Browse Source

修改库位查询显示和查询接口

hella_online_20240911
lijuncheng 2 months ago
parent
commit
c5338a82f2
  1. 13
      src/api/request2.js
  2. 41
      src/pages/query/coms/comLocationDetailCard.vue
  3. 71
      src/pages/query/location.vue

13
src/api/request2.js

@ -273,14 +273,14 @@ export function getExpectoutByItemcode(params) {
} }
/** /**
* 按库位查询库存汇总 * 按库位查询库存事务
* @param {*} * @param {*}
* *
*/ */
export function getBalanceByLocationcodeGroup(params) { export function getTransactionByLocationcode(params) {
return request({ return request({
url: baseApi + "/wms/balance/page", url: baseApi + "/wms/transaction/senior",
method: "get", method: "post",
data: params, data: params,
}); });
} }
@ -290,10 +290,9 @@ export function getBalanceByLocationcodeGroup(params) {
* @param {*} * @param {*}
*/ */
export function getBalanceByLocationcode(params) { export function getBalanceByLocationcode(params) {
return request({ return request({
url: baseApi + "/wms/balance/page", url: baseApi + "/wms/balance/seniorAll",
method: "get", method: "post",
data: params, data: params,
}); });
} }

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

@ -2,7 +2,6 @@
<view class="" style="width: 100%; background-color: #fff; border-radius: 10rpx;"> <view class="" style="width: 100%; background-color: #fff; border-radius: 10rpx;">
<view class="uni-flex uni-row" style="align-items: center;" > <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> <item :dataContent="dataContent" style="padding-top: 10rpx; margin-left: 10rpx;"></item>
</view> </view>
@ -18,8 +17,10 @@
</view> </view>
<view class="" v-if="dataContent.businessType" <view class="" v-if="dataContent.businessType"
style="font-size: 30rpx; padding-left: 10rpx ; padding-bottom: 10rpx;"> style="font-size: 30rpx; padding-left: 10rpx ; padding-bottom: 10rpx;">
<text style="color:green; ">业务类型</text> <text style="color:green; ">业务类型 </text>
{{businessTypeDesc(dataContent.businessType)}} <text v-if="hasChinese(dataContent.businessType)">{{dataContent.businessType}}</text>
<text v-else> {{businessTypeDesc(dataContent.businessType)}}</text>
<!-- {{businessTypeDesc(dataContent.businessType)}} -->
</view> </view>
</view> </view>
<view class="uni-flex" style="flex-direction: column;"> <view class="uni-flex" style="flex-direction: column;">
@ -30,7 +31,24 @@
</view> </view>
</view> </view>
<view v-if="dataContent.transactionType" class="" style="margin-left: 10rpx; font-size: 30rpx;">
事务类型{{dataContent.transactionType}}
</view>
<view v-if="dataContent.inventoryAction" class="" style="margin-left: 10rpx; font-size: 30rpx;">
库存动作{{inventoryActionName(dataContent.inventoryAction)}}
</view>
<view v-if="dataContent.recordNumber" class="" style="margin-left: 10rpx; font-size: 30rpx;">
业务记录号{{dataContent.recordNumber}}
</view>
<view v-if="dataContent.number" class="" style="margin-left: 10rpx; font-size: 30rpx;">
事务号{{dataContent.number}}
</view>
<view v-if="dataContent.worker" class="" style="margin-left: 10rpx; font-size: 30rpx;">
操作人{{dataContent.worker}}
</view>
<view class="" style="margin-left: 10rpx; font-size: 30rpx;">
创建时间{{dateFormat(dataContent.createTime)}}
</view>
@ -48,6 +66,10 @@
import { import {
getBusinessTypeName, getBusinessTypeName,
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
dateFormat
} from '@/common/basic.js';
export default { export default {
components: { components: {
itemQty, itemQty,
@ -91,6 +113,17 @@
businessTypeDesc(type){ businessTypeDesc(type){
return getBusinessTypeName(type) return getBusinessTypeName(type)
}, },
dateFormat(times){
return dateFormat(times)
},
hasChinese(str){
var reg = /[\u4e00-\u9fa5]/g;
return reg.test(str);
},
inventoryActionName(value){
return value=="IN"?"入库":"出库"
}
} }
} }

71
src/pages/query/location.vue

@ -1,15 +1,17 @@
<template> <template>
<!-- <page-meta root-font-size="18px"></page-meta> --> <!-- <page-meta root-font-size="18px"></page-meta> -->
<view class="uni-flex" style="flex-direction: column" > <view class="uni-flex" style="flex-direction: column">
<view class="" style=" width: 100%; position: fixed; top: 0;right: 0;"> <view class="" style=" width: 100%; position: fixed; right: 0;">
<com-blank-view @goScan='openScanPopup' v-if="locationCode==''"></com-blank-view> <com-blank-view @goScan='openScanPopup' v-if="locationCode==''"></com-blank-view>
<location-info :locationDetail='locationDetail' v-if="locationCode"></location-info> <location-info :locationDetail='locationDetail' v-if="locationCode"></location-info>
<z-tabs v-if="locationCode" :list="tabList" @change="tabChange" /> <z-tabs v-if="locationCode" :list="tabList" @change="tabChange" />
</view> </view>
<view style="padding-top: 200rpx;width:100%"> <view style="padding-top: 210rpx;width:100%">
<view v-if="totalCount>0" style="margin:10rpx; font-size:35rpx; font-weight:bold">总数 : {{totalCount}} </view> <view v-if="totalCount>0" style=" margin-left: 10rpx;margin-bottom: 10rpx; font-size:35rpx; font-weight:bold">总数 : {{totalCount}}
<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 v-for="(item, index) in dataList" style="width:100%" :key="index">
<view class="uni-flex uni-row"
style=" align-items: center; background-color: #fff; border-radius:10rpx;margin:10rpx; ">
<view class="" style="font-size:35rpx; "> <view class="" style="font-size:35rpx; ">
({{index+1}}) ({{index+1}})
</view> </view>
@ -22,7 +24,6 @@
</view> </view>
<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>
@ -35,7 +36,7 @@
<script> <script>
import { import {
getBalanceByLocationcode, getBalanceByLocationcode,
getBalanceByLocationcodeGroup, getTransactionByLocationcode,
getExpectInByLocationCode, getExpectInByLocationCode,
getExpectOutByLocationCode getExpectOutByLocationCode
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -81,13 +82,13 @@
// //
dataList: [], dataList: [],
tabList: ['汇总', '明细', '预计入', '预计出'], tabList: ['库存余额', '预计入', '预计出', '库存事务'],
tabIndex: 0, tabIndex: 0,
loadingType: "nomore", loadingType: "nomore",
totalCount:0 totalCount: 0
}; };
}, },
onLoad(option){ onLoad(option) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
}) })
@ -135,7 +136,7 @@
// this.getContentByTab(this.tabIndex); // this.getContentByTab(this.tabIndex);
}, },
getSummary(pageNo, pageSize, type) { getBalance(pageNo, pageSize, type) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中...", title: "加载中...",
@ -148,12 +149,18 @@
} }
var params = { var params = {
locationCode: this.locationCode,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: pageSize pageSize: pageSize,
filters: [{
column: "locationCode",
action: "==",
value: this.locationCode
}],
sort:"createTime",
by: "ASC"
} }
getBalanceByLocationcodeGroup(params).then(res => { getBalanceByLocationcode(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
@ -175,7 +182,7 @@
}, },
getDetailList(pageNo, pageSize, type) { getTransaction(pageNo, pageSize, type) {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中...", title: "加载中...",
@ -189,11 +196,17 @@
} }
var params = { var params = {
locationCode: this.locationCode,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: pageSize pageSize: pageSize,
filters: [{
column: "locationCode",
action: "==",
value: this.locationCode
}],
sort:"createTime",
by: "DESC"
} }
getBalanceByLocationcode(params).then(res => { getTransactionByLocationcode(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
@ -233,8 +246,9 @@
column: "locationCode", column: "locationCode",
action: "==", action: "==",
value: this.locationCode value: this.locationCode
}],
}] sort:"createTime",
by: "ASC"
} }
getExpectInByLocationCode(params).then(res => { getExpectInByLocationCode(params).then(res => {
@ -277,8 +291,9 @@
column: "locationCode", column: "locationCode",
action: "==", action: "==",
value: this.locationCode value: this.locationCode
}],
}] sort:"createTime",
by: "ASC"
} }
getExpectOutByLocationCode(params).then(res => { getExpectOutByLocationCode(params).then(res => {
@ -304,12 +319,12 @@
getContentByTab(index, pageNo, pageSize, type) { getContentByTab(index, pageNo, pageSize, type) {
if (index === 0) { if (index === 0) {
this.getSummary(pageNo, pageSize, type); this.getBalance(pageNo, pageSize, type);
} else if (index === 1) this.getDetailList(pageNo, pageSize, type) } else if (index === 1) this.getExpectin(pageNo, pageSize, type)
else if (index === 2) { else if (index === 2) {
this.getExpectin(pageNo, pageSize, type)
} else if (index == 3) {
this.getExpectOut(pageNo, pageSize, type) this.getExpectOut(pageNo, pageSize, type)
} else if (index == 3) {
this.getTransaction(pageNo, pageSize, type)
} }
}, },
@ -327,7 +342,7 @@
}, },
tabChange(index) { tabChange(index) {
this.tabIndex = index; this.tabIndex = index;
this.getContentByTab(index, this.pageNo, this.pageSize,"refresh") this.getContentByTab(index, this.pageNo, this.pageSize, "refresh")
}, },
} }
}; };

Loading…
Cancel
Save