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 器具代码

4
src/mycomponents/scan/winComScanBalance.vue

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

2
src/pages.json

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

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

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

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

@ -1,29 +1,57 @@
<template>
<view class="">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<view class='split_line'></view>
<template v-slot:title>
<itemQty :dataContent="dataContent" :isShowBalance="true"></itemQty>
</template>
<view v-for="(item, index) in dataContent.list">
<balance :dataContent="item" :isShowFromLocation="false" :isShowPack="isShowPack"
:isShowStdPack="false">
</balance>
<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 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>
</uni-collapse-item>
</uni-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>
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 {
components: {
itemQty,
balance
item,
pack,
batch,
qty,
status
},
data() {
return {
@ -35,7 +63,7 @@
props: {
dataContent: {
type: Object,
default: {},
default: null,
},
isShowPack: {
type: Boolean,
@ -74,4 +102,4 @@
</script>
<style>
</style>
</style>

267
src/pages/query/location.vue

@ -1,28 +1,27 @@
<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">
<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 v-if="tabIndex == 1" v-for="(item, index) in dataList">
<comLocationDetailCard :dataContent="item" style='margin: 10rpx;'></comLocationDetailCard>
</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>
<winScanLocation ref="scanPopup" title="库位代码" @getLocation='getScanCode'></winScanLocation>
@ -36,17 +35,19 @@
<script>
import {
getBalanceByLocationcode,
getBalanceByLocationcodeGroup
getBalanceByLocationcodeGroup,
getExpectInByLocationCode,
getExpectOutByLocationCode
} from '@/api/request2.js';
import {
maxPageSize,
goHome
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
calc
} from '@/common/calc.js';
import locationInfo from '@/mycomponents/location/locationInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -72,15 +73,18 @@
balances: [],
dataIn: [],
dataOut: [],
pageNo: 1,
//
pageSize: 1000,
pageSize: 10,
//
pageCurrent: 1,
//
dataList: [],
tabList: ['汇总', '明细'],
tabList: ['汇总', '明细', '预计入', '预计出'],
tabIndex: 0,
loadingType: "nomore",
totalCount:0
};
},
onLoad() {},
@ -95,6 +99,21 @@
mounted() {
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: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
@ -112,114 +131,181 @@
// this.getContentByTab(this.tabIndex);
},
getSummary(pageNo, pageSize) {
getSummary(pageNo, pageSize, type) {
let that = this;
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var params = {
itemCode: this.itemCode,
pageNo: pageNo,
locationCode: this.locationCode,
pageNo: this.pageNo,
pageSize: pageSize
}
getBalanceByLocationcodeGroup(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.locationCode + '】');
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 => {
this.$refs.paging.complete(false);
uni.hideLoading();
this.showMessage(error);
})
},
getDetailList(pageNo, pageSize) {
getDetailList(pageNo, pageSize, type) {
let that = this;
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var params = {
locationCode: this.locationCode,
pageNo: pageNo,
pageNo: this.pageNo,
pageSize: pageSize
}
getBalanceByLocationcode(params).then(res => {
uni.hideLoading();
if (res.data.list.length > 0) {
this.detailList = this.setShowList(res.data.list)
this.$refs.paging.complete(this.detailList);
} else {
this.$refs.paging.complete(false);
this.showMessage('未查找到库位w【' + this.locationCode + '】');
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 => {
this.$refs.paging.complete(false);
uni.hideLoading();
this.showMessage(error);
})
},
setShowList(list) {
var resultlist = [];
list.forEach(res => {
var temp = resultlist.find(res1 =>
res1.itemCode == res.itemCode)
if (temp == undefined) {
var 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)
getExpectin(pageNo, pageSize, type) {
let that = this;
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
}]
}
getExpectInByLocationCode(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);
})
return resultlist;
},
ontabtap(e) {
let index = e.target.dataset.current || e.currentTarget.dataset.current;
this.tabIndex = index;
this.getContentByTab(this.tabIndex);
getExpectOut(pageNo, pageSize, type) {
let that = this;
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) {
this.getSummary(pageNo, pageSize);
} else if (index === 1) this.getDetailList(pageNo, pageSize)
this.getSummary(pageNo, pageSize, type);
} else if (index === 1) this.getDetailList(pageNo, pageSize, type)
else if (index === 2) {
this.dataIn = this.balances;
this.getExpectin(pageNo, pageSize, type)
} else if (index == 3) {
this.dataOut = this.balances;
this.getExpectOut(pageNo, pageSize, type)
}
},
@ -237,14 +323,7 @@
},
tabChange(index) {
this.tabIndex = index;
this.$refs.paging.reload(true);
},
queryList(pageNo, pageSize) {
console.log("加载", pageNo)
if (this.locationCode != "") {
this.getContentByTab(this.tabIndex, pageNo, pageSize)
}
this.getContentByTab(index, this.pageNo, this.pageSize,"refresh")
},
}
};
@ -254,4 +333,4 @@
page {
height: 100%;
}
</style>
</style>
Loading…
Cancel
Save