Browse Source

修改补料任务

hella_vue3
niexiting 8 months ago
parent
commit
244c2042c9
  1. 2
      src/mycomponents/balance/balance.vue
  2. 13
      src/mycomponents/balance/handleBalance.vue
  3. 6
      src/pages/repleinsh/coms/comRepleishDetailCard.vue
  4. 134
      src/pages/repleinsh/coms/comScanReplishPack.vue
  5. 49
      src/pages/repleinsh/job/repleinshDetail.vue

2
src/mycomponents/balance/balance.vue

@ -14,7 +14,7 @@
<qty v-if="dataContent.handleQty==0 || dataContent.handleQty==undefined" :dataContent="dataContent"
:isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number( dataContent.qty)"
:handleQty="Number (dataContent.handleQty)" :isShowStdPack="isShowStdPack">
:handleQty="Number (dataContent.handleQty)" :isShowStdPack="isShowStdPack" :isShowStatus='isShowStatus'>
</compare-qty>
<view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>

13
src/mycomponents/balance/handleBalance.vue

@ -1,16 +1,16 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="space_between center" >
<view class="space_between center">
<view style="word-break: break-all;width: 60%;">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
<view style="word-break: break-all;">
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail"
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail" :isShowStatus='isShowStatus'
:isShowStdPack="false"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty"
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty" :isShowStatus='isShowStatus'
:isShowStdPack="false">
</compare-qty>
</view>
@ -56,7 +56,10 @@
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
},
},
watch: {
@ -77,4 +80,4 @@
opacity: 1;
}
</style>
</style>

6
src/pages/repleinsh/coms/comRepleishDetailCard.vue

@ -31,8 +31,12 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
<view class="card_view">
<text class="card_packing_code card_content ">外包装</text>
<text class="card_content ">{{record.parentPackingNumber}}</text>
</view>
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
:isShowBatch="batch.packingNumber!=null" :isShowStatus='true'>
</handle-balance>
</uni-swipe-action-item>
</uni-swipe-action>

