Эх сурвалжийг харах

证书参建方重复检测

gangyj 2 жил өмнө
parent
commit
b687f212a1

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

@@ -207,6 +207,7 @@
             :disabled='!form.signPfxDeputieList[key].projectId'
             v-model="form.signPfxDeputieList[key].contractId"
             placeholder="请选择"
+            @change="checkRoleRepeat(key)"
           >
             <el-option
               v-for="item in form.signPfxDeputieList[key].contractList"
@@ -221,6 +222,7 @@
             style="width:300px;"
             v-model="form.signPfxDeputieList[key].roleId"
             placeholder="请选择参建方"
+            @change="checkRoleRepeat(key)"
           >
             <el-option
               v-for="item in ParticipationConstruction"
@@ -497,6 +499,27 @@ export default {
       }
     },
     //#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 () {
     this.init()