|
|
@ -1,24 +1,23 @@ |
|
|
|
<template> |
|
|
|
<view class="page-wraper"> |
|
|
|
<view class="page-header"> |
|
|
|
<view class="header-view"> |
|
|
|
<view class="header_job_top"> |
|
|
|
<job-top :dataContent="jobContent"></job-top> |
|
|
|
<view class="header-view uni-flex space-between u-col-center"> |
|
|
|
<view class="task_number left uni-flex"> |
|
|
|
<text> {{mDate}} </text> |
|
|
|
<view class="time"> {{jobContent.deliNo}} </view> |
|
|
|
</view> |
|
|
|
<view class="header_item"> |
|
|
|
申请单号 : {{jobContent.requestNumber}} |
|
|
|
<view class="task_number"> |
|
|
|
<text> {{mTime}} </text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="page-main"> |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<!-- <view v-for="(toLocation, index) in detailSource"> |
|
|
|
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'></comRepleishDetailCardBatch> |
|
|
|
</view> --> |
|
|
|
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" @updateData='updateData'> |
|
|
|
</comRepleishDetailCardBatch> |
|
|
|
|
|
|
|
<view v-for="(toLocation, index) in detailSource" :key="index"> |
|
|
|
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData' |
|
|
|
:settingParam="jobContent"> |
|
|
|
</comRepleishDetailCardBatch> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -35,9 +34,13 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> |
|
|
|
<comScanReplishPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> |
|
|
|
</comScanReplishPackBatch> |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<!-- <comScanReplishPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> |
|
|
|
</comScanReplishPackBatch> --> |
|
|
|
|
|
|
|
<winScanPackAndLocation :balanceFromInventoryStatuses="true" ref="scanPopup" @getResult='getScanResult' |
|
|
|
:noShowBalanceMessage="false" @confirm='confirmFromLocation'> |
|
|
|
</winScanPackAndLocation> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -49,7 +52,9 @@ |
|
|
|
getRepleinshJobDetail, |
|
|
|
repleinshJobSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getDataSourceBatch, |
|
|
|
} from '@/common/detail.js'; |
|
|
|
import { |
|
|
|
goHome, |
|
|
|
navigateBack, |
|
|
@ -57,7 +62,8 @@ |
|
|
|
getCurrDateTime, |
|
|
|
getDirectoryItemArray, |
|
|
|
getPackingNumberAndBatch, |
|
|
|
deepCopyData |
|
|
|
deepCopyData, |
|
|
|
dateFormat, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -75,23 +81,22 @@ |
|
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import comRepleishDetailCard from '@/pages/repleinsh/coms/comRepleishDetailCard.vue' |
|
|
|
import comRepleishDetailCardBatch from '@/pages/repleinsh/coms/comRepleishDetailCardBatch.vue' |
|
|
|
import comScanReplishPack from '@/pages/repleinsh/coms/comScanReplishPack.vue' |
|
|
|
import comScanReplishPackBatch from '@/pages/repleinsh/coms/comScanReplishPackBatch.vue' |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import boardNumberVue from '../../../mycomponents/balance/boardNumber.vue'; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'issueDetail', |
|
|
|
components: { |
|
|
|
jobDetailPopup, |
|
|
|
winScanButton, |
|
|
|
comRepleishDetailCard, |
|
|
|
comRepleishDetailCardBatch, |
|
|
|
comScanReplishPack, |
|
|
|
comScanReplishPackBatch, |
|
|
|
requiredLocation, |
|
|
|
jobTop, |
|
|
|
comScanReplishPackBatch |
|
|
|
winScanPackAndLocation |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -105,7 +110,7 @@ |
|
|
|
toLocationAreaTypeList: [], |
|
|
|
jobStatus: "", |
|
|
|
scanMessage: "", |
|
|
|
managementType: '' |
|
|
|
detailSourceOriginal: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -151,8 +156,10 @@ |
|
|
|
} else { |
|
|
|
uni.navigateBack(); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
@ -163,6 +170,25 @@ |
|
|
|
mounted: function() { |
|
|
|
|
|
|
|
}, |
|
|
|
computed: { |
|
|
|
mDate() { |
|
|
|
if (!this.jobContent.day) { |
|
|
|
return '' |
|
|
|
} |
|
|
|
let date = dateFormat(this.jobContent.day) |
|
|
|
let dateArr = date.split(' ')[0].split('-') |
|
|
|
return `${dateArr[1]}-${dateArr[2]}` |
|
|
|
}, |
|
|
|
mTime() { |
|
|
|
console.log('this.jobContent.day', this.jobContent.day) |
|
|
|
if (!this.jobContent.day) { |
|
|
|
return '' |
|
|
|
} |
|
|
|
let date = dateFormat(this.jobContent.day) |
|
|
|
let dateArr = date.split(' ')[1].split(':') |
|
|
|
return `${dateArr[0]}:${dateArr[1]}` |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
//接收 |
|
|
@ -182,7 +208,7 @@ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
getRepleinshJobDetail(that.id).then(res => { |
|
|
|
getRepleinshJobDetail(that.id).then(async res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.data == null) { |
|
|
|
that.showMessage('未获取到详情'); |
|
|
@ -194,9 +220,8 @@ |
|
|
|
that.toLocationCode = that.subList[0].toLocationCode |
|
|
|
|
|
|
|
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) |
|
|
|
|
|
|
|
that.detailSource = res.data; |
|
|
|
|
|
|
|
that.detailSource = getDataSourceBatch(that.subList) |
|
|
|
that.detailSourceOriginal = getDataSourceBatch(that.subList) |
|
|
|
if (that.scanMessage) { |
|
|
|
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this |
|
|
|
.jobContent, that.scanMessage); |
|
|
@ -224,25 +249,61 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
resizeCollapse() { |
|
|
|
|
|
|
|
this.$nextTick(r => { |
|
|
|
this.$refs.comIssueDetailCard.forEach(r => { |
|
|
|
r.resizeCollapse(); |
|
|
|
r.$refs.recommendRepleinshRef.forEach(l => { |
|
|
|
l.resizeCollapse(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
clickSubmit() { |
|
|
|
let str = "" |
|
|
|
var scanCount = this.getScanCount(this.subList); |
|
|
|
if(!scanCount){ |
|
|
|
this.$refs.comMessage.showErrorMessage('扫描数量为0,请先扫描', res => { |
|
|
|
|
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.detailSource.subList.forEach(item => { |
|
|
|
if (item.handleQty != item.qty) { |
|
|
|
str += |
|
|
|
"扫描数量[" + item.handleQty + "]与任务数量不一致[" + item.qty + "],是否提交" |
|
|
|
let str1 = "" |
|
|
|
let str2 = "" |
|
|
|
let str3 = "" |
|
|
|
let isTrue = true |
|
|
|
this.detailSource.forEach(detail => { |
|
|
|
const isScaned = detail.subList.some(item => item.packList && item.packList.length > 0) |
|
|
|
if (isScaned) { |
|
|
|
if (parseFloat(detail.handleQty) < parseFloat(detail.qty)) { |
|
|
|
str += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】小于任务数量【${detail.qty}】\n` |
|
|
|
} |
|
|
|
if (parseFloat(detail.handleQty) > parseFloat(detail.qty)) { |
|
|
|
str1 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于任务数量【${detail.qty}\n】` |
|
|
|
} |
|
|
|
if (parseFloat(detail.handleQty) > parseFloat(detail.balanceQty)) { |
|
|
|
str2 += `物料号【${detail.itemCode}】扫描数量【${detail.handleQty}】大于库存数量【${detail.balanceQty}\n】` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
if (str) { |
|
|
|
if (this.jobContent.allowSmallerQty == "FALSE") { |
|
|
|
if (str) { |
|
|
|
str = '不允许提交\n' + str |
|
|
|
this.showErrorMessage(str) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.jobContent.allowBiggerQty == 'FALSE') { |
|
|
|
if (str1) { |
|
|
|
str1 = '不允许提交\n' + str1 |
|
|
|
this.showErrorMessage(str1) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (str2) { |
|
|
|
str2 = '不允许提交\n' + str2 |
|
|
|
this.showErrorMessage(str2) |
|
|
|
return |
|
|
|
} |
|
|
|
const strr = str || str1 ? str + str1 : '' |
|
|
|
if (strr) { |
|
|
|
str = strr + "是否提交?" |
|
|
|
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { |
|
|
|
if (res) { |
|
|
|
//防止重复点击 |
|
|
@ -257,6 +318,144 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result, managementTypeParams) { |
|
|
|
if (!result.package.number) { |
|
|
|
this.showErrorMessage("包装号不能为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.managementType = managementTypeParams |
|
|
|
let array1 = [] //记录推荐的库位 |
|
|
|
let array2 = [] //记录推荐的批次 |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(cur => { |
|
|
|
array1.push(cur.fromLocationCode) |
|
|
|
array2.push(cur.batch) |
|
|
|
}) |
|
|
|
}) |
|
|
|
// 扫描的库位是否在 |
|
|
|
const obj1 = array1.find(item => item == result.fromLocationCode) |
|
|
|
const obj2 = array2.find(item => item == result.label.batch) |
|
|
|
if (this.jobContent.allowModifyLocation == 'FALSE') { |
|
|
|
if (!obj1) { |
|
|
|
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.jobContent.allowModifyBatch == 'FALSE') { |
|
|
|
if (!obj2) { |
|
|
|
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (!obj1) { |
|
|
|
this.recommendQty = 0 |
|
|
|
} else { |
|
|
|
this.recommendQty = result.balance.qty |
|
|
|
} |
|
|
|
// this.managementType = managementTypeParams |
|
|
|
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { |
|
|
|
this.setDataBatch(result) |
|
|
|
} |
|
|
|
}, |
|
|
|
setDataBatch(result) { |
|
|
|
try { |
|
|
|
let that = this |
|
|
|
this.balanceinfo = result.balance |
|
|
|
var packingNumber = result.label.packingNumber; |
|
|
|
var batch = result.label.batch; |
|
|
|
var qty = result.label.qty; |
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
var locationCode = result.fromLocationCode; |
|
|
|
|
|
|
|
if (!result.balance) { |
|
|
|
this.showMessage("没有库存余额") |
|
|
|
return; |
|
|
|
} |
|
|
|
// var inventoryStatus = "OK"; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
var itemDetail = detail.subList.find(r => { |
|
|
|
return r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode |
|
|
|
}) |
|
|
|
//扫描的数据不在任务中,添加到列表 |
|
|
|
if (itemDetail == undefined) { |
|
|
|
var item = { |
|
|
|
scaned: true, |
|
|
|
packingNumber: packingNumber, |
|
|
|
fromLocationCode: this.fromLocationCode, |
|
|
|
toLocationCode: this.toLocationCode, |
|
|
|
batch: result.label.batch, |
|
|
|
handleQty: result.label.qty, |
|
|
|
qty: 0, |
|
|
|
inventoryStatus: result.balance.inventoryStatus, |
|
|
|
toLocation: result.balance.toLocation, |
|
|
|
balanceQty: result.balance.qty, |
|
|
|
packQty: result.package.packQty, |
|
|
|
packUnit: result.package.packUnit, |
|
|
|
uom: result.balance.uom, |
|
|
|
isRecommTaskItem: false, //不是推荐任务中的任务 |
|
|
|
supplierCode: result.label.supplierCode, |
|
|
|
packList: [{ |
|
|
|
boardNumber: result.package.number.substring(result.package.number.length - 5), |
|
|
|
batch: result.label.batch, |
|
|
|
packingNumber: result.package.number, |
|
|
|
scaned: true, |
|
|
|
handleQty: result.label.qty, |
|
|
|
uom: result.balance.uom, |
|
|
|
balanceQty: result.balance.qty, |
|
|
|
packQty: result.package.packQty, |
|
|
|
packUnit: result.package.packUnit, |
|
|
|
}] |
|
|
|
} |
|
|
|
detail.subList.push(item) |
|
|
|
//计算数量 |
|
|
|
detail.handleQty = 0 |
|
|
|
detail.qty = 0 |
|
|
|
} else { |
|
|
|
// itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty) |
|
|
|
itemDetail.packList = itemDetail.packList && itemDetail.packList.length > 0 ? itemDetail.packList : [] |
|
|
|
// console.log(()) |
|
|
|
let boardNumberDetail = itemDetail.packList.find(r => { |
|
|
|
return r.packingNumber == result.package.number |
|
|
|
}) |
|
|
|
if (boardNumberDetail) { |
|
|
|
this.showErrorMessage('该看板编号已存在,请重新扫描') |
|
|
|
return |
|
|
|
} else { |
|
|
|
itemDetail.packList.push({ |
|
|
|
boardNumber: result.package.number.substring(result.package.number.length - 5), |
|
|
|
batch: result.label.batch, |
|
|
|
packingNumber: result.package.number, |
|
|
|
scaned: true, |
|
|
|
handleQty: result.label.qty, |
|
|
|
uom: result.balance.uom, |
|
|
|
balanceQty: result.balance.qty, |
|
|
|
packQty: result.package.packQty, |
|
|
|
packUnit: result.package.packUnit, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
detail.subList.forEach(item => { |
|
|
|
item.handleQty = item.handleQty || 0 |
|
|
|
item.packList.forEach(cur => { |
|
|
|
detail.handleQty = calc.add(detail.handleQty, cur.handleQty) |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log(333, this.detailSource) |
|
|
|
setTimeout(r => { |
|
|
|
that.resizeCollapse(); |
|
|
|
that.$forceUpdate() |
|
|
|
}, 3000) |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
var scanCount = this.getScanCount(this.subList); |
|
|
@ -303,86 +502,114 @@ |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
async submitJob() { |
|
|
|
submitJob() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var itemCodes = [] |
|
|
|
this.detailSource.subList.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.Items.forEach(cur => { |
|
|
|
itemCodes.push(cur.itemCode) |
|
|
|
}) |
|
|
|
}) |
|
|
|
await getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交参数", params); |
|
|
|
if (!params.subList || params.subList.length == 0) { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage("请扫描您需要提交的补料任务") |
|
|
|
return |
|
|
|
} |
|
|
|
repleinshJobSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
var params = this.setParams() |
|
|
|
if (!params.subList || params.subList.length == 0) { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage("请扫描您需要提交的补料任务") |
|
|
|
return |
|
|
|
} |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
repleinshJobSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
var commitSubList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.subList.forEach(r => { |
|
|
|
if(r.scaned){ |
|
|
|
let subItem = { |
|
|
|
...r |
|
|
|
} |
|
|
|
subItem.recordList = [] |
|
|
|
let record = {}; |
|
|
|
record.handleQty = r.qty; |
|
|
|
|
|
|
|
// record.fromPackingNumber = r |
|
|
|
// .packingNumber; |
|
|
|
record.fromBatch = r.batch; |
|
|
|
record.fromContainerNumber = r |
|
|
|
.containerNumber; |
|
|
|
|
|
|
|
record.toContainerNumber = r |
|
|
|
.containerNumber; |
|
|
|
record.toInventoryStatus = r |
|
|
|
.inventoryStatus; |
|
|
|
record.toLocationCode = this |
|
|
|
.toLocationCode; |
|
|
|
record.supplierCode = r.supplierCode; |
|
|
|
|
|
|
|
record.fromParentPackingNumber = r |
|
|
|
.parentPackingNumber; |
|
|
|
|
|
|
|
record.fromPackingNumber = r |
|
|
|
.packingNumber; |
|
|
|
record.toPackingNumber = r |
|
|
|
.packingNumber; |
|
|
|
record.toPackUnit = r.packUnit; |
|
|
|
record.toBatch = r.batch; |
|
|
|
var info = getPackingNumberAndBatch(this.managementList, r.itemCode,r.packingNumber, r.batch); |
|
|
|
record.toPackingNumber = info.packingNumber; |
|
|
|
record.packingNumber = info.packingNumber; |
|
|
|
record.fromPackingNumber = info.packingNumber; |
|
|
|
subItem.toPackingNumber = info.packingNumber; |
|
|
|
subItem.packingNumber = info.packingNumber; |
|
|
|
subItem.fromPackingNumber = info.packingNumber; |
|
|
|
subItem.recordList.push(record); |
|
|
|
commitSubList.push(deepCopyData(subItem)); |
|
|
|
} |
|
|
|
this.detailSource.forEach(toLocationCode => { |
|
|
|
toLocationCode.sublist.forEach(item => { |
|
|
|
item.packList.forEach(boardNumber => { |
|
|
|
// fromLocation.Batchs.forEach(batch => { |
|
|
|
let subItem = boardNumber; |
|
|
|
|
|
|
|
if (subItem != undefined) { |
|
|
|
// if (batch.Records.length > 0) { |
|
|
|
subItem.recordList = []; |
|
|
|
// batch.Records.forEach(r => { |
|
|
|
let record = {}; |
|
|
|
record.handleQty = item.qty; |
|
|
|
record.fromBatch = item.batch; |
|
|
|
record.fromContainerNumber = item.containerNumber; |
|
|
|
|
|
|
|
record.toContainerNumber = item.containerNumber; |
|
|
|
record.toInventoryStatus = item.inventoryStatus; |
|
|
|
record.toLocationCode = this.toLocationCode; |
|
|
|
record.supplierCode = item.supplierCode; |
|
|
|
|
|
|
|
record.fromParentPackingNumber = item.parentPackingNumber; |
|
|
|
|
|
|
|
record.fromPackingNumber = item.packingNumber; |
|
|
|
record.toPackingNumber = item.packingNumber; |
|
|
|
record.toPackUnit = item.packUnit; |
|
|
|
record.toBatch = item.batch; |
|
|
|
subItem.recordList.push(record); |
|
|
|
// }) |
|
|
|
commitSubList.push(deepCopyData(subItem)); |
|
|
|
} |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log(88, commitSubList) |
|
|
|
return |
|
|
|
// this.detailSource.forEach(toLocationCode => { |
|
|
|
// toLocationCode.Items.forEach(item => { |
|
|
|
// item.Locations.forEach(fromLocation => { |
|
|
|
// fromLocation.Batchs.forEach(batch => { |
|
|
|
// let subItem = batch.detail; |
|
|
|
|
|
|
|
// if (subItem != undefined) { |
|
|
|
// if (batch.Records.length > 0) { |
|
|
|
// subItem.recordList = []; |
|
|
|
// batch.Records.forEach(r => { |
|
|
|
// let record = {}; |
|
|
|
// record.handleQty = r.qty; |
|
|
|
// record.fromBatch = r.batch; |
|
|
|
// record.fromContainerNumber = r.containerNumber; |
|
|
|
|
|
|
|
// record.toContainerNumber = r.containerNumber; |
|
|
|
// record.toInventoryStatus = r.inventoryStatus; |
|
|
|
// record.toLocationCode = this.toLocationCode; |
|
|
|
// record.supplierCode = r.supplierCode; |
|
|
|
|
|
|
|
// record.fromParentPackingNumber = r.parentPackingNumber; |
|
|
|
|
|
|
|
// record.fromPackingNumber = r.packingNumber; |
|
|
|
// record.toPackingNumber = r.packingNumber; |
|
|
|
// record.toPackUnit = r.packUnit; |
|
|
|
// record.toBatch = r.batch; |
|
|
|
// subItem.recordList.push(record); |
|
|
|
// }) |
|
|
|
// commitSubList.push(deepCopyData(subItem)); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
|
|
|
|
this.jobContent.subList = commitSubList |
|
|
|
this.jobContent.creator = creator; |
|
|
@ -419,14 +646,42 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
updateData(record) { |
|
|
|
let requestLocation = this.detailSource.subList.find(r => r.toLocationCode == record.toLocationCode); |
|
|
|
// this.detailSource.subList.forEach(r =>{ |
|
|
|
// if(r.itemCode == record.itemCode){ |
|
|
|
// r.handleQty = record.qty |
|
|
|
// } |
|
|
|
// }); |
|
|
|
console.log(this.detailSource.subList) |
|
|
|
updateData(e, item, index, detail) { |
|
|
|
// 在新数据源寻找 |
|
|
|
let itemC = this.detailSource.find(r => r.itemCode == detail.itemCode && r.fromLocationCode == detail |
|
|
|
.fromLocationCode && r.batch == detail.batch); |
|
|
|
// 在老数据源寻找 |
|
|
|
let itemOriginal = this.detailSourceOriginal.find(r => r.itemCode == detail.itemCode && r.fromLocationCode == |
|
|
|
detail.fromLocationCode && r.batch == detail.batch); |
|
|
|
if (itemOriginal) { |
|
|
|
if (detail.packList.length == 0) { |
|
|
|
this.detailSourceOriginal = this.detailSourceOriginal.filter(r => r.itemCode == detail.itemCode && r |
|
|
|
.fromLocationCode == detail.fromLocationCode && r.batch == detail.batch); |
|
|
|
this.detailSource = this.detailSource.filter(r => r.itemCode == detail.itemCode && r.fromLocationCode == |
|
|
|
detail.fromLocationCode && r.batch == detail.batch); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
openScanPopup() { |
|
|
|
let fromlocationCode = ''; |
|
|
|
let fromlocationList = []; |
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent); |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
@ -497,16 +752,49 @@ |
|
|
|
}, |
|
|
|
getScanCount(subList) { |
|
|
|
var scanCount = 0; |
|
|
|
this.detailSource.subList.forEach(toLocationCode => { |
|
|
|
scanCount+=calc.add(scanCount,parseFloat(toLocationCode.handleQty)) |
|
|
|
this.detailSource.forEach(toLocationCode => { |
|
|
|
toLocationCode.Items.forEach(item => { |
|
|
|
item.Locations.forEach(fromLocation => { |
|
|
|
fromLocation.Batchs.forEach(batch => { |
|
|
|
let subItem = batch.detail; |
|
|
|
if (batch.Records.length > 0) { |
|
|
|
scanCount = calc.add(scanCount, batch.Records.length) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log(scanCount) |
|
|
|
return scanCount; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.page-header .header-view { |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
background-color: #fff; |
|
|
|
font-size: 35rpx; |
|
|
|
padding: 10rpx 20rpx; |
|
|
|
border-radius: 4px; |
|
|
|
} |
|
|
|
|
|
|
|
.left { |
|
|
|
display: flex; |
|
|
|
|
|
|
|
.time { |
|
|
|
margin-left: 10rpx; |
|
|
|
text-align: center; |
|
|
|
background-color: #DA8910; |
|
|
|
min-width: 40rpx; |
|
|
|
height: 40rpx; |
|
|
|
line-height: 40rpx; |
|
|
|
border-radius: 50%; |
|
|
|
color: white; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |