From 2c687f86a2fdd8bdffc3ac8ce04eca1126646288 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期一, 13 十一月 2023 16:14:54 +0800
Subject: [PATCH] 所有涉及到产品的增加单位回显、收款计划增加金额不能为零、销售明细单未确认状态显示修改

---
 src/views/service/serviceContract/AddServiceContractDialog.vue |   36 +++--
 src/views/other/payment/saleInvoice/addSaleInvoice.vue         |  104 ++++++++--------
 src/views/client/salesLead/AdvanceDialog.vue                   |    4 
 src/views/sales/quotation/AddQuotationDialog.vue               |   20 +-
 src/views/sales/subOrder/AddSubOrderDialog.vue                 |   24 ++-
 src/components/makepager/CommonFormTableView.vue               |    3 
 src/views/other/payment/collectionPlan/AddCollectionPlan.vue   |   23 +++
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue         |    5 
 src/views/sales/salesReturn/AddSalesReturnDialog.vue           |    1 
 src/views/sales/refundForm/AddRefundFormDialog.vue             |   42 +++---
 src/views/sales/salesDetails/index.vue                         |   71 ++++++-----
 11 files changed, 187 insertions(+), 146 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 66158ed..364b17f 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -415,6 +415,7 @@
           ite.number = item.number
           ite.price = item.price
           ite.total = item.amount ? item.amount * item.price : 1 * item.price
+          ite.unit = item.unit
         }
       })
     },
@@ -436,6 +437,7 @@
           ite.number = item.number
           ite.price = item.price
           ite.total = item.amount ? item.amount * item.price : 1 * item.price
+          ite.unit = item.unit
         }
       })
     },
@@ -449,6 +451,7 @@
           ite.number = ""
           ite.price = 0
           ite.total = 0
+          ite.unit = ""
         }
       })
       this.$emit("clearupProduct", this.tableList.tableData)
