戴艳蓉 3 tahun lalu
induk
melakukan
ac5be7d187

+ 2 - 0
src/apis/service/goodStore/goodsCost/index.js

@@ -28,5 +28,7 @@ export default {
   catinfo: (data, params) => http(api + "catinfo", data, "post", params),
   // 删除
   copy: (data, params) => http(api + "goodupcopy", data, "post", params),
+  // 取实时金价
+  golpricelast: (data, params) => http(api + "golpricelast", data, "post", params),
 
 };

+ 3 - 0
src/assets/js/btnList.js

@@ -78,6 +78,9 @@ const btnList = [
   { code: "077", name: "删除支持品牌" },
   { code: "078", name: "再次发起审核流程" },
   { code: "079", name: "下线商品" },
+  { code: "080", name: "库管发货" },
+  { code: "081", name: "添加发货申请" },
+  // { code: "082", name: "发货申请" },
 
 ];
 export default btnList;

+ 2 - 2
src/components/globalComponents/digital-input/main.vue

@@ -50,11 +50,11 @@ export default {
   ],
   watch: {
     values: function (val) {
-      console.log(this.name + "=" + val);
+      // console.log(this.name + "=" + val);
       this.num = val;
     },
     newTime: function (val) {
-      console.log(this.name + "=" + this.values);
+      // console.log(this.name + "=" + this.values);
       this.num = this.values;
     },
   },

+ 0 - 7
src/views/goodStore/goodsCost/columns.js

