diff --git a/src/views/wpm_gx/handover_form.vue b/src/views/wpm_gx/handover_form.vue index f90e5f62..46a6e9d8 100644 --- a/src/views/wpm_gx/handover_form.vue +++ b/src/views/wpm_gx/handover_form.vue @@ -281,7 +281,6 @@ export default { let day = date.getDate(); that.form.handle_date = year + "-" + month + "-" + day; that.form.send_mgroup = that.mgroupId; - console.log('mgroupName',that.mgroupName) if(that.mgroupName=="size"||that.mgroupName=="facade"){//检验部交接 that.$API.system.user.list .req({ page: 0, posts__code__contains: "check" }) @@ -321,18 +320,45 @@ export default { getMaterial() { let that = this; var req = { - mgroupx: that.mgroupId, page: 0, notok_sign__isnull : 1, count_xtest__isnull:1 }; if(that.mgroupName=="size"){ - req.material__process__name="一次超洗"; - }else if(that.mgroupName=="facade"){ - req.material__process__name="二次超洗"; - } + that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => { + if(res.length>0){ + req.belong_dept=res[0].id; + this.$API.wpm.wmaterial.list.req(req).then((res) => { + let arr = []; + res.forEach(item=>{ + let obj = {}; + Object.assign(obj,item); + obj.label = item.batch; + arr.push(obj); + }) + that.materialOptions = arr; + }); + } + }) + }else if(that.mgroupName=="facade"){ + that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => { + if(res.length>0){ + req.belong_dept=res[0].id; + this.$API.wpm.wmaterial.list.req(req).then((res) => { + let arr = []; + res.forEach(item=>{ + let obj = {}; + Object.assign(obj,item); + obj.label = item.batch; + arr.push(obj); + }) + that.materialOptions = arr; + }); + } + }) + }else{ + req.mgroupx = that.mgroupId; this.$API.wpm.wmaterial.list.req(req).then((res) => { - // that.materialOptions = res; let arr = []; res.forEach(item=>{ let obj = {}; @@ -342,6 +368,8 @@ export default { }) that.materialOptions = arr; }); + } + }, //获取车间不合格物料 getMaterialNotok() {