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:
parent
37b5e3f468
commit
d6d382e281
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -467,15 +467,43 @@ export default {
|
|||
that.paramsJsonFileurl = list1;
|
||||
that.params_json.fileurl = JSON.stringify(that.paramsJsonFileurl);
|
||||
},
|
||||
//重置表单状态:open时主动清空,不依赖父级v-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;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ export default {
|
|||
methods: {
|
||||
handleAdd() {
|
||||
this.type = "add";
|
||||
this.addForm = {};
|
||||
this.limitedVisible = true;
|
||||
},
|
||||
handleCancel() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue