|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="page-wraper"> |
|
|
<view class="page-wraper"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> |
|
|
<com-blank-view @goScan='openScanPopup' 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='split_line'></view> |
|
|
<view class='split_line'></view> |
|
@ -33,10 +33,9 @@ |
|
|
</view> |
|
|
</view> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
</view> |
|
|
</view> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"> |
|
|
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode" |
|
|
</win-scan-pack-and-location> |
|
|
:isCheckLocationBalance="false"> |
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' |
|
|
</winComScanBalance> |
|
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
|
|
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
@ -49,6 +48,7 @@ |
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getInventoryStatusName |
|
|
getInventoryStatusName |
|
@ -70,6 +70,10 @@ |
|
|
getPackingNumberAndBatchByList, |
|
|
getPackingNumberAndBatchByList, |
|
|
deepCopyData |
|
|
deepCopyData |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
Decimal |
|
|
|
|
|
} from 'decimal.js'; //引入 |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getBusinessType, |
|
|
getBusinessType, |
|
@ -87,6 +91,7 @@ |
|
|
comBlankView, |
|
|
comBlankView, |
|
|
winScanLocation, |
|
|
winScanLocation, |
|
|
winScanPackAndLocation, |
|
|
winScanPackAndLocation, |
|
|
|
|
|
winComScanBalance |
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
// fromInventoryStatus: { |
|
|
// fromInventoryStatus: { |
|
@ -130,7 +135,6 @@ |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
title: "", |
|
|
title: "", |
|
|
dataContent: {}, |
|
|
dataContent: {}, |
|
|
fromLocationAreaTypeList: [], |
|
|
|
|
|
toLocationAreaTypeList: [], |
|
|
toLocationAreaTypeList: [], |
|
|
isShowEditLocation: false |
|
|
isShowEditLocation: false |
|
|
} |
|
|
} |
|
@ -140,9 +144,8 @@ |
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.businessType = res.businessType; |
|
|
this.businessType = res.businessType; |
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; |
|
|
|
|
|
this.toLocationAreaTypeList = res.toLocationAreaTypeList; |
|
|
this.toLocationAreaTypeList = res.toLocationAreaTypeList; |
|
|
this.showFromLocationPopup(); |
|
|
this.openScanPopup(); |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage(res.message) |
|
|
this.showErrorMessage(res.message) |
|
|
} |
|
|
} |
|
@ -218,29 +221,26 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
if (this.fromLocationCode == "") { |
|
|
if (this.businessType) { |
|
|
this.showFromLocationPopup(); |
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
return |
|
|
} else { |
|
|
|
|
|
this.getBusinessType() |
|
|
} |
|
|
} |
|
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
|
|
|
|
|
}, |
|
|
}, |
|
|
showFromLocationPopup() { |
|
|
showFromLocationPopup() { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs.scanFromLocationCode.openScanPopup(); |
|
|
this.$refs.scanFromLocationCode.openScanPopup(); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getFromLocation(location) { |
|
|
|
|
|
this.fromLocationCode = location.code; |
|
|
|
|
|
this.fromLocationInfo = location; |
|
|
|
|
|
this.openScanPopup(); |
|
|
|
|
|
}, |
|
|
|
|
|
getToLocation(location, code) { |
|
|
getToLocation(location, code) { |
|
|
this.toLocationCode = code; |
|
|
this.toLocationCode = code; |
|
|
this.toLocationInfo = location; |
|
|
this.toLocationInfo = location; |
|
|
}, |
|
|
}, |
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
var balance = result.balance; |
|
|
let balance = result.balance; |
|
|
var pack = result.package; |
|
|
let label = result.label; |
|
|
|
|
|
let pack = result.package; |
|
|
|
|
|
|
|
|
var item = this.detailSource.find(res => { |
|
|
var item = this.detailSource.find(res => { |
|
|
if (res.itemCode == balance.itemCode) { |
|
|
if (res.itemCode == balance.itemCode) { |
|
|
return res |
|
|
return res |
|
@ -248,66 +248,142 @@ |
|
|
}) |
|
|
}) |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
// itemp.containerNumber="" |
|
|
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
if (newDetail.packingNumber == '') { |
|
|
newDetail.fromLocationCode = balance.locationCode |
|
|
newDetail.packingNumber = pack.number; |
|
|
|
|
|
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
|
|
if (balance.lableQty) { |
|
|
|
|
|
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.businessTypeCode == "Move") { |
|
|
if (this.businessTypeCode == "Move") { |
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
} else { |
|
|
} else { |
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
newDetail.fromLocationCode = result.fromLocationCode |
|
|
|
|
|
itemp.subList.push(newDetail); |
|
|
itemp.subList.push(newDetail); |
|
|
this.detailSource.push(itemp) |
|
|
this.detailSource.push(itemp) |
|
|
|
|
|
this.scanPopupGetFocus() |
|
|
} else { |
|
|
} else { |
|
|
var detail = item.subList.find(r => { |
|
|
var detail = item.subList.find(r => { |
|
|
if (r.packingNumber == pack.number && |
|
|
if (r.packingNumber == pack.number && |
|
|
r.batch == pack.batch && |
|
|
r.batch == balance.batch && |
|
|
r.fromLocationCode == balance.locationCode && |
|
|
r.fromLocationCode == balance.locationCode && |
|
|
r.toInventoryStatus == balance.inventoryStatus && |
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
r.scaned == true) { |
|
|
|
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
if (detail == undefined) { |
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
//如果最开始扫父,在扫子,提示已经扫描父包装 |
|
|
// newDetail.inventoryStatus = balance.inventoryStatus; |
|
|
//如果扫子在扫父,提示扫描的是父包装,是否移除子包装,是移除子包装,显示父包装 |
|
|
if (this.businessTypeCode == "Move") { |
|
|
//扫描的是子包装, |
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
if (pack.parentNumber) { |
|
|
|
|
|
var checkData = item.subList.find(r => { |
|
|
|
|
|
if (r.packingNumber == pack.parentNumber && |
|
|
|
|
|
r.batch == balance.batch && |
|
|
|
|
|
r.fromLocationCode == balance.locationCode) { |
|
|
|
|
|
return r; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (checkData) { |
|
|
|
|
|
//提示已经扫描 |
|
|
|
|
|
this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch + |
|
|
|
|
|
"]的父包装已经扫描") |
|
|
|
|
|
console.log("父包装已经扫描") |
|
|
|
|
|
} else { |
|
|
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
|
|
newDetail.fromLocationCode = balance.locationCode |
|
|
|
|
|
if (balance.lableQty) { |
|
|
|
|
|
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.businessTypeCode == "Move") { |
|
|
|
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
|
|
|
} else { |
|
|
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
|
|
} |
|
|
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
|
|
item.subList.push(newDetail); |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
//扫描的是父包装 |
|
|
|
|
|
var checkData = item.subList.find(r => { |
|
|
|
|
|
if (r.parentNumber == pack.number && |
|
|
|
|
|
r.batch == balance.batch && |
|
|
|
|
|
r.fromLocationCode == balance.locationCode) { |
|
|
|
|
|
return r; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (checkData) { |
|
|
|
|
|
//是否移除 |
|
|
|
|
|
this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber + "]" + "批次[" + |
|
|
|
|
|
balance |
|
|
|
|
|
.batch + "]是父包装,是否移除子包装", res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
item.subList = []; |
|
|
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
|
|
newDetail.fromLocationCode = balance.locationCode |
|
|
|
|
|
if (balance.lableQty) { |
|
|
|
|
|
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.businessTypeCode == "Move") { |
|
|
|
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
|
|
|
} else { |
|
|
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
|
|
} |
|
|
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
|
|
item.subList.push(newDetail); |
|
|
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
console.log("扫描的是父包装,是否移除子包装") |
|
|
|
|
|
} else { |
|
|
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
|
|
newDetail.fromLocationCode = balance.locationCode |
|
|
|
|
|
newDetail.parentNumber = pack.parentNumber; |
|
|
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
|
|
newDetail.packUnit = pack.packUnit; |
|
|
|
|
|
newDetail.packQty = pack.packQty; |
|
|
|
|
|
if (balance.lableQty) { |
|
|
|
|
|
newDetail.handleQty = new Decimal(0).toNumber( balance.lableQty) |
|
|
|
|
|
} |
|
|
|
|
|
if (this.businessTypeCode == "Move") { |
|
|
|
|
|
newDetail.toInventoryStatus = balance.inventoryStatus; |
|
|
|
|
|
} else { |
|
|
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
|
|
} |
|
|
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
|
|
item.subList.push(newDetail); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (newDetail.packingNumber == '') { |
|
|
this.scanPopupGetFocus() |
|
|
newDetail.packingNumber = pack.number; |
|
|
|
|
|
} |
|
|
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
|
|
newDetail.fromLocationCode = result.fromLocationCode |
|
|
|
|
|
item.subList.push(newDetail); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage("包装[" + detail.packingNumber + "]\n" + |
|
|
if (detail.scaned == true) { |
|
|
"批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" + |
|
|
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") |
|
|
"库存状态[" + getInventoryStatusName(detail.toInventoryStatus) + "]\n" + |
|
|
} |
|
|
"重复扫描") |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
calcHandleQty(this.detailSource); |
|
|
calcHandleQty(this.detailSource); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
showErrorMessage(message) { |
|
|
if (this.$refs.scanPopup) { |
|
|
this.scanPopupLoseFocus() |
|
|
this.$refs.scanPopup.packLoseFocus() |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
if (this.$refs.scanPopup) { |
|
|
this.scanPopupGetFocus() |
|
|
this.$refs.scanPopup.packGetFocus() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@ -388,6 +464,18 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
|
|
this.$refs.scanPopup.losefocus(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
submit() { |
|
|
submit() { |
|
|
//目标库位和状态都一致时不可以提交 |
|
|
//目标库位和状态都一致时不可以提交 |
|
|
var params = this.setParams() |
|
|
var params = this.setParams() |
|
@ -407,7 +495,6 @@ |
|
|
}); |
|
|
}); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
@ -476,6 +563,7 @@ |
|
|
|
|
|
|
|
|
submitItem.fromLocationCode = detail.fromLocationCode; |
|
|
submitItem.fromLocationCode = detail.fromLocationCode; |
|
|
submitItem.toLocationCode = detail.toLocationCode; |
|
|
submitItem.toLocationCode = detail.toLocationCode; |
|
|
|
|
|
submitItem.parentNumber =detail.parentNumber |
|
|
|
|
|
|
|
|
submitItem.package = null; |
|
|
submitItem.package = null; |
|
|
submitItem.Records = null; |
|
|
submitItem.Records = null; |
|
|