134
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -69,7 +69,7 @@
<uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions">
<view style="padding: 0px 10px">
<balance :dataContent="record" :isShowFromLocation="false"
<balance :dataContent="record" :isShowFromLocation="false" :isShowStatus='true'
:isShowStdPack="false"></balance>
</view>
</uni-swipe-action-item>
@ -104,10 +104,10 @@
import {
getWorkShopLineStation
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
calc
} from '@/common/calc.js';
import {
getBalanceByManagementPrecision
@ -242,30 +242,33 @@
)
return;
} else {
//
uni.showLoading({
title: '加载中',
mask: true
})
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
balanceRes => {
if (balanceRes.success) {
if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
res => {
this.packGetFocus();
})
} else if (balanceRes.data.list.length == 1) {
let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.showBalanceSelect(balanceRes.data.list);
}
} else {
this.showErrorMessage(balanceRes.message.message);
}
uni.hideLoading();
});
this.afterGetBalance(result.label, result.label, packageInfo);
// //
// uni.showLoading({
// title: '',
// mask: true
// })
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
// balanceRes => {
// if (balanceRes.success) {
// if (balanceRes.data.list.length == 0) {
// this.showErrorMessage('[' + this.fromLocationCode + '],',
// res => {
// this.packGetFocus();
// })
// } else if (balanceRes.data.list.length == 1) {
// let balance = balanceRes.data.list[0];
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(balanceRes.data.list);
// }
// } else {
// this.showErrorMessage(balanceRes.message.message);
// }
// uni.hideLoading();
// });
}
} catch (e) {
this.showErrorMessage(e.stack)
@ -297,11 +300,11 @@
if (batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo)
that.addRecord(batch, label, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance, packageInfo);
that.addRecord(batch, label, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
@ -311,7 +314,7 @@
}
}
} else {
that.addRecord(batch, label, balance, packageInfo)
that.addRecord(batch, label, packageInfo)
}
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
@ -325,8 +328,8 @@
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发料明细,是否要继续发料?', res => {
if (res) {
let batch = that.createBatchInfo(label, balance,packageInfo);
if(fromLocation.Batchs.length>0){
let batch = that.createBatchInfo(label, balance, packageInfo);
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch);
@ -355,7 +358,7 @@
}
},
createBatchInfo(data, balance,packageInfo) {
createBatchInfo(data, balance, packageInfo) {
let batch = {
batch: data.batch,
qty: 0,
@ -363,54 +366,75 @@
handleQty: Number(data.qty),
Records: []
}
let record = this.creatRecord(data, balance,packageInfo);
let record = this.creatRecord(data, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
return batch;
},
creatRecord(label, balance, packageInfo) {
balance.packQty = packageInfo.packQty
balance.packUnit = packageInfo.packUnit
creatRecord(label, packageInfo) {
let record = {
scaned: true,
itemCode: label.itemCode,
packingNumber: label.packingNumber,
parentPackingNumber: packageInfo.parentNumber,
batch: label.batch,
qty: Number(balance.qty),
qty: Number(label.qty),
// qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
uom: label.uom,
inventoryStatus: "OK",
balance: null,
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode
}
return record;
},
// creatRecord(label, balance, packageInfo) {
// balance.packQty = packageInfo.packQty
// balance.packUnit = packageInfo.packUnit
// let record = {
// scaned: true,
// itemCode: label.itemCode,
// packingNumber: label.packingNumber,
// batch: label.batch,
// qty: Number(balance.qty),
// // qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty),
// uom: balance.uom,
// inventoryStatus: balance.inventoryStatus,
// balance: balance,
// toLocationCode: this.toLocationCode,
// supplierCode: label.supplierCode
// }
// return record;
// },
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty = calc.add(handleQty,res.qty)
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
this.dataContent.forEach(toLocationCode=>{
toLocationCode.Items.forEach(item=>{
var itemCodeHandleQty =0;
item.Locations.forEach(batch=>{
batch.Batchs.forEach(batchHandleQty=>{
itemCodeHandleQty=calc.add(itemCodeHandleQty,batchHandleQty.handleQty)
this.dataContent.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
var itemCodeHandleQty = 0;
item.Locations.forEach(batch => {
batch.Batchs.forEach(batchHandleQty => {
itemCodeHandleQty = calc.add(itemCodeHandleQty,
batchHandleQty.handleQty)
})
})
item.handleQty=itemCodeHandleQty;
item.handleQty = itemCodeHandleQty;
})
})
},
addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance, packageInfo);
addRecord(batch, label, packageInfo) {
let record = this.creatRecord(label, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
@ -528,4 +552,4 @@
max-height: 300rpx;
padding: 10rpx;
}
</style>
</style>

49
src/pages/repleinsh/job/repleinshDetail.vue

@ -298,8 +298,8 @@
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
// record.fromPackingNumber = r
// .packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
@ -311,25 +311,40 @@
record.toLocationCode = this
.toLocationCode;
record.supplierCode = r.supplierCode;
//使
if (this.jobContent
.useOnTheWayLocation ==
'TRUE') {
if(record.parentPackingNumber!='')
{
record.fromPackingNumber = record.parentPackingNumber;
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info =
getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
}
else
{
record.fromPackingNumber = record.packingNumber;
record.toPackingNumber = r
.packingNumber;
record.toBatch = info.batch;
}
record.toBatch = r.batch;
// //使
// if (this.jobContent
// .useOnTheWayLocation ==
// 'TRUE') {
// record.toPackingNumber = r
// .packingNumber;
// record.toBatch = r.batch;
// } else {
// var info =
// getPackingNumberAndBatch(
// this.managementList, r
// .itemCode,
// r.packingNumber, r
// .batch);
// record.toPackingNumber = info
// .packingNumber;
// record.toBatch = info.batch;
// }
subItem.recordList.push(record);
})
commitSubList.push(subItem);

Loading…
Cancel
Save