diff --git a/src/api/model/mtm.js b/src/api/model/mtm.js index 4956036e..b87e4318 100644 --- a/src/api/model/mtm.js +++ b/src/api/model/mtm.js @@ -405,6 +405,26 @@ export default { }, }, }, + routemat: { + list: { + name: "列表", + req: async function (data) { + return await http.get(`${config.API_URL}/mtm/routemat/`, data); + }, + }, + create: { + name: "创建", + req: async function (data) { + return await http.post(`${config.API_URL}/mtm/routemat/`, data); + }, + }, + delete: { + name: "删除", + req: async function (id) { + return await http.delete(`${config.API_URL}/mtm/routemat/${id}/`); + }, + }, + }, routepack: { list: { name: "列表", diff --git a/src/api/model/wpm.js b/src/api/model/wpm.js index 856c269f..4fb720df 100644 --- a/src/api/model/wpm.js +++ b/src/api/model/wpm.js @@ -317,7 +317,7 @@ export default { return await http.put(`${config.API_URL}/wpm/mlogbw/${id}/`,data); }, }, - del: { + delete: { name: "删除", req: async function (id) { return await http.delete(`${config.API_URL}/wpm/mlogbw/${id}/`); diff --git a/src/views/inm/mio_form.vue b/src/views/inm/mio_form.vue index 70db6ac1..976ccc28 100644 --- a/src/views/inm/mio_form.vue +++ b/src/views/inm/mio_form.vue @@ -192,10 +192,10 @@ export default { }, form: {}, rules: { - material: [ + number: [ { required: true, - message: "请选择所需产品", + message: "请填写编号", trigger: "blur", }, ], diff --git a/src/views/inm/mioitem_form.vue b/src/views/inm/mioitem_form.vue index b5457999..56cbffc1 100644 --- a/src/views/inm/mioitem_form.vue +++ b/src/views/inm/mioitem_form.vue @@ -12,7 +12,7 @@ :rules="rules" label-width="120px" > - + - + - + + + + + + + + + + + - 提交 + 提交 取消 @@ -182,9 +230,9 @@ const defaultForm = { material_in:'', material_out:'', hour_work:0, + div_number:1, batch_bind: true, is_autotask: true, - // is_count_utask: false, }; export default { props: { @@ -209,9 +257,18 @@ export default { materialsOut: [], mgroups: [], options: [], + routemats:[], + materialOptions:[], titleMap: { add: "新增", edit: "编辑" }, setFiltersVisible: false, + routeId: "", project_code: "", + addTemplate:{ + id:'', + material:'', + route:'', + + } }; }, mounted() { @@ -219,6 +276,7 @@ export default { this.getProcess(); this.getMaterialIn(); this.getMaterialOut(); + this.getMaterialOptions(); this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code; this.form.routepack = this.routepack; }, @@ -228,24 +286,30 @@ export default { }, getMgroup() { let that = this; - this.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => { - this.mgroups = res; + that.$API.mtm.mgroup.list.req({ page: 0 }).then((res) => { + that.mgroups = res; + }); + }, + getMaterialOptions() { + let that = this; + that.$API.mtm.material.list.req({ page: 0, type__in: "20,30"}).then((res) => { + that.materialOptions = res; }); }, getMaterialIn() { let that = this; - this.$API.mtm.material.list + that.$API.mtm.material.list .req({ page: 0, type__in: "10,20,30" }) .then((res) => { - this.materialsIn = res; + that.materialsIn = res; }); }, getMaterialOut() { let that = this; - this.$API.mtm.material.list + that.$API.mtm.material.list .req({ page: 0, type__in: "10,20" }) .then((res) => { - this.materialsOut = res; + that.materialsOut = res; }); }, getProcess() { @@ -254,6 +318,32 @@ export default { that.options = res; }); }, + getroutemats(){ + let that = this; + that.$API.mtm.routemat.list.req({ route: that.routeId,page: 0}).then((res) => { + that.routemats = res; + }); + }, + formTableSave(row){ + let that = this; + that.$API.mtm.routemat.create.req(row).then((res) => { + that.getroutemats(); + }); + }, + formTableDel(row){ + this.$confirm(`确定删除吗?`, "提示", { + type: "warning", + }).then(() => { + this.$API.mtm.routemat.delete.req(row.id).then((res) => { + let index = this.routemats.findIndex((item) => item.id === row.id); + this.routemats.splice(index, 1); + this.$message.success("删除成功"); + that.getroutemats(); + }).catch((err) => { + return err; + }); + }).catch(() => {}); + }, //显示 open(mode = "add") { this.mode = mode; @@ -263,6 +353,9 @@ export default { //表单注入数据 setData(data) { Object.assign(this.form, data); + this.routeId = data.id; + this.addTemplate.route = data.id; + this.getroutemats(); }, //表单提交方法 submit() { diff --git a/src/views/wpm_bx/handover.vue b/src/views/wpm_bx/handover.vue index 68ecc106..79324918 100644 --- a/src/views/wpm_bx/handover.vue +++ b/src/views/wpm_bx/handover.vue @@ -97,7 +97,7 @@ prop="material_name" min-width="140" > - + diff --git a/src/views/wpm_bx/inm_record_form.vue b/src/views/wpm_bx/inm_record_form.vue index 8b2236e0..872843e2 100644 --- a/src/views/wpm_bx/inm_record_form.vue +++ b/src/views/wpm_bx/inm_record_form.vue @@ -241,6 +241,7 @@ export default { }, selectBatchChange(item) { this.form.batch = item.batch; + this.form.mb = item.id; this.form.warehouse = item.warehouse; }, //选择车间库存物料后的处理 @@ -254,6 +255,7 @@ export default { }, selectBatchClear() { this.form.batch = ""; + this.form.mb = ""; this.form.warehouse = ""; }, //显示 diff --git a/src/views/wpm_bx/mlog_detail.vue b/src/views/wpm_bx/mlog_detail.vue index b97d87de..4f60ce78 100644 --- a/src/views/wpm_bx/mlog_detail.vue +++ b/src/views/wpm_bx/mlog_detail.vue @@ -82,7 +82,7 @@ row-key="id" stripe :params="paramsIn" - hidePagination + hidePagination > 编辑 + 详情 @@ -228,7 +233,7 @@ 详情 @@ -263,6 +268,7 @@ ref="saveDialog" :mlog="mlogId" :mgroup="mgroup" + :tracking="tracking" :materialIn="materialIn" @success="handleSaveSuccess" @closed="dialog.save = false" @@ -280,6 +286,7 @@ v-if="dialog.check_single" ref="checkDialogSingle" :mlogb="mlogb" + :wm = "wm" @success="handlesCheckSuccess" @closed="dialog.check_single = false" > @@ -349,6 +356,7 @@ export default { mlog: "", material_out__isnull: 0, }, + tracking:'10', mlogb:"", mgroup: "", mlogItem: {}, @@ -378,6 +386,7 @@ export default { }, ], }, + wm:'', materialOut:'', batchContains:'', apiObjPrint:this.$API.cm.labelmat.fromWm, @@ -402,6 +411,8 @@ export default { let that = this; that.$API.wpm.mlog.item.req(that.mlogId).then((res) => { that.mlogItem = res; + console.log('that.mlogItem',that.mlogItem); + this.tracking = this.mlogItem.material_in_.tracking; if(res.test_file!==null){ that.fileList = [{name:res.test_file,url:res.test_file}]; that.form.test_file = res.test_file; @@ -495,14 +506,15 @@ export default { this.$refs.checkDialog.open(obj); }); }, - table_out_check_single(row){ + table_out_check_single(row,type){ this.dialog.check_single = true; this.mlogb = row.id; + this.wm = row.wm_in; let obj = {}; Object.assign(obj, row); obj.mgroup_name = this.mlogItem.mgroup_name; this.$nextTick(() => { - this.$refs.checkDialogSingle.open(obj); + this.$refs.checkDialogSingle.open(type); }); }, //表单提交方法 diff --git a/src/views/wpm_bx/mlogb_form.vue b/src/views/wpm_bx/mlogb_form.vue index d86183d3..3af29d03 100644 --- a/src/views/wpm_bx/mlogb_form.vue +++ b/src/views/wpm_bx/mlogb_form.vue @@ -40,7 +40,7 @@ - + 提交 取消 @@ -68,6 +68,10 @@ export default { type: String, default: "", }, + tracking:{ + type: Number, + default: 10, + }, materialIn: { type: String, default: "", @@ -142,7 +146,8 @@ export default { }); if (arr.length > 0) { that.form.wm_in = arr[0].id; - if(that.mgroup_code == 'paiyicibang'||that.mgroup_code == 'paiercibang'){}else{ + that.form.count_use = arr[0].count; + if(that.tracking==10){}else{ that.submit();//提交 } }else{ diff --git a/src/views/wpm_bx/mlogbw_check.vue b/src/views/wpm_bx/mlogbw_check.vue index 145eb825..66bb1215 100644 --- a/src/views/wpm_bx/mlogbw_check.vue +++ b/src/views/wpm_bx/mlogbw_check.vue @@ -1,6 +1,6 @@