diff --git a/src/views/client/salesLead/AdvanceDialog.vue b/src/views/client/salesLead/AdvanceDialog.vue
index 9fef5a7..d3606c5 100644
--- a/src/views/client/salesLead/AdvanceDialog.vue
+++ b/src/views/client/salesLead/AdvanceDialog.vue
@@ -97,11 +97,11 @@
   methods: {
     setData(status) {
       if (status === 0) {
-        this.options = ["璺熻繘涓�", "澶辫触鍏抽棴", "鍗囩骇鍒板鎴�", "鍗囩骇鍒板鎴峰拰閿�鍞満浼�"]
+        this.options = ["璺熻繘涓�", "鍗囩骇鍒板鎴�", "鍗囩骇鍒板鎴峰拰閿�鍞満浼�", "澶辫触鍏抽棴"]
         this.value = "璺熻繘涓�"
         this.value1 = "璺熻繘涓�"
       } else if (status === 1) {
-        this.options = ["澶辫触鍏抽棴", "鍗囩骇鍒板鎴�", "鍗囩骇鍒板鎴峰拰閿�鍞満浼�"]
+        this.options = ["鍗囩骇鍒板鎴�", "鍗囩骇鍒板鎴峰拰閿�鍞満浼�", "澶辫触鍏抽棴"]
         this.value = "澶辫触鍏抽棴"
         this.value1 = "澶辫触鍏抽棴"
       } else if (status === -1) {
diff --git a/src/views/other/payment/collectionPlan/AddCollectionPlan.vue b/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
index 879de0b..c3cd4b1 100644
--- a/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
+++ b/src/views/other/payment/collectionPlan/AddCollectionPlan.vue
@@ -106,7 +106,13 @@
                   "
                 ></el-input>
                 <div v-else-if="item.date">
-                  <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 130px">
+                  <el-date-picker
+                    v-model="scope.row[item.prop]"
+                    type="date"
+                    value-format="yyyy-MM-dd"
+                    size="mini"
+                    style="width: 130px"
+                  >
                   </el-date-picker>
                 </div>
                 <div v-else @click="delClick(scope.row)"><i class="el-icon-delete"></i></div>
@@ -229,9 +235,12 @@
     // 淇濆瓨
     saveClick() {
       this.sumTotalAmount()
+      console.log(this.amount)
       if (this.editConfig.title === "鏂板缓") {
         if (this.principalId === 0) {
           this.$message.error("璇烽�夋嫨鏀舵璁″垝璐熻矗浜�")
+        } else if (this.amount === 0) {
+          this.$message.error("鏀舵閲戦涓嶈兘涓�0")
         } else if (this.amount !== this.planAmount) {
           this.$message.error("鏀舵璁″垝鍜屾湭璁″垝閲戦涓嶄竴鑷达紝璇烽噸绠�")
         } else {
@@ -247,7 +256,7 @@
         }
       }
     },
-    droppedClick(){
+    droppedClick() {
       this.editConfig.visible = false
       this.$parent.getData()
     },
@@ -436,9 +445,15 @@
     setDate(str, monthNumber) {
       console.log(str.split("-"))
       let dateArr = str.split("-")
-      let year = parseInt(dateArr[0])
-      let month = parseInt(dateArr[1]) + monthNumber
+      // 鏈堜唤鍜�
+      let monthCount = parseInt(dateArr[1]) + monthNumber
+      // 骞�
+      let year = monthCount > 12 ? parseInt(dateArr[0]) + 1 : parseInt(dateArr[0])
+      // 鏈�
+      let month = monthCount > 12 ? monthCount - 12 : monthCount
+      // 鏃�
       let day = parseInt(dateArr[2])
+
       return year + "-" + month + "-" + day
     },
     principalClick(val) {
diff --git a/src/views/other/payment/saleInvoice/addSaleInvoice.vue b/src/views/other/payment/saleInvoice/addSaleInvoice.vue
index 44889e2..15b6399 100644
--- a/src/views/other/payment/saleInvoice/addSaleInvoice.vue
+++ b/src/views/other/payment/saleInvoice/addSaleInvoice.vue
@@ -28,16 +28,14 @@
                   <el-input
                     v-if="
                       editConfig.title == '缂栬緫' ||
-                      (editConfig.title == '鏂板缓' &&
-                        codenumer &&
-                        (explain != '' || isIdDisabled))
+                      (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled))
                     "
                     :disabled="editConfig.title == '缂栬緫'"
                     v-model="editConfig.infomation.number"
                     placeholder="璇疯緭鍏ョ紪鐮�"
                   >
                   </el-input>
-                  <span  v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
+                  <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
                     >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
                   >
                   <!-- <WordInput
@@ -63,7 +61,7 @@
                   <el-input v-model="editConfig.infomation.subject" style="width: 100%"></el-input>
                 </el-form-item>
               </el-col>
-              
+
               <el-col :span="12">
                 <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
                   <div class="custom-name">
@@ -154,25 +152,25 @@
                         }
                       "
                       value-key="number"
-                      :disabled="this.editCommonConfig.infomation.id?true:false"
+                      :disabled="this.editCommonConfig.infomation.id ? true : false"
                       @select="handleSelectClient('serviceContract', $event)"
                       style="width: 100%"
                     ></el-autocomplete>
-                    <template v-if='!this.editCommonConfig.infomation.id'>
-                        <div class="common-select-btn" @click="selClientClick('serviceContract')">
-                          <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
-                        </div>
-                        <div
-                          v-if="
-                            editConfig.infomation.serviceContract_Number &&
-                            editConfig.infomation.serviceContract_Number.length > 0
-                          "
-                          class="common-select-btn"
-                          @click="clearupClient('serviceContract')"
-                        >
-                          <i class="el-icon-remove-outline" title="娓呴櫎"></i>
-                        </div>
-                      </template>
+                    <template v-if="!this.editCommonConfig.infomation.id">
+                      <div class="common-select-btn" @click="selClientClick('serviceContract')">
+                        <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
+                      </div>
+                      <div
+                        v-if="
+                          editConfig.infomation.serviceContract_Number &&
+                          editConfig.infomation.serviceContract_Number.length > 0
+                        "
+                        class="common-select-btn"
+                        @click="clearupClient('serviceContract')"
+                      >
+                        <i class="el-icon-remove-outline" title="娓呴櫎"></i>
+                      </div>
+                    </template>
                   </div>
                 </el-form-item>
               </el-col>
@@ -187,12 +185,12 @@
                         }
                       "
                       value-key="number"
-                      :disabled="this.editCommonConfig.infomation.id?true:false"
+                      :disabled="this.editCommonConfig.infomation.id ? true : false"
                       @select="handleSelectClient('contract', $event)"
                       style="width: 100%"
                     ></el-autocomplete>
-                    <template v-if='!this.editCommonConfig.infomation.id'>
-                      <div class="common-select-btn"  @click="selClientClick('contract')">
+                    <template v-if="!this.editCommonConfig.infomation.id">
+                      <div class="common-select-btn" @click="selClientClick('contract')">
                         <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                       </div>
                       <div
@@ -433,7 +431,7 @@
       dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
-        number: [{ required: true, validator: this.validateCheckCode, trigger: ["change",'blur' ] }],
+        number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }],
         subject: [{ required: true, message: "璇疯緭鍏ヤ富棰�", trigger: "blur" }],
         client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
         invoiceTypeId: [{ required: true, message: "璇烽�夋嫨绁ㄦ嵁绫诲瀷", trigger: "change" }],
