From 0a26d58a3906b9e13946c7cb46fae51a0de98920 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期一, 17 三月 2025 15:49:08 +0800
Subject: [PATCH] Merge branch 'dev' into dev_tides

---
 src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue |   88 ++++++++++++++------------------------------
 1 files changed, 28 insertions(+), 60 deletions(-)

diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
index d6d0f60..40e44a9 100644
--- a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
@@ -1,39 +1,24 @@
 <template>
   <div>
-    <TableCard :showTitle="false">
-      <template slot="form">
-        <div class="action-box">
-          <div></div>
-          <div class="flex">
-            <el-button icon="el-icon-plus" size="small" type="primary" @click="showDialog(undefined)">
-              鏂板缓
-            </el-button>
-            <el-button icon="el-icon-upload2" size="small" @click="exportExcel">
-              瀵煎嚭Excel
-            </el-button>
-          </div>
-        </div>
+    <div class="flex">
+      <el-button icon="el-icon-plus" size="small" type="primary" @click="showDialog(undefined)">
+        鏂板缓
+      </el-button>
+      <el-button icon="el-icon-upload2" size="small" @click="exportExcel">
+        瀵煎嚭Excel
+      </el-button>
+    </div>
+    <limsTable :column="columns" :currentChange="rowClick" :height="'25vh'" :highlightCurrentRow="true"
+               :isSelection="false" :rowStyle="tableRowStyle" :table-data="tableData" rowKey="id"
+               @pagination="pagination" :page="page" style="margin-top: 18px;">
+      <template v-slot:consumablesTypeSlot="{ row }">
+        {{ findType(row.consumablesType) }}
       </template>
-      <template v-slot:table>
-        <limsTable :column="columns" :currentChange="rowClick" :height="'25vh'" :highlightCurrentRow="true"
-          :isSelection="false" :rowStyle="tableRowStyle" :table-data="tableData" rowKey="id"
-          style="margin-top: 18px; padding: 0 15px;">
-          <template v-slot:consumablesTypeSlot="{ row }">
-            {{ findType(row.consumablesType) }}
-          </template>
-          <template v-slot:operation="scope">
-            <el-button size="small" type="text" @click="showDialog(scope.row)">缂栬緫</el-button>
-            <el-button size="small" style="color: #f56c6c" type="text" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
-          </template>
-        </limsTable>
-        <div class="pagination">
-          <div></div>
-          <el-pagination :page-size="pagination.pageSize" :page-sizes="[10, 20, 30, 40]" :total="pagination.total"
-            layout="total, sizes, prev, pager, next, jumper" @current-change="handleCurrent" @size-change="handleSize">
-          </el-pagination>
-        </div>
+      <template v-slot:operation="scope">
+        <el-button size="small" type="text" @click="showDialog(scope.row)">缂栬緫</el-button>
+        <el-button size="small" style="color: #f56c6c" type="text" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
       </template>
-    </TableCard>
+    </limsTable>
     <el-divider></el-divider>
     <div>
       <ConsumableProject ref="consumableProject"></ConsumableProject>
@@ -43,7 +28,6 @@
 </template>
 
 <script>
-import TableCard from './index.vue';
 import Edit from "./Edit.vue"
 import limsTable from '@/components/Table/lims-table.vue'
 import {
@@ -55,9 +39,7 @@
 
 export default {
   dicts: ["consumables_type"],
-  components: {
-    TableCard, limsTable, Edit, ConsumableProject
-  },
+  components: {limsTable, Edit, ConsumableProject},
   props: {
     contentsId: {
       type: Number,
@@ -133,9 +115,9 @@
         }
       ],
       tableData: [],
-      pagination: {
+      page: {
         current: 1,
-        pageSize: 20,
+        size: 20,
         total: 0
       },
       options: [],
@@ -147,9 +129,10 @@
   },
   methods: {
     async fetchData() {
-      procurementSuppliesList({ contentId: this.contentsId }).then(res => {
+      procurementSuppliesList({ contentId: this.contentsId, ...this.page }).then(res => {
         if (res.code === 200) {
           this.tableData = res.data.records
+          this.page.total = res.data.total
           if (this.tableData.length > 0) {
             this.rowClick(this.tableData[0])
           }
@@ -176,9 +159,9 @@
         this.$download.saveAs(blob, '鑰楁潗鍒楄〃.xlsx')
       })
     },
-    handleCurrent() {
-    },
-    handleSize() {
+    pagination(page) {
+      this.page.size = page.limit
+      this.fetchData()
     },
     handleDelete(row) {
       deleteProcurementSuppliesList({ id: row.id }).then(res => {
@@ -192,10 +175,10 @@
       this.$refs.consumableProject.fetchListId(row)
     },
     tableRowStyle({ row }) {
-      if (row.currentAmount <= row.lowerLimit) {
+      if(row.currentAmount <= row.lowerLimit) {
         return { background: '#ffcaca' }
       } else {
-        return {}
+        return { background: '#fff' }
       }
     }
   }
@@ -205,21 +188,6 @@
 
 <style scoped>
 .flex {
-  display: flex;
-}
-
-.action-box {
-  width: 100%;
-  padding-top: 10px;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-
-.pagination {
-  padding-top: 15px;
-  padding-right: 10px;
-  display: flex;
-  justify-content: space-between
+  text-align: right;
 }
 </style>

--
Gitblit v1.9.3