feat(dms): 添加巡检和保养工单设备检查功能

- 在巡检工单页面添加设备检查对话框,支持查看设备列表和检查结果
- 实现巡检工单设备状态更新功能,可标记设备为合格或不合格
- 添加保养工单设备检查界面,支持查看保养状态和完成操作
- 新增 getDeviceList 和 updateDeviceStatus API 接口用于巡检设备管理
- 新增 getMaintDeviceList 和 updateMaintDeviceStatus API 接口用于保养设备管理
- 在工单列表页面添加检查设备按钮,支持权限控制
- 实现设备检查进度统计和状态显示功能
master
zangch@mesnac.com 5 months ago
parent 1c17d2ec39
commit 1fc29ccb6a

@ -57,3 +57,20 @@ export function delDmsBillsInstance(inspectInstanceId) {
})
}
// 获取工单设备列表(网页版巡检执行)
export function getDeviceList(inspectInstanceId) {
return request({
url: '/dms/dmsBillsInstance/devices/' + inspectInstanceId,
method: 'get'
})
}
// 更新设备检查状态(合格/不合格)
export function updateDeviceStatus(data) {
return request({
url: '/dms/dmsBillsInstance/device/status',
method: 'put',
data: data
})
}

@ -60,3 +60,20 @@ export function delDmsBillsMaintInstance(maintInstanceId) {
method: 'delete'
})
}
// 获取保养工单设备列表(网页版保养执行)
export function getMaintDeviceList(maintInstanceId) {
return request({
url: '/dms/dmsBillsMaintInstance/devices/' + maintInstanceId,
method: 'get'
})
}
// 更新设备保养状态(合格/不合格)
export function updateMaintDeviceStatus(data) {
return request({
url: '/dms/dmsBillsMaintInstance/device/status',
method: 'put',
data: data
})
}

