Browse Source

修改补料任务的执行

hella_online_20240829
niexiting 4 months ago
parent
commit
17e043e30c
  1. 10
      src/mycomponents/balance/handleBalance.vue
  2. 7
      src/mycomponents/balance/pack.vue
  3. 4
      src/pages/repleinsh/coms/comRepleishDetailCard.vue
  4. 177
      src/pages/repleinsh/coms/comScanReplishPack.vue
  5. 1
      src/pages/repleinsh/job/repleinshDetail.vue

10
src/mycomponents/balance/handleBalance.vue

@ -2,16 +2,18 @@
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> <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%;"> <view style="word-break: break-all;width: 60%;">
<pack title='外包装' v-if="detail.parentPackingNumber!=undefined && detail.parentPackingNumber!=''"
:packingCode="detail.parentPackingNumber"></pack>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
<view style="word-break: break-all;"> <view style="word-break: break-all;">
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail" :isShowStatus='isShowStatus' <recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail"
:isShowStdPack="true"></recommend-qty> :isShowStatus='isShowStatus' :isShowStdPack="true"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty" :isShowStatus='isShowStatus' <compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty"
:isShowStdPack="true"> :isShowStatus='isShowStatus' :isShowStdPack="true">
</compare-qty> </compare-qty>
</view> </view>
</view> </view>

