Selaa lähdekoodia

feature_20260128_公装双包客户&三大渠道标签

zhujindu 1 viikko sitten
vanhempi
commit
d8f4df2f61

+ 18 - 0
src/api/storeManagement.js

@@ -17,3 +17,21 @@ export function updateArchives(data) {
     data,
   });
 }
+
+// 根据门店编码获取公装经销商拜访标签信息接口
+export function getGzVisitLabel(query) {
+  return request({
+    url: '/mobile/store/getGzVisitLabel',
+    method: 'get',
+    params: query,
+  });
+}
+
+// 修改公装拜访标签信息接口
+export function updateVisitLabel(data) {
+  return request({
+    url: 'mobile/store/updateVisitLabel',
+    method: 'post',
+    data,
+  });
+}

+ 61 - 0
src/views/deviceOutside/index.vue

@@ -85,6 +85,67 @@
               <div class="info" style="position: relative">
                 联系人:{{ item.contactName }}
                 <div style="position: absolute; bottom: 0px; right: 0px">
+                  <!-- 是否双包客户 -->
+                  <el-popover
+                    popper-class="zpover"
+                    placement="bottom"
+                    width="120"
+                    trigger="click"
+                    :content="item.storeLabels.doubleCustomer">
+                    <div
+                      v-if="item.storeLabels.doubleCustomer"
+                      class="visitStoreIco"
+                      style="background-color: #fff"
+                      slot="reference">
+                      <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
+                    </div>
+                  </el-popover>
+                  <!-- 工企标签 -->
+                  <el-popover
+                    popper-class="zpover"
+                    placement="bottom"
+                    width="120"
+                    trigger="click"
+                    :content="item.storeLabels.industrialEnterprises">
+                    <div
+                      v-if="item.storeLabels.industrialEnterprises"
+                      class="visitStoreIco"
+                      style="background-color: #fff"
+                      slot="reference">
+                      <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
+                    </div>
+                  </el-popover>
+                  <!-- 商住标签 -->
+                  <el-popover
+                    popper-class="zpover"
+                    placement="bottom"
+                    width="120"
+                    trigger="click"
+                    :content="item.storeLabels.commercialResidential">
+                    <div
+                      v-if="item.storeLabels.commercialResidential"
+                      class="visitStoreIco"
+                      style="background-color: #fff"
+                      slot="reference">
+                      <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
+                    </div>
+                  </el-popover>
+                  <!-- 市政工程标签 -->
+                  <el-popover
+                    popper-class="zpover"
+                    placement="bottom"
+                    width="120"
+                    trigger="click"
+                    :content="item.storeLabels.municipalEngineering">
+                    <div
+                      v-if="item.storeLabels.municipalEngineering"
+                      class="visitStoreIco"
+                      style="background-color: #fff"
+                      slot="reference">
+                      <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
+                    </div>
+                  </el-popover>
+
                   <!-- 凤凰客户 -->
                   <el-popover
                     popper-class="zpover"

+ 26 - 18
src/views/storeManagement/GZattributeDetail.vue

@@ -1,36 +1,44 @@
 <template>
-  <div class="GzStore">
-    <van-field readonly v-model="storeArchives.doubleContracting" label="是否双包客户" />
+  <div class="GzStore" v-if="detail">
+    <van-field readonly v-model="detail.doubleCustomer" label="是否双包客户" />
     <van-field
-      v-if="storeArchives.doubleContracting == '是'"
+      v-if="detail.doubleCustomer == '是'"
       readonly
       autosize
       type="textarea"
-      v-model="storeArchives.mainProductCategorys"
+      v-model="detail.customerType"
       label="客户类型" />
-    <van-field readonly v-model="storeArchives.doubleContracting" label="是否三大渠道" />
-    <van-field
-      v-if="storeArchives.doubleContracting == '是'"
-      readonly
-      autosize
-      type="textarea"
-      v-model="storeArchives.mainProductCategorys"
-      label="渠道类型" />
+    <van-field readonly autosize type="textarea" v-model="detail.channelType" label="渠道类型" />
   </div>
 </template>
 <script>
