设备点检保养计划新增,自动生成按钮状态修复

This commit is contained in:
JinLu.Yin 2022-09-01 23:05:36 +08:00
parent ba2272671c
commit 2ae6153046
2 changed files with 10 additions and 6 deletions

View File

@ -386,6 +386,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -408,7 +409,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加设备点检计划"; this.title = "添加计划";
this.optType = "add"; this.optType = "add";
}, },
// //
@ -429,7 +430,7 @@ export default {
getCheckplan(planId).then(response => { getCheckplan(planId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改设备点检计划"; this.title = "修改计划";
this.optType = "edit"; this.optType = "edit";
}); });
}, },
@ -456,27 +457,31 @@ export default {
handleFinish(){ handleFinish(){
if(this.form.planId != null && this.form.status =='PREPARE'){ if(this.form.planId != null && this.form.status =='PREPARE'){
this.form.status='FINISHED'; this.form.status='FINISHED';
updateCheckplan(this.form).then(response => { updateCheckplan(this.form).then(response => {
this.$modal.msgSuccess("已启用"); this.$modal.msgSuccess("已启用");
this.open = false; this.open = false;
this.getList(); this.getList();
},err =>{
this.form.status='PREPARE';
}); });
} }
}, },
handleDeFinish(){ handleDeFinish(){
if(this.form.planId != null && this.form.status =='FINISHED'){ if(this.form.planId != null && this.form.status =='FINISHED'){
this.form.status='PREPARE'; this.form.status='PREPARE';
updateCheckplan(this.form).then(response => { updateCheckplan(this.form).then(response => {
this.$modal.msgSuccess("已停用"); this.$modal.msgSuccess("已停用");
this.open = false; this.open = false;
this.getList(); this.getList();
},err =>{
this.form.status='FINISHED';
}); });
} }
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const planIds = row.planId || this.ids; const planIds = row.planId || this.ids;
this.$modal.confirm('是否确认删除设备点检计划编号为"' + planIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除计划编号为"' + planIds + '"的数据项?').then(function() {
return delCheckplan(planIds); return delCheckplan(planIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();

View File

@ -129,7 +129,6 @@ export default {
}, },
// //
onMachineryAdd(rows){ onMachineryAdd(rows){
debugger;
if(rows !=null && rows.length >0){ if(rows !=null && rows.length >0){
rows.forEach(row => { rows.forEach(row => {
row.planId = this.planId; row.planId = this.planId;