|
@ -1,61 +1,47 @@ |
|
|
<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> |
|
|
</template> |
|
|
<view class="" style="padding-bottom: 50rpx;"> |
|
|
<view class="" style="padding-bottom: 50rpx"> |
|
|
<view v-if="tabIndex == 0" v-for="(item, index) in dataList"> |
|
|
<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"> |
|
|
<view v-if="tabIndex == 1" v-for="(item, index) in dataList"> |
|
|
<comLocationDetailCard :dataContent="item" style='margin: 10rpx;'></comLocationDetailCard> |
|
|
<comLocationDetailCard :dataContent="item" style="margin: 10rpx"></comLocationDetailCard> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</my-paging> |
|
|
</my-paging> |
|
|
|
|
|
|
|
|
、 |
|
|
、 |
|
|
<win-scan-button @goScan='openScanPopup' v-if="containerNumber!=''"></win-scan-button> |
|
|
<win-scan-button @goScan="openScanPopup" v-if="containerNumber != ''"></win-scan-button> |
|
|
<winScanContainer ref="scanPopup" title='器具代码' @getContainer='getScanCode'> |
|
|
<winScanContainer ref="scanPopup" title="器具代码" @getContainer="getScanCode"> </winScanContainer> |
|
|
</winScanContainer> |
|
|
|
|
|
<show-modal ref="modal"></show-modal> |
|
|
<show-modal ref="modal"></show-modal> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { getBalanceByContainerNumber, getBalanceByContainerNumberGroup, getContainerByNumber } from '@/api/request2.js' |
|
|
getBalanceByContainerNumber, |
|
|
|
|
|
getBalanceByContainerNumberGroup, |
|
|
|
|
|
getContainerByNumber |
|
|
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
import { maxPageSize, goHome } from '@/common/basic.js' |
|
|
maxPageSize, |
|
|
|
|
|
goHome |
|
|
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
import { calc } from '@/common/calc.js' |
|
|
calc |
|
|
|
|
|
} 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' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import comLocationDetailCard from '@/pages/query/coms/comLocationDetailCard.vue' |
|
|
import comLocationDetailCard from '@/pages/query/coms/comLocationDetailCard.vue' |
|
|
import winScanContainer from "@/mycomponents/scan/winScanContainer.vue" |
|
|
import winScanContainer from '@/mycomponents/scan/winScanContainer.vue' |
|
|
import containerInfo from '@/mycomponents/container/containerInfo.vue' |
|
|
import containerInfo from '@/mycomponents/container/containerInfo.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
@ -67,7 +53,6 @@ |
|
|
comLocationDetailCard, |
|
|
comLocationDetailCard, |
|
|
containerInfo, |
|
|
containerInfo, |
|
|
winScanContainer |
|
|
winScanContainer |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -89,14 +74,17 @@ |
|
|
summarysList: [], |
|
|
summarysList: [], |
|
|
dataList: [], |
|
|
dataList: [], |
|
|
tabList: ['汇总', '明细'], |
|
|
tabList: ['汇总', '明细'], |
|
|
tabIndex: 0, |
|
|
tabIndex: 0 |
|
|
}; |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad(e) { |
|
|
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
|
|
title: e.title |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap(e) { |
|
|
if (e.index === 0) { |
|
|
if (e.index === 0) { |
|
|
goHome(); |
|
|
goHome() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
filters: {}, |
|
|
filters: {}, |
|
@ -105,109 +93,112 @@ |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
var test =this.$refs; |
|
|
const test = this.$refs |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
this.$refs.scanPopup.openScanPopup() |
|
|
}, |
|
|
}, |
|
|
closeScanPopup() { |
|
|
closeScanPopup() { |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
this.$refs.scanPopup.closeScanPopup() |
|
|
}, |
|
|
}, |
|
|
getScanCode(code) { |
|
|
getScanCode(code) { |
|
|
this.containerNumber = ''; |
|
|
this.containerNumber = '' |
|
|
this.summarys = []; |
|
|
this.summarys = [] |
|
|
this.balances = []; |
|
|
this.balances = [] |
|
|
this.occupieds = []; |
|
|
this.occupieds = [] |
|
|
this.containerNumber = code.number; |
|
|
this.containerNumber = code.number |
|
|
this.containerInfo = code; |
|
|
this.containerInfo = code |
|
|
this.tabChange(0) |
|
|
this.tabChange(0) |
|
|
// this.getItemInfo(code.number); |
|
|
// this.getItemInfo(code.number); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getItemInfo(code) { |
|
|
getItemInfo(code) { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "正在查询器具信息...", |
|
|
title: '正在查询器具信息...', |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}) |
|
|
getContainerByNumber(code).then(res => { |
|
|
getContainerByNumber(code) |
|
|
uni.hideLoading(); |
|
|
.then((res) => { |
|
|
|
|
|
uni.hideLoading() |
|
|
if (res.data.list.length > 0) { |
|
|
if (res.data.list.length > 0) { |
|
|
this.closeScanPopup(); |
|
|
this.closeScanPopup() |
|
|
this.containerNumber = res.data.list[0].number; |
|
|
this.containerNumber = res.data.list[0].number |
|
|
this.containerInfo = res.data.list[0]; |
|
|
this.containerInfo = res.data.list[0] |
|
|
this.tabChange(0) |
|
|
this.tabChange(0) |
|
|
} else { |
|
|
} else { |
|
|
this.showMessage('未查找到器具【' + code + '】'); |
|
|
this.showMessage(`未查找到器具【${code}】`) |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
}).catch(error => { |
|
|
.catch((error) => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading() |
|
|
this.containerNumber = ""; |
|
|
this.containerNumber = '' |
|
|
this.showMessage(error); |
|
|
this.showMessage(error) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getSummary(pageNo, pageSize) { |
|
|
getSummary(pageNo, pageSize) { |
|
|
let that = this; |
|
|
const that = this |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中...", |
|
|
title: '加载中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}) |
|
|
var params = { |
|
|
const params = { |
|
|
containerNumber: this.containerNumber, |
|
|
containerNumber: this.containerNumber, |
|
|
pageNo: pageNo, |
|
|
pageNo, |
|
|
pageSize: pageSize |
|
|
pageSize |
|
|
} |
|
|
} |
|
|
getBalanceByContainerNumberGroup(params).then(res => { |
|
|
getBalanceByContainerNumberGroup(params) |
|
|
uni.hideLoading(); |
|
|
.then((res) => { |
|
|
|
|
|
uni.hideLoading() |
|
|
if (res.data.list.length > 0) { |
|
|
if (res.data.list.length > 0) { |
|
|
this.summarysList = this.setShowList(res.data.list) |
|
|
this.summarysList = this.setShowList(res.data.list) |
|
|
this.$refs.paging.complete(this.summarysList); |
|
|
this.$refs.paging.complete(this.summarysList) |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.paging.complete(false); |
|
|
this.$refs.paging.complete(false) |
|
|
this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息'); |
|
|
this.showMessage(`未查找到器具【${this.containerNumber}】的库存信息`) |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
|
|
|
this.$refs.paging.complete(false); |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showMessage(error); |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
.catch((error) => { |
|
|
|
|
|
this.$refs.paging.complete(false) |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getDetailList(pageNo, pageSize) { |
|
|
getDetailList(pageNo, pageSize) { |
|
|
let that = this; |
|
|
const that = this |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中...", |
|
|
title: '加载中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}) |
|
|
var params = { |
|
|
const params = { |
|
|
containerNumber: this.containerNumber, |
|
|
containerNumber: this.containerNumber, |
|
|
pageNo: pageNo, |
|
|
pageNo, |
|
|
pageSize: pageSize |
|
|
pageSize |
|
|
} |
|
|
} |
|
|
getBalanceByContainerNumber(params).then(res => { |
|
|
getBalanceByContainerNumber(params) |
|
|
uni.hideLoading(); |
|
|
.then((res) => { |
|
|
|
|
|
uni.hideLoading() |
|
|
if (res.data.total > 0) { |
|
|
if (res.data.total > 0) { |
|
|
this.detailList = this.setShowList(res.data.list) |
|
|
this.detailList = this.setShowList(res.data.list) |
|
|
this.$refs.paging.complete(this.detailList); |
|
|
this.$refs.paging.complete(this.detailList) |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.paging.complete(false); |
|
|
this.$refs.paging.complete(false) |
|
|
this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息'); |
|
|
this.showMessage(`未查找到器具【${this.containerNumber}】的库存信息`) |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
}) |
|
|
this.$refs.paging.complete(false); |
|
|
.catch((error) => { |
|
|
uni.hideLoading(); |
|
|
this.$refs.paging.complete(false) |
|
|
this.showMessage(error); |
|
|
uni.hideLoading() |
|
|
|
|
|
this.showMessage(error) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setShowList(list) { |
|
|
setShowList(list) { |
|
|
var resultlist = []; |
|
|
const resultlist = [] |
|
|
list.forEach(res => { |
|
|
list.forEach((res) => { |
|
|
var temp = resultlist.find(res1 => |
|
|
const temp = resultlist.find((res1) => res1.itemCode == res.itemCode) |
|
|
res1.itemCode == res.itemCode) |
|
|
|
|
|
|
|
|
|
|
|
if (temp == undefined) { |
|
|
if (temp == undefined) { |
|
|
var data = { |
|
|
const data = { |
|
|
itemCode: res.itemCode, |
|
|
itemCode: res.itemCode, |
|
|
qty: Number(res.qty), |
|
|
qty: Number(res.qty), |
|
|
uom: res.uom, |
|
|
uom: res.uom, |
|
@ -218,7 +209,7 @@ |
|
|
batch: res.batch, |
|
|
batch: res.batch, |
|
|
uom: res.uom, |
|
|
uom: res.uom, |
|
|
qty: Number(res.qty), |
|
|
qty: Number(res.qty), |
|
|
inventoryStatus: res.inventoryStatus, |
|
|
inventoryStatus: res.inventoryStatus |
|
|
} |
|
|
} |
|
|
data.list.push(item) |
|
|
data.list.push(item) |
|
|
resultlist.push(data) |
|
|
resultlist.push(data) |
|
@ -229,48 +220,46 @@ |
|
|
batch: res.batch, |
|
|
batch: res.batch, |
|
|
uom: res.uom, |
|
|
uom: res.uom, |
|
|
qty: Number(res.qty), |
|
|
qty: Number(res.qty), |
|
|
inventoryStatus: res.inventoryStatus, |
|
|
inventoryStatus: res.inventoryStatus |
|
|
} |
|
|
} |
|
|
temp.list.push(item) |
|
|
temp.list.push(item) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
return resultlist; |
|
|
return resultlist |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getContentByTab(index, pageNo, pageSize) { |
|
|
getContentByTab(index, pageNo, pageSize) { |
|
|
if (index === 0) { |
|
|
if (index === 0) { |
|
|
this.getSummary(pageNo, pageSize); |
|
|
this.getSummary(pageNo, pageSize) |
|
|
} else if (index === 1) this.getDetailList(pageNo, pageSize) |
|
|
} else if (index === 1) this.getDetailList(pageNo, pageSize) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
upper: function(e) {}, |
|
|
upper(e) {}, |
|
|
lower: function(e) {}, |
|
|
lower(e) {}, |
|
|
tabChange(index) { |
|
|
tabChange(index) { |
|
|
this.tabIndex = index; |
|
|
this.tabIndex = index |
|
|
this.$refs.paging.reload(true); |
|
|
this.$refs.paging.reload(true) |
|
|
}, |
|
|
}, |
|
|
showMessage(message) { |
|
|
showMessage(message) { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
this.$refs.comMessage.showErrorMessage(message, (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.afterCloseMessage() |
|
|
this.afterCloseMessage() |
|
|
} |
|
|
} |
|
|
}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
afterCloseMessage() { |
|
|
afterCloseMessage() { |
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
this.$refs.scanPopup.getfocus(); |
|
|
this.$refs.scanPopup.getfocus() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
queryList(pageNo, pageSize) { |
|
|
queryList(pageNo, pageSize) { |
|
|
console.log("加载", pageNo) |
|
|
console.log('加载', pageNo) |
|
|
if (this.containerNumber != "") { |
|
|
if (this.containerNumber != '') { |
|
|
this.getContentByTab(this.tabIndex, pageNo, pageSize) |
|
|
this.getContentByTab(this.tabIndex, pageNo, pageSize) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|