diff --git a/src/api/model/wpm.js b/src/api/model/wpm.js index 20946b23..516fd168 100644 --- a/src/api/model/wpm.js +++ b/src/api/model/wpm.js @@ -485,9 +485,17 @@ export default { }, }, wpr:{ - name: "动态产品", - req: async function (data) { - return await http.get(`${config.API_URL}/wpmw/wpr/`, data); + list: { + name: "动态产品", + req: async function (data) { + return await http.get(`${config.API_URL}/wpmw/wpr/`, data); + }, + }, + item: { + name: "动态产品", + req: async function (id) { + return await http.get(`${config.API_URL}/wpmw/wpr/${id}/`); + }, }, }, }; diff --git a/src/views/inm/mio_form.vue b/src/views/inm/mio_form.vue index 976ccc28..88965f1e 100644 --- a/src/views/inm/mio_form.vue +++ b/src/views/inm/mio_form.vue @@ -102,7 +102,7 @@ v-model="form.belong_dept" clearable style="width: 100%" - @change="deptChange" + @change="getgetDeptUsers" > { - this.userOptions = res; - }); + getgetDeptUsers(){ + this.$API.system.user.list.req({ depts: this.form.belong_dept, page: 0 }).then((res) => { + this.userOptions = res; + }); }, getDeptUser() { this.$API.system.user.list diff --git a/src/views/template/scan.vue b/src/views/template/scan.vue index 7f396806..14b1fb8f 100644 --- a/src/views/template/scan.vue +++ b/src/views/template/scan.vue @@ -45,7 +45,8 @@ export default { this.closed(); }, closed(){ - this.visible = false; + this.codeText = ''; + // this.visible = false; } } } diff --git a/src/views/wpm_bx/handover_form.vue b/src/views/wpm_bx/handover_form.vue index 48f5c227..6b04a48c 100644 --- a/src/views/wpm_bx/handover_form.vue +++ b/src/views/wpm_bx/handover_form.vue @@ -547,30 +547,79 @@ export default { return; } let that = this; + let keys = data.split('#')[0]; let id = data.split('#')[1]; - console.log('id',id); - this.$API.cm.labelmat.item.req(id).then((res) => { - let arr = that.form.handoverb.filter((item) => { - return item.batch == res.batch; + if(keys=='wpr'){ + that.$API.wpm.wpr.item.req(id).then((res) => { + if(res){ + let indexs = 0; + let arr = that.form.handoverb.filter((item,index) => { + indexs = index; + return item.wm == res.wm; + }) + //有handoverb + if(arr.length>0){ + //判断是否有wpr,若无将wpr放进去 + if(arr[0].handoverbw&&arr[0].handoverbw.length>0){ + let arr1 = []; + arr1 = arr[0].handoverbw.filter((item1) => { + item1.wpr = item1.id; + }) + if(arr1.length>0){ + that.$message.error("该物料已存在"); + }else{ + let obj1 = {}; + obj1.wpr = res.id; + that.form.handoverb[indexs].handoverbw.push(obj1); + } + }else{ + that.form.handoverb[indexs].handoverbw = []; + let obj1 = {}; + obj1.wpr = res.id; + that.form.handoverb[indexs].handoverbw.push(obj1); + } + }else{//无handoverb + that.materialOptions.forEach((item) => { + console.log('item.id',item.id); + if(item.id == res.wm){ + let obj2 = {}; + obj2.wm = item.id; + obj2.batch = item.batch; + obj2.counts = item.count; + obj2.handoverbw = []; + obj2.count = 1; + let obj3 = {}; + obj3.wpr = res.id; + obj2.handoverbw.push(obj3); + that.form.handoverb.push(obj2); + } + }) + } + } }) - if(arr.length>0){ - that.$message.error("该批次已存在") - }else{ - that.materialOptions.forEach((item) => { - if(item.batch == res.batch){ - let obj = {}; - obj.wm = item.id; - obj.batch = item.batch; - obj.counts = item.count; - obj.count = item.count; - that.form.handoverb.push(obj) - that.$refs.scanDialog.closed(); - } + }else{ + this.$API.cm.labelmat.item.req(id).then((res) => { + let arr = that.form.handoverb.filter((item) => { + return item.batch == res.batch; }) - } - }) + if(arr.length>0){ + that.$message.error("该批次已存在") + }else{ + that.materialOptions.forEach((item) => { + if(item.batch == res.batch){ + let obj = {}; + obj.wm = item.id; + obj.batch = item.batch; + obj.counts = item.count; + obj.count = item.count; + that.form.handoverb.push(obj) + } + }) + } + }) + } //根据扫描内容,获取物料详情匹配当前库存物料 - this.scanVisible = false; + // this.scanVisible = false; }, }, }; diff --git a/src/views/wpm_bx/inm.vue b/src/views/wpm_bx/inm.vue index 3dcbeb25..234760f7 100644 --- a/src/views/wpm_bx/inm.vue +++ b/src/views/wpm_bx/inm.vue @@ -113,7 +113,7 @@