Kaynağa Gözat

处理合并异常处理2

yjwang 1 hafta önce
ebeveyn
işleme
90f1ba2f21
1 değiştirilmiş dosya ile 52 ekleme ve 47 silme
  1. 52 47
      src/views/hisStore/storeProduct/index.vue

+ 52 - 47
src/views/hisStore/storeProduct/index.vue

@@ -2038,7 +2038,7 @@ export default {
       this.upload.open = false;
       this.upload.isUploading = false;
       this.$refs.upload.clearFiles();
-      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
       this.getList();
     },
     handleImport() {
@@ -2061,7 +2061,7 @@ export default {
     },
     //生成SKU
     generate() {
-      genFormatAttr(this.form.productId, {attrs: this.attrs}).then(res => {
+      genFormatAttr(this.form.productId, { attrs: this.attrs }).then(res => {
         if (this.form.specType === 0) {
           this.oneFormValidate = res.value;
           this.form.header = res.header;
@@ -2123,7 +2123,7 @@ export default {
         };
         this.attrs.push(data);
         var hash = {};
-        this.attrs = this.attrs.reduce(function (item, next) {
+        this.attrs = this.attrs.reduce(function(item, next) {
           hash[next.value] ? '' : hash[next.value] = true && item.push(next);
           return item
         }, [])
@@ -2139,7 +2139,7 @@ export default {
       if (num) {
         this.attrs[idx].detail.push(num);
         var hash = {};
-        this.attrs[idx].detail = this.attrs[idx].detail.reduce(function (item, next) {
+        this.attrs[idx].detail = this.attrs[idx].detail.reduce(function(item, next) {
           hash[next] ? '' : hash[next] = true && item.push(next);
           return item
         }, [])
@@ -2156,7 +2156,7 @@ export default {
           type: 'error'
         });
       }
-      that.ruleList.forEach(function (item, index) {
+      that.ruleList.forEach(function(item, index) {
         if (item.ruleName === that.form.selectRule) {
           that.attrs = JSON.parse(item.ruleValue);
 
@@ -2426,21 +2426,21 @@ export default {
           this.qualificationArr = this.form.qualificationCertificate.split(",");
         }
 
-        if(this.form.isBusinessPermanent == 1){
+        if (this.form.isBusinessPermanent == 1) {
           this.businessValue = true
-        }else {
+        } else {
           this.businessValue = false
         }
 
-        if(this.form.isLicensePermanent == 1){
+        if (this.form.isLicensePermanent == 1) {
           this.licenseValue = true
-        }else {
+        } else {
           this.licenseValue = false
         }
 
-        if(this.form.isCertificatePermanent == 1){
+        if (this.form.isCertificatePermanent == 1) {
           this.certificateValue = true
-        }else {
+        } else {
           this.certificateValue = false
         }
 
@@ -2449,7 +2449,11 @@ export default {
           { expireKey: 'licenseExpire', startKey: 'licenseStart', endKey: 'licenseEnd' },
           { expireKey: 'certificateExpire', startKey: 'certificateStart', endKey: 'certificateEnd' },
           { expireKey: 'voucherExpire', startKey: 'voucherStart', endKey: 'voucherEnd' },
-          { expireKey: 'qualificationExpire', startKey: 'qualificationCertificateStart', endKey: 'qualificationCertificateEnd' }
+          {
+            expireKey: 'qualificationExpire',
+            startKey: 'qualificationCertificateStart',
+            endKey: 'qualificationCertificateEnd'
+          }
         ];
 
         expireFieldMap.forEach(item => {
@@ -2463,8 +2467,8 @@ export default {
         //组装attrs数据
         if (response.attrs != null) {
           this.attrs = [];
-          response.attrs.forEach(function (item, index) {
-            var data = {value: item.attrName, detail: item.attrValues.split(',')}
+          response.attrs.forEach(function(item, index) {
+            var data = { value: item.attrName, detail: item.attrValues.split(',') }
             that.attrs.push(data);
           });
         }
@@ -2581,22 +2585,22 @@ export default {
           }
 
           //无语,有的时候要删除,删除了又要加回来。
-          if(!!this.businessValue){
-            this.form.isBusinessPermanent=1;
-          }else {
-            this.form.isBusinessPermanent=0;
+          if (!!this.businessValue) {
+            this.form.isBusinessPermanent = 1;
+          } else {
+            this.form.isBusinessPermanent = 0;
           }
 
-          if(!!this.licenseValue){
-            this.form.isLicensePermanent=1;
-          }else {
-            this.form.isLicensePermanent=0;
+          if (!!this.licenseValue) {
+            this.form.isLicensePermanent = 1;
+          } else {
+            this.form.isLicensePermanent = 0;
           }
 
-          if(!!this.certificateValue){
-            this.form.isCertificatePermanent=1;
-          }else {
-            this.form.isCertificatePermanent=0;
+          if (!!this.certificateValue) {
+            this.form.isCertificatePermanent = 1;
+          } else {
+            this.form.isCertificatePermanent = 0;
           }
 
           // // 组装companyIds
@@ -2620,12 +2624,12 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(function () {
+      }).then(function() {
         return delStoreProduct(productIds);
       }).then(() => {
         this.getList();
         this.msgSuccess("删除成功");
-      }).catch(function () {
+      }).catch(function() {
       });
     },
     /** 导出按钮操作 */
@@ -2635,14 +2639,14 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(function () {
+      }).then(function() {
         return exportStoreProduct(queryParams);
       }).then(response => {
         this.download(response.msg);
-      }).catch(function () {
+      }).catch(function() {
       });
     },
-    handleDrugExport(row){
+    handleDrugExport(row) {
       const productId = row.productId
       this.exportLoading = true;
       exportDrugProduct({ productId: productId }).then(response => {
@@ -2659,12 +2663,12 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(function () {
+      }).then(function() {
         return sync580(productIds);
       }).then(() => {
         this.getList();
         this.msgSuccess("同步成功");
-      }).catch(function () {
+      }).catch(function() {
       });
     },
     /** 批量下架按钮操作 */
@@ -2679,19 +2683,19 @@ export default {
       }).then(() => {
         this.getList();
         this.msgSuccess("下架成功");
-      }).catch(function () {
+      }).catch(function() {
       });
     },
-    handleReviewAudit(){
-      console.log("aaaaaaaaaaaaaaa->",this.form.reviewAudit);
+    handleReviewAudit() {
+      console.log("aaaaaaaaaaaaaaa->", this.form.reviewAudit);
     },
-    switchChange(){
+    switchChange() {
       console.log(this.form.isBusinessLicensePermanent);
     },
-    showOperLog(row){
+    showOperLog(row) {
       getAuthInfo(row.productId).then(response => {
         this.auditLogs = response.auditLog;
-        this.titleValue ="商品:" +"《" +row.productName+"》"+ "审核记录";
+        this.titleValue = "商品:" + "《" + row.productName + "》" + "审核记录";
         this.authVisible = true;
       })
     },
@@ -2700,19 +2704,20 @@ export default {
         .then(_ => {
           done();
         })
-        .catch(_ => {});
+        .catch(_ => {
+        });
     },
     /**
      * 复制商品
      * **/
-    productCopy(row){
-      this.$confirm('确认是否复制当前《'+row.productName+'》商品!', '复制商品', {
+    productCopy(row) {
+      this.$confirm('确认是否复制当前《' + row.productName + '》商品!', '复制商品', {
         confirmButtonText: '确 认',
         cancelButtonText: '取 消',
         type: 'warning'
       }).then(() => {
         copyProduct(row).then(response => {
-          if(response.code === 200){
+          if (response.code === 200) {
             this.$message.success("操作成功!")
             this.getList();
           }
@@ -2825,10 +2830,9 @@ export default {
       if (this.categoryOrStoreChangeTimer) {
         clearTimeout(this.categoryOrStoreChangeTimer);
       }
-    }
     },
     //打开溯源码页面
-    openVerify(row){
+    openVerify(row) {
       if (row) {
         this.currentProductId = row.productId;
       } else if (this.ids.length > 0) {
@@ -2840,7 +2844,7 @@ export default {
         this.$message.error('请先选择需要管理溯源码的商品');
         return;
       }
-      this.titleVisible = this.titleVisible+'《'+row.productName+'》';
+      this.titleVisible = this.titleVisible + '《' + row.productName + '》';
       this.verifyDialogVisible = true;
     },
     /**
@@ -2855,8 +2859,9 @@ export default {
       }, 100);
       this.getList();
       this.verifyDialogVisible = false;
-      this.titleVisible="溯源管理";
+      this.titleVisible = "溯源管理";
     },
+  }
 };
 </script>