@@ -475,7 +473,9 @@
       clientId: this.editCommonConfig.infomation.client_id,
       SalesDetailsId: this.editCommonConfig.infomation.id,
       serviceContractId: this.editCommonConfig.infomation.id,
-      tableData: []
+      tableData: [],
+      productId: 1,
+      isNoProduct: true
     }
   },
   created() {
@@ -484,23 +484,23 @@
     this.$store.dispatch("geSalesDetails")
     this.setTableForm()
     this.getCommonData()
-    this.formInfo();
+    this.formInfo()
   },
-  watch:{
-    'editCommonConfig.visible'(val){
-      if(val){
+  watch: {
+    "editCommonConfig.visible"(val) {
+      if (val) {
         this.formInfo()
       }
-    },
+    }
   },
   methods: {
-    formInfo(){
-      this.objCode.type='閿�鍞彂绁ㄧ紪鐮�'
-      this.objCode.codeStandID = ''
-      if(this.editConfig.infomation.codeStandID){
-        this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
+    formInfo() {
+      this.objCode.type = "閿�鍞彂绁ㄧ紪鐮�"
+      this.objCode.codeStandID = ""
+      if (this.editConfig.infomation.codeStandID) {
+        this.objCode.codeStandID = this.editConfig.infomation.codeStandID
       }
-      this.getRCodeStandardList();
+      this.getRCodeStandardList()
     },
     getCommonData() {
       getAllData().then((res) => {
@@ -511,26 +511,26 @@
       this.getInvoiceTypeList()
       this.getInvoiceStatusList()
       this.getCourierCompanyList()
-      this.$set(this.editConfig.infomation,'serviceContract_Number',this.editCommonConfig.infomation.keyword)
-      this.$set(this.editConfig.infomation,'contract_number',this.editCommonConfig.infomation.keyword)
+      this.$set(this.editConfig.infomation, "serviceContract_Number", this.editCommonConfig.infomation.keyword)
+      this.$set(this.editConfig.infomation, "contract_number", this.editCommonConfig.infomation.keyword)
     },
     async getInvoiceTypeList() {
-      const res=await getInvoiceTypeList()
-        if (res.code == 200) {
-          this.invoiceTypeOptions = res.data.data
-        }
+      const res = await getInvoiceTypeList()
+      if (res.code == 200) {
+        this.invoiceTypeOptions = res.data.data
+      }
     },
     async getInvoiceStatusList() {
-      const res=await getInvoiceStatusList()
-        if (res.code == 200) {
-          this.invoiceStatusOptions = res.data.data
-        }
+      const res = await getInvoiceStatusList()
+      if (res.code == 200) {
+        this.invoiceStatusOptions = res.data.data
+      }
     },
     async getCourierCompanyList() {
-      const res=await getCourierCompanyList()
-        if (res.code == 200) {
-          this.courierCompanyOptions = res.data.data
-        }
+      const res = await getCourierCompanyList()
+      if (res.code == 200) {
+        this.courierCompanyOptions = res.data.data
+      }
     },
     // 淇濆瓨
     saveClick(formName) {
@@ -590,7 +590,7 @@
         products: this.tableData,
         sourceId: this.editConfig.sourceType === 1 ? this.SalesDetailsId : this.serviceContractId,
         sourceType: this.editConfig.sourceType,
-        number:data.number || "",
+        number: data.number || "",
         subject: data.subject || "",
         taxpayerIdNumber: data.taxpayerIdNumber || ""
       }
diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue
index f09c5f7..d2647fb 100644
--- a/src/views/sales/quotation/AddQuotationDialog.vue
+++ b/src/views/sales/quotation/AddQuotationDialog.vue
@@ -29,16 +29,14 @@
                   <el-input
                     v-if="
                       editConfig.title == '缂栬緫' ||
-                      (editConfig.title == '鏂板缓' &&
-                        codenumer &&
-                        (explain != '' || isIdDisabled))
+                      (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled))
                     "
                     :disabled="editConfig.title == '缂栬緫'"
                     v-model="editConfig.infomation.number"
                     placeholder="璇疯緭鍏ョ紪鐮�"
                   >
                   </el-input>
-                  <span  v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
+                  <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
                     >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
                   >
                   <!-- <WordInput
@@ -370,7 +368,7 @@
       dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
-        number: [{ required: true, validator: this.validateCheckCode,  trigger: ["blur","change"] }],
+        number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }],
         quotationName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
         quotation_status_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
         sale_chance_name: [{ required: true, validator: this.checkChance, trigger: "change" }],
@@ -424,7 +422,7 @@
       if (val) {
         this.formInfo()
       }
-    },
+    }
   },
   methods: {
     formInfo() {
@@ -605,7 +603,8 @@
             name: "",
             number: "",
             price: 0,
-            total: 0
+            total: 0,
+            unit: ""
           }
         ]
       } else {
@@ -621,6 +620,7 @@
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
+          { label: "鍗曚綅", prop: "unit" },
           { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
           { label: "浠风◣鍚堣", prop: "total", inputFloat: true }
         ]
@@ -646,7 +646,8 @@
         name: "",
         number: "",
         price: 0,
-        total: 0
+        total: 0,
+        unit: ""
       })
       this.showSummary.show = true
     },
