From 033e85a3630fea9860b3fb6b42ed705906bcd3c0 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 25 八月 2023 19:28:59 +0800
Subject: [PATCH] 采购

---
 src/components/makepager/CommonFormTableView.vue |   59 +++++++++++++++++++----------------------------------------
 1 files changed, 19 insertions(+), 40 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 55fee16..951409e 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -1,13 +1,8 @@
 <template>
   <div class="page-view">
     <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
-      <el-table
-        :data="tableList.tableData"
-        :show-summary="showSummary.show"
-        :summary-method="getSummaries"
-        :span-method="arraySpanMethod"
-        style="width: 100%"
-      >
+      <el-table :data="tableList.tableData" style="width: 100%">
+        <el-table-column type="index" label="缂栧彿" width="50" align="center"></el-table-column>
         <el-table-column
           v-for="(item, i) in tableList.tableColumn"
           :key="i"
@@ -63,7 +58,7 @@
                     <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                   </div>
                   <div class="common-select-btn" @click="clearupClient(scope.row)">
-                    <i class="el-icon-edit-outline" title="娓呴櫎"></i>
+                    <i class="el-icon-remove-outline" title="娓呴櫎"></i>
                   </div>
                 </div>
               </el-form-item>
@@ -127,25 +122,13 @@
     </el-form>
     <div v-if="!detailEnter" style="margin: 10px">
       <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" :disabled="isRecalculate ? false : true"
+
+      <el-button size="small" v-if="recalculateShow" 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">
-        <el-col v-if="showSummary.total" :span="2" :offset="22">
-          <span style="font-weight: bold">鍚堣</span>
-          <span style="margin-left: 10px">{{ total }}</span>
-        </el-col>
-        <el-col v-if="showSummary.refundable" :span="2" :offset="22">
-          <span style="font-weight: bold">搴旈��娆�</span>
-          <span style="margin-left: 10px">0.00</span>
-        </el-col>
-      </el-row>
-    </div>
-    <!-- 鍚堝悓璁㈠崟 -->
+    <!-- 浜у搧鍚嶇О -->
     <SelectCommonDialog
       v-if="editSelCommonConfig.editVisible"
       :edit-common-config="editSelCommonConfig"
@@ -185,10 +168,16 @@
           total: false,
           refundable: false,
           sumProp: [],
+          titleProp:["#", "浜у搧鍚嶇О"],
           mergeNumber: 1
         }
       }
-    }
+    },
+    recalculateShow:{
+      type:[Boolean],
+      defalut:true,
+    },
+    
   },
   data() {
     return {
@@ -263,7 +252,7 @@
           sums[index] = "灏忚:"
           return
         }
-        const title = ["#", "浜у搧鍚嶇О"]
+        const title = this.showSummary.titleProp
         // 鍘婚櫎鏌愪簺涓嶉渶瑕佽绠楃殑鏁版嵁
         if (title.includes(column.label)) {
           sums[index] = ""
@@ -291,6 +280,7 @@
       })
       return sums
     },
+
     // 鏁板瓧鎹㈣涓洪噾棰濇樉绀烘牸寮�
     number_format(number, decimals, dec_point, thousands_sep) {
       decimals = 2 //杩欓噷榛樿璁剧疆淇濈暀涓や綅灏忔暟锛屼篃鍙互娉ㄩ噴杩欏彞閲囩敤浼犲叆鐨勫弬鏁�
@@ -332,21 +322,6 @@
     empty() {
       this.isRecalculate = false
       this.$emit("emptyProductClick")
-    },
-    // 閲嶇畻
-    recalculate() {
-      this.$confirm("纭畾瑕侀噸绠楁槑缁嗘墍鏈夎?", "鎻愮ず", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      })
-        .then(() => {
-          this.$emit("recalculateProductClick")
-          this.tableList.tableData.map((ite) => {
-            ite.total = ite.amount ? ite.amount * ite.price : 1 * ite.price
-          })
-        })
-        .catch(() => {})
     },
     // 閫夋嫨浜у搧鍚嶇О鐩稿叧鏂规硶
     querySearchAsync(queryString, cb) {
@@ -406,6 +381,10 @@
         }
       })
       this.$emit("clearupProduct", this.tableList.tableData)
+    },
+    // 鍒犻櫎
+    deleteClient(row) {
+      this.$emit("deleteProduct", row)
     }
   }
 }

--
Gitblit v1.8.0