fix:车间库存领料时扫码问题修正

This commit is contained in:
shijing 2025-02-07 16:59:09 +08:00
parent f3aea5bf88
commit f4ecb03144
1 changed files with 31 additions and 4 deletions

View File

@ -62,7 +62,7 @@
>
</el-option>
</el-select>
<scan-dialog ref="scanDialog" @closed="scanClose"> </scan-dialog>
<scan-dialog ref="scanDialog" :closeNow="closeNow" @closed="scanClose"> </scan-dialog>
</el-form-item>
<el-form-item label="批次" v-if="cate == 'do_out'">
<el-select
@ -139,6 +139,7 @@ export default {
return {
type: "do_in",
loading: false,
closeNow:true,
mode: "add",
titleMap: {
do_out: "生产领料",
@ -234,8 +235,8 @@ export default {
obj.page = 0;
obj.state = 10;
obj.material = that.form.material;
this.$API.inm.warehouse.batch.req(obj).then((res) => {
this.batchOptions = res.filter((item) => {
that.$API.inm.warehouse.batch.req(obj).then((res) => {
that.batchOptions = res.filter((item) => {
return item.state == 10;
});
});
@ -244,7 +245,33 @@ export default {
let that = this;
let id = data.split('#')[1];
console.log('id',id);
that.form.batch = id;
// that.form.batch = id;
that.$API.cm.labelmat.item.req(id).then((res) => {
that.form.mb = res.id;
that.form.batch = res.batch;
that.form.warehouse = res.warehouse;
let arr = that.mioitemlist.filter((mioitem) => {
return mioitem.batch == res.batch;
});
if(arr.length > 0){
that.$message.error('该批次已存在');
that.selectBatchClear();
}else{
let arr2 = that.batchOptions.filter((batchitem) => {
return batchitem.batch == res.batch;
})
if(arr2.length > 0){
that.selectBatch = arr2[0].batch;
that.form.batch = arr2[0].batch;
that.form.mb = arr2[0].id;
that.form.warehouse = arr2[0].warehouse;
that.$refs.scanDialog.visible = false;
}else{
that.$message.error('该批次不存在');
}
}
})
},
selectMaterialChange() {
this.getBatchOptions();