Browse Source

HL-5676 直接发料支持扫描多个物料

hella_online_20240803
lijuncheng 3 months ago
parent
commit
da22c63950
  1. 50
      src/pages/issue/record/directIssue.vue

50
src/pages/issue/record/directIssue.vue

@ -4,19 +4,13 @@
<com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header-view">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</view>
</view>
</view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="true" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" :isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
@removePack="removePack"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
@ -79,7 +73,6 @@
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
createDetailInfo, createDetailInfo,
calcTreeHandleQty,
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
@ -200,11 +193,11 @@
let pack = result.package; let pack = result.package;
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) { // if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this // this.showErrorMessage("[" + balance.packingNumber + "[" + balance.batch + "][" + this
.fromLocationCode + "]没有库存余额") // .fromLocationCode + "]")
return; // return;
} // }
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
@ -212,15 +205,13 @@
} }
}) })
if (item == undefined) { if (item == undefined) {
if (this.itemCode != "" && this.itemCode != balance.itemCode) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码")
return;
}
if (this.fromWarehouseCode == '') { if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode; this.fromWarehouseCode = balance.warehouseCode;
} }
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit; newDetail.packUnit = pack.packUnit;
@ -237,7 +228,7 @@
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == pack.number && if (r.packingNumber == pack.number &&
r.batch == balance.batch && r.batch == balance.batch &&
r.locationCode == balance.locationCode && r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) { r.inventoryStatus == balance.inventoryStatus) {
return r; return r;
} }
@ -249,7 +240,8 @@
if (pack.parentNumber) { if (pack.parentNumber) {
var checkData = item.subList.find(r => { var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber && if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch) { r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r; return r;
} }
}) })
@ -264,6 +256,7 @@
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty; newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) { if (balance.lableQty) {
newDetail.handleQty = balance.lableQty newDetail.handleQty = balance.lableQty
} }
@ -273,7 +266,8 @@
// //
var checkData = item.subList.find(r => { var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number && if (r.parentNumber == pack.number &&
r.batch == balance.batch) { r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r; return r;
} }
}) })
@ -288,6 +282,7 @@
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty; newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) { if (balance.lableQty) {
newDetail.handleQty = balance.lableQty newDetail.handleQty = balance.lableQty
} }
@ -297,6 +292,7 @@
console.log("扫描的是父包装,是否移除子包装") console.log("扫描的是父包装,是否移除子包装")
} else { } else {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit; newDetail.packUnit = pack.packUnit;
@ -326,18 +322,6 @@
}); });
}, },
calcTreeHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty, detail.qty)
}
}
}
this.$forceUpdate();
},
showSelect() { showSelect() {
// if (this.editPosition) { // if (this.editPosition) {
this.show = true this.show = true

Loading…
Cancel
Save