Browse Source

YT-692采购收货收货库区管理精度为按数量管理,PDA扫描标签失败

intex_online20241111
zhang_li 3 weeks ago
parent
commit
e11b01a422
  1. 5
      src/mycomponents/scan/winComScan.vue
  2. 1
      src/mycomponents/scan/winScanLocation.vue
  3. 6
      src/pages/inventoryMove/coms/comMoveRecord.vue
  4. 77
      src/pages/inventoryMove/coms/okToHoldRecordPack.vue
  5. 142
      src/pages/purchaseReceipt/job/receiptDetail.vue

5
src/mycomponents/scan/winComScan.vue

@ -155,10 +155,11 @@
// title: '...', // title: '...',
// mask: true // mask: true
// }) // })
console.log(222)
let that = this; let that = this;
// if(index==-1){ // if(index==-1){
// that.scanMsg =that.scanMsg + "\n"; // that.sc
// } console.log(that.scanMsg.includes('\n'))
if (that.scanMsg.includes('\n')) { if (that.scanMsg.includes('\n')) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; // that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => { setTimeout(() => {

1
src/mycomponents/scan/winScanLocation.vue

@ -92,6 +92,7 @@
title: '扫描中...', title: '扫描中...',
mask: true mask: true
}); });
console.log(111,result)
let label = result.label; let label = result.label;
if (label.barType === 'QRCode') { if (label.barType === 'QRCode') {
this.code = label.locationCode; this.code = label.locationCode;

6
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -35,7 +35,7 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<!-- 合格转隔离单独的弹窗--> <!-- 合格转隔离单独的弹窗-->
<okToHoldRecordPack ref="okToHoldRecordPackRef" :fromLocationCodeProps='fromLocationCode' :itemCodeProps='itemCode' :batchProps='batch' :showOnePop='showOnePop' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @fromLocationBlur='fromLocationBlur'></okToHoldRecordPack> <okToHoldRecordPack ref="okToHoldRecordPackRef" :fromLocationCodeProps='fromLocationCode' :itemCodeProps='itemCode' :batchProps='batch' :showOnePop='showOnePop' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @fromLocationBlur="fromLocationBlur"></okToHoldRecordPack>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'" > <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'" >
</win-scan-pack-and-location> </win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' <win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
@ -476,7 +476,9 @@
} }
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
fromLocationBlur(){ fromLocationBlur(result){
console.log('pooo',result)
this.$refs.scanFromLocationCode.getScanResult(result)
// this.$refs.scanPopup. // this.$refs.scanPopup.
}, },
showErrorMessage(message) { showErrorMessage(message) {

77
src/pages/inventoryMove/coms/okToHoldRecordPack.vue

@ -9,14 +9,14 @@
</view> </view>
<view class="item"> <view class="item">
<view class="label">来源库位</view> <view class="label">来源库位</view>
<view class="value"><u-input v-model="fromLocationCode" @blur="fromLocationBlur"></u-input></view> <view class="value"><input v-model="fromLocationCode" @input="fromLocationScanMsg"></input></view>
<view class="searchIcon"> <view class="searchIcon">
<image src="/static/search.svg" mode="" @click="fromLocationClick"/> <image src="/static/search.svg" mode="" @click="fromLocationClick"/>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="label">零件</view> <view class="label">零件</view>
<view class="value"><u-input v-model="itemCode"></u-input></view> <view class="value"><u-input v-model="itemCode" @blur="itemCodeBlur"></u-input></view>
<view class="searchIcon"> <view class="searchIcon">
<image src="/static/search.svg" mode="" @click="itemCodeClick"/> <image src="/static/search.svg" mode="" @click="itemCodeClick"/>
</view> </view>
@ -53,6 +53,11 @@
getBusinessType getBusinessType
} from '@/common/record.js'; } from '@/common/record.js';
import {
getLabelInfo
} from '../../../common/label.js';
export default { export default {
components: { components: {
winScanLocation winScanLocation
@ -111,10 +116,70 @@
} }
this.$emit("confirm",obj); this.$emit("confirm",obj);
}, },
fromLocationBlur(){ fromLocationScanMsg(){
// this.$refs.scanLocationCode.openScanPopup() this.scanMsg = this.fromLocationCode
console.log(this.fromLocationCode) this.handelScanMsg()
this.$emit("fromLocationBlur"); },
itemCodeBlur(){
this.scanMsg = this.itemCode
this.handelScanMsg()
},
handelScanMsg() {
//
// uni.showLoading({
// title: '...',
// mask: true
// })
let that = this;
console.log(that.scanMsg)
// if(index==-1){
// that.scanMsg =that.scanMsg + "\n";
// }
console.log(that.scanMsg.includes('\n'))
if (that.scanMsg.includes('\n')) {
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50';
setTimeout(() => {
that.losefocus();
let content = uni.$u.trim(that.scanMsg)
if (content == "") {
// that.getfocus();
this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => {
if (res) {
that.scanMsg = ""
that.getfocus();
}
})
return;
}
if (that.isShowHistory) {
that.scanList.unshift(content);
}
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
scanResult.scanMessage = content
if (scanResult.success) {
// that.getfocus();//
that.$emit("fromLocationBlur", scanResult);
} else {
that.losefocus();
this.$refs.comMessage.showErrorMessage(scanResult.message, res => {
if (res) {
that.getfocus();
}
})
}
});
}, 200);
}
},
losefocus() {
let that = this;
this.$nextTick(r => {
that.boxfocus = false;
});
}, },
}, },
watch: { watch: {

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

@ -34,7 +34,7 @@
<!-- 管理精度是批次 --> <!-- 管理精度是批次 -->
<comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent" <comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' @remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
v-if="managementType == 'BY_BATCH'"> v-if="managementType == 'BY_BATCH' || managementType =='BY_QUANTITY'">
</comReceiptDetailCardBacth> </comReceiptDetailCardBacth>
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData" <com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData"
@updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' v-else> @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' v-else>
@ -317,8 +317,11 @@
}, },
getScanResult(result) { getScanResult(result) {
this.balanceInfo = result.balance this.balanceInfo = result.balance
if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY' ){ console.log(this.managementType)
if(this.managementType == 'BY_BATCH'){
this.getScanResultAfterBatch(result) this.getScanResultAfterBatch(result)
}else if(this.managementType == 'BY_QUANTITY' ){
this.getScanResultAfterQuantity(result)
}else{ }else{
this.getScanResultAfter(result) this.getScanResultAfter(result)
} }
@ -559,6 +562,138 @@
this.showErrorMessage(e.message) this.showErrorMessage(e.message)
} }
}, },
//
getScanResultAfterQuantity(result){
try {
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
return;
}
detail.scaned = true;
if (result.label.labelType == "ContainerLabel") {
var containerNumber = result.label.container;
var itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
if (itemDetail.length == 0) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中")
} else {
if (itemDetail[0].scaned) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描")
} else {
itemDetail.forEach(item => {
item.scaned = true;
itemDetail.scanDate = new Date();
item.handleQty = calc.add(item.handleQty,result.label.qty)
item.toLocationCode = this.toLocationCode;
})
// calcHandleQty(this.detailSource);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
}
}
} else if (result.label.labelType == "PurchaseLabel") {
var packingNumber = result.package.number;
var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
console.log(8989,this.detailSource)
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
//
// var itemDetail = detail.subList.find(r => r.batch ==
// batch);
// if (itemDetail == undefined) {
// itemDetail = detail.subList.find(r => r.batch ==
// batch);
// if (itemDetail == undefined) {
// this.showMessage("" + batch + "")
// } else {
// var pack = itemDetail.packList.find(p =>
// p.batch == batch)
// if (pack == undefined) {
// this.showMessage("" + batch + "")
// } else {
let isScan = false
const itemDetail = detail.subList[0]
let pack = detail.subList[0] && detail.subList[0].length>0 ?detail.subList[0] : {}
if(packingNumber){
isScan = this.packingNumberList.some(item=>item == packingNumber)
}else{
isScan = false
}
if (isScan) {
detail.subList[0].scanDate = new Date();
// this.showMessage("" + packingNumber + "");
detail.subList[0].handleQty = calc.add(detail.subList[0].handleQty,result.label.qty)
} else {
this.packingNumberList.push(packingNumber)
detail.subList[0].scaned = true
detail.subList[0].scanDate = new Date();
detail.subList[0].handleQty = Number(result.label.qty);
detail.subList[0].toLocationCode = this.toLocationCode;
detail.subList[0].labelQty = Number(result.label.qty);
}
// }
calcHandleQty(this.detailSource);
this.continueScan()
// itemDetail.packList[0] = detail.subList[0]; //
this.$forceUpdate()
// }
// } else {
// //,
// var scanedLength = 0;
// itemDetail.packList.forEach(res => {
// if (res.scaned) {
// scanedLength++;
// }
// })
// debugger
// let isScan = false
// if(packingNumber){
// isScan = this.packingNumberList.some(item=>item == packingNumber)
// }else{
// isScan = false
// }
// if (isScan) {
// itemDetail.scanDate = new Date();
// // this.showMessage("" + packingNumber + "")
// itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
// } else {
// this.packingNumberList.push(packingNumber)
// itemDetail.scaned = true;
// itemDetail.scanDate = new Date();
// itemDetail.handleQty =itemDetail.handleQty ?itemDetail.handleQty:0
// itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
// console.log(itemDetail.handleQty)
// itemDetail.toLocationCode = this.toLocationCode;
// itemDetail.labelQty = Number(result.label.qty);
// itemDetail.packList.forEach(pac => {
// pac.scaned = true
// pac.scanDate = new Date();
// pac.handleQty = calc.add(pac.handleQty,result.label.qty);
// pac.toLocationCode = this.toLocationCode;
// })
// detail.handleQty = itemDetail.handleQty
// this.detailSource[0].subList.sort(compareDesc('scanDate')); //
// this.continueScan()
// this.$forceUpdate()
// }
// calcHandleQty(this.detailSource);
// }
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
// //
continueScan() { continueScan() {
this.scanCount = getScanCount(this.subList); this.scanCount = getScanCount(this.subList);
@ -714,7 +849,8 @@
var params = this.setParams(); var params = this.setParams();
let that = this let that = this
console.log(params) console.log(877,params)
// return;
purchaseReceiptJobSubmit(params).then(res => { purchaseReceiptJobSubmit(params).then(res => {
if (res.data) { if (res.data) {
let isCheckPrint = getSwitchInfoByCode(this.switchCode)// let isCheckPrint = getSwitchInfoByCode(this.switchCode)//

Loading…
Cancel
Save