lijuncheng 1 week ago
parent
commit
8357613ff3
  1. 3
      src/common/detail.js
  2. 16
      src/common/label.js
  3. 19
      src/mycomponents/package/packageCard.vue
  4. 26
      src/mycomponents/package/packageList.vue
  5. 4
      src/mycomponents/qty/recommendQty.vue
  6. 9
      src/mycomponents/scan/winComScan.vue
  7. 8
      src/mycomponents/scan/winScanPack.vue
  8. 22
      src/pages/inventoryMove/coms/comMoveRecord.vue
  9. 3
      src/pages/issue/job/issueDetail.vue
  10. 14
      src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
  11. 338
      src/pages/purchaseReceipt/job/receiptDetail.vue

3
src/common/detail.js

@ -141,6 +141,7 @@ export function createRecordInfo(detail, balance) {
//计算实际数量
export function calcHandleQty(detailSource) {
console.log(999,detailSource)
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
@ -190,6 +191,8 @@ export function calcTreeHandleQty(detailSource) {
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}
}else{
detail.handleQty = new Decimal(0).toNumber();
}
if(detail.handleQty){
item.handleQty = calc.add(item.handleQty, detail.handleQty);

16
src/common/label.js

@ -14,7 +14,7 @@ import {
getManagementPrecisions
} from '@/common/balance.js';
export function getLabelInfo(scanMsg, headerType, callBack,locationCode) {
export function getLabelInfo(scanMsg, headerType, callBack,locationCode,isHavePackNumber) {
if (scanMsg.length == 0) {
return null
}
@ -42,17 +42,17 @@ export function getLabelInfo(scanMsg, headerType, callBack,locationCode) {
let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode
{
getQRCodeInfo(header, version, scanMsg, callBack,locationCode);
getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber);
}
// else if (type == 'B') //barcode
// {
// getBarCodeInfo(header, version, items[2], callBack);
// }
else { //直接输入文本
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
}
} else {
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
// let labelResult = {
// label: {
// labelType: "",
@ -67,7 +67,7 @@ export function getLabelInfo(scanMsg, headerType, callBack,locationCode) {
}
}
export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber) {
//获取包装信息
let labelItem = labelDic.find(r => r.header == header && r.version == version);
if (labelItem == undefined) {
@ -92,7 +92,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
};
labelDic.push(newItem);
getLabelItems(newItem, scanMsg, callBack,locationCode);
getLabelItems(newItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}).catch(err => {
labelResult.success = false;
@ -100,7 +100,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
callBack(err);
})
} else {
getLabelItems(labelItem, scanMsg, callBack,locationCode);
getLabelItems(labelItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}
@ -117,9 +117,11 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
const managementList = res.list;
managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
if(!isHavePackNumber){
packingNumber = ''
}
}
}
})
}
if (packingNumber != undefined && packingNumber != '') {

19
src/mycomponents/package/packageCard.vue

@ -6,7 +6,8 @@
<view style="word-break: break-all;">
<!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber">
</container> -->
<pack :packingCode="dataContent.packingNumber"></pack>
<pack :packingCode="dataContent.packingNumber" :isShowPackingNumberProps='isShowPackingNumberProps'></pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location>
@ -19,12 +20,12 @@
<recommend-qty v-if="dataContent.handleQty==null || dataContent.handleQty==undefined" :dataContent="dataContent"
:isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" :isShowStatus="isShowStatus">
:handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" :isShowStatus="isShowStatus" :isShowRecommendQty='isShowRecommendQty'>
</compare-qty>
<view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
<!-- <view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
<text style="font-size: 25rpx;color: #2979ff; width: 45rpx; " @click="copy">复制</text>
</view>
</view> -->
</view>
</view>
</view>
@ -90,7 +91,15 @@
type: String,
default: '库位'
},
//
isShowPackingNumberProps:{
type:Boolean,
default:false
},
isShowRecommendQty: {
type: Boolean,
default: true
}
},
watch: {
//

26
src/mycomponents/package/packageList.vue

@ -2,12 +2,12 @@
<view class="">
<view class="" v-for="(item,index) in dataContent" :key="item.id">
<uni-collapse ref="collapse2" @change="collapseChange" >
<uni-collapse-item :disabled="false">
<uni-collapse-item :disabled="false" :open="true">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')">
@click="swipeClick($event,item,'parent',index)">
<package-card :dataContent="item" :isShowLocation="false"
:isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus"></package-card>
@ -19,11 +19,12 @@
style=" width: 100%; background-color: antiquewhite;">
<uni-swipe-action>
<uni-swipe-action-item
:right-options="(pack.scaned&&isEdit)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack,'child')">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false"
:right-options="(pack.scaned)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack,'child',index,item)">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false" :isShowPackingNumberProps='isShowPackingNumberProps'
:isShowToLocation="false"
:isShowStatus="isShowPackListStatus"
:isShowRecommendQty='false'
:isShowBatch="false"></package-card>
</uni-swipe-action-item>
</uni-swipe-action>
@ -113,6 +114,11 @@
isEdit: {
type: Boolean,
default: false
},
//
isShowPackingNumberProps:{
type:Boolean,
default:false
}
},
@ -120,14 +126,14 @@
},
methods: {
swipeClick(e, item, type) {
swipeClick(e, item, type,index,ele) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
if (type == 'parent') {
this.removeParent(item);
} else {
this.remove(item)
this.remove(item,index,ele)
}
}
},
@ -150,13 +156,14 @@
remove(item) {
remove(item,index,ele) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.handleQty = null;
this.$emit('updateData')
this.collapseChange()
this.$emit('updateData',ele,index)
this.$forceUpdate()
}
});
@ -164,6 +171,7 @@
edit(item) {
this.editItem = item;
console.log(777,item)
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
},
collapseChange() {

4
src/mycomponents/qty/recommendQty.vue

@ -1,10 +1,10 @@
<template>
<view>
<status v-if="isShowStatus" :status='dataContent.inventoryStatus'></status>
<status v-if="isShowStatus && dataContent.inventoryStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center" v-if="isShowCount" >
<view class="text_recommend ">
{{Number(dataContent.qty)}}
{{Number(dataContent.qty) ? Number(dataContent.qty) : ''}}
</view>
<!-- /{{Number(dataContent.packQty)}} -->
<!-- v-show="!isShowStdPack" -->

9
src/mycomponents/scan/winComScan.vue

@ -92,7 +92,12 @@
locationCode:{
type: String,
default: ''
}
},
//
isHavePackNumber: {
type: Boolean,
default: false
},
},
data() {
return {
@ -195,7 +200,7 @@
}
})
}
},this.locationCode);
},this.locationCode,this.isHavePackNumber);
}, 200);
}
},

