fix:弹框表单残留上次内容问题一批:route_form open时主动resetForm不再依赖父级v-if销毁(关闭动画期间重开复用实例致残留);riskpoint新增未重置saveForm且RiskForm常驻挂载补destroy-on-close;algo页弹框v-model改v-if与algo2对齐;mroom/plat_record新增未重置表单

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-07-23 14:19:26 +08:00
parent 37b5e3f468
commit d6d382e281
5 changed files with 41 additions and 9 deletions

View File

@ -356,7 +356,7 @@
<el-dialog v-model="choseMyScheduleDialog" title="选择策略">
<MySchedule @scheduleChose="scheduleChose"></MySchedule>
</el-dialog>
<el-dialog v-model="riskDialog" title="新增/编辑" width="90%">
<el-dialog v-model="riskDialog" title="新增/编辑" width="90%" destroy-on-close>
<RiskForm ref="riskForm" :riskpoint="rowData.id" @riskConfirm="riskConfirm"></RiskForm>
</el-dialog>
</el-container>
@ -444,6 +444,7 @@ export default {
this.$refs.table.queryData(this.query);
},
table_add() {
this.saveForm = Object.assign({}, defaultForm);
this.saveDialog = true;
},
table_edit(row) {

View File

@ -128,13 +128,13 @@
</el-container>
</el-container>
<save-dialog
v-model="dialog.save"
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccessss"
@closed="dialog.save = false"
></save-dialog>
<algo-dialog
v-model="dialog.algos"
v-if="dialog.algos"
ref="algoDialog"
@success="handleSaveSuccessss"
@closed="dialog.algos = false"

View File

@ -467,15 +467,43 @@ export default {
that.paramsJsonFileurl = list1;
that.params_json.fileurl = JSON.stringify(that.paramsJsonFileurl);
},
//openv-if
resetForm() {
this.form = Object.assign({}, defaultForm);
this.form.routepack = this.routepack;
if (this.project_code == "bxerp" || this.project_code == "tcerp") {
this.form.material_out_tracking = 20;
}
this.params_json = {
duibian1: 0,
duibian2: 0,
changdu1: 0,
changdu2: 0,
pbnum: 0,
pbsigao: 0,
pbbb: "是",
};
this.params_json2 = { dscd: 0, sijing: 0 };
this.fileIds = [];
this.fileurl = [];
this.fileurl_form = [];
this.paramsJsonFileurl = [];
this.routemats = [];
this.routeId = "";
this.processName = "";
this.divDisable = false;
},
//
open(mode = "add") {
let that = this;
that.mode = mode;
that.resetForm();
that.visible = true;
that.$nextTick(() => {
if(that.count){
that.form.sort = that.count+1;
}
that.$refs.dialogForm && that.$refs.dialogForm.clearValidate();
})
return this;
},

View File

@ -99,6 +99,11 @@
</template>
<script>
const defaultForm = {
name: "",
location: "",
capacity: "",
};
export default {
name: "mroom",
data() {
@ -114,11 +119,7 @@ export default {
edit: "编辑",
show: "查看",
},
addForm: {
name: "",
location: "",
capacity: "",
},
addForm: Object.assign({}, defaultForm),
rules: {
name: [{ required: true, message: "请输入会议室名称", trigger: "blur" }],
location: [{ required: true, message: "请输入地点", trigger: "blur" }],
@ -127,9 +128,10 @@ export default {
};
},
methods: {
//
//
handleAdd() {
this.type = "add";
this.addForm = Object.assign({}, defaultForm);
this.limitedVisible = true;
},
handleCancel() {

View File

@ -245,6 +245,7 @@ export default {
methods: {
handleAdd() {
this.type = "add";
this.addForm = {};
this.limitedVisible = true;
},
handleCancel() {