From 10c3bce9528daaf45682efa8b163e63c5006a72f Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 21 十二月 2023 18:36:05 +0800
Subject: [PATCH] 必填只能编辑数量,非必填编辑销售单价,成本单价,数量+成本单价不填写可以通过校验填写则需要校验大于0

---
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 6aabb56..0477013 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -408,7 +408,7 @@
               :show-summary="showSummary"
               pageName="quotation"
               :isOperate="((autoCodeHeadersObj.bjd=='yes'&&editConfig.infomation.quotation_number)||autoCodeHeadersObj.bjd!='yes')?true:false"
-              :quotationNumber="editConfig.infomation.quotation_number"
+              :quotationNumber="autoCodeHeadersObj.bjd=='yes'?editConfig.infomation.quotation_number:''"
               :product-table-list="productTableList"
               @inputContent="inputContent"
               @addProductClick="addProductClick"
@@ -674,6 +674,15 @@
           if (this.isNoProduct) {
             this.$message.error("璇烽�夋嫨浜у搧")
           } else {
+            for (let i = 0; i < this.tableData.length; i++) {
+              if (this.tableData[i].cost||Number(this.tableData[i].cost)==0) {
+                let reg = /^\+?[1-9]\d*$/;
+                if(!reg.test(this.tableData[i].cost)){
+                  this.$message.error("鎴愭湰鍗曚环闇�瑕佸~鍐欏ぇ浜�0鐨�2浣嶅皬鏁帮紒")
+                  return true;
+                }
+              }
+            }
             const params = this.saveParams()
             if (this.editConfig.title === "鏂板缓") {
               getAddSalesDetails(params).then((res) => {
@@ -961,9 +970,9 @@
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鍗曚綅", prop: "unit" },
           { label: "閿�鍞崟浠�", prop: "price",inputFloat: !isBjdRequird, isRequird: true },
-          { label: "鎴愭湰鍗曚环", prop: "cost",inputFloat: !isBjdRequird},
+          { label: "鎴愭湰鍗曚环", prop: "cost",input: !isBjdRequird},
           { label: "姣涘埄", prop: "profit" },
-          { label: "姣涘埄鐜�", prop: "margin",min:90},
+          { label: "姣涘埄鐜�(%)", prop: "margin",min:90},
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
           { label: "浠风◣鍚堣", prop: "total" }
         ]

--
Gitblit v1.8.0