Browse Source

YT-832客户退货,pda扫描任务报错

intex_online20241111
zhang_li 2 weeks ago
parent
commit
38887eb61a
  1. 2
      src/mycomponents/qty/balanceQtyEdit.vue
  2. 2
      src/mycomponents/qty/packUnit.vue
  3. 110
      src/pages/customerReturn/job/returnDetail.vue

2
src/mycomponents/qty/balanceQtyEdit.vue

@ -44,7 +44,7 @@
<view class="uni-flex uni-row space-between padding title u-col-center" v-if="queryBalance">
<text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
<text class="text_recommend" v-if="dataContent.balanceQty">{{Number(dataContent.balanceQty)}}</text>
<uom :uom="dataContent.uom"></uom>
</view>
</view>

2
src/mycomponents/qty/packUnit.vue

@ -1,5 +1,5 @@
<template>
<view class="std_pack" v-if="dataContent.packQty!=undefined">
<view class="std_pack" v-if="dataContent.packQty">
<text>
<!-- {{Number(dataContent.packQty)}}{{getUomInfo(dataContent.uom)}}/{{getPackUnitName(dataContent.packUnit)}} -->
<!-- {{getPackUnitName(dataContent.packUnit)}}({{Number(dataContent.packQty)}}{{getUomInfo(dataContent.uom)}}) -->

110
src/pages/customerReturn/job/returnDetail.vue

@ -80,6 +80,10 @@
getScanCount
} from '@/common/detail.js';
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
@ -246,7 +250,7 @@
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
this.$refs.scanPopup.openScanPopup( this.fromLocationCode );
},
closeScanPopup() {
@ -254,6 +258,52 @@
},
getScanResult(result) {
console.log(result)
this.managementType ==result.managementType
if(result.managementType == "BY_BATCH" || result.managementType == "BY_QUANTITY" ){
this.setDataBatch(result)
}else{
this.setData(result)
}
},
setDataBatch(result){
try {
var packingNumber = result.package.number;
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 {
console.log(366,batch)
console.log(366,detail.subList)
var itemDetail = detail.subList.find(r => {
return r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage( "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showErrorMessage("[" + packingNumber + "]" + "[" + batch + "]")
itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty)
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty)
itemDetail.packQty = Number(result.package.packQty)
itemDetail.packUnit = result.package.packUnit
this.calcHandleQty();
}
}
}
} catch (e) {
this.showMessage(e.message)
}
},
setData(result){
try {
var packingNumber = result.package.number;
var batch = result.label.batch;
@ -287,7 +337,6 @@
this.showMessage(e.message)
}
},
scanLocationCode(location, code) {
this.toLocationCode = code
this.detailSource.forEach(item => {
@ -310,12 +359,20 @@
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
if(this.managementType == "BY_BATCH" || this.managementType == "BY_QUANTITY" ){
this.checkCountBatch()
}else{
this.checkCount();
}
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
if(this.managementType == "BY_BATCH" || this.managementType == "BY_QUANTITY" ){
this.checkCountBatch()
}else{
this.checkCount();
}
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
@ -354,7 +411,51 @@
this.submitJob()
}
},
checkCountBatch(){
//
let str = ''
let str1 = ''
let str2 = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `批次【${cur.batch}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
if(cur.handleQty > cur.qty){
str1 = `批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以大于推荐数量【${cur.qty}`
}
if(cur.handleQty < cur.qty){
str2 = `批次【${cur.batch}】提交数量【${ cur.handleQty}】不可以小于推荐数量【${cur.qty}`
}
})
})
this.jobContent.allowBiggerQty = 'FALSE'
if(this.jobContent.allowBiggerQty == 'FALSE' &&str1){
this.$refs.comMessage.showConfirmWarningModal(str1)
return
}
if(this.jobContent.allowSmallerQty == 'FALSE' && str2){
this.$refs.comMessage.showConfirmWarningModal(str2)
return
}
if (str) {
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
this.submitJob()
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
@ -370,6 +471,7 @@
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
customerReturnJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {

Loading…
Cancel
Save