7
src/mycomponents/balance/pack.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="card_view"> <view class="card_view">
<text class="card_packing_code card_content ">包装</text> <text class="card_packing_code card_content ">{{title}}</text>
<text class="card_content ">{{packingCode}}</text> <text class="card_content ">{{packingCode}}</text>
</view> </view>
</template> </template>
@ -20,6 +20,11 @@
type: String, type: String,
default: '' default: ''
}, },
title:
{
type:String,
default: '包装'
}
}, },
watch: { watch: {

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

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

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

@ -69,8 +69,8 @@
<uni-swipe-action-item @click="swipeClick($event,record,index)" <uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions"> :right-options="scanOptions">
<view style="padding: 0px 10px"> <view style="padding: 0px 10px">
<balance :dataContent="record" :isShowFromLocation="false" :isShowStatus='true' <balance :dataContent="record" :isShowFromLocation="false"
:isShowStdPack="false"></balance> :isShowStatus='true' :isShowStdPack="false"></balance>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -102,7 +102,8 @@
getDetailEditRemoveOption getDetailEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
import { import {
getWorkShopLineStation getWorkShopLineStation,
getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -222,7 +223,6 @@
onScan(result) { onScan(result) {
try { try {
let that = this; let that = this;
if (that.fromLocationCode == '') { if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => { that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus(); that.$refs.toLocationCombox.onFocus();
@ -242,22 +242,48 @@
) )
return; return;
} else { } else {
//
uni.showLoading({
title: '加载中',
mask: true
})
this.getBalance(result.label, balances => {
//
let s = '';
if (result.package.parentNumber == null || result.package.parentNumber == '') {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
let newBalances = balances.list.filter(b => b.locationCode ==that.fromLocationCode);
if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
let balance = newBalances[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.showBalanceSelect(newBalances);
}
}
} else {
//
if (balances.list.length == 0) {
this.afterGetBalance(result.label, null, packageInfo);
} else {
this.showErrorMessage('该包装在库位【' + balances.list[0].locationCode +
'】已经有库存余额,请重新扫描')
}
}
uni.hideLoading();
});
this.afterGetBalance(result.label, result.label, packageInfo);
// //
// uni.showLoading({
// title: '',
// mask: true
// })
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, // getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
// balanceRes => { // balanceRes => {
// if (balanceRes.success) { // if (balanceRes.success) {
// let s = '';
// if (balanceRes.data.list.length == 0) { // if (balanceRes.data.list.length == 0) {
// this.showErrorMessage('[' + this.fromLocationCode + '],', // this.afterGetBalance(result.label, null, packageInfo);
// res => {
// this.packGetFocus();
// })
// } else if (balanceRes.data.list.length == 1) { // } else if (balanceRes.data.list.length == 1) {
// let balance = balanceRes.data.list[0]; // let balance = balanceRes.data.list[0];
// this.afterGetBalance(result.label, balance, packageInfo); // this.afterGetBalance(result.label, balance, packageInfo);
@ -275,6 +301,45 @@
uni.hideLoading(); uni.hideLoading();
} }
}, },
getBalance(label, callback) {
var filters = []
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance); this.afterGetBalance(this.label, balance);
}, },
@ -297,14 +362,14 @@
let record = batch.Records.find(r => r.packingNumber == packingCode); let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) { if (record == undefined) {
// //
if (batch.Recommends!=undefined && batch.Recommends.length > 0) { if (batch.Recommends != undefined && batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) { if (recommend != undefined) {
that.addRecord(batch, label, packageInfo) that.addRecord(batch, label, balance, packageInfo)
} else { } else {
// //
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, packageInfo); that.addRecord(batch, label, balance, packageInfo);
} else { } else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => { res => {
@ -314,7 +379,7 @@
} }
} }
} else { } else {
that.addRecord(batch, label, packageInfo) that.addRecord(batch, label, balance, packageInfo)
} }
} else { } else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
@ -325,7 +390,6 @@
} }
} else { } else {
if (this.jobContent.allowModifyBatch == "TRUE") { if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,批次【' + lot + this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,批次【' + lot +
'】不是推荐批次,是否要继续发料?', res => { '】不是推荐批次,是否要继续发料?', res => {
if (res) { if (res) {
@ -351,29 +415,37 @@
) )
} }
} catch (e) { } catch (e) {
that.showErrorMessage(e.stack, this.showErrorMessage(e.stack,
res => { res => {
that.getfocus(); this.getfocus();
} }
) )
} }
}, },
createBatchInfo(data, balance, packageInfo) { createBatchInfo(label, balance, packageInfo) {
let batch = { let batch = {
batch: data.batch, batch: label.batch,
qty: 0, qty: 0,
uom: data.uom, uom: label.uom,
handleQty: Number(data.qty),
Records: [] Records: []
} }
let record = this.creatRecord(data, packageInfo); let record = {}
if (balance == null) {
record = this.creatRecordByBalance(label, packageInfo);
batch.handleQty = Number(label.qty)
} else {
record = this.creatRecordByLabel(balance, packageInfo);
batch.handleQty = Number(balance.qty)
}
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
return batch; return batch;
}, },
creatRecord(label, packageInfo) { creatRecordByLabel(label, packageInfo) {
let record = { let record = {
scaned: true, scaned: true,
itemCode: label.itemCode, itemCode: label.itemCode,
@ -387,32 +459,30 @@
balance: null, balance: null,
toLocationCode: this.toLocationCode, toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode, supplierCode: label.supplierCode,
packUnit:packageInfo.packUnit, packUnit: packageInfo.packUnit,
packQty:packageInfo.packQty packQty: packageInfo.packQty
} }
return record; return record;
}, },
creatRecordByBalance(balance, packageInfo) {
balance.packQty = packageInfo.packQty
// creatRecord(label, balance, packageInfo) { balance.packUnit = packageInfo.packUnit
// balance.packQty = packageInfo.packQty let record = {
// balance.packUnit = packageInfo.packUnit scaned: true,
// let record = { itemCode: balance.itemCode,
// scaned: true, packingNumber: balance.packingNumber,
// itemCode: label.itemCode, batch: balance.batch,
// packingNumber: label.packingNumber, qty: Number(balance.qty),
// batch: label.batch, // qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty),
// qty: Number(balance.qty), uom: balance.uom,
// // qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), inventoryStatus: balance.inventoryStatus,
// uom: balance.uom, balance: balance,
// inventoryStatus: balance.inventoryStatus, toLocationCode: this.toLocationCode,
// balance: balance, supplierCode: balance.supplierCode
// toLocationCode: this.toLocationCode, }
// supplierCode: label.supplierCode return record;
// } },
// return record;
// },
calcBatchHandleQty(batch) { calcBatchHandleQty(batch) {
let handleQty = 0; let handleQty = 0;
@ -436,8 +506,13 @@
}) })
}, },
addRecord(batch, label, packageInfo) { addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, packageInfo); let record = {};
if (balance == null) {
record = this.creatRecordByLabel(label, packageInfo);
} else {
record = this.creatRecordByBalance(balance, packageInfo);
}
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);

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

@ -271,7 +271,6 @@
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
return;
repleinshJobSubmit(params).then(res => { repleinshJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {

Loading…
Cancel
Save