点检、巡检、保养计划校验

master
wws 12 months ago
parent a6b9a87114
commit 3ebef94a3d

@ -948,12 +948,14 @@ export default {
}
this.$modal.confirm('是否确认删除计划工单编号为"' + orderCodes + '"的数据项?').then(function () {
return delDeviceOrder(orderIds);
}).then(() => {
this.getList();
delDeviceOrder(orderIds).then(response => {
if (response.code != 500) {
this.$modal.msgSuccess("删除成功");
this.getList();
}
}).catch(() => {
});
})
},
/** 导出按钮操作 */
handleExport() {

@ -377,18 +377,18 @@
<!-- 巡检计划基本信息 -->
<div class="my-step-body" v-if="inspectionPlanStep==0">
<el-row>
<el-col :span="8" offset="2">
<el-col :span="8" :offset="2">
<el-form-item label="计划名称">
<el-input v-model="form.planName" placeholder="请输入计划名称"/>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-col :span="8" :offset="1">
<el-form-item label="循环周期">
<el-input v-model="form.planLoop" placeholder="请输入循环周期"/>
<el-input-number v-model="form.planLoop" label=""></el-input-number>
</el-form-item>
</el-col >
<el-col :span="2">
<el-select v-model="form.planLoopType" placeholder="周期" clearable>
<el-select v-model="form.planLoopType" placeholder="周期">
<el-option
v-for="dict in dict.type.device_loop_type"
:key="dict.value"
@ -399,9 +399,9 @@
</el-col>
</el-row>
<el-row>
<el-col :span="8" offset="2">
<el-col :span="8" :offset="2">
<el-form-item label="计划状态">
<el-select v-model="form.planStatus" placeholder="计划状态" clearable>
<el-select v-model="form.planStatus" placeholder="计划状态">
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
@ -411,9 +411,9 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" offset="2">
<el-col :span="8" :offset="1">
<el-form-item label="车间">
<el-select @change="changeCenter" v-model="form.planWorkshop" placeholder="请选择车间" clearable>
<el-select @change="changeCenter" v-model="form.planWorkshop" placeholder="请选择车间">
<el-option
v-for="item in workCenterList"
:key="item.factoryCode"
@ -1009,15 +1009,48 @@ export default {
stepLast() {
this.inspectionPlanStep--;
},
// --
//
stepNext() {
//
if (this.inspectionPlanStep == 0) {
if (this.form.planName == null) {
this.$message({
message: "计划名称不能为空!",
type: "warning"
})
return
}
if (this.form.planLoop <= 0) {
this.$message({
message: "循环周期不可小于等于0",
type: "warning"
})
return
}
if (this.form.planTimeArray.length == 0) {
this.$message({
message: "循环时间范围不能为空!",
type: "warning"
})
return
}
if (this.form.planWorkshop == null) {
this.$message({
message: '请选择工作中心!',
type: 'warning'
message: "车间不能为空!",
type: "warning"
})
return
}
}
if (this.inspectionPlanStep == 1) {
if (this.form.equipmentItem.length == 0) {
this.$message({
message: "请选择设备!",
type: "warning"
})
return
}
}
this.inspectionPlanStep++;
},
/** 查询计划列表 */
@ -1153,46 +1186,15 @@ export default {
},
/** 提交按钮 */
submitForm() {
//
if (this.form.planName == null) {
this.$message({
message: '计划名称不能为空!',
type: 'warning'
})
return
}
if (this.form.planLoop == null) {
this.$message({
message: '循环周期不能为空!',
type: 'warning'
})
return
}
if (this.form.planLoopType == null) {
this.$message({
message: '请选择循环周期类型!',
type: 'warning'
})
return
}
if (this.form.planStatus == null) {
this.$message({
message: '请选择计划状态!',
type: 'warning'
})
return
}
if (this.form.planTimeArray.length == 0) {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.selectPersonList.length == 0) {
this.$message({
message: '请选择计划执行时间!',
type: 'warning'
message: "请请选择人员!",
type: "warning"
})
return
}
this.$refs["form"].validate(valid => {
if (valid) {
this.planLoading = true;
if (this.form.planId != null) {
this.form.personList = this.selectPersonList;

@ -394,17 +394,17 @@
<div class="my-step-body" v-if="spotCheckStep==0">
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="计划名称">
<el-form-item label="计划名称" prop="planName">
<el-input v-model="form.planName" placeholder="请输入计划名称"/>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="循环周期">
<el-input v-model="form.planLoop" placeholder="请输入循环周期"/>
<el-col :span="8" :offset="1">
<el-form-item label="循环周期" prop="planLoop">
<el-input-number v-model="form.planLoop" label=""></el-input-number>
</el-form-item>
</el-col>
<el-col :span="2">
<el-select v-model="form.planLoopType" placeholder="周期" clearable>
<el-select v-model="form.planLoopType" placeholder="周期">
<el-option
v-for="dict in dict.type.device_loop_type"
:key="dict.value"
@ -417,7 +417,7 @@
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="计划状态">
<el-select v-model="form.planStatus" placeholder="计划状态" clearable>
<el-select v-model="form.planStatus" placeholder="计划状态">
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
@ -428,28 +428,19 @@
</el-form-item>
</el-col>
<el-col :span="8" :offset="1">
<el-form-item label-width="100px" label="点检开始时间">
<el-form-item label-width="115px" label="点检开始时间" prop="planLoopStart">
<el-date-picker
v-model="form.planLoopStart"
type="date"
placeholder="开始时间">
</el-date-picker>
<el-date-picker
v-if="false"
@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" offset="2" >
<el-form-item label="车间">
<el-select @change="changeCenter" v-model="form.planWorkshop" placeholder="请选择车间" clearable>
<el-form-item label="车间" prop="planWorkshop">
<el-select @change="changeCenter" v-model="form.planWorkshop" placeholder="请选择车间">
<el-option
v-for="item in workCenterList"
:key="item.factoryCode"
@ -675,6 +666,8 @@ export default {
dicts: ['device_loop_type', 'sys_normal_disable','device_yes_no'],
data() {
return {
//
rules: {},
//
pickerOptions: {
shortcuts: [{
@ -806,8 +799,6 @@ export default {
planType: "spotInspection",
planLoopStart: null,
},
//
rules: {}
};
},
created() {
@ -969,13 +960,13 @@ export default {
//
var itemName = this.form.equipmentItem[i].equPlanDetailList[j].itemName;
for (let k = 0; k < this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList.length; k++){
for (let k = 0; k < this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList.length; k++) {
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 {
} else {
this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k].standardTypeName = "定量";
}
this.itemDetailList.push(this.form.equipmentItem[i].equPlanDetailList[j].equPlanStandardList[k]);
@ -1056,13 +1047,46 @@ export default {
},
//
stepNext() {
//
if (this.spotCheckStep == 0) {
if (this.form.planName == null) {
this.$message({
message: "计划名称不能为空!",
type: "warning"
})
return
}
if (this.form.planLoop <= 0) {
this.$message({
message: "循环周期不可小于等于0",
type: "warning"
})
return
}
if (this.form.planLoopStart == null) {
this.$message({
message: "点检开始时间不能为空!",
type: "warning"
})
return
}
if (this.form.planWorkshop == null) {
this.$message({
message: '请选择车间!',
type: 'warning'
message: "车间不能为空!",
type: "warning"
})
return
}
}
if (this.spotCheckStep == 1) {
if (this.form.equipmentItem.length == 0) {
this.$message({
message: "请选择设备!",
type: "warning"
})
return
}
}
this.spotCheckStep++;
},
/** 查询点检计划列表 */
@ -1138,7 +1162,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.planId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -1189,6 +1213,13 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.selectPersonList.length == 0) {
this.$message({
message: "请请选择人员!",
type: "warning"
})
return
}
this.planLoading = true;
if (this.form.planId != null) {
this.form.personList = this.selectPersonList;
@ -1232,12 +1263,13 @@ export default {
}
}
this.$modal.confirm('是否确认删除计划编号为"' + planCodes + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除计划编号为"' + planCodes + '"的数据项?').then(function () {
return delPlan(planIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {

@ -636,7 +636,7 @@
<script>
import { listSpotInspectionOrder, getSpotInspectionOrder, delSpotInspectionOrder, addSpotInspectionOrder, updateSpotInspectionOrder } from "@/api/device/spotInspectionOrder";
import {getDeviceOrder, listDeviceOrder, updateDeviceOrder} from "@/api/device/deviceOrder";
import {delDeviceOrder, getDeviceOrder, listDeviceOrder, updateDeviceOrder} from "@/api/device/deviceOrder";
import {getWorkCenter} from "@/api/device/plan";
import {getInspectionWork} from "@/api/device/inspectionWork";
@ -949,12 +949,15 @@ export default {
}
}
this.$modal.confirm('是否确认删除点检工单编号为"' + orderCodes + '"的数据项?').then(function() {
return delSpotInspectionOrder(orderIds);
}).then(() => {
this.getList();
this.$modal.confirm('是否确认删除点检工单编号为"' + orderCodes + '"的数据项?').then(function () {
delDeviceOrder(orderIds).then(response => {
if (response.code != 500) {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList();
}
}).catch(() => {
});
})
},
/** 导出按钮操作 */
handleExport() {

@ -1184,7 +1184,7 @@ import {
} from "@/api/device/upkeepOrder";
import {formatEquItem, querySpareList} from "@/api/device/upkeepPlan";
import {getEquList, getPersonList, getWorkCenter} from "@/api/device/plan";
import {getDeviceOrder, listDeviceOrder, updateDeviceOrder} from "@/api/device/deviceOrder";
import {delDeviceOrder, getDeviceOrder, listDeviceOrder, updateDeviceOrder} from "@/api/device/deviceOrder";
import {getInspectionWork, updateInspectionWork} from "@/api/device/inspectionWork";
export default {
@ -1821,12 +1821,14 @@ export default {
}
this.$modal.confirm('是否确认删除保养工单编号为"' + orderCodes + '"的数据项?').then(function () {
return delUpkeepOrder(orderIds);
}).then(() => {
this.getList();
delDeviceOrder(orderIds).then(response => {
if (response.code != 500) {
this.$modal.msgSuccess("删除成功");
this.getList();
}
}).catch(() => {
});
})
},
/** 导出按钮操作 */
handleExport() {

@ -405,7 +405,7 @@
<!-- 保养计划基本信息 -->
<div class="my-step-body" v-if="this.upkeepSteps==0">
<el-row>
<el-col :span="8">
<el-col :offset="2" :span="8">
<el-form-item label="保养名称:">
<el-input v-model="form.planName" placeholder="请输入保养名称"/>
</el-form-item>
@ -424,7 +424,7 @@
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-col :offset="2" :span="20">
<el-form-item label-width="110px" label="保养生成规则:">
<el-radio v-model="form.calculationRule" label="0"></el-radio>
<el-radio v-model="form.calculationRule" label="1"></el-radio>
@ -434,9 +434,9 @@
</el-row>
<el-row>
<div v-if="form.calculationRule != '2' ">
<el-col :span="6">
<el-col :offset="2" :span="8">
<el-form-item label="循环周期:">
<el-input v-model="form.planLoop" placeholder="请输入循环周期"/>
<el-input-number v-model="form.planLoop" label=""></el-input-number>
</el-form-item>
</el-col>
<el-col :span="2">
@ -449,7 +449,7 @@
/>
</el-select>
</el-col>
<el-col :span="15" :offset="1">
<el-col :offset="2" :span="22">
<el-form-item label-width="100px" label="保养时间范围">
<el-date-picker
@change="changeArray"
@ -463,7 +463,7 @@
</el-col>
</div>
<div v-else>
<el-col :span="8">
<el-col :offset="2" :span="8">
<el-form-item label-width="100px" label="保养开始时间">
<el-date-picker
v-model="form.planLoopStart"
@ -475,13 +475,13 @@
</div>
</el-row>
<el-row>
<el-col :span="12">
<el-col :offset="2" :span="10">
<el-form-item label-width="110px" label="是否停机保养:">
<el-radio v-model="form.shutDown" label="1"></el-radio>
<el-radio v-model="form.shutDown" label="0"></el-radio>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="10">
<el-form-item label-width="110px" label="保养类型:">
<el-radio v-model="form.upkeep" label="0"></el-radio>
<el-radio v-model="form.upkeep" label="1"></el-radio>
@ -1372,13 +1372,52 @@ export default {
},
//
stepNext() {
if (this.upkeepSteps == 0) {
if (this.form.planName == null) {
this.$message({
message: "计划名称不能为空!",
type: "warning"
})
return
}
if (this.form.planLoop <= 0 && this.form.calculationRule !=2) {
this.$message({
message: "循环周期不可小于等于0",
type: "warning"
})
return
}
if (this.form.planTimeArray.length == 0 && this.form.calculationRule != "2") {
this.$message({
message: "循环时间范围不能为空!",
type: "warning"
})
return
}
if (this.form.planLoopStart == null && this.form.calculationRule == "2") {
this.$message({
message: "开始时间不可为空!",
type: "warning"
})
return
}
if (this.form.planWorkshop == null) {
this.$message({
message: '请选择车间!',
type: 'warning'
message: "车间不能为空!",
type: "warning"
})
return
}
}
if (this.upkeepSteps == 1) {
if (this.form.equipmentItem.length == 0) {
this.$message({
message: "请选择设备!",
type: "warning"
})
return
}
}
this.upkeepSteps++;
},
/** 查询保养计划列表 */
@ -1523,6 +1562,13 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.selectPersonList.length == 0) {
this.$message({
message: "请请选择人员!",
type: "warning"
})
return
}
this.planLoading = true;
if (this.form.planId != null) {
this.form.personList = this.selectPersonList;

Loading…
Cancel
Save