From f84e425bb9debb5f2af8e417bf07d2a2b0077609 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 28 四月 2026 17:00:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro' into dev_NEW_pro
---
src/views/equipmentManagement/repair/index.vue | 81 ++++++++++++++++++++++++++++++----------
1 files changed, 61 insertions(+), 20 deletions(-)
diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index 2443123..f3a4330 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -75,10 +75,10 @@
瀵煎嚭
</el-button>
<el-button
- type="danger"
- icon="Delete"
- :disabled="multipleList.length <= 0"
- @click="delRepairByIds(multipleList.map((item) => item.id))"
+ type="danger"
+ icon="Delete"
+ :disabled="multipleList.length <= 0 || hasFinishedStatus"
+ @click="delRepairByIds(multipleList.map((item) => item.id))"
>
鎵归噺鍒犻櫎
</el-button>
@@ -104,44 +104,54 @@
</template>
<template #operation="{ row }">
<el-button
- type="primary"
- text
- @click="addMaintain(row)"
- >
- 鏂板缁翠慨
- </el-button>
- <el-button
- type="primary"
- text
- icon="editPen"
- @click="editRepair(row.id)"
+ type="primary"
+ link
+ :disabled="row.status === 1"
+ @click="editRepair(row.id)"
>
缂栬緫
</el-button>
<el-button
- type="danger"
- text
- icon="delete"
- @click="delRepairByIds(row.id)"
+ type="success"
+ link
+ :disabled="row.status === 1"
+ @click="addMaintain(row)"
+ >
+ 缁翠慨
+ </el-button>
+ <el-button
+ type="danger"
+ link
+ :disabled="row.status === 1"
+ @click="delRepairByIds(row.id)"
>
鍒犻櫎
+ </el-button>
+ <el-button
+ type="primary"
+ link
+ @click="openFileDialog(row)"
+ >
+ 闄勪欢
</el-button>
</template>
</PIMTable>
</div>
<RepairModal ref="repairModalRef" @ok="getTableData"/>
<MaintainModal ref="maintainModalRef" @ok="getTableData"/>
+ <FileList v-if="fileDialogVisible" v-model:visible="fileDialogVisible" :record-type="'device_repair'" :record-id="recordId" />
</div>
</template>
<script setup>
+import {onMounted, getCurrentInstance, computed, ref, defineAsyncComponent} from "vue";
import {usePaginationApi} from "@/hooks/usePaginationApi";
import {getRepairPage, delRepair} 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";
+const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
defineOptions({
name: "璁惧鎶ヤ慨",
@@ -185,6 +195,11 @@
label: "瑙勬牸鍨嬪彿",
align: "center",
prop: "deviceModel",
+ },
+ {
+ label: "椤圭洰",
+ align: "center",
+ prop: "machineryCategory",
},
{
label: "鎶ヤ慨鏃ユ湡",
@@ -252,10 +267,24 @@
getTableData();
};
+// 鎵撳紑闄勪欢寮圭獥
+const recordId =ref(0)
+const fileDialogVisible = ref(false)
+
+const openFileDialog = async (row) => {
+ recordId.value = row.id
+ fileDialogVisible.value = true
+}
+
// 澶氶�夊悗鍋氫粈涔�
const handleSelectionChange = (selectionList) => {
multipleList.value = selectionList;
};
+
+// 妫�鏌ラ�変腑鐨勮褰曚腑鏄惁鏈夊畬缁撶姸鎬佺殑
+const hasFinishedStatus = computed(() => {
+ return multipleList.value.some(item => item.status === 1)
+})
// 鏂板鎶ヤ慨
const addRepair = () => {
@@ -280,6 +309,18 @@
// 鍗曡鍒犻櫎
const delRepairByIds = async (ids) => {
+ // 妫�鏌ユ槸鍚︽湁瀹岀粨鐘舵�佺殑璁板綍
+ const idsArray = Array.isArray(ids) ? ids : [ids];
+ const hasFinished = idsArray.some(id => {
+ const record = dataList.value.find(item => item.id === id);
+ return record && record.status === 1;
+ });
+
+ if (hasFinished) {
+ ElMessage.warning('涓嶈兘鍒犻櫎鐘舵�佷负瀹岀粨鐨勮褰�');
+ return;
+ }
+
ElMessageBox.confirm("纭鍒犻櫎鎶ヤ慨鏁版嵁, 姝ゆ搷浣滀笉鍙��?", "璀﹀憡", {
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
--
Gitblit v1.9.3