|
|
@@ -239,24 +239,49 @@
|
|
|
addMatter(matter) {
|
|
|
console.log('matter', matter);
|
|
|
const id = 'tem' + new Date().getTime();
|
|
|
+
|
|
|
+ const msgList = [];
|
|
|
+ const className = this.getDictValue(
|
|
|
+ '记录规则类型',
|
|
|
+ matter.recordRulesClassify
|
|
|
+ );
|
|
|
+
|
|
|
// 添加事项
|
|
|
this.currentRows.forEach((task) => {
|
|
|
- this.matterList.push({
|
|
|
- ...matter,
|
|
|
- id: id + task.id,
|
|
|
- produceTaskId: task.id,
|
|
|
- produceTaskName: task.name,
|
|
|
- reportWorkType: this.reportWorkType
|
|
|
- });
|
|
|
- this.addPOs.push({
|
|
|
- ...matter,
|
|
|
- id: id + task.id,
|
|
|
- produceTaskId: task.id,
|
|
|
- produceTaskName: task.name,
|
|
|
- reportWorkType: this.reportWorkType
|
|
|
- });
|
|
|
+ // 判断是否存在同一分类
|
|
|
+ const exists = this.matterList
|
|
|
+ .filter((item) => item.reportWorkType == this.reportWorkType)
|
|
|
+ .some(
|
|
|
+ (item) =>
|
|
|
+ item.recordRulesClassify == matter.recordRulesClassify &&
|
|
|
+ task.id == item.produceTaskId
|
|
|
+ );
|
|
|
+
|
|
|
+ if (!exists) {
|
|
|
+ this.matterList.push({
|
|
|
+ ...matter,
|
|
|
+ id: id + task.id,
|
|
|
+ produceTaskId: task.id,
|
|
|
+ produceTaskName: task.name,
|
|
|
+ reportWorkType: this.reportWorkType
|
|
|
+ });
|
|
|
+ this.addPOs.push({
|
|
|
+ ...matter,
|
|
|
+ id: id + task.id,
|
|
|
+ produceTaskId: task.id,
|
|
|
+ produceTaskName: task.name,
|
|
|
+ reportWorkType: this.reportWorkType
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 记录重复信息
|
|
|
+ msgList.push({ taskName: task.name });
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
+ if (msgList.length > 0) {
|
|
|
+ this.$message.warning(`部分工序已存在该分类规则:${className}`);
|
|
|
+ }
|
|
|
+
|
|
|
this.handleSort();
|
|
|
},
|
|
|
editMatter(matter) {
|