|
@ -1,12 +1,12 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!-- <page-meta root-font-size="18px"></page-meta> --> |
|
|
<!-- <page-meta root-font-size="18px"></page-meta> --> |
|
|
<view class=""> |
|
|
<view class="uni-flex" style="flex-direction: column"> |
|
|
<view class="" style="width: 100%; position: fixed; top: 20rpx; right: 0"> |
|
|
<view class="" style="width: 100%; position: fixed; top: 0; right: 0"> |
|
|
<com-blank-view @goScan="openScanPopup" v-if="locationCode == ''"></com-blank-view> |
|
|
<com-blank-view @goScan="openScanPopup" v-if="locationCode == ''"></com-blank-view> |
|
|
<location-info :locationDetail="locationDetail" v-if="locationCode"></location-info> |
|
|
<location-info :locationDetail="locationDetail" v-if="locationCode"></location-info> |
|
|
<z-tabs v-if="locationCode" :list="tabList" @change="tabChange" /> |
|
|
<z-tabs v-if="locationCode" :list="tabList" @change="tabChange" /> |
|
|
</view> |
|
|
</view> |
|
|
<view style="margin-top: 200rpx; width: 100%"> |
|
|
<view style="padding-top: 200rpx; width: 100%"> |
|
|
<view v-if="totalCount > 0" style="margin: 10rpx; font-size: 35rpx; font-weight: bold">总数 : {{ totalCount }} </view> |
|
|
<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 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="uni-flex uni-row" style="align-items: center; background-color: #fff; border-radius: 10rpx; margin: 10rpx"> |
|
@ -175,56 +175,104 @@ const getDetailList = (pageNo, pageSize, type) => { |
|
|
showMessage(error) |
|
|
showMessage(error) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
const getExpectin = (pageNo, pageSize, type) => { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '加载中...', |
|
|
|
|
|
mask: true |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (type === 'refresh') { |
|
|
|
|
|
pageNo.value = 1 |
|
|
|
|
|
dataList.value = [] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
|
pageNo: pageNo.value, |
|
|
|
|
|
pageSize, |
|
|
|
|
|
filters: [ |
|
|
|
|
|
{ |
|
|
|
|
|
column: 'locationCode', |
|
|
|
|
|
action: '==', |
|
|
|
|
|
value: locationCode.value |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const setShowList = (list) => { |
|
|
getExpectInByLocationCode(params) |
|
|
const resultlist = [] |
|
|
.then((res) => { |
|
|
list.forEach((res) => { |
|
|
uni.hideLoading() |
|
|
const temp = resultlist.find((res1) => res1.itemCode == res.itemCode) |
|
|
if (type === 'refresh') { |
|
|
if (temp == undefined) { |
|
|
uni.stopPullDownRefresh() |
|
|
const data = { |
|
|
|
|
|
itemCode: res.itemCode, |
|
|
|
|
|
qty: Number(res.qty), |
|
|
|
|
|
uom: res.uom, |
|
|
|
|
|
list: [] |
|
|
|
|
|
} |
|
|
|
|
|
var item = { |
|
|
|
|
|
packingNumber: res.packingNumber, |
|
|
|
|
|
batch: res.batch, |
|
|
|
|
|
uom: res.uom, |
|
|
|
|
|
qty: Number(res.qty), |
|
|
|
|
|
inventoryStatus: res.inventoryStatus |
|
|
|
|
|
} |
|
|
|
|
|
data.list.push(item) |
|
|
|
|
|
resultlist.push(data) |
|
|
|
|
|
} else { |
|
|
|
|
|
temp.qty = calc.add(temp.qty, res.qty) |
|
|
|
|
|
var item = { |
|
|
|
|
|
packingNumber: res.packingNumber, |
|
|
|
|
|
batch: res.batch, |
|
|
|
|
|
uom: res.uom, |
|
|
|
|
|
qty: Number(res.qty), |
|
|
|
|
|
inventoryStatus: res.inventoryStatus |
|
|
|
|
|
} |
|
|
|
|
|
temp.list.push(item) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
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) => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
showMessage(error) |
|
|
}) |
|
|
}) |
|
|
return resultlist |
|
|
|
|
|
} |
|
|
} |
|
|
const ontabtap = (e) => { |
|
|
const getExpectOut = (pageNo, pageSize, type) => { |
|
|
const index = e.target.dataset.current || e.currentTarget.dataset.current |
|
|
uni.showLoading({ |
|
|
tabIndex.value = index |
|
|
title: '加载中...', |
|
|
getContentByTab(tabIndex.value) |
|
|
mask: true |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (type === 'refresh') { |
|
|
|
|
|
pageNo.value = 1 |
|
|
|
|
|
dataList.value = [] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
|
pageNo: pageNo.value, |
|
|
|
|
|
pageSize, |
|
|
|
|
|
filters: [ |
|
|
|
|
|
{ |
|
|
|
|
|
column: 'locationCode', |
|
|
|
|
|
action: '==', |
|
|
|
|
|
value: locationCode.value |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getContentByTab = (index, pageNo, pageSize) => { |
|
|
getExpectOutByLocationCode(params) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
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) => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getContentByTab = (index, pageNo, pageSize, type) => { |
|
|
if (index === 0) { |
|
|
if (index === 0) { |
|
|
getSummary(pageNo, pageSize) |
|
|
getSummary(pageNo, pageSize, type) |
|
|
} else if (index === 1) { |
|
|
} else if (index === 1) { |
|
|
getDetailList(pageNo, pageSize) |
|
|
getDetailList(pageNo, pageSize, type) |
|
|
} else if (index === 2) { |
|
|
} else if (index === 2) { |
|
|
dataIn.value = balances.value |
|
|
getExpectin(pageNo, pageSize, type) |
|
|
} else if (index == 3) { |
|
|
} else if (index == 3) { |
|
|
dataOut.value = balances.value |
|
|
getExpectin(pageNo, pageSize, type) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -242,12 +290,7 @@ const afterCloseMessage = () => { |
|
|
} |
|
|
} |
|
|
const tabChange = (index) => { |
|
|
const tabChange = (index) => { |
|
|
tabIndex.value = index |
|
|
tabIndex.value = index |
|
|
paging.value.reload(true) |
|
|
getContentByTab(index, pageNo.value, pageSize.value, 'refresh') |
|
|
} |
|
|
|
|
|
const queryList = (pageNo, pageSize) => { |
|
|
|
|
|
if (locationCode.value != '') { |
|
|
|
|
|
getContentByTab(tabIndex.value, pageNo, pageSize) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|