Browse Source

YT-497采购收货PAD扫描箱码,同一批次的不能重复扫描

intex_online20241111
zhang_li 1 month ago
parent
commit
ec1b6f7155
  1. 4
      src/api/request2.js
  2. 4
      src/common/balance.js
  3. 38
      src/common/label.js
  4. 2
      src/mycomponents/item/itemCompareQty.vue
  5. 97
      src/mycomponents/qty/recommendHandleQty.vue
  6. 13
      src/mycomponents/scan/winComScan.vue
  7. 9
      src/mycomponents/scan/winScanPack.vue
  8. 47
      src/pages/inventoryMove/record/okToHoldRecord.vue
  9. 55
      src/pages/purchaseReceipt/job/receiptDetail.vue

4
src/api/request2.js

@ -421,7 +421,7 @@ export function getPackageByNumber(number) {
* @param {*}
*
*/
export function getPackageListByNumber(number) {
export async function getPackageListByNumber(number) {
var params = {
number: number,
pageNo: 1,
@ -4301,7 +4301,7 @@ export function overPackageRecordSubmit(params) {
* @param {*}
*
*/
export function getManagementPrecision(params) {
export async function getManagementPrecision(params) {
return request({
url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes",
method: "post",

4
src/common/balance.js

@ -105,7 +105,7 @@ export function getPrecisionStrategyList(itemList, callback) {
* @param {*}
*
*/
export function getManagementPrecisions(itemCodes, locationCode, callback) {
export async function getManagementPrecisions(itemCodes, locationCode, callback) {
// let jsonParem = JSON.stringify(param)
let result = {
list: [],
@ -117,7 +117,7 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
itemCodes: itemCodes,
locationCode: locationCode
}
getManagementPrecision(params).then(res => {
await getManagementPrecision(params).then(res => {
if (res.data == null) {
result.success = false
result.message = '未查询到管理精度信息'

38
src/common/label.js

@ -10,10 +10,11 @@ import {
getDirectoryItemArray
} from '../common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
export function getLabelInfo(scanMsg, headerType, callBack) {
console.log('扫描信息:', scanMsg);
export function getLabelInfo(scanMsg, headerType, callBack,locationCode) {
if (scanMsg.length == 0) {
return null
}
@ -41,17 +42,17 @@ export function getLabelInfo(scanMsg, headerType, callBack) {
let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode
{
getQRCodeInfo(header, version, scanMsg, callBack);
getQRCodeInfo(header, version, scanMsg, callBack,locationCode);
}
// else if (type == 'B') //barcode
// {
// getBarCodeInfo(header, version, items[2], callBack);
// }
else { //直接输入文本
getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode);
}
} else {
getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode);
// let labelResult = {
// label: {
// labelType: "",
@ -66,7 +67,7 @@ export function getLabelInfo(scanMsg, headerType, callBack) {
}
}
export function getQRCodeInfo(header, version, scanMsg, callBack) {
export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
//获取包装信息
let labelItem = labelDic.find(r => r.header == header && r.version == version);
if (labelItem == undefined) {
@ -91,7 +92,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
};
labelDic.push(newItem);
getLabelItems(newItem, scanMsg, callBack);
getLabelItems(newItem, scanMsg, callBack,locationCode);
}
}).catch(err => {
labelResult.success = false;
@ -99,22 +100,32 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
callBack(err);
})
} else {
getLabelItems(labelItem, scanMsg, callBack);
getLabelItems(labelItem, scanMsg, callBack,locationCode);
}
}
export function getLabelItems(labelItem, scanMsg, callBack) {
export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
let labelResult = analysisQRCodeLabel(labelItem, scanMsg);
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息
let packingNumber = labelResult.label.packingNumber
let packingNumber1 = labelResult.label.packingNumber//记录单号
if(locationCode){
await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => {
if (res.success) {
const managementList = res.list;
const managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
packingNumber = ''
}
}
})
}
if (packingNumber != undefined && packingNumber != '') {
getPackageListByNumber(packingNumber).then(pack => {
await getPackageListByNumber(packingNumber).then(pack => {
if (pack.data.reqPackage) {
labelResult.package = pack.data.reqPackage;
labelResult.package.subList = pack.data.subList;
console.log('包装信息', JSON.stringify(labelResult.package))
} else {
labelResult.success = false;
labelResult.message = '包装号[' + packingNumber + ']没有包装信息';
@ -128,6 +139,7 @@ export function getLabelItems(labelItem, scanMsg, callBack) {
} else {
//线边的物料可能没有箱码
labelResult.package = labelResult.label;
labelResult.package.number = packingNumber1 ? packingNumber1 : ''
callBack(labelResult);
// labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码';

2
src/mycomponents/item/itemCompareQty.vue

@ -20,7 +20,7 @@
<script>
import item from '@/mycomponents/item/item.vue'
import qty from '@/mycomponents/qty/qty.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import recommendQty from '@/mycomponents/qty/recommendHandleQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
import balanceQty from '@/mycomponents/qty/balanceQty.vue'

97
src/mycomponents/qty/recommendHandleQty.vue

@ -0,0 +1,97 @@
<template>
<view>
<status v-if="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center">
<view class="text_recommend " v-if="Number(recommendQty)">
{{Number(recommendQty)}}/
</view>
<view class="text_recommend ">
{{Number(dataContent.qty)}}
</view>
</view>
<view>
<pack-unit :dataContent="dataContent"></pack-unit>
<!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> -->
</view>
</view>
</template>
<script>
// import packQty from '@/mycomponents/qty/packQty.vue'
import packUnit from '@/mycomponents/qty/packUnit.vue'
import uom from '@/mycomponents/qty/uom.vue'
import status from '@/mycomponents/status/status.vue'
export default {
components: {
// packQty,
packUnit,
uom,
status
},
data() {
return {
};
},
//
props: {
type: {
type: String,
default: 'default' //recommend: compare:
},
dataContent: {
type: Object,
default: {}
},
recommendQty: {
type: Number,
default: 0
},
handleQty: {
type: Number,
default: 0
},
isShowStatus: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
},
objTextStyle: {
type: Object,
default: null
},
isShowPackCount: {
type: Boolean,
default: true
},
isShowCount: {
type: Boolean,
default: true
}
},
watch: {
},
methods: {
calc(qty, packQty) {
if(qty&&packQty){
return Math.ceil(Number(qty) / Number(packQty));
}else{
return 0
}
}
},
}
</script>
<style lang="scss">
</style>

13
src/mycomponents/scan/winComScan.vue

@ -59,6 +59,11 @@
getLabelInfo
} from '../../common/label.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
export default {
name: "winComScan",
emits: ["getResult"],
@ -83,6 +88,10 @@
headerType: {
type: String,
default: 'HPQ' //HLB HMQ HCQ HPQ
},
locationCode:{
type: String,
default: ''
}
},
data() {
@ -99,7 +108,6 @@
}
},
mounted() {
},
watch: {
placeholder() {
@ -170,6 +178,7 @@
if (that.isShowHistory) {
that.scanList.unshift(content);
}
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
@ -187,7 +196,7 @@
}
})
}
});
},this.locationCode);
}, 200);
}
},

9
src/mycomponents/scan/winScanPack.vue

@ -15,7 +15,7 @@
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
:isShowHistory="isShowHistory" :clearResult="true" :locationCode='locationCode'></win-com-scan>
</view>
</view>
</view>
@ -48,11 +48,13 @@
headerType:{
type: String,
default: 'HPQ'
}
},
},
data() {
return {
show: false,
locationCode:''
}
},
created() {
@ -69,8 +71,9 @@
})
},
openScanPopup() {
openScanPopup(locationCode1) {
this.$refs.popup.open('bottom')
this.locationCode = locationCode1
setTimeout(res => {
this.getfocus()
}, 500)

47
src/pages/inventoryMove/record/okToHoldRecord.vue

@ -1,11 +1,11 @@
<template>
<view class="page-wraper">
<comMoveRecord :myTitle="title" businessTypeCode='OkToHold' > </comMoveRecord>
<!-- <comMoveRecord :myTitle="title" businessTypeCode='OkToHold' > </comMoveRecord> -->
</view>
</template>
<script>
import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue'
// import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue'
export default {
components: {
@ -13,14 +13,49 @@
},
data() {
return {
title:''
formHeader: [{
label: '来源库位',
field: 'fromLocationCode',
form:{
component:'Input',
componentProps: {
disabled: true
}
}
},{
label: '零件',
field: 'itemCode',
form:{
component:'Input',
componentProps: {
disabled: true
}
}
},{
label: '批次',
field: 'batch',
form:{
component:'Input',
componentProps: {
disabled: true
}
}
},{
label: '数量',
field: 'batch',
form:{
component:'Input',
componentProps: {
disabled: true
}
}
}]
}
},
onLoad(option) {
this.title = option.title
},
methods: {
}
methods: {}
}
</script>

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

@ -76,7 +76,7 @@
</view>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :locationCode='jobToLocationCode'></win-scan-pack>
<win-scan-button @goScan='openScanPopup' v-if="operation=='receipt'"></win-scan-button>
<!-- <winScanPackAndCont ref="scanPopup" @getResult='getScanResult'></winScanPackAndCont> -->
<comMessage ref="comMessage"></comMessage>
@ -117,6 +117,13 @@
calcTreeHandleQty
} from '@/common/detail.js';
import {
Decimal
} from 'decimal.js'; //
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndCont from '@/mycomponents/scan/winScanPackAndCont.vue'
@ -169,8 +176,7 @@
switchCode1: "",
isCheckLocation: 'purchaseReceiptLocationCodeValidate', //
reasonText: "",
packingNumberList:[],
// printDeafult: {}, //
// templateDeafult: {} //
};
@ -450,10 +456,10 @@
itemDetail.forEach(item => {
item.scaned = true;
itemDetail.scanDate = new Date();
item.handleQty = item.qty;
item.handleQty = calc.add(item.handleQty,result.label.qty)
item.toLocationCode = this.toLocationCode;
})
calcHandleQty(this.detailSource);
// calcHandleQty(this.detailSource);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
@ -483,10 +489,17 @@
if (pack == undefined) {
this.showMessage("批次【" + batch + "】不在列表中")
} else {
if (pack.scaned) {
let isScan = false
if(packingNumber){
isScan = this.packingNumberList.some(item=>item == packingNumber)
}else{
isScan = false
}
if (isScan) {
pack.scanDate = new Date();
this.showMessage("批次【" + batch + "】已经扫描");
this.showMessage("箱码【" + packingNumber + "】已经扫描");
} else {
this.packingNumberList.push(packingNumber)
pack.scaned = true
pack.scanDate = new Date();
pack.handleQty = Number(result.label.qty);
@ -507,24 +520,31 @@
scanedLength++;
}
})
if (itemDetail.scaned && scanedLength == itemDetail
.packList.length) {
let isScan = false
if(packingNumber){
isScan = this.packingNumberList.some(item=>item == packingNumber)
}else{
isScan = false
}
if (isScan) {
itemDetail.scanDate = new Date();
this.showMessage("批次【" + batch + "】已经扫描")
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
this.packingNumberList.push(packingNumber)
itemDetail.scaned = true;
itemDetail.scanDate = new Date();
itemDetail.handleQty = Number(result.label.qty);
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 = Number(pac.qty);
pac.handleQty = calc.add(pac.handleQty,result.label.qty);
pac.toLocationCode = this.toLocationCode;
})
calcTreeHandleQty(this.detailSource);
detail.handleQty = itemDetail.handleQty
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
@ -598,7 +618,7 @@
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
this.openScanPopup(this.jobToLocationCode);
}
});
}
@ -634,7 +654,6 @@
}
})
},
submitJob() {
uni.showLoading({
title: "提交中....",
@ -644,8 +663,6 @@
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
@ -888,7 +905,7 @@
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
this.$refs.scanPopup.openScanPopup(this.jobToLocationCode);
},
closeScanPopup() {

Loading…
Cancel
Save