fix:出入库记录及明细表单新增时清空,避免上次保存数据残留导致"物料找不到"
mio_form/mioitem_form的open()原只设type、不重置form,saveDialog虽用 v-if="dialog.save"+@closed重建,但关闭动画未结束就再点新增时dialog.save 仍为true、组件被复用,导致上次的material/mb/batch/selectObj等残留。 新增resetForm(),add模式打开时强制清空,不依赖v-if重建时序。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3d75e89e1e
commit
27060f7c54
|
|
@ -326,10 +326,17 @@ export default {
|
||||||
// console.log('userOption',userOption);
|
// console.log('userOption',userOption);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//新增时清空表单,避免上次保存的数据残留(与mioitem_form一致,防v-if未及时重建时复用旧实例)
|
||||||
|
resetForm() {
|
||||||
|
this.form = { state: 10, inout_date: this.$TOOL.dateFormat2(new Date()) };
|
||||||
|
},
|
||||||
//显示
|
//显示
|
||||||
open(mode = "add", type = "",htype="") {
|
open(mode = "add", type = "",htype="") {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.htype = htype;
|
this.htype = htype;
|
||||||
|
if (mode == "add") {
|
||||||
|
this.resetForm();
|
||||||
|
}
|
||||||
this.form.type = type;
|
this.form.type = type;
|
||||||
this.init();
|
this.init();
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
|
|
||||||
|
|
@ -735,11 +735,35 @@ export default {
|
||||||
this.form.warehouse = "";
|
this.form.warehouse = "";
|
||||||
this.inputBatchDisable = false;
|
this.inputBatchDisable = false;
|
||||||
},
|
},
|
||||||
|
//新增时清空表单,避免上次保存的数据残留导致"物料找不到"等错误
|
||||||
|
resetForm() {
|
||||||
|
this.form = { count: 1, note: '', pack_index: 1 };
|
||||||
|
this.selectObj = null;
|
||||||
|
this.selectBatch = null;
|
||||||
|
this.mioitems = [''];
|
||||||
|
this.mioitemw = [];
|
||||||
|
this.wprList = [];
|
||||||
|
this.wbatchOptions = [];
|
||||||
|
this.batchOptions = [];
|
||||||
|
this.batchOptions_o = [];
|
||||||
|
this.components = [];
|
||||||
|
this.assembShow = false;
|
||||||
|
this.batchcount = null;
|
||||||
|
this.mTracking = 10;
|
||||||
|
this.prefix = '';
|
||||||
|
this.halfgoodprefix = '';
|
||||||
|
this.digitNum = null;
|
||||||
|
this.count_send_yp = 0;
|
||||||
|
this.inputBatchDisable = false;
|
||||||
|
},
|
||||||
//显示
|
//显示
|
||||||
open(mode = "add", type = "",mtype) {
|
open(mode = "add", type = "",mtype) {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.mtype = mtype?mtype:null;
|
this.mtype = mtype?mtype:null;
|
||||||
|
if (mode == "add") {
|
||||||
|
this.resetForm();
|
||||||
|
}
|
||||||
this.form.type = this.type = type;
|
this.form.type = this.type = type;
|
||||||
if (mode == "add") {
|
if (mode == "add") {
|
||||||
this.init();
|
this.init();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue