fix:fmlog结构层日志中扫码添加日志修改
This commit is contained in:
parent
418046cd33
commit
484b692ec8
|
|
@ -354,6 +354,7 @@ export default {
|
|||
},
|
||||
qct:'',
|
||||
codeText:'',
|
||||
codeBatch:'',
|
||||
mgroupName:'',
|
||||
materialCount:1,//领料批次现有库存数
|
||||
material_in:'',
|
||||
|
|
@ -481,7 +482,7 @@ export default {
|
|||
that.materialOptions = res;
|
||||
if(that.codeText!==''){
|
||||
res.forEach(item=>{
|
||||
if(item.batch == that.codeText){
|
||||
if(item.batch == that.codeBatch){
|
||||
that.form.wm_in = item.id;
|
||||
that.form.batch = item.batch;
|
||||
that.materialCount = that.form.count_use = that.form.count_ok = item.count_cando;
|
||||
|
|
@ -506,12 +507,21 @@ export default {
|
|||
},
|
||||
//显示
|
||||
open(mode = "add",codeText) {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
if(codeText){
|
||||
this.codeText = codeText;
|
||||
let that = this;
|
||||
that.mode = mode;
|
||||
that.visible = true;
|
||||
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;
|
||||
},
|
||||
//表单注入数据
|
||||
|
|
|
|||
|
|
@ -173,8 +173,8 @@
|
|||
</el-card>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:fmlog="params.fmlog"
|
||||
ref="saveDialogs"
|
||||
:fmlog="fmlogId"
|
||||
:mgroup="mgroup"
|
||||
:mtask="mtask"
|
||||
:process="processId"
|
||||
|
|
@ -209,6 +209,14 @@ export default {
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
mgroup: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
mtask: {
|
||||
type: String,
|
||||
default: "",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
saveDialog,
|
||||
|
|
@ -237,7 +245,6 @@ export default {
|
|||
page: 0,
|
||||
fmlog: "",
|
||||
},
|
||||
mgroup: "",
|
||||
fmlogItem: {},
|
||||
saveInForm: {
|
||||
count_use: 0,
|
||||
|
|
@ -278,11 +285,18 @@ export default {
|
|||
mounted() {
|
||||
this.getfmlogItem();
|
||||
this.params.fmlog = this.fmlogId;
|
||||
this.paramsWm.mgroup = this.mgroup;
|
||||
this.apiObj = this.$API.wpm.mlog.list;
|
||||
},
|
||||
methods: {
|
||||
open(codeText="") {
|
||||
this.codeText = codeText;
|
||||
if(this.codeText!=""){
|
||||
this.$nextTick(() => {
|
||||
this.codeTextChange(codeText);
|
||||
})
|
||||
|
||||
}
|
||||
this.visible = true;
|
||||
},
|
||||
|
||||
|
|
@ -290,8 +304,6 @@ export default {
|
|||
let that = this;
|
||||
that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => {
|
||||
that.fmlogItem = res;
|
||||
that.mgroup = res.mgroup;
|
||||
that.mtask = res.mtask;
|
||||
that.paramsWm.mgroup = res.mgroup;
|
||||
that.$API.wpm.mlog.list.req(that.params).then((res) => {
|
||||
that.tableData = res;
|
||||
|
|
@ -301,9 +313,6 @@ export default {
|
|||
})
|
||||
that.paramsWm.search = that.batchContains;
|
||||
that.apiObjWm = that.$API.wpm.wmaterial.list;
|
||||
if(that.codeText!=""){
|
||||
this.codeTextChange(that.codeText);
|
||||
}
|
||||
}else{}
|
||||
});
|
||||
});
|
||||
|
|
@ -316,21 +325,19 @@ export default {
|
|||
table_add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open('add');
|
||||
this.$refs.saveDialogs.open('add');
|
||||
});
|
||||
},
|
||||
codeTextChange(codeText){
|
||||
let that = this;
|
||||
that.codeText = codeText;
|
||||
that.dialog.save = true;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.saveDialog.open('add',codeText);
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialogs.open('add',codeText);
|
||||
});
|
||||
},
|
||||
table_edit(row){
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open('edit').setData(row);
|
||||
this.$refs.saveDialogs.open('edit').setData(row);
|
||||
});
|
||||
},
|
||||
//表单提交方法
|
||||
|
|
|
|||
|
|
@ -148,6 +148,8 @@
|
|||
<detail-drawer
|
||||
v-if="dialog.detail"
|
||||
ref="detailDialog"
|
||||
:mtask="mtaskId"
|
||||
:mgroup="mgroupId"
|
||||
:fmlogId="fmlogId"
|
||||
:processId="processId"
|
||||
@closed="detailClose"
|
||||
|
|
@ -245,6 +247,7 @@ export default {
|
|||
},
|
||||
//日志详情
|
||||
table_detail(row) {
|
||||
this.mtaskId = row.mtask;
|
||||
this.fmlogId = row.id;
|
||||
this.dialog.detail = true;
|
||||
this.$nextTick(() => {
|
||||
|
|
@ -271,30 +274,23 @@ export default {
|
|||
codeTextChange(codeText){
|
||||
let that = this;
|
||||
that.codeText = 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 id = codeText.split('#')[1];
|
||||
that.$API.cm.labelmat.item.req(id).then((res) => {
|
||||
let params = {}
|
||||
params.page = 0;
|
||||
params.state = 20;
|
||||
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=>{
|
||||
if(res1.length==1){//只有一个任务,直接打开日志详情
|
||||
that.mtaskId =res1[0].id;
|
||||
that.changeMtask();
|
||||
// that.table_detail(res2[0]);
|
||||
}else{//多个任务时,弹出任务选择框
|
||||
that.mtaskoptions = res1;
|
||||
that.dialog.mtask = true;
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch((err) => {})
|
||||
},
|
||||
changeMtask(){
|
||||
let that = this;
|
||||
|
|
|
|||
Loading…
Reference in New Issue