8
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" :locationCode='locationCode'></win-com-scan>
:isShowHistory="isShowHistory" :clearResult="true" :locationCode='locationCode' :isHavePackNumber='isHavePackNumber'></win-com-scan>
</view>
</view>
</view>
@ -53,7 +53,8 @@
data() {
return {
show: false,
locationCode:''
locationCode:'',
isHavePackNumber:false,//
}
},
created() {
@ -70,9 +71,10 @@
})
},
openScanPopup(locationCode1) {
openScanPopup(locationCode1,isHavePackNumber) {
this.$refs.popup.open('bottom')
this.locationCode = locationCode1
this.isHavePackNumber = isHavePackNumber
setTimeout(res => {
this.getfocus()
}, 500)

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

@ -389,6 +389,16 @@
return res
}
})
// 0
if(!balance.qty){
this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]库存余额数量是0")
return
}
//
if(result.label.qty > balance.qty){
this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]数量[" + result.label.qty + "]不可以大于库存余额数量[" + balance.qty + "]")
return
}
if (item == undefined) {
var itemp = createItemInfoForLabel(balance, result.label);
let newDetail = createDetailInfoForLabel(balance, pack, result.label);
@ -406,6 +416,8 @@
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode
newDetail.handleQty = Number(result.label.qty)
newDetail.packQty = balance.packQty;
newDetail.packUnit = balance.packUnit;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
@ -414,7 +426,6 @@
this.$refs.okToHoldRecordPackRef.showOne = false
} else {
var detail = ''
console.log(9988,managementTypeParams)
if(managementTypeParams == 'BY_QUANTITY'){
detail = item.subList.find(r => {
if (r.fromLocationCode == balance.locationCode &&
@ -447,6 +458,9 @@
newDetail.toLocationCode = this.toLocationCode;
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode
newDetail.handleQty = result.label.qty
newDetail.packQty = balance.packQty;
newDetail.packUnit = balance.packUnit;
item.subList.push(newDetail);
this.clearFromLocation()
this.$refs.okToHoldRecordPackRef.handleQty = 0
@ -456,11 +470,11 @@
// detail.handleQty =calc.add(detail.handleQty, result.label.qty)
if(managementTypeParams == 'BY_QUANTITY'){
this.showErrorMessage(
"批次[]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"物料号[" + item.itemCode + "]\n" + "批次[]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"已经存在")
}else if(managementTypeParams == 'BY_BATCH'){
this.showErrorMessage(
"批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"物料号[" + item.itemCode + "]\n" + "批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"已经存在")
}
}
@ -596,7 +610,7 @@
console.log("提交" ,params)
let obj = params.subList.find(item=>item.balanceQty < item.handleQty)
if(obj){
this.$refs.comMessage.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
this.$refs.comMessage.showConfirmWarningModal('物料号[' +obj.itemCode + ']批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
uni.hideLoading()
return
}

3
src/pages/issue/job/issueDetail.vue

@ -223,8 +223,7 @@
getManagementPrecisions(itemCodes, that.fromLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
}
})
setTimeout(r => {

14
src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue

@ -1,7 +1,7 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<uni-collapse-item :open="true" @change="resizeCollapse">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item :right-options="dataContent.handleQty>0? removeOptions:options"
@ -11,9 +11,9 @@
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'"
<package-list ref='packageListRef' :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'"
:settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData"
:isShowFromLocation="false"></package-list>
:isShowFromLocation="false" :isShowPackingNumberProps='true'></package-list>
</uni-collapse-item>
</uni-collapse>
@ -117,9 +117,9 @@
},
resizeCollapse() {
this.$nextTick(r => {
setTimeout(() => {
this.$refs.collapse.resize()
});
}, 500)
this.$forceUpdate();
},
@ -200,8 +200,8 @@
this.editItem.handleQty = qty;
this.$emit('updateData')
},
updateData() {
this.$emit('updateData')
updateData(index,packList) {
this.$emit('updateData',index,packList)
}
}
}

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

@ -5,7 +5,7 @@
<view class="header_job_top">
<jobTopAsn :dataContent="jobContent"></jobTopAsn>
</view>
<view v-if="operation=='receipt'" class="uni-flex uni-row "
<view v-if="operation=='receipt' && (managementList == 'BY_BATCH' || managementType == 'BY_QUANTITY')" class="uni-flex uni-row "
style=";margin-top: 10rpx; margin-left: 10rpx; text-align: right;">
<view class="font_default" style="display: block; ">
整单收货
@ -32,7 +32,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<!-- 管理精度是批次 -->
<comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent"
<comReceiptDetailCardBacth ref='comReceiptDetailCardBacthRef' :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
v-if="managementType == 'BY_BATCH' || managementType =='BY_QUANTITY'">
</comReceiptDetailCardBacth>
@ -178,8 +178,10 @@
reasonText: "",
packingNumberList:[],
source_type:'',
idValue:0
// printDeafult: {}, //
// templateDeafult: {} //
};
},
@ -192,9 +194,6 @@
this.source_type = option.source_type;
this.switchCode = "purchasereceiptPrintPDA" //PDA
this.switchCode1 = "EnableQms" //QMSTRUEFALSE
},
onShow() {
if (this.id != undefined) {
//
if (this.status == "1") {
@ -206,6 +205,10 @@
}
}
},
onShow() {
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
@ -319,11 +322,8 @@
},
getScanResult(result) {
this.balanceInfo = result.balance
console.log(this.managementType)
if(this.managementType == 'BY_BATCH'){
if(this.managementType == 'BY_BATCH'||this.managementType == 'BY_QUANTITY'){
this.getScanResultAfterBatch(result)
}else if(this.managementType == 'BY_QUANTITY' ){
this.getScanResultAfterQuantity(result)
}else{
this.getScanResultAfter(result)
}
@ -439,6 +439,7 @@
},
//
getScanResultAfterBatch(result){
console.log(222,result)
try {
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
@ -469,7 +470,7 @@
}
}
} else if (result.label.labelType == "PurchaseLabel") {
debugger
// debugger
var packingNumber = result.package.number;
var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch;
@ -479,218 +480,84 @@
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
//
var itemDetail = detail.subList.find(r => r.batch ==
batch);
if (itemDetail == undefined) {
itemDetail = detail.subList.find(r => r.batch ==
const batchDetailList = detail.subList.filter(r => r.batch ==
batch);
if (itemDetail == undefined) {
this.showMessage("批次【" + batch + "】不在列表中")
} else {
var pack = itemDetail.packList.find(p =>
p.batch == batch)
if (pack == undefined) {
if (!batchDetailList || batchDetailList && batchDetailList.length == 0) {
this.showMessage("批次【" + batch + "】不在列表中")
} else {
let isScan = false
if(packingNumber){
isScan = this.packList.some(item=>item == packingNumber)
}else{
isScan = false
//
var isHavePackingNumber =this.packingNumberList.find(r => r.packingNumber == packingNumber);
if(isHavePackingNumber){
this.showMessage("箱码【" + packingNumber + "】已经扫描");
return
}
if (isScan) {
pack.scanDate = new Date();
// this.showMessage("" + packingNumber + "");
for(let i = 0 ; i <batchDetailList.length;i++){
//
let packAllHandleQty = new Decimal(0).toNumber()
batchDetailList[i].packList.forEach(pack=>{
pack.handleQty =pack.handleQty? pack.handleQty :0
packAllHandleQty = calc.add(packAllHandleQty,pack.handleQty)
})
//
let handleQtySub = calc.sub(parseFloat(batchDetailList[i].qty),parseFloat(packAllHandleQty))
let pack = {}
pack.packingNumber =packingNumber
pack.packQty = result.package.packQty
pack.packUnit = result.package.packUnit
pack.qty = batchDetailList[i].qty
pack.handleQty = calc.add(pack.handleQty,result.label.qty)
} else {
this.packList.push(packingNumber)
pack.packList.push(packingNumber)
pack.scaned = true
pack.scanDate = new Date();
pack.handleQty = Number(result.label.qty);
pack.toLocationCode = this.toLocationCode;
pack.labelQty = Number(result.label.qty);
}
}
calcHandleQty(this.detailSource);
itemDetail.packList.sort(compareDesc('scanDate')); //
this.$forceUpdate()
}
} else {
//,
var scanedLength = 0;
itemDetail.packList.forEach(res => {
if (res.scaned) {
scanedLength++;
pack.labelQty = Number(qty);
pack.scaned = true;
//
if(handleQtySub >= parseFloat(qty)){
pack.handleQty = Number(qty);
batchDetailList[i].packList.push(pack)
batchDetailList[i].scaned = true
const isHave = this.packingNumberList.find(item=>item.packingNumber == packingNumber)
if(!isHave){
this.packingNumberList.push(pack)
}
})
let isScan = false
if(packingNumber){
isScan = this.packingNumberList.some(item=>item == packingNumber)
calcTreeHandleQty(this.detailSource);
break
}else{
isScan = false
}
if (isScan) {
itemDetail.scanDate = new Date();
// this.showMessage("" + packingNumber + "")
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
//
if(handleQtySub != 0){
//
if(batchDetailList.length-1 == i){
pack.handleQty = 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()
//
pack.handleQty = handleQtySub;
}
calcHandleQty(this.detailSource);
batchDetailList[i].packList.push(pack)
batchDetailList[i].scaned = true
qty = calc.sub(parseFloat(qty),parseFloat(handleQtySub))
//
const isHave = this.packingNumberList.find(item=>item.packingNumber == packingNumber)
if(!isHave){
this.packingNumberList.push(pack)
}
calcTreeHandleQty(this.detailSource);
}
}
} catch (e) {
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;
console.log(8777,this.detailSource)
setTimeout(()=>{
this.$refs.comReceiptDetailCardBacthRef.forEach(item=>{
item.resizeCollapse()
item.$refs.packageListRef.$refs.collapse2.forEach(cur=>{
cur.resize()
})
// 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 + "");
})
},500)
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);
// }
}
}
@ -708,12 +575,20 @@
}
},
updateData() {
updateData(ele,index) {
// if(this.managementType == 'BY_BATCH'){
// }else{
// calcTreeHandleQty(this.detailSource)
// }
calcHandleQty(this.detailSource);
if(ele){
ele.packList.splice(index,1)
if(ele.packList.length == 0){
ele.scaned = false
}
this.packingNumberList.splice(index,1)
}
calcTreeHandleQty(this.detailSource);
},
scanLocationCode(location, code) {
@ -737,6 +612,8 @@
},
commit() {
this.scanCount = getScanCount(this.detailSource);
console.log(this.scanCount )
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
@ -794,9 +671,35 @@
//
checkBatch(){
//
const scanCount1 = this.detailSource
const current = this.detailSource.find(item=> item.handleQty<item.qty)
if(current){
let str = ''
let str1 = ''
var scanCount=0;
this.detailSource.forEach((item) => {
item.subList.forEach(cur=>{
if(cur.scaned){
scanCount++;
if(parseFloat(cur.qty)>parseFloat(cur.handleQty)){
str += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}\n`
}
if(parseFloat(cur.qty)<parseFloat(cur.handleQty)){
str1 += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于任务数量【${cur.qty}\n`
}
}
})
})
if(this.jobContent.allowBiggerQty == "FALSE"){
if(str1){
this.$refs.comMessage.showErrorMessage(str1);
return;
}
}
if(this.jobContent.allowSmallerQty == "FALSE"){
if(str){
this.$refs.comMessage.showErrorMessage(str);
return;
}
}
if(this.scanCount < this.subList.length){
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
@ -854,7 +757,6 @@
var params = this.setParams();
let that = this
console.log(877,params)
// return;
purchaseReceiptJobSubmit(params).then(res => {
if (res.data) {
@ -868,6 +770,7 @@
})
}else if(!isCheckPrint1 && !isCheckPrint){
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number)
uni.hideLoading()
}else if(that.source_type!='TOOL'&&that.source_type!='Develop'){
// if (res.data == '') {
// this.showCommitSuccessMessage(res.data)
@ -977,13 +880,15 @@ console.log(8787,this.detailSource)
pack.handleQty = 0
}
})
detail.toLocationCode = this.toLocationCode ? this.toLocationCode :this.jobToLocationCode
let obj = {...detail}
obj.packList = []
obj.toLocationCode = this.toLocationCode ? this.toLocationCode :this.jobToLocationCode
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber;
detail.formPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
subList.push(detail)
obj.toPackingNumber = info.packingNumber;
obj.packingNumber = info.packingNumber;
obj.formPackingNumber = info.packingNumber;
obj.toBatch = info.batch;
subList.push(obj)
})
})
this.jobContent.subList = subList
@ -1093,7 +998,8 @@ console.log(8787,this.detailSource)
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup(this.jobToLocationCode);
//
this.$refs.scanPopup.openScanPopup(this.jobToLocationCode,true);
},
closeScanPopup() {

Loading…
Cancel
Save