From bd9a631d2b597492307cd39f93c09cc3aa4db62d Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期三, 07 一月 2026 15:23:14 +0800
Subject: [PATCH] 进销存·华玺砂浆》设备保修的新增保修添加金额和审批人开发 进销存·华玺砂浆》协同报销页面修改
---
src/views/equipmentManagement/repair/index.vue | 76 +++++++++++++++++++++++++++++++++----
1 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index 6cae307..de7f850 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -71,19 +71,23 @@
<el-button
type="primary"
icon="Plus"
- :disabled="multipleList.length !== 1"
+ :disabled="multipleList.length !== 1 || multipleList[0]?.status !== 1"
@click="addMaintain"
>
+
鏂板缁翠慨
</el-button>
<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 +107,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 +120,7 @@
text
icon="editPen"
@click="editRepair(row.id)"
+ :disabled="row.status !== 0"
>
缂栬緫
</el-button>
@@ -119,7 +128,8 @@
type="danger"
text
icon="delete"
- @click="delRepairByIds(row.id)"
+ @click="delRepairByIds(row)"
+ :disabled="row.status !== 0"
>
鍒犻櫎
</el-button>
@@ -134,7 +144,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 +153,8 @@
defineOptions({
name: "璁惧鎶ヤ慨",
});
+
+const { proxy } = getCurrentInstance();
// 妯℃�佹瀹炰緥
const repairModalRef = ref();
@@ -163,7 +175,12 @@
} = usePaginationApi(
getRepairPage,
{
- searchText: undefined,
+ deviceName: undefined,
+ deviceModel: undefined,
+ remark: undefined,
+ maintenanceName: undefined,
+ repairTimeStr: undefined,
+ maintenanceTimeStr: undefined,
},
[
{
@@ -259,6 +276,7 @@
// 鏂板缁翠慨
const addMaintain = () => {
+
const row = multipleList.value[0];
maintainModalRef.value.open(row.id, row);
};
@@ -271,19 +289,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