Browse Source

Merge branch 'sit'

xiaodai2022 2 years ago
parent
commit
7f7bf4fbdd

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


+ 42 - 22
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -361,9 +361,7 @@
               <el-select
                 v-model="ruleForm.good_type"
                 filterable
-                :disabled="
-                  type === 'view' ||type === 'editCoin'
-                "
+                :disabled="type === 'view' || type === 'editCoin'"
                 clearable
                 style="width: 100%"
                 placeholder="是否定制"
@@ -385,7 +383,7 @@
                 :placeholder="'定制起订量'"
                 :name="'ruleForm.moq'"
                 :min="0"
-                :disabled="type === 'view' ||type === 'editCoin'"
+                :disabled="type === 'view' || type === 'editCoin'"
                 :max="100000000000"
                 :position="'right'"
                 :precision="0"
@@ -403,7 +401,7 @@
                 :placeholder="'定制工期'"
                 :name="'ruleForm.customized'"
                 :min="0"
-                :disabled="type === 'view' ||type === 'editCoin'"
+                :disabled="type === 'view' || type === 'editCoin'"
                 :max="100000000000"
                 :position="'right'"
                 :precision="0"
@@ -845,7 +843,7 @@
     </el-row>
     <el-row class="ddiv">
       <el-col :span="1" class="dtitle">
-        <ul style="padding:0;">
+        <ul style="padding: 0">
           <li>固</li>
           <li>定</li>
           <li>与</li>
@@ -1467,24 +1465,46 @@ export default {
         package_fee,
         other_fee,
       } = item;
+      let isok = true;
       let ffindex = -1;
-      this.ladder_tableData.forEach((i, findex) => {
-        if (findex === parseInt(index + "")) {
-          ffindex = findex;
-          this.ladder_tableData[findex].id = id;
-          this.ladder_tableData[findex].min_num = min_num;
-          this.ladder_tableData[findex].cost_fee = cost_fee;
-          this.ladder_tableData[findex].delivery_fee = delivery_fee;
-          this.ladder_tableData[findex].nake_fee = nake_fee;
-          this.ladder_tableData[findex].cert_fee = cert_fee;
-          this.ladder_tableData[findex].mark_fee = mark_fee;
-          this.ladder_tableData[findex].package_fee = package_fee;
-          this.ladder_tableData[findex].other_fee = other_fee;
-        }
-      });
-      if (ffindex === -1) {
+      if (this.ladder_tableData && this.ladder_tableData.length === 0) {
         this.ladder_tableData.push(item);
+      } else {
+        this.ladder_tableData.forEach((i, findex) => {
+          if (parseInt(min_num + "") === parseInt(i.min_num + "")) {
+            isok = false;
+            this.ladder_tableData[findex].id = id;
+            this.ladder_tableData[findex].min_num = min_num;
+            this.ladder_tableData[findex].cost_fee = cost_fee;
+            this.ladder_tableData[findex].delivery_fee = delivery_fee;
+            this.ladder_tableData[findex].nake_fee = nake_fee;
+            this.ladder_tableData[findex].cert_fee = cert_fee;
+            this.ladder_tableData[findex].mark_fee = mark_fee;
+            this.ladder_tableData[findex].package_fee = package_fee;
+            this.ladder_tableData[findex].other_fee = other_fee;
+          }
+        });
+        if (isok) {
+          this.ladder_tableData.forEach((i, findex) => {
+            if (findex === parseInt(index + "")) {
+              ffindex = findex;
+              this.ladder_tableData[findex].id = id;
+              this.ladder_tableData[findex].min_num = min_num;
+              this.ladder_tableData[findex].cost_fee = cost_fee;
+              this.ladder_tableData[findex].delivery_fee = delivery_fee;
+              this.ladder_tableData[findex].nake_fee = nake_fee;
+              this.ladder_tableData[findex].cert_fee = cert_fee;
+              this.ladder_tableData[findex].mark_fee = mark_fee;
+              this.ladder_tableData[findex].package_fee = package_fee;
+              this.ladder_tableData[findex].other_fee = other_fee;
+            }
+          });
+          if (ffindex === -1) {
+            this.ladder_tableData.push(item);
+          }
+        }
       }
+
       await this.get_all_fee();
       this.showModel = false;
     },
