Browse Source

采购收货功能变更

intex
zhang_li 1 week ago
parent
commit
f189938e6e
  1. 3
      src/common/detail.js
  2. 18
      src/common/label.js
  3. 19
      src/mycomponents/package/packageCard.vue
  4. 32
      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. 3
      src/pages/issue/job/issueDetail.vue
  9. 14
      src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
  10. 345
      src/pages/purchaseReceipt/job/receiptDetail.vue

3
src/common/detail.js

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

18
src/common/label.js

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

19
src/mycomponents/package/packageCard.vue

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

32
src/mycomponents/package/packageList.vue

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

4
src/mycomponents/qty/recommendQty.vue

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

9
src/mycomponents/scan/winComScan.vue

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

8
src/mycomponents/scan/winScanPack.vue

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

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

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

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

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

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

@ -5,7 +5,7 @@
<view class="header_job_top"> <view class="header_job_top">
<jobTopAsn :dataContent="jobContent"></jobTopAsn> <jobTopAsn :dataContent="jobContent"></jobTopAsn>
</view> </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;"> style=";margin-top: 10rpx; margin-left: 10rpx; text-align: right;">
<view class="font_default" style="display: block; "> <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="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<!-- 管理精度是批次 --> <!-- 管理精度是批次 -->
<comReceiptDetailCardBacth :dataContent="item" :index="index" :settingParam="jobContent" <comReceiptDetailCardBacth ref='comReceiptDetailCardBacthRef' :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' @remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
v-if="managementType == 'BY_BATCH' || managementType =='BY_QUANTITY'"> v-if="managementType == 'BY_BATCH' || managementType =='BY_QUANTITY'">
</comReceiptDetailCardBacth> </comReceiptDetailCardBacth>
@ -178,8 +178,10 @@
reasonText: "", reasonText: "",
packingNumberList:[], packingNumberList:[],
source_type:'', source_type:'',
idValue:0
// printDeafult: {}, // // printDeafult: {}, //
// templateDeafult: {} // // templateDeafult: {} //
}; };
}, },
@ -319,11 +321,8 @@
}, },
getScanResult(result) { getScanResult(result) {
this.balanceInfo = result.balance this.balanceInfo = result.balance
console.log(this.managementType) if(this.managementType == 'BY_BATCH'||this.managementType == 'BY_QUANTITY'){
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)
} }
@ -439,6 +438,7 @@
}, },
// //
getScanResultAfterBatch(result){ getScanResultAfterBatch(result){
console.log(222,result)
try { try {
var itemCode = result.label.itemCode; var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
@ -469,7 +469,7 @@
} }
} }
} else if (result.label.labelType == "PurchaseLabel") { } else if (result.label.labelType == "PurchaseLabel") {
debugger // debugger
var packingNumber = result.package.number; var packingNumber = result.package.number;
var parentpackingNumber = result.package.parentNumber; var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch; var batch = result.label.batch;
@ -479,218 +479,84 @@
this.showMessage("物料号【" + itemCode + "】不在列表中") this.showMessage("物料号【" + itemCode + "】不在列表中")
} else { } else {
// //
var itemDetail = detail.subList.find(r => r.batch == const batchDetailList = detail.subList.filter(r => r.batch ==
batch); batch);
if (itemDetail == undefined) { if (!batchDetailList || batchDetailList && batchDetailList.length == 0) {
itemDetail = detail.subList.find(r => r.batch ==
batch);
if (itemDetail == undefined) {
this.showMessage("批次【" + batch + "】不在列表中") this.showMessage("批次【" + batch + "】不在列表中")
} else { } else {
var pack = itemDetail.packList.find(p => //
p.batch == batch) var isHavePackingNumber =this.packingNumberList.find(r => r.packingNumber == packingNumber);
if (pack == undefined) { if(isHavePackingNumber){
this.showMessage("批次【" + batch + "】不在列表中") this.showMessage("箱码【" + packingNumber + "】已经扫描");
} else { return
let isScan = false }
if(packingNumber){ for(let i = 0 ; i <batchDetailList.length;i++){
isScan = this.packList.some(item=>item == packingNumber) //
}else{ let packAllHandleQty = new Decimal(0).toNumber()
isScan = false batchDetailList[i].packList.forEach(pack=>{
} pack.handleQty =pack.handleQty? pack.handleQty :0
if (isScan) { packAllHandleQty = calc.add(packAllHandleQty,pack.handleQty)
pack.scanDate = new Date(); })
// this.showMessage("" + packingNumber + ""); //
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.toLocationCode = this.toLocationCode;
pack.labelQty = Number(result.label.qty); 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)
}
calcTreeHandleQty(this.detailSource);
break
}else{
//
if(handleQtySub != 0){
//
if(batchDetailList.length-1 == i){
pack.handleQty = qty;
}else{
//
pack.handleQty = handleQtySub;
}
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);
}
} }
}
calcHandleQty(this.detailSource);
itemDetail.packList.sort(compareDesc('scanDate')); //
this.$forceUpdate()
}
} else {
//,
var scanedLength = 0;
itemDetail.packList.forEach(res => {
if (res.scaned) {
scanedLength++;
}
})
let isScan = false
if(packingNumber){
isScan = this.packingNumberList.some(item=>item == packingNumber)
}else{
isScan = false
} }
if (isScan) { console.log(8777,this.detailSource)
itemDetail.scanDate = new Date();
// this.showMessage("" + packingNumber + "") setTimeout(()=>{
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty) this.$refs.comReceiptDetailCardBacthRef.forEach(item=>{
} else { item.resizeCollapse()
this.packingNumberList.push(packingNumber)
itemDetail.scaned = true; item.$refs.packageListRef.$refs.collapse2.forEach(cur=>{
itemDetail.scanDate = new Date(); cur.resize()
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 },500)
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
}
calcHandleQty(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;
})
// 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);
// }
} }
} }
@ -708,12 +574,20 @@
} }
}, },
updateData() { updateData(ele,index) {
// if(this.managementType == 'BY_BATCH'){ // if(this.managementType == 'BY_BATCH'){
// }else{ // }else{
// calcTreeHandleQty(this.detailSource) // 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) { scanLocationCode(location, code) {
@ -737,6 +611,8 @@
}, },
commit() { commit() {
this.scanCount = getScanCount(this.detailSource);
console.log(this.scanCount )
if (this.scanCount == 0) { if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描") this.showErrorMessage("扫描数为0,请先扫描")
return; return;
@ -794,9 +670,35 @@
// //
checkBatch(){ checkBatch(){
// //
const scanCount1 = this.detailSource let str = ''
const current = this.detailSource.find(item=> item.handleQty<item.qty) let str1 = ''
if(current){ 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") { if (this.jobContent.allowPartialComplete == "TRUE") {
// //
@ -854,7 +756,6 @@
var params = this.setParams(); var params = this.setParams();
let that = this let that = this
console.log(877,params) console.log(877,params)
// return;
purchaseReceiptJobSubmit(params).then(res => { purchaseReceiptJobSubmit(params).then(res => {
if (res.data) { if (res.data) {
@ -868,6 +769,7 @@
}) })
}else if(!isCheckPrint1 && !isCheckPrint){ }else if(!isCheckPrint1 && !isCheckPrint){
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number) this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number)
uni.hideLoading()
}else if(that.source_type!='TOOL'&&that.source_type!='Develop'){ }else if(that.source_type!='TOOL'&&that.source_type!='Develop'){
// if (res.data == '') { // if (res.data == '') {
// this.showCommitSuccessMessage(res.data) // this.showCommitSuccessMessage(res.data)
@ -977,13 +879,15 @@ console.log(8787,this.detailSource)
pack.handleQty = 0 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); var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber; obj.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber; obj.packingNumber = info.packingNumber;
detail.formPackingNumber = info.packingNumber; obj.formPackingNumber = info.packingNumber;
detail.toBatch = info.batch; obj.toBatch = info.batch;
subList.push(detail) subList.push(obj)
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
@ -1093,7 +997,8 @@ console.log(8787,this.detailSource)
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(this.jobToLocationCode); //
this.$refs.scanPopup.openScanPopup(this.jobToLocationCode,true);
}, },
closeScanPopup() { closeScanPopup() {

Loading…
Cancel
Save