zhang_li
3 months ago
12 changed files with 303 additions and 276 deletions
@ -1,280 +1,269 @@ |
|||||
<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="containerNumber==''"></com-blank-view> |
<com-blank-view @goScan="openScanPopup" v-if="containerNumber == ''"></com-blank-view> |
||||
|
|
||||
<my-paging v-show="containerNumber!=''" ref="paging" v-model="dataList" @query="queryList"> |
<my-paging v-show="containerNumber != ''" ref="paging" v-model="dataList" @query="queryList"> |
||||
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中,如果需要跟着滚动,则不要设置slot="top" --> |
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中,如果需要跟着滚动,则不要设置slot="top" --> |
||||
<template #top> |
<template #top> |
||||
<view v-if="containerNumber!=''"> |
<view v-if="containerNumber != ''"> |
||||
<containerInfo :itemDetail="containerInfo" ></containerInfo> |
<containerInfo :itemDetail="containerInfo"></containerInfo> |
||||
<view class='split_line'></view> |
<view class="split_line"></view> |
||||
<z-tabs :list="tabList" @change="tabChange" /> |
<z-tabs :list="tabList" @change="tabChange" /> |
||||
</view> |
</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: 10rpx"> </comLocationDetailCard> |
||||
|
</view> |
||||
|
<view v-if="tabIndex == 1" v-for="(item, index) in dataList"> |
||||
|
<comLocationDetailCard :dataContent="item" style="margin: 10rpx"></comLocationDetailCard> |
||||
|
</view> |
||||
|
</view> |
||||
|
</my-paging> |
||||
|
|
||||
</template> |
、 |
||||
<view class="" style="padding-bottom: 50rpx;"> |
<win-scan-button @goScan="openScanPopup" v-if="containerNumber != ''"></win-scan-button> |
||||
<view v-if="tabIndex == 0" v-for="(item, index) in dataList"> |
<winScanContainer ref="scanPopup" title="器具代码" @getContainer="getScanCode"> </winScanContainer> |
||||
<comLocationDetailCard :isShowPack="false" :dataContent="item" style='margin: 10rpx;'> |
<show-modal ref="modal"></show-modal> |
||||
</comLocationDetailCard> |
<comMessage ref="comMessage"></comMessage> |
||||
</view> |
</view> |
||||
<view v-if="tabIndex == 1" v-for="(item, index) in dataList"> |
|
||||
<comLocationDetailCard :dataContent="item" style='margin: 10rpx;'></comLocationDetailCard> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
</my-paging> |
|
||||
|
|
||||
、 |
|
||||
<win-scan-button @goScan='openScanPopup' v-if="containerNumber!=''"></win-scan-button> |
|
||||
<winScanContainer ref="scanPopup" title='器具代码' @getContainer='getScanCode'> |
|
||||
</winScanContainer> |
|
||||
<show-modal ref="modal"></show-modal> |
|
||||
<comMessage ref="comMessage"></comMessage> |
|
||||
|
|
||||
</view> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { |
import { getBalanceByContainerNumber, getBalanceByContainerNumberGroup, getContainerByNumber } from '@/api/request2.js' |
||||
getBalanceByContainerNumber, |
|
||||
getBalanceByContainerNumberGroup, |
|
||||
getContainerByNumber |
|
||||
} from '@/api/request2.js'; |
|
||||
|
|
||||
import { |
|
||||
maxPageSize, |
|
||||
goHome |
|
||||
} from '@/common/basic.js'; |
|
||||
|
|
||||
import { |
|
||||
calc |
|
||||
} from '@/common/calc.js'; |
|
||||
|
|
||||
import locationInfo from '@/mycomponents/location/locationInfo.vue' |
|
||||
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
||||
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
||||
import comLocationDetailCard from '@/pages/query/coms/comLocationDetailCard.vue' |
|
||||
import winScanContainer from "@/mycomponents/scan/winScanContainer.vue" |
|
||||
import containerInfo from '@/mycomponents/container/containerInfo.vue' |
|
||||
|
|
||||
export default { |
|
||||
name: 'location', |
|
||||
components: { |
|
||||
locationInfo, |
|
||||
comBlankView, |
|
||||
winScanButton, |
|
||||
comLocationDetailCard, |
|
||||
containerInfo, |
|
||||
winScanContainer |
|
||||
|
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
containerInfo: {}, |
|
||||
containerNumber: '', |
|
||||
summarys: [], |
|
||||
balances: [], |
|
||||
// 每页数据量 |
|
||||
pageSize: 1000, |
|
||||
// 当前页 |
|
||||
pageCurrent: 1, |
|
||||
// 数据总量 |
|
||||
scrollTop: 0, |
|
||||
old: { |
|
||||
scrollTop: 0 |
|
||||
}, |
|
||||
|
|
||||
detailList: [], |
import { maxPageSize, goHome } from '@/common/basic.js' |
||||
summarysList: [], |
|
||||
dataList: [], |
|
||||
tabList: ['汇总', '明细'], |
|
||||
tabIndex: 0, |
|
||||
}; |
|
||||
}, |
|
||||
onLoad() { |
|
||||
}, |
|
||||
onNavigationBarButtonTap(e) { |
|
||||
if (e.index === 0) { |
|
||||
goHome(); |
|
||||
} |
|
||||
}, |
|
||||
filters: {}, |
|
||||
mounted() { |
|
||||
this.openScanPopup() |
|
||||
}, |
|
||||
methods: { |
|
||||
openScanPopup() { |
|
||||
var test =this.$refs; |
|
||||
this.$refs.scanPopup.openScanPopup(); |
|
||||
}, |
|
||||
closeScanPopup() { |
|
||||
this.$refs.scanPopup.closeScanPopup(); |
|
||||
}, |
|
||||
getScanCode(code) { |
|
||||
this.containerNumber = ''; |
|
||||
this.summarys = []; |
|
||||
this.balances = []; |
|
||||
this.occupieds = []; |
|
||||
this.containerNumber = code.number; |
|
||||
this.containerInfo = code; |
|
||||
this.tabChange(0) |
|
||||
// this.getItemInfo(code.number); |
|
||||
}, |
|
||||
|
|
||||
getItemInfo(code) { |
import { calc } from '@/common/calc.js' |
||||
uni.showLoading({ |
|
||||
title: "正在查询器具信息...", |
|
||||
mask: true |
|
||||
}); |
|
||||
getContainerByNumber(code).then(res => { |
|
||||
uni.hideLoading(); |
|
||||
if (res.data.list.length > 0) { |
|
||||
this.closeScanPopup(); |
|
||||
this.containerNumber = res.data.list[0].number; |
|
||||
this.containerInfo = res.data.list[0]; |
|
||||
this.tabChange(0) |
|
||||
} else { |
|
||||
this.showMessage('未查找到器具【' + code + '】'); |
|
||||
} |
|
||||
|
|
||||
}).catch(error => { |
import locationInfo from '@/mycomponents/location/locationInfo.vue' |
||||
uni.hideLoading(); |
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
||||
this.containerNumber = ""; |
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
this.showMessage(error); |
import comLocationDetailCard from '@/pages/query/coms/comLocationDetailCard.vue' |
||||
}) |
import winScanContainer from '@/mycomponents/scan/winScanContainer.vue' |
||||
}, |
import containerInfo from '@/mycomponents/container/containerInfo.vue' |
||||
|
|
||||
getSummary(pageNo, pageSize) { |
export default { |
||||
let that = this; |
name: 'location', |
||||
uni.showLoading({ |
components: { |
||||
title: "加载中...", |
locationInfo, |
||||
mask: true |
comBlankView, |
||||
}); |
winScanButton, |
||||
var params = { |
comLocationDetailCard, |
||||
containerNumber: this.containerNumber, |
containerInfo, |
||||
pageNo: pageNo, |
winScanContainer |
||||
pageSize: pageSize |
}, |
||||
} |
data() { |
||||
getBalanceByContainerNumberGroup(params).then(res => { |
return { |
||||
uni.hideLoading(); |
containerInfo: {}, |
||||
if (res.data.list.length > 0) { |
containerNumber: '', |
||||
this.summarysList = this.setShowList(res.data.list) |
summarys: [], |
||||
this.$refs.paging.complete(this.summarysList); |
balances: [], |
||||
} else { |
// 每页数据量 |
||||
this.$refs.paging.complete(false); |
pageSize: 1000, |
||||
this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息'); |
// 当前页 |
||||
} |
pageCurrent: 1, |
||||
}).catch(error => { |
// 数据总量 |
||||
this.$refs.paging.complete(false); |
scrollTop: 0, |
||||
uni.hideLoading(); |
old: { |
||||
this.showMessage(error); |
scrollTop: 0 |
||||
}) |
}, |
||||
|
|
||||
}, |
detailList: [], |
||||
|
summarysList: [], |
||||
|
dataList: [], |
||||
|
tabList: ['汇总', '明细'], |
||||
|
tabIndex: 0 |
||||
|
} |
||||
|
}, |
||||
|
onLoad(e) { |
||||
|
uni.setNavigationBarTitle({ |
||||
|
title: e.title |
||||
|
}) |
||||
|
}, |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome() |
||||
|
} |
||||
|
}, |
||||
|
filters: {}, |
||||
|
mounted() { |
||||
|
this.openScanPopup() |
||||
|
}, |
||||
|
methods: { |
||||
|
openScanPopup() { |
||||
|
const test = this.$refs |
||||
|
this.$refs.scanPopup.openScanPopup() |
||||
|
}, |
||||
|
closeScanPopup() { |
||||
|
this.$refs.scanPopup.closeScanPopup() |
||||
|
}, |
||||
|
getScanCode(code) { |
||||
|
this.containerNumber = '' |
||||
|
this.summarys = [] |
||||
|
this.balances = [] |
||||
|
this.occupieds = [] |
||||
|
this.containerNumber = code.number |
||||
|
this.containerInfo = code |
||||
|
this.tabChange(0) |
||||
|
// this.getItemInfo(code.number); |
||||
|
}, |
||||
|
|
||||
getDetailList(pageNo, pageSize) { |
getItemInfo(code) { |
||||
let that = this; |
uni.showLoading({ |
||||
uni.showLoading({ |
title: '正在查询器具信息...', |
||||
title: "加载中...", |
mask: true |
||||
mask: true |
}) |
||||
}); |
getContainerByNumber(code) |
||||
var params = { |
.then((res) => { |
||||
containerNumber: this.containerNumber, |
uni.hideLoading() |
||||
pageNo: pageNo, |
if (res.data.list.length > 0) { |
||||
pageSize: pageSize |
this.closeScanPopup() |
||||
} |
this.containerNumber = res.data.list[0].number |
||||
getBalanceByContainerNumber(params).then(res => { |
this.containerInfo = res.data.list[0] |
||||
uni.hideLoading(); |
this.tabChange(0) |
||||
if (res.data.total > 0) { |
} else { |
||||
this.detailList = this.setShowList(res.data.list) |
this.showMessage(`未查找到器具【${code}】`) |
||||
this.$refs.paging.complete(this.detailList); |
} |
||||
} else { |
}) |
||||
this.$refs.paging.complete(false); |
.catch((error) => { |
||||
this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息'); |
uni.hideLoading() |
||||
} |
this.containerNumber = '' |
||||
}).catch(error => { |
this.showMessage(error) |
||||
this.$refs.paging.complete(false); |
}) |
||||
uni.hideLoading(); |
}, |
||||
this.showMessage(error); |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
setShowList(list) { |
getSummary(pageNo, pageSize) { |
||||
var resultlist = []; |
const that = this |
||||
list.forEach(res => { |
uni.showLoading({ |
||||
var temp = resultlist.find(res1 => |
title: '加载中...', |
||||
res1.itemCode == res.itemCode) |
mask: true |
||||
|
}) |
||||
|
const params = { |
||||
|
containerNumber: this.containerNumber, |
||||
|
pageNo, |
||||
|
pageSize |
||||
|
} |
||||
|
getBalanceByContainerNumberGroup(params) |
||||
|
.then((res) => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data.list.length > 0) { |
||||
|
this.summarysList = this.setShowList(res.data.list) |
||||
|
this.$refs.paging.complete(this.summarysList) |
||||
|
} else { |
||||
|
this.$refs.paging.complete(false) |
||||
|
this.showMessage(`未查找到器具【${this.containerNumber}】的库存信息`) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$refs.paging.complete(false) |
||||
|
uni.hideLoading() |
||||
|
this.showMessage(error) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
if (temp == undefined) { |
getDetailList(pageNo, pageSize) { |
||||
var data = { |
const that = this |
||||
itemCode: res.itemCode, |
uni.showLoading({ |
||||
qty: Number(res.qty), |
title: '加载中...', |
||||
uom: res.uom, |
mask: true |
||||
list: [] |
}) |
||||
} |
const params = { |
||||
var item = { |
containerNumber: this.containerNumber, |
||||
packingNumber: res.packingNumber, |
pageNo, |
||||
batch: res.batch, |
pageSize |
||||
uom: res.uom, |
} |
||||
qty: Number(res.qty), |
getBalanceByContainerNumber(params) |
||||
inventoryStatus: res.inventoryStatus, |
.then((res) => { |
||||
} |
uni.hideLoading() |
||||
data.list.push(item) |
if (res.data.total > 0) { |
||||
resultlist.push(data) |
this.detailList = this.setShowList(res.data.list) |
||||
} else { |
this.$refs.paging.complete(this.detailList) |
||||
temp.qty = calc.add(temp.qty,res.qty) |
} else { |
||||
var item = { |
this.$refs.paging.complete(false) |
||||
packingNumber: res.packingNumber, |
this.showMessage(`未查找到器具【${this.containerNumber}】的库存信息`) |
||||
batch: res.batch, |
} |
||||
uom: res.uom, |
}) |
||||
qty: Number(res.qty), |
.catch((error) => { |
||||
inventoryStatus: res.inventoryStatus, |
this.$refs.paging.complete(false) |
||||
} |
uni.hideLoading() |
||||
temp.list.push(item) |
this.showMessage(error) |
||||
} |
}) |
||||
}) |
}, |
||||
return resultlist; |
|
||||
}, |
|
||||
|
|
||||
getContentByTab(index, pageNo, pageSize) { |
setShowList(list) { |
||||
if (index === 0) { |
const resultlist = [] |
||||
this.getSummary(pageNo, pageSize); |
list.forEach((res) => { |
||||
} else if (index === 1) this.getDetailList(pageNo, pageSize) |
const temp = resultlist.find((res1) => res1.itemCode == res.itemCode) |
||||
|
|
||||
}, |
if (temp == undefined) { |
||||
|
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) |
||||
|
} |
||||
|
}) |
||||
|
return resultlist |
||||
|
}, |
||||
|
|
||||
upper: function(e) {}, |
getContentByTab(index, pageNo, pageSize) { |
||||
lower: function(e) {}, |
if (index === 0) { |
||||
tabChange(index) { |
this.getSummary(pageNo, pageSize) |
||||
this.tabIndex = index; |
} else if (index === 1) this.getDetailList(pageNo, pageSize) |
||||
this.$refs.paging.reload(true); |
}, |
||||
}, |
|
||||
showMessage(message) { |
|
||||
this.$refs.comMessage.showErrorMessage(message, res => { |
|
||||
if (res) { |
|
||||
this.afterCloseMessage() |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
afterCloseMessage() { |
|
||||
if (this.$refs.scanPopup != undefined) { |
|
||||
this.$refs.scanPopup.getfocus(); |
|
||||
} |
|
||||
}, |
|
||||
queryList(pageNo, pageSize) { |
|
||||
console.log("加载", pageNo) |
|
||||
if (this.containerNumber != "") { |
|
||||
this.getContentByTab(this.tabIndex, pageNo, pageSize) |
|
||||
} |
|
||||
|
|
||||
}, |
upper(e) {}, |
||||
} |
lower(e) {}, |
||||
}; |
tabChange(index) { |
||||
|
this.tabIndex = index |
||||
|
this.$refs.paging.reload(true) |
||||
|
}, |
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, (res) => { |
||||
|
if (res) { |
||||
|
this.afterCloseMessage() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
afterCloseMessage() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.getfocus() |
||||
|
} |
||||
|
}, |
||||
|
queryList(pageNo, pageSize) { |
||||
|
console.log('加载', pageNo) |
||||
|
if (this.containerNumber != '') { |
||||
|
this.getContentByTab(this.tabIndex, pageNo, pageSize) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
</script> |
</script> |
||||
|
|
||||
<style scoped lang="scss"> |
<style scoped lang="scss"> |
||||
page { |
page { |
||||
height: 100%; |
height: 100%; |
||||
} |
} |
||||
</style> |
</style> |
||||
|
Loading…
Reference in new issue