Ver código fonte

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

ccjgmwz 3 anos atrás
pai
commit
5f5536c241
3 arquivos alterados com 79 adições e 28 exclusões
  1. 2 3
      pages/erpbusiness/sendCommand.vue
  2. 76 24
      pages/user/report.vue
  3. 1 1
      static/map_0110.html

+ 2 - 3
pages/erpbusiness/sendCommand.vue

@@ -104,7 +104,7 @@
 		},
 		onShow() {
 			this.gridList = uni.getStorageSync("quality_print")
-			this.gridList.compId = uni.getStorageSync('pcUserInfo').compId
+			// this.gridList.compId = uni.getStorageSync('pcUserInfo').compId
 			console.log(this.gridList)
 			let that = this;
 			let width;
@@ -193,8 +193,7 @@
 				command.rowSpace(60);
 				command.setSelectSizeOfModuleForQRCode(5);
 				command.setSelectErrorCorrectionLevelForQRCode(7)
-				command.setStoreQRCodeData(that.gridList.compId + '&' + that.gridList.qualityNo + '&' + that.gridList
-					.warehouseId);
+				command.setStoreQRCodeData(that.gridList.compId + '&' + that.gridList.qualityNo + '&' + that.gridList.warehouseId);
 				command.setPrintQRCode();
 				//客户姓名
 				command.setSelectJustification(0); //居左

+ 76 - 24
pages/user/report.vue

@@ -156,7 +156,7 @@
 				<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"/>
+					background="none" :ontouch="true" />
 			</view>
 			<view class="content4 content-wrap">
 				<view class="title">在途信息统计表</view>
@@ -196,7 +196,7 @@
 				<iframe class='map' :src='url'></iframe>
 			</view>
 
-		<!-- 	<view class="content7">
+			<!-- 	<view class="content7">
 				<maoScroll :data="ztList" :showNum="showNum" :lineHeight="lineHeight" :animationScroll="animationScroll"
 					:animation="animation">
 					<template v-slot="{line}">
@@ -214,17 +214,20 @@
 				</maoScroll>
 			</view> -->
 			<view class="content7">
-			    <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 ref='scroll' class='scroll'>
+					<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>
 		</view>
 
 		<u-select v-model="showDate" mode="mutil-column" confirm-color='#22C572' :list="dateList" @confirm="confirm">
@@ -240,6 +243,7 @@
 		},
 		data() {
 			return {
+				carInterval: '',
 				inventoryCost: '',
 				inventoryValue: '',
 				contractSelect: '0',
@@ -296,7 +300,7 @@
 					percentage: ''
 				},
 				dateList: [
-					[ {
+					[{
 							value: '1',
 							label: '2021年'
 						},
@@ -376,6 +380,9 @@
 			}
 			this.init()
 		},
+		destroyed() {
+			clearInterval(this.carInterval)
+		},
 		methods: {
 			goToPage(index) {
 				console.log(index)
@@ -401,7 +408,8 @@
 				}
 			},
 			init() {
-				this.url = "https://liangxin.zthymaoyi.com/map_0105.html?id=" + uni.getStorageSync('pcUserInfo').compId +'&seachMoth='+this.seachMoth
+				this.url = "https://liangxin.zthymaoyi.com/map_0105.html?id=" + uni.getStorageSync('pcUserInfo').compId +
+					'&seachMoth=' + this.seachMoth
 				this.$api.doRequest('get', '/biInfoController/selectBiInfo?compId=' + uni.getStorageSync('pcUserInfo')
 					.compId + '&seachMoth=' + this.seachMoth).then(res => {
 					console.log(res)
@@ -419,12 +427,17 @@
 						if (i < 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))
+									1)).toFixed(2)
+							res.data.data[i].biViewInfoList[0].percentage = Number(res.data.data[i].biViewInfoList[
+									0]
+								.percentage.substring(0, res.data.data[i].biViewInfoList[0].percentage.length -
+									1)).toFixed(2) + '%'
+							res.data.data[i].total = Number(res.data.data[i].total).toFixed(2)
 							switch (i) {
 								case 0:
 									this.dataObj0 = {
 										percentage: res.data.data[i].biViewInfoList[0].percentage,
-										total: Number(res.data.data[i].total),
+										total: res.data.data[i].total,
 										percent: Number(res.data.data[i].biViewInfoList[0].percent)
 									}
 									break;
@@ -604,15 +617,15 @@
 							}
 
 						} else if (i == 7) {
-							this.inventoryCost = Number(res.data.data[i].biViewInfoList[0].count)
-							this.inventoryValue = Number(res.data.data[i].biViewInfoList[1].count)
+							this.inventoryCost = Number(res.data.data[i].biViewInfoList[0].count).toFixed(2)
+							this.inventoryValue = Number(res.data.data[i].biViewInfoList[1].count).toFixed(2)
 
 						} else if (i == 8) {
 							let _x = []
 							let _y = []
 							for (let k = 0; k < res.data.data[i].biViewInfoList.length; k++) {
 								_x.push(res.data.data[i].biViewInfoList[k].name)
-								_y.push(Number(res.data.data[i].biViewInfoList[k].count))
+								_y.push(Number(res.data.data[i].biViewInfoList[k].count).toFixed(2))
 							}
 							this.chartData = {
 								categories: _x,
@@ -734,7 +747,8 @@
 						} else if (i == 9) {
 							for (let k = 0; k < res.data.data[i].biViewInfoList.length; k++) {
 								var obj = res.data.data[i].biViewInfoList[k]
-								obj.startName = obj.name.split('→')[0].substring(0, 5) + '...'
+								// obj.startName = obj.name.split('→')[0].substring(0, 5) + '...'
+								obj.startName = obj.name.split('→')[0]
 								obj.endName = obj.name.split('→')[1]
 							}
 							this.ztList = res.data.data[i].biViewInfoList
@@ -742,16 +756,46 @@
 						}
 					}
 					this.chartlist = _list
+					this.scroll()
 					uni.hideLoading()
 				})
 			},
+			scroll() {
+				let _scroll = 0
+				let that = this
+				let _outHeight = ''
+				let _inHeight = ''
+				let obj = uni.createSelectorQuery().select('.content7')
+				obj.boundingClientRect(function(data) { // data - 各种参数
+					console.log(data)
+					_outHeight = data.height
+				}).exec()
+				setTimeout(function() {
+					let obj1 = uni.createSelectorQuery().select('.scroll')
+					obj1.boundingClientRect(function(data) { // data - 各种参数
+						console.log(data)
+						_inHeight = data.height
+					}).exec()
+					that.carInterval = setInterval(function() {
+						_scroll++
+						console.log(_scroll)
+						if (_scroll < _inHeight - _outHeight) {
+							that.$refs.scroll.$el.style.top = '-' + _scroll + 'px'
+						} else {
+							_scroll = 0
+						}
+					}, 50)
+
+				}, 0)
+
+			},
 			confirm(e) {
 				console.log(e)
-				this.nowDate = e[0].label+e[1].label
+				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
+					this.seachMoth = _year + '-' + e[1].value
 				} else {
 					this.seachMoth = _year
 				}
@@ -983,6 +1027,14 @@
 
 	.content7 {
 		position: relative;
+		overflow: hidden;
+		height: 400rpx;
+		margin-top: 20rpx;
+
+		.scroll {
+			position: absolute;
+			width: 100%;
+		}
 
 		.row1 {
 			background: #FAFAFA;

+ 1 - 1
static/map_0107.html → static/map_0110.html

@@ -67,7 +67,7 @@
 			src="https://webapi.amap.com/maps?v=2.0&key=211dd6f989e719022aaf47ddb0659c47&plugin=AMap.Scale,AMap.ToolBar,AMap.Geocoder,AMap.Geolocation,Geolocation">
 		</script>
 		<script src="https://webapi.amap.com/loca?v=2.0.0&key=211dd6f989e719022aaf47ddb0659c47"></script>
-		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
+		<script src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/jquery.min.js"></script>
 		<script>
 			var markerList = []
 			var mapPointData = {}