|
|
@@ -155,7 +155,7 @@
|
|
|
ref="cycleMultipleRef"
|
|
|
:formData="formData"
|
|
|
:pageType="type"
|
|
|
- :disabled="type == 'processEdit'"
|
|
|
+ :isBindPlan="type == 'processEdit'"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -671,6 +671,10 @@
|
|
|
);
|
|
|
|
|
|
this.formData.executeMethodTitle = value;
|
|
|
+
|
|
|
+ if (!value) {
|
|
|
+ this.$message.warning('执行方式不能为空!');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -795,24 +799,28 @@
|
|
|
|
|
|
console.log('this.formData', this.formData);
|
|
|
},
|
|
|
+ // 过程监测 修改规则详情
|
|
|
async processEditSetValue(row) {
|
|
|
const data = await recordrulesGetById(row.rulesId);
|
|
|
|
|
|
const info = JSON.parse(JSON.stringify(row));
|
|
|
- if (data.isExecuteMethod) {
|
|
|
- data.executeMethodList = produceTaskConfigRuleDetails.map((i) => {
|
|
|
- return i.executeMethodTitle;
|
|
|
- });
|
|
|
+ data.executeMethodList = info.produceTaskConfigRuleDetails.map((i) => {
|
|
|
+ return i.executeMethodTitle;
|
|
|
+ });
|
|
|
+ // 去重
|
|
|
+ data.executeMethodList = [...new Set(data.executeMethodList)];
|
|
|
|
|
|
- data.details = produceTaskConfigRuleDetails;
|
|
|
+ data.details = info.produceTaskConfigRuleDetails;
|
|
|
+ if (data.executeMethodList.length) {
|
|
|
data.executeMethodTitle = data.executeMethodList[0] || '';
|
|
|
} else {
|
|
|
- data.executeMethodList = [];
|
|
|
- data.details = info.produceTaskConfigRuleDetails || [];
|
|
|
data.executeMethodTitle = '';
|
|
|
}
|
|
|
|
|
|
this.$util.assignObject(this.formData, data);
|
|
|
+ if (data.executeMethodList.length) {
|
|
|
+ this.formData.isExecuteMethod = 1;
|
|
|
+ }
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.cycleMultipleRef?.setRecordRulesCycleList(
|
|
|
@@ -834,25 +842,10 @@
|
|
|
|
|
|
if (data.isExecuteMethod) {
|
|
|
data.executeMethodList = Object.keys(data.detailMap).map((i) => {
|
|
|
- return i === '' ? '无执行方式' : i;
|
|
|
+ return i;
|
|
|
});
|
|
|
|
|
|
- if (data.executeMethodList.includes('无执行方式')) {
|
|
|
- // 将无执行方式 放到第一个
|
|
|
- data.executeMethodList = data.executeMethodList.filter(
|
|
|
- (i) => i !== '无执行方式'
|
|
|
- );
|
|
|
- data.executeMethodList.unshift('无执行方式');
|
|
|
- }
|
|
|
-
|
|
|
- data.details = Object.values(data.detailMap)
|
|
|
- .flat()
|
|
|
- .map((i) => {
|
|
|
- if (i.executeMethodTitle == '') {
|
|
|
- i.executeMethodTitle = '无执行方式';
|
|
|
- }
|
|
|
- return i;
|
|
|
- });
|
|
|
+ data.details = Object.values(data.detailMap).flat();
|
|
|
data.executeMethodTitle = data.executeMethodList[0] || '';
|
|
|
} else {
|
|
|
data.executeMethodList = [];
|
|
|
@@ -935,10 +928,14 @@
|
|
|
}
|
|
|
|
|
|
for (const item of this.formData.executeMethodList) {
|
|
|
+ if (!item) {
|
|
|
+ return this.$message.warning(`执行方式不能为空!`);
|
|
|
+ }
|
|
|
+
|
|
|
const exists = this.formData.details.some(
|
|
|
(detail) => detail.executeMethodTitle === item
|
|
|
);
|
|
|
- if (!exists && item != '无执行方式') {
|
|
|
+ if (!exists) {
|
|
|
this.$message.warning(
|
|
|
`请为执行方式 "${item}" 添加至少一条规则项`
|
|
|
);
|
|
|
@@ -991,6 +988,10 @@
|
|
|
}
|
|
|
|
|
|
for (const item of this.formData.executeMethodList) {
|
|
|
+ if (!item) {
|
|
|
+ return this.$message.warning(`执行方式不能为空!`);
|
|
|
+ }
|
|
|
+
|
|
|
const exists = this.formData.details.some(
|
|
|
(detail) => detail.executeMethodTitle === item
|
|
|
);
|
|
|
@@ -1229,9 +1230,20 @@
|
|
|
addExecuteMethod() {
|
|
|
this.$prompt('', '请输入执行方式', {
|
|
|
confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消'
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ inputValidator(value) {
|
|
|
+ if (!value) {
|
|
|
+ return '执行方式不能为空!';
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
})
|
|
|
.then(({ value }) => {
|
|
|
+ console.log('value', value);
|
|
|
+ if (!value) {
|
|
|
+ return this.$message.warning('执行方式不能为空!');
|
|
|
+ }
|
|
|
+
|
|
|
if (this.formData.executeMethodList.includes(value)) {
|
|
|
return this.$message.warning('执行方式已存在!');
|
|
|
}
|
|
|
@@ -1242,7 +1254,9 @@
|
|
|
this.formData.executeMethodTitle = value;
|
|
|
}
|
|
|
})
|
|
|
- .catch((err) => {});
|
|
|
+ .catch((err) => {
|
|
|
+ console.log('取消输入执行方式', err);
|
|
|
+ });
|
|
|
},
|
|
|
// 删除执行方式
|
|
|
deleteExecuteMethod(item) {
|
|
|
@@ -1264,9 +1278,10 @@
|
|
|
this.formData.details = this.formData.details.map((i) => {
|
|
|
return {
|
|
|
...i,
|
|
|
- executeMethodTitle: '无执行方式'
|
|
|
+ executeMethodTitle: ''
|
|
|
};
|
|
|
});
|
|
|
+ this.formData.executeMethodList = [];
|
|
|
} else {
|
|
|
if (this.formData.executeMethodList.length == 0) {
|
|
|
// 添加一个默认执行方式
|
|
|
@@ -1302,6 +1317,10 @@
|
|
|
}
|
|
|
|
|
|
for (const item of this.formData.executeMethodList) {
|
|
|
+ if (!item) {
|
|
|
+ return this.$message.warning(`执行方式不能为空!`);
|
|
|
+ }
|
|
|
+
|
|
|
const exists = this.formData.details.some(
|
|
|
(detail) => detail.executeMethodTitle === item
|
|
|
);
|