@@ -662,7 +663,8 @@
           name: "",
           number: "",
           price: 0,
-          total: 0
+          total: 0,
+          unit: ""
         }
       ]
       this.productTableList.tableData = this.tableData
diff --git a/src/views/sales/refundForm/AddRefundFormDialog.vue b/src/views/sales/refundForm/AddRefundFormDialog.vue
index 11fedd0..671075e 100644
--- a/src/views/sales/refundForm/AddRefundFormDialog.vue
+++ b/src/views/sales/refundForm/AddRefundFormDialog.vue
@@ -28,16 +28,14 @@
                   <el-input
                     v-if="
                       editConfig.title == '缂栬緫' ||
-                      (editConfig.title == '鏂板缓' &&
-                        codenumer &&
-                        (explain != '' || isIdDisabled))
+                      (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled))
                     "
                     :disabled="editConfig.title == '缂栬緫'"
                     v-model="editConfig.infomation.number"
                     placeholder="璇疯緭鍏ョ紪鐮�"
                   >
                   </el-input>
-                  <span  v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
+                  <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
                     >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
                   >
                   <!-- <WordInput
@@ -327,7 +325,7 @@
 import { getAddSalesRefund, getUpdateSalesRefund } from "@/api/sales/refundForm"
 import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
 import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
-import {getBankAccountList, getPaymentTypeList} from "@/api/common/payment"
+import { getBankAccountList, getPaymentTypeList } from "@/api/common/payment"
 import codeMixin from "@/components/makepager/mixin/codeMixin"
 import { getSalesReturnList } from "@/api/sales/salesReturn"
 import { mapActions } from "vuex"
@@ -362,7 +360,7 @@
       editConfig: this.editCommonConfig,
       rules: {
         client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
-        number: [{ required: true,  validator: this.validateCheckCode, trigger: ["blur",'change'] }],
+        number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }],
         refundDate: [{ required: true, message: "璇烽�夋嫨閫�娆炬棩鏈�", trigger: "change" }],
         memberId: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }],
         sale_return_nunber: [{ required: true, message: "璇烽�夋嫨閿�鍞��璐у崟", trigger: "change" }]
@@ -411,7 +409,7 @@
       if (val) {
         this.formInfo()
       }
