Просмотр исходного кода

feature_20260513_新建专业五金店

zhujindu недель назад: 2
Родитель
Сommit
3c297732b0

+ 42 - 20
src/views/storeManagement/storeAdd.vue

@@ -365,7 +365,7 @@
                         fromValue.storeCategory == '126565' &&
                         fromValue.orgName &&
                         fromValue.orgName.indexOf('BMD') != -1 &&
-                        displayImg.length <= 3
+                        displayImg.length < 3
                       ">
                       <van-col span="12">
                         <div>
@@ -785,13 +785,15 @@
       </div>
     </div>
     <div class="mask" v-if="progressFlag">
-      <el-progress
-        type="circle"
-        :percentage="percentage"
-        :show-text="true"
-        :width="110"
-        :format="format"></el-progress>
-      <!-- <div class="progressClose" @click="progressClose">取消</div> -->
+      <div class="progress">
+        <el-progress
+          type="circle"
+          :percentage="percentage"
+          :show-text="true"
+          :width="110"
+          :format="format"></el-progress>
+        <!-- <div class="progressClose" @click="progressClose">取消</div> -->
+      </div>
     </div>
   </div>
 </template>
@@ -1060,7 +1062,11 @@ export default {
           storeCompetitorList: [],
           otherCompetitor: '', //主营竞品品牌-其他
         };
-        this.displayImg = [];
+        this.displayImg = [
+          // 'https://cdn-svs-test.nipponpaint.com.cn/17790740128352026-05-18%E7%95%A5%E7%95%A5%E7%95%A5.jpg?Expires=2094693212&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=1O13rUNy5FHiqTxcuJTq7RnPek4%3D',
+          // 'https://cdn-svs-test.nipponpaint.com.cn/17790740128352026-05-18%E7%95%A5%E7%95%A5%E7%95%A5.jpg?Expires=2094693212&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=1O13rUNy5FHiqTxcuJTq7RnPek4%3D',
+          // 'https://cdn-svs-test.nipponpaint.com.cn/17790740128352026-05-18%E7%95%A5%E7%95%A5%E7%95%A5.jpg?Expires=2094693212&OSSAccessKeyId=LTAI5tG1DTJFA16BHkzHVxjz&Signature=1O13rUNy5FHiqTxcuJTq7RnPek4%3D',
+        ];
         setTimeout(() => {
           // this.getLocation()
         });
