Browse Source

YT-1888PDA【采购退货任务】,现扫描后的页面,需要修改。推荐批次是任务中的批次,如果任务中没有批次,PDA端则不显示。扫描箱码后,需要显示实际扫描的批次,如果相同批次进行了重复扫描,则累加已扫描数量;如果扫描了不用的批次,则再显示一条实际扫描的明细。

intex_online20241228
张立 1 month ago
parent
commit
3a4ec86142
  1. 1
      src/common/detail.js
  2. 11
      src/mycomponents/detail/comRecommendDetailCard.vue
  3. 6
      src/mycomponents/recommend/recommend.vue
  4. 398
      src/pages/purchaseReturn/job/returnDetailBatch.vue
  5. 5
      src/pages/purchaseReturn/job/returnJob.vue
  6. 198
      src/pages/unPlanned/job/issueJobDetail.vue

1
src/common/detail.js

@ -187,6 +187,7 @@ export function calcHandleNewQty(detailSource) {
item.handleQty = new Decimal(0).toNumber();
// item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
detail.handleQty = detail.handleQty || new Decimal(0).toNumber();
if (detail ) {
if (!detail.isRecommend && detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);

11
src/mycomponents/detail/comRecommendDetailCard.vue

@ -18,7 +18,7 @@
<br/>
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='item.batch ? true:false' :isShowPack='isShowPack'>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='isShowBatch?true : item.batch ? true:false' :isShowPack='isShowPack' :formLocationTitle='formLocationTitle'>
</recommend>
</view>
@ -27,12 +27,9 @@
<br/>
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='item.batch? true:false' :isShowPack='isShowPack'>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='isShowBatch?true : item.batch? true:false' :isShowPack='isShowPack' :formLocationTitle='formLocationTitle'>
</recommend>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
@ -109,6 +106,10 @@
type: Boolean,
default: true
},
formLocationTitle: {
type: String,
default: '库位'
},
},
watch: {
dataContent: {

6
src/mycomponents/recommend/recommend.vue

@ -7,7 +7,7 @@
</container> -->
<pack v-if="isShowPack && detail.packingNumber" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch && detail.batch!=null" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode">
<location v-if="isShowFromLocation" :title="formLocationTitle" :locationCode="detail.fromLocationCode">
</location>
<!-- <to-location></to-location> -->
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="detail.toLocationCode">
@ -90,6 +90,10 @@
type: String,
default: '库位'
},
formLocationTitle: {
type: String,
default: '来源库位'
},
},
watch: {

398
src/pages/purchaseReturn/job/returnDetailBatch.vue

@ -22,9 +22,13 @@
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<comReturnDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" :settingParam="jobContent"
@updateData='updateData' v-if="managementType == 'BY_BATCH'">
</comReturnDetailCardBatch>
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowToLocation='false' formLocationTitle='库位'>
</comRecommendDetailCard>
</view>
</view>
</scroll-view>
</view>
@ -42,9 +46,8 @@
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanReturnPack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanReturnPack>
<!-- 按批次的扫码-->
<comScanReturnPackBatch ref="comScanReturnPackBatch" @closeScan='closeScan' @updateData='updateData'>
</comScanReturnPackBatch>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<return-detail-info-popup ref="jobDetailPopup"></return-detail-info-popup>
<comMessage ref="comMessage"></comMessage>
@ -70,14 +73,16 @@
getInventoryStatusName
} from '@/common/directory.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
// import {
// getDataSource
// } from '@/pages/issue/js/issue.js';
import {
createRecordInfo,
calcHandleQty,
getScanCount
getScanCount,
getDataSource,
calcHandleNewQty,
} from '@/common/detail.js';
import {
@ -96,6 +101,7 @@
import comReturnDetailCardBatch from '@/pages/purchaseReturn/coms/comReturnDetailCardBatch.vue'
import comScanReturnPack from '@/pages/purchaseReturn/coms/comScanReturnPack.vue'
import comScanReturnPackBatch from '@/pages/purchaseReturn/coms/comScanReturnPackBatch.vue'
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
export default {
name: 'returnDetail',
@ -107,7 +113,8 @@
jobTop,
comScanReturnPack,
comScanReturnPackBatch,
comReturnDetailCardBatch
comReturnDetailCardBatch,
comRecommendDetailCard
},
data() {
@ -201,7 +208,7 @@
mask: true
});
getPurchasereturnJobDetail(that.id).then(res => {
getPurchasereturnJobDetail(that.id).then(async res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
@ -211,28 +218,14 @@
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.toLocationCode = that.jobContent.toLocationCode
that.detailSource = getDataSource(that.detailSource,that.subList);
that.subList.forEach(item=>{
item.isRecommend = true
})
that.detailSource = await getDataSource(that.subList)
console.log(222,that.detailSource)
that.fromLocationCode =that.subList[0].fromLocationCode
that.poNumber =that.subList[0].poNumber
//
var itemCodes = []
res.data.subList.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
getManagementPrecisions(itemCodes, that.fromLocationCode, ret => {
if (ret.success) {
this.managementList = ret.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
if (this.managementType == 'BY_BATCH') {
that.detailSource = res.data
} else {
that.detailSource = getDataSource(that.detailSource, that.subList);
}
}
})
} else {
that.showMessage('列表数据为0');
}
@ -254,109 +247,183 @@
// })
// });
},
updateData(record) {
if(record){
// let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
// let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
// let itemHandleQty = 0;
// if (item != undefined) {
// item.Locations.forEach(l => {
// let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
// .packingNumber == null || b.packingNumber == '') && b.batch ==
// record.batch);
// let handleQty = 0;
// if (batch != undefined) {
// batch.Records.forEach(res => {
// handleQty = calc.add(handleQty, res.qty)
// })
// batch.handleQty = handleQty;
// itemHandleQty = calc.add(itemHandleQty, handleQty)
// }
// })
// item.handleQty=itemHandleQty;
// }
// this.$forceUpdate()
}else {
//
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if(record){
var handleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,handleQty)
}
})
})
})
//
item.handleQty =totalQty
})
})
getScanResult(result, managementPrecision) {
console.log(33, result, managementPrecision)
if (managementPrecision == 'BY_QUANTITY') {
result.label.batch = ''
this.setDataBatch(result)
} else if (managementPrecision == 'BY_BATCH') {
this.setDataBatch(result)
} else {
this.setData(result)
}
//
},
submit(){
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
if (params.subList.length == 0) {
uni.hideLoading()
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return
}
if(!this.checkCount()){
uni.hideLoading()
return ;
setDataBatch(result) {
try {
var packingNumber = result.balance.packingNumber;
var batch = result.label.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
console.log(999, detail.subList)
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.isRecommend == false
})
if (itemDetail == undefined) {
var newAdd = {
itemCode: itemCode,
packingNumber: packingNumber,
batch: batch,
handleQty: Number(result.label.qty),
qty: detail.qty,
fromLocationCode: locationCode,
inventoryStatus: inventoryStatus,
toInventoryStatus: inventoryStatus,
balance: result.balance,
isRecommend: false,
isNewAdd: "newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
} else {
if (itemDetail.scaned) {
itemDetail.handleQty = calc.add(itemDetail.handleQty, Number(result.label.qty));
// this.showErrorMessage("" + packingNumber + "," + batch + "" + result
// .fromLocationCode + "")
}else{
itemDetail.scaned = true;
itemDetail.handleQty= Number(result.label.qty)
}
}
this.calcHandleQty();
}
} catch (e) {
this.showMessage(e.message)
}
this.submitJob()
},
checkCount(){
let str=""
let commitHint=""
this.detailSource.subList.forEach(item => {
if (this.jobContent.allowPartialComplete == "FALSE") {
if (item.qty != item.handleQty) {
str += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.qty}】不一致\n`
}
setData(result) {
try {
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
//
if (item.qty != item.handleQty) {
commitHint += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.qty}】不一致,是否提交?\n`
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.isRecommend == false
})
if (itemDetail == undefined) {
var newAdd = {
itemCode: itemCode,
packingNumber: packingNumber,
batch: batch,
handleQty: detail.qty < Number(result.balance.qty) ? detail.qty : Number(result.balance.qty),
qty: detail.qty,
fromLocationCode: locationCode,
inventoryStatus: inventoryStatus,
toInventoryStatus: inventoryStatus,
balance: result.balance,
isRecommend: false,
isNewAdd: "newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
this.calcHandleQty();
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】已经扫描")
}
}
}
})
if(str){
str = '不允许提交\n' + str
this.showErrorMessage(str)
} catch (e) {
this.showMessage(e.message)
}
if(commitHint){
this.showQuestionMessage(commitHint,res=>{
if(res){
this.submitJob()
},
calcHandleQty() {
calcHandleNewQty(this.detailSource)
// this.continueScan()
this.$forceUpdate();
},
updateData() {
//
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i]
for (var j = 0; j < item.subList.length; j++) {
var sub = item.subList[j]
if (!sub.isRecommend && !sub.scaned) {
item.subList.splice(j, 1)
}
})
}
}
if(str||commitHint){
return false
}else {
return true
this.calcHandleQty();
},
submit(){
this.checkCount()
// uni.showLoading({
// title: "....",
// mask: true
// });
// var params = this.setParams()
// console.log("", JSON.stringify(params));
// if (params.subList.length == 0) {
// uni.hideLoading()
// this.$refs.comMessage.showConfirmMessageModal('')
// return
// }
},
checkCount(){
//
let str = ''
let num = 0
this.detailSource.forEach((item) => {
if (item.qty != item.handleQty) {
str += `物料号【${item.itemCode}】任务数量【${item.qty}】与实际提交数量【${item.handleQty}】不一致`
}
item.subList.forEach((cur,key)=>{
if(cur.isRecommend == false && cur.handleQty){
num++
}
})
})
if(!num){
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return
}
if (str) {
str = str + '\n是否提交?'
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
this.submitJob()
}
},
@ -366,8 +433,10 @@
mask: true
});
var itemCodes = []
this.detailSource.subList.forEach(cur => {
itemCodes.push(cur.itemCode)
this.detailSource.forEach(item => {
item.subList.forEach(cur => {
itemCodes.push(cur.itemCode)
})
})
//
getManagementPrecisions(itemCodes, this.fromLocationCode, res => {
@ -395,38 +464,35 @@
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.subList.forEach(r => {
if (r.scaned) {
let subItem = {
...r
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned && !detail.isRecommend) {
detail.recordList = []
let record = {};
record.handleQty = detail.qty;
record.toContainerNumber = detail
.ContainerNumber;
record.inventoryStatus = detail
.inventoryStatus;
record.toLocationCode = item
.toLocationCode;
record.supplierCode =detail.supplierCode;
//使
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
record.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;
record.toPackingNumber = info.packingNumber;
record.packingNumber = info.packingNumber;
record.fromPackingNumber = info.packingNumber;
record.fromBatch = detail.batch;
record.fromPackingNumber = detail.packingNumber
detail.recordList.push(record);
subList.push(deepCopyData(detail))
}
subItem.recordList = []
let record = {};
record.handleQty = r.qty;
record.toContainerNumber = r
.ContainerNumber;
record.inventoryStatus = r
.inventoryStatus;
record.toLocationCode = subItem
.toLocationCode;
record.supplierCode = r.supplierCode;
//使
var info = getPackingNumberAndBatch(this.managementList, r.itemCode,
record.packingNumber, r.batch);
subItem.toPackingNumber = info.packingNumber;
subItem.packingNumber = info.packingNumber;
subItem.fromPackingNumber = info.packingNumber;
record.toPackingNumber = info.packingNumber;
record.packingNumber = info.packingNumber;
record.fromPackingNumber = info.packingNumber;
record.fromBatch = r.batch;
record.fromPackingNumber = r.packingNumber
subItem.recordList.push(record);
subList.push(deepCopyData(subItem));
}
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
@ -434,7 +500,27 @@
},
openScanDetailPopup() {
this.$refs.comScanReturnPackBatch.openScanPopup(this.detailSource, this.jobContent);
let fromlocationCode = '';
let fromlocationList = [];
console.log(this.detailSource)
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
console.log(fromlocationCode, fromlocationList, this.jobContent)
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
scanPopupGetFocus() {

5
src/pages/purchaseReturn/job/returnJob.vue

@ -190,9 +190,8 @@
getManagementPrecisions([item.itemCode], item.fromLocationCode, ret => {
if (ret.success) {
this.managementList = ret.list;
this.managementType = this.managementList.some(cur => cur.ManagementPrecision == 'BY_BATCH') ?
'BY_BATCH' : ''
if (this.managementType == 'BY_BATCH') {
this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : ''
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
uni.navigateTo({
url: './returnDetailBatch?id=' + item.masterId + '&status=' + item.status+'&title='+this.title
});

198
src/pages/unPlanned/job/issueJobDetail.vue

@ -8,7 +8,8 @@
<view class="task_text">
<view class="card_view">
<text class="card_packing_code ">目的地</text>
<text class="card_content " style="word-wrap: break-word; word-break: break-all;" >{{jobContent.destination}}</text>
<text class="card_content "
style="word-wrap: break-word; word-break: break-all;">{{jobContent.destination}}</text>
</view>
</view>
</view>
@ -18,8 +19,8 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowToLocation='false'>
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData"
@updateData="updateData" @openDetail="openDetail" :isShowToLocation='false'>
</comRecommendDetailCard>
</view>
</view>
@ -27,8 +28,7 @@
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="uni-flex u-col-center space-between padding_10" style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
@ -69,11 +69,11 @@
calcHandleNewQty,
getScanCount
} from '@/common/detail.js';
import {
calc
} from '@/common/calc'
import {
Decimal
} from 'decimal.js'; //
@ -181,10 +181,10 @@
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.subList.forEach(item=>{
that.subList.forEach(item => {
item.isRecommend = true
})
that.detailSource = await getDataSource(that.subList)
that.detailSource = await getDataSource(that.subList)
//
var itemCodes = []
this.detailSource.forEach(item => {
@ -195,7 +195,8 @@
await getManagementPrecisions(itemCodes, that.fromLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
this.managementType = this.managementList && this.managementList[0] && this.managementList[0]
.ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
}
})
} else {
@ -228,11 +229,11 @@
updateData() {
//
for (var i = 0; i < this.detailSource.length; i++) {
var item =this.detailSource[i]
var item = this.detailSource[i]
for (var j = 0; j < item.subList.length; j++) {
var sub =item.subList[j]
if(!sub.isRecommend&&!sub.scaned){
item.subList.splice(j,1)
var sub = item.subList[j]
if (!sub.isRecommend && !sub.scaned) {
item.subList.splice(j, 1)
}
}
}
@ -243,18 +244,18 @@
this.$refs.detailInfoPopup.openPopup(item)
},
getScanResult(result,managementPrecision) {
console.log(33,result,managementPrecision)
if(managementPrecision == 'BY_QUANTITY'){
getScanResult(result, managementPrecision) {
console.log(33, result, managementPrecision)
if (managementPrecision == 'BY_QUANTITY') {
result.label.batch = ''
this.setDataBatch(result)
}else if(managementPrecision == 'BY_BATCH' ){
} else if (managementPrecision == 'BY_BATCH') {
this.setDataBatch(result)
}else{
} else {
this.setData(result)
}
},
setDataBatch(result){
setDataBatch(result) {
try {
var packingNumber = result.balance.packingNumber;
var batch = result.label.batch;
@ -263,29 +264,29 @@
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
console.log(999,detail.subList)
console.log(999, detail.subList)
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==false
r.fromLocationCode == result.fromLocationCode &&
r.isRecommend == false
})
if (itemDetail == undefined) {
var newAdd = {
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:Number(result.label.qty),
qty:detail.qty,
fromLocationCode:locationCode,
inventoryStatus:inventoryStatus,
toInventoryStatus:inventoryStatus,
balance:result.balance,
isRecommend:false,
isNewAdd:"newAdd"
itemCode: itemCode,
packingNumber: packingNumber,
batch: batch,
handleQty: Number(result.label.qty),
qty: detail.qty,
fromLocationCode: locationCode,
inventoryStatus: inventoryStatus,
toInventoryStatus: inventoryStatus,
balance: result.balance,
isRecommend: false,
isNewAdd: "newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
@ -294,89 +295,89 @@
detail.subList.push(newAdd)
} else {
if (itemDetail.scaned) {
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty));
itemDetail.handleQty = calc.add(itemDetail.handleQty, Number(result.label.qty));
// this.showErrorMessage("" + packingNumber + "," + batch + "" + result
// .fromLocationCode + "")
}
}
}
this.calcHandleQty();
this.calcHandleQty();
}
} catch (e) {
this.showMessage(e.message)
}
},
setData(result){
try {
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==false
})
if (itemDetail == undefined) {
var newAdd = {
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.qty),
qty:detail.qty,
fromLocationCode:locationCode,
inventoryStatus:inventoryStatus,
toInventoryStatus:inventoryStatus,
balance:result.balance,
isRecommend:false,
isNewAdd:"newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
this.calcHandleQty();
setData(result) {
try {
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】已经扫描")
}
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.isRecommend == false
})
if (itemDetail == undefined) {
var newAdd = {
itemCode: itemCode,
packingNumber: packingNumber,
batch: batch,
handleQty: detail.qty < Number(result.balance.qty) ? detail.qty : Number(result.balance.qty),
qty: detail.qty,
fromLocationCode: locationCode,
inventoryStatus: inventoryStatus,
toInventoryStatus: inventoryStatus,
balance: result.balance,
isRecommend: false,
isNewAdd: "newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
this.calcHandleQty();
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】已经扫描")
}
}
}
} catch (e) {
this.showMessage(e.message)
}
} catch (e) {
this.showMessage(e.message)
}
},
commit() {
var scanCount=0;
var scanCount = 0;
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if(cur.scaned){
if (cur.scaned) {
scanCount++;
}
})
})
if(scanCount==0){
if (scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
this.checkCount();
this.checkCount();
// this.scanCount = getScanCount(this.jobContent.subList);
// if (this.scanCount == 0) {
// this.showErrorMessage("0,")
// return;
// }
// // //
// if (this.scanCount == this.subList.length) {
// this.checkCount();
@ -395,17 +396,17 @@ setData(result){
// }
// }
},
checkCount(){
checkCount() {
//
let str = ''
this.detailSource.forEach((item) => {
if(item.qty!=item.handleQty){
if (item.qty != item.handleQty) {
str += `物料号【${item.itemCode}】任务数量【${item.qty}】与实际提交数量【${item.handleQty}】不一致`
}
})
if (str) {
str = str+'\n是否提交?'
str = str + '\n是否提交?'
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -444,7 +445,7 @@ setData(result){
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
@ -458,11 +459,12 @@ setData(result){
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned&&!detail.isRecommend) {
if (detail.scaned && !detail.isRecommend) {
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = '';
detail.toBatch = detail.batch;
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;
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber;

Loading…
Cancel
Save