achao 2 rokov pred
rodič
commit
f8e4b25c63
2 zmenil súbory, kde vykonal 243 pridanie a 188 odobranie
  1. 238 185
      pages/dataReport/costbreakdown.vue
  2. 5 3
      pages/user/newReport.vue

+ 238 - 185
pages/dataReport/costbreakdown.vue

@@ -2,13 +2,15 @@
 	<view>
 	<view>
 		<view class='fixedbox' :style='{"top":customBar+"px"}'>
 		<view class='fixedbox' :style='{"top":customBar+"px"}'>
 			<view class='search'>
 			<view class='search'>
-				<u-search @search='getList' v-model='expenseName' placeholder='可按费用名称查找' search-icon-color='#AFB3BF' bg-color='#F5F6F9' :shape='"round"'  :clearabled="true" :show-action='false'></u-search>
+				<u-search @search='getList' v-model='expenseName' placeholder='可按费用名称查找' search-icon-color='#AFB3BF'
+					bg-color='#F5F6F9' :shape='"round"' :clearabled="true" :show-action='false'></u-search>
 			</view>
 			</view>
 			<view style='background:#fff;'>
 			<view style='background:#fff;'>
 				<view class='purposewrap'>
 				<view class='purposewrap'>
 					<view :class='expensesPurpose==1?"active":""' @click='expenseclick(1)' class='item left'>合同费用</view>
 					<view :class='expensesPurpose==1?"active":""' @click='expenseclick(1)' class='item left'>合同费用</view>
 					<view :class='expensesPurpose==3?"active":""' @click='expenseclick(3)' class='item'>库点费用</view>
 					<view :class='expensesPurpose==3?"active":""' @click='expenseclick(3)' class='item'>库点费用</view>
-					<view :class='expensesPurpose==5?"active":""' @click='expenseclick(5)' class='item right'>经营性费用</view>
+					<view :class='expensesPurpose==5?"active":""' @click='expenseclick(5)' class='item right'>经营性费用
+					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view v-if='expensesPurpose==1' class='costwrap'>
 			<view v-if='expensesPurpose==1' class='costwrap'>
@@ -19,15 +21,20 @@
 			</view>
 			</view>
 			<view v-if='expensesPurpose==3' class='costwrap'>
 			<view v-if='expensesPurpose==3' class='costwrap'>
 				<view :class='wareExpenseType1==""?"active":""' @click='wareExpenseTypeclick("")' class='item'>全部</view>
 				<view :class='wareExpenseType1==""?"active":""' @click='wareExpenseTypeclick("")' class='item'>全部</view>
-				<view :class='wareExpenseType1=="煤费"?"active":""' @click='wareExpenseTypeclick("煤费")' class='item'>煤费</view>
-				<view :class='wareExpenseType1=="电费"?"active":""' @click='wareExpenseTypeclick("电费")' class='item'>电费</view>
-				<view :class='wareExpenseType1=="人工费"?"active":""' @click='wareExpenseTypeclick("人工费")' class='item'>人工费</view>
-				<view :class='wareExpenseType1=="杂费"?"active":""' @click='wareExpenseTypeclick("杂费")' class='item'>杂费</view>
+				<view :class='wareExpenseType1=="煤费"?"active":""' @click='wareExpenseTypeclick("煤费")' class='item'>煤费
+				</view>
+				<view :class='wareExpenseType1=="电费"?"active":""' @click='wareExpenseTypeclick("电费")' class='item'>电费
+				</view>
+				<view :class='wareExpenseType1=="人工费"?"active":""' @click='wareExpenseTypeclick("人工费")' class='item'>人工费
+				</view>
+				<view :class='wareExpenseType1=="杂费"?"active":""' @click='wareExpenseTypeclick("杂费")' class='item'>杂费
+				</view>
 				<view :class='searchType==1?"active":""' @click='wareExpenseTypeclick(1)' class='item'>收款</view>
 				<view :class='searchType==1?"active":""' @click='wareExpenseTypeclick(1)' class='item'>收款</view>
 			</view>
 			</view>
 		</view>
 		</view>
