|
|
|
@ -85,10 +85,10 @@
|
|
|
|
|
placeholder="请选择循环执行时间结束">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="false" label="巡检人员" prop="planPerson">
|
|
|
|
|
<el-form-item v-if="false" label="点检人员" prop="planPerson">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.planPerson"
|
|
|
|
|
placeholder="请输入巡检人员"
|
|
|
|
|
placeholder="请输入点检人员"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
@ -301,7 +301,7 @@
|
|
|
|
|
<span>{{ parseTime(scope.row.planLoopEnd, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="false" label="巡检人员" align="center" prop="planPerson" />
|
|
|
|
|
<el-table-column v-if="false" label="点检人员" align="center" prop="planPerson" />
|
|
|
|
|
<el-table-column label="计划状态" align="center" prop="planStatus">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.planStatus"/>
|
|
|
|
@ -364,7 +364,7 @@
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改点检计划对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
|
|
|
|
|
<el-dialog v-loading="planLoading" :title="title" :visible.sync="open" width="900px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
<el-form-item v-if="false" label="计划编码" prop="planCode">
|
|
|
|
|
<el-input v-model="form.planCode" placeholder="请输入计划编码" />
|
|
|
|
@ -383,21 +383,7 @@
|
|
|
|
|
<el-input v-model="form.planName" placeholder="请输入计划名称"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span=12 :offset="1">
|
|
|
|
|
<el-form-item label-width="100px" label="点检执行时间">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
@change="changeArray"
|
|
|
|
|
v-model="form.planTimeArray"
|
|
|
|
|
type="datetimerange"
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始时间"
|
|
|
|
|
end-placeholder="结束时间">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-col :span="6" :offset="1">
|
|
|
|
|
<el-form-item label="循环周期">
|
|
|
|
|
<el-input v-model="form.planLoop" placeholder="请输入循环周期"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -412,7 +398,9 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="6" :offset="1">
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label-width="100px" label="计划状态">
|
|
|
|
|
<el-select v-model="form.planStatus" placeholder="计划状态" clearable>
|
|
|
|
|
<el-option
|
|
|
|
@ -424,6 +412,18 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span=12 :offset="1">
|
|
|
|
|
<el-form-item label-width="100px" label="点检执行时间">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
@change="changeArray"
|
|
|
|
|
v-model="form.planTimeArray"
|
|
|
|
|
type="datetimerange"
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始时间"
|
|
|
|
|
end-placeholder="结束时间">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
@ -476,7 +476,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="itemTempName"
|
|
|
|
|
label="巡检项"
|
|
|
|
|
label="点检项"
|
|
|
|
|
width="300">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
@ -639,16 +639,26 @@ import {
|
|
|
|
|
updateSpotCheckPlan,
|
|
|
|
|
formatEquItem
|
|
|
|
|
} from "@/api/device/spotCheckPlan";
|
|
|
|
|
import {addPlan, getEquList, getPersonList, getWorkCenter, initUpdatePlanInfo, updatePlan} from "@/api/device/plan";
|
|
|
|
|
import {
|
|
|
|
|
addPlan,
|
|
|
|
|
delPlan,
|
|
|
|
|
getEquList,
|
|
|
|
|
getPersonList,
|
|
|
|
|
getWorkCenter,
|
|
|
|
|
initUpdatePlanInfo,
|
|
|
|
|
updatePlan
|
|
|
|
|
} from "@/api/device/plan";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "SpotCheckPlan",
|
|
|
|
|
dicts: ['device_loop_type', 'sys_normal_disable','device_yes_no'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 加载
|
|
|
|
|
planLoading: false,
|
|
|
|
|
// 工作中心list
|
|
|
|
|
workCenterList: [],
|
|
|
|
|
// 巡检人员选择穿梭框
|
|
|
|
|
// 点检人员选择穿梭框
|
|
|
|
|
personList: [],
|
|
|
|
|
selectPersonList: [],
|
|
|
|
|
// 编辑检查标准list
|
|
|
|
@ -675,7 +685,7 @@ export default {
|
|
|
|
|
selectEqu: false,
|
|
|
|
|
// 编辑检查项弹窗
|
|
|
|
|
editorItem: false,
|
|
|
|
|
// 巡检计划步骤
|
|
|
|
|
// 点检计划步骤
|
|
|
|
|
inspectionPlanStep: 0,
|
|
|
|
|
// 步骤
|
|
|
|
|
spotCheckStep: 0,
|
|
|
|
@ -763,7 +773,7 @@ export default {
|
|
|
|
|
changeCenter() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 改变巡检周期事件
|
|
|
|
|
// 改变点检周期事件
|
|
|
|
|
changeArray(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
console.log(this.form.planTimeArray)
|
|
|
|
@ -869,7 +879,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 巡检人员穿梭框
|
|
|
|
|
// 点检人员穿梭框
|
|
|
|
|
filterMethod(query, item) {
|
|
|
|
|
return item.label.indexOf(query) > -1;
|
|
|
|
|
},
|
|
|
|
@ -884,6 +894,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 删除标准
|
|
|
|
|
delStandard(e) {
|
|
|
|
|
console.log("e")
|
|
|
|
|
console.log(e)
|
|
|
|
|
console.log("this")
|
|
|
|
|
console.log(this.itemDetailList)
|
|
|
|
|
e.showFlag = false;
|
|
|
|
|
for (let i = 0; i < this.itemDetailList.length; i++) {
|
|
|
|
|
if (this.itemDetailList[i].detailCode == e.detailCode) {
|
|
|
|
@ -892,33 +906,61 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 点击编辑设备-巡检项目
|
|
|
|
|
// 点击编辑设备-点检项目
|
|
|
|
|
editorTheItem(e) {
|
|
|
|
|
|
|
|
|
|
console.log('e')
|
|
|
|
|
console.log(e)
|
|
|
|
|
console.log("form")
|
|
|
|
|
console.log(this.form.equipmentItem)
|
|
|
|
|
console.log("长度")
|
|
|
|
|
console.log(this.form.equipmentItem.length)
|
|
|
|
|
|
|
|
|
|
// 清除缓存
|
|
|
|
|
this.itemDetailList = [];
|
|
|
|
|
|
|
|
|
|
let qw = 1;
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.form.equipmentItem.length; i++) {
|
|
|
|
|
if (e.code == this.form.equipmentItem[i].code) {
|
|
|
|
|
|
|
|
|
|
if (e.equipmentCode == this.form.equipmentItem[i].equipmentCode) {
|
|
|
|
|
console.log("一次")
|
|
|
|
|
console.log(e.equipmentCode == this.form.equipmentItem[i].equipmentCode)
|
|
|
|
|
console.log(e.equipmentCode)
|
|
|
|
|
console.log(this.form.equipmentItem[i].equipmentCode)
|
|
|
|
|
|
|
|
|
|
for (let j = 0; j < this.form.equipmentItem[i].equPlanDetailList.length; j++) {
|
|
|
|
|
|
|
|
|
|
// 检查项名称
|
|
|
|
|
var itemName = this.form.equipmentItem[i].equPlanDetailList[j].itemName;
|
|
|
|
|
|
|
|
|
|
console.log("长度")
|
|
|
|
|
console.log(this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList.length)
|
|
|
|
|
|
|
|
|
|
for (let k = 0; k < this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList.length; k++){
|
|
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemName = itemName;
|
|
|
|
|
if (this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardType == "qualitative") {
|
|
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定性";
|
|
|
|
|
}else {
|
|
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定量";
|
|
|
|
|
|
|
|
|
|
if (this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].showFlag == true) {
|
|
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].itemName = itemName;
|
|
|
|
|
if (this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardType == "qualitative") {
|
|
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定性";
|
|
|
|
|
}else {
|
|
|
|
|
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定量";
|
|
|
|
|
}
|
|
|
|
|
console.log(qw++)
|
|
|
|
|
this.itemDetailList.push(this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.itemDetailList.push(this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.editorItem = true;
|
|
|
|
|
},
|
|
|
|
|
// 删除设备-巡检项
|
|
|
|
|
// 删除设备-点检项
|
|
|
|
|
delTheEquItem(e) {
|
|
|
|
|
this.form.equipmentItem.splice(e.equipmentCode, 1)
|
|
|
|
|
},
|
|
|
|
@ -979,6 +1021,13 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 下一步
|
|
|
|
|
stepNext() {
|
|
|
|
|
if (this.form.planWorkshop == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择车间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.spotCheckStep++;
|
|
|
|
|
},
|
|
|
|
|
/** 查询点检计划列表 */
|
|
|
|
@ -1006,12 +1055,12 @@ export default {
|
|
|
|
|
equipmentName: null,
|
|
|
|
|
equipmentCode: null,
|
|
|
|
|
planLoop: null,
|
|
|
|
|
planLoopType: null,
|
|
|
|
|
planLoopType: 'day',
|
|
|
|
|
planLoopStart: null,
|
|
|
|
|
planLoopEnd: null,
|
|
|
|
|
planPerson: null,
|
|
|
|
|
planStatus: null,
|
|
|
|
|
planRestrict: null,
|
|
|
|
|
planStatus: '0',
|
|
|
|
|
planRestrict: '1',
|
|
|
|
|
planType: "spotInspection",
|
|
|
|
|
planOutsource: null,
|
|
|
|
|
workCode: null,
|
|
|
|
@ -1060,7 +1109,6 @@ export default {
|
|
|
|
|
this.spotCheckStep = 0;
|
|
|
|
|
this.selectPersonList = [];
|
|
|
|
|
this.personList = [];
|
|
|
|
|
|
|
|
|
|
this.setPerson();
|
|
|
|
|
this.setWorkCenter();
|
|
|
|
|
|
|
|
|
@ -1081,6 +1129,8 @@ export default {
|
|
|
|
|
initUpdatePlanInfo(row).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
|
|
|
|
|
console.log(response.data)
|
|
|
|
|
|
|
|
|
|
this.selectPersonList = response.data.personListVO;
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.form.equipmentItem.length; i++) {
|
|
|
|
@ -1100,9 +1150,11 @@ export default {
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.planLoading = true;
|
|
|
|
|
if (this.form.planId != null) {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
updatePlan(this.form).then(response => {
|
|
|
|
|
this.planLoading = false;
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
@ -1110,6 +1162,7 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
addPlan(this.form).then(response => {
|
|
|
|
|
this.planLoading = false;
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
@ -1121,8 +1174,27 @@ export default {
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const planIds = row.planId || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除点检计划编号为"' + planIds + '"的数据项?').then(function() {
|
|
|
|
|
return delSpotCheckPlan(planIds);
|
|
|
|
|
|
|
|
|
|
var planCodes = '';
|
|
|
|
|
// 处理信息
|
|
|
|
|
for (let i = 0; i < this.spotCheckPlanList.length; i++) {
|
|
|
|
|
for (let j = 0; j < planIds.length; j++) {
|
|
|
|
|
if (planIds[j] == this.spotCheckPlanList[i].planId) {
|
|
|
|
|
planCodes = planCodes + this.spotCheckPlanList[i].planCode + ',';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (planCodes == '') {
|
|
|
|
|
for (let i = 0; i < this.spotCheckPlanList.length; i++) {
|
|
|
|
|
if (planIds == this.spotCheckPlanList[i].planId) {
|
|
|
|
|
planCodes = this.spotCheckPlanList[i].planCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$modal.confirm('是否确认删除计划编号为"' + planCodes + '"的数据项?').then(function() {
|
|
|
|
|
return delPlan(planIds);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|