@@ -415,13 +415,6 @@ const rules = {
 
   
 
-  mark_fee: [
-    {
-      required: true,
-      validator: validate_num,
-      trigger: "blur",
-    },
-  ],
   demo_fee: [
     {
       required: true,

+ 168 - 133
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -249,6 +249,7 @@
                     "
                     style="width: 100%"
                     placeholder="启用实时金价"
+                    @change="is_goold_price_change"
                   >
                     <el-option
                       v-for="group in options5"
@@ -734,10 +735,6 @@
                 <p>1:1</p>
               </div>
             </el-form-item>
-            <div style="font-size: 12px; color: #606266">
-              <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
-              <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
-            </div>
           </el-col>
           <el-col :span="9">
             <el-form-item label="商品主图" prop="good_img">
@@ -837,38 +834,29 @@
               </div>
             </el-form-item>
           </el-col>
+          <el-col :span="24">
+            <div style="font-size: 12px; color: #606266">
+              <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
+              <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
+            </div>
+          </el-col>
         </el-row>
       </el-col>
     </el-row>
     <el-row class="ddiv">
       <el-col :span="1" class="dtitle">
-        <ul style="padding: 20px 0 0 0">
+        <ul>
           <li>固</li>
           <li>定</li>
+          <li>与</li>
+          <li>阶</li>
+          <li>梯</li>
           <li>成</li>
           <li>本</li>
         </ul></el-col
       >
       <el-col :span="23" class="dmain">
         <el-row>
-          <el-col :span="6">
-            <el-form-item label="加标费" prop="mark_fee" label-width="75px">
-              <digital-input
-                :values="ruleForm.mark_fee"
-                :placeholder="'加标费'"
-                :min="0"
-                :name="'ruleForm.mark_fee'"
-                :disabled="type === 'view' || type === 'editBase'"
-                :max="100000000000"
-                :position="'right'"
-                :precision="2"
-                :size="'mini'"
-                :controls="false"
-                :append="'元'"
-                @reschange="number_change($event, 'mark_fee')"
-              />
-            </el-form-item>
-          </el-col>
           <el-col :span="6">
             <el-form-item label="打样费" prop="demo_fee" label-width="75px">
               <digital-input
@@ -942,7 +930,29 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="8" v-show="is_noble">
+          <el-col :span="6">
+            <el-form-item label="启用阶梯" prop="is_step">
+              <el-select
+                v-model="ruleForm.is_step"
+                filterable
+                :disabled="type === 'view' || type === 'editBase'"
+                style="width: 100%"
+                placeholder="启用阶梯"
+                @change="is_step_change"
+              >
+                <el-option
+                  v-for="group in options5"
+                  :key="group.id"
+                  :label="group.name"
+                  :value="group.id"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col
+            :span="6"
+            v-show="is_noble && ruleForm && ruleForm.is_gold_price === '1'"
+          >
             <el-form-item
               label="供应商采购金价"
               prop="cgd_gold_price"
@@ -964,37 +974,18 @@
               />
             </el-form-item>
           </el-col>
-        </el-row>
-      </el-col>
-    </el-row>
-    <el-row class="ddiv">
-      <el-col :span="1" class="dtitle">
-        <ul>
-          <li>阶</li>
-          <li>梯</li>
-          <li>成</li>
-          <li>本</li>
-        </ul></el-col
-      >
-      <el-col :span="23" class="dmain">
-        <el-row>
-          <el-col :span="6">
-            <el-form-item label="启用阶梯" prop="is_step">
-              <el-select
-                v-model="ruleForm.is_step"
-                filterable
-                :disabled="type === 'view' || type === 'editBase'"
-                style="width: 100%"
-                placeholder="启用阶梯"
-                @change="is_step_change"
+          <el-col
+            :span="6"
+            v-show="is_noble && ruleForm && ruleForm.is_gold_price === '1'"
+          >
+            <el-form-item label="当前金价">
+              <el-input
+                v-model="ruleForm.noble_price"
+                disabled
+                placeholder="当前金价"
+              >
+                <template slot="append">元/g</template></el-input
               >
-                <el-option
-                  v-for="group in options5"
-                  :key="group.id"
-                  :label="group.name"
-                  :value="group.id"
-                />
-              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="24" style="padding-left: 18px">
@@ -1006,13 +997,14 @@
               style="width: 100%; margin: 0 0 20px 0"
             >
               <el-table-column prop="min_num" label="起订量(>=)" />
-              <el-table-column prop="nake_price" label="裸价" />
-              <el-table-column prop="cert_fee" label="证书费" />
-              <el-table-column prop="packing_fee" label="包装费" />
+              <el-table-column prop="nake_fee" label="成本单价" />
               <el-table-column prop="cost_fee" label="工艺费" />
               <el-table-column prop="delivery_fee" label="物流费" />
-              <el-table-column prop="new_nake_fee" label="系统成本合计" />
-              <el-table-column prop="nake_fee" label="系统成本合计" />
+              <el-table-column prop="cert_fee" label="证书费" />
+              <el-table-column prop="mark_fee" label="加标费" />
+              <el-table-column prop="package_fee" label="包装费" />
+              <el-table-column prop="other_fee" label="其他费用" />
+              <el-table-column prop="nake_total" label="成本合计" />
               <el-table-column
                 fixed="right"
                 v-if="type === 'add' || type === 'editCoin' || type === 'edit'"
@@ -1051,7 +1043,6 @@
           :index="costmodelIndex"
           :show-model="costshowModel"
           :sitem="costsitem"
-          :goodsitem="ruleForm"
           @refresh="costrefreshEdit"
           @cancel="costshowModel = false"
         />
@@ -1171,11 +1162,13 @@ export default {
       await this.resetForm();
       this.sch_is_noble();
       this.good_type_change();
+      await this.get_golpricelast();
       this.loading = false;
     },
-    number_change(e, key) {
+    async number_change(e, key) {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
+      await this.get_all_fee();
     },
     openEdit(index, sitem) {
       this.modelIndex = index;
@@ -1380,6 +1373,10 @@ export default {
             nake_fee: a.nake_fee,
             cost_fee: a.cost_fee,
             delivery_fee: a.delivery_fee,
+            cert_fee: a.cert_fee,
+            mark_fee: a.mark_fee,
+            package_fee: a.package_fee,
+            other_fee: a.other_fee,
             is_del: a.is_del || "0",
           };
           resList.push(m);
@@ -1444,7 +1441,7 @@ export default {
           ffindex = findex;
           this.spec_tableData[findex].id = id;
           this.spec_tableData[findex].spec_id = spec_id;
-          this.spec_tableData[findex].isMust = isMust;
+          // this.spec_tableData[findex].isMust = isMust;
           this.spec_tableData[findex].spec_value = spec_value;
           this.spec_tableData[findex].spec_value_id = spec_value_id;
           this.spec_tableData[findex].spec_value_value = spec_value_value;
@@ -1456,25 +1453,101 @@ export default {
       this.showModel = false;
     },
     //阶梯成本修改
-    costrefreshEdit(e) {
+    async costrefreshEdit(e) {
       let item = JSON.parse(JSON.stringify(e));
-      const { index, id, cost_fee, delivery_fee, min_num, nake_fee } = item;
+      const {
+        index,
+        id,
+        cost_fee,
+        delivery_fee,
+        min_num,
+        nake_fee,
+        cert_fee,
+        mark_fee,
+        package_fee,
+        other_fee,
+      } = item;
       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].min_num = min_num;
           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;
     },
+    async get_golpricelast() {
+      const { noble_metal } = this.ruleForm;
+      if (noble_metal) {
+        let model = {
+          type: noble_metal,
+        };
+        const { code, data, message } = await asyncRequest.golpricelast(model);
+        if (code === 0) {
+          data.forEach((e) => {
+            if (e.type) {
+              this.ruleForm.noble_price = e.price;
+            }
+          });
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
+        }
+      } else {
+        this.ruleForm.noble_price = "0";
+      }
+    },
+    async get_all_fee() {
+      await this.get_golpricelast();
+      this.ladder_tableData.forEach((si, sii) => {
+        this.ladder_tableData[sii].nake_total = this.count_fee(si);
+      });
+    },
+    count_fee(e) {
+      const {
+        noble_price, //贵金属实时金价
+        is_gold_price, //是否启用实时金价
+        noble_weight, //贵金属重量
+      } = this.ruleForm;
+      const {
+        cost_fee, //工艺费
+        delivery_fee, //物流费
+        nake_fee, //成本单价
+        cert_fee, //证书费
+        mark_fee, //加标费
+        package_fee, //包装费
+        other_fee, //其他费用
+      } = e;
+      let total =
+        package_fee * 100 +
+        nake_fee * 100 +
+        mark_fee * 100 +
+        cert_fee * 100 +
+        delivery_fee * 100 +
+        other_fee * 100;
+      if (this.is_noble && is_gold_price) {
+        let a = noble_price * 100;
+        let b = noble_weight * 1000;
+        let c = cost_fee * 100;
+        let ab = parseInt((a * b) / 1000);
+        let bc = parseInt((b * c) / 1000);
+        total += ab + bc;
+      }
+      return parseFloat(total / 100);
+    },
     dataSort(key) {
       return function (a, b) {
         let value1 = a[key];
@@ -1500,7 +1573,7 @@ export default {
         cat_id: [],
         brandid: [],
         noble_weight: "0",
-        weight: "",
+        weight: "0",
         good_type: "0",
         is_stock: "0",
         supplierNo: [],
@@ -1512,8 +1585,8 @@ export default {
         is_exclusive: [],
         noble_metal: "",
         is_gold_price: "",
-        moq: "0",
-        customized: "0",
+        moq: "",
+        customized: "",
         after_sales: "",
         craft_desc: "",
         good_remark: "",
@@ -1535,16 +1608,12 @@ export default {
         good_img: [],
         good_info_img: [],
         //固定阶梯成本
-        cert_fee: "0",
-        packing_fee: "0",
-        cost_fee: "0",
-        mark_fee: "0",
         demo_fee: "0",
         open_fee: "0",
         sample_fee: "0",
         market_price: "0",
-        nake_price: "0",
         cgd_gold_price: "0",
+        noble_price: "0",
         is_step: "0",
         is_diff: "",
         config: [],
@@ -1605,22 +1674,18 @@ export default {
             good_img, //	string	商品图片
             good_thumb_img, //	string	商品说略图
             good_info_img, //	string	商品详情图
-            cert_fee, //	string	证书费
-            packing_fee, //	string	打包费
-            cost_fee, //	string	工艺费
-            mark_fee, //	string	加标费
             demo_fee, //	string	打样费
             open_fee, //	string	开模费
             noble_metal, //	string	金属类别
             noble_weight, //	string	金属重量
             is_gold_price, //	string	是否使用实时金价
             market_price, //	string	市场价
-            nake_price, //	string	成本裸价
             cgd_gold_price, //	string	供应商采购金价
+            noble_price,
             is_step, //	string	是否使用阶梯价
             // is_online, //	string	是否上线
             status, //		string	状态
-            nakelist, //梯成本
+            nakelist, //梯成本
             speclist, //商品规格
             brand_name,
             config,
@@ -1700,7 +1765,7 @@ export default {
             unit: good_unit ? [good_unit] : [],
             is_exclusive: exclusiveList || [],
             noble_metal: noble_metal || "",
-            is_gold_price: is_gold_price || "",
+            is_gold_price: is_gold_price || "0",
             moq: moq || "0",
             customized: customized || "0",
             after_sales: after_sales || "",
@@ -1728,16 +1793,12 @@ export default {
               ? (good_info_img || "").split(",")
               : [],
             //固定阶梯成本
-            cert_fee: cert_fee || "",
-            packing_fee: packing_fee || "",
-            cost_fee: cost_fee || "",
-            mark_fee: mark_fee || "",
             demo_fee: demo_fee || "",
             open_fee: open_fee || "",
             sample_fee: sample_fee || "",
             market_price: market_price || "",
-            nake_price: nake_price || "",
             cgd_gold_price: cgd_gold_price || "",
+            noble_price: noble_price || "0",
             is_step: is_step || "0",
             is_diff: is_diff || "",
             config: config ? config.split(",") : [],
@@ -1758,8 +1819,15 @@ export default {
         "cgd_gold_price",
       ];
       for (let i = 0; i < list.length; i++) {
-        this.rulesThis[list[i]][0].required = this.is_noble;
-        console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
+        if (list[i] === "cgd_gold_price") {
+          const { is_gold_price } = this.ruleForm;
+          this.rulesThis[list[i]][0].required =
+            this.is_noble && is_gold_price === "1";
+          console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
+        } else {
+          this.rulesThis[list[i]][0].required = this.is_noble;
+        }
+
         this.$refs.ruleForm.validateField(list[i]);
       }
     },
@@ -1767,50 +1835,35 @@ export default {
       let item = null;
       if (type === 1) {
         item = JSON.parse(JSON.stringify(model));
-        delete item["cert_fee"];
-        delete item["packing_fee"];
-        delete item["cost_fee"];
-        delete item["mark_fee"];
         delete item["demo_fee"];
         delete item["open_fee"];
         delete item["noble_metal"];
         delete item["noble_weight"];
         delete item["is_gold_price"];
         delete item["market_price"];
-        delete item["nake_price"];
         delete item["cgd_gold_price"];
         delete item["is_step"];
         delete item["good_ladder"];
       } else {
         const {
-          cert_fee,
-          packing_fee,
-          cost_fee,
-          mark_fee,
           demo_fee,
           open_fee,
           noble_metal,
           noble_weight,
           is_gold_price,
           market_price,
-          nake_price,
           cgd_gold_price,
           is_step,
           good_ladder,
           spuCode,
         } = model;
         item = {
-          cert_fee: cert_fee || "",
-          packing_fee: packing_fee || "",
-          cost_fee: cost_fee || "",
-          mark_fee: mark_fee || "",
           demo_fee: demo_fee || "",
           open_fee: open_fee || "",
           noble_metal: noble_metal || "",
           noble_weight: noble_weight || "",
           is_gold_price: is_gold_price || "",
           market_price: market_price || "",
-          nake_price: nake_price || "",
           cgd_gold_price: cgd_gold_price || "",
           is_step: is_step || "",
           good_ladder: good_ladder || [],
@@ -1829,6 +1882,7 @@ export default {
       this.is_noble = pid === "6";
       this.sch_is_noble();
       await this.set_must_spec();
+      await this.get_all_fee();
     },
     async set_must_spec() {
       const { cat_id } = this.ruleForm;
@@ -1897,36 +1951,25 @@ export default {
         });
       }
     },
-
+    async is_goold_price_change(e) {
+      await this.get_all_fee();
+    },
     //商品品牌选择
     brandidsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.brandid = [id];
-      } else {
-        this.ruleForm.brandid = [];
-      }
+      this.ruleForm.brandid = id ? [id] : [];
       this.$refs.ruleForm.validateField("brandid");
     },
     //供应商选择
     supplierNosearchChange(e) {
-      console.log(e);
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.supplierNo = [code];
-      } else {
-        this.ruleForm.supplierNo = [];
-      }
+      this.ruleForm.supplierNo = code ? [code] : [];
       this.$refs.ruleForm.validateField("supplierNo");
     },
     //业务企业选择
     company_idsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.company_id = code;
-      } else {
-        this.ruleForm.company_id = "";
-      }
+      this.ruleForm.company_id = code || "";
       this.$refs.ruleForm.validateField("company_id");
     },
     //税点选择
@@ -1942,23 +1985,15 @@ export default {
     //单位选择
     unitsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.unit = [code];
-      } else {
-        this.ruleForm.unit = [];
-      }
+      this.ruleForm.unit = code ? [code] : [];
       this.$refs.ruleForm.validateField("unit");
     },
     //贵金属种类选择
-    noble_metalsearchChange(e) {
-      console.log(e);
+    async noble_metalsearchChange(e) {
       const { id, code, label } = e;
-      if (id) {
-        this.ruleForm.noble_metal = id;
-      } else {
-        this.ruleForm.noble_metal = "";
-      }
+      this.ruleForm.noble_metal = id || "";
       this.$refs.ruleForm.validateField("noble_metal");
+      await this.get_all_fee();
     },
     //省市区
     selectAreaChange(e, key) {
@@ -1989,11 +2024,11 @@ export default {
       let list = ["moq", "customized"];
       for (let i = 0; i < list.length; i++) {
         this.rulesThis[list[i]][0].required = this.ruleForm.good_type === "1";
-        console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
+        // console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
         this.$refs.ruleForm.validateField(list[i]);
       }
     },
-    imgUploadError(res, key) {
+    UploadErrorEvent(res, key) {
       if (res !== "break") {
         this.$message.error("图片上传失败!");
         this.$refs.ruleForm.validateField(key);

+ 81 - 79
src/views/goodStore/goodsCost/components/costFormAddEdit.vue

@@ -32,7 +32,6 @@
                     :values="ruleForm.min_num"
                     :placeholder="'起订量'"
                     :min="0"
-                    :name="'ruleForm.min_num'"
                     :disabled="false"
                     :max="100000000000"
                     :position="'right'"
@@ -45,12 +44,11 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="裸价" prop="nake_price">
+                <el-form-item label="成本单价" prop="nake_fee">
                   <digital-input
-                    :values="ruleForm.nake_price"
-                    :placeholder="'价'"
+                    :values="ruleForm.nake_fee"
+                    :placeholder="'成本单价'"
                     :min="0"
-                    :name="'ruleForm.nake_price'"
                     :disabled="false"
                     :max="100000000000"
                     :position="'right'"
@@ -58,17 +56,16 @@
                     :size="'mini'"
                     :controls="false"
                     :append="'元'"
-                    @reschange="number_change($event, 'nake_price')"
+                    @reschange="number_change($event, 'nake_fee')"
                   />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="证书费" prop="cert_fee">
+                <el-form-item label="工艺费" prop="cost_fee">
                   <digital-input
-                    :values="ruleForm.cert_fee"
-                    :placeholder="'证书费'"
+                    :values="ruleForm.cost_fee"
+                    :placeholder="'工艺费'"
                     :min="0"
-                    :name="'ruleForm.cert_fee'"
                     :disabled="false"
                     :max="100000000000"
                     :position="'right'"
@@ -76,17 +73,16 @@
                     :size="'mini'"
                     :controls="false"
                     :append="'元'"
-                    @reschange="number_change($event, 'cert_fee')"
+                    @reschange="number_change($event, 'cost_fee')"
                   />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="包装费" prop="packing_fee">
+                <el-form-item label="物流费" prop="delivery_fee">
                   <digital-input
-                    :values="ruleForm.nake_fee"
-                    :placeholder="'packing_fee'"
+                    :values="ruleForm.delivery_fee"
+                    :placeholder="'物流费'"
                     :min="0"
-                    :name="'ruleForm.packing_fee'"
                     :disabled="false"
                     :max="100000000000"
                     :position="'right'"
@@ -94,17 +90,17 @@
                     :size="'mini'"
                     :controls="false"
                     :append="'元'"
-                    @reschange="number_change($event, 'packing_fee')"
+                    @reschange="number_change($event, 'delivery_fee')"
                   />
                 </el-form-item>
               </el-col>
+
               <el-col :span="12">
-                <el-form-item label="工艺费" prop="cost_fee">
+                <el-form-item label="证书费" prop="cert_fee">
                   <digital-input
-                    :values="ruleForm.cost_fee"
-                    :placeholder="'工艺费'"
+                    :values="ruleForm.cert_fee"
+                    :placeholder="'证书费'"
                     :min="0"
-                    :name="'ruleForm.cost_fee'"
                     :disabled="false"
                     :max="100000000000"
                     :position="'right'"
@@ -112,17 +108,16 @@
                     :size="'mini'"
                     :controls="false"
                     :append="'元'"
-                    @reschange="number_change($event, 'cost_fee')"
+                    @reschange="number_change($event, 'cert_fee')"
                   />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="物流费" prop="delivery_fee">
+                <el-form-item label="加标费" prop="mark_fee">
                   <digital-input
-                    :values="ruleForm.delivery_fee"
-                    :placeholder="'物流费'"
+                    :values="ruleForm.mark_fee"
+                    :placeholder="'加标费'"
                     :min="0"
-                    :name="'ruleForm.delivery_fee'"
                     :disabled="false"
                     :max="100000000000"
                     :position="'right'"
@@ -130,28 +125,34 @@
                     :size="'mini'"
                     :controls="false"
                     :append="'元'"
-                    @reschange="number_change($event, 'delivery_fee')"
+                    @reschange="number_change($event, 'mark_fee')"
                   />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="系统成本合计" label-width="110px" required>
-                  <el-input
-                    v-model="ruleForm.new_nake_fee"
-                    disabled
-                    placeholder="系统成本合计"
-                  >
-                    <template slot="append">元</template></el-input
-                  >
+                <el-form-item label="包装费" prop="package_fee">
+                  <digital-input
+                    :values="ruleForm.package_fee"
+                    :placeholder="'包装费'"
+                    :min="0"
+                    :disabled="false"
+                    :max="100000000000"
+                    :position="'right'"
+                    :precision="2"
+                    :size="'mini'"
+                    :controls="false"
+                    :append="'元'"
+                    @reschange="number_change($event, 'package_fee')"
+                  />
                 </el-form-item>
               </el-col>
+
               <el-col :span="12">
-                <el-form-item label="成本合计" prop="nake_fee">
+                <el-form-item label="其他费用" prop="other_fee">
                   <digital-input
-                    :values="ruleForm.nake_fee"
-                    :placeholder="'成本合计'"
+                    :values="ruleForm.other_fee"
+                    :placeholder="'其他费用'"
                     :min="0"
-                    :name="'ruleForm.nake_fee'"
                     :disabled="false"
                     :max="100000000000"
                     :position="'right'"
@@ -159,21 +160,21 @@
                     :size="'mini'"
                     :controls="false"
                     :append="'元'"
-                    @reschange="number_change($event, 'nake_fee')"
+                    @reschange="number_change($event, 'other_fee')"
                   />
                 </el-form-item>
               </el-col>
+              <el-col :span="24" style="text-align: right">
+                <el-button :size="'small'" type="primary" @click="submitForm"
+                  >保 存
+                </el-button>
+                <el-button @click="showModelThis = false" :size="'small'">{{
+                  "取 消"
+                }}</el-button>
+              </el-col>
             </el-row>
           </el-form>
         </el-col>
-        <el-col :span="24" style="text-align: right">
-          <el-button :size="'small'" type="primary" @click="submitForm"
-            >保 存
-          </el-button>
-          <el-button @click="showModelThis = false" :size="'small'">{{
-            "取 消"
-          }}</el-button>
-        </el-col>
       </el-row>
     </el-card>
   </el-dialog>
@@ -182,7 +183,7 @@
 import resToken from "@/mixins/resToken";
 export default {
   name: "brand",
-  props: ["showModel", "index", "sitem", "goodsitem"],
+  props: ["showModel", "index", "sitem"],
   mixins: [resToken],
   data() {
     const validate_num_0 = (rule, value, callback) => {
@@ -227,7 +228,7 @@ export default {
             trigger: "blur",
           },
         ],
-        packing_fee: [
+        package_fee: [
           {
             required: true,
             validator: validate_num,
@@ -242,11 +243,19 @@ export default {
             trigger: "blur",
           },
         ],
+
+        mark_fee: [
+          {
+            required: true,
+            validator: validate_num,
+            trigger: "blur",
+          },
+        ],
         nake_fee: [
-          { required: true, message: "成本合计不能为空!", trigger: "blur" },
+          { required: true, validator: validate_num, trigger: "blur" },
         ],
         delivery_fee: [
-          { required: true, message: "物流费不能为空!", trigger: "blur" },
+          { required: true, validator: validate_num, trigger: "blur" },
         ],
       },
     };
@@ -296,12 +305,26 @@ export default {
           id: "",
           index: "-1",
           min_num: "0",
-          cost_fee: "0",
           nake_fee: "0",
+          cost_fee: "0",
           delivery_fee: "0",
+          cert_fee: "0",
+          mark_fee: "0",
+          package_fee: "0",
+          other_fee: "0",
         };
       } else {
-        const { id, min_num, cost_fee, nake_fee, delivery_fee } = this.sitem;
+        const {
+          id,
+          min_num,
+          nake_fee,
+          cost_fee,
+          delivery_fee,
+          cert_fee,
+          mark_fee,
+          package_fee,
+          other_fee,
+        } = this.sitem;
         this.ruleForm = {
           id: id || "",
           index: this.index,
@@ -309,6 +332,10 @@ export default {
           cost_fee: cost_fee || "0",
           nake_fee: nake_fee || "0",
           delivery_fee: delivery_fee || "0",
+          cert_fee: cert_fee || "0",
+          mark_fee: mark_fee || "0",
+          package_fee: package_fee || "0",
+          other_fee: other_fee || "0",
         };
       }
     },
@@ -317,32 +344,7 @@ export default {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
     },
-    async get_new_nake_price() {
-      const { nake_price, cert_fee, packing_fee, cost_fee, delivery_fee } =
-        this.ruleForm;
-      const { mark_fee, is_gold_price, noble_metal, cat_id, noble_weight } =
-        this.goodsitem;
-      let is_noble = false,
-        new_p = 0;
-      if (cat_id && cat_id.length > 0) {
-        cat_id.foreach((a) => {
-          if (a === "6") {
-            is_noble = true;
-          }
-        });
-      }
-      // this.ruleForm.new_nake_fee
-      new_p =
-        packing_fee * 100 +
-        nake_price * 100 +
-        mark_fee * 100 +
-        cert_fee * 100 +
-        delivery_fee * 100;
-      if (is_noble) {
-        // new_p+=is_gold_price
-      }
-      this.ruleForm.new_nake_fee = parseFloat(new_p);
-    },
+
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {

+ 6 - 5
src/views/purchaseIn/wsmInOrder/components/wsm-in-order-addEdit-form.vue

@@ -318,19 +318,20 @@ export default {
           this.loading = true;
           let model = JSON.parse(JSON.stringify(this.ruleForm));
           model.post_company = model.post_company.toString();
-
-          const res = await asyncRequest.orderinadd(model);
+          const { code, message } = await asyncRequest.orderinadd(model);
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             this.$notify.success({
               title: "添加成功",
               message: "",
             });
             this.$emit("refresh"); //抛出事件给详情页。
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
+          } else if (code === "1009") {
+            this.$message.warning(`${message},请刷新采购单详情重试!`);
           } else {
-            this.$message.warning(res.message);
+            this.$message.warning(message);
           }
         } else {
           console.log("error submit!!");

+ 51 - 45
src/views/sellOut/sellOutOrder/detail.vue

@@ -4,9 +4,10 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-    <p>{{ status }}---{{ powers }}</p>
-     <div class="detail-page-title">
-        <span>销售出库单编号:</span><span v-if="sitem">{{ sitem.outCode }}</span>
+      <p>{{ status }}---{{ powers }}</p>
+      <div class="detail-page-title">
+        <span>销售出库单编号:</span
+        ><span v-if="sitem">{{ sitem.outCode }}</span>
         <el-button
           class="fr"
           v-if="status === '2' && powers.some((item) => item == '049')"
@@ -25,53 +26,58 @@
         :options="statusOptions"
         :status="status"
       />
-       <el-tabs v-model="activeTabs">
+      <el-tabs v-model="activeTabs">
         <el-tab-pane label="业务详情" name="1">
-      <el-collapse v-model="activeNames" style="margin:-18px 0 0 0">
-        <el-collapse-item title="销售出库单详情" name="1">
-          <show-data-table
-            :newTime="newTime"
-            v-if="newTime !== ''"
-            :sitem="sitem"
-            :columns="ShowDataTableColumns"
-          >
-            <template slot="status">
-              <el-tag
-                :size="'mini'"
-                :type="sitem.status == '0' ? 'warning' : ''"
-                v-text="
-                  (
-                    statusOptions.find((item) => item.value == sitem.status) ||
-                    {}
-                  ).label || '--'
-                "
-              ></el-tag>
-            </template>
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
+            <el-collapse-item title="销售出库单详情" name="1">
+              <show-data-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="sitem"
+                :columns="ShowDataTableColumns"
+              >
+                <template slot="status">
+                  <el-tag
+                    :size="'mini'"
+                    :type="sitem.status == '0' ? 'warning' : ''"
+                    v-text="
+                      (
+                        statusOptions.find(
+                          (item) => item.value == sitem.status
+                        ) || {}
+                      ).label || '--'
+                    "
+                  ></el-tag>
+                </template>
                 <template slot="order_type">
-              <el-tag
-                :size="'mini'"
-                :type="''" >{{sitem.status==='1'?'销售出库单':"咨询出库单"}}</el-tag>
-            </template>
-          </show-data-table>
+                  <el-tag :size="'mini'" :type="''">{{
+                    sitem.status === "1" ? "销售出库单" : "咨询出库单"
+                  }}</el-tag>
+                </template>
+              </show-data-table>
 
-          <!-- <add-edit-form
+              <!-- <add-edit-form
             :sitem="sitem"
             :newTime="newTime"
             v-if="newTime != ''"
           ></add-edit-form> -->
-        </el-collapse-item>
-        <el-collapse-item
-          title="客户验收"
-          name="3"
-          v-if="status === '1' && powers.some((item) => item == '052')"
-        >
-          <div class="tr" style="padding: 0 0 20px 0">
-            <el-button type="primary" plain :size="'mini'" @click="goodsCheck"
-              >客户已收到货</el-button
+            </el-collapse-item>
+            <el-collapse-item
+              title="客户验收"
+              name="3"
+              v-if="status === '1' && powers.some((item) => item == '052')"
             >
-          </div>
-        </el-collapse-item>
-        <!-- <el-collapse-item title="填写售后申请单" name="3" v-if="status === '4'">
+              <div class="tr" style="padding: 0 0 20px 0">
+                <el-button
+                  type="primary"
+                  plain
+                  :size="'mini'"
+                  @click="goodsCheck"
+                  >客户已收到货</el-button
+                >
+              </div>
+            </el-collapse-item>
+            <!-- <el-collapse-item title="填写售后申请单" name="3" v-if="status === '4'">
           <sell-return-apply
             :sitem="sitem"
             v-if="newTime != '' || true"
@@ -79,9 +85,8 @@
             @refresh="updateStatus"
           />
         </el-collapse-item> -->
- 
-      </el-collapse>
-      </el-tab-pane>
+          </el-collapse>
+        </el-tab-pane>
         <el-tab-pane label="审批记录" name="2">
           <process-time-line
             v-if="newTime !== ''"
@@ -149,6 +154,7 @@ export default {
       showModel: false,
       loading: false,
       statusOptions: [
+        { value: "0", label: "待库管发货" },
         { value: "1", label: "待客户验收" },
         { value: "2", label: "订单出库完成" },
       ],