Преглед изворни кода

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

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
 			</view>
22
 			</view>
23
 			<view class="data-cards">
23
 			<view class="data-cards">
24
 				<view class="card-item">
24
 				<view class="card-item">
25
-					<text class="card-label">日上传</text>
25
+					<text class="card-label">日上传</text>
26
 					<text class="card-value">{{ wareHouseCard.uploadCostToday }}</text>
26
 					<text class="card-value">{{ wareHouseCard.uploadCostToday }}</text>
27
 				</view>
27
 				</view>
28
 				<view class="card-item">
28
 				<view class="card-item">
29
-					<text class="card-label">日下架</text>
29
+					<text class="card-label">日下架</text>
30
 					<text class="card-value green">{{ wareHouseCard.outStockToday }}</text>
30
 					<text class="card-value green">{{ wareHouseCard.outStockToday }}</text>
31
 				</view>
31
 				</view>
32
 				<view class="card-item">
32
 				<view class="card-item">
@@ -406,6 +406,7 @@ export default {
406
 			this.pageNum = 1;
406
 			this.pageNum = 1;
407
 			this.goodsList = [];
407
 			this.goodsList = [];
408
 			this.getList();
408
 			this.getList();
409
+			this.getCard();
409
 		},
410
 		},
410
 		formatterProductAttribute(attr) {
411
 		formatterProductAttribute(attr) {
411
 			if (!attr || attr.length == 0) {
412
 			if (!attr || attr.length == 0) {
@@ -466,9 +467,16 @@ export default {
466
 				});
467
 				});
467
 			}
468
 			}
468
 		},
469
 		},
469
-		// 获取仓库卡片数据
470
+		// 获取仓库卡片数据(与列表使用相同筛选条件,便于筛选后卡片数据一致)
470
 		getCard() {
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
 				if (res.code === 200) {
480
 				if (res.code === 200) {
473
 					this.wareHouseCard = res.data;
481
 					this.wareHouseCard = res.data;
474
 				}
482
 				}

+ 2 - 1
utils/api.js

@@ -125,7 +125,8 @@ const install = (Vue, vm) => {
125
 		getPersonCards:(params)=>http.get(store.state.user.path+'/personCenter/getPersonCards',{ params }),//个人中心-获取个人中心数据
125
 		getPersonCards:(params)=>http.get(store.state.user.path+'/personCenter/getPersonCards',{ params }),//个人中心-获取个人中心数据
126
 		getPersonLatestClue:(params)=>http.get(store.state.user.path+'/personCenter/getPersonLatestClue',{ params }),//个人中心-获取最新线索
126
 		getPersonLatestClue:(params)=>http.get(store.state.user.path+'/personCenter/getPersonLatestClue',{ params }),//个人中心-获取最新线索
127
 		getPersonRanking:(params)=>http.get(store.state.user.path+'/personCenter/getPersonRanking',{ params }),//个人中心-获取个人排名
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
 		inquiryChart:(data)=>http.post(store.state.user.path+'/warehouse/getPriceChart',data),//询价中心-获取询价图表数据
130
 		inquiryChart:(data)=>http.post(store.state.user.path+'/warehouse/getPriceChart',data),//询价中心-获取询价图表数据
130
 		addInquiry:(data)=>http.post(store.state.user.path+'/inquiryCenter/addInquiry',data),//添加/编辑询价 有id是编辑 没有id是添加
131
 		addInquiry:(data)=>http.post(store.state.user.path+'/inquiryCenter/addInquiry',data),//添加/编辑询价 有id是编辑 没有id是添加
131
 		inquiryDetail:(data)=>http.post(store.state.user.path+'/inquiryCenter/getInquiryDetail',data),//询价详情
132
 		inquiryDetail:(data)=>http.post(store.state.user.path+'/inquiryCenter/getInquiryDetail',data),//询价详情