-    },
+    }
   },
   methods: {
     ...mapActions(["getReturnListFliter"]),
@@ -425,27 +423,27 @@
       this.getBankAccountList()
     },
     async getCommonData() {
-      const res=await getAllData()
-      if(res.code==200){
-        this.memberOptions = res.data.member? res.data.member:[]
+      const res = await getAllData()
+      if (res.code == 200) {
+        this.memberOptions = res.data.member ? res.data.member : []
       }
-      this.$set(this.editConfig.infomation,'memberId',this.editConfig.infomation.memberId)
+      this.$set(this.editConfig.infomation, "memberId", this.editConfig.infomation.memberId)
       this.getPaymentTypeList()
     },
     getPaymentTypeList() {
-       getPaymentTypeList().then(res=>{
+      getPaymentTypeList().then((res) => {
         if (res.code === 200) {
           this.paymentTypeListOptions = res.data.data ?? []
         }
-        this.$set(this.editConfig.infomation,'paymentTypeId',this.editConfig.infomation.paymentTypeId)
+        this.$set(this.editConfig.infomation, "paymentTypeId", this.editConfig.infomation.paymentTypeId)
       })
     },
     getBankAccountList() {
-      getBankAccountList().then(res=>{
+      getBankAccountList().then((res) => {
         if (res.code === 200) {
-          this.accountOptions = res.data.data? res.data.data:[]
+          this.accountOptions = res.data.data ? res.data.data : []
         }
-        this.$set(this.editConfig.infomation,'bankAccountId',this.editConfig.infomation.bankAccountId)
+        this.$set(this.editConfig.infomation, "bankAccountId", this.editConfig.infomation.bankAccountId)
       })
     },
     // 淇濆瓨
@@ -505,7 +503,7 @@
           reason: data.reason || "",
           refundDate: data.refundDate || "",
           sourceId: this.sourceId || 0,
-          sourceType: 1,
+          sourceType: 1
         }
       }
       return params
@@ -595,7 +593,8 @@
             name: "",
             number: "",
             price: 0,
-            total: 0
+            total: 0,
+            unit: ""
           }
         ]
       } else {
@@ -612,6 +611,7 @@
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
+          { label: "鍗曚綅", prop: "unit" },
           { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
           { label: "浠风◣鍚堣", prop: "total", inputFloat: true }
         ]
@@ -637,7 +637,8 @@
         name: "",
         number: "",
         price: 0,
-        total: 0
+        total: 0,
+        unit: ""
       })
       this.showSummary.show = true
     },
@@ -653,7 +654,8 @@
           name: "",
           number: "",
           price: 0,
-          total: 0
+          total: 0,
+          unit: ""
         }
       ]
       this.productTableList.tableData = this.tableData
diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 2c6b0bd..160a087 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -646,8 +646,8 @@
                 console.log(res)
                 this.editConfig.visible = false
                 if (res.code === 200) {
-                  this.tableData.map((item) => {
-                    this.amountTotal += item.total
+                  this.selProductData.map((item) => {
+                    this.amountTotal += parseFloat(item.total)
                   })
                   let config = {
                     amountTotal: this.amountTotal,
@@ -913,6 +913,7 @@
           { label: "浜у搧鍚嶇О", prop: "name", isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
+          { label: "鍗曚綅", prop: "unit" },
           { label: "閿�鍞崟浠�", prop: "price" },
           { label: "浠风◣鍚堣", prop: "total" }
         ]
diff --git a/src/views/sales/salesDetails/index.vue b/src/views/sales/salesDetails/index.vue
index f1e49e6..5b8ea21 100644
--- a/src/views/sales/salesDetails/index.vue
+++ b/src/views/sales/salesDetails/index.vue
@@ -160,35 +160,35 @@
   data() {
     // 浜у搧淇℃伅
     const productColumn = [
-      { label: "浜у搧缂栧彿", prop: "Id", default: true },
-      { label: "浜у搧鍚嶇О", prop: "Name" },
-      { label: "鏁伴噺", prop: "Amount" },
-      { label: "鍗曚綅", prop: "Unit" },
-      { label: "鍙戣揣鍗�", prop: "shipOrder" },
+      { label: "浜у搧缂栧彿", prop: "id", default: true },
+      { label: "浜у搧鍚嶇О", prop: "name" },
+      { label: "鏁伴噺", prop: "amount" },
+      { label: "鍗曚綅", prop: "unit" },
+      { label: "鍙戣揣鍗�", prop: "invoice" },
       { label: "鎵胯繍鍟�", prop: "carrier" },
       { label: "杩愬崟鍙�", prop: "waybillNumber" },
-      { label: "閿�鍞崟浠�", prop: "SalePrice", price: true },
-      { label: "浠风◣鍚堣", prop: "Valorem", price: true }
+      { label: "閿�鍞崟浠�", prop: "salePrice", price: true },
+      { label: "浠风◣鍚堣", prop: "valorem", price: true }
     ]
     // 搴撳瓨淇℃伅
     const inventoryColumn = [
-      { label: "浜у搧缂栧彿", prop: "Id", default: true },
-      { label: "浜у搧鍚嶇О", prop: "Name" },
-      { label: "璁㈠崟鏁伴噺", prop: "OrderAmount" },
-      { label: "浠撳簱", prop: "Warehouse" },
-      { label: "鍦ㄥ簱鏁伴噺", prop: "Amount" },
-      { label: "鍙敤搴撳瓨", prop: "AvailableNumber" },
-      { label: "鍗曚綅", prop: "Unit" }
+      { label: "浜у搧缂栧彿", prop: "id", default: true },
+      { label: "浜у搧鍚嶇О", prop: "name" },
+      { label: "璁㈠崟鏁伴噺", prop: "orderAmount" },
+      { label: "浠撳簱", prop: "warehouse" },
+      { label: "鍦ㄥ簱鏁伴噺", prop: "amount" },
+      { label: "鍙敤搴撳瓨", prop: "availableNumber" },
+      { label: "鍗曚綅", prop: "unit" }
     ]
     // 鍒堕�犱俊鎭�
     const makeColumn = [
-      { label: "鐢熶骇璁㈠崟", prop: "OrderId", default: true },
-      { label: "浜у搧鍚嶇О", prop: "ProductName" },
-      { label: "璁㈠崟鐘舵��", prop: "OrderStatus" },
-      { label: "宸ュ崟缂栧彿", prop: "WorkOrderId" },
-      { label: "宸ュ崟鐘舵��", prop: "WorkOrderStatus" },
-      { label: "璁″垝寮�濮嬫椂闂�", prop: "StartTime" },
-      { label: "璁″垝缁撴潫鏃堕棿", prop: "EndTime" }
+      { label: "鐢熶骇璁㈠崟", prop: "orderId", default: true },
+      { label: "浜у搧鍚嶇О", prop: "productName" },
+      { label: "璁㈠崟鐘舵��", prop: "orderStatus" },
+      { label: "宸ュ崟缂栧彿", prop: "workOrderId" },
+      { label: "宸ュ崟鐘舵��", prop: "workOrderStatus" },
+      { label: "璁″垝寮�濮嬫椂闂�", prop: "startTime" },
+      { label: "璁″垝缁撴潫鏃堕棿", prop: "endTime" }
     ]
     return {
       tableList: {},
@@ -202,7 +202,7 @@
         show: false,
         sumProp: [
           "receiveTotalAmount",
-          "total",
+          "amountTotal",
           "amountReceivable",
           "invoicedAmount",
           "uninvoicedAmount",
@@ -240,7 +240,7 @@
         { label: "绛剧害鏃ユ湡", prop: "signTime" },
         { label: "浜や粯鏃ユ湡", prop: "deliveryDate" },
         { label: "璁㈠崟鏉ユ簮", prop: "source" },
-        { label: "鍚堣", prop: "total", price: true },
+        { label: "鍚堣", prop: "amountTotal", price: true },
         { label: "鐘舵��", prop: "status", isCallMethod: true, getCallMethod: this.getStatus }
       ],
       showCol: ["璁㈠崟缂栧彿", "閿�鍞礋璐d汉", "绛剧害鏃ユ湡", "浜や粯鏃ユ湡", "璁㈠崟鏉ユ簮", "鍚堣", "鐘舵��"],
@@ -375,7 +375,7 @@
               if (res.data.count > 0) {
                 this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {}
                 let row = this.tableList.tableInfomation[0]
-                this.getProductInventoryInfo(row.number)
+                this.getProductInventoryInfo(row)
               }
             } else {
               this.tableList.tableInfomation = []
@@ -392,11 +392,16 @@
         })
     },
     // 鑾峰彇浜у搧/搴撳瓨淇℃伅
-    async getProductInventoryInfo(number) {
-      await getProductInventoryInfo(number).then((res) => {
-        console.log(res)
-        this.productTableList.tableInfomation = res.data
-      })
+    async getProductInventoryInfo(row) {
+      console.log(row.status, "鐘舵��", row)
+      if (row.status === 1) {
+        this.productTableList.tableInfomation = row.products
+      } else {
+        await getProductInventoryInfo(row.number).then((res) => {
+          console.log(res)
+          this.productTableList.tableInfomation = res.data
+        })
+      }
     },
     // 鑾峰彇鍒堕�犱俊鎭�
     async getProductOrderInfo(number) {
@@ -537,7 +542,7 @@
         this.tableBottomColumn = this.productColumn
         this.showBottomCol = this.showProductCol
         this.setBottomList()
-        this.getProductInventoryInfo(this.selectRow.number)
+        this.getProductInventoryInfo(this.selectRow)
       } else if (this.TabsIndex == 1) {
         this.isClickProduct = false
         this.isClickInventory = true
@@ -546,7 +551,7 @@
         this.tableBottomColumn = this.inventoryColumn
         this.showBottomCol = this.showInventoryCol
         this.setBottomList()
-        this.getProductInventoryInfo(this.selectRow.number)
+        this.getProductInventoryInfo(this.selectRow)
       } else if (this.TabsIndex == 2) {
         this.isClickProduct = false
         this.isClickInventory = false
@@ -567,9 +572,9 @@
       console.log(row, column, event)
       this.selectRow = row
       if (this.TabsIndex == 0) {
-        this.getProductInventoryInfo(this.selectRow.number)
+        this.getProductInventoryInfo(this.selectRow)
       } else if (this.TabsIndex == 1) {
-        this.getProductInventoryInfo(this.selectRow.number)
+        this.getProductInventoryInfo(this.selectRow)
       } else if (this.TabsIndex == 2) {
         this.getProductOrderInfo(this.selectRow.number)
       }
diff --git a/src/views/sales/salesReturn/AddSalesReturnDialog.vue b/src/views/sales/salesReturn/AddSalesReturnDialog.vue
index 55b08b1..ae95c1e 100644
--- a/src/views/sales/salesReturn/AddSalesReturnDialog.vue
+++ b/src/views/sales/salesReturn/AddSalesReturnDialog.vue
@@ -569,6 +569,7 @@
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
+          { label: "鍗曚綅", prop: "unit" },
           { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
           { label: "浠风◣鍚堣", prop: "total", inputFloat: true }
         ]
diff --git a/src/views/sales/subOrder/AddSubOrderDialog.vue b/src/views/sales/subOrder/AddSubOrderDialog.vue
index cb48a40..ad0f153 100644
--- a/src/views/sales/subOrder/AddSubOrderDialog.vue
+++ b/src/views/sales/subOrder/AddSubOrderDialog.vue
@@ -28,16 +28,14 @@
                   <el-input
                     v-if="
                       editConfig.title == '缂栬緫' ||
-                      (editConfig.title == '鏂板缓' &&
-                        codenumer &&
-                        (explain != '' || isIdDisabled))
+                      (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled))
                     "
                     :disabled="editConfig.title == '缂栬緫'"
                     v-model="editConfig.infomation.number"
                     placeholder="璇疯緭鍏ョ紪鐮�"
                   >
                   </el-input>
-                  <span  v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
+                  <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
                     >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
                   >
                   <!-- <WordInput
@@ -238,7 +236,7 @@
       dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
-        number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur",'change'] }],
+        number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }],
         master_order_number: [{ required: true, message: "璇烽�夋嫨鎴栧垱寤洪攢鍞�诲崟", trigger: "blur" }],
         client_name: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
         memberId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }]
