Ver Fonte

fix: 客户管理新增能增加资质证书

liujt há 5 dias atrás
pai
commit
976b12ea09

+ 5 - 3
src/views/saleManage/contact/components/addContactDialog.vue

@@ -874,6 +874,7 @@
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import certificateManagement from '@/views/saleManage/contact/components/certificateManagement/index.vue';
   import { parameterGetByCode } from '@/api/main/index.js';
+  import { saveOrEdit } from '@/api/saleManage/contact';
   export default {
     props: {
       categoryTreeList: Array
@@ -1709,6 +1710,7 @@
             linkList: this.tableLinkData,
             productList: this.supplyList
           };
+          this.tableCertificateDataList = this.$refs.certificateManagementRef.getTableValue();
           if (this.isUpdate) {
             contactUpdate(data)
               .then((res) => {
@@ -1730,9 +1732,9 @@
                 this.loading = false;
                 this.$message.success('新增成功');
                 this.tableCertificateDataList.forEach((item) => {
-                  item['relationId'] = id;
-                  item['relationName'] = this.form.name;
-                  contactQcPackSaveAPI(item);
+                  item['holderId'] = id;
+                  item['holder'] = this.form.name;
+                  saveOrEdit(item);
                 });
 
                 if (type == 'sub') {

+ 1 - 1
src/views/saleManage/contact/components/certificateManagement/components/add-dialog.vue

@@ -311,7 +311,7 @@
           let productTable = this.$refs.productTableRef.getTableValue();
           data.categorys = productTable || [];
           if (!this.form.holderId) {
-            this.$emit('success', this.form);
+            this.$emit('success', data);
             this.close();
           } else {
             saveOrEdit(data)

+ 4 - 1
src/views/saleManage/contact/components/certificateManagement/index.vue

@@ -11,11 +11,11 @@
     <detailDialog ref="detailDialogRef" />
     <!-- 工具栏 -->
     <template v-slot:toolbar>
+      <!-- v-if="holderData.holderId" -->
       <el-button
         type="primary"
         icon="el-icon-plus"
         @click="handleUpload('add')"
-        v-if="holderData.holderId"
         >添加</el-button
       >
       <!-- <el-button type="primary" @click="handleUpload">导入</el-button> -->
@@ -263,6 +263,9 @@
       },
       openDetail(row) {
         this.$refs.detailDialogRef.open(row);
+      },
+      getTableValue() {
+        return this.tableList;
       }
     }
   };