|
|
@ -11,9 +11,9 @@ |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" |
|
|
|
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" |
|
|
|
@updateData="updateData" @removePack="removePack"></record-com-detail-card> |
|
|
|
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation"> |
|
|
|
</record-com-detail-card> |
|
|
|
</view> |
|
|
|
<view class="split_line"></view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
@ -21,10 +21,12 @@ |
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%"> |
|
|
|
<view class=""> |
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation="getToLocationCode" |
|
|
|
:locationAreaTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
<!-- <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation="getToLocationCode"--> |
|
|
|
<!-- :locationAreaTypeList="tolocationTypeList"></requiredLocation>--> |
|
|
|
</view> |
|
|
|
<view class="uni-flex uni-row"> |
|
|
|
<button class="btn_single_reject" style="margin-right:5px ;" hover-class="btn_commit_after" |
|
|
|
@click="commit">取消</button> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -32,6 +34,8 @@ |
|
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
|
</view> |
|
|
|
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> |
|
|
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode' |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location> |
|
|
|
<com-message ref="comMessageRef" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -39,7 +43,7 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, getCurrentInstance, nextTick } from 'vue' |
|
|
|
import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' |
|
|
|
import { productPutawayRecordSubmit } from '@/api/request2.js' |
|
|
|
import { productPutawayRecordSubmit,getPutawayRecommendLocation } from '@/api/request2.js' |
|
|
|
import { goHome, getPackingNumberAndBatchByList, deepCopyData, updateTitle } from '@/common/basic.js' |
|
|
|
import { getPrecisionStrategyList } from '@/common/balance.js' |
|
|
|
|
|
|
@ -52,7 +56,7 @@ |
|
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' |
|
|
|
|
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
import { useCountStore } from '@/store' |
|
|
|
|
|
|
|
// 获取自定义的store |
|
|
@ -76,6 +80,8 @@ |
|
|
|
const scanPopup = ref() |
|
|
|
const comMessageRef = ref() |
|
|
|
const type = ref('') |
|
|
|
const editItem = ref(null) |
|
|
|
const toLocationAreaTypeList = ref([]) |
|
|
|
onLoad((option) => { |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: option.title |
|
|
@ -91,7 +97,8 @@ |
|
|
|
businessType.value = res.businessType |
|
|
|
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList |
|
|
|
tolocationTypeList.value = res.tolocationTypeList |
|
|
|
openScanPopup() |
|
|
|
toLocationAreaTypeList.value = res.toLocationAreaTypeList; |
|
|
|
openScanPopup() |
|
|
|
} else { |
|
|
|
showErrorMessage(res.message) |
|
|
|
} |
|
|
@ -109,13 +116,17 @@ |
|
|
|
const pack = result.package |
|
|
|
result.balance.forEach( |
|
|
|
balance => { |
|
|
|
var item = detailSource.value.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
let item = detailSource.value.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode && res.containerNumber == balance.parentPackingNumber) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
//查询推荐的目标库位 |
|
|
|
getRecommendLocation(balance, res => { |
|
|
|
itemp.toLocationCode = res.code; |
|
|
|
}) |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus; |
|
|
|
itemp.subList.push(newDetail); |
|
|
@ -144,6 +155,40 @@ |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
const getRecommendLocation = (balance, callback)=> { |
|
|
|
uni.showLoading({ |
|
|
|
title: '扫描中...', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
|
|
|
|
let param = { |
|
|
|
itemCode: balance.itemCode, |
|
|
|
batch: balance.batch, |
|
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
|
supplierCode: '', |
|
|
|
businessCode: this.bussinessCode |
|
|
|
}; |
|
|
|
console.log(JSON.stringify(param)) |
|
|
|
getPutawayRecommendLocation(param).then(res => { |
|
|
|
callback(res.data); |
|
|
|
uni.hideLoading(); |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
showErrorMessage(error); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//移除推荐的预占用库位 |
|
|
|
const removeRecommendLocation = ()=> { |
|
|
|
showMessage('移除推荐的预占用库位') |
|
|
|
} |
|
|
|
|
|
|
|
const showScanToLocation = (item)=> { |
|
|
|
editItem.value = item; |
|
|
|
setTimeout(r => { |
|
|
|
scanLocationCode.value.openScanPopup(); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const handleCalcHandleQty = () => { |
|
|
|
calcHandleQty(detailSource.value) |
|
|
@ -151,12 +196,14 @@ |
|
|
|
|
|
|
|
const removeItem = (index, item) => { |
|
|
|
detailSource.value.splice(index, 1) |
|
|
|
removeRecommendLocation() |
|
|
|
} |
|
|
|
const removePack = () => { |
|
|
|
for (let i = 0; i < detailSource.value.length; i++) { |
|
|
|
const item = detailSource.value[i] |
|
|
|
if (item.subList.length == 0) { |
|
|
|
detailSource.value.splice(i, 1) |
|
|
|
removeRecommendLocation() |
|
|
|
} |
|
|
|
} |
|
|
|
updateData() |
|
|
@ -325,16 +372,9 @@ |
|
|
|
const closeScanMessage = () => { |
|
|
|
scanPopupGetFocus() |
|
|
|
} |
|
|
|
const getLocation = (location, code) => { |
|
|
|
getFromLocationCode(location, code) |
|
|
|
} |
|
|
|
const getFromLocationCode = (location, code) => { |
|
|
|
fromLocationCode.value = code |
|
|
|
openScanPopup() |
|
|
|
} |
|
|
|
const getToLocationCode = (location, code) => { |
|
|
|
console.log(code) |
|
|
|
toLocationCode.value = code |
|
|
|
editItem.value.toLocationCode = code |
|
|
|
// detailSource.value.forEach((item) => { |
|
|
|
// item.subList.forEach((detail) => { |
|
|
|
// detail.toLocationCode = toLocationCode.value |
|
|
|