|
|
|
@ -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,15 +799,13 @@ export default {
|
|
|
|
|
planType: "spotInspection",
|
|
|
|
|
planLoopStart: null,
|
|
|
|
|
},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.setWorkCenter();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
methods: {
|
|
|
|
|
// 获取工作中心
|
|
|
|
|
setWorkCenter() {
|
|
|
|
|
getWorkCenter().then(response => {
|
|
|
|
@ -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,93 +1047,126 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 下一步
|
|
|
|
|
stepNext() {
|
|
|
|
|
if (this.form.planWorkshop == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择车间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
// 校验
|
|
|
|
|
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"
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.spotCheckStep == 1) {
|
|
|
|
|
if (this.form.equipmentItem.length == 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: "请选择设备!",
|
|
|
|
|
type: "warning"
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.spotCheckStep++;
|
|
|
|
|
},
|
|
|
|
|
/** 查询点检计划列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
/** 查询点检计划列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listPlan(this.queryParams).then(response => {
|
|
|
|
|
this.spotCheckPlanList = response.rows;
|
|
|
|
|
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
planId: null,
|
|
|
|
|
planCode: null,
|
|
|
|
|
planName: null,
|
|
|
|
|
planWorkshop: null,
|
|
|
|
|
planProdLine: null,
|
|
|
|
|
equipmentName: null,
|
|
|
|
|
equipmentCode: null,
|
|
|
|
|
planLoop: null,
|
|
|
|
|
planLoopType: 'day',
|
|
|
|
|
planLoopStart: null,
|
|
|
|
|
planLoopEnd: null,
|
|
|
|
|
planPerson: null,
|
|
|
|
|
planStatus: '0',
|
|
|
|
|
planRestrict: '1',
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
planId: null,
|
|
|
|
|
planCode: null,
|
|
|
|
|
planName: null,
|
|
|
|
|
planWorkshop: null,
|
|
|
|
|
planProdLine: null,
|
|
|
|
|
equipmentName: null,
|
|
|
|
|
equipmentCode: null,
|
|
|
|
|
planLoop: null,
|
|
|
|
|
planLoopType: 'day',
|
|
|
|
|
planLoopStart: null,
|
|
|
|
|
planLoopEnd: null,
|
|
|
|
|
planPerson: null,
|
|
|
|
|
planStatus: '0',
|
|
|
|
|
planRestrict: '1',
|
|
|
|
|
planType: "spotInspection",
|
|
|
|
|
planOutsource: null,
|
|
|
|
|
workCode: null,
|
|
|
|
|
upkeep: null,
|
|
|
|
|
calculationRule: null,
|
|
|
|
|
shutDown: null,
|
|
|
|
|
factoryCode: null,
|
|
|
|
|
attr1: null,
|
|
|
|
|
attr2: null,
|
|
|
|
|
attr3: null,
|
|
|
|
|
delFlag: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
planOutsource: null,
|
|
|
|
|
workCode: null,
|
|
|
|
|
upkeep: null,
|
|
|
|
|
calculationRule: null,
|
|
|
|
|
shutDown: null,
|
|
|
|
|
factoryCode: null,
|
|
|
|
|
attr1: null,
|
|
|
|
|
attr2: null,
|
|
|
|
|
attr3: null,
|
|
|
|
|
delFlag: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
createTimeArray: [],
|
|
|
|
|
updateTimeArray: [],
|
|
|
|
|
planTimeArray: [],
|
|
|
|
|
equipmentItem: [],
|
|
|
|
|
personList: [],
|
|
|
|
|
loopStartArray: [],
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
// 重置日期范围
|
|
|
|
|
this.queryParams.createTimeArray = [];
|
|
|
|
|
this.queryParams.updateTimeArray = [];
|
|
|
|
|
this.queryParams.loopStartArray = [];
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.planId)
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.planId)
|
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
// 清除缓存
|
|
|
|
|
this.resetQuery();
|
|
|
|
@ -1153,11 +1177,11 @@ export default {
|
|
|
|
|
this.setPerson();
|
|
|
|
|
this.setWorkCenter();
|
|
|
|
|
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加点检计划";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加点检计划";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
// 清除缓存
|
|
|
|
|
this.queryEquipment = [];
|
|
|
|
@ -1184,13 +1208,20 @@ export default {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改计划";
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
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) {
|
|
|
|
|
if (this.form.planId != null) {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
updatePlan(this.form).then(response => {
|
|
|
|
|
this.planLoading = false;
|
|
|
|
@ -1198,21 +1229,21 @@ export default {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
addPlan(this.form).then(response => {
|
|
|
|
|
this.planLoading = false;
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const planIds = row.planId || this.ids;
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const planIds = row.planId || this.ids;
|
|
|
|
|
|
|
|
|
|
var planCodes = '';
|
|
|
|
|
// 处理信息
|
|
|
|
@ -1232,20 +1263,21 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$modal.confirm('是否确认删除计划编号为"' + planCodes + '"的数据项?').then(function() {
|
|
|
|
|
return delPlan(planIds);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('device/spotCheckPlan/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `spotCheckPlan_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$modal.confirm('是否确认删除计划编号为"' + planCodes + '"的数据项?').then(function () {
|
|
|
|
|
return delPlan(planIds);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('device/spotCheckPlan/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `spotCheckPlan_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|