@@ -294,7 +292,7 @@
       if (val) {
         this.formInfo()
       }
-    },
+    }
   },
   methods: {
     formInfo() {
@@ -310,7 +308,7 @@
           console.log(res)
           if (res.code === 200) {
             this.memberOptions = res.data.member
-            this.$set(this.editConfig.infomation,'memberId',this.editConfig.infomation.memberId)
+            this.$set(this.editConfig.infomation, "memberId", this.editConfig.infomation.memberId)
             this.dataProcess()
           }
         })
@@ -387,7 +385,7 @@
         memberId: data.memberId || 0,
         number: data.number || "",
         product: this.tableData,
-        codeStandID: data.ID,
+        codeStandID: data.ID
       }
       return params
     },
@@ -497,7 +495,8 @@
             name: "",
             number: "",
             price: 0,
-            total: 0
+            total: 0,
+            unit: ""
           }
         ]
       } else {
@@ -513,6 +512,7 @@
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
+          { label: "鍗曚綅", prop: "unit" },
           { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
           { label: "浠风◣鍚堣", prop: "total", inputFloat: true }
         ]
@@ -538,7 +538,8 @@
         name: "",
         number: "",
         price: 0,
-        total: 0
+        total: 0,
+        unit: ""
       })
       this.showSummary.show = true
     },
