|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
|
<el-form |
|
|
|
|
ref="form" |
|
|
|
|
:model="form" |
|
|
|
|
:rules="formRules" |
|
|
|
|
label-width="140px" |
|
|
|
|
label-position="top" |
|
|
|
|
> |
|
|
|
|
@ -300,7 +301,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<el-row v-if="this.status >= 1 || (viewType == 'view' && status == -4)"> |
|
|
|
|
<el-col :span="6"> |
|
|
|
|
<el-form-item label="维修班组" > |
|
|
|
|
<el-form-item label="维修班组" prop="repairTeam"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.repairTeam" |
|
|
|
|
:rows="3" |
|
|
|
|
@ -312,9 +313,9 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="6"> |
|
|
|
|
<el-form-item label="维修人员" > |
|
|
|
|
<el-form-item label="维修人员" prop="repairPerson"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="repairPerson" |
|
|
|
|
v-model="form.repairPerson" |
|
|
|
|
:rows="3" |
|
|
|
|
:disabled="status > 1 || viewType == 'view'" |
|
|
|
|
> |
|
|
|
|
@ -647,6 +648,14 @@ export default { |
|
|
|
|
repairPerson:'', |
|
|
|
|
repairContent:'' |
|
|
|
|
}, |
|
|
|
|
formRules:{ |
|
|
|
|
repairTeam:[ |
|
|
|
|
{required:true,message:'请选择维修班组',trigger:'change'} |
|
|
|
|
], |
|
|
|
|
repairPerson:[ |
|
|
|
|
{required:true,message:'请选择维修人员',trigger:'change'} |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
//状态 |
|
|
|
|
status: 0, |
|
|
|
|
//当前行id |
|
|
|
|
@ -690,6 +699,7 @@ export default { |
|
|
|
|
this.groupId = val |
|
|
|
|
getMainPer({deptId:val}).then(res =>{ |
|
|
|
|
this.perData = res.data.data |
|
|
|
|
this.form.repairPerson = '' |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 图片上传成功参数 |
|
|
|
|
@ -748,7 +758,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
getMainPer({deptId:this.form.repairTeam}).then(res =>{ |
|
|
|
|
this.perData = res.data.data |
|
|
|
|
this.repairPerson = row.repairPerson |
|
|
|
|
this.form.repairPerson = row.repairPerson |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 特殊属性的给默认值 |
|
|
|
|
@ -778,50 +788,55 @@ export default { |
|
|
|
|
* 按钮报修单提交 |
|
|
|
|
*/ |
|
|
|
|
async submit() { |
|
|
|
|
if (this.status > 2) { |
|
|
|
|
if (this.form.status2 === undefined || this.form.status2 === "") { |
|
|
|
|
this.$message({ type: "warning", message: "请选择维修结果" }); |
|
|
|
|
return; |
|
|
|
|
this.$refs.form.validate((valid) =>{ |
|
|
|
|
if(valid){ |
|
|
|
|
if (this.status > 2) { |
|
|
|
|
if (this.form.status2 === undefined || this.form.status2 === "") { |
|
|
|
|
this.$message({ type: "warning", message: "请选择维修结果" }); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let status; |
|
|
|
|
if (this.form.status2 === undefined || this.form.status2 === "") { |
|
|
|
|
status = this.status + 1; |
|
|
|
|
} else { |
|
|
|
|
status = this.form.status2; |
|
|
|
|
} |
|
|
|
|
// 调修改接口 传状态、id、对象 |
|
|
|
|
const params = { |
|
|
|
|
id: this.id, |
|
|
|
|
instrumentId: this.instrumentId, |
|
|
|
|
...this.form, |
|
|
|
|
status, |
|
|
|
|
// repairPerson:this.repairPerson |
|
|
|
|
}; |
|
|
|
|
if(this.imgList.length !== 0){ |
|
|
|
|
params.repairAttach = this.imgList[0].url |
|
|
|
|
} |
|
|
|
|
this.$delete(params, "status2"); |
|
|
|
|
this.$delete(params, "applyUser"); |
|
|
|
|
this.$delete(params, "applyUserName"); |
|
|
|
|
// console.log('params ==============>',params) |
|
|
|
|
reportModify(params); |
|
|
|
|
// if (this.status === 0) { |
|
|
|
|
// await reportModify(1, this.id) |
|
|
|
|
// } else if (this.status === 1) { |
|
|
|
|
// await reportModify(2, this.id) |
|
|
|
|
// } else if (this.status === 2) { |
|
|
|
|
// await reportModify(3, this.id) |
|
|
|
|
// } else if (this.status === 3) { |
|
|
|
|
// await reportModify(4, this.id) |
|
|
|
|
// } |
|
|
|
|
// await reportModify(this.status + 1, this.id) |
|
|
|
|
//关闭页面并跳转回列表页 |
|
|
|
|
const tag = this.$store.getters.tagList.find( |
|
|
|
|
(item) => item.value === this.$route.fullPath |
|
|
|
|
); |
|
|
|
|
this.$store.commit("DEL_TAG", tag); |
|
|
|
|
this.$router.push({ path: "/repair/proposer" }); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let status; |
|
|
|
|
if (this.form.status2 === undefined || this.form.status2 === "") { |
|
|
|
|
status = this.status + 1; |
|
|
|
|
} else { |
|
|
|
|
status = this.form.status2; |
|
|
|
|
} |
|
|
|
|
// 调修改接口 传状态、id、对象 |
|
|
|
|
const params = { |
|
|
|
|
id: this.id, |
|
|
|
|
instrumentId: this.instrumentId, |
|
|
|
|
...this.form, |
|
|
|
|
status, |
|
|
|
|
repairPerson:this.repairPerson |
|
|
|
|
}; |
|
|
|
|
if(this.imgList.length !== 0){ |
|
|
|
|
params.repairAttach = this.imgList[0].url |
|
|
|
|
} |
|
|
|
|
this.$delete(params, "status2"); |
|
|
|
|
this.$delete(params, "applyUser"); |
|
|
|
|
this.$delete(params, "applyUserName"); |
|
|
|
|
// console.log('params ==============>',params) |
|
|
|
|
await reportModify(params); |
|
|
|
|
// if (this.status === 0) { |
|
|
|
|
// await reportModify(1, this.id) |
|
|
|
|
// } else if (this.status === 1) { |
|
|
|
|
// await reportModify(2, this.id) |
|
|
|
|
// } else if (this.status === 2) { |
|
|
|
|
// await reportModify(3, this.id) |
|
|
|
|
// } else if (this.status === 3) { |
|
|
|
|
// await reportModify(4, this.id) |
|
|
|
|
// } |
|
|
|
|
// await reportModify(this.status + 1, this.id) |
|
|
|
|
//关闭页面并跳转回列表页 |
|
|
|
|
const tag = this.$store.getters.tagList.find( |
|
|
|
|
(item) => item.value === this.$route.fullPath |
|
|
|
|
); |
|
|
|
|
this.$store.commit("DEL_TAG", tag); |
|
|
|
|
this.$router.push({ path: "/repair/proposer" }); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|