zhangyuewww 1 year ago
parent
commit
3b901c2dc6
2 changed files with 25 additions and 28 deletions
  1. 5 3
      pages/user/contractLook/inventoryCost.vue
  2. 20 25
      pages/user/contractLook/position.vue

+ 5 - 3
pages/user/contractLook/inventoryCost.vue

@@ -69,7 +69,8 @@
 				parameter: {
 					startDate: "",
 					endDate: '',
-					warehouseName: ''
+					warehouseName: '',
+					warehouseId: ''
 				},
 				show: false,
 				mode: 'range',
@@ -124,8 +125,8 @@
 			},
 			goposition(item) {
 				uni.navigateTo({
-					url: '/pages/user/contractLook/position?warehouse=' + item.warehouseName + '&warehouseType=' +
-						item.warehouseType
+					url: '/pages/user/contractLook/position?warehouse=' + item.warehouseName + '&warehouseId=' +
+						item.warehouseId
 				})
 			},
 			cancelClick() {
@@ -205,6 +206,7 @@
 							for (let i = 0; i < results.length; i++) {
 								let _obj = {}
 								_obj.warehouseName = results[i][0].warehouseName
+								_obj.warehouseId = results[i][0].warehouseId
 								// 大于两条添加合计行
 								if (results[i].length > 1) {
 									let _price = 0

+ 20 - 25
pages/user/contractLook/position.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 		<view class="big_title">{{warehousename}}</view>
-		<view @click='goposition(item)' class="cost-list" v-for="(item,index) in costList">
+		<view class="cost-list" v-for="(item,index) in costList">
 			<view style="display: flex;justify-content: space-between;">
 				<view class="title">仓位号:{{item.binNumber}}</view>
 			</view>
@@ -12,11 +12,11 @@
 					<view class="font">储量(吨)</view>
 					<view class="font">价值(元)</view>
 				</view>
-				<view class="goods-table-content" v-for="(item1,index1) in item.warehouseNumViewList">
-					<view class="font" :class="item.warehouseNumViewList.length>1&&index1==item.warehouseNumViewList.length-1?'active':''">
+				<view class="goods-table-content" v-for="(item1,index1) in item.warehousePositionStorageInfoList">
+					<view class="font" :class="item.warehousePositionStorageInfoList.length>1&&index1==item.warehousePositionStorageInfoList.length-1?'active':''">
 						{{item1.goodsName}}
 					</view>
-					<view class="font" :class="item.warehouseNumViewList.length>1&&index1==item.warehouseNumViewList.length-1?'active':''">
+					<view class="font" :class="item.warehousePositionStorageInfoList.length>1&&index1==item.warehousePositionStorageInfoList.length-1?'active':''">
 						{{item1.storage}}
 					</view>
 					<view class="font">{{item1.cost}}</view>
@@ -65,6 +65,7 @@
 				isShowAlert: false,
 				content: '当前登录身份已失效,请重新登录!',
 				warehousename:'',
+				warehouseId: '',
 				parameter: {
 					startDate: "",
 					endDate: '',
@@ -89,6 +90,7 @@
 		},
 		onLoad: function(option) {
 			this.warehousename=option.warehouse
+			this.warehouseId=option.warehouseId
 			this.init()
 		},
 		computed: {
@@ -100,11 +102,11 @@
 					url: '/pages/public/login'
 				})
 			},
-			goposition(item){
-				uni.navigateTo({
-					url: '/pages/user/contractLook/position?warehouse='+item.warehouseName+'&warehouseType='+item.warehouseType
-				})
-			},
+			// goposition(item){
+			// 	uni.navigateTo({
+			// 		url: '/pages/user/contractLook/position?warehouse='+item.warehouseName+'&warehouseType='+item.warehouseType
+			// 	})
+			// },
 			cancelClick() {
 				this.isShowAlert = false
 			},
@@ -168,36 +170,29 @@
 					uni.showLoading({
 						title: '正在加载'
 					})
-					this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseViewinfo', {
-						compId: uni.getStorageSync('pcUserInfo').compId,
-						warehouseType: 1,
-						warehouseName:this.warehousename
+					this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
+						id:this.warehouseId
 					}).then(res => {
 						uni.hideLoading()
 						if (res.data.data) {
-							const results = res.data.data.warehouseViewList
-
+							const results = res.data.data.warehousePositionInfoList
 							for (let i = 0; i < results.length; i++) {
-								if(results[i].warehouseNumViewList.length>1){
+								if(results[i].warehousePositionStorageInfoList&&results[i].warehousePositionStorageInfoList.length>1){
 									let _price = 0
-									console.log(results[i].warehouseNumViewList)
-									for (let q = 0; q < results[i].warehouseNumViewList.length; q++) {
-										console.log(results[i].warehouseNumViewList[q])
-										_price +=Number(results[i].warehouseNumViewList[q].storage)
+									for (let q = 0; q < results[i].warehousePositionStorageInfoList.length; q++) {
+										_price +=Number(results[i].warehousePositionStorageInfoList[q].storage)
 									}
 									_price = _price.toFixed(2)
-									results[i].warehouseNumViewList.push({
+									results[i].warehousePositionStorageInfoList.push({
 										'goodsName': '合计',
 										'storage': _price
 									})
 								}
+								this.costList =results
 							}
-							this.costList =results
-						}
-
+						}				
 					})
 				}
-
 			},
 			makeGroupData(array, fn) {
 				const groups = {};