-		<view v-if='costList.length>0' class='costlistwrap' >
-			<view v-for='(item,index) in costList' :style='index!=costList.length-1?"border-bottom:2rpx solid #eee":""' class='item'>
+		<view v-if='costList.length>0' class='costlistwrap'>
+			<view v-for='(item,index) in costList' :style='index!=costList.length-1?"border-bottom:2rpx solid #eee":""'
+				class='item'>
 				<view class='flex align-item-center'>
 				<view class='flex align-item-center'>
 					<view v-if='item.expensesType==1' class="status income">收</view>
 					<view v-if='item.expensesType==1' class="status income">收</view>
 					<view v-if='item.expensesType==2' class="status pay">付</view>
 					<view v-if='item.expensesType==2' class="status pay">付</view>
@@ -35,22 +42,25 @@
 						<view class="costtype">{{item.expenseName}}</view>
 						<view class="costtype">{{item.expenseName}}</view>
 						<view class="costmoney"><text>¥</text>{{item.amountMoney}}</view>
 						<view class="costmoney"><text>¥</text>{{item.amountMoney}}</view>
 					</view>
 					</view>
-					
+
 				</view>
 				</view>
-				<view style='justify-content: space-between;font-size:28rpx;margin:10rpx 0;' class='flex align-item-center'>
+				<view style='justify-content: space-between;font-size:28rpx;margin:10rpx 0;'
+					class='flex align-item-center'>
 					<view v-if='item.expensesPurpose==3'>{{item.warehouseName}}</view>
 					<view v-if='item.expensesPurpose==3'>{{item.warehouseName}}</view>
 					<view v-if='item.expensesPurpose==1'>{{item.contractNo}}</view>
 					<view v-if='item.expensesPurpose==1'>{{item.contractNo}}</view>
 					<view v-if='item.expensesPurpose==5'>{{item.paymentDate}}</view>
 					<view v-if='item.expensesPurpose==5'>{{item.paymentDate}}</view>
 					<view>{{item.agent}}</view>
 					<view>{{item.agent}}</view>
 				</view>
 				</view>
-				<view v-if='item.expensesPurpose==1||item.expensesPurpose==3' style='font-size:24rpx;margin:20rpx 0;' class='flex align-item-center'>
+				<view v-if='item.expensesPurpose==1||item.expensesPurpose==3' style='font-size:24rpx;margin:20rpx 0;'
+					class='flex align-item-center'>
 					<view class="">
 					<view class="">
 						{{item.paymentDate}}
 						{{item.paymentDate}}
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
-		<view v-if='show' :style="{'margin-top':costList.length==0?'260rpx':'0'}" style='text-align:center;background:#F2F6FA;' >
+		<view v-if='show' :style="{'margin-top':costList.length==0?'260rpx':'0'}"
+			style='text-align:center;background:#F2F6FA;'>
 			暂无更多数据
 			暂无更多数据
 		</view>
 		</view>
 	</view>
 	</view>
@@ -60,68 +70,88 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				customBar:0,
-				costType:'',
-				expensesPurpose:'1',
-				currentPage:1,
-				show:false,
-				wareExpenseType:'',
-				wareExpenseType1:'',
-				pageSize:10,
-				costList:[],
-				isLoadMore:false,
-				searchType:'',
-				expenseName:''
+				expenseInfo: {
+					startDate: '',
+					endDate: ''
+				},
+				customBar: 0,
+				costType: '',
+				expensesPurpose: '1',
+				currentPage: 1,
+				show: false,
+				wareExpenseType: '',
+				wareExpenseType1: '',
+				pageSize: 10,
+				costList: [],
+				isLoadMore: false,
+				searchType: '',
+				expenseName: ''
 			}
 			}
 		},
 		},
