feat:fmlog=>mlog层日志,实现扫码自动弹出mlog表单功能

This commit is contained in:
shijing 2025-03-14 16:30:13 +08:00
parent 92143e53fe
commit 14e39014e0
2 changed files with 97 additions and 2 deletions

View File

@ -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{}
});
});

View File

@ -16,6 +16,14 @@
v-auth="'mlog.create'"
>返工</el-button
>
<el-input
ref="codeInput"
v-model="codeText"
clearable
placeholder="正常交接"
style="width:150px"
@keyup.enter="codeTextChange"
></el-input>
</div>
<div class="right-panel">
<el-input
@ -92,6 +100,39 @@
</el-table-column>
</scTable>
</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
v-if="dialog.save"
ref="saveDialog"
@ -152,12 +193,17 @@ export default {
dialog: {
save: false,
detail: false,
mtask:false,
},
tableData: [],
selection: [],
mtaskoptions:[],
mtask: "",
mlogId: "",
fmlogId:"",
fmlogId: "",
codeText: "",
mtaskId:"",
};
},
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) {
this.selection = selection;