fix:fmlog结构层日志中扫码添加日志修改

This commit is contained in:
shijing 2025-04-09 11:06:49 +08:00
parent 418046cd33
commit 484b692ec8
3 changed files with 45 additions and 32 deletions

View File

@ -354,6 +354,7 @@ export default {
}, },
qct:'', qct:'',
codeText:'', codeText:'',
codeBatch:'',
mgroupName:'', mgroupName:'',
materialCount:1,// materialCount:1,//
material_in:'', material_in:'',
@ -481,7 +482,7 @@ export default {
that.materialOptions = res; that.materialOptions = res;
if(that.codeText!==''){ if(that.codeText!==''){
res.forEach(item=>{ res.forEach(item=>{
if(item.batch == that.codeText){ if(item.batch == that.codeBatch){
that.form.wm_in = item.id; that.form.wm_in = item.id;
that.form.batch = item.batch; that.form.batch = item.batch;
that.materialCount = that.form.count_use = that.form.count_ok = item.count_cando; that.materialCount = that.form.count_use = that.form.count_ok = item.count_cando;
@ -506,12 +507,21 @@ export default {
}, },
// //
open(mode = "add",codeText) { open(mode = "add",codeText) {
this.mode = mode; let that = this;
this.visible = true; that.mode = mode;
if(codeText){ that.visible = true;
this.codeText = codeText; if(codeText!==''){
that.codeText = codeText;
let id = codeText.split('#')[1];
that.$API.cm.labelmat.item.req(id).then((res) => {
that.codeBatch = res.batch;
that.getMaterial();
}).catch((err) => {
that.getMaterial();
})
}else{
that.getMaterial();
} }
this.getMaterial();
return this; return this;
}, },
// //

View File

@ -173,8 +173,8 @@
</el-card> </el-card>
<save-dialog <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialogs"
:fmlog="params.fmlog" :fmlog="fmlogId"
:mgroup="mgroup" :mgroup="mgroup"
:mtask="mtask" :mtask="mtask"
:process="processId" :process="processId"
@ -209,6 +209,14 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mgroup: {
type: String,
default: "",
},
mtask: {
type: String,
default: "",
}
}, },
components: { components: {
saveDialog, saveDialog,
@ -237,7 +245,6 @@ export default {
page: 0, page: 0,
fmlog: "", fmlog: "",
}, },
mgroup: "",
fmlogItem: {}, fmlogItem: {},
saveInForm: { saveInForm: {
count_use: 0, count_use: 0,
@ -278,11 +285,18 @@ export default {
mounted() { mounted() {
this.getfmlogItem(); this.getfmlogItem();
this.params.fmlog = this.fmlogId; this.params.fmlog = this.fmlogId;
this.paramsWm.mgroup = this.mgroup;
this.apiObj = this.$API.wpm.mlog.list; this.apiObj = this.$API.wpm.mlog.list;
}, },
methods: { methods: {
open(codeText="") { open(codeText="") {
this.codeText = codeText; this.codeText = codeText;
if(this.codeText!=""){
this.$nextTick(() => {
this.codeTextChange(codeText);
})
}
this.visible = true; this.visible = true;
}, },
@ -290,8 +304,6 @@ export default {
let that = this; let that = this;
that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => { that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => {
that.fmlogItem = res; that.fmlogItem = res;
that.mgroup = res.mgroup;
that.mtask = res.mtask;
that.paramsWm.mgroup = res.mgroup; that.paramsWm.mgroup = res.mgroup;
that.$API.wpm.mlog.list.req(that.params).then((res) => { that.$API.wpm.mlog.list.req(that.params).then((res) => {
that.tableData = res; that.tableData = res;
@ -301,9 +313,6 @@ 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(that.codeText);
}
}else{} }else{}
}); });
}); });
@ -316,21 +325,19 @@ export default {
table_add() { table_add() {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open('add'); this.$refs.saveDialogs.open('add');
}); });
}, },
codeTextChange(codeText){ codeTextChange(codeText){
let that = this; this.dialog.save = true;
that.codeText = codeText; this.$nextTick(() => {
that.dialog.save = true; this.$refs.saveDialogs.open('add',codeText);
that.$nextTick(() => {
that.$refs.saveDialog.open('add',codeText);
}); });
}, },
table_edit(row){ table_edit(row){
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row); this.$refs.saveDialogs.open('edit').setData(row);
}); });
}, },
// //

View File

@ -148,6 +148,8 @@
<detail-drawer <detail-drawer
v-if="dialog.detail" v-if="dialog.detail"
ref="detailDialog" ref="detailDialog"
:mtask="mtaskId"
:mgroup="mgroupId"
:fmlogId="fmlogId" :fmlogId="fmlogId"
:processId="processId" :processId="processId"
@closed="detailClose" @closed="detailClose"
@ -245,6 +247,7 @@ export default {
}, },
// //
table_detail(row) { table_detail(row) {
this.mtaskId = row.mtask;
this.fmlogId = row.id; this.fmlogId = row.id;
this.dialog.detail = true; this.dialog.detail = true;
this.$nextTick(() => { this.$nextTick(() => {
@ -271,30 +274,23 @@ export default {
codeTextChange(codeText){ codeTextChange(codeText){
let that = this; let that = this;
that.codeText = codeText; that.codeText = codeText;
// let id = codeText.split('#')[1];
let obj = {}; that.$API.cm.labelmat.item.req(id).then((res) => {
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 = {} let params = {}
params.page = 0; params.page = 0;
params.state = 20; params.state = 20;
params.mgroup = that.mgroupId; params.mgroup = that.mgroupId;
params.route__material_in = res[0].material; params.route__material_in = res.material;
that.$API.pm.mtask.list.req(params).then(res1=>{ that.$API.pm.mtask.list.req(params).then(res1=>{
if(res1.length==1){// if(res1.length==1){//
that.mtaskId =res1[0].id; that.mtaskId =res1[0].id;
that.changeMtask(); that.changeMtask();
// that.table_detail(res2[0]);
}else{// }else{//
that.mtaskoptions = res1; that.mtaskoptions = res1;
that.dialog.mtask = true; that.dialog.mtask = true;
} }
}) })
}) }).catch((err) => {})
}, },
changeMtask(){ changeMtask(){
let that = this; let that = this;