feat:fmlog=>mlog层日志,实现扫码自动弹出mlog表单功能
This commit is contained in:
parent
92143e53fe
commit
14e39014e0
|
|
@ -273,7 +273,8 @@ export default {
|
||||||
this.apiObj = this.$API.wpm.mlog.list;
|
this.apiObj = this.$API.wpm.mlog.list;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open(codeText="") {
|
||||||
|
this.codeText = codeText;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -292,6 +293,9 @@ export default {
|
||||||
})
|
})
|
||||||
that.paramsWm.search = that.batchContains;
|
that.paramsWm.search = that.batchContains;
|
||||||
that.apiObjWm = that.$API.wpm.wmaterial.list;
|
that.apiObjWm = that.$API.wpm.wmaterial.list;
|
||||||
|
if(that.codeText!=""){
|
||||||
|
this.codeTextChange();
|
||||||
|
}
|
||||||
}else{}
|
}else{}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,14 @@
|
||||||
v-auth="'mlog.create'"
|
v-auth="'mlog.create'"
|
||||||
>返工</el-button
|
>返工</el-button
|
||||||
>
|
>
|
||||||
|
<el-input
|
||||||
|
ref="codeInput"
|
||||||
|
v-model="codeText"
|
||||||
|
clearable
|
||||||
|
placeholder="正常交接"
|
||||||
|
style="width:150px"
|
||||||
|
@keyup.enter="codeTextChange"
|
||||||
|
></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<el-input
|
<el-input
|
||||||
|
|
@ -92,6 +100,39 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
|
<!-- 关联任务选择 -->
|
||||||
|
<el-dialog v-model="dialog.mtask" title="关联任务">
|
||||||
|
<el-form
|
||||||
|
label-width="100px"
|
||||||
|
ref="saveInForm"
|
||||||
|
>
|
||||||
|
<el-form-item label="关联任务" prop="mtask">
|
||||||
|
<el-select
|
||||||
|
v-model="mtaskId"
|
||||||
|
placeholder="关联任务"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
@change="changeMtask"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in mtaskoptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.number"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:loading="isSaveing"
|
||||||
|
@click="mtaskSure()"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
<save-dialog
|
<save-dialog
|
||||||
v-if="dialog.save"
|
v-if="dialog.save"
|
||||||
ref="saveDialog"
|
ref="saveDialog"
|
||||||
|
|
@ -152,12 +193,17 @@ export default {
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
detail: false,
|
detail: false,
|
||||||
|
mtask:false,
|
||||||
},
|
},
|
||||||
|
|
||||||
tableData: [],
|
tableData: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
|
mtaskoptions:[],
|
||||||
mtask: "",
|
mtask: "",
|
||||||
mlogId: "",
|
mlogId: "",
|
||||||
fmlogId:"",
|
fmlogId: "",
|
||||||
|
codeText: "",
|
||||||
|
mtaskId:"",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -219,6 +265,51 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//日志页面扫描物料二维码信息mlog
|
||||||
|
codeTextChange(){
|
||||||
|
let that = this;
|
||||||
|
that.codeText;
|
||||||
|
//根据扫描内容获取物料
|
||||||
|
let obj = {};
|
||||||
|
obj.page=0;
|
||||||
|
obj.tag = 'todo';
|
||||||
|
obj.mgroup=that.mgroupId;
|
||||||
|
obj.batch=that.codeText;
|
||||||
|
that.$API.wpm.wmaterial.list.req(obj).then(res=>{
|
||||||
|
//根据物料获取任务
|
||||||
|
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) {
|
selectionChange(selection) {
|
||||||
this.selection = selection;
|
this.selection = selection;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue