Browse Source

YT-1061 采购上架修改

intex
lijuncheng 3 days ago
parent
commit
3e5748b960
  1. 134
      src/pages/putaway/job/putawayDetail.vue

134
src/pages/putaway/job/putawayDetail.vue

@ -16,14 +16,15 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<!-- 物料按照批次的组件 批次不显示包装 -->
<comJobDetailCardBatch ref='comJobDetailCardBatchRef' :dataContent="item" :index="index" :settingParam="jobContent" :isShowStatus="true"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
<comJobDetailCardBatch ref='comJobDetailCardBatchRef' :dataContent="item" :index="index"
:settingParam="jobContent" :isShowStatus="true" @remove="updateData"
@updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
:isShowPackListStatus="false" v-if="managementType == 'BY_BATCH'">
</comJobDetailCardBatch>
<!-- 物料按照包装的组件 -->
<comJobDetailCard :dataContent="item" :index="index" :settingParam="jobContent" :isShowStatus="true"
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList'
:isShowPackListStatus="false" v-else>
<comJobDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
:isShowStatus="true" @remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' :isShowPackListStatus="false" v-else>
</comJobDetailCard>
</view>
</view>
@ -31,7 +32,8 @@
</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="">
<locationCompare ref='comScanLocation' title="目标库位" :recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode' :isShowEdit="isCheckLocation"
@ -47,8 +49,8 @@
<!-- <winScanPackAndLocationNoBalance ref="scanPopup" @getResult='getScanResult' :allowNullBalance="true">
</winScanPackAndLocationNoBalance> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="false" :toLocationCode="jobToLocationCode" ref="scanPopup"
@getResult='getScanResult' :noShowBalanceMessage="false">
<winScanPackAndLocation :balanceFromInventoryStatuses="false" :toLocationCode="jobToLocationCode"
ref="scanPopup" @getResult='getScanResult' :noShowBalanceMessage="false">
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage>
@ -120,7 +122,7 @@
toLocationAreaTypeList: [],
jobStatus: "",
jobToLocationCode: "",
isCheckLocation: false,
isCheckLocation: true,
scanMessage: "",
managementType: '' //
};
@ -212,12 +214,6 @@
that.fromLocationCode = that.subList[0].fromLocationCode
that.jobToLocationCode = that.subList[0].toLocationCode;
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.isCheckLocation = getSwitchInfoByCode("PurchasePutawayToLocationCodeValidate")
if (that.isCheckLocation) {
that.toLocationCode = ""
} else {
that.toLocationCode = that.jobToLocationCode;
}
//
var itemCodes = []
this.detailSource.forEach(item => {
@ -227,15 +223,25 @@
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
this.managementType = this.managementList.some(item => item
.ManagementPrecision ==
'BY_PACKAGING') ? 'BY_PACKAGING' : 'BY_BATCH'
}
})
if (this.managementType == "BY_PACKAGING") {
that.isCheckLocation = getSwitchInfoByCode("PurchasePutawayToLocationCodeValidate")
if (that.isCheckLocation) {
that.toLocationCode = ""
} else {
that.toLocationCode = that.jobToLocationCode;
}
}else {
this.isCheckLocation=true;
}
//
if (this.scanMessage) {
this.openScanPopupSimulate(this.scanMessage)
}
} else {
that.showMessage('列表数据为0');
}
@ -277,7 +283,7 @@
updateData() {
console.log("updateData")
// this.calcHandleQty();
if (this.managementType == 'BY_BATCH' || managementPrecision == 'BY_QUANTITY') {
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
calcHandleQty(this.detailSource);
} else {
calcTreeHandleQty(this.detailSource)
@ -333,38 +339,7 @@
},
getScanResult(result, managementPrecision) {
this.managementType = managementPrecision
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)
// this.jobContent.allowModifyLocation = 'FALSE'
// this.jobContent.allowModifyBatch = 'FALSE'
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 = managementPrecision;
if (this.managementType == 'BY_BATCH' || managementPrecision == 'BY_QUANTITY') {
this.setDataBatch(result, managementPrecision)
} else {
@ -407,27 +382,9 @@
})
if (itemDetail == undefined) {
// let newItemDetail = {}
detail.subList.push({
scaned:true,
fromLocationCode:result.fromLocationCode,
toLocationCode:this.toLocationCode,
batch:result.label.batch,
handleQty:result.label.qty,
qty:this.recommendQty,
inventoryStatus:result.balance.inventoryStatus,
toLocation:result.balance.toLocation,
balance:result.balance,
balanceQty:result.balance.qty,
packQty:result.package.packQty,
packUnit:result.package.packUnit,
uom:result.balance.uom,
})
setTimeout(r => {
this.resizeCollapse();
this.$forceUpdate()
}, 100)
calcHandleQty(this.detailSource);
this.showErrorMessage("物料号【" + itemCode + "】" + "批次【" + batch + "】库位【" + locationCode +
"】不在列表中")
} else {
var scanedLength = 0;
itemDetail.packList.forEach(res => {
@ -577,13 +534,30 @@
this.showMessage(e.message)
}
},
scanLocationCode(location, code) {
//
if(this.jobContent.allowModifyLocation=="TRUE"){
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}else {
//
if(code==this.jobToLocationCode){
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}else {
this.showErrorMessage("扫描的库位【"+code+"】与推荐的库位【"+this.jobToLocationCode+"】不一致")
}
}
},
openDetail(item) {
@ -649,13 +623,16 @@
if (cur.scaned) {
scanCount++;
if (parseFloat(cur.qty) > parseFloat(cur.handleQty)) {
str += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}\n`
str +=
`物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}\n`
}
if (parseFloat(cur.qty) < parseFloat(cur.handleQty)) {
str1 += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于任务数量【${cur.qty}\n`
str1 +=
`物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于任务数量【${cur.qty}\n`
}
if (parseFloat(cur.handleQty) > parseFloat(cur.balanceQty)) {
str2 += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.balanceQty}\n`
str2 +=
`物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.balanceQty}\n`
}
}
})
@ -706,6 +683,9 @@
},
commit() {
if (!this.checkLocation()) {
return
}
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
@ -714,7 +694,9 @@
getManagementPrecisions(itemCodes, this.toLocationCode, 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'
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
this.checkBatch()
} else {

Loading…
Cancel
Save