@@ -1817,7 +1837,7 @@ export default {
         "is_diff",
         "config",
         "other_config",
-        'cgd_gold_price'
+        "cgd_gold_price",
       ];
       for (let i = 0; i < list.length; i++) {
         if (list[i] === "cgd_gold_price") {

+ 22 - 43
src/views/goodStore/goodsOnline/components/fixed-price-form.vue

@@ -253,15 +253,6 @@
             </template>
           </el-table-column>
         </el-table>
-        <!-- 弹窗 新增/修改 -->
-        <!-- <cost-form-add-edit
-          :index="costmodelIndex"
-          :show-model="costshowModel"
-          :sitem="costsitem"
-          :spuCode="spuCode"
-          @refresh="costrefreshEdit"
-          @cancel="costshowModel = false"
-        /> -->
       </el-col>
       <el-col :span="24"
         ><el-form-item label="售价凭证类型" prop="proof_type">
@@ -330,7 +321,7 @@
             <li v-if="ruleForm.proof_type === '2'" class="tupian">
               <div v-if="img_url" class="clearfix">
                 <img
-                  style="width:50px; height:50px"
+                  style="width: 50px; height: 50px"
                   :src="img_url"
                   class="avatar fl"
                 />
@@ -633,6 +624,7 @@ export default {
           });
         } else {
           this.ruleForm.good_ladder[index].edit = true;
+          this.ruleForm.good_ladder[index].newTime = new Date().valueOf() + "";
         }
       }
     },
@@ -656,6 +648,14 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           if (!this.ruleForm.good_ladder[rowIndex].search_loading) {
+            const { min_num } = this.ruleForm.good_ladder[rowIndex];
+            let findex = this.ruleForm.good_ladder.findIndex(
+              (v) => v.edit !== true && v.min_num + "" === min_num + ""
+            );
+            if (findex !== -1) {
+              this.$message.warning("当前已有相同起订量的销售价!");
+              return;
+            }
             let { isok, price, message } = await this.get_new(rowIndex);
             if (isok === 0) {
               this.ruleForm.good_ladder[rowIndex].new_sale_price = price;
@@ -697,39 +697,6 @@ export default {
         }
       }
     },
-    //阶梯成本修改
-    costrefreshEdit(e) {
-      let item = JSON.parse(JSON.stringify(e));
-      console.log(item);
-      const {
-        index,
-        id,
-        min_num,
-        sale_price,
-        market_price,
-        market_platform,
-        status,
-        is_del,
-      } = item;
-      let ffindex = -1;
-      this.ruleForm.good_ladder.forEach((i, findex) => {
-        if (findex === parseInt(index + "")) {
-          ffindex = findex;
-          this.ruleForm.good_ladder[findex].id = id;
-          this.ruleForm.good_ladder[findex].sale_price = sale_price;
-          this.ruleForm.good_ladder[findex].market_price = market_price;
-          this.ruleForm.good_ladder[findex].min_num = min_num;
-          this.ruleForm.good_ladder[findex].market_platform = market_platform;
-          this.ruleForm.good_ladder[findex].newTime = new Date().valueOf() + "";
-          this.ruleForm.good_ladder[findex].status = status;
-          this.ruleForm.good_ladder[findex].id_del = is_del;
-        }
-      });
-      if (ffindex === -1) {
-        this.ruleForm.good_ladder.push(item);
-      }
-      this.showModel = false;
-    },
 
     async resetForm() {
       // 重置
@@ -797,6 +764,18 @@ export default {
             this.loading = false;
             return;
           }
+          let isedit = false;
+          list.forEach((v) => {
+            if (v.edit) {
+              isedit = true;
+            }
+          });
+          if (isedit) {
+            this.$message.warning("请保存阶梯售价!");
+            this.loading = false;
+            return;
+          }
+
           let all_is_ok = true;
           for (let i = 0; i < this.ruleForm.good_ladder; i++) {
             this.ruleForm.good_ladder[i].search_loading = true;

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