ソースを参照

Merge branch 'feature_20250205_重复门店经销商维护' into release

zhujindu 9 ヶ月 前
コミット
65be26b002

+ 18 - 0
src/api/store.js

@@ -9,3 +9,21 @@ export function listChainsByCategory(query) {
     params: query,
   });
 }
+
+// 门店~扩展经销商(经销商人员)
+export function addStoreChainContact(data) {
+  return request({
+    url: 'mobile/store/addStoreChainContact',
+    method: 'post',
+    data,
+  });
+}
+
+// 新增门店前校验门店是否重复接口
+export function checkStoreBeforeAdd(data) {
+  return request({
+    url: 'mobile/store/checkStoreBeforeAdd',
+    method: 'post',
+    data,
+  });
+}

+ 5 - 0
src/router/index.js

@@ -121,6 +121,11 @@ const router = new VueRouter({
           name: 'success',
           component: () => import('@/views/storeManagement/success.vue'),
         },
+        {
+          path: '/chainMaintain',
+          name: 'chainMaintain',
+          component: () => import('@/views/storeManagement/chainMaintain.vue'),
+        },
       ],
     },
     {

+ 1 - 3
src/store/modules/user.js

@@ -15,9 +15,6 @@ const user = {
     SET_ACTIVA_TYPE_STORE: (state, value) => {
       state.activaTypeStore = value;
     },
-    SET_ASSIGN_FLAG: (state, value) => {
-      state.isAssignFlag = value;
-    },
     SET_STORE_TYPE: (state, value) => {
       state.storeType = value;
     },
@@ -39,6 +36,7 @@ const user = {
             localStorage.setItem('deptLevel', res.data.depts[0].deptLevel);
             localStorage.setItem('userId', res.data.userId);
             localStorage.setItem('deptIds', JSON.stringify(res.data.deptIds));
+            localStorage.setItem('chainUser', res.data.chainUser); //是否经销商用户 true
             // 门店类型
             getDictOption({}, 'sfa_store_type').then((res) => {
               commit('SET_STORE_TYPE', res.data);

ファイルの差分が大きいため隠しています
+ 1177 - 0
src/views/storeManagement/chainMaintain.vue


+ 35 - 13
src/views/storeManagement/storeAdd.vue

@@ -715,7 +715,7 @@ import txmapimg1 from '@/assets/txmap1.svg';
 import txmapimg2 from '@/assets/txmap2.svg';
 import txmapimg3 from '@/assets/marker_blue.png';
 import { getPosition, getTicketFun } from '@/utils/TXApiFun';
-import { listChainsByCategory } from '@/api/store';
+import { listChainsByCategory, checkStoreBeforeAdd } from '@/api/store';
 import store from '@/store';
 export default {
   name: 'storeAdd',
@@ -1850,18 +1850,40 @@ export default {
         this.verifyStoreType(this.fromValue.storeCategory) &&
         this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
       ) {
-        this.toastLoading().clear();
-        this.$dialog
-          .confirm({
-            title: '系统提示',
-            message: `该门店类型为<span style="color:red">同城分销店</span>,<br/>首笔订单最低金额:<span style="color:red">1000元</span>`,
-            confirmButtonText: '去下单',
-            cancelButtonText: '修改门店信息',
-          })
-          .then(() => {
-            this.toastLoading(0, '上传中...', true);
-            this.addStoreFun();
-          });
+        // 门店重复判断
+        checkStoreBeforeAdd(this.fromValue).then((res) => {
+          this.toastLoading().clear();
+          // type	1=不重复;2=重复不让修改;3=重复可扩展
+          // store type=3时有值
+          if (res.data.type == 3) {
+            this.$dialog
+              .confirm({
+                title: '门店已存在',
+                message: res.msg,
+                confirmButtonText: '维护',
+                cancelButtonText: '取消',
+              })
+              .then(() => {
+                // 重复门店增加经销商
+                this.$router.push({
+                  path: '/storeDetail',
+                  query: { id: res.data.store.storeId, type: 'chainMaintain' },
+                });
+              });
+          } else if (res.data.type == 2 || res.data.type == 1) {
+            this.$dialog
+              .confirm({
+                title: '系统提示',
+                message: `该门店类型为<span style="color:red">同城分销店</span>,<br/>首笔订单最低金额:<span style="color:red">1000元</span>`,
+                confirmButtonText: '去下单',
+                cancelButtonText: '修改门店信息',
+              })
+              .then(() => {
+                this.toastLoading(0, '上传中...', true);
+                this.addStoreFun();
+              });
+          }
+        });
       } else {
         this.addStoreFun();
       }

+ 50 - 98
src/views/storeManagement/storeDetail.vue

@@ -4,37 +4,42 @@
       <!-- 顶部条 -->
       <van-nav-bar class="navBar" title="客户详情" left-arrow @click-left="onClickLeft">
         <template #right>
-          <!-- updatable 当前操作人是否可以编辑 -->
-          <template v-if="list.updatable">
-            <!-- 未结案状态下 -->
-            <template v-if="list.approvalStatus == 0">
-              <!-- validFlag 正常门店 -->
-              <template v-if="list.validFlag == 0">
-                <!-- 未提交 -->
-                <template v-if="list.processApprovalStatus == 0">
-                  <span style="color: #0057ba" v-if="type != 'address'" @click="editorFn"
-                    >编辑
-                  </span>
-                </template>
-                <!--下首单专用接口,只有在未结案、没有订单调用 -->
-                <!-- <span
+          <template v-if="type == 'chainMaintain'">
+            <span style="color: #0057ba" @click="chainMaintain">维护经销商</span>
+          </template>
+          <template v-else>
+            <!-- updatable 当前操作人是否可以编辑 -->
+            <template v-if="list.updatable">
+              <!-- 未结案状态下 -->
+              <template v-if="list.approvalStatus == 0">
+                <!-- validFlag 正常门店 -->
+                <template v-if="list.validFlag == 0">
+                  <!-- 未提交 -->
+                  <template v-if="list.processApprovalStatus == 0">
+                    <span style="color: #0057ba" v-if="type != 'address'" @click="editorFn"
+                      >编辑
+                    </span>
+                  </template>
+                  <!--下首单专用接口,只有在未结案、没有订单调用 -->
+                  <!-- <span
                   v-if="!orderList.length"
                   style="color: #0057ba; margin-left: 10px"
                   @click="placeOrderFn"
                   >去下单
                 </span> -->
+                </template>
+              </template>
+              <template v-else>
+                <span style="color: #0057ba" v-if="list.validFlag == 2" @click="placeOrderFn"
+                  >去下单
+                </span>
+                <span
+                  style="color: #0057ba"
+                  v-if="list.validFlag != 2 && type != 'address'"
+                  @click="editorFn"
+                  >编辑
+                </span>
               </template>
-            </template>
-            <template v-else>
-              <span style="color: #0057ba" v-if="list.validFlag == 2" @click="placeOrderFn"
-                >去下单
-              </span>
-              <span
-                style="color: #0057ba"
-                v-if="list.validFlag != 2 && type != 'address'"
-                @click="editorFn"
-                >编辑
-              </span>
             </template>
           </template>
         </template>
@@ -385,6 +390,7 @@
       <br />
       <!-- type:address 拜访时位置偏差过大,可以修改地址(只能修改地址) -->
       <div
+        v-if="type != 'chainMaintain'"
         style="
           position: fixed;
           bottom: 0;
@@ -568,6 +574,7 @@ import { updateStoreAddress, valid } from '@/api/visitstore';
 import uploadImg from '@/components/viewaddreddUploadImg.vue';
 import helpPage from './helpPage.vue';
 import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
+import { getOrderUrlByStoreId } from '@/api/inventory';
 export default {
   components: { uploadImg, mapmarker, viewUploadImg, helpPage },
   data() {
@@ -611,7 +618,7 @@ export default {
       address: '地址',
       storeTypePOP: false,
       GZAttributeFormShow: false,
-      type: '',
+      type: '', //chainMaintain:维护经销商;address:修改地址
       towntShow: false,
       districtShow: false,
       cityShow: false,
@@ -1541,80 +1548,18 @@ export default {
         message: '加载中...',
         forbidClick: true,
       });
-      addStore(this.list).then((res) => {
+      getOrderUrlByStoreId({
+        storeId: this.$route.query.id,
+        from: 'storeDetail',
+      }).then((res) => {
         loading1.clear();
-        if (res.code == 200) {
-          if (res.data.serverCode) {
-            if (
-              res.data.orderUrl != null &&
-              (res.data.orderUrl != '') & (res.data.orderUrl != undefined)
-            ) {
-              window.location.replace(res.data.orderUrl);
-            } else {
-              checkVisit({ storeId: res.data.sfaStore.storeId }).then((response) => {
-                localStorage.setItem('startTime', new Date());
-                localStorage.setItem('ORGName', this.list.deptName);
-                localStorage.setItem('chainNameR', this.list.storeName);
-                if (response.code == 200) {
-                  that.$dialog
-                    .confirm({
-                      title: '系统提示',
-                      message: '建店成功,是否立即拜访?',
-                      confirmButtonText: '立即拜访',
-                      cancelButtonText: '返回上一页',
-                    })
-                    .then(() => {
-                      localStorage.setItem('startTime', new Date());
-                      localStorage.setItem('ORGName', res.data.sfaStore.deptName);
-                      localStorage.setItem('chainNameR', res.data.sfaStore.storeName);
-                      window.location.replace(
-                        window.location.origin +
-                          '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
-                          res.data.sfaStore.storeId +
-                          '&lat=' +
-                          that.list.lat +
-                          '&lon=' +
-                          that.list.lon +
-                          '&addressLine=' +
-                          that.list.addressLine +
-                          '&storeCategory=' +
-                          res.data.sfaStore.storeCategory +
-                          '&storeName=' +
-                          that.list.storeName +
-                          '&contactName=' +
-                          that.list.contactName +
-                          '&storeCode=' +
-                          res.data.sfaStore.storeCode +
-                          '&latNew=' +
-                          that.list.lat +
-                          '&lonNew=' +
-                          that.list.lon
-                      );
-                    })
-                    .catch(() => {
-                      that.$router.go(-2);
-                    });
-                } else {
-                  that.$dialog
-                    .alert({
-                      title: '系统提示',
-                      message: response.msg,
-                    })
-                    .then((res) => {});
-                }
-              });
-            }
-          } else {
-            this.list.storeCode = res.data.sfaStore.storeCode;
-            this.list.storeId = res.data.sfaStore.storeId;
-            this.$dialog.alert({
-              title: '系统提示',
-              message: res.data.serverMsg,
-            });
-          }
+        if (res.code == 200 && res.data) {
+          window.location.href = res.data;
         } else {
-          this.msgList = res.msg;
-          this.showDialog = true;
+          this.Toast({
+            message: res.msg,
+            duration: 5000,
+          });
         }
       });
     },
@@ -1670,6 +1615,13 @@ export default {
         startPosition: index,
       });
     },
+    // 维护经销商
+    chainMaintain() {
+      this.$router.push({
+        path: '/chainMaintain',
+        query: { id: this.$route.query.id },
+      });
+    },
   },
 };
 </script>

+ 9 - 3
src/views/storeManagement/storeEdit.vue

@@ -815,9 +815,11 @@ export default {
       treeSelect: [],
       sfaStoreChainsContactList: [], //选中确定的经销商
       activatedTCFXList: [], //选中的经销商
+      chainUser: false, //是否经销商用户 true
     };
   },
   activated() {
+    this.chainUser = localStorage.getItem('chainUser'); //经销商人员(包含分销、先锋)
     this.tabVal = 'insidePlan';
     this.treeSelect = [];
     // 授权
@@ -1465,6 +1467,7 @@ export default {
         });
     },
     showPickerChainsListFn() {
+      if (this.chainUser == 'true') return;
       if (this.fromValue.storeCategoryName == '') {
         this.$toast('类型未选择');
         return;
@@ -1649,9 +1652,12 @@ export default {
         this.fromValue.ifJzStoreType = value.ifJzStoreType;
         this.getChainsByDeptCode(null, value.ifJzStoreType);
         // 切换门店类型删除选定经销商
-        this.treeSelect = [];
-        this.sfaStoreChainsContactList = []; //选中确定的经销商
-        this.activatedTCFXList = []; //选中的经销商
+        // 同城分销人员禁止切换经销商
+        if (this.chainUser == 'false') {
+          this.treeSelect = [];
+          this.sfaStoreChainsContactList = []; //选中确定的经销商
+          this.activatedTCFXList = []; //选中的经销商
+        }
         this.showPicker = false;
       }
       if (value.dictValue == 'C912') {