瀏覽代碼

证书参建方重复检测

gangyj 2 年之前
父節點
當前提交
b687f212a1
共有 1 個文件被更改,包括 23 次插入0 次删除
  1. 23 0
      src/views/certificate/lists/addList.vue

+ 23 - 0
src/views/certificate/lists/addList.vue

@@ -207,6 +207,7 @@
             :disabled='!form.signPfxDeputieList[key].projectId'
             :disabled='!form.signPfxDeputieList[key].projectId'
             v-model="form.signPfxDeputieList[key].contractId"
             v-model="form.signPfxDeputieList[key].contractId"
             placeholder="请选择"
             placeholder="请选择"
+            @change="checkRoleRepeat(key)"
           >
           >
             <el-option
             <el-option
               v-for="item in form.signPfxDeputieList[key].contractList"
               v-for="item in form.signPfxDeputieList[key].contractList"
@@ -221,6 +222,7 @@
             style="width:300px;"
             style="width:300px;"
             v-model="form.signPfxDeputieList[key].roleId"
             v-model="form.signPfxDeputieList[key].roleId"
             placeholder="请选择参建方"
             placeholder="请选择参建方"
+            @change="checkRoleRepeat(key)"
           >
           >
             <el-option
             <el-option
               v-for="item in ParticipationConstruction"
               v-for="item in ParticipationConstruction"
@@ -497,6 +499,27 @@ export default {
       }
       }
     },
     },
     //#endregion
     //#endregion
+
+    //检测参建方是否重复
+    checkRoleRepeat(index){
+      let cur = this.form.signPfxDeputieList[index];
+      if(!cur.roleId){
+        return;
+      }
+
+      this.form.signPfxDeputieList.forEach((info,i)=>{
+        if(i === index){
+          return;
+        }
+        if(info.contractId == cur.contractId && info.roleId == cur.roleId){
+          this.$message({
+            message: "关联的项目参见方不可重复",
+            type: 'error'
+          });
+          this.form.signPfxDeputieList[index].roleId = '';
+        }
+      })
+    }
   },
   },
   created () {
   created () {
     this.init()
     this.init()