|
|
@@ -277,12 +277,13 @@
|
|
|
indicator: '',
|
|
|
indicatorName: '',
|
|
|
businessType: '',
|
|
|
+ businessName: '',
|
|
|
remark: '',
|
|
|
// 条件
|
|
|
groups: [],
|
|
|
createUserName: '',
|
|
|
updateUserName: '',
|
|
|
- enable: 0,
|
|
|
+ enable: 1,
|
|
|
code: ''
|
|
|
};
|
|
|
|
|
|
@@ -295,7 +296,7 @@
|
|
|
createUserName: '',
|
|
|
groupId: 0,
|
|
|
indicatorId: null,
|
|
|
- logicOperator: '',
|
|
|
+ logicOperator: 'and',
|
|
|
sortNum: 0,
|
|
|
tableName: '',
|
|
|
fixedCondition: null,
|
|
|
@@ -318,11 +319,11 @@
|
|
|
operatorOptions: [
|
|
|
{
|
|
|
name: '属于',
|
|
|
- value: '1'
|
|
|
+ value: 1
|
|
|
},
|
|
|
{
|
|
|
name: '不属于',
|
|
|
- value: '2'
|
|
|
+ value: 2
|
|
|
}
|
|
|
],
|
|
|
rules: {
|
|
|
@@ -399,21 +400,38 @@
|
|
|
if (this.form.businessType === '' || this.form.indicator === '') {
|
|
|
return this.$message.warning('请先选择业务类型和考核指标');
|
|
|
}
|
|
|
+
|
|
|
+ const maxSortNum = this.form.groups.reduce((max, group) => {
|
|
|
+ return group.sortNum > max ? group.sortNum : max;
|
|
|
+ }, 0);
|
|
|
+
|
|
|
this.form.groups.push({
|
|
|
- conditions: [{ ...JSON.parse(JSON.stringify(conditionsItem)) }],
|
|
|
+ conditions: [{ ...this.newConditionsItem() }],
|
|
|
createUserName: this.user.info.name,
|
|
|
indicatorId: null,
|
|
|
logicOperator: 'or',
|
|
|
- sortNum: 0,
|
|
|
+ sortNum: maxSortNum + 1,
|
|
|
updateUserName: ''
|
|
|
});
|
|
|
},
|
|
|
// 添加子条件
|
|
|
addItem(item) {
|
|
|
+ const conditionsItem = this.newConditionsItem();
|
|
|
+ conditionsItem.createUserName = this.user.info.name;
|
|
|
+
|
|
|
+ const maxSortNum = item.conditions.reduce((max, condition) => {
|
|
|
+ return condition.sortNum > max ? condition.sortNum : max;
|
|
|
+ }, 0);
|
|
|
+
|
|
|
+ conditionsItem.sortNum = maxSortNum + 1;
|
|
|
+
|
|
|
item.conditions.push({
|
|
|
- ...JSON.parse(JSON.stringify(conditionsItem))
|
|
|
+ ...conditionsItem
|
|
|
});
|
|
|
},
|
|
|
+ newConditionsItem() {
|
|
|
+ return JSON.parse(JSON.stringify(conditionsItem));
|
|
|
+ },
|
|
|
handleSave(flag) {
|
|
|
console.log('this.form', this.form);
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
@@ -543,6 +561,10 @@
|
|
|
},
|
|
|
// 业务类型修改 同步考核指标名称 和 清空条件
|
|
|
businessTypeChange() {
|
|
|
+ const item = this.allEnable.find(
|
|
|
+ (el) => el.businessType == this.form.businessType
|
|
|
+ );
|
|
|
+ this.form.businessName = item?.businessName || '';
|
|
|
this.form.indicator = '';
|
|
|
this.form.indicatorName = '';
|
|
|
// 清空条件
|