logwire-wms-ui-test
Version:
运匠科技wms-PDA基础组件库
133 lines (121 loc) • 4.89 kB
JavaScript
/*
* 出库拣选 - 独立件和非独立件 使用到的公共方法
* @author: 张文
* @date 2022-06-20
* */
import {
projectWmsOutboundSubmitPickAbnormal,
projectWmsOutboundSubmitPickSplitDown,
projectWmsOutboundSubmitPickStockout
} from "../../../../../api/outbound/pick/alone";
export const aloneAndNotAlone = {
methods: {
// 格式化数据
formatData(res){
// 拣选单位中文翻译
const uomLabel = {
EA: {
top: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.min','最小销售数'),
table: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.minNum','最小销售')
},
IP: {
top: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.inNum','内装数'),
table: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.in','内装'),
},
CS: {
top: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.boxNum','箱装数'),
table: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.box','箱'),
},
PL: {
top: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.lpnNum','托装数'),
table: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.lpn','托'),
},
LPN: {
top: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.allLpn','整托盘'),
table: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.lpn','托'),
},
CASE: {
top: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.allBox','整箱'),
table: this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.box','箱'),
}
}
res.pendingPickLineList.forEach(item=>{
item.uomLabel = uomLabel[item.uom]
})
return res
},
// 确认缺货
lackConfirm(data){
const item = this.pickData.pendingPickLineList[this.taskIndex]
return projectWmsOutboundSubmitPickStockout({
pickId: this.pickData.pickId,
pickNo: this.pickData.pickNo,
fromLocationId: item.fromLocationId,
fromLpn: item.fromLpn,
ownerId: data.ownerId,
skuId: data.skuId,
stockoutQty: data.lackQty,
lineGroupKey: item.lineGroupKey,
})
},
// 确认异常
abnConfirm(data){
const item = this.pickData.pendingPickLineList[this.taskIndex]
return projectWmsOutboundSubmitPickAbnormal({
pickId: this.pickData.pickId,
pickNo: this.pickData.pickNo,
fromLocationId: item.fromLocationId,
fromLpn: item.fromLpn,
fromCase: item.fromCase,
ownerId: data.ownerId,
skuId: data.skuId,
lineGroupKey: item.lineGroupKey,
...data.data
})
},
// 确认拆板下架
splitConfirm(data){
const item = this.pickData.pendingPickLineList[this.taskIndex]
const split = this.splitPopup.data.splitDownData
projectWmsOutboundSubmitPickSplitDown({
pickId: this.pickData.pickId,
pickNo: this.pickData.pickNo,
fromLocationId: item.fromLocationId,
fromLpn: item.fromLpn,
ownerId: item.ownerId,
skuId: item.skuId,
masterLocationId: split.masterLocationId,
masterLocationCode: split.masterLocationCode,
...data
}).then(()=>{
this.$lwToast.success(
this.$lwLanguage.get('wms_project.pda.components.page.outbound.pick.mixin.aloneAndNotAlone.success','操作成功')
)
this.splitPopup.show = false
})
},
// 拆板下架弹出框关闭
splitOff(){
// 判断当前拣选任务是否完成
if (this.splitPopup.data.pickOrderFinish){
this.$refs.dataLookAndChange.openPickSuccessPopup()
return
}
this.pickData = this.formatData(this.splitPopup.data.pickTaskData)
this.checkTaskIndex(this.pickData.pendingPickLineList.length)
},
// 拣选明细行点击未拣选行
allPickClick(item){
if (item.pickStatus === '300') return
const wait = this.pickData.pendingPickLineList
for (let i = 0; i < wait.length; i++) {
if (wait[i].lineGroupKey === item.lineGroupKey){
this.taskIndex = i
this.tabActive = 'ing'
this.cutEnd()
return;
}
}
},
}
}