From 4a63f03516cc177ad60ebbe28a65e80587846b3e Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 24 八月 2023 14:56:45 +0800
Subject: [PATCH] 新增销售退款单增加选择退货单及其他bug

---
 src/components/makepager/CommonFormTableView.vue |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 3981921..00c60c6 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -8,6 +8,7 @@
         :span-method="arraySpanMethod"
         style="width: 100%"
       >
+        <el-table-column v-if="tableList.isReturn" type="index" label="#" width="50" align="center"></el-table-column>
         <el-table-column
           v-for="(item, i) in tableList.tableColumn"
           :key="i"
@@ -46,7 +47,6 @@
                 v-else-if="item.productName"
                 label=" "
                 :prop="'tableData.' + scope.$index + '.' + item.prop"
-                :rules="[{ required: item.isRequird ? true : false, message: '浜у搧鍚嶇О涓嶈兘涓虹┖' }]"
               >
                 <div class="custom-name">
                   <el-autocomplete
@@ -130,7 +130,9 @@
       <el-button size="small" type="primary" @click="add">鏂板</el-button>
       <!-- <el-button size="small" type="primary" disabled>瀵煎叆鏄庣粏</el-button> -->
       <el-button size="small" type="primary" @click="empty">娓呯┖</el-button>
-      <el-button size="small" type="primary" @click="recalculate">閲嶇畻</el-button>
+      <el-button size="small" type="primary" @click="recalculate" :disabled="isRecalculate ? false : true"
+        >閲嶇畻</el-button
+      >
     </div>
     <div v-if="showSummary.total || showSummary.refundable" style="height: 42px; line-height: 42px">
       <el-row :gutter="10">
@@ -169,6 +171,7 @@
       default: () => {
         return {
           tableData: [], // 鎺ュ彛杩斿洖鏁版嵁
+          isReturn: false,
           tableColumn: [
             // table琛ㄥ崟
             { label: "", prop: "", min: 200, tooltip: true }
@@ -199,12 +202,18 @@
         title: "",
         infomation: {}
       },
-      productIndex: 0
+      productIndex: 0,
+      isRecalculate: true
     }
   },
   created() {
     this.getProductList()
     this.tableList = this.productTableList
+    if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
+      this.isRecalculate = false
+    } else {
+      this.isRecalculate = true
+    }
   },
   computed: {},
   methods: {
@@ -256,7 +265,7 @@
           sums[index] = "灏忚:"
           return
         }
-        const title = ["#"]
+        const title = ["#", "浜у搧鍚嶇О"]
         // 鍘婚櫎鏌愪簺涓嶉渶瑕佽绠楃殑鏁版嵁
         if (title.includes(column.label)) {
           sums[index] = ""
@@ -323,6 +332,7 @@
     },
     // 娓呯┖
     empty() {
+      this.isRecalculate = false
       this.$emit("emptyProductClick")
     },
     // 閲嶇畻
@@ -353,6 +363,7 @@
     },
     handleSelectClient(item, prop, row) {
       // this.clientId = item.id
+      this.isRecalculate = true
       console.log(item, prop, row)
       this.tableList.tableData.map((ite) => {
         if (ite.name === item.name) {
@@ -372,6 +383,7 @@
     selClient(item) {
       console.log(item)
       console.log(this.tableList.tableData)
+      this.isRecalculate = true
       // this.editConfig.infomation.client_name = row.name
       this.tableList.tableData.map((ite, index) => {
         if (index === this.productIndex) {

--
Gitblit v1.8.0