Browse Source

增加是否负责人

liyuan 5 days ago
parent
commit
78f1126bb2
1 changed files with 38 additions and 5 deletions
  1. 38 5
      src/views/store/detailsPage.vue

+ 38 - 5
src/views/store/detailsPage.vue

@@ -140,6 +140,14 @@
               >录入明细
             </el-button>
           </template>
+            <template slot="master" slot-scope="{ row }">
+<!--                <el-switch
+                    v-model="row.master"
+                    disabled
+                    active-color="#13ce66">
+                </el-switch>-->
+                <i class="el-icon-check large-icon" v-if="row.master"></i>
+            </template>
           <template slot-scope="{ type, size, row, disabled, index }" slot="menu">
             <el-button
               :size="size"
@@ -747,11 +755,13 @@ export default {
               },
             ],
           },
-          // {
-          //   label: "登录用户id",
-          //   prop: "userId",
-          //   cell: true
-          // },
+          {
+            label: "负责人",
+            prop: "master",
+            cell: true,
+              addDisplay:false,
+              editDisplay:false
+          },
           {
             label: "备注",
             prop: "remarks",
@@ -1024,6 +1034,9 @@ export default {
           this.data = res.data.data.corpsAddrList;
           this.corpsFiles = res.data.data.corpsFilesList;
           this.contactsData = res.data.data.corpsAttnList;
+            for (let contact of this.contactsData) {
+                contact.master = contact.tel === res.data.data.tel
+            }
           this.form = res.data.data;
         })
         .finally(() => {
@@ -1127,6 +1140,20 @@ export default {
           if (this.corpsFiles.filter((item) => item.mainImage == 1).length == 0) {
             this.corpsFiles[0].mainImage = 1;
           }
+            let telData = this.contactsData.find(e => String(e.tel) === String(this.form.tel))
+            console.info('this.contactsData---', this.contactsData)
+            console.info('this.form.tel---', this.form.tel)
+            console.info('telData---', telData)
+            if (!telData) {
+                this.contactsData.push({
+                    tel: this.form.tel,
+                    cname: '门店负责人',
+                    master: true
+                })
+            }
+            for (let contact of this.contactsData) {
+                contact.master = contact.tel === this.form.tel
+            }
           this.loadingBtn = true;
           submit({
             ...this.form,
@@ -1188,10 +1215,12 @@ export default {
       if (this.data.length == 1) {
         this.$set(row, "defaultAddres", "1");
       }
+        row.master = false
       done(row);
     },
     //修改客户联系人触发
     rowUpdate(row, index, done, loading) {
+        row.master = false
       done(row);
     },
     //删除客户联系人触发
@@ -1287,4 +1316,8 @@ export default {
     height: 45px;
 }
 
+.large-icon {
+    font-size: 18px !important;
+}
+
 </style>