|
|
@ -5,10 +5,11 @@ |
|
|
|
</view> |
|
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
|
<view class="page-header"> |
|
|
|
<view class="header_item"> |
|
|
|
来源库位 : {{fromLocationCode}} |
|
|
|
<view class="header-view"> |
|
|
|
<view class="header_item"> |
|
|
|
来源库位 : {{fromLocationCode}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-line /> |
|
|
|
</view> |
|
|
|
<view class="page-main"> |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
@ -16,7 +17,10 @@ |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" |
|
|
|
:isShowFromLocation="false" @removeItem="removeItem(index,item)" |
|
|
|
@updateData="updateData" @removePack="removePack"> |
|
|
|
:isShowModifedLocation="true" |
|
|
|
@updateData="updateData" |
|
|
|
@editLocation="showScanToLocation" |
|
|
|
@removePack="removePack"> |
|
|
|
</record-com-detail-card> |
|
|
|
</view> |
|
|
|
|
|
|
@ -43,14 +47,17 @@ |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
|
|
|
<win-scan-location ref="scanToLocationCode" title="目标库位" @getLocation='getToLocationCode' |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
putawayRecordSubmit, |
|
|
|
validateItemAndLocation, |
|
|
|
getPutawayRecommendLocation |
|
|
|
getPutawayRecommendLocation, |
|
|
|
checkItemCodeAndLocation, |
|
|
|
recommendLocationRemoveExpectin |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -116,7 +123,8 @@ |
|
|
|
showToLoaction: true, |
|
|
|
recommendLocationList: [], //推荐库位列表 |
|
|
|
fromWarehouseCode: '', //来源仓库 |
|
|
|
businessTypeCode: "PurchasePutaway" |
|
|
|
businessTypeCode: "PurchasePutaway", |
|
|
|
editItem:{} |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -168,6 +176,7 @@ |
|
|
|
// 获取推荐库位 |
|
|
|
this.getRecommendLocation(balance, pack, toLocation => { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
itemp.toLocationCode = toLocation.locationCode; |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.toLocationCode = toLocation.locationCode; |
|
|
|
newDetail.toWarehouseCode = toLocation.toWarehouseCode; |
|
|
@ -445,6 +454,7 @@ |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
getToLocationCode(location, code) { |
|
|
|
console.log( JSON.stringify(this.editItem) ) |
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
uni.showToast({ |
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
@ -452,7 +462,59 @@ |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.toLocationCode = code; |
|
|
|
var item = this.editItem.subList[0] |
|
|
|
if(item){ |
|
|
|
var param ={ |
|
|
|
batch:item.batch, |
|
|
|
inventoryStatus:item.inventoryStatus, |
|
|
|
itemCode:item.itemCode, |
|
|
|
toLocationCode:item.toLocationCode, |
|
|
|
expectinNumber: item.packingNumber + "-" + Date.now(), |
|
|
|
} |
|
|
|
checkItemCodeAndLocation(param).then(res=>{ |
|
|
|
if(res.data.recommendFlag){ |
|
|
|
this.editItem.toLocationCode = code; |
|
|
|
}else { |
|
|
|
if(res.data.errorMsg){ |
|
|
|
this.showErrorMessage(res.data.errorMsg) |
|
|
|
}else { |
|
|
|
if(res.data.balanceMsg){ |
|
|
|
this.$refs.comMessage.showQuestionMessage('已经有库存余额,是否继续上架?', res => { |
|
|
|
if (res) { |
|
|
|
}else { |
|
|
|
this.removeRecommendLocation(res.data.recommendList) |
|
|
|
} |
|
|
|
}); |
|
|
|
}else { |
|
|
|
this.editItem.toLocationCode = code; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}).catch(error=>{ |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//移除推荐的预占用库位 |
|
|
|
removeRecommendLocation(lst) { |
|
|
|
let param = { |
|
|
|
expectinNumberList: lst, |
|
|
|
}; |
|
|
|
recommendLocationRemoveExpectin(param).then(res => { |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
this.showErrorMessage('【' + lst.join(',') + '】移除预占用失败,请在PC端的预占用中移除') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showScanToLocation(item) { |
|
|
|
this.editItem = item; |
|
|
|
setTimeout(r => { |
|
|
|
this.$refs.scanToLocationCode.openScanPopup(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
@ -460,6 +522,17 @@ |
|
|
|
this.clear(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showQuestionMessage(hint) { |
|
|
|
this.$refs.comMessage.showQuestionMessage('已经有库存余额,是否继续上架?', res => { |
|
|
|
if (res) { |
|
|
|
}else { |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clear() { |
|
|
|
this.fromLocationInfo = {}; |
|
|
@ -467,6 +540,7 @@ |
|
|
|
this.fromWarehouseCode = ''; |
|
|
|
this.toWarehouseCode = ''; |
|
|
|
this.detailSource = []; |
|
|
|
this.editItem ={} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|