Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_online_20240829
yufei0306 6 months ago
parent
commit
0de8d970a7
  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="space_between center">
<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>
<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" :isShowStatus='isShowStatus'
:isShowStdPack="true"></recommend-qty>
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail"
:isShowStatus='isShowStatus' :isShowStdPack="true"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty" :isShowStatus='isShowStatus'
:isShowStdPack="true">
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty"
:isShowStatus='isShowStatus' :isShowStdPack="true">
</compare-qty>
</view>
</view>

7
src/mycomponents/balance/pack.vue

@ -1,6 +1,6 @@
<template>
<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>
</view>
</template>
@ -20,6 +20,11 @@
type: String,
default: ''
},
title:
{
type:String,
default: '包装'
}
},
watch: {

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

@ -30,10 +30,10 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
: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_content ">{{record.parentPackingNumber}}</text>
</view>
</view> -->
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null" :isShowStatus='true'>
</handle-balance>

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

@ -69,8 +69,8 @@
<uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions">
<view style="padding: 0px 10px">
<balance :dataContent="record" :isShowFromLocation="false" :isShowStatus='true'
:isShowStdPack="false"></balance>
<balance :dataContent="record" :isShowFromLocation="false"
:isShowStatus='true' :isShowStdPack="false"></balance>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
@ -102,7 +102,8 @@
getDetailEditRemoveOption
} from '@/common/array.js';
import {
getWorkShopLineStation
getWorkShopLineStation,
getBalanceByFilter
} from '@/api/request2.js';
import {
@ -222,7 +223,6 @@
onScan(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
@ -242,22 +242,48 @@
)
return;
} 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,
// balanceRes => {
// if (balanceRes.success) {
// let s = '';
// if (balanceRes.data.list.length == 0) {
// this.showErrorMessage('[' + this.fromLocationCode + '],',
// res => {
// this.packGetFocus();
// })
// this.afterGetBalance(result.label, null, packageInfo);
// } else if (balanceRes.data.list.length == 1) {
// let balance = balanceRes.data.list[0];
// this.afterGetBalance(result.label, balance, packageInfo);
@ -275,6 +301,45 @@
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) {
this.afterGetBalance(this.label, balance);
},
@ -297,14 +362,14 @@
let record = batch.Records.find(r => r.packingNumber == packingCode);
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);
if (recommend != undefined) {
that.addRecord(batch, label, packageInfo)
that.addRecord(batch, label, balance, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, packageInfo);
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
@ -314,7 +379,7 @@
}
}
} else {
that.addRecord(batch, label, packageInfo)
that.addRecord(batch, label, balance, packageInfo)
}
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
@ -325,7 +390,6 @@
}
} else {
if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,批次【' + lot +
'】不是推荐批次,是否要继续发料?', res => {
if (res) {
@ -351,29 +415,37 @@
)
}
} catch (e) {
that.showErrorMessage(e.stack,
this.showErrorMessage(e.stack,
res => {
that.getfocus();
this.getfocus();
}
)
}
},
createBatchInfo(data, balance, packageInfo) {
createBatchInfo(label, balance, packageInfo) {
let batch = {
batch: data.batch,
batch: label.batch,
qty: 0,
uom: data.uom,
handleQty: Number(data.qty),
uom: label.uom,
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);
this.issueRecord.unshift(record)
return batch;
},
creatRecord(label, packageInfo) {
creatRecordByLabel(label, packageInfo) {
let record = {
scaned: true,
itemCode: label.itemCode,
@ -387,32 +459,30 @@
balance: null,
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode,
packUnit:packageInfo.packUnit,
packQty:packageInfo.packQty
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty
}
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;
// },
creatRecordByBalance(balance, packageInfo) {
balance.packQty = packageInfo.packQty
balance.packUnit = packageInfo.packUnit
let record = {
scaned: true,
itemCode: balance.itemCode,
packingNumber: balance.packingNumber,
batch: balance.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: balance.supplierCode
}
return record;
},
calcBatchHandleQty(batch) {
let handleQty = 0;
@ -436,8 +506,13 @@
})
},
addRecord(batch, label, packageInfo) {
let record = this.creatRecord(label, packageInfo);
addRecord(batch, label, balance, packageInfo) {
let record = {};
if (balance == null) {
record = this.creatRecordByLabel(label, packageInfo);
} else {
record = this.creatRecordByBalance(balance, packageInfo);
}
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);

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

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

Loading…
Cancel
Save