Browse Source

修改按库位查询库存

hella_online_20240829
lijuncheng 5 months ago
parent
commit
0f6fbdf8bd
  1. 26
      src/api/request2.js
  2. 4
      src/mycomponents/scan/winComScanBalance.vue
  3. 2
      src/pages.json
  4. 2
      src/pages/package/record/overPackageRecord.vue
  5. 64
      src/pages/query/coms/comLocationDetailCard.vue
  6. 267
      src/pages/query/location.vue

26
src/api/request2.js

@ -296,6 +296,32 @@ export function getBalanceByLocationcode(params) {
}); });
} }
/**
* 按库位查询 预计入
* @param {*}
*/
export function getExpectInByLocationCode(params) {
return request({
url: baseApi + "/wms/expectin/senior",
method: "post",
data: params,
});
}
/**
* 按库位查询 预计出
* @param {*}
*/
export function getExpectOutByLocationCode(params) {
return request({
url: baseApi + "/wms/expectout/senior",
method: "post",
data: params,
});
}
/** /**
* 查询器具信息接口 * 查询器具信息接口
* @param {*} number 器具代码 * @param {*} number 器具代码

4
src/mycomponents/scan/winComScanBalance.vue

@ -127,8 +127,8 @@
batch: result.label.batch, batch: result.label.batch,
packingNumber: result.label.packingNumber, packingNumber: result.label.packingNumber,
inventoryStatus: this.fromInventoryStatuses, inventoryStatus: this.fromInventoryStatuses,
areaType: this.fromLocationAreaTypeList areaType: this.fromLocationAreaTypeList,
bussinessCode:this.bussinessCode
} }
getBalanceByParams(params).then(res => { getBalanceByParams(params).then(res => {
uni.hideLoading() uni.hideLoading()

2
src/pages.json

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

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

@ -61,7 +61,7 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult'> <winComScanBalance ref="scanPopup" @getBalance='getScanResult' businesstypeCode="OverPackage">
</winComScanBalance> </winComScanBalance>

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

@ -1,29 +1,57 @@
<template> <template>
<view class=""> <view class="" style="width: 100%; background-color: #fff; border-radius: 10rpx;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true"> <view class="uni-flex uni-row" style="align-items: center;" >
<view class='split_line'></view> <text style="font-size:35rpx; padding-left:10rpx">物料代码</text>
<template v-slot:title> <item :dataContent="dataContent" style="padding-top: 10rpx; margin-left: 10rpx;"></item>
<itemQty :dataContent="dataContent" :isShowBalance="true"></itemQty> </view>
</template>
<view class="uni-flex uni-row space-between" style="align-items: center;">
<view v-for="(item, index) in dataContent.list"> <view>
<balance :dataContent="item" :isShowFromLocation="false" :isShowPack="isShowPack" <pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
:isShowStdPack="false"> <pack v-if=" dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
</balance> <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> </view>
</uni-collapse-item> <view class="" v-if="dataContent.businessType"
</uni-collapse> 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> </view>
</template> </template>
<script> <script>
import itemQty from '@/mycomponents/item/itemQty.vue' 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'
export default { export default {
components: { components: {
itemQty, itemQty,
balance item,
pack,
batch,
qty,
status
}, },
data() { data() {
return { return {
@ -35,7 +63,7 @@
props: { props: {
dataContent: { dataContent: {
type: Object, type: Object,
default: {}, default: null,
}, },
isShowPack: { isShowPack: {
type: Boolean, type: Boolean,
@ -74,4 +102,4 @@
</script> </script>
<style> <style>
</style> </style>

267
src/pages/query/location.vue

@ -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>
Loading…
Cancel
Save