From 376cab4afba8fd1b8be67cae067ed917462c2e16 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期四, 18 十二月 2025 09:05:12 +0800
Subject: [PATCH] 添加设备报修和保养附件管理功能,维修保养过程描述
---
src/views/equipmentManagement/upkeep/index.vue | 69 ++++++++++++++++++++++++++++------
1 files changed, 57 insertions(+), 12 deletions(-)
diff --git a/src/views/equipmentManagement/upkeep/index.vue b/src/views/equipmentManagement/upkeep/index.vue
index 7183964..63ca907 100644
--- a/src/views/equipmentManagement/upkeep/index.vue
+++ b/src/views/equipmentManagement/upkeep/index.vue
@@ -59,6 +59,9 @@
<el-button type="success" icon="Van" @click="addPlan">
鏂板璁″垝
</el-button>
+ <el-button @click="handleOut">
+ 瀵煎嚭
+ </el-button>
<el-button
type="danger"
icon="Delete"
@@ -111,32 +114,43 @@
>
鍒犻櫎
</el-button>
+ <el-button
+ type="primary"
+ text
+ icon="folder"
+ @click="openFilesForm(row)"
+ >
+ 闄勪欢
+ </el-button>
</template>
</PIMTable>
</div>
<PlanModal ref="planModalRef" @ok="getTableData" />
<MaintenanceModal ref="maintainModalRef" @ok="getTableData" />
+ <files-dia ref="filesDia"></files-dia>
</div>
</template>
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { getUpkeepPage, delUpkeep } from "@/api/equipmentManagement/upkeep";
-import { onMounted } from "vue";
+import { onMounted, getCurrentInstance } from "vue";
import PlanModal from "./Modal/PlanModal.vue";
import MaintenanceModal from "./Modal/MaintenanceModal.vue";
import dayjs from "dayjs";
import { ElMessageBox, ElMessage } from "element-plus";
-
+import FilesDia from "./filesDia.vue";
defineOptions({
name: "璁惧淇濆吇",
});
+
+const { proxy } = getCurrentInstance();
// 璁″垝寮圭獥鎺у埗鍣�
const planModalRef = ref();
// 淇濆吇寮圭獥鎺у埗鍣�
const maintainModalRef = ref();
-
+const filesDia = ref()
// 琛ㄦ牸澶氶�夋閫変腑椤�
const multipleList = ref([]);
@@ -154,7 +168,12 @@
getTableData,
resetFilters,
onCurrentChange,
-} = usePaginationApi(getUpkeepPage, {}, [
+} = usePaginationApi(getUpkeepPage, {
+ deviceName: undefined,
+ maintenancePlanTime: undefined,
+ maintenanceActuallyTime: undefined,
+ maintenanceActuallyName: undefined,
+}, [
{
label: "璁惧鍚嶇О",
align: "center",
@@ -176,12 +195,17 @@
align: "center",
prop: "createUserName",
},
+ // {
+ // label: "褰曞叆鏃ユ湡",
+ // align: "center",
+ // prop: "createTime",
+ // formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
+ // width: 200,
+ // },
{
- label: "褰曞叆鏃ユ湡",
+ label: "淇濆吇杩涘害鎻忚堪",
align: "center",
- prop: "createTime",
- formatData: (cell) => dayjs(cell).format("YYYY-MM-DD HH:mm:ss"),
- width: 200,
+ prop: "maintenanceProcessDesc",
},
{
label: "瀹為檯淇濆吇浜�",
@@ -250,11 +274,17 @@
planModalRef.value.openEdit(id);
};
-const changePage = ({ page }) => {
- pagination.currentPage = page;
- onCurrentChange(page);
+const changePage = ({ page, limit }) => {
+ pagination.currentPage = page;
+ pagination.pageSize = limit;
+ onCurrentChange(page);
};
-
+// 鎵撳紑闄勪欢寮规
+const openFilesForm = (row) => {
+ nextTick(() => {
+ filesDia.value?.openDialog( row,'璁惧淇濆吇')
+ })
+};
// 鍗曡鍒犻櫎
const delRepairByIds = async (ids) => {
ElMessageBox.confirm("纭鍒犻櫎鎶ヤ慨鏁版嵁, 姝ゆ搷浣滀笉鍙��?", "璀﹀憡", {
@@ -270,6 +300,21 @@
});
};
+// 瀵煎嚭
+const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/device/maintenance/export", {}, "璁惧淇濆吇.xlsx");
+ })
+ .catch(() => {
+ ElMessage.info("宸插彇娑�");
+ });
+};
+
onMounted(() => {
getTableData();
});
--
Gitblit v1.9.3