diff --git a/src/config/route.js b/src/config/route.js index d9d93371..e66726c5 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -1869,6 +1869,15 @@ const routes = [ }, component: "inm/workshop_mio", }, + { + name: "inmScrap", + path: "/inm/inmScrap", + meta: { + title: "废品库", + perms: ["inmScrap"], + }, + component: "inm/inmScrap", + }, ], }, //采购 pum diff --git a/src/views/inm/inmScrap.vue b/src/views/inm/inmScrap.vue new file mode 100644 index 00000000..5edb3cbb --- /dev/null +++ b/src/views/inm/inmScrap.vue @@ -0,0 +1,214 @@ + + + diff --git a/src/views/inm/workshop_mio.vue b/src/views/inm/workshop_mio.vue index 7f80db01..6386374b 100644 --- a/src/views/inm/workshop_mio.vue +++ b/src/views/inm/workshop_mio.vue @@ -4,15 +4,15 @@
生产入库生产领料 销售发货生产入库 {{ item.batch }}
{{ item.count }} - ({{ item.notok_sign_name }}) + + ({{ item.notok_sign_name }}) +
@@ -205,11 +203,11 @@ export default { lists:[],//交接数组 handle_user: [], form: { - send_date: "", - send_user: "", - send_mgroup: "", - recive_user: "", - recive_mgroup: "", + send_date: null, + send_user: null, + send_mgroup: null, + recive_user: null, + recive_mgroup: null, handoverb:[{wm:'',count:''}], }, rules: { @@ -294,7 +292,11 @@ export default { that.deptID = that.$TOOL.data.get('gx_deptID'); that.getUserList(); } - that.getMaterial(); + if(that.type==40){ + that.getMaterialNotok(); + }else{ + that.getMaterial(); + } that.getDeptOptions(); that.getMgroupOptions(); }, @@ -329,30 +331,44 @@ export default { }else if(that.mgroupName=="facade"){ req.material__process__name="二次超洗"; } - // else{ - // if (this.type == 10) { - // req.notok_sign__isnull = 1; - // } else if (this.type == 20) { - // req.notok_sign__isnull = 0; - // }else if (this.type == 30) { - // req.notok_sign__isnull = 1; - // } - // } - - this.$API.wpm.wmaterial.list - .req(req) - .then((res) => { - that.materialOptions = res; - }); + this.$API.wpm.wmaterial.list.req(req).then((res) => { + // that.materialOptions = res; + let arr = []; + res.forEach(item=>{ + let obj = {}; + Object.assign(obj,item); + obj.label = item.batch; + arr.push(obj); + }) + that.materialOptions = arr; + }); + }, + //获取车间不合格物料 + getMaterialNotok() { + let that = this; + var req = { + mgroupx: that.mgroupId, + page: 0, + notok_sign__isnull : 0, + count_xtest__isnull:1 + }; + this.$API.wpm.wmaterial.list.req(req).then((res) => { + let arr = []; + res.forEach(item=>{ + let obj = {}; + Object.assign(obj,item); + obj.label = item.batch+'('+item.notok_sign_name+')'; + arr.push(obj); + }) + that.materialOptions = arr; + }); }, //获取交送工段人员 getUserList() { let that = this; - this.$API.system.user.list - .req({ depts: that.deptID, page: 0 }) - .then((res) => { - that.userList = res; - }); + this.$API.system.user.list.req({ depts: that.deptID, page: 0 }).then((res) => { + that.userList = res; + }); }, //获取接收工段人员 getUserList2() { @@ -361,9 +377,7 @@ export default { this.mgroupOptions.forEach(item => { if(item.id==that.form.recive_mgroup){ deptID = item.belong_dept; - this.$API.system.user.list - .req({ depts: deptID, page: 0 }) - .then((res) => { + this.$API.system.user.list.req({ depts: deptID, page: 0 }).then((res) => { that.userList2 = res; }); } @@ -398,29 +412,40 @@ export default { }, //提交 submit() { - this.$refs.dialogForm.validate(async (valid) => { + let that = this; + that.$refs.dialogForm.validate(async (valid) => { if (valid) { - if (this.mode == "add") { - this.$API.wpm.handover.create.req(this.form).then((res) => { - this.isSaveing = false; - this.$emit("success", this.form, this.mode); - this.visible = false; - this.$message.success("操作成功"); + if (that.mode == "add") { + that.$API.wpm.handover.create.req(that.form).then((res) => { + if(that.type==40){ + //提交 + that.$API.wpm.handover.submit.req(res.id).then((res1) => { + that.isSaveing = false; + that.$emit("success"); + that.visible = false; + that.$message.success("操作成功"); + }); + }else{ + that.isSaveing = false; + that.$emit("success"); + that.visible = false; + that.$message.success("操作成功"); + } }).catch((err) => { //可以处理校验错误 - this.isSaveing = false; + that.isSaveing = false; return err; }); - } else if (this.mode == "edit") { - this.$API.wpm.handover.update.req(this.form.id, this.form).then((res) => { - this.isSaveing = false; - this.$emit("success", this.form, this.mode); - this.visible = false; - this.$message.success("操作成功"); + } else if (that.mode == "edit") { + that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => { + that.isSaveing = false; + that.$emit("success", that.form, that.mode); + that.visible = false; + that.$message.success("操作成功"); }) .catch((err) => { //可以处理校验错误 - this.isSaveing = false; + that.isSaveing = false; return err; }); } diff --git a/src/views/wpm_gx/inm.vue b/src/views/wpm_gx/inm.vue index 1bc84097..13ef1dfb 100644 --- a/src/views/wpm_gx/inm.vue +++ b/src/views/wpm_gx/inm.vue @@ -9,6 +9,8 @@ 入库 + + 报废