|
|
@ -1,25 +1,21 @@ |
|
|
|
<template> |
|
|
|
<!-- <page-meta root-font-size="18px"></page-meta> --> |
|
|
|
<view class=""> |
|
|
|
<com-blank-view @goScan="openScanPopup" v-if="locationCode == ''"></com-blank-view> |
|
|
|
|
|
|
|
<my-paging v-show="locationCode != ''" ref="paging" v-model="dataList" @query="queryList"> |
|
|
|
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中,如果需要跟着滚动,则不要设置slot="top" --> |
|
|
|
<template #top> |
|
|
|
<view v-if="locationCode != ''"> |
|
|
|
<location-info :locationDetail="locationDetail" v-if="locationCode"></location-info> |
|
|
|
<z-tabs :list="tabList" @change="tabChange" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view class="" style="padding-bottom: 50rpx"> |
|
|
|
<view v-if="tabIndex == 0" v-for="(item, index) in dataList"> |
|
|
|
<comLocationDetailCard :isShowPack="false" :dataContent="item" style="margin: 20rpx"> </comLocationDetailCard> |
|
|
|
</view> |
|
|
|
<view v-if="tabIndex == 1" v-for="(item, index) in dataList"> |
|
|
|
<comLocationDetailCard :dataContent="item" style="margin: 20rpx"></comLocationDetailCard> |
|
|
|
<view class="" style="width: 100%; position: fixed; top: 20rpx; right: 0"> |
|
|
|
<com-blank-view @goScan="openScanPopup" v-if="locationCode == ''"></com-blank-view> |
|
|
|
<location-info :locationDetail="locationDetail" v-if="locationCode"></location-info> |
|
|
|
<z-tabs v-if="locationCode" :list="tabList" @change="tabChange" /> |
|
|
|
</view> |
|
|
|
<view style="margin-top: 200rpx; width: 100%"> |
|
|
|
<view v-if="totalCount > 0" style="margin: 10rpx; font-size: 35rpx; font-weight: bold">总数 : {{ totalCount }} </view> |
|
|
|
<view v-for="(item, index) in dataList" style="width: 100%"> |
|
|
|
<view class="uni-flex uni-row" style="align-items: center; background-color: #fff; border-radius: 10rpx; margin: 10rpx"> |
|
|
|
<view class="" style="font-size: 35rpx"> ({{ index + 1 }}) </view> |
|
|
|
<comLocationDetailCard :isShowPack="false" :dataContent="item" style="margin: 10rpx"> </comLocationDetailCard> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</my-paging> |
|
|
|
<uni-load-more :status="loadingType" v-if="dataList.length > 0" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan="openScanPopup" v-if="locationCode != ''"></win-scan-button> |
|
|
|
<winScanLocation ref="scanPopup" title="库位代码" @getLocation="getScanCode"></winScanLocation> |
|
|
@ -32,7 +28,7 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, getCurrentInstance, nextTick, onMounted, watch } from 'vue' |
|
|
|
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' |
|
|
|
import { getBalanceByLocationcode, getBalanceByLocationcodeGroup } from '@/api/request2.js' |
|
|
|
import { getBalanceByLocationcode, getBalanceByLocationcodeGroup, getExpectInByLocationCode, getExpectOutByLocationCode } from '@/api/request2.js' |
|
|
|
|
|
|
|
import { maxPageSize, goHome } from '@/common/basic.js' |
|
|
|
|
|
|
@ -51,14 +47,17 @@ const summarys = ref([]) |
|
|
|
const balances = ref([]) |
|
|
|
const dataIn = ref([]) |
|
|
|
const dataOut = ref([]) |
|
|
|
const pageNo = ref(1) |
|
|
|
// 每页数据量 |
|
|
|
const pageSize = ref(1000) |
|
|
|
const pageSize = ref(10) |
|
|
|
// 当前页 |
|
|
|
const pageCurrent = ref(1) |
|
|
|
// 数据总量 |
|
|
|
const dataList = ref([]) |
|
|
|
const tabList = ref(['汇总', '明细']) |
|
|
|
const tabList = ref(['汇总', '明细', '预计入', '预计出']) |
|
|
|
const tabIndex = ref(0) |
|
|
|
const loadingType = ref('nomore') |
|
|
|
const totalCount = ref(0) |
|
|
|
const scanPopup = ref() |
|
|
|
const modal = ref() |
|
|
|
const paging = ref() |
|
|
@ -74,6 +73,18 @@ onNavigationBarButtonTap((e) => { |
|
|
|
onMounted(() => { |
|
|
|
openScanPopup() |
|
|
|
}) |
|
|
|
onPullDownRefresh(() => { |
|
|
|
getContentByTab(tabIndex.value, pageNo.value, pageSize.value, 'refresh') |
|
|
|
}) |
|
|
|
|
|
|
|
onReachBottom(() => { |
|
|
|
console.log('底部') |
|
|
|
// 避免多次触发 |
|
|
|
if (loadingType.value == 'loading' || loadingType.value == 'nomore') { |
|
|
|
return |
|
|
|
} |
|
|
|
getContentByTab(tabIndex.value, pageNo.value, pageSize.value, 'more') |
|
|
|
}) |
|
|
|
const openScanPopup = (val) => { |
|
|
|
scanPopup.value.openScanPopup() |
|
|
|
} |
|
|
@ -92,23 +103,35 @@ const getScanCode = (location, code) => { |
|
|
|
// this.getContentByTab(this.tabIndex); |
|
|
|
} |
|
|
|
|
|
|
|
const getSummary = (pageNo, pageSize) => { |
|
|
|
const getSummary = (pageNo, pageSize, type) => { |
|
|
|
proxy.$modal.loading('加载中....') |
|
|
|
loadingType.value = 'loading' |
|
|
|
if (type === 'refresh') { |
|
|
|
pageNo.value = 1 |
|
|
|
dataList.value = [] |
|
|
|
} |
|
|
|
|
|
|
|
const params = { |
|
|
|
itemCode: itemCode.value, |
|
|
|
pageNo, |
|
|
|
locationCode: locationCode.value, |
|
|
|
pageNo: pageNo.value, |
|
|
|
pageSize |
|
|
|
} |
|
|
|
|
|
|
|
getBalanceByLocationcodeGroup(params) |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data.list.length > 0) { |
|
|
|
summarysList.value = setShowList(res.data.list) |
|
|
|
paging.value.complete(summarysList.value) |
|
|
|
} else { |
|
|
|
paging.value.complete(false) |
|
|
|
showMessage(`未查找到库位【${locationCode.value}】`) |
|
|
|
if (type === 'refresh') { |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
} |
|
|
|
const { list } = res.data |
|
|
|
totalCount.value = res.data.total |
|
|
|
loadingType.value = 'loadmore' |
|
|
|
if (list == null || list.length == 0) { |
|
|
|
loadingType.value = 'nomore' |
|
|
|
return |
|
|
|
} |
|
|
|
dataList.value = type === 'refresh' ? list : dataList.value.concat(list) |
|
|
|
pageNo.value++ |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
paging.value.complete(false) |
|
|
@ -117,24 +140,34 @@ const getSummary = (pageNo, pageSize) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const getDetailList = (pageNo, pageSize) => { |
|
|
|
const getDetailList = (pageNo, pageSize, type) => { |
|
|
|
proxy.$modal.loading('加载中....') |
|
|
|
loadingType.value = 'loading' |
|
|
|
if (type === 'refresh') { |
|
|
|
pageNo.value = 1 |
|
|
|
dataList.value = [] |
|
|
|
} |
|
|
|
|
|
|
|
const params = { |
|
|
|
locationCode: locationCode.value, |
|
|
|
pageNo, |
|
|
|
pageNo: pageNo.value, |
|
|
|
pageSize |
|
|
|
} |
|
|
|
getBalanceByLocationcode(params) |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data.list.length > 0) { |
|
|
|
detailList.value = setShowList(res.data.list) |
|
|
|
paging.value.complete(detailList.value) |
|
|
|
} else { |
|
|
|
paging.value.complete(false) |
|
|
|
showMessage(`未查找到库位w【${locationCode.value}】`) |
|
|
|
if (type === 'refresh') { |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
} |
|
|
|
const { list } = res.data |
|
|
|
totalCount.value = res.data.total |
|
|
|
loadingType.value = 'loadmore' |
|
|
|
if (list == null || list.length == 0) { |
|
|
|
loadingType.value = 'nomore' |
|
|
|
return |
|
|
|
} |
|
|
|
dataList.value = type === 'refresh' ? list : dataList.value.concat(list) |
|
|
|
pageNo.value++ |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
paging.value.complete(false) |
|
|
|