From 21e7326b415597938fba463ebb8b3507b7fdbdfd Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 15 三月 2025 13:57:57 +0800
Subject: [PATCH] 修改原材料下单报异常捕获方式

---
 src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue |   29 ++++++++---------------------
 1 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
index 8e5ef0f..40e44a9 100644
--- a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
@@ -10,7 +10,7 @@
     </div>
     <limsTable :column="columns" :currentChange="rowClick" :height="'25vh'" :highlightCurrentRow="true"
                :isSelection="false" :rowStyle="tableRowStyle" :table-data="tableData" rowKey="id"
-               style="margin-top: 18px;">
+               @pagination="pagination" :page="page" style="margin-top: 18px;">
       <template v-slot:consumablesTypeSlot="{ row }">
         {{ findType(row.consumablesType) }}
       </template>
@@ -19,13 +19,6 @@
         <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"
-                     background
-                     layout="total, sizes, prev, pager, next, jumper" @current-change="handleCurrent" @size-change="handleSize">
-      </el-pagination>
-    </div>
     <el-divider></el-divider>
     <div>
       <ConsumableProject ref="consumableProject"></ConsumableProject>
@@ -122,9 +115,9 @@
         }
       ],
       tableData: [],
-      pagination: {
+      page: {
         current: 1,
-        pageSize: 20,
+        size: 20,
         total: 0
       },
       options: [],
@@ -136,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])
           }
@@ -165,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 => {
@@ -195,12 +189,5 @@
 <style scoped>
 .flex {
   text-align: right;
-}
-
-.pagination {
-  padding-top: 15px;
-  padding-right: 10px;
-  display: flex;
-  justify-content: space-between
 }
 </style>

--
Gitblit v1.9.3