From 77bb414c194741197a5c3718b71d7e5dffb4e6a7 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 09 一月 2026 17:22:38 +0800
Subject: [PATCH] 添加不合格现象,检验记录不可编辑生产报工信息,生产报工记录加上生产时间字段
---
src/views/equipmentManagement/repair/index.vue | 74 ++++++++++++++++++++++++++++++++----
1 files changed, 65 insertions(+), 9 deletions(-)
diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index 6cae307..341b654 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -71,7 +71,7 @@
<el-button
type="primary"
icon="Plus"
- :disabled="multipleList.length !== 1"
+ :disabled="multipleList.length !== 1 || multipleList[0]?.status !== 1"
@click="addMaintain"
>
鏂板缁翠慨
@@ -79,11 +79,14 @@
<el-button type="success" icon="Van" @click="addRepair">
鏂板鎶ヤ慨
</el-button>
+ <el-button @click="handleOut">
+ 瀵煎嚭
+ </el-button>
<el-button
type="danger"
icon="Delete"
:disabled="multipleList.length <= 0"
- @click="delRepairByIds(multipleList.map((item) => item.id))"
+ @click="delRepairByIds(multipleList)"
>
鎵归噺鍒犻櫎
</el-button>
@@ -103,8 +106,12 @@
@pagination="changePage"
>
<template #statusRef="{ row }">
- <el-tag v-if="row.status === 1" type="success">瀹岀粨</el-tag>
- <el-tag v-if="row.status === 0" type="danger">寰呯淮淇�</el-tag>
+ <el-tag v-if="row.status === 5" type="danger">缁翠慨澶辫触</el-tag>
+ <el-tag v-if="row.status === 4" type="danger">缁翠慨鎴愬姛</el-tag>
+ <el-tag v-if="row.status === 3" type="danger">缁翠慨涓�</el-tag>
+ <el-tag v-if="row.status === 2" type="danger">瀹℃牳澶辫触</el-tag>
+ <el-tag v-if="row.status === 1" type="success">瀹℃牳閫氳繃</el-tag>
+ <el-tag v-if="row.status === 0" type="warning">瀹℃牳涓�</el-tag>
</template>
<template #operation="{ row }">
<el-button
@@ -112,6 +119,7 @@
text
icon="editPen"
@click="editRepair(row.id)"
+ :disabled="row.status !== 0"
>
缂栬緫
</el-button>
@@ -119,7 +127,8 @@
type="danger"
text
icon="delete"
- @click="delRepairByIds(row.id)"
+ @click="delRepairByIds(row)"
+ :disabled="row.status !== 0"
>
鍒犻櫎
</el-button>
@@ -134,7 +143,7 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import { getRepairPage, delRepair } from "@/api/equipmentManagement/repair";
-import { onMounted } from "vue";
+import { onMounted, getCurrentInstance } from "vue";
import RepairModal from "./Modal/RepairModal.vue";
import { ElMessageBox, ElMessage } from "element-plus";
import dayjs from "dayjs";
@@ -143,6 +152,8 @@
defineOptions({
name: "璁惧鎶ヤ慨",
});
+
+const { proxy } = getCurrentInstance();
// 妯℃�佹瀹炰緥
const repairModalRef = ref();
@@ -163,7 +174,12 @@
} = usePaginationApi(
getRepairPage,
{
- searchText: undefined,
+ deviceName: undefined,
+ deviceModel: undefined,
+ remark: undefined,
+ maintenanceName: undefined,
+ repairTimeStr: undefined,
+ maintenanceTimeStr: undefined,
},
[
{
@@ -271,19 +287,59 @@
// 鍗曡鍒犻櫎
const delRepairByIds = async (ids) => {
+ let isDel = false
+ if(Array.isArray(ids)){
+ ids.forEach((item)=>{
+ if(item.status !== 0){
+ isDel = true
+ }
+ })
+ }else{
+ if(ids.status !== 0){
+ isDel = true
+ }
+ }
+
+ if(isDel){
+ ElMessage.warning("鍙兘鍒犻櫎瀹℃牳涓殑鎶ヤ慨鏁版嵁");
+ return
+ }
+
ElMessageBox.confirm("纭鍒犻櫎鎶ヤ慨鏁版嵁, 姝ゆ搷浣滀笉鍙��?", "璀﹀憡", {
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning",
}).then(async () => {
- const { code } = await delRepair(ids);
+ let idsList = ""
+ if(Array.isArray(ids)){
+ idsList = multipleList.value.map((item) => item.id);
+ console.log(idsList)
+ }else{
+ idsList = ids.id
+ }
+ const { code } = await delRepair(idsList);
if (code === 200) {
ElMessage.success("鍒犻櫎鎴愬姛");
- getTableData();
+ await getTableData();
}
});
};
+// 瀵煎嚭
+const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/device/repair/export", {}, "璁惧鎶ヤ慨.xlsx");
+ })
+ .catch(() => {
+ ElMessage.info("宸插彇娑�");
+ });
+};
+
onMounted(() => {
getTableData();
});
--
Gitblit v1.9.3