@ -1,5 +1,57 @@
<template>
<div class="app-container">
<!-- 设备检查对话框 -->
<el-dialog title="巡检工单设备检查" :visible.sync="deviceDialogVisible" width="900px" append-to-body>
<div style="margin-bottom: 15px;">
<span>巡检路线{{ routeName }}</span>
<span style="margin-left: 30px;">设备总数{{ deviceTotal }}</span>
<span style="margin-left: 30px;">已完成{{ completedCount }}/{{ deviceTotal }}</span>
</div>
<el-table v-loading="deviceLoading" :data="deviceList">
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="设备编码" align="center" prop="deviceCode" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="巡检标准" align="center" prop="inspectStandard" show-overflow-tooltip />
<el-table-column label="检查结果" align="center" width="180">
<template slot-scope="scope">
<span v-if="scope.row.instanceDetailStatus === '3'" :style="{color: scope.row.inspectStatus === '1' ? '#67C23A' : '#F56C6C'}">
{{ scope.row.inspectStatus === '1' ? '✓ 合格' : '✗ 不合格' }}
</span>
<span v-else style="color: #909399;">未检查</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
v-if="scope.row.instanceDetailStatus !== '3'"
size="mini"
type="success"
icon="el-icon-check"
@click="updateStatus(scope.row, '1')"
>合格</el-button>
<el-button
v-if="scope.row.instanceDetailStatus !== '3'"
size="mini"
type="danger"
icon="el-icon-close"
@click="updateStatus(scope.row, '0')"
>不合格</el-button>
<el-button
v-if="scope.row.instanceDetailStatus === '3'"
size="mini"
type="text"
@click="updateStatus(scope.row, null)"
>修改</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 15px; color: #909399; font-size: 12px;">
图例<span style="color: #67C23A;"> 合格</span> | <span style="color: #F56C6C;"> 不合格</span> | <span style="color: #909399;">未检查</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="deviceDialogVisible = false"> </el-button>
</div>
</el-dialog>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="计划ID" prop="planInspectId">-->
<!-- <el-input-->
@ -153,10 +205,16 @@
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template slot-scope="scope">
<el-button
style="float: right"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleCheckDevice(scope.row)"
v-hasPermi="['dms:dmsBillsInstance:edit']"
>检查设备</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-bell"
@ -268,7 +326,7 @@
</template>
<script>
import { listDmsBillsInstance, getDmsBillsInstance, delDmsBillsInstance, addDmsBillsInstance, updateDmsBillsInstance } from "@/api/dms/dmsBillsInstance";
import { listDmsBillsInstance, getDmsBillsInstance, delDmsBillsInstance, addDmsBillsInstance, updateDmsBillsInstance, getDeviceList, updateDeviceStatus } from "@/api/dms/dmsBillsInstance";
import { listDmsBaseInspectRoute } from '@/api/dms/dmsBaseInspectRoute'
import { listDmsPlanInspect} from '@/api/dms/dmsPlanInspect'
@ -277,6 +335,12 @@ export default {
dicts:['dms_inspect_type','dms_inspect_status'],
data() {
return {
//
deviceDialogVisible: false,
deviceLoading: false,
deviceList: [],
routeName: '',
currentInspectInstanceId: null,
dmsRepairList:[],
dmsBaseInspectRouteList:[],
//
@ -328,6 +392,14 @@ export default {
}
};
},
computed: {
deviceTotal() {
return this.deviceList.length;
},
completedCount() {
return this.deviceList.filter(d => d.instanceDetailStatus === '3').length;
}
},
created() {
this.getList();
this.getRoute();
@ -457,6 +529,37 @@ export default {
this.download('dms/dmsBillsInstance/export', {
...this.queryParams
}, `dmsBillsInstance_${new Date().getTime()}.xlsx`)
},
/** 检查设备按钮操作 */
handleCheckDevice(row) {
this.currentInspectInstanceId = row.inspectInstanceId;
this.routeName = row.routeName || '未知路线';
this.deviceDialogVisible = true;
this.loadDeviceList();
},
/** 加载设备列表 */
loadDeviceList() {
this.deviceLoading = true;
getDeviceList(this.currentInspectInstanceId).then(response => {
this.deviceList = response.data;
this.deviceLoading = false;
}).catch(() => {
this.deviceLoading = false;
});
},
/** 更新设备检查状态 */
updateStatus(row, status) {
const data = {
instanceDetailId: row.instanceDetailId,
inspectInstanceId: row.inspectInstanceId,
inspectStatus: status,
instanceDetailStatus: status === null ? '1' : '3'
};
updateDeviceStatus(data).then(() => {
this.$modal.msgSuccess(status === '1' ? '已标记为合格' : status === '0' ? '已标记为不合格' : '状态已重置');
this.loadDeviceList();
this.getList(); //
});
}
}
};

