Browse Source

采购收货和上架修改成按批次2024/9/13 12:06:51

syhx
zhang_li 2 months ago
parent
commit
eaf3a23a17
  1. 2
      src/mycomponents/package/packageCard.vue
  2. 28
      src/mycomponents/scan/winScanPackAndLocation.vue
  3. 39
      src/pages/purchaseReceipt/job/receiptDetail.vue
  4. 140
      src/pages/putaway/job/putawayDetail.vue

2
src/mycomponents/package/packageCard.vue

@ -6,7 +6,7 @@
<view style="word-break: break-all;"> <view style="word-break: break-all;">
<!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber"> <!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber">
</container> --> </container> -->
<pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber"></pack> <pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode"> <location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location> </location>

28
src/mycomponents/scan/winScanPackAndLocation.vue

@ -120,7 +120,11 @@
balanceFromInventoryStatuses: { //fromInventoryStatuses balanceFromInventoryStatuses: { //fromInventoryStatuses
type: Boolean, type: Boolean,
default: true default: true
} },
toLocationCode: {
type: String,
default: ""
},
}, },
data() { data() {
return { return {
@ -209,8 +213,8 @@
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; // this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; //
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); // this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //
uni.showLoading({ uni.showLoading({
title:"获取标签信息", title: "获取标签信息",
mask:true mask: true
}) })
getLabelInfo(scanMessage, this.headerType, callback => { getLabelInfo(scanMessage, this.headerType, callback => {
uni.hideLoading() uni.hideLoading()
@ -308,7 +312,7 @@
// } // }
}, },
checkPackage(result) { async checkPackage(result) {
if (result.label != null) { if (result.label != null) {
this.scanResult = result; this.scanResult = result;
if (this.queryBalance == true) { if (this.queryBalance == true) {
@ -317,7 +321,8 @@
// mask: true // mask: true
// }) // })
// -- fromInventoryStatuses // -- fromInventoryStatuses
getBalanceByManagementPrecisionByPacking(result.label, result.package, this.fromLocationCode, this //
await getBalanceByManagementPrecisionByPacking(result.label, result.package, this.fromLocationCode, this
.balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined, .balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined,
res => { res => {
uni.hideLoading(); uni.hideLoading();
@ -365,9 +370,9 @@
}, },
// //
allowNoneBalance(datas) { async allowNoneBalance(datas) {
if (datas.length == 0) { if (datas.length == 0) {
this.packCallBack(null); await this.packCallBack(null);
} else { } else {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],已经查找到该包装的库存记录,请重新扫描', res => { this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],已经查找到该包装的库存记录,请重新扫描', res => {
this.packGetFocus(); this.packGetFocus();
@ -440,7 +445,7 @@
this.$emit("getCountScanResult", data); this.$emit("getCountScanResult", data);
}, },
packCallBack(item) { async packCallBack(item) {
if (this.$refs.comscan) { if (this.$refs.comscan) {
this.$refs.comscan.clear(); this.$refs.comscan.clear();
} }
@ -452,7 +457,12 @@
fromLocationCode: this.fromLocationCode, fromLocationCode: this.fromLocationCode,
} }
this.packGetFocus(); this.packGetFocus();
//
if (this.managementPrecision == 'BY_BATCH') {
this.$emit("getResult", data, this.managementPrecision);
} else {
this.$emit("getResult", data); this.$emit("getResult", data);
}
}, },
packGetFocus() { packGetFocus() {
@ -476,7 +486,7 @@
let condition = '按照以下条件:\n'; let condition = '按照以下条件:\n';
let label = this.scanResult.label; let label = this.scanResult.label;
var isShowStatus = this.balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined var isShowStatus = this.balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined
let status="" let status = ""
if (isShowStatus) { if (isShowStatus) {
status = getInventoryStatusDesc(isShowStatus); status = getInventoryStatusDesc(isShowStatus);
} }

39
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -31,9 +31,13 @@
<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="">
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <!-- 管理精度是批次 -->
@remove="updateData" @updateData="updateData" <comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent"
:locationAreaTypeList='toLocationAreaTypeList'> @remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
v-if="managementType == 'BY_BATCH'">
</comReceiptDetailCardBacth>
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData"
@updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' v-else>
</com-receipt-detail-card> </com-receipt-detail-card>
</view> </view>
</view> </view>
@ -119,6 +123,7 @@
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue' import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue'
import comReceiptDetailCardBacth from '@/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue'
import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue' import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue'
// import print from '@/mycomponents/print/print.vue' // import print from '@/mycomponents/print/print.vue'
import { import {
@ -137,6 +142,7 @@
comReceiptDetailCard, comReceiptDetailCard,
locationCompare, locationCompare,
jobTopAsn, jobTopAsn,
comReceiptDetailCardBacth
// print // print
}, },
data() { data() {
@ -153,6 +159,7 @@
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [], managementList: [],
managementType: '', //
jobStatus: "", jobStatus: "",
isAllReceived: false, isAllReceived: false,
operation: '', operation: '',
@ -267,6 +274,19 @@
that.toLocationCode = that.jobToLocationCode; that.toLocationCode = that.jobToLocationCode;
} }
that.isAllReceived = false; that.isAllReceived = false;
//
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
// if (uni.getStorageSync('purchaseReceiptDetailPointParams')) { // if (uni.getStorageSync('purchaseReceiptDetailPointParams')) {
// const purchaseReceiptDetailPointParams = uni.getStorageSync( // const purchaseReceiptDetailPointParams = uni.getStorageSync(
// 'purchaseReceiptDetailPointParams') // 'purchaseReceiptDetailPointParams')
@ -515,7 +535,7 @@
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams(); var params = this.setParams();
let that =this let that = this
purchaseReceiptJobSubmit(params).then(res => { purchaseReceiptJobSubmit(params).then(res => {
if (res.data) { if (res.data) {
let isCheckPrint = getSwitchInfoByCode(this.switchCode) let isCheckPrint = getSwitchInfoByCode(this.switchCode)
@ -524,7 +544,7 @@
// this.showCommitSuccessMessage("\n\n" + res.data.number) // this.showCommitSuccessMessage("\n\n" + res.data.number)
uni.redirectTo({ uni.redirectTo({
url: '/pages/pointPutawayJob/index?number='+that.jobContent.number url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number
}) })
} else { } else {
// if (res.data == '') { // if (res.data == '') {
@ -582,7 +602,8 @@
} }
uni.hideLoading() uni.hideLoading()
uni.redirectTo({ uni.redirectTo({
url: '/pages/pointPutawayJob/index?number='+that.jobContent.number+'&data=' + url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number +
'&data=' +
encodeURIComponent(JSON.stringify(dataParams)) encodeURIComponent(JSON.stringify(dataParams))
}) })
} }
@ -628,6 +649,8 @@
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch); detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber; detail.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber;
detail.formPackingNumber = info.packingNumber;
detail.toBatch = info.batch; detail.toBatch = info.batch;
subList.push(detail) subList.push(detail)
}) })
@ -711,7 +734,7 @@
showMessage(message) { showMessage(message) {
if(this.$refs.scanPopup){ if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus(); this.$refs.scanPopup.losefocus();
} }
setTimeout(r => { setTimeout(r => {
@ -724,7 +747,7 @@
}, },
showErrorMessage(message) { showErrorMessage(message) {
if(this.$refs.scanPopup){ if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus(); this.$refs.scanPopup.losefocus();
} }
setTimeout(r => { setTimeout(r => {

140
src/pages/putaway/job/putawayDetail.vue

@ -15,11 +15,15 @@
<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="">
<comJobDetailCard :dataContent="item" :index="index" :settingParam="jobContent" <!-- 物料按照批次的组件 批次不显示包装 -->
:isShowStatus="true" @remove="updateData" @updateData="updateData" <comJobDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent" :isShowStatus="true"
:locationAreaTypeList='toLocationAreaTypeList' @remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
:isShowPackListStatus="false" :isShowPackListStatus="false" v-if="managementType == 'BY_BATCH'">
> </comJobDetailCardBatch>
<!-- 物料按照包装的组件 -->
<comJobDetailCard :dataContent="item" :index="index" :settingParam="jobContent" :isShowStatus="true"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
:isShowPackListStatus="false" v-else>
</comJobDetailCard> </comJobDetailCard>
</view> </view>
</view> </view>
@ -27,8 +31,7 @@
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10" style="background-color:ghostwhite; width: 100%; ">
style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<locationCompare ref='comScanLocation' title="目标库位" :recommendLocationCode="jobToLocationCode" <locationCompare ref='comScanLocation' title="目标库位" :recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode' :isShowEdit="isCheckLocation" :locationCode="toLocationCode" @getLocation='scanLocationCode' :isShowEdit="isCheckLocation"
@ -44,8 +47,8 @@
<!-- <winScanPackAndLocationNoBalance ref="scanPopup" @getResult='getScanResult' :allowNullBalance="true"> <!-- <winScanPackAndLocationNoBalance ref="scanPopup" @getResult='getScanResult' :allowNullBalance="true">
</winScanPackAndLocationNoBalance> --> </winScanPackAndLocationNoBalance> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="false" ref="scanPopup" @getResult='getScanResult' <winScanPackAndLocation :balanceFromInventoryStatuses="false" :toLocationCode="jobToLocationCode" ref="scanPopup"
:noShowBalanceMessage="false"> @getResult='getScanResult' :noShowBalanceMessage="false">
</winScanPackAndLocation> </winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -88,6 +91,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comJobDetailCard from "@/mycomponents/detail/comJobDetailCard.vue" import comJobDetailCard from "@/mycomponents/detail/comJobDetailCard.vue"
import comJobDetailCardBatch from "@/mycomponents/detail/comJobDetailCardBatch.vue"
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
@ -98,7 +102,8 @@
winScanPackAndLocation, winScanPackAndLocation,
locationCompare, locationCompare,
comJobDetailCard, comJobDetailCard,
jobTop jobTop,
comJobDetailCardBatch
}, },
data() { data() {
return { return {
@ -114,7 +119,8 @@
jobStatus: "", jobStatus: "",
jobToLocationCode: "", jobToLocationCode: "",
isCheckLocation: false, isCheckLocation: false,
scanMessage: "" scanMessage: "",
managementType: '' //
}; };
}, },
onLoad(option) { onLoad(option) {
@ -210,6 +216,19 @@
} else { } else {
that.toLocationCode = that.jobToLocationCode; that.toLocationCode = that.jobToLocationCode;
} }
//
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
// //
if (this.scanMessage) { if (this.scanMessage) {
this.openScanPopupSimulate(this.scanMessage) this.openScanPopupSimulate(this.scanMessage)
@ -256,7 +275,7 @@
updateData() { updateData() {
console.log("updateData") console.log("updateData")
// this.calcHandleQty(); // this.calcHandleQty();
calcTreeHandleQty(this.detailSource) // calcTreeHandleQty(this.detailSource)
}, },
// //
openScanPopupSimulate(message) { openScanPopupSimulate(message) {
@ -307,8 +326,9 @@
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
}, },
getScanResult(result) { getScanResult(result, managementPrecision) {
try { try {
this.managementType = managementPrecision
var packingNumber = result.label.packingNumber; var packingNumber = result.label.packingNumber;
var batch = result.label.batch; var batch = result.label.batch;
var qty = result.label.qty; var qty = result.label.qty;
@ -326,6 +346,11 @@
if (detail == undefined) { if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else { } else {
detail.scaned = true
if (this.managementType == 'BY_BATCH') {
this.verificationBatch(detail, packingNumber, batch, qty, itemCode, locationCode, result)
} else {
var itemDetail = detail.subList.find(r => { var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber && return r.packingNumber == packingNumber &&
r.batch == batch && r.batch == batch &&
@ -403,11 +428,98 @@
} }
} }
} }
}
if (this.managementType == 'BY_BATCH') {
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.packingNumber = ''
})
})
}
} catch (e) { } catch (e) {
this.showMessage(e.message) this.showMessage(e.message)
} }
}, },
//
verificationBatch(detail,packingNumber,batch,qty,itemCode,locationCode,result){
var itemDetail = detail.subList.find(r => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode
})
if (itemDetail == undefined) {
var isExit;
for (let subItem of detail.subList) {
var item;
for (let pack of subItem.packList) {
if (pack.batch == batch) {
item = pack;
isExit = pack;
break;
}
}
if (item != undefined) {
subItem.scaned = true
subItem.handleQty = 0;
item = undefined
}
}
if (isExit == undefined) {
this.showErrorMessage("批次【" + batch + "】库位【" + result
.fromLocationCode + "】不在列表中")
} else {
if (!isExit.cancleScanedHiht && isExit.scaned) {
this.showMessage("批次【" + batch + "】已经扫描")
} else {
isExit.scaned = true
let qty = 0;
if (result.balance != null) {
qty = Number(result.balance.qty);
} else {
qty = Number(result.label.qty);
}
isExit.handleQty = Number(result.label.qty);
isExit.toLocationCode = this.toLocationCode;
}
}
calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
} else {
var scanedLength = 0;
itemDetail.packList.forEach(res => {
if (res.scaned) {
scanedLength++;
}
})
//
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList
.length) {
// this.showMessage("" + packingNumber + "")
this.showMessage("批次【" + batch + "】已经扫描")
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = result.label.qty;
// itemDetail.toInventoryStatus = "OK"
itemDetail.packList.forEach(pac => {
pac.scaned = true
pac.handleQty = Number(pac.qty);
pac.toLocationCode = this.toLocationCode;
})
calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
}
},
scanLocationCode(location, code) { scanLocationCode(location, code) {
this.toLocationCode = code this.toLocationCode = code
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -518,6 +630,8 @@
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch); detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber; detail.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;
detail.toBatch = info.batch; detail.toBatch = info.batch;
detail.toContainerNumber = ''; detail.toContainerNumber = '';

Loading…
Cancel
Save