Преглед на файлове

解决新增证书无法显示合同段及详情页合同段回显问题

huangjn преди 3 години
родител
ревизия
1cb363d05f
променени са 1 файла, в които са добавени 27 реда и са изтрити 7 реда
  1. 27 7
      src/views/certificate/lists/addList.vue

+ 27 - 7
src/views/certificate/lists/addList.vue

@@ -208,7 +208,7 @@
             placeholder="请选择"
           >
             <el-option
-              v-for="item in ContractSection[key]"
+              v-for="item in form.signPfxDeputieList[key].contractList"
               :key="item.id"
               :label="item.name"
               :value="item.id"
@@ -381,16 +381,25 @@ export default {
       this.form.signatureFileUrl = [file]
     },
     pushSignPfxDeputieList () {//添加关联项目
-      this.form.signPfxDeputieList.unshift({
+      // this.form.signPfxDeputieList.unshift({
+      //   projectId: '',
+      //   contractId: '',
+      //   roleId: '',
+      // })
+
+      this.form.signPfxDeputieList.push({
         projectId: '',
         contractId: '',
         roleId: '',
+        contractList: []
       })
+
     },
     focusContractSection (projectId, key) {//获取合同段数据
       this.projectMeiju.forEach(val => {
         if (val.id == projectId) {
-          this.ContractSection[key] = val.contractInfoList
+          // this.ContractSection[key] = val.contractInfoList
+          this.form.signPfxDeputieList[key].contractList = val.contractInfoList
         }
       })
     },
@@ -436,10 +445,21 @@ export default {
       console.log(res);
       if (res.code == 200) {
         this.projectMeiju = res.data
-        this.form.signPfxDeputieList.forEach((val, key) => {
-          this.ContractSection.push(res.data[key].contractInfoList)
-        })
-        console.log(this.ContractSection);
+        // this.form.signPfxDeputieList.forEach((val, key) => {
+        //   this.ContractSection.push(res.data[key].contractInfoList)
+        // })
+
+        if(this.form.signPfxDeputieList.length > 0){
+            this.form.signPfxDeputieList.forEach((val, key) => {
+              this.projectMeiju.forEach((project, key) => {
+                if(val.projectId == project.id){
+                  val.contractList = project.contractInfoList;
+                }
+              })
+            })
+        }
+
+        console.log(this.form.signPfxDeputieList);
       }
     },
     async findPfxType () {