报废原因管理bug修复

This commit is contained in:
hongchao 2025-01-17 11:25:21 +08:00
parent 9f98a65dea
commit 1afa702f6a
1 changed files with 13 additions and 3 deletions

View File

@ -251,7 +251,10 @@ export default {
parentOption: [], parentOption: [],
typeOption: [], typeOption: [],
// //
form: {}, form: {
parentId: undefined,
typeId: undefined,
},
// //
rules: { rules: {
parentId: [ parentId: [
@ -265,7 +268,7 @@ export default {
{ {
required: true, required: true,
message: "名称不能为空", message: "名称不能为空",
trigger: "change", trigger: "blur",
}, },
], ],
reason: [ reason: [
@ -299,6 +302,7 @@ export default {
/** 根据二级查三级类型下拉框 */ /** 根据二级查三级类型下拉框 */
handleChange() { handleChange() {
this.typeOption = []; this.typeOption = [];
setTimeout(()=>{
getTypeOptionInfoThree({parentId:this.form.parentId}).then((response) => { getTypeOptionInfoThree({parentId:this.form.parentId}).then((response) => {
response.data.forEach((item) => { response.data.forEach((item) => {
this.typeOption.push({ this.typeOption.push({
@ -306,7 +310,9 @@ export default {
typeName: item.typeName, typeName: item.typeName,
}); });
}); });
this.form.typeId = null; //
}); });
},500)
}, },
@ -323,6 +329,7 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
// this.form.typeId = undefined; //
this.showDevice = true; this.showDevice = true;
this.title = "新增"; this.title = "新增";
}, },
@ -347,7 +354,10 @@ export default {
}, },
// //
reset() { reset() {
this.form = {}; this.form = {
parentId: undefined,
typeId: undefined,
};
this.resetForm("form"); this.resetForm("form");
}, },