Pārlūkot izejas kodu

feat(客户管理): 客户管理页面优化

qihao 2 gadi atpakaļ
vecāks
revīzija
790ae6aa1f

+ 21 - 14
src/views/saleManage/contact/components/addContactDialog.vue

@@ -13,7 +13,7 @@
       <el-tab-pane label="基本信息" name="base">
         <el-form
           label-width="100px"
-          ref="formRef"
+          ref="form"
           :model="form"
           :rules="rules"
           style="margin-top: 30px"
@@ -706,24 +706,19 @@ export default {
         }
       },
       async save() {
-
-        const data1 = {
-          base: this.form,
-          other: this.otherForm,
-          bankList: this.tableBankData,
-          linkList: this.tableLinkData
-        };
-        console.log("data1", data1);
-        return;
-
-
         const isBaseValid = await this.$refs.form.validate();
-        const isOtherValid = await this.$refs.form.validate();
-        if (!isBaseValid || !isOtherValid) {
+        const isOtherValid = await this.$refs.otherForm.validate();
+        if (!isBaseValid) {
+          this.activeName = 'base';
+          return false;
+        }
+        if (!isOtherValid) {
+          this.activeName = 'other';
           return false;
         }
         if(this.tableLinkData && this.tableLinkData.length === 0){
           this.$message.error("联系人信息至少有1条");
+          this.activeName = 'link';
           return false;
         }
 
@@ -734,6 +729,9 @@ export default {
           if (node) {
             this.form.addressId = node.path.join();
             this.form.addressName = node.pathLabels.join();
+          } else {
+            this.form.addressId = '';
+            this.form.addressName = '';
           }
         }
         if (this.$refs.industry.getCheckedNodes()) {
@@ -741,6 +739,9 @@ export default {
           if (node) {
             this.form.industryCode = node.path.join();
             this.form.industryFullName = node.pathLabels.join();
+          } else {
+            this.form.industryCode = '';
+            this.form.industryFullName = '';
           }
         }
         if (this.form.companyCategoryId) {
@@ -751,6 +752,8 @@ export default {
         }
         if(this.form.businessLicenseFiles && this.form.businessLicenseFiles.length > 0){
           this.form.businessLicenseFile = this.form.businessLicenseFiles[0];
+        } else {
+          this.form.businessLicenseFile = null;
         }
 
         // 其他信息处理
@@ -765,6 +768,9 @@ export default {
           if (node) {
             this.otherForm.addressId = node.path.join();
             this.otherForm.addressName = node.pathLabels.join();
+          } else {
+            this.otherForm.addressId = '';
+            this.otherForm.addressName = '';
           }
         }
 
@@ -806,6 +812,7 @@ export default {
       },
       cancel() {
         this.$nextTick(() => {
+          this.activeName = 'base';
           // 关闭后,销毁所有的表单数据
           this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
           this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();

+ 1 - 1
src/views/saleManage/contact/components/contactDetailDialog.vue

@@ -204,7 +204,7 @@
       <el-tab-pane label="其他信息" name="other">
         <el-form
           label-width="160px"
-          ref="otherForm"
+          ref="otherFormRef"
           :model="otherForm"
           style="margin-top: 30px"
         >

+ 6 - 4
src/views/saleManage/contact/index.vue

@@ -42,9 +42,11 @@
                   新建
                 </el-button>
               </template>
-              <template v-slot:code="{ row }">
-                <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.code }}</el-link>
+
+              <template v-slot:name="{ row }">
+                <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.name }}</el-link>
               </template>
+
               <!-- 操作列 -->
               <template v-slot:action="{ row }">
                 <el-link
@@ -137,7 +139,6 @@ export default {
             prop: 'code',
             label: '客户编码',
             align: 'center',
-            slot: 'code',
             showOverflowTooltip: true,
             minWidth: 140
           },
@@ -145,8 +146,9 @@ export default {
             prop: 'name',
             label: '客户名称',
             align: 'center',
+            slot: 'name',
             showOverflowTooltip: true,
-            minWidth: 150
+            minWidth: 200
           },
           {
             prop: 'serialNo',