Browse Source

修改按库位查询库存 2024/7/5 17:17:56src/pages/query/location.vue

hella_vue3
zhang_li 3 months ago
parent
commit
ad4adbc25a
  1. 16
      src/api/request2.js
  2. 3
      src/mycomponents/scan/winComScanBalance.vue
  3. 2
      src/pages.json
  4. 2
      src/pages/package/record/overPackageRecord.vue
  5. 43
      src/pages/query/coms/comLocationDetailCard.vue
  6. 107
      src/pages/query/location.vue

16
src/api/request2.js

@ -185,6 +185,22 @@ export function getBalanceByLocationcodeGroup(params) {
export function getBalanceByLocationcode(params) {
return http.get("/wms/balance/page",{params})
}
/**
* 按库位查询 预计入
* @param {*}
*/
export function getExpectInByLocationCode(params) {
return http.post("/wms/expectin/senior",params)
}
/**
* 按库位查询 预计出
* @param {*}
*/
export function getExpectOutByLocationCode(params) {
return http.post("/wms/expectout/senior",params)
}
/**
* 查询器具信息接口
* @param {*} number 器具代码

3
src/mycomponents/scan/winComScanBalance.vue

@ -106,7 +106,8 @@ export default {
batch: result.label.batch,
packingNumber: result.label.packingNumber,
inventoryStatus: this.fromInventoryStatuses,
areaType: this.fromLocationAreaTypeList
areaType: this.fromLocationAreaTypeList,
bussinessCode: this.bussinessCode
}
getBalanceByParams(params)
.then((res) => {

2
src/pages.json

@ -75,7 +75,7 @@
"path": "pages/query/location",
"style": {
"navigationBarTitleText": "按库位查询库存",
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"titleNView": {
"autoBackButton": "true",
"buttons": [{}]

2
src/pages/package/record/overPackageRecord.vue

@ -52,7 +52,7 @@
</view>
<win-scan-button @goScan="openScanPopup"></win-scan-button>
</view>
<winComScanBalance ref="scanPopup" @getBalance="getScanResult"> </winComScanBalance>
<winComScanBalance ref="scanPopup" @getBalance="getScanResult" businesstypeCode="OverPackage"> </winComScanBalance>
<com-message ref="comMessageRef" />
</view>
</template>

43
src/pages/query/coms/comLocationDetailCard.vue

@ -1,28 +1,45 @@
<template>
<view class="" style="background: white">
<u-collapse ref="collapse1" @change="">
<u-collapse-item :open="true">
<view class="split_line"></view>
<template v-slot:title>
<itemQty :dataContent="dataContent" :isShowBalance="true" style="width;100%; padding: 0px 20rpx"></itemQty>
</template>
<view class="" style="width: 100%; background-color: #fff; border-radius: 10rpx">
<view class="uni-flex uni-row" style="align-items: center">
<text style="font-size: 35rpx; padding-left: 10rpx">物料代码</text>
<item :dataContent="dataContent" style="padding-top: 10rpx; margin-left: 10rpx"></item>
</view>
<view v-for="(item, index) in dataContent.list">
<balance :dataContent="item" :isShowFromLocation="false" :isShowPack="isShowPack" :isShowStdPack="false"> </balance>
<view class="uni-flex uni-row space-between" style="align-items: center">
<view>
<pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<pack v-if="dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<view class="" v-if="dataContent.jobNumber" style="font-size: 30rpx; padding-left: 10rpx; padding-bottom: 10rpx">
<text style="color: coral">任务号</text>
{{ dataContent.jobNumber }}
</view>
</u-collapse-item>
</u-collapse>
<view class="" v-if="dataContent.businessType" style="font-size: 30rpx; padding-left: 10rpx; padding-bottom: 10rpx">
<text style="color: green">业务类型</text>
{{ dataContent.businessType }}
</view>
</view>
<view class="uni-flex" style="flex-direction: column">
<view class="uni-flex uni-row center">
<qty :dataContent="dataContent" :isShowStdPack="isShowStdPack" :isShowStatus="true"></qty>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import itemQty from '@/mycomponents/item/itemQty.vue'
import balance from '@/mycomponents/balance/balance.vue'
import item from '@/mycomponents/item/item.vue'
import pack from '@/mycomponents/balance/pack.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qty from '@/mycomponents/qty/qty.vue'
import status from '@/mycomponents/status/status.vue'
const props = defineProps({
dataContent: {
type: Object,
default: {}
default: null
},
isShowPack: {
type: Boolean,

107
src/pages/query/location.vue

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

Loading…
Cancel
Save