-		onLoad(){
-			
+		onLoad(options) {
+			console.log(options.data)
+
+			if (options.type == 1) {
+				// 获取月份的天数
+				let _days = new Date(options.data.split('-')[0], options.data.split('-')[1], 0).getDate()
+				console.log(_days)
+				this.expenseInfo = {
+					startDate: options.data + '-01',
+					endDate: options.data + '-' + _days
+				}
+			} else if (options.type == 2) {
+				this.expenseInfo = {
+					startDate: options.data + '-01-01',
+					endDate: options.data + '-12-31'
+				}
+			}
+			console.log(this.expenseInfo)
 			uni.getSystemInfo({
 			uni.getSystemInfo({
-			    success: (e) => {
-			      // this.compareVersion(e.SDKVersion, '2.5.0')
-			      let statusBar = 0  //状态栏高度
-			      let customBar = 0  // 状态栏高度 + 导航栏高度  
-			      let navbar = 0 // 自定义标题与胶囊对齐高度
-			      
-			      
-			      // #ifdef MP
-			      statusBar = e.statusBarHeight
-			      customBar = e.statusBarHeight + 45
-			      if (e.platform === 'android') {
-			        this.$store.commit('SET_SYSTEM_IOSANDROID', false)
-			        customBar = e.statusBarHeight + 50
-			      }
-			      // #endif
-			      
-			      
-			      // #ifdef MP-WEIXIN
-			      statusBar = e.statusBarHeight
-			      const custom = wx.getMenuButtonBoundingClientRect()
-			      customBar = custom.bottom + custom.top - e.statusBarHeight
-			 
-			      navbar = (custom.top - e.statusBarHeight) * 2 + custom.height
-			      // #endif
-			 
-			 
-			      // #ifdef MP-ALIPAY
-			      statusBar = e.statusBarHeight
-			      customBar = e.statusBarHeight + e.titleBarHeight
-			      // #endif
-			 
-			 
-			      // #ifdef APP-PLUS
-			      console.log('app-plus', e)
-			      statusBar = e.statusBarHeight
-			      customBar = e.statusBarHeight + 45
-			      // #endif
-			 
-			 
-			      // #ifdef H5
-			      statusBar = 0
-			      customBar = e.statusBarHeight + 45
-			      // #endif
-					this.customBar=customBar
-			    }
+				success: (e) => {
+					// this.compareVersion(e.SDKVersion, '2.5.0')
+					let statusBar = 0 //状态栏高度
+					let customBar = 0 // 状态栏高度 + 导航栏高度  
+					let navbar = 0 // 自定义标题与胶囊对齐高度
+
+
+					// #ifdef MP
+					statusBar = e.statusBarHeight
+					customBar = e.statusBarHeight + 45
+					if (e.platform === 'android') {
+						this.$store.commit('SET_SYSTEM_IOSANDROID', false)
+						customBar = e.statusBarHeight + 50
+					}
+					// #endif
+
+
+					// #ifdef MP-WEIXIN
+					statusBar = e.statusBarHeight
+					const custom = wx.getMenuButtonBoundingClientRect()
+					customBar = custom.bottom + custom.top - e.statusBarHeight
+
+					navbar = (custom.top - e.statusBarHeight) * 2 + custom.height
+					// #endif
+
+
+					// #ifdef MP-ALIPAY
+					statusBar = e.statusBarHeight
+					customBar = e.statusBarHeight + e.titleBarHeight
+					// #endif
+
+
+					// #ifdef APP-PLUS
+					console.log('app-plus', e)
+					statusBar = e.statusBarHeight
+					customBar = e.statusBarHeight + 45
+					// #endif
+
+
+					// #ifdef H5
+					statusBar = 0
+					customBar = e.statusBarHeight + 45
+					// #endif
+					this.customBar = customBar
+				}
 			})
 			})
 		},
 		},
 		onShow() {
 		onShow() {
@@ -129,38 +159,38 @@
 		},
 		},
 		onReachBottom() { //上拉触底函数
 		onReachBottom() { //上拉触底函数
 			// if (this.statusFlag == 3) {
 			// if (this.statusFlag == 3) {
-				if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
-					this.pageSize += 1
-					this.currentPage += 1
-					this.getList()
-				}
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.pageSize += 1
+				this.currentPage += 1
+				this.getList()
+			}
 			// }
 			// }
 		},
 		},
 		methods: {
 		methods: {
-			wareExpenseTypeclick(status){
-				this.currentPage=1
-				if(status==1){
-					this.searchType=1
-					this.wareExpenseType1=5
-					this.wareExpenseType=''
-				}else{
-					this.wareExpenseType1=status
-					this.wareExpenseType=status
-					this.searchType=''
+			wareExpenseTypeclick(status) {
+				this.currentPage = 1
+				if (status == 1) {
+					this.searchType = 1
+					this.wareExpenseType1 = 5
+					this.wareExpenseType = ''
+				} else {
+					this.wareExpenseType1 = status
+					this.wareExpenseType = status
+					this.searchType = ''
 				}
 				}
 				this.getList()
 				this.getList()
 			},
 			},
-			costTypeclick(status){
-				this.currentPage=1
-				this.costType=status
+			costTypeclick(status) {
+				this.currentPage = 1
+				this.costType = status
 				this.getList()
 				this.getList()
 			},
 			},
-			expenseclick(status){
-				this.currentPage=1
-				this.expensesPurpose=status
+			expenseclick(status) {
+				this.currentPage = 1
+				this.expensesPurpose = status
 				this.getList()
 				this.getList()
 			},
 			},
-			getList(){
+			getList() {
 				uni.showLoading({
 				uni.showLoading({
 					title: "正在加载"
 					title: "正在加载"
 				})
 				})
@@ -168,27 +198,29 @@
 					expensesPurpose: this.expensesPurpose,
 					expensesPurpose: this.expensesPurpose,
 					currentPage: this.currentPage,
 					currentPage: this.currentPage,
 					pageSize: this.pageSize,
 					pageSize: this.pageSize,
-					appFlag:1,
-					costType:this.costType,
-					wareExpenseType:this.wareExpenseType,
-					searchType:this.searchType,
-					expenseName:this.expenseName
+					appFlag: 1,
+					costType: this.costType,
+					wareExpenseType: this.wareExpenseType,
+					searchType: this.searchType,
+					expenseName: this.expenseName,
+					startDate: this.expenseInfo.startDate,
+					endDate: this.expenseInfo.endDate
 				}).then(res => {
 				}).then(res => {
-					if(res.data.code){
+					if (res.data.code) {
 						uni.hideLoading()
 						uni.hideLoading()
-						if(res.data.data.records.length>0){
-							if(this.currentPage==1){
-								this.costList=res.data.data.records
-							}else{
-								this.costList=this.costList.concat(res.data.data.records)
+						if (res.data.data.records.length > 0) {
+							if (this.currentPage == 1) {
+								this.costList = res.data.data.records
+							} else {
+								this.costList = this.costList.concat(res.data.data.records)
 							}
 							}
-						}else{
-							this.show=true
-							if(this.currentPage==1){
-								this.costList=[]
+						} else {
+							this.show = true
+							if (this.currentPage == 1) {
+								this.costList = []
 							}
 							}
 						}
 						}
-					}else{
+					} else {
 						uni.hideLoading()
 						uni.hideLoading()
 						uni.showToast({
 						uni.showToast({
 							title: "系统异常,请联系管理员",
 							title: "系统异常,请联系管理员",
@@ -196,7 +228,7 @@
 							duration: 2000
 							duration: 2000
 						})
 						})
 					}
 					}
-					
+
 				})
 				})
 			}
 			}
 		}
 		}
