|
|
|
|
@ -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(); // 刷新工单列表状态
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|