+import { getGzVisitLabel } from '@/api/storeManagement';
 export default {
   props: {
-    storeArchives: {
-      type: Object,
-      default: () => {},
+    storeCode: {
+      type: [String, Number],
     },
   },
   data() {
-    return {};
+    return {
+      detail: null,
+    };
+  },
+  created() {
+    this.detail = null;
+    this.getDetaild();
+  },
+  activated() {
+    this.detail = null;
+    this.getDetaild();
+  },
+  methods: {
+    getDetaild() {
+      getGzVisitLabel({ storeCode: this.storeCode }).then((res) => {
+        this.detail = res.data;
+      });
+    },
   },
-  activated() {},
-  methods: {},
 };
 </script>
 <style scoped lang="scss">

+ 58 - 44
src/views/storeManagement/GZattributeEditor.vue

@@ -2,25 +2,34 @@
   <div class="GZattributeEditor">
     <van-nav-bar class="navBar" title="公装经销商编辑" left-arrow @click-left="onClickLeft" />
     <div class="content" v-if="detail">
-      <van-form ref="tabstoreVal">
-        <van-field label="是否双包客户">
+      <van-form ref="tabstoreVal" @submit="onSubmit">
+        <van-field
+          label="是否双包客户"
+          :rules="[{ required: true, message: '请选择是否双包客户' }]">
+          <template #left-icon>
+            <span class="van-f-red">*</span>
+          </template>
           <template #input>
-            <van-radio-group v-model="detail.doubleContracting" direction="horizontal">
+            <van-radio-group v-model="detail.doubleCustomer" direction="horizontal">
               <van-radio name="是">是</van-radio>
               <van-radio name="否">否</van-radio>
             </van-radio-group>
           </template>
         </van-field>
         <van-field
-          v-if="detail.doubleContracting == '是'"
+          v-if="detail.doubleCustomer == '是'"
+          :rules="[{ required: true, message: '请选择客户类型' }]"
           autosize
           type="textarea"
           label="客户类型">
+          <template #left-icon>
+            <span class="van-f-red">*</span>
+          </template>
           <template #input>
-            <van-checkbox-group v-model="detail.mainProductCategorys" direction="horizontal">
+            <van-checkbox-group v-model="detail.customerType" direction="horizontal">
               <van-checkbox
-                v-for="(item, index) in mainProductCategorys"
-                :name="item.dictValue"
+                v-for="(item, index) in doubleustomer"
+                :name="item.dictLabel"
                 shape="square"
                 :key="index">
                 {{ item.dictValue }}
@@ -28,29 +37,23 @@
             </van-checkbox-group>
           </template>
         </van-field>
-        <van-field label="是否三大渠道">
-          <template #input>
-            <van-radio-group v-model="detail.doubleContracting" direction="horizontal">
-              <van-radio name="是">是</van-radio>
-              <van-radio name="否">否</van-radio>
-            </van-radio-group>
-          </template>
-        </van-field>
         <van-field
-          v-if="detail.doubleContracting == '是'"
           autosize
           type="textarea"
-          label="渠道类型">
+          label="渠道类型"
+          :rules="[{ required: true, message: '请选择渠道类型' }]">
+          <template #left-icon>
+            <span class="van-f-red">*</span>
+          </template>
           <template #input>
-            <van-checkbox-group v-model="detail.mainProductCategorys" direction="horizontal">
-              <van-checkbox
-                v-for="(item, index) in mainProductCategorys"
-                :name="item.dictValue"
-                shape="square"
+            <van-radio-group v-model="detail.channelType" direction="horizontal">
+              <van-radio
+                v-for="(item, index) in channelTypeArr"
+                :name="item.dictLabel"
                 :key="index">
                 {{ item.dictValue }}
-              </van-checkbox>
-            </van-checkbox-group>
+              </van-radio>
+            </van-radio-group>
           </template>
         </van-field>
       </van-form>
@@ -66,49 +69,60 @@
 </template>
 
 <script>
-import { sendAndCheckVerCode, getDictOption } from '@/api/index';
-import { getStoreArchives, updateArchives } from '@/api/storeManagement';
+import { getDictOption } from '@/api/index';
+import { getGzVisitLabel, updateVisitLabel } from '@/api/storeManagement';
 export default {
   name: 'GZattributeEditor',
   data() {
-    return {};
+    return {
+      detail: null,
+      channelTypeArr: [],
+      doubleustomer: [],
+    };
   },
   activated() {
+    this.detail = null;
     this.toastLoading(0, '加载中...', true);
-    Promise.all([this.getDictOptionFun('gz_visit_label_channel_type')]).then((res) => {
-      debugger;
+    // 公装拜访标签渠道类型:gz_visit_label_channel_type 公装拜访标签双包客户:gz_visit_label_double_customer
+    Promise.all([
+      this.getDictOptionFun('gz_visit_label_channel_type'),
+      this.getDictOptionFun('gz_visit_label_double_customer'),
+    ]).then((res) => {
+      this.channelTypeArr = res[0];
+      this.doubleustomer = res[1];
+      console.log(this.doubleustomer);
+      this.getDetaild();
     });
   },
   methods: {
     getDictOptionFun(type) {
-      getDictOption({}, type).then((res) => {});
+      return new Promise((resolve, reject) => {
+        getDictOption({}, type).then((res) => {
+          resolve(res.data);
+        });
+      });
     },
     getDetaild() {
-      getStoreArchives({ storeCode: this.$route.query.storeCode }).then((res) => {
+      getGzVisitLabel({ storeCode: this.$route.query.storeCode }).then((res) => {
         this.toastLoading().clear();
         if (res.code == 200) {
-          //   let copyData = JSON.parse(JSON.stringify(res.data));
-          res.data.mainProductCategorys = res.data.mainProductCategorys
-            ? res.data.mainProductCategorys.split(',')
-            : [];
+          res.data.customerType = res.data.customerType ? res.data.customerType.split(',') : [];
           this.detail = res.data;
-          this.mobileStatus = res.data.mobileStatus;
-          // mobileStatus  是否验证通过 1,2是
-          if (res.data.mobileStatus == '1' || res.data.mobileStatus == '2') {
-            this.verificationPassedPhoneNum = this.detail.ownerMobile;
-          }
-          // 验证码和发送按钮是否显示
-          this.verifyMobile = this.mobileStatus == '0' ? false : true;
         }
       });
     },
     // 保存
     confirmShare() {
+      this.$refs.tabstoreVal.submit();
+    },
+    onSubmit(value) {
       this.toastLoading(0, '加载中...', true);
       let params = JSON.parse(JSON.stringify(this.detail));
-      params.mainProductCategorys = params.mainProductCategorys.join(',');
+      params.customerType = params.customerType.join(',');
       params.storeCode = this.$route.query.storeCode;
-      updateArchives(params).then((res) => {
+      params.chainCode = this.$route.query.chainCode;
+      if (params.doubleCustomer == '否') params.customerType = '';
+      updateVisitLabel(params).then((res) => {
         this.toastLoading().clear();
         if (res.code == 200) {
           this.$toast(res.msg);

+ 5 - 4
src/views/storeManagement/storeDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="storeDetail">
-    <div class="navBarTOP">
+    <div class="navBarTOP" v-if="list">
       <!-- 顶部条 -->
       <van-nav-bar class="navBar" title="客户详情" left-arrow @click-left="onClickLeft">
         <template #right>
@@ -337,7 +337,7 @@
         </van-tab>
         <!-- 公装经销商 -->
         <van-tab title="客户标签" name="outsidePlan" v-if="list.storeCategory == 'C108'">
-          <GZattributeDetail :storeArchives="list.storeArchives"></GZattributeDetail>
+          <GZattributeDetail :storeCode="list.storeCode"></GZattributeDetail>
         </van-tab>
         <van-tab title="属性信息" name="outsidePlan" v-else>
           <!-- 金牌店档案信息 -->
@@ -603,7 +603,7 @@ export default {
       tabVal: 'insidePlan',
       showDialog: false,
       msgList: '',
-      list: [],
+      list: {},
       provinceList: [],
       txmapimg1: txmapimg1,
       txmapimg2: txmapimg2,
@@ -683,6 +683,7 @@ export default {
     },
   },
   activated() {
+    this.list = {};
     this.cityABStore = false;
     // 下单成功后点击上传陈列照直接跳转到编辑页面
     let id = localStorage.getItem('successStoreId');
@@ -1664,7 +1665,7 @@ export default {
         // 公装经销商
         this.$router.push({
           path: '/GZattributeEditor',
-          query: { storeCode: this.list.storeCode },
+          query: { storeCode: this.list.storeCode, chainCode: this.list.chainCode },
         });
       } else {
         // 金牌店属性编辑