瀏覽代碼

仓库统计卡片增加参数,支持按照筛选统计

Yannay 9 小時之前
父節點
當前提交
a31f18f679
共有 2 個文件被更改,包括 14 次插入5 次删除
  1. 12 4
      pages/wareHouse/index.vue
  2. 2 1
      utils/api.js

+ 12 - 4
pages/wareHouse/index.vue

@@ -22,11 +22,11 @@
22 22
 			</view>
23 23
 			<view class="data-cards">
24 24
 				<view class="card-item">
25
-					<text class="card-label">日上传</text>
25
+					<text class="card-label">日上传</text>
26 26
 					<text class="card-value">{{ wareHouseCard.uploadCostToday }}</text>
27 27
 				</view>
28 28
 				<view class="card-item">
29
-					<text class="card-label">日下架</text>
29
+					<text class="card-label">日下架</text>
30 30
 					<text class="card-value green">{{ wareHouseCard.outStockToday }}</text>
31 31
 				</view>
32 32
 				<view class="card-item">
@@ -406,6 +406,7 @@ export default {
406 406
 			this.pageNum = 1;
407 407
 			this.goodsList = [];
408 408
 			this.getList();
409
+			this.getCard();
409 410
 		},
410 411
 		formatterProductAttribute(attr) {
411 412
 			if (!attr || attr.length == 0) {
@@ -466,9 +467,16 @@ export default {
466 467
 				});
467 468
 			}
468 469
 		},
469
-		// 获取仓库卡片数据
470
+		// 获取仓库卡片数据(与列表使用相同筛选条件,便于筛选后卡片数据一致)
470 471
 		getCard() {
471
-			uni.$u.api.getWareHouseCard({ userId: this.$store.state.user.userInfo.userId }).then(res => {
472
+			const body = {
473
+				searchString: this.searchString,
474
+				type: this.type,
475
+				deptId: this.deptId,
476
+				deptName: this.deptName,
477
+				...this.searchInfo
478
+			};
479
+			uni.$u.api.getWareHouseCardPost(body).then(res => {
472 480
 				if (res.code === 200) {
473 481
 					this.wareHouseCard = res.data;
474 482
 				}

+ 2 - 1
utils/api.js

@@ -125,7 +125,8 @@ const install = (Vue, vm) => {
125 125
 		getPersonCards:(params)=>http.get(store.state.user.path+'/personCenter/getPersonCards',{ params }),//个人中心-获取个人中心数据
126 126
 		getPersonLatestClue:(params)=>http.get(store.state.user.path+'/personCenter/getPersonLatestClue',{ params }),//个人中心-获取最新线索
127 127
 		getPersonRanking:(params)=>http.get(store.state.user.path+'/personCenter/getPersonRanking',{ params }),//个人中心-获取个人排名
128
-		getWareHouseCard:(params)=>http.get(store.state.user.path+'/warehouse/getWareHouseCard',{ params }),//仓库中心-获取仓库信息
128
+		getWareHouseCard:(params)=>http.get(store.state.user.path+'/warehouse/getWareHouseCard',{ params }),//仓库中心-获取仓库信息(无筛选)
129
+		getWareHouseCardPost:(data)=>http.post(store.state.user.path+'/warehouse/getWareHouseCard', data || {}),//仓库中心-卡片数据(支持与列表相同筛选条件)
129 130
 		inquiryChart:(data)=>http.post(store.state.user.path+'/warehouse/getPriceChart',data),//询价中心-获取询价图表数据
130 131
 		addInquiry:(data)=>http.post(store.state.user.path+'/inquiryCenter/addInquiry',data),//添加/编辑询价 有id是编辑 没有id是添加
131 132
 		inquiryDetail:(data)=>http.post(store.state.user.path+'/inquiryCenter/getInquiryDetail',data),//询价详情