|
|
@ -9,10 +9,18 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card-batch :dataContent="item" :index="index" :settingParam="dataContent" |
|
|
|
:isShowFromLocation="false" @removeItem="removeItem(index,item)" |
|
|
|
:isShowModifedLocation="true" |
|
|
|
@updateData="updateData" |
|
|
|
@editLocation="showScanToLocation" |
|
|
|
@removePack="removePack" |
|
|
|
v-if="managementType == 'BY_BATCH'||managementType =='BY_QUANTITY' "> |
|
|
|
</record-com-detail-card-batch> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" |
|
|
|
:isShowFromLocation="true" @removeItem="removeItem(index,item)" |
|
|
|
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" |
|
|
|
@removePack="removePack"> |
|
|
|
@removePack="removePack" v-else> |
|
|
|
</record-com-detail-card> |
|
|
|
|
|
|
|
</view> |
|
|
@ -77,7 +85,8 @@ |
|
|
|
getBusinessType, |
|
|
|
createItemInfo, |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
calcHandleQty, |
|
|
|
calcHandleQtyAdd |
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -97,6 +106,7 @@ |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' |
|
|
|
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' |
|
|
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
@ -112,6 +122,7 @@ |
|
|
|
winScanLocation, |
|
|
|
winScanPackAndLocation, |
|
|
|
recordComDetailCard, |
|
|
|
recordComDetailCardBatch, |
|
|
|
recordDetailCard, |
|
|
|
balanceSelect, |
|
|
|
winComScanBalance, |
|
|
@ -137,7 +148,8 @@ |
|
|
|
show: false, |
|
|
|
positionInfo: "请选择生产线", |
|
|
|
resultData: {}, |
|
|
|
itemCode: "" |
|
|
|
itemCode: "", |
|
|
|
managementType:'' |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -192,8 +204,9 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async getScanResult(result,managementType) { |
|
|
|
if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ |
|
|
|
async getScanResult(result,managementTypeParams) { |
|
|
|
this.managementType = managementTypeParams |
|
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
this.setDataBatch(result); |
|
|
|
}else{ |
|
|
|
this.setData(result); |
|
|
@ -356,11 +369,12 @@ |
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
newDetail.handleQty = 0 |
|
|
|
newDetail.balanceQty =result.balance.qty; |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
this.itemCode = balance.itemCode; |
|
|
|
this.fromLocationCode = balance.locationCode |
|
|
|
this.scanPopupGetFocus() |
|
|
|
// this.scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
|
|
|
|
var detail = item.subList.find(r => { |
|
|
@ -418,6 +432,7 @@ |
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
newDetail.fromLocationCode=balance.locationCode |
|
|
|
newDetail.handleQty = 0 |
|
|
|
newDetail.balanceQty =result.balance.qty; |
|
|
|
item.subList.push(newDetail); |
|
|
|
} |
|
|
|
}) |
|
|
@ -430,32 +445,35 @@ |
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
newDetail.handleQty = 0 |
|
|
|
newDetail.balanceQty =result.balance.qty; |
|
|
|
item.subList.push(newDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.scanPopupGetFocus() |
|
|
|
// this.scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
// this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// calcHandleQty(this.detailSource); |
|
|
|
console.log(this.detailSource) |
|
|
|
for (let item of this.detailSource) { |
|
|
|
item.handleQty = new Decimal(0).toNumber(); |
|
|
|
item.qty = new Decimal(0).toNumber(); |
|
|
|
for (let detail of item.subList) { |
|
|
|
if (detail != undefined) { |
|
|
|
if (detail.scaned) { |
|
|
|
item.handleQty = calc.add(result.label.qty, detail.handleQty) |
|
|
|
detail.handleQty = calc.add(result.label.qty, detail.handleQty); |
|
|
|
} |
|
|
|
item.qty = calc.add(item.qty, detail.qty); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(result.label) |
|
|
|
calcHandleQtyAdd(this.detailSource, result.label); |
|
|
|
// console.log(this.detailSource) |
|
|
|
// for (let item of this.detailSource) { |
|
|
|
// item.handleQty = new Decimal(0).toNumber(); |
|
|
|
// item.qty = new Decimal(0).toNumber(); |
|
|
|
// for (let detail of item.subList) { |
|
|
|
// if (detail != undefined) { |
|
|
|
// if (detail.scaned) { |
|
|
|
// item.handleQty = calc.add(result.label.qty, detail.handleQty) |
|
|
|
// detail.handleQty = calc.add(result.label.qty, detail.handleQty); |
|
|
|
// } |
|
|
|
// item.qty = calc.add(item.qty, detail.qty); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
@ -595,6 +613,13 @@ |
|
|
|
...this.setRecordParams() |
|
|
|
} |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty) |
|
|
|
if(isHaveItem){ |
|
|
|
this.showErrorMessage(`物料号${isHaveItem.itemCode}`) |
|
|
|
this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') |
|
|
|
uni.hideLoading() |
|
|
|
return |
|
|
|
} |
|
|
|
issueRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
@ -637,6 +662,7 @@ |
|
|
|
// detail.toLocationCode = detail.toLocationCode |
|
|
|
submitItem.qty = detail.handleQty; |
|
|
|
submitItem.package = ""; |
|
|
|
submitItem.balanceQty = detail.balanceQty; |
|
|
|
submitItem.recordList = [{ |
|
|
|
toInventoryStatus: detail.inventoryStatus, |
|
|
|
fromParentPackingNumber: detail.parentNumber, |
|
|
|