achao 2 лет назад
Родитель
Сommit
7085843eb3
2 измененных файлов с 240 добавлено и 69 удалено
  1. 7 7
      pages/dataReport/Inventoryentrydetails.vue
  2. 233 62
      pages/user/newReport.vue

+ 7 - 7
pages/dataReport/Inventoryentrydetails.vue

@@ -58,17 +58,14 @@
 			}
 		},
 		onLoad() {
-			uni.showLoading({
-					title: "正在加载"
-				})
 			this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfApp', {
-				compId:uni.getStorageSync('pcUserInfo').compId,
+				compId: uni.getStorageSync('pcUserInfo').compId,
 			}).then(res => {
 				if (res.data.code == 200) {
-					uni.hideLoading()
+					// uni.hideLoading()
 					this.warehouseList = res.data.data
 				} else {
-					uni.hideLoading()
+					// uni.hideLoading()
 					uni.showToast({
 						title: "系统异常,请联系管理员",
 						icon: 'none',
@@ -146,7 +143,9 @@
 				console.log(e)
 			},
 			getList() {
-
+				uni.showLoading({
+					title: "正在加载"
+				})
 				// warehouseBaseInfo/selectWarehouseSelf
 
 				this.$api.doRequest('get', '/warehousingOrder/selectInfo', {
@@ -215,6 +214,7 @@
 								this.warehouseList = []
 							}
 						}
+						uni.hideLoading()
 					} else {
 						uni.hideLoading()
 						uni.showToast({

+ 233 - 62
pages/user/newReport.vue

@@ -3,12 +3,13 @@
 		<view class="status_bar"></view>
 		<view class="top-nav">
 			<u-icon name="arrow-left" size="38" class="back" @click="back"></u-icon>
-			<view class="left" :class="index==1?'nav-active':''" @click="navClick(1)">
-				全部
-			</view>
 			<view class="right" :class="index==2?'nav-active':''" @click="navClick(2)">
 				新季
 			</view>
+			<view class="left" :class="index==1?'nav-active':''" @click="navClick(1)">
+				全部
+			</view>
+
 		</view>
 		<view class="content1 content-item">
 			<view class="title">
@@ -38,7 +39,7 @@
 						收入(万元)
 					</view>
 					<view class="price">
-						{{sr?sr:0}}
+						{{sr?Number(sr).toFixed(2):0}}
 					</view>
 				</view>
 				<view class="row3" @click='godetail(2)'>
@@ -47,7 +48,7 @@
 							支出(万元)
 						</view>
 						<view class="number">
-							{{zc?zc:0}}
+							{{zc?Number(zc).toFixed(2):0}}
 						</view>
 					</view>
 					<view class="center">
@@ -64,11 +65,13 @@
 				</view>
 				<view class="row5 flex alc">
 					<view class="left">
-						<text class="point-left flex alc"></text>收入(万元):<text class="text-left">{{sr}}</text>
+						<text class="point-left flex alc"></text>收入(万元):<text
+							class="text-left">{{Number(sr).toFixed(2)}}</text>
 						<!-- <text class="point-left flex alc"></text>收入(万元):<text class="text-left">2000.00</text> -->
 					</view>
 					<view class="right">
-						<text class="point-right"></text>收入(万元):<text class="text-right">{{zc}}</text>
+						<text class="point-right"></text>支出(万元):<text
+							class="text-right">{{Number(zc).toFixed(2)}}</text>
 						<!-- <text class="point-left flex alc"></text>收入(万元):<text class="text-left">2000.00</text> -->
 					</view>
 				</view>
@@ -91,7 +94,7 @@
 			<uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
 				:show="isSHowContent2">
 				<u-line color="#EEEEEE" />
-				<view class="row1 flex jcsb mtb40">
+				<view class="row1 flex jcsb" style="margin-top: 40rpx;">
 					<view class="left title-lv2">
 						数量统计
 					</view>
@@ -112,7 +115,7 @@
 				<view class="row3">
 					<qiun-data-charts type="bar" :opts="opts2" :chartData="chartData1" />
 				</view>
-				<view class="row4 flex jcsb mtb40" v-if="isHaveData3">
+				<view class="row4 flex jcsb mtb40">
 					<view class="left title-lv2">
 						利润核算
 					</view>
@@ -120,7 +123,7 @@
 						利润明细
 					</view>
 				</view>
-				<view class="row5" v-if="isHaveData3">
+				<view class="row5">
 					<view class="left flex">
 						<view class="" v-if="index==1">
 							<u-icon name="arrow-left" size="26" style="margin-right: 10rpx;" color="#969696"
@@ -178,9 +181,9 @@
 						<view class="name">
 							{{item.name}}
 						</view>
-						<view class="bottom">
+						<view class="bottom flex alc">
 							<u-line-progress :percent="item.percent" :active-color="color4(index)" :show-percent='false'
-								class='left' height='20'>
+								class='left' height='12'>
 							</u-line-progress>
 							<view class="weight">
 								{{item.weight}}
@@ -195,7 +198,7 @@
 					<view class="list-item flex jcsb" v-for="(item,index) in InventoryList">
 						<view class="flex alc">
 							<image :src="item.src" mode="widthFix" style="width: 40rpx;margin-right: 20rpx;"></image>
-							<text>{{item.name}}</text>
+							<text style="color:#707575;">{{item.name}}</text>
 						</view>
 						<view class="number">
 							{{item.number}}
@@ -207,7 +210,7 @@
 						当期货值
 					</view>
 					<view class="right">
-						单位:元
+						单位:
 					</view>
 				</view>
 				<view class="row6">
@@ -219,7 +222,7 @@
 					</view>
 					<view class="list-item" v-for="item in averageCostList">
 						<view class="flex jcsb alc">
-							<view class="left">
+							<view class="left" style="color: #7A7A7A;">
 								{{item.name}}
 							</view>
 							<view class="">
@@ -247,8 +250,25 @@
 			</view>
 			<uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
 				:show="isSHowContent4">
-				<view class="row1">
-					<qiun-data-charts type="ring" :opts="opts6" :chartData="chartData6" />
+				<u-line color="#EEEEEE" />
+				<view class="" style="color: #9E9E9E;margin: 30rpx 0 0 30rpx; font-size: 12px;">
+					单位:吨
+				</view>
+				<view class="flex alc">
+					<view class="" style="width:40%;height: 160px;">
+						<qiun-data-charts type="ring" :opts="opts6" :chartData="chartData6" class='opts6' />
+					</view>
+					<view class="zt-right">
+						<view class="flex jcsb alc" v-for="item in rkList" style="font-weight: 700;">
+							<view class="left">
+								<text :style="item.style"></text>{{item.name}}
+							</view>
+							<view class="right">
+								{{Number(item.value).toFixed(2)}}
+							</view>
+						</view>
+					</view>
+
 				</view>
 			</uni-transition>
 			<view class="zd flex" @click="foldClcik('fade',4)">
@@ -263,13 +283,31 @@
 			</view>
 			<uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
 				:show="isSHowContent5">
+				<u-line color="#EEEEEE" />
 				<view class="row1 days-nav">
 					<view class="item" :class="carIndex==index?'item-active':''" v-for="(item, index) in dayList"
 						@click="clickNav(index)">
 						{{item}}
 					</view>
 				</view>
-				<qiun-data-charts type="ring" :opts="opts7" :chartData="chartData7" />
+				<view class="flex alc">
+					<view class="" style="width:40%;height: 160px;">
+						<qiun-data-charts type="ring" :opts="opts7" :chartData="chartData7" />
+					</view>
+					<view class="zt-right">
+						<view class="flex jcsb alc" v-for="item in ztList" style="font-weight: 700;">
+							<view class="left">
+								<text :style="item.style"></text>{{item.name}}
+							</view>
+							<view class="right">
+								{{item.value}}
+							</view>
+						</view>
+					</view>
+
+				</view>
+
+
 			</uni-transition>
 			<view class="zd flex" @click="foldClcik('fade',5)">
 				{{this.isSHowContent5?'点击收起':'点击展开'}}
@@ -283,6 +321,7 @@
 			</view>
 			<uni-transition ref="ani" custom-class="transition" :mode-class="modeClass" :styles="styles"
 				:show="isSHowContent6">
+				<u-line color="#EEEEEE" />
 				<view class="row1 flex jcsb">
 					<view class="left">
 						app注册
@@ -326,6 +365,9 @@
 
 		data() {
 			return {
+				rkList: [],
+				ztList: [],
+				ztColor: ['#38CA80', '#8D9EE9', '#FFBB6E'],
 				color: ['#FFBB6E', '#8D9EE9', '#FF8B95', '#38CA80', '#FFDD85', "#1890FF", "#91CB74", "#FAC858", "#EE6666",
 					"#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 					"#ea7ccc"
@@ -341,7 +383,7 @@
 				sr: '',
 				zc: '',
 				seachYear: '',
-				seachMoth: '',
+				seachMoth: '2022-10-10',
 				dayList: ['1天', '7天', '30天'],
 				averageCostList: [{
 						name: '玉米',
@@ -437,6 +479,7 @@
 						data: [{
 							// disabled: true,
 							axisLine: false,
+							fontColor: "#BEBEBE",
 						}],
 
 					},
@@ -477,6 +520,9 @@
 					padding: [15, 30, 0, 5],
 					legend: {
 						fontSize: 12,
+						position: 'top',
+						itemGap: 10,
+						margin: 30
 					},
 					xAxis: {
 						boundaryGap: "justify",
@@ -486,14 +532,16 @@
 						dashLength: 10,
 
 					},
-					yAxis: {},
+					yAxis: {
+
+					},
 					extra: {
 						// tooltip: {
 						// 	showBox: false,
 						// },
 						bar: {
 							type: "group",
-							width: 30,
+							width: 10,
 							meterBorde: 1,
 							meterFillColor: "#FFFFFF",
 							activeBgColor: "#000000",
@@ -553,7 +601,9 @@
 						axisLine: false,
 						itemCount: 4,
 					},
-					yAxis: {},
+					yAxis: {
+
+					},
 					extra: {
 						bar: {
 							type: "group",
@@ -584,7 +634,9 @@
 					yAxis: {
 						gridType: "dash",
 						data: [{
-							min: 0
+							min: 0,
+							fontColor: "#BEBEBE",
+							axisLine: false
 						}]
 					},
 					extra: {
@@ -605,15 +657,14 @@
 					}
 				},
 				opts6: {
+					dataLabel: false,
 					rotate: false,
 					rotateLock: false,
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
 					],
-					padding: [5, 5, 5, 5],
-					dataLabel: true,
 					legend: {
-						show: true,
+						show: false,
 						position: "right",
 						lineHeight: 25
 					},
@@ -629,7 +680,7 @@
 					},
 					extra: {
 						ring: {
-							ringWidth: 20,
+							ringWidth: 10,
 							activeOpacity: 0.5,
 							activeRadius: 10,
 							offsetAngle: 0,
@@ -641,15 +692,14 @@
 					}
 				},
 				opts7: {
+					dataLabel: false,
 					rotate: false,
 					rotateLock: false,
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
 					],
-					padding: [5, 5, 5, 5],
-					dataLabel: true,
 					legend: {
-						show: true,
+						show: false,
 						position: "right",
 						lineHeight: 25
 					},
@@ -665,7 +715,7 @@
 					},
 					extra: {
 						ring: {
-							ringWidth: 15,
+							ringWidth: 10,
 							activeOpacity: 0.5,
 							activeRadius: 10,
 							offsetAngle: 0,
@@ -687,7 +737,12 @@
 					},
 					yAxis: {
 						gridType: "dash",
-						dashLength: 2
+						dashLength: 2,
+						data: [{
+							// disabled: true,
+							axisLine: false,
+							fontColor: "#BEBEBE",
+						}],
 					},
 					extra: {
 						area: {
@@ -696,6 +751,28 @@
 							addLine: true,
 							width: 2,
 							gradient: true
+						},
+						tooltip: {
+							showBox: false,
+							showArrow: true,
+							showCategory: false,
+							borderWidth: 0,
+							borderRadius: 0,
+							borderColor: "#000000",
+							borderOpacity: 0.7,
+							bgColor: "#000000",
+							bgOpacity: 0.7,
+							gridType: "dash",
+							dashLength: 4,
+							gridColor: "#E9E9E9",
+							fontColor: "#FFFFFF",
+							splitLine: true,
+							horizentalLine: false,
+							xAxisLabel: false,
+							yAxisLabel: false,
+							labelBgColor: "#FFFFFF",
+							labelBgOpacity: 0.7,
+							labelFontColor: "#666666"
 						}
 					}
 				},
@@ -710,7 +787,12 @@
 					},
 					yAxis: {
 						gridType: "dash",
-						dashLength: 2
+						dashLength: 2,
+						data: [{
+							// disabled: true,
+							axisLine: false,
+							fontColor: "#BEBEBE",
+						}],
 					},
 					extra: {
 						area: {
@@ -719,11 +801,33 @@
 							addLine: true,
 							width: 2,
 							gradient: true
+						},
+						tooltip: {
+							showBox: false,
+							showArrow: true,
+							showCategory: false,
+							borderWidth: 0,
+							borderRadius: 0,
+							borderColor: "#000000",
+							borderOpacity: 0.7,
+							bgColor: "#000000",
+							bgOpacity: 0.7,
+							gridType: "dash",
+							dashLength: 4,
+							gridColor: "#E9E9E9",
+							fontColor: "#FFFFFF",
+							splitLine: true,
+							horizentalLine: false,
+							xAxisLabel: false,
+							yAxisLabel: false,
+							labelBgColor: "#FFFFFF",
+							labelBgOpacity: 0.7,
+							labelFontColor: "#666666"
 						}
 					}
 				},
 				textIndex: 1,
-				index: 1,
+				index: 2,
 				background: {
 					backgroundColor: '#2E303A',
 					backgroundColor: 'red',
@@ -909,6 +1013,7 @@
 				let _categories = []
 				let _price1 = []
 				let _price2 = []
+				this.chartData.series = [];
 				// 设置x轴数据
 				let _ySRPriceMax = 0
 				let _yZCPriceMax = 0
@@ -917,13 +1022,13 @@
 
 					if (val[0].biViewInfoList && val[0].biViewInfoList.length > 0) {
 						for (let i = 0; i < val[0].biViewInfoList.length; i++) {
-							val[0].biViewInfoList[i].weight = Number(val[0].biViewInfoList[i].weight * 0.0001).toFixed(2)
+							val[0].biViewInfoList[i].weight = Number(val[0].biViewInfoList[i].weight).toFixed(2)
 							_price1.push(val[0].biViewInfoList[i].weight)
 						}
 						//月收入最大值
 						_ySRPriceMax = Math.max(..._price1)
 						for (let i = 0; i < val[2].biViewInfoList.length; i++) {
-							val[2].biViewInfoList[i].weight = Number(val[2].biViewInfoList[i].weight * 0.0001).toFixed(2)
+							val[2].biViewInfoList[i].weight = Number(val[2].biViewInfoList[i].weight).toFixed(2)
 							_price2.push(val[2].biViewInfoList[i].weight)
 							_categories.push(new Date(val[2].biViewInfoList[i].name).getMonth() + 1)
 						}
@@ -939,17 +1044,19 @@
 					}
 				} else {
 					if (val[1].biViewInfoList && val[1].biViewInfoList.length > 0) {
+
 						this.ym1 = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].name
 						this.sr = val[1].biViewInfoList[val[1].biViewInfoList.length - 1].weight
 						this.zc = val[3].biViewInfoList[val[3].biViewInfoList.length - 1].weight
 						for (let i = 0; i < val[1].biViewInfoList.length; i++) {
-							_categories.push(new Date(val[1].biViewInfoList[i].name).getMonth() + 1)
+							_categories.push(val[1].biViewInfoList[i].name)
 							_price1.push(val[1].biViewInfoList[i].weight)
 						}
 						for (let i = 0; i < val[3].biViewInfoList.length; i++) {
 							_price2.push(val[3].biViewInfoList[i].weight)
 						}
 					}
+					_max = _price1 > _price2 ? _price1 : _price2
 				}
 				let res = {
 					categories: _categories,
@@ -965,7 +1072,8 @@
 
 					]
 				};
-				this.opts.yAxis.data[0].max = Math.ceil(_max / 1000) * 1000
+				// this.opts.yAxis.data[0].max = Math.ceil(_max / 1000) * 1000
+				this.opts.yAxis.data[0].max = Math.ceil(_max * 1.05 / 500) * 500
 				this.chartData = JSON.parse(JSON.stringify(res));
 			},
 			makeDate2(val) {
@@ -1023,16 +1131,19 @@
 						_categorieslr.push(val[5].biViewInfoList[i].name.substring(0, 2))
 						_countlr.push(val[5].biViewInfoList[i].weight ? val[5].biViewInfoList[i].weight : 0)
 					}
-					//利润核算
-					let res3 = {
-						categories: _categorieslr,
-						series: [{
-							name: "利润金额",
-							data: _countlr
-						}]
-					};
-					this.chartData3 = JSON.parse(JSON.stringify(res3));
+
+				} else {
+					this.isHaveData3 = false
 				}
+				//利润核算
+				let res3 = {
+					categories: _categorieslr,
+					series: [{
+						name: "利润金额",
+						data: _countlr
+					}]
+				};
+				this.chartData3 = JSON.parse(JSON.stringify(res3));
 
 			},
 			makeDate4(val) {
@@ -1048,7 +1159,7 @@
 								i]
 							.weight).toFixed(0) : 0)
 					}
-					_maxWeight = Math.max(..._weightList)
+					_maxWeight = Math.max(..._weightList) + Math.max(..._weightList) * 0.05
 					for (let i = 0; i < val[8].biViewInfoList.length; i++) {
 						let _obj = {
 							percent: Number(val[8].biViewInfoList[i].weight).toFixed(0) / _maxWeight * 100,
@@ -1098,14 +1209,15 @@
 			makeDate5(val) {
 				let _categorieslr = []
 				let _count = []
-				if (val[7].biViewInfoList && val[7].biViewInfoList.length > 0) {
-					for (let i = 0; i < val[7].biViewInfoList.length; i++) {
+				if (val[7].biViewInfoList && val[9].biViewInfoList.length > 0) {
+					for (let i = 0; i < val[9].biViewInfoList.length; i++) {
 						let _obj = {
-							value: Number(val[7].biViewInfoList[i].count ? val[7].biViewInfoList[i].count : 0).toFixed(
-								0),
+							value: Number(val[9].biViewInfoList[i].weight ? val[9].biViewInfoList[i].weight : 0)
+								.toFixed(
+									0),
 							color: this.color[i]
 						}
-						_categorieslr.push(val[7].biViewInfoList[i].name)
+						_categorieslr.push(val[9].biViewInfoList[i].name)
 						_count.push(_obj)
 					}
 				}
@@ -1131,7 +1243,7 @@
 				let res5 = {
 					categories: _categorieslr,
 					series: [{
-						name: "利润金额",
+						name: "货值(万元)",
 						data: _count
 					}]
 				};
@@ -1145,12 +1257,23 @@
 					for (let i = 0; i < val[10].biViewInfoList.length; i++) {
 						let _obj = {
 							name: val[10].biViewInfoList[i].name,
-							value: val[10].biViewInfoList[i].weight
+							value: val[10].biViewInfoList[i].weight,
+							color: this.color[i],
+							style: {
+								'background': this.color[i],
+								'border-radius': '50%',
+								'width': '20rpx',
+								'height': '20rpx',
+								'display': 'inline-block',
+								'margin-right': '10rpx'
+							},
 						}
 						_data.push(_obj)
+						this.rkList = _data
 					}
 				}
 				let res6 = {
+					width: 200,
 					series: [{
 						data: _data
 					}]
@@ -1162,12 +1285,23 @@
 				console.log(val)
 				this.chartData7.series = [];
 				let _data = []
+				this.ztList = []
 				for (let i = 0; i < val.biViewInfoList.length; i++) {
 					let _obj = {
 						name: val.biViewInfoList[i].name,
-						value: Number(val.biViewInfoList[i].count)
+						value: Number(val.biViewInfoList[i].count),
+						color: this.ztColor[i],
+						style: {
+							'background': this.ztColor[i],
+							'border-radius': '50%',
+							'width': '20rpx',
+							'height': '20rpx',
+							'display': 'inline-block',
+							'margin-right': '10rpx'
+						},
 					}
 					_data.push(_obj)
+					this.ztList = _data
 				}
 				console.log(_data)
 				let res7 = {
@@ -1179,13 +1313,24 @@
 			},
 			makeDate7(val) {
 				let _data = []
+				this.ztList = []
 				if (val[11].biViewInfoList && val[11].biViewInfoList.length) {
 					for (let i = 0; i < val[11].biViewInfoList.length; i++) {
 						let _obj = {
 							name: val[11].biViewInfoList[i].name,
 							value: Number(val[11].biViewInfoList[i].count),
+							color: this.ztColor[i],
+							style: {
+								'background': this.ztColor[i],
+								'border-radius': '50%',
+								'width': '20rpx',
+								'height': '20rpx',
+								'display': 'inline-block',
+								'margin-right': '10rpx'
+							},
 						}
 						_data.push(_obj)
+						this.ztList = _data
 					}
 				}
 
@@ -1196,6 +1341,7 @@
 					}]
 				};
 				this.chartData7 = JSON.parse(JSON.stringify(res7));
+
 			},
 			makeDate8(val) {
 				let _categories = []
@@ -1213,7 +1359,7 @@
 				if (val[13].biViewInfoList && val[13].biViewInfoList.length > 0) {
 					for (let i = 0; i < val[13].biViewInfoList.length; i++) {
 						_categories1.push(val[13].biViewInfoList[i].name)
-						_data1.push(val[12].biViewInfoList[i].weight)
+						_data1.push(val[13].biViewInfoList[i].weight)
 					}
 				}
 
@@ -1221,14 +1367,16 @@
 					categories: _categories,
 					series: [{
 						name: "成交量A",
-						data: _data
+						data: _data,
+						textColor: "transparent"
 					}]
 				}
 				let res9 = {
 					categories: _categories1,
 					series: [{
 						name: "成交量A",
-						data: _data1
+						data: _data1,
+						textColor: "transparent"
 					}]
 				}
 				this.chartData8 = JSON.parse(JSON.stringify(res8))
@@ -1254,7 +1402,7 @@
 					.compId + '&seachMoth=' + this.seachMoth + '&seachYear=' + this.seachYear).then(
 					res => {
 						console.log("数据报表", res)
-
+						uni.hideLoading()
 						this.chartList = res.data.data
 						// 收支核算数据处理
 						this.makeDate1(res.data.data)
@@ -1264,7 +1412,7 @@
 						this.makeDate3(res.data.data)
 						//库存储量
 						this.makeDate4(res.data.data)
-						//期货值
+						//期货值
 						this.makeDate5(res.data.data)
 						//今日入库
 						this.makeDate6(res.data.data)
@@ -1789,11 +1937,31 @@
 		}
 	}
 
+	.content4 {
+		.row1 {
+			display: flex;
+
+			.opts6 uni-canvas {
+				width: 200px;
+			}
+		}
+	}
+
 	.content5 {
 		.days-nav {
 			display: flex;
 			justify-content: space-evenly;
 		}
+
+
+	}
+
+	.zt-right {
+		flex-direction: column;
+		justify-content: space-evenly;
+		height: 100px;
+		display: flex;
+		width: 100%;
 	}
 
 	.content6 {
@@ -1801,10 +1969,13 @@
 			margin: 20rpx 0;
 		}
 
+		.left {
+			font-weight: 700;
+		}
+
 	}
 
 	.days-nav {
-		background: red;
 		margin: 20rpx;
 		background: #F5F6FA;
 		border-radius: 8rpx;