xiaodai2022 2 years ago
parent
commit
542b2bd12e

+ 4 - 4
src/views/sellOut/filing/columns.js

@@ -365,7 +365,7 @@ const listCol = [
   {
     prop: "filingCode",
     label: "报备单编码",
-    width: "155",
+    minWidth: "155",
   },
   // {
   //   prop: "good_img",
@@ -376,7 +376,7 @@ const listCol = [
   {
     prop: "good_name",
     label: "商品名称",
-    width: "155",
+    minWidth: "155",
   },
 
   {
@@ -405,13 +405,13 @@ const listCol = [
   {
     prop: "companyCode",
     label: "客户编号",
-    width: "110",
+    minWidth: "110",
   },
 
   {
     prop: "companyName",
     label: "客户名称",
-    width: "110",
+    minWidth: "110",
   },
   {
     prop: "orderCode",

+ 6 - 64
src/views/sellOut/filing/detail.vue

@@ -172,7 +172,7 @@
                 :newTime="newTime"
                 v-if="newTime !== ''"
                 :disabled="!(status == '0' && ppowers.some((i) => i == '0'))"
-                :sitem="orderItem"
+                :sitem="this.sitem"
                 @searchChange="examFormSubmit($event, '')"
               />
             </el-collapse-item>
@@ -317,34 +317,7 @@ export default {
         this.sitem = JSON.parse(JSON.stringify(data));
         this.sitem.good_img = this.sitem.good_img.split(",");
 
-        const { status, exam_info } = this.sitem;
-        this.orderItem = {};
-        this.moneyDirItem = {};
-        this.moneyItem = {};
-        this.BossItem = {};
-        if (exam_info && exam_info.length > 0) {
-          exam_info.forEach((e) => {
-            console.log(e.status);
-            switch (e.info_status + "") {
-              case "0":
-                this.orderItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "2":
-                this.moneyDirItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "4":
-                this.moneyItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "7":
-                this.BossItem = JSON.parse(JSON.stringify(e));
-                break;
-              default:
-                this.orderItem = JSON.parse(JSON.stringify(e));
-            }
-          });
-          this.eaxmList = JSON.parse(JSON.stringify(exam_info));
-        }
-
+        const { status } = this.sitem;
         this.status = status;
 
         this.getNewTime();
@@ -362,46 +335,14 @@ export default {
 
     async examFormSubmit(e, title) {
       if (!this.loading) {
-        const { state, remark } = e;
-        let model = {
-          bargainNo: this.queryId,
-          status: state,
-          remark: remark,
-        };
         await this.$confirm(`确定要提交${title}审批结果?`, {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning",
         })
           .then(async () => {
-            const { after_price, lower_price } = this.sitem;
-            if (
-              this.status === "7" &&
-              after_price * 1 < lower_price * 1 &&
-              state + "" === "1"
-            ) {
-              this.loading = false;
-              await this.$confirm(
-                `当前商品同意议价后,售价已低于系统最低售价${this.sitem.lower_price}元!`,
-                `最终售价已低于系统最低售价!是否继续?`,
-
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "error",
-                }
-              )
-                .then(async () => {
-                  this.loading = true;
-                  await this.statusSubmit(model, title);
-                })
-                .catch(() => {
-                  this.loading = false;
-                  console.log("取消1");
-                });
-            } else {
-              await this.statusSubmit(model, title);
-            }
+            this.loading = true;
+            await this.statusSubmit(e, title);
           })
           .catch(() => {
             this.loading = false;
@@ -410,12 +351,13 @@ export default {
       }
     },
     async statusSubmit(model, title) {
+      model.companyCode = model.companyCode[0];
       const { code, data, message } = await asyncRequest.status(model);
       this.loading = false;
       // console.log("res", data);
       if (code === 0) {
         this.$notify.success({
-          title: title + "成功!",
+          title: "审核提交" + "成功!",
           message: "",
         });
         await this.initForm();

+ 28 - 7
src/views/sellOut/filing/exam-form.vue

@@ -169,14 +169,16 @@ export default {
           } = this.sitem;
           this.cgd_charge = cgd_charge;
           this.price = price;
+          console.log(this.sitem);
+          console.log(this.price);
           this.is_determine_price = is_determine_price;
           this.ruleForm = {
             id: id,
             status: "2",
             companyCode: companyCode ? [companyCode] : [],
             companyName,
-            service_charge,
-            service_proportion,
+            service_charge: service_charge ? service_charge : "0",
+            service_proportion: service_proportion ? service_proportion : "0",
             plat_code,
           };
         }
@@ -193,9 +195,6 @@ export default {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
       await this.num(key);
-      console.log(
-        this.ruleForm.service_charge + "-----" + this.ruleForm.service_proportion
-      );
     },
     async num(key) {
       const is_sale = this.is_determine_price === "1";
@@ -209,15 +208,22 @@ export default {
         cgdAdd = this.cgd_charge * 1;
       }
       if (key === "service_charge") {
-        serAdd = this.ruleForm.service_charge * 1;
+        serAdd = this.ruleForm.service_charge ?? "0" * 1;
       }
       if (key === "service_proportion") {
-        rate = this.ruleForm.service_proportion * 1;
+        rate = this.ruleForm.service_proportion ?? "0" * 1;
       }
       console.log(cgdAdd + "---" + serAdd + "---" + qrdAdd + "----" + rate);
       if (is_sale && key === "service_charge") {
+        if (qrdAdd <= serAdd) {
+          this.$message.error("服务费不能大于等于销售单价!");
+          await this.set_number_change("service_charge", "0");
+          await this.set_number_change("service_proportion", "0");
+          return;
+        }
         // cgdAdd = qrdAdd - serAdd;
         // rate = (1 - cgdAdd / qrdAdd)*100;
+
         cgdAdd = accSub(qrdAdd, serAdd);
         rate = accMul(accSub(1, accDiv(cgdAdd, qrdAdd)), 100);
         await this.set_number_change("service_proportion", rate);
@@ -225,6 +231,13 @@ export default {
       if (is_sale && key === "service_proportion") {
         // cgdAdd = qrdAdd * (100 - rate);
         // serAdd = qrdAdd - cgdAdd;
+        if (rate === 100) {
+          this.$message.error("服务费比例不能等于100!");
+          await this.set_number_change("service_charge", "0");
+          await this.set_number_change("service_proportion", "0");
+          return;
+        }
+
         cgdAdd = accMul(qrdAdd, accSub(100, rate));
         serAdd = accSub(qrdAdd, cgdAdd);
         await this.set_number_change("service_charge", serAdd);
@@ -232,6 +245,7 @@ export default {
       if (!is_sale && key === "service_charge") {
         // qrdAdd = cgdAdd + serAdd;
         // rate = 1 - cgdAdd / qrdAdd;
+
         qrdAdd = add_sum(cgdAdd, serAdd);
         rate = accSub(1, accDiv(cgdAdd, qrdAdd));
         await this.set_number_change("service_proportion", rate);
@@ -239,10 +253,17 @@ export default {
       if (!is_sale && key === "service_proportion") {
         // qrdAdd = cgdAdd / (100 - rate);
         // serAdd = qrdAdd - cgdAdd;
+        if (rate === 100) {
+          this.$message.error("服务费比例不能等于100!");
+          await this.set_number_change("service_charge", "0");
+          await this.set_number_change("service_proportion", "0");
+          return;
+        }
         qrdAdd = accDiv(cgdAdd, accSub(100, rate));
         serAdd = accSub(qrdAdd, cgdAdd);
         await this.set_number_change("service_charge", serAdd);
       }
+      console.log(cgdAdd + "---" + serAdd + "---" + qrdAdd + "----" + rate);
     },
     async set_number_change(key, value) {
       this.ruleForm[key] = value + "" || "0";