|
@@ -291,28 +291,39 @@ export default {
|
|
|
callback();
|
|
|
};
|
|
|
var checkEduId = (rule, value, callback) => {
|
|
|
- const len = this.itemList.length;
|
|
|
- if (len > 1) {
|
|
|
- const len1 = this.itemList.filter(
|
|
|
- (e) => e.educationTypeId == -1
|
|
|
- ).length;
|
|
|
- if (len1 > 0 && len1 != len) {
|
|
|
- callback(new Error("需统一不限!"));
|
|
|
+ const { itemCategory } = this.itemList[rule.field.split(".")[1]];
|
|
|
+ if (this.itemList.length > 1) {
|
|
|
+ const levelList = this.itemList.filter(
|
|
|
+ (e) => e.itemCategory && e.itemCategory == itemCategory
|
|
|
+ );
|
|
|
+ const len = levelList.length;
|
|
|
+ if (len > 1) {
|
|
|
+ const len1 = levelList.filter((e) => e.educationTypeId == -1).length;
|
|
|
+ if (len1 > 0 && len1 != len) {
|
|
|
+ callback(new Error("需统一不限!"));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
callback();
|
|
|
};
|
|
|
var checkBusId = (rule, value, callback) => {
|
|
|
- const { educationTypeId } = this.itemList[rule.field.split(".")[1]];
|
|
|
+ const { educationTypeId, itemCategory } =
|
|
|
+ this.itemList[rule.field.split(".")[1]];
|
|
|
if (this.itemList.length > 1) {
|
|
|
- const flag = this.itemList.some(
|
|
|
- (e) => e.educationTypeId == educationTypeId && e.businessId == -1
|
|
|
+ const levelList = this.itemList.filter(
|
|
|
+ (e) =>
|
|
|
+ itemCategory &&
|
|
|
+ educationTypeId &&
|
|
|
+ e.educationTypeId == educationTypeId &&
|
|
|
+ e.itemCategory == itemCategory
|
|
|
);
|
|
|
- if (flag) {
|
|
|
- const flag1 = this.itemList.some(
|
|
|
- (e) => e.educationTypeId == educationTypeId && e.businessId != -1
|
|
|
- );
|
|
|
- flag1 && callback(new Error("需统一不限!"));
|
|
|
+ console.log(levelList, 666);
|
|
|
+ const len = levelList.length;
|
|
|
+ if (len > 1) {
|
|
|
+ const len1 = levelList.filter((e) => e.businessId == -1).length;
|
|
|
+ if (len1 > 0 && len1 != len) {
|
|
|
+ callback(new Error("需统一不限!"));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
callback();
|
|
@@ -520,7 +531,6 @@ export default {
|
|
|
return a.minValue - b.minValue;
|
|
|
});
|
|
|
for (let i = 0, len = list.length - 1; i < len; i++) {
|
|
|
- console.log(i, list);
|
|
|
if (list[i].maxValue >= list[i + 1].minValue) {
|
|
|
return "阶梯计价存在范围冲突";
|
|
|
}
|