@ -1,5 +1,51 @@
<template>
<div class="app-container">
<!-- 设备检查对话框 -->
<el-dialog title="保养工单设备检查" :visible.sync="deviceDialogVisible" width="900px" append-to-body>
<div style="margin-bottom: 15px;">
<span>保养级别{{ maintLevelName }}</span>
<span style="margin-left: 30px;">负责人{{ maintSupervisor }}</span>
<span style="margin-left: 30px;">设备总数{{ deviceTotal }}</span>
<span style="margin-left: 30px;">已完成{{ completedCount }}/{{ deviceTotal }}</span>
</div>
<el-table v-loading="deviceLoading" :data="deviceList">
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="设备编码" align="center" prop="deviceCode" />
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="保养工位" align="center" prop="maintStationName" show-overflow-tooltip />
<el-table-column label="保养标准" align="center" prop="maintProtocol" show-overflow-tooltip />
<el-table-column label="保养状态" align="center" width="120">
<template slot-scope="scope">
<span v-if="scope.row.maintStatus === 3" style="color: #67C23A;"> </span>
<span v-else-if="scope.row.maintStatus === 2" style="color: #409EFF;"> 保养中</span>
<span v-else style="color: #909399;"> 待保养</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
v-if="scope.row.maintStatus !== 3"
size="mini"
type="success"
icon="el-icon-check"
@click="updateStatus(scope.row, 3)"
>完成</el-button>
<el-button
v-if="scope.row.maintStatus === 3"
size="mini"
type="text"
@click="viewDetail(scope.row)"
>查看详情</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 15px; color: #909399; font-size: 12px;">
图例<span style="color: #67C23A;"> 已完成</span> | <span style="color: #409EFF;"> 保养中</span> | <span style="color: #909399;"> 待保养</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="deviceDialogVisible = false"> </el-button>
</div>
</el-dialog>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="保养单号" prop="billsMaintCode">
<el-input
@ -114,8 +160,15 @@
<!-- <el-table-column label="保养完成率" align="center" prop="maintCompRate" />-->
<!-- <el-table-column label="是否标识1-是2-否" align="center" prop="isFlag" />-->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleCheckDevice(scope.row)"
v-hasPermi="['dms:dmsBillsMaintInstance:edit']"
>检查设备</el-button>
<!--el-button
style="float: right"
size="mini"
@ -196,7 +249,7 @@
</template>
<script>
import { listDmsBillsMaintInstance, getDmsBillsMaintInstance, delDmsBillsMaintInstance, addDmsBillsMaintInstance, updateDmsBillsMaintInstance } from "@/api/dms/dmsBillsMaintInstance";
import { listDmsBillsMaintInstance, getDmsBillsMaintInstance, delDmsBillsMaintInstance, addDmsBillsMaintInstance, updateDmsBillsMaintInstance, getMaintDeviceList, updateMaintDeviceStatus } from "@/api/dms/dmsBillsMaintInstance";
import { listMaint } from '@/api/dms/maint'
export default {
@ -204,6 +257,13 @@ export default {
dicts:['dms_maint_level','dms_maint_status'],
data() {
return {
//
deviceDialogVisible: false,
deviceLoading: false,
deviceList: [],
currentMaintInstanceId: null,
maintLevelName: '',
maintSupervisor: '',
//
maintList:[],
//
@ -255,6 +315,14 @@ export default {
}
};
},
computed: {
deviceTotal() {
return this.deviceList.length;
},
completedCount() {
return this.deviceList.filter(d => d.maintStatus === 3).length;
}
},
created() {
this.getList();
this.getPlanMaint();
@ -378,6 +446,50 @@ export default {
...this.queryParams
}, `dmsBillsMaintInstance_${new Date().getTime()}.xlsx`)
},
/** 检查设备按钮操作 */
handleCheckDevice(row) {
this.currentMaintInstanceId = row.maintInstanceId;
this.maintLevelName = this.getMaintLevelName(row.maintLevel);
this.maintSupervisor = row.maintSupervisor || '未指定';
this.deviceDialogVisible = true;
this.loadDeviceList();
},
/** 获取保养级别名称 */
getMaintLevelName(level) {
const levelMap = {
1: '日常保养',
2: '月度保养',
3: '年度保养'
};
return levelMap[level] || '未知';
},
/** 加载设备列表 */
loadDeviceList() {
this.deviceLoading = true;
getMaintDeviceList(this.currentMaintInstanceId).then(response => {
this.deviceList = response.data;
this.deviceLoading = false;
}).catch(() => {
this.deviceLoading = false;
});
},
/** 更新设备保养状态 */
updateStatus(row, status) {
const data = {
billsMaintDetailId: row.billsMaintDetailId,
maintInstanceId: row.maintInstanceId,
maintStatus: status
};
updateMaintDeviceStatus(data).then(() => {
this.$modal.msgSuccess('已标记为已完成');
this.loadDeviceList();
this.getList(); //
});
},
/** 查看详情 */
viewDetail(row) {
this.$message.info('设备保养详情:设备编码 ' + row.deviceCode);
},
/** 详情按钮操作 */

Loading…
Cancel
Save