@@ -204,87 +236,108 @@
 </script>
 </script>
 
 
 <style lang='scss' scoped>
 <style lang='scss' scoped>
-.fixedbox{
-	position:fixed;width:100%;top:0;background:#fff;
-	padding-top:20rpx;
-}
-.purposewrap{
-	display:flex;
-	background:#fff;
-	font-size:32rpx;
-	margin: 0 auto;
-	width:93%;
-	.item{
-		padding:20rpx;
-		color:#7A7A7A;
-		width:33.3333%;
-		text-align:center;
-	}
-	.item.left{
-		text-align:left;
-	}
-	.item.right{
-		text-align:right;
-	}
-	.item.active{
-		color:#262626;
-		font-weight:600;
-	}
-}
-.costwrap{
-	display:flex;
-	margin:10rpx 34rpx;
-	.item{
-		padding:10rpx 20rpx;
-		color:#333333;
-		text-align:center;
-		border-radius:30rpx;
+	.fixedbox {
+		position: fixed;
+		width: 100%;
+		top: 0;
+		background: #fff;
+		padding-top: 20rpx;
 	}
 	}
-	.item.active{
-		color:#fff;
-		background:#22C572;
-	}
-}
-.costlistwrap{
-	background:#fff;
-	margin:260rpx 20rpx 20rpx;
-	border-radius:20rpx;
-	padding:0 20rpx;
-	.item{
-		padding:30rpx 0;
-		.status{
-			font-size:24rpx;
-			margin-right:10rpx;
-			padding:4rpx 10rpx;
-			border-radius:10rpx;
+
+	.purposewrap {
+		display: flex;
+		background: #fff;
+		font-size: 32rpx;
+		margin: 0 auto;
+		width: 93%;
+
+		.item {
+			padding: 20rpx;
+			color: #7A7A7A;
+			width: 33.3333%;
+			text-align: center;
 		}
 		}
-		.status.pay{
-			background:#E9F8F0;
-			color:#22C572;
+
+		.item.left {
+			text-align: left;
 		}
 		}
-		.status.income{
-			background:#FEECE6;
-			color:#FE6430;
+
+		.item.right {
+			text-align: right;
 		}
 		}
-		.costtype{
-			font-size:32rpx;
-			font-weight:600;
+
+		.item.active {
+			color: #262626;
+			font-weight: 600;
 		}
 		}
-		.costmoney{
-			font-size:36rpx;
-			font-weight:600;
-			text{
-				font-size:26rpx;
+	}
+
+	.costwrap {
+		display: flex;
+		margin: 10rpx 34rpx;
+
+		.item {
+			padding: 10rpx 20rpx;
+			color: #333333;
+			text-align: center;
+			border-radius: 30rpx;
+		}
+
+		.item.active {
+			color: #fff;
+			background: #22C572;
+		}
+	}
+
+	.costlistwrap {
+		background: #fff;
+		margin: 260rpx 20rpx 20rpx;
+		border-radius: 20rpx;
+		padding: 0 20rpx;
+
+		.item {
+			padding: 30rpx 0;
+
+			.status {
+				font-size: 24rpx;
+				margin-right: 10rpx;
+				padding: 4rpx 10rpx;
+				border-radius: 10rpx;
+			}
+
+			.status.pay {
+				background: #E9F8F0;
+				color: #22C572;
+			}
+
+			.status.income {
+				background: #FEECE6;
+				color: #FE6430;
+			}
+
+			.costtype {
+				font-size: 32rpx;
+				font-weight: 600;
+			}
+
+			.costmoney {
+				font-size: 36rpx;
+				font-weight: 600;
+
+				text {
+					font-size: 26rpx;
+				}
 			}
 			}
 		}
 		}
 	}
 	}
-}
-.search{
-	width:100vw;
-	background:#fff;
-}
-.u-search{
-	width:94%;
-	margin:0 auto !important;
-}
+
+	.search {
+		width: 100vw;
+		background: #fff;
+	}
+
+	.u-search {
+		width: 94%;
+		margin: 0 auto !important;
+	}
 </style>
 </style>

