|
|
@ -8,10 +8,17 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card-batch :dataContent="item" :index="index" :settingParam="dataContent" |
|
|
|
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" |
|
|
|
:isShowModifedLocation="true" |
|
|
|
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation" |
|
|
|
v-if="managementType == 'BY_BATCH'||managementType =='BY_QUANTITY' "> |
|
|
|
</record-com-detail-card-batch > |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" |
|
|
|
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" |
|
|
|
:isShowModifedLocation="true" |
|
|
|
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation"> |
|
|
|
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation" |
|
|
|
v-else> |
|
|
|
</record-com-detail-card> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -42,6 +49,12 @@ |
|
|
|
|
|
|
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode' |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location> |
|
|
|
|
|
|
|
<win-scan-pack-and-location ref="winScanPackAndLocationRef" @getResult='getScanResult' :allowModifyLocation='false'> |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
<win-scan-location ref="winScanFromLocation" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -72,7 +85,8 @@ |
|
|
|
getBusinessType, |
|
|
|
createItemInfo, |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
calcHandleQty, |
|
|
|
calcHandleQtyAdd |
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -87,6 +101,8 @@ |
|
|
|
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' |
|
|
|
import { |
|
|
|
updateTitle |
|
|
|
} from '@/common/basic.js'; |
|
|
@ -100,7 +116,9 @@ |
|
|
|
recordComDetailCard, |
|
|
|
winScanPackage, |
|
|
|
winScanLocation, |
|
|
|
winComScanBalance |
|
|
|
winComScanBalance, |
|
|
|
winScanPackAndLocation, |
|
|
|
recordComDetailCardBatch |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -120,7 +138,8 @@ |
|
|
|
businessType: {}, |
|
|
|
managementList: [], |
|
|
|
type: '', |
|
|
|
editItem: null |
|
|
|
editItem: null, |
|
|
|
managementType:'' |
|
|
|
}; |
|
|
|
}, |
|
|
|
// 装配收货:type = 'assemble' |
|
|
@ -154,8 +173,140 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
getScanResult(result) { |
|
|
|
this.setData(result); |
|
|
|
getScanResult(result,managementTypeParams) { |
|
|
|
this.managementType = managementTypeParams |
|
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
this.setDataBatch(result) |
|
|
|
}else{ |
|
|
|
this.setData(result) |
|
|
|
} |
|
|
|
}, |
|
|
|
async setDataBatch(result) { |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
|
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
// itemp.containerNumber="" |
|
|
|
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 = balance.lableQty |
|
|
|
} |
|
|
|
newDetail.handleQty =0; |
|
|
|
newDetail.balanceQty =result.balance.qty; |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
this.itemCode = balance.itemCode; |
|
|
|
this.fromLocationCode = balance.locationCode |
|
|
|
await this.getRecommendLocation(balance,result) |
|
|
|
await this.scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.batch == balance.batch && |
|
|
|
r.fromLocationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
//如果最开始扫父,在扫子,提示已经扫描父包装 |
|
|
|
//如果扫子在扫父,提示扫描的是父包装,是否移除子包装,是移除子包装,显示父包装 |
|
|
|
//扫描的是子包装, |
|
|
|
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 = balance.lableQty |
|
|
|
} |
|
|
|
newDetail.handleQty =0; |
|
|
|
newDetail.balanceQty =result.balance.qty; |
|
|
|
item.subList.push(newDetail); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//扫描的是父包装 |
|
|
|
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 = balance.lableQty |
|
|
|
} |
|
|
|
newDetail.handleQty =0; |
|
|
|
newDetail.balanceQty =result.balance.qty; |
|
|
|
item.subList.push(newDetail); |
|
|
|
calcHandleQtyAdd(this.detailSource,result.label); |
|
|
|
} |
|
|
|
}) |
|
|
|
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 = balance.lableQty |
|
|
|
} |
|
|
|
newDetail.handleQty =0; |
|
|
|
newDetail.balanceQty =result.balance.qty; |
|
|
|
item.subList.push(newDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.scanPopupGetFocus() |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
// detail.handleQty = calc.add(detail.handleQty,result.label.qty) |
|
|
|
// this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQtyAdd(this.detailSource,result.label); |
|
|
|
}, |
|
|
|
|
|
|
|
async setData(result) { |
|
|
@ -421,7 +572,8 @@ |
|
|
|
openScanPopup() { |
|
|
|
if (this.businessType) { |
|
|
|
this.toLocationAreaTypeList = getDirectoryItemArray(this.businessType.inAreaTypes) |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
// this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
this.openFromLocationScanPopup() |
|
|
|
} else { |
|
|
|
this.getBusinessType() |
|
|
|
} |
|
|
@ -444,7 +596,18 @@ |
|
|
|
this.$refs.scanPopup.losefocus(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
openFromLocationScanPopup() { |
|
|
|
if (this.fromLocationCode == "") { |
|
|
|
this.showFromLocationPopup(); |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs.winScanPackAndLocationRef.openScanPopupForType(this.fromLocationCode, this.businessType); |
|
|
|
}, |
|
|
|
showFromLocationPopup() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.winScanFromLocation.openScanPopup(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
scanLocationCode(location, code) { |
|
|
|
this.toLocationCode = code |
|
|
|
this.detailSource.forEach(item => { |
|
|
@ -463,7 +626,15 @@ |
|
|
|
}); |
|
|
|
|
|
|
|
var params = this.setParams() |
|
|
|
|
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty) |
|
|
|
if(isHaveItem){ |
|
|
|
this.showErrorMessage(`物料号${isHaveItem.itemCode}`) |
|
|
|
this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']') |
|
|
|
uni.hideLoading() |
|
|
|
return |
|
|
|
} |
|
|
|
productPutawayRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
@ -574,7 +745,14 @@ |
|
|
|
getToLocationCode(location, code) { |
|
|
|
this.editItem.toLocationCode = code; |
|
|
|
}, |
|
|
|
|
|
|
|
getLocation(location, code) { |
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
}, |
|
|
|
getFromLocationCode(location, code) { |
|
|
|
this.fromLocationInfo = location; |
|
|
|
this.fromLocationCode = code; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.clearData(); |
|
|
|