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