|
@ -73,7 +73,7 @@ |
|
|
<win-scan-button @goScan='openScanPopup' v-if="fromLocation!=null"></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup' v-if="fromLocation!=null"></win-scan-button> |
|
|
<win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code> |
|
|
<win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code> |
|
|
<win-scan-by-code ref="scanToLocationPopup" title="目标库位" @getScanCode='getToLocation'></win-scan-by-code> |
|
|
<win-scan-by-code ref="scanToLocationPopup" title="目标库位" @getScanCode='getToLocation'></win-scan-by-code> |
|
|
<win-scan-by-pack ref="scanPackPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|
|
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode> |
|
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|
|
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|
|
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|
|
@afterCloseCommitMessage='closeCommitMessage'> |
|
|
@afterCloseCommitMessage='closeCommitMessage'> |
|
@ -84,7 +84,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
locations, |
|
|
locations, |
|
|
getBalancesByFilterAsync, |
|
|
getRecommendBalanceByLocationAsync, |
|
|
getWipListAsync, |
|
|
getWipListAsync, |
|
|
returnToWarehouse, |
|
|
returnToWarehouse, |
|
|
} from '@/api/index.js'; |
|
|
} from '@/api/index.js'; |
|
@ -105,6 +105,7 @@ |
|
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
|
|
import comBalance from '@/mycomponents/common/comBalance.vue' |
|
|
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|
|
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|
|
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue' |
|
|
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue' |
|
|
|
|
|
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'returnToWarehouse', |
|
|
name: 'returnToWarehouse', |
|
@ -118,7 +119,8 @@ |
|
|
comScanSemiPutaway, |
|
|
comScanSemiPutaway, |
|
|
comBalance, |
|
|
comBalance, |
|
|
winCollapseLocation, |
|
|
winCollapseLocation, |
|
|
SemiCollapseItem |
|
|
SemiCollapseItem, |
|
|
|
|
|
winScanByProductCode |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -214,105 +216,48 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
let that = this; |
|
|
let item = this.itemList.find(r => { |
|
|
that.currentLabel = result.data; |
|
|
return r.itemCode == result.itemCode |
|
|
let code = result.data.code; |
|
|
}); |
|
|
if (code) { |
|
|
|
|
|
let datas = []; |
|
|
|
|
|
//判断是否重复扫描 |
|
|
|
|
|
this.itemList.filter(r => { |
|
|
|
|
|
if (r.toPackingCode == code) { |
|
|
|
|
|
datas.push(r); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (datas.length > 0) { |
|
|
|
|
|
this.showRescanMessage('箱码【' + code + '】已经存在,是否要重新扫描?'); |
|
|
|
|
|
// showConfirmMsg('箱码【' + code + '】已经存在,是否要重新扫描?', confirm => { |
|
|
|
|
|
// if (confirm) { |
|
|
|
|
|
// that.itemList.forEach((r, i) => { |
|
|
|
|
|
// if (r.toPackingCode == code) { |
|
|
|
|
|
// that.itemList.splice(i, 1); |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
// that.getLabel(); |
|
|
|
|
|
// } |
|
|
|
|
|
// }); |
|
|
|
|
|
} else { |
|
|
|
|
|
that.getLabel(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item) { |
|
|
|
|
|
this.showMessage("物料[" + result.itemCode + "]已经扫描") |
|
|
} else { |
|
|
} else { |
|
|
this.showMessage('请先扫描箱标签'); |
|
|
this.getLabel(result.itemCode); |
|
|
return; |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//重新扫描 |
|
|
|
|
|
afterRescan(val) { |
|
|
|
|
|
let that = this; |
|
|
|
|
|
if (confirm) { |
|
|
|
|
|
that.itemList.forEach((r, i) => { |
|
|
|
|
|
if (r.toPackingCode == that.currentLabel.packingCode) { |
|
|
|
|
|
that.itemList.splice(i, 1); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
that.getLabel(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.scanPopupGetFocus(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getLabel() { |
|
|
async getLabel(itemCode) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '扫描中...', |
|
|
title: '扫描中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
let balanceParams = { |
|
|
let balanceParams = [this.fromLocation.code] |
|
|
pageSize: 100, |
|
|
|
|
|
pageIndex: 1, |
|
|
|
|
|
packingCode: that.currentLabel.packingCode, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
let balanceRes = await getBalancesByFilterAsync(balanceParams); |
|
|
|
|
|
if (balanceRes.totalCount > 0) { |
|
|
|
|
|
let locationCode = balanceRes.items[0].locationCode; |
|
|
|
|
|
this.showScanMessage('箱码【' + that.currentLabel.packingCode + '】在【' + locationCode + |
|
|
|
|
|
'】库位已经有库存信息,请重新扫描箱码'); |
|
|
|
|
|
} else { |
|
|
|
|
|
let itemInfo = that.itemList.find(r => { |
|
|
|
|
|
return r.itemCode == that.currentLabel.itemCode |
|
|
|
|
|
}) |
|
|
|
|
|
if (itemInfo == undefined) { |
|
|
|
|
|
let params = { |
|
|
|
|
|
locationCode: that.fromLocation.code, |
|
|
|
|
|
itemCode: that.currentLabel.itemCode |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
let wipRes = await getWipListAsync(params); |
|
|
let balanceRes = await getRecommendBalanceByLocationAsync(balanceParams,itemCode,false); |
|
|
if (wipRes.totalCount == 0) { |
|
|
if (balanceRes.length == 0) { |
|
|
this.showScanMessage('零件【' + that.currentLabel.itemCode + '】在【' + this.fromLocation.code + |
|
|
this.showScanMessage('零件【' + itemCode + '】在【' + this.fromLocation.code + |
|
|
'】库位没有库存信息,不可以退库'); |
|
|
'】库位没有库存信息,不可以退库'); |
|
|
} else { |
|
|
} else { |
|
|
let balanceItem = wipRes.items[0]; |
|
|
let balanceItem = balanceRes[0]; |
|
|
let item = { |
|
|
let item = { |
|
|
itemCode: that.currentLabel.itemCode, |
|
|
itemCode: itemCode, |
|
|
|
|
|
itemName:balanceItem.itemName, |
|
|
totalQty: balanceItem.qty, |
|
|
totalQty: balanceItem.qty, |
|
|
uom: balanceItem.uom, |
|
|
uom: balanceItem.uom, |
|
|
|
|
|
locationCode:this.fromLocation.code, |
|
|
scanQty: 0, |
|
|
scanQty: 0, |
|
|
|
|
|
qty:balanceItem.qty, |
|
|
status: balanceItem.status, |
|
|
status: balanceItem.status, |
|
|
balanceItem: balanceItem, |
|
|
balanceItem: balanceItem, |
|
|
labelList: [] |
|
|
labelList: [] |
|
|
}; |
|
|
}; |
|
|
this.addLabel(item); |
|
|
this.addLabel(item); |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.addLabel(itemInfo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
}, |
|
|
}, |
|
@ -320,40 +265,30 @@ |
|
|
addLabel(item) { |
|
|
addLabel(item) { |
|
|
//没有标签 |
|
|
//没有标签 |
|
|
if (item.labelList.length == 0) { |
|
|
if (item.labelList.length == 0) { |
|
|
if (this.currentLabel.qty > item.totalQty) { |
|
|
|
|
|
this.showScanMessage('标签数量【' + this.currentLabel.qty + |
|
|
|
|
|
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库') |
|
|
|
|
|
} else { |
|
|
|
|
|
let data = this.itemList.find(r => r.itemCode == item.itemCode) |
|
|
let data = this.itemList.find(r => r.itemCode == item.itemCode) |
|
|
if (data == undefined) { |
|
|
if (data == undefined) { |
|
|
this.itemList.push(item) |
|
|
this.itemList.push(item) |
|
|
} |
|
|
} |
|
|
this.calcScanQty(item, 0) |
|
|
this.calcScanQty(item, 0) |
|
|
item.labelList.unshift(this.currentLabel); |
|
|
item.labelList.unshift(item); |
|
|
this.scanPopupGetFocus(); |
|
|
this.scanPopupGetFocus(); |
|
|
} |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
let scanQty = 0; |
|
|
let scanQty = 0; |
|
|
item.labelList.forEach(r => { |
|
|
item.labelList.forEach(r => { |
|
|
scanQty += Number(r.qty) |
|
|
scanQty += Number(r.qty) |
|
|
}) |
|
|
}) |
|
|
if (scanQty + this.currentLabel.qty > item.totalQty) { |
|
|
|
|
|
this.showScanMessage('已扫描数量【' + scanQty + '】加标签数量【' + this.currentLabel.qty + |
|
|
|
|
|
'】大于零件的库存数量【' + item.totalQty + '】,不可以退库') |
|
|
|
|
|
} else { |
|
|
|
|
|
this.calcScanQty(item, scanQty) |
|
|
this.calcScanQty(item, scanQty) |
|
|
item.labelList.unshift(this.currentLabel); |
|
|
item.labelList.unshift(item); |
|
|
this.scanPopupGetFocus(); |
|
|
this.scanPopupGetFocus(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
calcScanQty(item, scanQty) { |
|
|
calcScanQty(item, scanQty) { |
|
|
item.scanQty = scanQty + this.currentLabel.qty; |
|
|
item.scanQty = scanQty + item.qty; |
|
|
|
|
|
|
|
|
//标签赋默认值 |
|
|
//标签赋默认值 |
|
|
this.currentLabel.locationCode = this.fromLocation.code; |
|
|
// this.item.locationCode = this.fromLocation.code; |
|
|
this.currentLabel.status = 2; |
|
|
// this.item.status = 2; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
scanToLocation(item) { |
|
|
scanToLocation(item) { |
|
@ -475,6 +410,7 @@ |
|
|
|
|
|
|
|
|
let item = this.getSubmitParam(); |
|
|
let item = this.getSubmitParam(); |
|
|
let params = JSON.stringify(item); |
|
|
let params = JSON.stringify(item); |
|
|
|
|
|
console.log("提交",params) |
|
|
returnToWarehouse(params) |
|
|
returnToWarehouse(params) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
that.showCommitSuccess(); |
|
|
that.showCommitSuccess(); |
|
@ -510,9 +446,9 @@ |
|
|
detail.stdPackQty = balanceItem.stdPackQty; |
|
|
detail.stdPackQty = balanceItem.stdPackQty; |
|
|
|
|
|
|
|
|
detail.fromPackingCode = balanceItem.packingCode; |
|
|
detail.fromPackingCode = balanceItem.packingCode; |
|
|
detail.toPackingCode = l.packingCode; |
|
|
detail.toPackingCode = ""; |
|
|
detail.fromLot = balanceItem.lot; |
|
|
detail.fromLot = balanceItem.lot; |
|
|
detail.toLot = l.lot; |
|
|
detail.toLot = ""; |
|
|
|
|
|
|
|
|
detail.fromLocationCode = that.fromLocation.code; |
|
|
detail.fromLocationCode = that.fromLocation.code; |
|
|
detail.fromLocationErpCode = that.fromLocation.erpLocationCode; |
|
|
detail.fromLocationErpCode = that.fromLocation.erpLocationCode; |
|
@ -545,7 +481,8 @@ |
|
|
detail.recommendExpireDate = l.expireDate; |
|
|
detail.recommendExpireDate = l.expireDate; |
|
|
detail.recommendLot = balanceItem.lot;; |
|
|
detail.recommendLot = balanceItem.lot;; |
|
|
detail.recommendToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|
|
detail.recommendToLocationCode = l.toLocationCode ?? that.defaultToLocation.code; |
|
|
detail.recommendToLocationArea = l.toLocationArea ?? that.defaultToLocation.areaCode; |
|
|
detail.recommendToLocationArea = l.toLocationArea ?? that.defaultToLocation |
|
|
|
|
|
.areaCode; |
|
|
detail.recommendToLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|
|
detail.recommendToLocationGroup = l.toLocationGroup ?? that.defaultToLocation |
|
|
.locationGroupCode; |
|
|
.locationGroupCode; |
|
|
detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|
|
detail.recommendToLocationErpCode = l.toLocationErpCode ?? that.defaultToLocation |
|
|