diff --git a/src/views/wpm_gx/fmlog_detail.vue b/src/views/wpm_gx/fmlog_detail.vue index 20bb5502..5ce16001 100644 --- a/src/views/wpm_gx/fmlog_detail.vue +++ b/src/views/wpm_gx/fmlog_detail.vue @@ -273,7 +273,8 @@ export default { this.apiObj = this.$API.wpm.mlog.list; }, methods: { - open() { + open(codeText="") { + this.codeText = codeText; this.visible = true; }, @@ -292,6 +293,9 @@ export default { }) that.paramsWm.search = that.batchContains; that.apiObjWm = that.$API.wpm.wmaterial.list; + if(that.codeText!=""){ + this.codeTextChange(); + } }else{} }); }); diff --git a/src/views/wpm_gx/fmlogs.vue b/src/views/wpm_gx/fmlogs.vue index 399359dd..dfaed964 100644 --- a/src/views/wpm_gx/fmlogs.vue +++ b/src/views/wpm_gx/fmlogs.vue @@ -16,6 +16,14 @@ v-auth="'mlog.create'" >返工 +
+ + + + + + + + + + + + { + //根据物料获取任务 + let params = {} + params.page = 0; + params.state = 20; + params.mgroup = that.mgroupId; + params.route__material_in = res[0].material; + that.$API.pm.mtask.list.req(params).then(res1=>{ + if(res1.length==1){//只有一个任务,直接打开日志详情 + that.mtaskId =res1[0].id; + that.changeMtask(); + // that.table_detail(res2[0]); + }else{//多个任务时,弹出任务选择框 + that.mtaskoptions = res1; + that.dialog.mtask = true; + } + }) + }) + }, + changeMtask(){ + let that = this; + that.dialog.mtask = false; + let params = {} + params.page = 0; + params.mtask =that.mtaskId; + params.mgroup = that.mgroupId; + //根据任务获取日志 + that.$API.wpm.fmlog.list.req(params).then(res=>{ + that.fmlogId = res[0].id; + that.dialog.detail = true; + that.$nextTick(() => { + that.$refs.detailDialog.open(that.codeText); + }); + }) + }, //表格选择后回调事件 selectionChange(selection) { this.selection = selection;