diff --git a/src/views/inm/mioitem_form.vue b/src/views/inm/mioitem_form.vue index d615dec6..c1d95307 100644 --- a/src/views/inm/mioitem_form.vue +++ b/src/views/inm/mioitem_form.vue @@ -318,24 +318,8 @@ export default { }, mounted() { let that = this; - let url1 = window.location.href; - this.url_code = url1.split('/')[3]; let config_base = that.$TOOL.data.get("BASE_INFO").base; that.project_code = config_base.base_code; - // console.log('that.type',that.type); - if(that.type=='other_in'||that.type=='do_out'){ - let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj")); - // console.log('mioitemSelecObj',mioitemSelecObj); - if(mioitemSelecObj!==null){ - that.selectObj = mioitemSelecObj; - that.form.material = that.selectObj.id; - that.form.unit = that.selectObj.unit; - that.form.unit_price = that.selectObj.unit_price; - that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:''; - that.mTracking = that.selectObj.tracking; - that.getBatchOptions(); - } - } }, methods: { init() { @@ -591,6 +575,7 @@ export default { }, //显示 open(mode = "add", type = "",mtype) { + let that = this; this.mode = mode; this.mtype = mtype?mtype:null; this.form.type = this.type = type; @@ -598,6 +583,20 @@ export default { this.init(); } this.visible = true; + // console.log('that.type',that.type); + if(that.type=='other_in'||that.type=='do_out'){ + let mioitemSelecObj =JSON.parse(sessionStorage.getItem("mioitemSelecObj")); + // console.log('mioitemSelecObj',mioitemSelecObj); + if(mioitemSelecObj!==null){ + that.selectObj = mioitemSelecObj; + that.form.material = that.selectObj.id; + that.form.unit = that.selectObj.unit; + that.form.unit_price = that.selectObj.unit_price; + that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:''; + that.mTracking = that.selectObj.tracking; + that.getBatchOptions(); + } + } return this; }, countChange(){