|
@ -4,6 +4,13 @@ |
|
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
|
|
|
<view class="page-header"> |
|
|
|
|
|
<view class="header_item"> |
|
|
|
|
|
来源库位:{{fromLocationCode}} |
|
|
|
|
|
</view> |
|
|
|
|
|
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="page-main"> |
|
|
<view class="page-main"> |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
@ -20,7 +27,7 @@ |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<targetContainer ref="scanContainer" title="托盘" :containerCode="containerCode" |
|
|
<targetContainer ref="scanContainer" title="器具" :containerCode="containerCode" |
|
|
@getContainer="getContainer"> |
|
|
@getContainer="getContainer"> |
|
|
</targetContainer> |
|
|
</targetContainer> |
|
|
</view> |
|
|
</view> |
|
@ -29,11 +36,12 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<win-scan-button @goScan='showFromLocationPopup'></win-scan-button> |
|
|
<win-scan-button @goScan='showScanPackagePopup'></win-scan-button> |
|
|
</view> |
|
|
</view> |
|
|
<win-scan-location ref="scanLocationPopup" title="库位" @getLocation="getFromLocation" |
|
|
<win-scan-location ref="scanLocationPopup" title="库位" @getLocation="getFromLocation" |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false"> |
|
|
|
|
|
</win-scan-pack-and-location> |
|
|
<!-- <win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> --> |
|
|
<!-- <win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> --> |
|
|
<com-message ref="comMessage"></com-message> |
|
|
<com-message ref="comMessage"></com-message> |
|
|
</view> |
|
|
</view> |
|
@ -136,43 +144,80 @@ |
|
|
getFromLocation(location) { |
|
|
getFromLocation(location) { |
|
|
if (location != null) { |
|
|
if (location != null) { |
|
|
this.fromLocationCode = location.code; |
|
|
this.fromLocationCode = location.code; |
|
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType) |
|
|
this.showScanPackagePopup(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showScanPackagePopup() { |
|
|
|
|
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
var packingNumber = result.label.packingNumber; |
|
|
let balance = result.balance; |
|
|
var batch = result.label.batch; |
|
|
let label = result.label; |
|
|
var qty = result.label.qty; |
|
|
let pack = result.package; |
|
|
var itemCode = result.label.itemCode; |
|
|
|
|
|
var pack = result.package; |
|
|
|
|
|
var item = this.detailSource.find(res => { |
|
|
var item = this.detailSource.find(res => { |
|
|
if (res.itemCode == itemCode) { |
|
|
if (res.itemCode == balance.itemCode) { |
|
|
return res |
|
|
return res |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
var itemp = createItemInfo(result.label, pack); |
|
|
var itemInfo = createItemInfo(balance, pack); |
|
|
let newDetail = createDetailInfo(result.label, pack); // |
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
itemp.subList.push(newDetail); |
|
|
itemInfo.subList.push(newDetail); |
|
|
this.detailSource.push(itemp) |
|
|
this.detailSource.push(itemInfo) |
|
|
} else { |
|
|
} else { |
|
|
var detail = item.subList.find(r => { |
|
|
var detail = item.subList.find(r => { |
|
|
if (r.packingNumber == packingNumber) { |
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
|
|
|
r.batch == balance.batch && |
|
|
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
|
|
r.inventoryStatus == balance.inventoryStatus && |
|
|
|
|
|
r.scaned == true) { |
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
if (detail == undefined) { |
|
|
let newDetail = createDetailInfo(result.label, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
item.subList.push(newDetail); |
|
|
item.subList.push(newDetail); |
|
|
} else { |
|
|
} else { |
|
|
if (detail.scaned == true) { |
|
|
this.showErrorMessage('箱码[' + balance.packingNumber + "]已经在列表中") |
|
|
this.showErrorMessage("箱码[" + packingNumber + "批次[" + batch + "]已经在列表中") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.calcHandleQty(); |
|
|
calcHandleQty(this.detailSource); |
|
|
this.scanPopupGetFocus(); |
|
|
// var packingNumber = result.label.packingNumber; |
|
|
|
|
|
// var batch = result.label.batch; |
|
|
|
|
|
// var qty = result.label.qty; |
|
|
|
|
|
// var itemCode = result.label.itemCode; |
|
|
|
|
|
// var pack = result.package; |
|
|
|
|
|
// var item = this.detailSource.find(res => { |
|
|
|
|
|
// if (res.itemCode == itemCode) { |
|
|
|
|
|
// return res |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// if (item == undefined) { |
|
|
|
|
|
// var itemp = createItemInfo(result.label, pack); |
|
|
|
|
|
// let newDetail = createDetailInfo(result.label, pack); // |
|
|
|
|
|
// itemp.subList.push(newDetail); |
|
|
|
|
|
// this.detailSource.push(itemp) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// var detail = item.subList.find(r => { |
|
|
|
|
|
// if (r.packingNumber == packingNumber) { |
|
|
|
|
|
// return r; |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// if (detail == undefined) { |
|
|
|
|
|
// let newDetail = createDetailInfo(result.label, pack); |
|
|
|
|
|
// item.subList.push(newDetail); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// if (detail.scaned == true) { |
|
|
|
|
|
// this.showErrorMessage("箱码[" + packingNumber + "批次[" + batch + "]已经在列表中") |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// this.calcHandleQty(); |
|
|
|
|
|
// this.scanPopupGetFocus(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
showErrorMessage(message) { |
|
@ -207,11 +252,11 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
scanPopupGetFocus() { |
|
|
this.$refs.scanPopup.getfocus(); |
|
|
this.$refs.scanPopup.packGetFocus(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
scanPopupLoseFocus() { |
|
|
this.$refs.scanPopup.losefocus(); |
|
|
this.$refs.scanPopup.packLoseFocus(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
@ -219,9 +264,44 @@ |
|
|
this.showMessage("请先选择托码") |
|
|
this.showMessage("请先选择托码") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.detailSource.length == 0) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
let params = this.getParams(); |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getParams() { |
|
|
|
|
|
var subList = [] |
|
|
|
|
|
var creator = this.$store.state.user.id |
|
|
|
|
|
let params = { |
|
|
|
|
|
number: this.containerCode, |
|
|
|
|
|
type: 'bind', |
|
|
|
|
|
status: 'USED', |
|
|
|
|
|
creator: creator |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
item.subList.forEach(detail => { |
|
|
|
|
|
if (detail.scaned) { |
|
|
|
|
|
detail.containerContentType = 'PACKAGE'; |
|
|
|
|
|
detail.contentNumber = detail.packingNumber; |
|
|
|
|
|
|
|
|
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
|
|
detail.batch = detail.batch; |
|
|
|
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
|
|
|
|
detail.package = null; |
|
|
|
|
|
subList.push(detail) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
params.subList = subList |
|
|
|
|
|
return params; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
showMessage(message) { |
|
|
setTimeout(r => { |
|
|
setTimeout(r => { |
|
|
this.scanPopupLoseFocus(); |
|
|
this.scanPopupLoseFocus(); |
|
@ -245,7 +325,7 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getContainer(containerInfo) { |
|
|
getContainer(containerInfo) { |
|
|
this.containerCode = containerInfo.Number; |
|
|
this.containerCode = containerInfo.number; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
showCommitSuccessMessage(hint) { |
|
|