Browse Source

YT-573生产退料PDA不显示批次且扫描不上YT-499制品回收时,扫描箱标签时报错;要根据来源库位所在库区查询管理精度,根据管理精度查询库存余额

intex_online20241111
张立 4 months ago
parent
commit
7350388b4f
  1. 2
      src/api/request2.js
  2. 6
      src/common/label.js
  3. 114
      src/mycomponents/detail/comDetailCardBatch.vue
  4. 1
      src/mycomponents/scan/winScanPack.vue
  5. 21
      src/pages/deliver/coms/comScanDeliverPackBatch.vue
  6. 1323
      src/pages/deliver/job/deliverDetailBatch.vue
  7. 84
      src/pages/productRecycle/job/productRecycleJobDetail.vue
  8. 84
      src/pages/productionReturn/job/okToReturnDetail.vue

2
src/api/request2.js

@ -4302,7 +4302,7 @@ export function overPackageRecordSubmit(params) {
*
*/
export async function getManagementPrecision(params) {
return request({
return await request({
url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes",
method: "post",
data: params,

6
src/common/label.js

@ -105,6 +105,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
}
export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
let managementType = ""
let labelResult = analysisQRCodeLabel(labelItem, scanMsg);
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息
@ -114,7 +115,7 @@ export async function getLabelItems(labelItem, scanMsg, callBack,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'
managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
packingNumber = ''
}
@ -137,11 +138,12 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
callBack(labelResult);
})
} else {
console.log(999,labelResult)
//线边的物料可能没有箱码
labelResult.package = labelResult.label;
labelResult.package.number = packingNumber1 ? packingNumber1 : ''
labelResult.package.packingNumber=''
labelResult.managementType = managementType
console.log(999,labelResult)
callBack(labelResult);
// labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码';

114
src/mycomponents/detail/comDetailCardBatch.vue

@ -1,29 +1,27 @@
<template>
<view style="background-color: #fff;">
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
<view class="" v-for="(item,index) in dataContent.subList" :key="index" :class="item.scaned?'scan_view':''">
<uni-swipe-action ref="swipeAction" v-if='index==0'>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template>
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')" style='padding:0px 0px 5px 0px;align-items: center;'>
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" isShowPack='false'>
</recommend> -->
<div style="display: flex;">
<div style="flex: 1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></location>
</div>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</div>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance"
@confirm="confirm"></balance-qty-edit>
<view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
@ -31,20 +29,13 @@
</template>
<script>
import config from '@/static/config.js'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import {
getDetailOption,
getPurchaseReceiptOption,
getRemoveOption,
getEditRemoveOption
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
@ -53,10 +44,7 @@
itemCompareQty,
recommend,
balanceQtyEdit,
winScanLocation,
location,
toLocation,
batch,
winScanLocation
},
props: {
dataContent: {
@ -79,6 +67,15 @@
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: null
@ -91,10 +88,6 @@
type: Boolean,
default: true
},
isEdit: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
@ -109,8 +102,8 @@
})
}
},
immediate: true,
deep: true
}
@ -123,10 +116,7 @@
locatonItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
options: [],
removeOptions: [],
editAndRemoveOptions: []
scanOptions: []
}
},
@ -137,8 +127,7 @@
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
}
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
// this.showLocation();
},
@ -189,35 +178,6 @@
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
isDevlement() {
return config.isDevelopment;
},
copy(detail) {
console.log(detail)
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail
.batch + ";Q" + detail.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
// #endif
},
}
}
</script>

1
src/mycomponents/scan/winScanPack.vue

@ -49,7 +49,6 @@
type: String,
default: 'HPQ'
},
},
data() {
return {

21
src/pages/deliver/coms/comScanDeliverPackBatch.vue

@ -6,7 +6,7 @@
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描箱码
扫描箱码
</view>
<view class="">
@ -55,7 +55,7 @@
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
headerType="HPQ,HMQ" :isShowHistory="false" :locationCode='locationCode'>
</win-com-scan>
<view style="width: 100%;">
@ -152,6 +152,10 @@
type: String,
default: ''
},
locationCode:{
type: String,
default: ''
}
},
data() {
return {
@ -410,7 +414,7 @@
)
return;
}
if (this.toLocation && result.package.packUnit) {
if (this.toLocation) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
this.showErrorMessage('扫描物料代码不属于该任务');
@ -533,11 +537,12 @@
}
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
res => {
that.getfocus();
}
)
// that.showErrorMessage('' + packingCode + ',',
// res => {
// that.getfocus();
// }
// )
that.addRecord(batch, label, balance, packageInfo)
}
} else {

1323
src/pages/deliver/job/deliverDetailBatch.vue

File diff suppressed because it is too large

84
src/pages/productRecycle/job/productRecycleJobDetail.vue

@ -71,6 +71,10 @@
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
@ -366,20 +370,22 @@
if (itemDetail) {
//
if (itemDetail.scaned) {
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n已经扫描")
return;
// this.showErrorMessage("\n" + batch + "\n" + result
// .fromLocationCode + "\n" + balanceStatus + "\n")
itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.label.qty));
itemDetail.balanceQty = Number(result.label.qty);
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.handleQty = Number(result.label.qty);
itemDetail.balanceQty = Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
}
this.calcHandleQty();
} else {
//
itemDetail = detail.subList.find(r => {
@ -390,30 +396,44 @@
if (itemDetail) {
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
//
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续回收?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packQty = result.package.packQty
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} else {
if(balanceStatus!=itemStatus){
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续回收?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packQty = result.package.packQty
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许回收!', res => {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许回收!', res => {
this.scanPopupGetFocus();
});
});
}
//
}else{
itemDetail.scaned = true;
itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packQty = result.package.packQty
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
}
} else {
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中")
@ -492,6 +512,7 @@
checkCountBatch(){
//
let str = ''
let str1 = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
@ -503,10 +524,17 @@
}
str += `物料号【${item.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
if(cur.handleQty > cur.balance.qty){
str1 += `物料号【${item.itemCode}】提交数量【${cur.handleQty}】不可以大于库存数量【${cur.balance.qty}`
}
})
})
if (str1) {
this.$refs.comMessage.showMessage(str1);
return
}
if (str) {
str = '任务明细未全部完成,是否提交?\n'+str
str = '任务明细未全部完成,是否提交?\n'+ str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()

84
src/pages/productionReturn/job/okToReturnDetail.vue

@ -66,7 +66,9 @@
getManagementPrecisions
} from '@/common/balance.js';
import {
calc
} from '@/common/calc'
import {
getDataSource,
createRecordInfo,
@ -256,7 +258,7 @@
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
this.$refs.scanPopup.openScanPopup(this.fromLocationCode);
// let fromlocationCode = '';
// let fromlocationList = [];
// for (var i = 0; i < this.detailSource.length; i++) {
@ -282,6 +284,79 @@
getScanResult(result) {
this.managementType = result.managementType
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
this.setDataBatch(result)
} else {
this.setData(result)
}
},
setDataBatch(result){
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showErrorMessage("[" + batch + "]")
itemDetail.handleQty =calc.add(itemDetail.handleQty,Number(result.package.qty))
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.package.qty)
itemDetail.inventoryStatus = "OK"
itemDetail.packQty = result.package.packQty
itemDetail.packUnit = result.package.packUnit
//退,退000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
// '],?', res => {
// if (res) {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// } else {
// this.scanPopupGetFocus();
// }
// });
// } else {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// }
}
this.calcHandleQty();
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
setData(result){
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
@ -306,8 +381,8 @@
itemDetail.packQty = result.package.packQty
itemDetail.packUnit = result.package.packUnit
this.calcHandleQty();
//退,退000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
@ -400,6 +475,7 @@
itemCode: itemCodes,
locationCode: this.toLocationCode
}
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;

Loading…
Cancel
Save