@@ -554,7 +555,8 @@
           name: "",
           number: "",
           price: 0,
-          total: 0
+          total: 0,
+          unit: ""
         }
       ]
       this.productTableList.tableData = this.tableData
diff --git a/src/views/service/serviceContract/AddServiceContractDialog.vue b/src/views/service/serviceContract/AddServiceContractDialog.vue
index 3f90381..a2123db 100644
--- a/src/views/service/serviceContract/AddServiceContractDialog.vue
+++ b/src/views/service/serviceContract/AddServiceContractDialog.vue
@@ -28,16 +28,14 @@
                   <el-input
                     v-if="
                       editConfig.title == '缂栬緫' ||
-                      (editConfig.title == '鏂板缓' &&
-                        codenumer &&
-                        (explain != '' || isIdDisabled))
+                      (editConfig.title == '鏂板缓' && codenumer && (explain != '' || isIdDisabled))
                     "
                     :disabled="editConfig.title == '缂栬緫'"
                     v-model="editConfig.infomation.number"
                     placeholder="璇疯緭鍏ョ紪鐮�"
                   >
                   </el-input>
-                  <span  v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
+                  <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
                     >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
                   >
                   <!-- <WordInput
@@ -504,7 +502,7 @@
       dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
-        number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur",'change'] }],
+        number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }],
         client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
         signTime: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
         memberId: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }]
@@ -566,7 +564,7 @@
       if (val) {
         this.formInfo()
       }
-    },
+    }
   },
   methods: {
     formInfo() {
@@ -582,11 +580,19 @@
         .then((res) => {
           if (res.code === 200) {
             this.memberOptions = res.data.member
-            this.$set(this.editConfig.infomation,'memberId',this.editConfig.infomation.memberId)
+            this.$set(this.editConfig.infomation, "memberId", this.editConfig.infomation.memberId)
             this.contractTypeOptions = res.data.serviceContractType
-            this.$set(this.editConfig.infomation,'serviceContractTypeId',this.editConfig.infomation.serviceContractTypeId)
+            this.$set(
+              this.editConfig.infomation,
+              "serviceContractTypeId",
+              this.editConfig.infomation.serviceContractTypeId
+            )
             this.contractStatusOptions = res.data.serviceContractStatus
-            this.$set(this.editConfig.infomation,'serviceContractStatusId',this.editConfig.infomation.serviceContractStatusId)
+            this.$set(
+              this.editConfig.infomation,
+              "serviceContractStatusId",
+              this.editConfig.infomation.serviceContractStatusId
+            )
             // this.currencyOptions = res.data.currency
           }
         })
@@ -659,7 +665,7 @@
         typeId: 0,
         serviceContractTypeId: data.serviceContractTypeId || 0,
         serviceContractStatusId: data.serviceContractStatusId || 0,
-        codeStandID: data.ID,
+        codeStandID: data.ID
       }
       return params
     },
@@ -774,7 +780,8 @@
             name: "",
             number: "",
             price: 0,
-            total: 0
+            total: 0,
+            unit: ""
           }
         ]
       } else {
@@ -790,6 +797,7 @@
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
+          { label: "鍗曚綅", prop: "unit" },
           { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
           { label: "浠风◣鍚堣", prop: "total", inputFloat: true }
         ]
@@ -815,7 +823,8 @@
         name: "",
         number: "",
         price: 0,
-        total: 0
+        total: 0,
+        unit: ""
       })
       this.showSummary.show = true
     },
@@ -831,7 +840,8 @@
           name: "",
           number: "",
           price: 0,
-          total: 0
+          total: 0,
+          unit: ""
         }
       ]
       this.productTableList.tableData = this.tableData

--
Gitblit v1.8.0