Browse Source

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

hella_online_20240911
lijuncheng 2 weeks 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 {*}
*
*/
export function getBalanceByLocationcodeGroup(params) {
export function getTransactionByLocationcode(params) {
return request({
url: baseApi + "/wms/balance/page",
method: "get",
url: baseApi + "/wms/transaction/senior",
method: "post",
data: params,
});
}
@ -290,10 +290,9 @@ export function getBalanceByLocationcodeGroup(params) {
* @param {*}
*/
export function getBalanceByLocationcode(params) {
return request({
url: baseApi + "/wms/balance/page",
method: "get",
url: baseApi + "/wms/balance/seniorAll",
method: "post",
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="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>
@ -18,8 +17,10 @@
</view>
<view class="" v-if="dataContent.businessType"
style="font-size: 30rpx; padding-left: 10rpx ; padding-bottom: 10rpx;">
<text style="color:green; ">业务类型</text>
{{businessTypeDesc(dataContent.businessType)}}
<text style="color:green; ">业务类型 </text>
<text v-if="hasChinese(dataContent.businessType)">{{dataContent.businessType}}</text>
<text v-else> {{businessTypeDesc(dataContent.businessType)}}</text>
<!-- {{businessTypeDesc(dataContent.businessType)}} -->
</view>
</view>
<view class="uni-flex" style="flex-direction: column;">
@ -30,7 +31,24 @@
</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 {
getBusinessTypeName,
} from '@/common/directory.js';
import {
dateFormat
} from '@/common/basic.js';
export default {
components: {
itemQty,
@ -91,6 +113,17 @@
businessTypeDesc(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>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<view class="uni-flex" style="flex-direction: column" >
<view class="" style=" width: 100%; position: fixed; top: 0;right: 0;">
<view class="uni-flex" style="flex-direction: column">
<view class="" style=" width: 100%; position: fixed; 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="padding-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 style="padding-top: 210rpx;width:100%">
<view v-if="totalCount>0" style=" margin-left: 10rpx;margin-bottom: 10rpx; font-size:35rpx; font-weight:bold">总数 : {{totalCount}}
</view>
<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; ">
({{index+1}})
</view>
@ -22,7 +24,6 @@
</view>
<win-scan-button @goScan='openScanPopup' v-if="locationCode!=''"></win-scan-button>
<winScanLocation ref="scanPopup" title="库位代码" @getLocation='getScanCode'></winScanLocation>
@ -35,7 +36,7 @@
<script>
import {
getBalanceByLocationcode,
getBalanceByLocationcodeGroup,
getTransactionByLocationcode,
getExpectInByLocationCode,
getExpectOutByLocationCode
} from '@/api/request2.js';
@ -81,13 +82,13 @@
//
dataList: [],
tabList: ['汇总', '明细', '预计入', '预计出'],
tabList: ['库存余额', '预计入', '预计出', '库存事务'],
tabIndex: 0,
loadingType: "nomore",
totalCount:0
totalCount: 0
};
},
onLoad(option){
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title
})
@ -135,7 +136,7 @@
// this.getContentByTab(this.tabIndex);
},
getSummary(pageNo, pageSize, type) {
getBalance(pageNo, pageSize, type) {
let that = this;
uni.showLoading({
title: "加载中...",
@ -148,12 +149,18 @@
}
var params = {
locationCode: this.locationCode,
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();
if (type === "refresh") {
uni.stopPullDownRefresh();
@ -175,7 +182,7 @@
},
getDetailList(pageNo, pageSize, type) {
getTransaction(pageNo, pageSize, type) {
let that = this;
uni.showLoading({
title: "加载中...",
@ -189,11 +196,17 @@
}
var params = {
locationCode: this.locationCode,
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();
if (type === "refresh") {
uni.stopPullDownRefresh();
@ -233,8 +246,9 @@
column: "locationCode",
action: "==",
value: this.locationCode
}]
}],
sort:"createTime",
by: "ASC"
}
getExpectInByLocationCode(params).then(res => {
@ -277,8 +291,9 @@
column: "locationCode",
action: "==",
value: this.locationCode
}]
}],
sort:"createTime",
by: "ASC"
}
getExpectOutByLocationCode(params).then(res => {
@ -304,12 +319,12 @@
getContentByTab(index, pageNo, pageSize, type) {
if (index === 0) {
this.getSummary(pageNo, pageSize, type);
} else if (index === 1) this.getDetailList(pageNo, pageSize, type)
this.getBalance(pageNo, pageSize, type);
} else if (index === 1) this.getExpectin(pageNo, pageSize, type)
else if (index === 2) {
this.getExpectin(pageNo, pageSize, type)
} else if (index == 3) {
this.getExpectOut(pageNo, pageSize, type)
} else if (index == 3) {
this.getTransaction(pageNo, pageSize, type)
}
},
@ -327,7 +342,7 @@
},
tabChange(index) {
this.tabIndex = index;
this.getContentByTab(index, this.pageNo, this.pageSize,"refresh")
this.getContentByTab(index, this.pageNo, this.pageSize, "refresh")
},
}
};

Loading…
Cancel
Save