Bladeren bron

Merge branch 'v3.0' into company

snow 1 jaar geleden
bovenliggende
commit
8e2898b666

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


+ 57 - 14
src/views/goodStore/goodsOnline/components/fixed-price-form.vue

@@ -803,17 +803,17 @@ export default {
     //保存某一行
     async checkRow(rowIndex) {
       const { sale_price ,new_sale_price , cost_fee , new_cost_fee } = this.addrForm.good_ladder[rowIndex] || {}
-      const _salePrice = Number(sale_price)
-      const _systemSalePrice = Number(new_sale_price)
-      const _costFee = Number(cost_fee)
-      const _systemCostFee = Number(new_cost_fee)
+      const _salePrice = Number(sale_price) || 0
+      const _systemSalePrice = Number(new_sale_price) || 0
+      const _costFee = Number(cost_fee) || 0
+      const _systemCostFee = Number(new_cost_fee) || 0
 
-      if(_salePrice && _salePrice < _systemSalePrice){
+      if(_systemSalePrice && (_salePrice < _systemSalePrice)){
         this.$message.warning('售价不能小于系统售价!')
         return
       }
 
-      if(_costFee && _costFee < _systemCostFee) {
+      if(_systemCostFee && (_costFee < _systemCostFee)) {
         this.$message.warning('工艺费不能小于系统工艺费!')
         return
       }
@@ -955,28 +955,50 @@ export default {
         }
       });
     },
+    set_ladder_item(i, price, new_cost_fee) {
+      this.addrForm.good_ladder[i].new_sale_price = price;
+      // this.addrForm.good_ladder[i].sale_price = price;
+      this.addrForm.good_ladder[i].new_cost_fee = new_cost_fee;
+      this.addrForm.good_ladder[i].cost_fee = new_cost_fee;
+      this.addrForm.good_ladder[i].newTime = new Date().valueOf() + Math.random();
+      this.$set(this.addrForm.good_ladder, i, this.addrForm.good_ladder[i]);
+    },
     async submitForm() {
+
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           if (!this.loading) {
             let model = JSON.parse(JSON.stringify(this.ruleForm));
             const { state } = model;
-            if (state + "" === "1") {
-              this.loading = true;
-              if (this.addrForm.good_ladder.length === 0) {
-                this.$message.warning("至少存在一条销售价信息!");
-                this.loading = false;
-                return;
+            this.loading = true;
+            if (this.addrForm.good_ladder.length === 0) {
+              this.$message.warning("至少存在一条销售价信息!");
+              this.loading = false;
+              return;
+            }
+            let list = JSON.parse(JSON.stringify(this.addrForm.good_ladder));
+
+            for(let index = 0; index< list.length;index ++){
+              const item = list[index]
+              if(item.edit){
+                this.$message.warning(`请保存第 ${index + 1} 行的阶梯售价信息`)
+                this.loading = false
+                return
               }
-              let list = JSON.parse(JSON.stringify(this.addrForm.good_ladder));
+            }
+
+            if (state + "" === "1") {
               let all_is_ok = true;
               let isok = true;
-              for (let i = 0; i < this.addrForm.good_ladder; i++) {
+
+              for (let i = 0; i < this.addrForm.good_ladder.length; i++) {
                 this.addrForm.good_ladder[i].search_loading = true;
                 const { market_platform } = this.addrForm.good_ladder[i];
+
                 if (market_platform == "") {
                   isok = false;
                 }
+                
                 let { isok, price, new_cost_fee } = await this.get_new(i);
                 if (isok === 0) {
                   this.set_ladder_item(i, price, new_cost_fee);
@@ -987,6 +1009,27 @@ export default {
                   this.set_ladder_item(i, price, new_cost_fee);
                 }
               }
+
+              for (let index = 0; index < this.addrForm.good_ladder.length; index++){
+                const { sale_price ,new_sale_price , cost_fee , new_cost_fee } = this.addrForm.good_ladder[index] || {}
+                 const _salePrice = Number(sale_price) 
+                 const _systemSalePrice = Number(new_sale_price) 
+                 const _costFee = Number(cost_fee) 
+                 const _systemCostFee = Number(new_cost_fee) 
+
+                 if(_systemSalePrice &&( _salePrice < _systemSalePrice)){
+                   this.$message.warning(`第 ${index + 1} 行的售价不能小于系统售价!`)
+                   this.loading = false
+                   return
+                 }
+               
+                 if(_systemCostFee && (_costFee < _systemCostFee)) {
+                   this.$message.warning('第 ${index + 1} 行的售价不能工艺费不能小于系统工艺费!')
+                   this.loading = false
+                   return
+                 }
+              }
+
               if (!isok) {
                 this.$message.warning("比价平台不能为空!");
                 this.loading = false;

+ 8 - 2
src/views/goodStore/supplierGoodsCost/components/baseForm.vue

@@ -40,7 +40,7 @@
                 disabled
                 :size="'mini'"
                 :names="supplierName"
-                :isDetail="type !== 'add'"
+                :isDetail="true"
                 :isp="this.type !== 'view'"
                 @searchChange="supplierNosearchChange"
               />
@@ -1837,7 +1837,13 @@ export default {
           this.status = status;
           this.brand_name = brand_name;
           this.unit_name = unit;
-          this.supplierName = supplierName || "";
+
+          if(this.type === 'add'){
+             this.supplierName = this.getCompanyWithCode(this.currentCompany).name
+          }else{
+            this.supplierName = supplierName || "";
+          }
+
           this.ruleForm = {
             id: id || "",
             spuCode: spuCode || "",

+ 1 - 1
src/views/netOrderEntry/netOrderEnter/detail-modal.vue

@@ -738,7 +738,7 @@ export default {
       this.detailLoading = false
     },
     platform_codesearchChange(e) {
-      const { id, label, pay_name } = e
+      const { id, pay_name } = e
       this.ruleForm.platform_id = id || ''
       this.pay_name = pay_name || ''
       this.$refs.ruleForm.validateField('platform_id')

+ 32 - 20
src/views/youzan/othgoodsOnline/components/online-exam-form.vue

@@ -422,30 +422,44 @@ export default {
       const { nakelist, spuCode, platform_id } = this.sitem;
       this.spuCode = spuCode;
       this.platform_id = platform_id;
-      console.log(this.sitem);
-      this.nakelist = JSON.parse(JSON.stringify(nakelist));
-      this.nakelist.forEach(async (si, sii) => {
+
+      const _nakelist = JSON.parse(JSON.stringify(nakelist));
+      let hasEdit = false
+      _nakelist.forEach(async (si, sii) => {
         si.start_sale_num = si.min_num;
-        let { isok, price, sale_cost_fee } = await this.get_new(sii);
+        let { isok, price, sale_cost_fee } = await this.get_new(sii,si.min_num);
         if (isok === 0) {
-          this.nakelist[sii].sale_good_price = price;
-          this.nakelist[sii].sale_cost_fee = sale_cost_fee;
-          this.nakelist[sii].newTime = new Date().valueOf() + "";
+          _nakelist[sii].sale_good_price = price;
+          _nakelist[sii].sale_cost_fee = sale_cost_fee;
+          _nakelist[sii].newTime = new Date().valueOf() + "";
         } else if (isok >= 100 && isok <= 104) {
           await this.logout();
         } else {
-          this.nakelist[sii].sale_good_price = price;
-          this.nakelist[sii].sale_cost_fee = sale_cost_fee;
-          this.nakelist[sii].newTime = new Date().valueOf() + "";
+          _nakelist[sii].sale_good_price = price;
+          _nakelist[sii].sale_cost_fee = sale_cost_fee;
+          _nakelist[sii].newTime = new Date().valueOf() + "";
+        }
+        if(String(si.min_num) === "1" && !hasEdit){
+          this.currentRow = si
+          this.$set(this.nakelist, sii, {
+            ..._nakelist[sii],
+            edit:true
+          });
+          hasEdit = true
+        }else{
+          this.$set(this.nakelist, sii, {
+            ..._nakelist[sii],
+          });
         }
-        this.$set(this.nakelist, sii, this.nakelist[sii]);
       });
 
+      // this.nakelist = _nakelist
+
       // this.setCurrent(this.nakelist[0]);
-      let index = this.nakelist.findIndex((e) => e.min_num + "" === "1");
-      if (index !== -1) {
-        this.handleCurrentChange(this.nakelist[index]);
-      }
+      // let index = _nakelist.findIndex((e) => e.min_num + "" === "1");
+      // if (index !== -1) {
+      //   this.handleCurrentChange(this.nakelist[index]);
+      // }
 
       this.loading = false;
     },
@@ -506,9 +520,7 @@ export default {
     // setCurrent(row) {
     //   this.$refs.singleTable.setCurrentRow(row);
     // },
-    async get_new(index) {
-      console.log(index);
-      const { min_num } = this.nakelist[index];
+    async get_new(index,min_num) {
       const { code, data, message } = await asyncRequest.goodupprice({
         min_num: min_num,
         platform_id: this.platform_id,
@@ -573,7 +585,6 @@ export default {
                 auto_listing_time,
                 origin,
               } = this.ruleForm;
-
               // console.log(yz_cat_id);
               model.platform_youzan_id = this.sitem.platform_youzan_id;
               model.yz_cat_id = "";
@@ -667,7 +678,8 @@ export default {
                 this.$message.warning(message);
               }
             })
-            .catch(() => {
+            .catch((err) => {
+              console.log(err)
               console.log("取消");
             });
         } else {

+ 16 - 12
src/views/youzan/othgoodsOnline/detail.vue

@@ -476,7 +476,7 @@ export default {
         this.spuCode = spuCode;
         this.platform_id = platform_id;
         // this.ladderlist = JSON.parse(JSON.stringify(ladderlist));
-        this.nakelist = JSON.parse(JSON.stringify(nakelist));
+        const _nakelist = JSON.parse(JSON.stringify(nakelist));
         // console.log(this.ladderlist);
         let cat = "";
         if (cat_info && cat_info.length > 0) {
@@ -490,23 +490,28 @@ export default {
         if (!isArray(this.sitem.good_info_img)) {
           this.sitem.good_info_img = this.sitem.good_info_img.split(",");
         }
-        this.nakelist.forEach(async (si, sii) => {
+
+        _nakelist.forEach(async (si, sii) => {
           si.start_sale_num = si.min_num;
-          let { isok, price, sale_cost_fee } = await this.get_new(sii);
+          let { isok, price, sale_cost_fee } = await this.get_new(sii,si.min_num);
           if (isok === 0) {
-            this.nakelist[sii].sale_good_price = price;
-            this.nakelist[sii].sale_cost_fee = sale_cost_fee;
-            this.nakelist[sii].newTime = new Date().valueOf() + "";
+            _nakelist[sii].sale_good_price = price;
+            _nakelist[sii].sale_cost_fee = sale_cost_fee;
+            _nakelist[sii].newTime = new Date().valueOf() + "";
           } else if (isok >= 100 && isok <= 104) {
             await this.logout();
           } else {
-            this.nakelist[sii].sale_good_price = price;
-            this.nakelist[sii].sale_cost_fee = sale_cost_fee;
-            this.nakelist[sii].newTime = new Date().valueOf() + "";
+            _nakelist[sii].sale_good_price = price;
+            _nakelist[sii].sale_cost_fee = sale_cost_fee;
+            _nakelist[sii].newTime = new Date().valueOf() + "";
           }
-          this.$set(this.nakelist, sii, this.nakelist[sii]);
+          this.$set(this.nakelist, sii, _nakelist[sii]);
         });
 
+      //  this.nakelist = _nakelist
+
+       console.log(this.nakelist)
+
         this.status = exam_status;
         this.getNewTime();
       } else if (code >= 100 && code <= 104) {
@@ -515,8 +520,7 @@ export default {
         this.$message.warning(message);
       }
     },
-    async get_new(index) {
-      const { min_num } = this.nakelist[index];
+    async get_new(index,min_num) {
       const { code, data, message } = await asyncRequest.goodupprice({
         min_num: min_num,
         platform_id: this.platform_id,

Some files were not shown because too many files changed in this diff