瀏覽代碼

修改地图

wangchao 3 年之前
父節點
當前提交
a536c378a8
共有 4 個文件被更改,包括 207 次插入76 次删除
  1. 10 1
      pages.json
  2. 133 0
      pages/user/contractLook/inventoryCost.vue
  3. 64 75
      pages/user/report.vue
  4. 0 0
      static/map_0105.html

+ 10 - 1
pages.json

@@ -1247,7 +1247,16 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/user/contractLook/inventoryCost",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "库存成本",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"subpackages": [{
 			"root": "pageA",
 			"pages": [{

+ 133 - 0
pages/user/contractLook/inventoryCost.vue

@@ -0,0 +1,133 @@
+<template>
+	<view class="content">
+		<view class="cost-list" v-for="(item,index) in costList">
+			<view class="title">
+				{{item.warehouseName}}
+			</view>
+			<view class="goods-table">
+				<view class="goods-table-title">
+					<view class="font">货名</view>
+					<view class="font">储量(吨)</view>
+					<view class="font">价值(元)</view>
+				</view>
+				<view class="goods-table-content" v-for="(item1,index1) in item.goodList">
+					<view class="font">{{item1.goodsName}}</view>
+					<view class="font">{{item1.storage}}</view>
+					<view class="font">{{item1.cost}}</view>
+				</view>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				costList:[]
+			}
+		},
+		onLoad: function(option) {
+			uni.showLoading({
+				title: "加载中",
+				mask: true
+			})
+			this.init()
+		},
+		methods: {
+			init() {
+				this.$api.doRequest('get', '/costManagementInfo/selectCostManagementInfo', {
+				compId: uni.getStorageSync('pcUserInfo').compId,
+				warehouseType: 1
+				}).then(res => {
+					uni.hideLoading()
+					const results = this.makeGroupData(res.data.data,function (item) {
+					return [item.warehouseName];
+					});
+					
+					console.log(this.costList)
+					let _data = []
+					for(let i=0;i<results.length;i++){
+						let _obj = {}
+						_obj.warehouseName = results[i][0].warehouseName
+						_obj.goodList = results[i]
+						_data.push(_obj)
+					}
+					console.log(_data)
+					this.costList = _data
+				})
+			},
+			makeGroupData(array,fn){
+				const groups = {};
+				array.forEach(function (item) {
+				     const group = JSON.stringify(fn(item));
+				     groups[group] = groups[group] || [];
+				     groups[group].push(item);
+				});
+				return Object.keys(groups).map(function (group) {
+					
+				     return groups[group];
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+.cost-list{
+	margin: 20rpx;
+	background: white;
+	border-radius: 20rpx;
+	padding: 20rpx;
+	.title{
+		font-size: 32rpx;
+		font-weight: 500;
+		color: #333333;
+	}
+	.goods-table{
+		margin-top: 22rpx;
+	}
+	.goods-table-title{
+			display: flex;
+			border-bottom: 1px solid #EEEEEE;
+			padding-bottom:16rpx;
+			// margin-bottom: ;
+		.font{
+			
+			font-size: 27rpx;
+			font-weight: 400;
+			color: #B2B3BB;
+			
+		}
+		.font:nth-of-type(1){
+			width: 40%;
+		}
+		.font:nth-of-type(2){
+			width: 30%;
+		}
+		.font:nth-of-type(3){
+			width: 30%;
+			text-align: right;
+		}
+	}
+	.goods-table-content{
+		display: flex;
+		margin: 22rpx;
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #333333;
+		.font:nth-of-type(1){
+			width: 40%;
+		}
+		.font:nth-of-type(2){
+			width: 30%;
+		}
+		.font:nth-of-type(3){
+			width: 30%;
+			text-align: right;
+		}
+		
+	}
+}
+</style>

+ 64 - 75
pages/user/report.vue

@@ -37,7 +37,7 @@
 					</view>
 				</view>
 				<u-line color="#EEEEEE" class="u-line" />
-				<view class="row2">
+				<view class="row2" @click="goToPage(1)">
 					<view class="top">
 						合同总量
 					</view>
@@ -75,7 +75,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="row3">
+				<view class="row3" @click="goToPage(2)">
 					<view class="top">
 						合同总额
 					</view>
@@ -113,7 +113,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="row4">
+				<view class="row4" @click="goToPage(3)">
 					<view class="top">
 						合同总额
 					</view>
@@ -154,7 +154,7 @@
 
 			</view>
 			<view class="content3 content-wrap">
-				<view class="title">粮食品种占比</view>
+				<view class="title" @click="goToPage(4)">粮食品种占比</view>
 				<u-line color="#EEEEEE" class="u-line" />
 				<qiun-data-charts type="line" class='line-chart' :chartData="chartData" :opts='zringoptions'
 					background="none" :ontouch="true" />
@@ -165,7 +165,7 @@
 				<qiun-data-charts type="column" class='line-chart' :chartData="carChartData" :opts='ringoptions'
 					background="none" />
 			</view>
-			<view class="content5 content-wrap">
+			<view class="content5 content-wrap" @click="goToPage(5)">
 				<view class="title">库存成本</view>
 				<u-line color="#EEEEEE" class="u-line" />
 				<view class="row1">
@@ -198,11 +198,12 @@
 			</view>
 
 			<view class="content7">
-				<maoScroll :data="ztList" :showNum="showNum" :lineHeight="lineHeight" :animationScroll="animationScroll" :animation="animation">
+				<maoScroll :data="ztList" :showNum="showNum" :lineHeight="lineHeight" :animationScroll="animationScroll"
+					:animation="animation">
 					<template v-slot="{line}">
 						<view class="row1">
 							<view class="zt">
-							<view class="point"></view>在途
+								<view class="point"></view>在途
 							</view>
 							<view>{{line.startName}}</view>
 							<img src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jiantou.png" alt="">
@@ -212,16 +213,6 @@
 						</view>
 					</template>
 				</maoScroll>
-				<!-- <view class="row1" v-for="(item,index) in ztList">
-					<view class="zt">
-						<view class="point"></view>在途
-					</view>
-					<view>{{item.startName}}</view>
-					<img src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jiantou.png" alt="">
-					<view class="">
-						{{item.endName}}
-					</view>
-				</view> -->
 			</view>
 		</view>
 
@@ -233,7 +224,7 @@
 <script>
 	import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
 	export default {
-		components:{
+		components: {
 			maoScroll
 		},
 		data() {
@@ -242,15 +233,10 @@
 				inventoryValue: '',
 				contractSelect: '0',
 				url: '',
-				nowDate: '2021年全年',
+				nowDate: '2022年全年',
+				seachMoth: '',
 				background: {
 					backgroundColor: '#2E303A',
-					// 导航栏背景图
-					// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
-					// 还可以设置背景图size属性
-					// backgroundSize: 'cover',
-					// 渐变色
-					// backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
 				},
 				typeSelect: '0',
 				contractSelect: '0',
@@ -299,13 +285,13 @@
 					percentage: ''
 				},
 				dateList: [
-					[{
+					[ {
 							value: '1',
-							label: '2020年'
+							label: '2021年'
 						},
 						{
 							value: '2',
-							label: '2021年'
+							label: '2022年'
 						}
 					],
 					[{
@@ -313,39 +299,39 @@
 							label: '全年'
 						},
 						{
-							value: '1',
+							value: '01',
 							label: '1月'
 						},
 						{
-							value: '2',
+							value: '02',
 							label: '2月'
 						},
 						{
-							value: '3',
+							value: '03',
 							label: '3月'
 						},
 						{
-							value: '4',
+							value: '04',
 							label: '4月'
 						},
 						{
-							value: '5',
+							value: '05',
 							label: '5月'
 						},
 						{
-							value: '6',
+							value: '06',
 							label: '6月'
 						},
 						{
-							value: '7',
+							value: '07',
 							label: '7月'
 						},
 						{
-							value: '8',
+							value: '08',
 							label: '8月'
 						},
 						{
-							value: '9',
+							value: '09',
 							label: '9月'
 						},
 						{
@@ -363,7 +349,6 @@
 					]
 				],
 				ztList: [],
-				//向上滚动
 				showNum: 8,
 				lineHeight: 80,
 				animationScroll: 5000,
@@ -371,17 +356,43 @@
 			}
 		},
 		onLoad: function(option) {
-			uni.showLoading({
-				title:"数据加载中...",
-				mask:true
-			})
-			this.url = "https://liangxin.zthymaoyi.com/map.html?id=" + uni.getStorageSync('pcUserInfo').compId
+			// uni.showLoading({
+			// 	title: "数据加载中...",
+			// 	mask: true
+			// })
+			this.url = "https://liangxin.zthymaoyi.com/map_0105.html?id=" + uni.getStorageSync('pcUserInfo').compId
+			if (this.nowDate == '2022年全年') {
+				this.seachMoth = '2022'
+			}
 			this.init()
 		},
 		methods: {
+			goToPage(index) {
+				console.log(index)
+				if (index == 4) {
+					uni.navigateTo({
+						url: '/pages/user/contractLook/warehouseReserves'
+					})
+					return true
+				} else if (index == 5) {
+					uni.navigateTo({
+						url: '/pages/user/contractLook/inventoryCost'
+					})
+					return true
+				}
+				if (this.contractSelect == '0') {
+					uni.navigateTo({
+						url: '/pages/user/contractLook/purchaseContract'
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/user/contractLook/salesContract'
+					})
+				}
+			},
 			init() {
 				this.$api.doRequest('get', '/biInfoController/selectBiInfo?compId=' + uni.getStorageSync('pcUserInfo')
-					.compId).then(res => {
+					.compId + '&seachMoth=' + this.seachMoth).then(res => {
 					console.log(res)
 					uni.hideLoading()
 					let _list = []
@@ -398,7 +409,6 @@
 							res.data.data[i].biViewInfoList[0].percent = Number(res.data.data[i].biViewInfoList[0]
 								.percentage.substring(0, res.data.data[i].biViewInfoList[0].percentage.length -
 									1))
-
 							switch (i) {
 								case 0:
 									this.dataObj0 = {
@@ -724,44 +734,23 @@
 					uni.hideLoading()
 				})
 			},
-			getHeight(Class) {
-				let query = uni.createSelectorQuery().in(this);
-				query
-					.selectAll(Class)
-					.boundingClientRect(data => {
-						this.height = data[0].height;
-					})
-					.exec();
-			},
-			prizeScroll() {
-				let speed = 50;
-				let animation = uni.createAnimation({
-					duration: this.getHeight('.content7') / speed,
-					timingFunction: 'linear',
-					delay: 0
-				});
-				// this.animation = animation;
-				setInterval(() => {
-					if (this.scrollHeight >= this.height) {
-						animation.translateY(0).step();
-						this.scrollHeight = 0;
-						this.animationData = animation.export();
-					} else {
-						this.scrollHeight = this.scrollHeight + 1;
-						animation.translateY(-this.scrollHeight).step();
-						this.animationData = animation.export();
-					}
-				}, speed);
-			},
 			confirm(e) {
 				console.log(e)
+				this.nowDate = e[0].label+e[1].label
+				let _year = e[0].label.substring(0, 4)
+				
+				if (e[1].label != '全年') {
+					this.seachMoth = _year + e[1].value
+				} else {
+					this.seachMoth = _year
+				}
+				this.init()
 			},
 			dateClick() {
 				this.showDate = true
 			},
 			typeClick(index) {
 				this.typeSelect = index
-
 				console.log(index)
 			},
 			htClick(index) {

+ 0 - 0
static/map.html → static/map_0105.html