|
@ -1,28 +1,27 @@ |
|
|
<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; " > |
|
|
|
|
|
<view class="" style="font-size:35rpx; "> |
|
|
</template> |
|
|
({{index+1}}) |
|
|
<view class="" style="padding-bottom: 50rpx;"> |
|
|
</view> |
|
|
<view v-if="tabIndex == 0" v-for="(item, index) in dataList"> |
|
|
|
|
|
<comLocationDetailCard :isShowPack="false" :dataContent="item" style='margin: 10rpx;'> |
|
|
<comLocationDetailCard :isShowPack="false" :dataContent="item" style='margin: 10rpx;'> |
|
|
</comLocationDetailCard> |
|
|
</comLocationDetailCard> |
|
|
</view> |
|
|
</view> |
|
|
<view v-if="tabIndex == 1" v-for="(item, index) in dataList"> |
|
|
|
|
|
<comLocationDetailCard :dataContent="item" style='margin: 10rpx;'></comLocationDetailCard> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<uni-load-more :status="loadingType" v-if="dataList.length>0" /> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</my-paging> |
|
|
|
|
|
|
|
|
|
|
|
<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> |
|
@ -36,17 +35,19 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
getBalanceByLocationcode, |
|
|
getBalanceByLocationcode, |
|
|
getBalanceByLocationcodeGroup |
|
|
getBalanceByLocationcodeGroup, |
|
|
|
|
|
getExpectInByLocationCode, |
|
|
|
|
|
getExpectOutByLocationCode |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
maxPageSize, |
|
|
maxPageSize, |
|
|
goHome |
|
|
goHome |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
calc |
|
|
calc |
|
|
} from '@/common/calc.js'; |
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
|
import locationInfo from '@/mycomponents/location/locationInfo.vue' |
|
|
import locationInfo from '@/mycomponents/location/locationInfo.vue' |
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
@ -72,15 +73,18 @@ |
|
|
balances: [], |
|
|
balances: [], |
|
|
dataIn: [], |
|
|
dataIn: [], |
|
|
dataOut: [], |
|
|
dataOut: [], |
|
|
|
|
|
pageNo: 1, |
|
|
// 每页数据量 |
|
|
// 每页数据量 |
|
|
pageSize: 1000, |
|
|
pageSize: 10, |
|
|
// 当前页 |
|
|
// 当前页 |
|
|
pageCurrent: 1, |
|
|
pageCurrent: 1, |
|
|
// 数据总量 |
|
|
// 数据总量 |
|
|
|
|
|
|
|
|
dataList: [], |
|
|
dataList: [], |
|
|
tabList: ['汇总', '明细'], |
|
|
tabList: ['汇总', '明细', '预计入', '预计出'], |
|
|
tabIndex: 0, |
|
|
tabIndex: 0, |
|
|
|
|
|
loadingType: "nomore", |
|
|
|
|
|
totalCount:0 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad() {}, |
|
|
onLoad() {}, |
|
@ -95,6 +99,21 @@ |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.openScanPopup() |
|
|
this.openScanPopup() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
|
|
|
this.getContentByTab(this.tabIndex, this.pageNo, this.pageSize, "refresh"); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onReachBottom() { |
|
|
|
|
|
console.log("底部") |
|
|
|
|
|
//避免多次触发 |
|
|
|
|
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.getContentByTab(this.tabIndex, this.pageNo, this.pageSize, "more"); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
@ -112,114 +131,181 @@ |
|
|
// this.getContentByTab(this.tabIndex); |
|
|
// this.getContentByTab(this.tabIndex); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getSummary(pageNo, pageSize) { |
|
|
getSummary(pageNo, pageSize, type) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中...", |
|
|
title: "加载中...", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
this.loadingType = "loading"; |
|
|
|
|
|
if (type === "refresh") { |
|
|
|
|
|
this.pageNo = 1; |
|
|
|
|
|
this.dataList = []; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var params = { |
|
|
var params = { |
|
|
itemCode: this.itemCode, |
|
|
locationCode: this.locationCode, |
|
|
pageNo: pageNo, |
|
|
pageNo: this.pageNo, |
|
|
pageSize: pageSize |
|
|
pageSize: pageSize |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getBalanceByLocationcodeGroup(params).then(res => { |
|
|
getBalanceByLocationcodeGroup(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
if (res.data.list.length > 0) { |
|
|
if (type === "refresh") { |
|
|
this.summarysList = this.setShowList(res.data.list) |
|
|
uni.stopPullDownRefresh(); |
|
|
this.$refs.paging.complete(this.summarysList); |
|
|
} |
|
|
|
|
|
var list = res.data.list; |
|
|
} else { |
|
|
this.totalCount = res.data.total |
|
|
this.$refs.paging.complete(false); |
|
|
this.loadingType = "loadmore"; |
|
|
this.showMessage('未查找到库位【' + this.locationCode + '】'); |
|
|
if (list == null || list.length == 0) { |
|
|
|
|
|
this.loadingType = "nomore"; |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
this.dataList = type === "refresh" ? list : this.dataList.concat(list); |
|
|
|
|
|
this.pageNo++; |
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
this.$refs.paging.complete(false); |
|
|
|
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
this.showMessage(error); |
|
|
this.showMessage(error); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getDetailList(pageNo, pageSize) { |
|
|
getDetailList(pageNo, pageSize, type) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中...", |
|
|
title: "加载中...", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.loadingType = "loading"; |
|
|
|
|
|
if (type === "refresh") { |
|
|
|
|
|
this.pageNo = 1; |
|
|
|
|
|
this.dataList = []; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var params = { |
|
|
var params = { |
|
|
locationCode: this.locationCode, |
|
|
locationCode: this.locationCode, |
|
|
pageNo: pageNo, |
|
|
pageNo: this.pageNo, |
|
|
pageSize: pageSize |
|
|
pageSize: pageSize |
|
|
} |
|
|
} |
|
|
getBalanceByLocationcode(params).then(res => { |
|
|
getBalanceByLocationcode(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
if (res.data.list.length > 0) { |
|
|
if (type === "refresh") { |
|
|
this.detailList = this.setShowList(res.data.list) |
|
|
uni.stopPullDownRefresh(); |
|
|
this.$refs.paging.complete(this.detailList); |
|
|
} |
|
|
} else { |
|
|
var list = res.data.list; |
|
|
this.$refs.paging.complete(false); |
|
|
this.totalCount = res.data.total |
|
|
this.showMessage('未查找到库位w【' + this.locationCode + '】'); |
|
|
this.loadingType = "loadmore"; |
|
|
|
|
|
if (list == null || list.length == 0) { |
|
|
|
|
|
this.loadingType = "nomore"; |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
this.dataList = type === "refresh" ? list : this.dataList.concat(list); |
|
|
|
|
|
this.pageNo++; |
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
this.$refs.paging.complete(false); |
|
|
|
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
this.showMessage(error); |
|
|
this.showMessage(error); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setShowList(list) { |
|
|
getExpectin(pageNo, pageSize, type) { |
|
|
var resultlist = []; |
|
|
let that = this; |
|
|
list.forEach(res => { |
|
|
uni.showLoading({ |
|
|
var temp = resultlist.find(res1 => |
|
|
title: "加载中...", |
|
|
res1.itemCode == res.itemCode) |
|
|
mask: true |
|
|
|
|
|
}); |
|
|
if (temp == undefined) { |
|
|
|
|
|
var data = { |
|
|
if (type === "refresh") { |
|
|
itemCode: res.itemCode, |
|
|
this.pageNo = 1; |
|
|
qty: Number(res.qty), |
|
|
this.dataList = []; |
|
|
uom: res.uom, |
|
|
} |
|
|
list: [] |
|
|
|
|
|
} |
|
|
var params = { |
|
|
var item = { |
|
|
pageNo: this.pageNo, |
|
|
packingNumber: res.packingNumber, |
|
|
pageSize: pageSize, |
|
|
batch: res.batch, |
|
|
filters: [{ |
|
|
uom: res.uom, |
|
|
column: "locationCode", |
|
|
qty: Number(res.qty), |
|
|
action: "==", |
|
|
inventoryStatus: res.inventoryStatus, |
|
|
value: this.locationCode |
|
|
} |
|
|
|
|
|
data.list.push(item) |
|
|
}] |
|
|
resultlist.push(data) |
|
|
} |
|
|
} else { |
|
|
|
|
|
temp.qty = calc.add(temp.qty,res.qty) |
|
|
getExpectInByLocationCode(params).then(res => { |
|
|
var item = { |
|
|
uni.hideLoading(); |
|
|
packingNumber: res.packingNumber, |
|
|
if (type === "refresh") { |
|
|
batch: res.batch, |
|
|
uni.stopPullDownRefresh(); |
|
|
uom: res.uom, |
|
|
|
|
|
qty: Number(res.qty), |
|
|
|
|
|
inventoryStatus: res.inventoryStatus, |
|
|
|
|
|
} |
|
|
|
|
|
temp.list.push(item) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
var list = res.data.list; |
|
|
|
|
|
this.totalCount = res.data.total |
|
|
|
|
|
this.loadingType = "loadmore"; |
|
|
|
|
|
if (list == null || list.length == 0) { |
|
|
|
|
|
this.loadingType = "nomore"; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.dataList = type === "refresh" ? list : this.dataList.concat(list); |
|
|
|
|
|
this.pageNo++; |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showMessage(error); |
|
|
}) |
|
|
}) |
|
|
return resultlist; |
|
|
|
|
|
}, |
|
|
}, |
|
|
ontabtap(e) { |
|
|
|
|
|
let index = e.target.dataset.current || e.currentTarget.dataset.current; |
|
|
getExpectOut(pageNo, pageSize, type) { |
|
|
this.tabIndex = index; |
|
|
let that = this; |
|
|
this.getContentByTab(this.tabIndex); |
|
|
uni.showLoading({ |
|
|
|
|
|
title: "加载中...", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (type === "refresh") { |
|
|
|
|
|
this.pageNo = 1; |
|
|
|
|
|
this.dataList = []; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var params = { |
|
|
|
|
|
pageNo: this.pageNo, |
|
|
|
|
|
pageSize: pageSize, |
|
|
|
|
|
filters: [{ |
|
|
|
|
|
column: "locationCode", |
|
|
|
|
|
action: "==", |
|
|
|
|
|
value: this.locationCode |
|
|
|
|
|
|
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getExpectOutByLocationCode(params).then(res => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
if (type === "refresh") { |
|
|
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
|
|
} |
|
|
|
|
|
var list = res.data.list; |
|
|
|
|
|
this.totalCount = res.data.total |
|
|
|
|
|
this.loadingType = "loadmore"; |
|
|
|
|
|
if (list == null || list.length == 0) { |
|
|
|
|
|
this.loadingType = "nomore"; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.dataList = type === "refresh" ? list : this.dataList.concat(list); |
|
|
|
|
|
this.pageNo++; |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showMessage(error); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getContentByTab(index, pageNo, pageSize) { |
|
|
getContentByTab(index, pageNo, pageSize, type) { |
|
|
if (index === 0) { |
|
|
if (index === 0) { |
|
|
this.getSummary(pageNo, pageSize); |
|
|
this.getSummary(pageNo, pageSize, type); |
|
|
} else if (index === 1) this.getDetailList(pageNo, pageSize) |
|
|
} else if (index === 1) this.getDetailList(pageNo, pageSize, type) |
|
|
else if (index === 2) { |
|
|
else if (index === 2) { |
|
|
this.dataIn = this.balances; |
|
|
this.getExpectin(pageNo, pageSize, type) |
|
|
} else if (index == 3) { |
|
|
} else if (index == 3) { |
|
|
this.dataOut = this.balances; |
|
|
this.getExpectOut(pageNo, pageSize, type) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -237,14 +323,7 @@ |
|
|
}, |
|
|
}, |
|
|
tabChange(index) { |
|
|
tabChange(index) { |
|
|
this.tabIndex = index; |
|
|
this.tabIndex = index; |
|
|
this.$refs.paging.reload(true); |
|
|
this.getContentByTab(index, this.pageNo, this.pageSize,"refresh") |
|
|
}, |
|
|
|
|
|
queryList(pageNo, pageSize) { |
|
|
|
|
|
console.log("加载", pageNo) |
|
|
|
|
|
if (this.locationCode != "") { |
|
|
|
|
|
this.getContentByTab(this.tabIndex, pageNo, pageSize) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
@ -254,4 +333,4 @@ |
|
|
page { |
|
|
page { |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |