Browse Source

YT-483直接发料按照批次管理精度,重复扫描箱签应该累加数量,而不会提示重复扫描。不应该查库存数量,应该扫描提交标签箱签

intex_online20241111
张立 4 months ago
parent
commit
89fed1d271
  1. 68
      src/pages/issue/record/directIssue.vue
  2. 4
      src/pages/putaway/record/putawayRecord.vue

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

@ -9,10 +9,18 @@
<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-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" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="true" @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" v-else>
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -77,7 +85,8 @@
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
createDetailInfo, createDetailInfo,
calcHandleQty calcHandleQty,
calcHandleQtyAdd
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
@ -97,6 +106,7 @@
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
@ -112,6 +122,7 @@
winScanLocation, winScanLocation,
winScanPackAndLocation, winScanPackAndLocation,
recordComDetailCard, recordComDetailCard,
recordComDetailCardBatch,
recordDetailCard, recordDetailCard,
balanceSelect, balanceSelect,
winComScanBalance, winComScanBalance,
@ -137,7 +148,8 @@
show: false, show: false,
positionInfo: "请选择生产线", positionInfo: "请选择生产线",
resultData: {}, resultData: {},
itemCode: "" itemCode: "",
managementType:''
}; };
}, },
onLoad(option) { onLoad(option) {
@ -192,8 +204,9 @@
}); });
}, },
async getScanResult(result,managementType) { async getScanResult(result,managementTypeParams) {
if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.setDataBatch(result); this.setDataBatch(result);
}else{ }else{
this.setData(result); this.setData(result);
@ -356,11 +369,12 @@
newDetail.packUnit = pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty; newDetail.packQty = pack.packQty;
newDetail.handleQty = 0 newDetail.handleQty = 0
newDetail.balanceQty =result.balance.qty;
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.itemCode = balance.itemCode; this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode this.fromLocationCode = balance.locationCode
this.scanPopupGetFocus() // this.scanPopupGetFocus()
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
@ -418,6 +432,7 @@
newDetail.packQty = pack.packQty; newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode newDetail.fromLocationCode=balance.locationCode
newDetail.handleQty = 0 newDetail.handleQty = 0
newDetail.balanceQty =result.balance.qty;
item.subList.push(newDetail); item.subList.push(newDetail);
} }
}) })
@ -430,32 +445,35 @@
newDetail.packUnit = pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty; newDetail.packQty = pack.packQty;
newDetail.handleQty = 0 newDetail.handleQty = 0
newDetail.balanceQty =result.balance.qty;
item.subList.push(newDetail); item.subList.push(newDetail);
} }
} }
this.scanPopupGetFocus() // this.scanPopupGetFocus()
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
// this.showErrorMessage("[" + detail.packingNumber + "[" + balance.batch + "]") // this.showErrorMessage("[" + detail.packingNumber + "[" + balance.batch + "]")
} }
} }
} }
// calcHandleQty(this.detailSource);
console.log(this.detailSource) console.log(this.detailSource)
for (let item of this.detailSource) { console.log(result.label)
item.handleQty = new Decimal(0).toNumber(); calcHandleQtyAdd(this.detailSource, result.label);
item.qty = new Decimal(0).toNumber(); // console.log(this.detailSource)
for (let detail of item.subList) { // for (let item of this.detailSource) {
if (detail != undefined) { // item.handleQty = new Decimal(0).toNumber();
if (detail.scaned) { // item.qty = new Decimal(0).toNumber();
item.handleQty = calc.add(result.label.qty, detail.handleQty) // for (let detail of item.subList) {
detail.handleQty = calc.add(result.label.qty, detail.handleQty); // if (detail != undefined) {
} // if (detail.scaned) {
item.qty = calc.add(item.qty, detail.qty); // 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) { showErrorMessage(message) {
@ -595,6 +613,13 @@
...this.setRecordParams() ...this.setRecordParams()
} }
console.log("提交参数", JSON.stringify(params)); 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 => { issueRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -637,6 +662,7 @@
// detail.toLocationCode = detail.toLocationCode // detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
submitItem.balanceQty = detail.balanceQty;
submitItem.recordList = [{ submitItem.recordList = [{
toInventoryStatus: detail.inventoryStatus, toInventoryStatus: detail.inventoryStatus,
fromParentPackingNumber: detail.parentNumber, fromParentPackingNumber: detail.parentNumber,

4
src/pages/putaway/record/putawayRecord.vue

@ -171,8 +171,8 @@
methods: { methods: {
getScanResult(result,managementType) { getScanResult(result,managementType) {
this.managementType = managementType this.managementType = managementTypeParams
if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this. getScanResultAfterBatch(result) this. getScanResultAfterBatch(result)
}else{ }else{
this. getScanResultAfter(result) this. getScanResultAfter(result)

Loading…
Cancel
Save