+ 5 - 3
pages/user/newReport.vue

@@ -420,7 +420,9 @@
 				opts3: {
 				opts3: {
 					color: ["#8D9EE9"],
 					color: ["#8D9EE9"],
 					padding: [15, 15, 0, 5],
 					padding: [15, 15, 0, 5],
-					legend: {},
+					legend: {
+						show: false
+					},
 					xAxis: {
 					xAxis: {
 						disableGrid: true
 						disableGrid: true
 					},
 					},
@@ -678,7 +680,7 @@
 						url = '/pages/dataReport/breakdownofprofit'
 						url = '/pages/dataReport/breakdownofprofit'
 						break;
 						break;
 					case 2:
 					case 2:
-						url = '/pages/dataReport/costbreakdown'
+						url = '/pages/dataReport/costbreakdown?data=' + this.ym1 + '&type=' + this.index
 						break;
 						break;
 					case 3:
 					case 3:
 						url = '/pages/dataReport/Inventoryentrydetails'
 						url = '/pages/dataReport/Inventoryentrydetails'
@@ -866,7 +868,7 @@
 					},
 					},
 					{
 					{
 						name: '头寸',
 						name: '头寸',
-						number: _tc,
+						number: Number(_tc).toFixed(3),
 						src: '../../static/img/tc.png'
 						src: '../../static/img/tc.png'
 					},
 					},