From 6cd4984f83e7c9fabac3daa23cc9946d9d68314b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 15 七月 2025 17:10:00 +0800
Subject: [PATCH] 1.采购管理-分页bug
---
src/views/equipmentManagement/repair/index.vue | 147 ++++++++++++++++++++++++++----------------------
1 files changed, 80 insertions(+), 67 deletions(-)
diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index 2e75914..d734e1d 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -15,14 +15,14 @@
<el-button type="success" icon="Van" @click="addRepair">
鏂板鎶ヤ慨
</el-button>
- <!-- <el-button
+ <el-button
type="danger"
icon="Delete"
:disabled="multipleList.length <= 0"
@click="delRepairByIds(multipleList.map((item) => item.id))"
>
鎵归噺鍒犻櫎
- </el-button> -->
+ </el-button>
</div>
</div>
<PIMTable
@@ -36,6 +36,7 @@
total: pagination.total,
}"
@selection-change="handleSelectionChange"
+ @pagination="changePage"
>
<template #statusRef="{ row }">
<el-tag v-if="row.status === 1" type="success">瀹岀粨</el-tag>
@@ -87,72 +88,79 @@
const multipleList = ref([]);
// 琛ㄦ牸閽╁瓙
-const { filters, columns, dataList, pagination, getTableData, resetFilters } =
- usePaginationApi(
- getRepairPage,
+const {
+ filters,
+ columns,
+ dataList,
+ pagination,
+ getTableData,
+ resetFilters,
+ onCurrentChange,
+} = usePaginationApi(
+ getRepairPage,
+ {
+ searchText: undefined,
+ },
+ [
{
- searchText: undefined,
+ label: "璁惧鍚嶇О",
+ align: "center",
+ prop: "deviceName",
},
- [
- {
- label: "璁惧鍚嶇О",
- align: "center",
- prop: "deviceName",
- },
- {
- label: "瑙勬牸鍨嬪彿",
- align: "center",
- prop: "deviceModel",
- },
- {
- label: "鎶ヤ慨鏃ユ湡",
- align: "center",
- prop: "repairTime",
- formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
- },
- {
- label: "鎶ヤ慨浜�",
- align: "center",
- prop: "repairName",
- },
- {
- label: "鏁呴殰鐜拌薄",
- align: "center",
- prop: "remark",
- },
- {
- label: "缁翠慨浜�",
- align: "center",
- prop: "maintenanceName",
- },
- {
- label: "缁翠慨缁撴灉",
- align: "center",
- prop: "maintenanceResult",
- },
- {
- label: "缁翠慨鏃ユ湡",
- align: "center",
- prop: "maintenanceTime",
- formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
- },
- {
- label: "鐘舵��",
- align: "center",
- prop: "status",
- dataType: "slot",
- slot: "statusRef",
- },
- {
- fixed: "right",
- label: "鎿嶄綔",
- dataType: "slot",
- slot: "operation",
- align: "center",
- width: "200px",
- },
- ]
- );
+ {
+ label: "瑙勬牸鍨嬪彿",
+ align: "center",
+ prop: "deviceModel",
+ },
+ {
+ label: "鎶ヤ慨鏃ユ湡",
+ align: "center",
+ prop: "repairTime",
+ formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
+ },
+ {
+ label: "鎶ヤ慨浜�",
+ align: "center",
+ prop: "repairName",
+ },
+ {
+ label: "鏁呴殰鐜拌薄",
+ align: "center",
+ prop: "remark",
+ },
+ {
+ label: "缁翠慨浜�",
+ align: "center",
+ prop: "maintenanceName",
+ },
+ {
+ label: "缁翠慨缁撴灉",
+ align: "center",
+ prop: "maintenanceResult",
+ },
+ {
+ label: "缁翠慨鏃ユ湡",
+ align: "center",
+ prop: "maintenanceTime",
+ formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
+ },
+ {
+ label: "鐘舵��",
+ align: "center",
+ prop: "status",
+ dataType: "slot",
+ slot: "statusRef",
+ },
+ {
+ fixed: "right",
+ label: "鎿嶄綔",
+ dataType: "slot",
+ slot: "operation",
+ align: "center",
+ width: "200px",
+ },
+ ]
+);
// 澶氶�夊悗鍋氫粈涔�
const handleSelectionChange = (selectionList) => {
@@ -161,7 +169,7 @@
// 鏂板鎶ヤ慨
const addRepair = () => {
- repairModalRef.value.openModal();
+ repairModalRef.value.openAdd();
};
// 缂栬緫鎶ヤ慨
@@ -175,6 +183,11 @@
maintainModalRef.value.open(row.id, row);
};
+const changePage = ({ page }) => {
+ pagination.currentPage = page;
+ onCurrentChange(page);
+};
+
// 鍗曡鍒犻櫎
const delRepairByIds = async (ids) => {
ElMessageBox.confirm("纭鍒犻櫎鎶ヤ慨鏁版嵁, 姝ゆ搷浣滀笉鍙��?", "璀﹀憡", {
--
Gitblit v1.9.3