From 2fc58fbb10745abd97168b8da21d4142e11d7f2e Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期四, 18 十二月 2025 13:36:43 +0800
Subject: [PATCH] 新增设备维修保养过程描述,上传对应附件
---
src/views/equipmentManagement/repair/index.vue | 52 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index 6cae307..9aad3c2 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -79,6 +79,9 @@
<el-button type="success" icon="Van" @click="addRepair">
鏂板鎶ヤ慨
</el-button>
+ <el-button @click="handleOut">
+ 瀵煎嚭
+ </el-button>
<el-button
type="danger"
icon="Delete"
@@ -116,6 +119,14 @@
缂栬緫
</el-button>
<el-button
+ type="primary"
+ text
+ icon="editPen"
+ @click="showImage(row)"
+ >
+ 闄勪欢
+ </el-button>
+ <el-button
type="danger"
text
icon="delete"
@@ -128,25 +139,32 @@
</div>
<RepairModal ref="repairModalRef" @ok="getTableData" />
<MaintainModal ref="maintainModalRef" @ok="getTableData" />
+ <ImagePreviewDialog v-model:model-value="showImages" :images="imageUrls" />
</div>
</template>
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
-import { getRepairPage, delRepair } from "@/api/equipmentManagement/repair";
-import { onMounted } from "vue";
+import {getRepairPage, delRepair, getRepairById} from "@/api/equipmentManagement/repair";
+import { onMounted, getCurrentInstance } from "vue";
import RepairModal from "./Modal/RepairModal.vue";
import { ElMessageBox, ElMessage } from "element-plus";
import dayjs from "dayjs";
import MaintainModal from "./Modal/MaintainModal.vue";
+import ImagePreviewDialog from "@/components/ImagePreview/ImagePreviewDialog.vue";
defineOptions({
name: "璁惧鎶ヤ慨",
});
+const { proxy } = getCurrentInstance();
+
// 妯℃�佹瀹炰緥
const repairModalRef = ref();
const maintainModalRef = ref();
+
+const showImages = ref(false)
+const imageUrls = ref([])
// 琛ㄦ牸澶氶�夋閫変腑椤�
const multipleList = ref([]);
@@ -163,7 +181,12 @@
} = usePaginationApi(
getRepairPage,
{
- searchText: undefined,
+ deviceName: undefined,
+ deviceModel: undefined,
+ remark: undefined,
+ maintenanceName: undefined,
+ repairTimeStr: undefined,
+ maintenanceTimeStr: undefined,
},
[
{
@@ -221,7 +244,7 @@
dataType: "slot",
slot: "operation",
align: "center",
- width: "200px",
+ width: "300px",
},
]
);
@@ -284,6 +307,27 @@
});
};
+// 瀵煎嚭
+const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/device/repair/export", {}, "璁惧鎶ヤ慨.xlsx");
+ })
+ .catch(() => {
+ ElMessage.info("宸插彇娑�");
+ });
+};
+
+const showImage = async (row) => {
+ const {data} = await getRepairById(row.id)
+ imageUrls.value = data?.files.map((item) => item.url)
+ showImages.value = true
+}
+
onMounted(() => {
getTableData();
});
--
Gitblit v1.9.3