@@ -1323,6 +1329,10 @@ export default {
       this.fromValue.chainName = '';
       this.getChainsByDeptId(value.deptId, this.fromValue.ifJzStoreType);
       this.showPickerDept = false;
+      // 非BMD门店,清空陈列照图片展示
+      if (value.text.indexOf('BMD') == -1) {
+        this.displayImg = [];
+      }
     },
     setStoreNameFn() {
       if (this.fromValue.storeName.trim() == '') {
@@ -1770,7 +1780,10 @@ export default {
         this.fromValue.tcfxCode = '';
         this.dictTypeFormShow = false;
       }
-
+      // 非专业五金店
+      if (value.dictValue !== '126565') {
+        this.displayImg = [];
+      }
       if (value.dictValue == 'C917') {
         this.GZAttributeFormShow = true;
         this.dictTypeSJSFormShow = false;
@@ -2091,6 +2104,7 @@ export default {
     addStoreFun(BMDtype) {
       addStore(this.fromValue).then((res) => {
         this.toastLoading().clear();
+          this.resetProgress();
         if (res.code == 200) {
           if (res.data.serverCode) {
             this.fromValue.storeCode = res.data.sfaStore.storeCode;
@@ -2170,7 +2184,6 @@ export default {
             });
           }
         } else {
-          this.resetProgress();
           this.$dialog.alert({
             title: '系统提示',
             message: res.msg,
@@ -2464,13 +2477,21 @@ export default {
     bottom: 0;
     width: 100%;
     height: 100%;
-    background: rgba(255, 255, 255, 0.3);
+    background: rgba(0, 0, 0, 0.5);
     display: flex;
     justify-content: center;
     align-items: center;
     z-index: 99999999;
     display: flex;
     flex-direction: column;
+    .progress {
+      width: 90%;
+      height: 140px;
+      background: #fff;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
     .progressClose {
       width: 70px;
       text-align: center;
@@ -2485,6 +2506,7 @@ export default {
   }
   .displayImg {
     overflow: hidden;
+    padding-bottom: 10px;
     .displayImgBox {
       position: relative;
       width: 48%;
@@ -2500,14 +2522,14 @@ export default {
     .displayImgBox:nth-child(even) {
       margin-right: 0;
     }
-    // i {
-    //   position: absolute;
-    //   right: 4px;
-    //   color: white;
-    //   background: red;
-    //   overflow: hidden;
-    //   border-radius: 50%;
-    // }
+    i {
+      position: absolute;
+      right: 4px;
+      color: white;
+      background: red;
+      overflow: hidden;
+      border-radius: 50%;
+    }
   }
 }
 </style>

+ 83 - 0
src/views/storeManagement/storeDetail.vue

@@ -613,6 +613,17 @@
         <!-- </div> -->
       </div>
     </van-popup>
+    <div class="mask" v-if="progressFlag">
+      <div class="progress">
+        <el-progress
+          type="circle"
+          :percentage="percentage"
+          :show-text="true"
+          :width="110"
+          :format="format"></el-progress>
+        <!-- <div class="progressClose" @click="progressClose">取消</div> -->
+      </div>
+    </div>
   </div>
 </template>
 
@@ -725,6 +736,9 @@ export default {
       cityABStore: false, //同城分销A/B店
       displayImg: [],
       storeCompetitorList: '',
+      progressFlag: false,
+      percentage: 0,
+      timeFlag: null,
     };
   },
   watch: {
@@ -1692,13 +1706,28 @@ export default {
         return;
       }
       this.toastLoading(0, '正在提交...', true);
+      if (this.list.storeCategory == '126565') {
+        this.progress();
+        this.submitFun();
+      } else {
+        this.submitFun();
+      }
+    },
+    submitFun() {
       submitApproval({
         storeId: this.list.storeId, // 店铺id
       }).then((res) => {
+        this.resetProgress();
         if (res.code == 200) {
           this.$toast.success('提交成功');
           this.getDetail();
           this.$router.go(-1);
+        } else {
+          this.$dialog.alert({
+            title: '系统提示',
+            message: res.msg,
+            messageAlign: 'left',
+          });
         }
       });
     },
@@ -1727,6 +1756,25 @@ export default {
         query: { storeCode: this.list.storeCode },
       });
     },
+    // 重置loaidng状态
+    resetProgress() {
+      this.percentage = 100;
+      clearInterval(this.timeFlag);
+      this.progressFlag = false;
+      this.percentage = 0;
+    },
+    progress() {
+      // 后端接口20000ms后失效,每1000m progress加10,到90停止;
+      this.progressFlag = true;
+      this.percentage = 10;
+      this.timeFlag = setInterval(() => {
+        this.percentage = this.percentage + 10;
+        if (this.percentage == 90) clearInterval(this.timeFlag);
+      }, 1000);
+    },
+    format(percentage) {
+      return `${percentage} %\n图像识别中`;
+    },
   },
 };
 </script>
@@ -1971,5 +2019,40 @@ export default {
       width: 9em;
     }
   }
+  .mask {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, 0.5);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    z-index: 99999999;
+    display: flex;
+    flex-direction: column;
+    .progress {
+      width: 90%;
+      height: 140px;
+      background: #fff;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    .progressClose {
+      width: 70px;
+      text-align: center;
+      background: #67c23a;
+      color: #fff;
+      height: 30px;
+      line-height: 30px;
+      border-radius: 5px;
+      margin-top: 5px;
+      font-size: 12px;
+    }
+  }
 }
 </style>

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

@@ -361,15 +361,27 @@
                   </template>
                   <div class="displayImgBox" v-if="fromValue.ifJzStoreType != 1">
                     <div v-if="storeTypePOP">
-                      <upload-img
-                        v-if="fromValue.ifJzStoreType != 1"
-                        :uploadid="uploadid2"
-                        imgArr=""
-                        @newimgarr="newimgarr1"
-                        imgText="陈列照(至少一张)"
-                        :type="2"
-                        :displayPhoto="fromValue.storeCategory == '126565' ? '1' : '0'"
-                        :count="1"></upload-img>
+                      <template v-if="fromValue.storeCategory == '126565' && displayImg.length < 3">
+                        <upload-img
+                          v-if="fromValue.ifJzStoreType != 1"
+                          :uploadid="uploadid2"
+                          imgArr=""
+                          @newimgarr="newimgarr1"
+                          imgText="陈列照(至少一张)"
+                          :type="2"
+                          :displayPhoto="'1'"
+                          :count="1"></upload-img>
+                      </template>
+                      <template v-else>
+                        <upload-img
+                          v-if="fromValue.ifJzStoreType != 1"
+                          :uploadid="uploadid2"
+                          imgArr=""
+                          @newimgarr="newimgarr1"
+                          imgText="陈列照(至少一张)"
+                          :type="2"
+                          :count="1"></upload-img>
+                      </template>
                     </div>
                   </div>
                 </div>