Bläddra i källkod

采集端端新增功能

zhangdan 4 år sedan
förälder
incheckning
b01f82bb73
7 ändrade filer med 144 tillägg och 63 borttagningar
  1. 74 35
      pages/index/addData.vue
  2. 70 28
      pages/index/index.vue
  3. BIN
      static/chuyu.png
  4. BIN
      static/huishou.png
  5. BIN
      static/jianzhu.png
  6. BIN
      static/qita.png
  7. BIN
      static/youhai.png

+ 74 - 35
pages/index/addData.vue

@@ -1,26 +1,40 @@
 <template>
 	<view class="content">
-		<view>
+		<view class="content-form">
 			<view class="form-data">
 				<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
-						<u-form-item prop="gatherNum_other" label="其他垃圾:" >
-							<u-input :disabled="isView" @input="numberToFixed('gatherNum_other',0,999999)" type="number" placeholder="请输入" v-model="form.gatherNum_other" />
-							<text slot="right" style="color: #000000;">桶(约{{form.gatherNum_other*240}}kg)</text>
+						<u-form-item prop="gatherNum_huishou" label="可回收物:">
+							<u-input :disabled="isView" @input="numberToFixed('gatherNum_huishou',2,999999)" type="number" placeholder="请输入" v-model="form.gatherNum_huishou" />
+							<text slot="right" style="color: #000000;">KG</text>
+						</u-form-item>
+						<u-form-item prop="gatherNum_harm" label="有害垃圾:" >
+							<u-input :disabled="isView" @input="numberToFixed('gatherNum_harm',2,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_harm" />
+							<text slot="right" style="color: #000000;">KG</text>
 						</u-form-item>
+						<u-gap height="20" bg-color="#f5f5f5"></u-gap>
 						<u-form-item prop="gatherNum_chuyu" label="厨余垃圾:" >
-							<u-input :disabled="isView" @input="numberToFixed('gatherNum_chuyu',0,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_chuyu" />
-							<text slot="right" style="color: #000000;">桶(约{{form.gatherNum_chuyu*240}}kg)</text>
+							<u-input :disabled="isView" @input="numberToFixed('gatherNum_chuyu',2,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_chuyu" />
+							<text slot="right" style="color: #000000;">L(约{{form.gatherNum_chuyu*1}}KG)</text>
 						</u-form-item>
+						<u-form-item prop="gatherNum_other" label="其他垃圾:" >
+							<u-input :disabled="isView" @input="numberToFixed('gatherNum_other',2,999999)" type="number" placeholder="请输入" v-model="form.gatherNum_other" />
+							<text slot="right" style="color: #000000;">L(约{{form.gatherNum_other*1}}KG)</text>
+						</u-form-item>
+						<u-gap height="20" bg-color="#f5f5f5"></u-gap>
 						<u-form-item prop="gatherNum_jianzhu" label="建筑垃圾:" >
 							<u-input :disabled="isView" @input="numberToFixed('gatherNum_jianzhu',2,999999)" placeholder="请输入" type="digit" v-model="form.gatherNum_jianzhu" />
-							<text slot="right" style="color: #000000;">吨(约{{form.gatherNum_jianzhu*1000}}kg)</text>
+							<text slot="right" style="color: #000000;">KG</text>
+						</u-form-item>
+						<u-gap height="20" bg-color="#f5f5f5"></u-gap>
+						<u-form-item prop="remarks" label="信息备注:">
+							<u-input :disabled="isView" placeholder="请输入" v-model="form.remarks" :maxlength="30" class="receiveAddress"  height="0" auto-height :clearable="false"></u-input>
 						</u-form-item>
 				</u-form>
 			</view>
-			<view class="form-data remark">
+			<!-- <view class="form-data remark">
 				<text>信息备注</text>
-				<textarea :disabled="isView" :auto-height="true" :maxlength="30" v-model="form.remarks" class="receiveAddress"/>
-			</view>
+				<textarea :disabled="isView" :auto-height="true" :maxlength="30" v-model="form.remarks" class="receiveAddress" placeholder="请输入" />
+			</view> -->
 			<view class="form-data qyImg">
 				<text>清运照片</text>
 				<view class="info-main">
@@ -41,12 +55,14 @@
 					</view>
 				</view>
 			</view>
+		</view>
+		<view class="content-btn"> 
 			<u-button v-if="isView" @click="isView = false" class="submitBtn" type="waring" shape="circle">修改</u-button>
 			<u-button v-else @click="submit" :loading="loading" class="submitBtn" type="success" shape="circle">提交</u-button>
-			<uni-popup ref="openModal" type="center">
-				<uni-popup-dialog content="确认提交吗?" @confirm="onOk" :title="title"></uni-popup-dialog>
-			</uni-popup>
 		</view>
+		<uni-popup ref="openModal" type="center">
+			<uni-popup-dialog content="确认提交吗?" @confirm="onOk" :title="title"></uni-popup-dialog>
+		</uni-popup>
 	</view>
 </template>
 
@@ -65,6 +81,8 @@
 				loading:false, // 提交按钮加载圈
 				photograph: [], //  图片路径
 				form: {
+					gatherNum_huishou: '',
+					gatherNum_harm: '',
 					gatherNum_other: '', // 其它垃圾
 					gatherNum_chuyu: '', // 厨余垃圾
 					gatherNum_jianzhu: '', // 建筑垃圾
@@ -107,9 +125,13 @@
 						const a = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_BUILDING')
 						const b = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_OTHER')
 						const c = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_KITCHEN')
+						const d = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_HARM')
+						const e = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_RECYCLING')
 						this.form.gatherNum_jianzhu= a ? a.gatherNum.toString() : '0'
 						this.form.gatherNum_chuyu= c ? c.gatherNum.toString() : '0'
 						this.form.gatherNum_other= b ? b.gatherNum.toString() : '0'
+						this.form.gatherNum_harm= d ? d.gatherNum.toString() : '0'
+						this.form.gatherNum_huishou= e ? e.gatherNum.toString() : '0'
 						this.form.remarks=res.data.remarks
 						this.photograph=res.data.imageUrlList || []
 						console.log(this.form,'this.form')
@@ -161,7 +183,7 @@
 			},
 			// 提交
 			submit(){
-				if((!this.form.gatherNum_other ||this.form.gatherNum_other==0)  && (!this.form.gatherNum_chuyu || this.form.gatherNum_chuyu==0) && (!this.form.gatherNum_jianzhu || this.form.gatherNum_jianzhu==0)) {
+				if((!this.form.gatherNum_huishou ||this.form.gatherNum_huishou==0) && (!this.form.gatherNum_harm ||this.form.gatherNum_harm==0) &&(!this.form.gatherNum_other ||this.form.gatherNum_other==0)  && (!this.form.gatherNum_chuyu || this.form.gatherNum_chuyu==0) && (!this.form.gatherNum_jianzhu || this.form.gatherNum_jianzhu==0)) {
 					uni.showToast({
 						title: '请至少输入一项垃圾分类的数量!',
 						icon: 'none'
@@ -182,20 +204,36 @@
 				if(this.itemId){
 					params.id=this.itemId
 				}
+				if(this.form.gatherNum_huishou) {
+					params.rubbishEntityList.push({
+						"rubbishType":"GATHER_RECYCLING",
+						"rubbishWeight": this.form.gatherNum_huishou*1000,
+						"gatherNum": this.form.gatherNum_huishou,
+						"unit":"KILOGRAM"
+					})
+				}
+				if(this.form.gatherNum_harm) {
+					params.rubbishEntityList.push({
+						"rubbishType":"GATHER_HARM",
+						"rubbishWeight": this.form.gatherNum_harm*1000,
+						"gatherNum": this.form.gatherNum_harm,
+						"unit":"KILOGRAM"
+					})
+				}
 				if(this.form.gatherNum_other) {
 					params.rubbishEntityList.push({
 						"rubbishType":"GATHER_OTHER",
-						"rubbishWeight": this.form.gatherNum_other*240,
+						"rubbishWeight": this.form.gatherNum_other*1000,
 						"gatherNum": this.form.gatherNum_other,
-						"unit":"BUCKET"
+						"unit":"LITER"
 					})
 				}
 				if(this.form.gatherNum_chuyu) {
 					params.rubbishEntityList.push({
 						"rubbishType":"GATHER_KITCHEN",
-						"rubbishWeight": this.form.gatherNum_chuyu*240,
+						"rubbishWeight": this.form.gatherNum_chuyu*1000,
 						"gatherNum": this.form.gatherNum_chuyu,
-						"unit":"BUCKET"
+						"unit":"LITER"
 					})
 				}
 				if(this.form.gatherNum_jianzhu) {
@@ -203,7 +241,7 @@
 						"rubbishType":"GATHER_BUILDING",
 						"rubbishWeight": this.form.gatherNum_jianzhu*1000,
 						"gatherNum": this.form.gatherNum_jianzhu,
-						"unit":"TON"
+						"unit":"KILOGRAM"
 					})
 				}
 				this.loading=true
@@ -240,26 +278,28 @@
 		height: 100vh;
 		padding: 0;
 		background: #F5F5F5;
-		// .buttons{
-		// 	font-size: 32upx;
-		// 	display: block;
-		// 	height: 80upx;
-		// 	line-height: 80upx;
-		// 	margin: 0 auto;
-		// 	background-color: #0DC55F;
-		// 	color: #fff;
-		// 	border-radius: 50upx;
-		// }
+		display: flex;
+		flex-direction: column;
 		.receiveAddress{
 			width: 100%;
 			line-height: 1.5em;
 			box-sizing: border-box;
 			font-style: normal;
 		}
+		.content-form{
+			flex:1;
+			overflow-y: scroll;
+		}
 		.form-data{
-			padding: 0 40upx;
+			// padding: 40upx;
 			margin-bottom: 20upx;
 			background-color: #fff;
+			.u-form-item.data-v-5e7216f1 {
+				padding:20rpx 40rpx;
+			}
+		}
+		.u-form-item{
+			 padding: 0 40upx;
 		}
 		.remark{
 			padding: 40upx ;
@@ -312,13 +352,12 @@
 				}
 			}
 		}
+		.content-btn{
+			background-color: #fff;
+			padding: 40rpx;
+		}
 		.submitBtn{
 			font-size: 32upx;
-			display: block;
-			width: 670upx;
-			height: 80upx;
-			line-height: 80upx;
-			margin: 0 auto;
 			color: #fff;
 			border-radius: 50upx;
 		}

+ 70 - 28
pages/index/index.vue

@@ -10,18 +10,28 @@
 			<!-- 总计 -->
 			<view class="header-cont">
 				<view class="cont-item">
-					<text>其它垃圾</text>
-					<text v-if="!titleStatus" class="other">{{otherTotal}}kg</text>
+					<text v-if="!titleStatus" class="other">{{huishouTotal? huishouTotal/1000 :'0'}}</text>
+					<text>可回收物(L)</text>
 					<u-loading :show="titleStatus"></u-loading>
 				</view>
 				<view class="cont-item">
-					<text>厨余垃圾</text>
-					<text v-if="!titleStatus" class="chuyu">{{chuyuTotal}}kg</text>
+					<text v-if="!titleStatus" class="other">{{harmTotal ? harmTotal/1000:'0'}}</text>
+					<text>有害收物(L)</text>
 					<u-loading :show="titleStatus"></u-loading>
 				</view>
 				<view class="cont-item">
-					<text>建筑垃圾</text>
-					<text v-if="!titleStatus" class="jianzhu">{{jianzhuTotal}}kg</text>
+					<text v-if="!titleStatus" class="other">{{chuyuTotal ? chuyuTotal/1000 :'0'}}</text>
+					<text>厨余垃圾(L)</text>
+					<u-loading :show="titleStatus"></u-loading>
+				</view>
+				<view class="cont-item">
+					<text v-if="!titleStatus" class="other">{{otherTotal ? otherTotal/1000 :'0'}}</text>
+					<text>其它垃圾(KG)</text>
+					<u-loading :show="titleStatus"></u-loading>
+				</view>
+				<view class="cont-item">
+					<text v-if="!titleStatus" class="other">{{jianzhuTotal ? jianzhuTotal/1000 :'0'}}</text>
+					<text>建筑垃圾(KG)</text>
 					<u-loading :show="titleStatus"></u-loading>
 				</view>
 			</view>
@@ -39,20 +49,35 @@
 					</view>
 				</view>
 				<view class="cell-item-cont">
-					<!-- 其他垃圾 -->
+					<!-- 可收回物 -->
+					<view class="cont-item">
+						<u-image src="/static/huishou.png" width="90" height="90"></u-image>
+						<text class="item-title">可回收物</text>
+						<text>{{item.gatherOther? (item.gatherOther/1000/1000).toFixed(3)/1 :0}}kg</text>
+					</view>
+					<!-- 有害垃圾 -->
 					<view class="cont-item">
-						<u-image src="/static/index/other.png"></u-image>
-						<text>{{item.gatherOther? (item.gatherOther/1000).toFixed(3)/1 :0}}kg</text>
+						<u-image src="/static/youhai.png"></u-image>
+						<text class="item-title">有害垃圾</text>
+						<text>{{item.gatherOther? (item.gatherOther/1000/1000).toFixed(3)/1 :0}}kg</text>
 					</view>
 					<!-- 厨余垃圾 -->
 					<view class="cont-item">
-						<u-image src="/static/index/chuyu.png"></u-image>
-						<text>{{item.gatherKitchen ? (item.gatherKitchen/1000).toFixed(3)/1 :0}}kg</text>
+						<u-image src="/static/chuyu.png"></u-image>
+						<text class="item-title">厨余垃圾</text>
+						<text>{{item.gatherKitchen ? (item.gatherKitchen/1000/1000).toFixed(3)/1 :0}}kg</text>
+					</view>
+					<!-- 其他垃圾 -->
+					<view class="cont-item">
+						<u-image src="/static/qita.png"></u-image>
+						<text class="item-title">其他垃圾</text>
+						<text>{{item.gatherOther? (item.gatherOther/1000/1000).toFixed(3)/1 :0}}kg</text>
 					</view>
 					<!-- 建筑垃圾 -->
 					<view class="cont-item">
-						<u-image src="/static/index/jianzhu.png"></u-image>
-						<text>{{item.gatherBuilding ? (item.gatherBuilding/1000).toFixed(3)/1 :0}}kg</text>
+						<u-image src="/static/jianzhu.png"></u-image>
+						<text class="item-title">建筑垃圾</text>
+						<text>{{item.gatherBuilding ? (item.gatherBuilding/1000/1000).toFixed(3)/1 :0}}kg</text>
 					</view>
 				</view>
 			</view>
@@ -84,6 +109,8 @@
 			return {
 				hasLogin: false, // 是否登录
 				listdata: [], // 列表数据
+				huishouTotal:0, // 可回收物总和
+				harmTotal:0, // 有害垃圾物总和
 				otherTotal: 0, // 其它垃圾总和
 				jianzhuTotal: 0, // 建筑垃圾总和
 				chuyuTotal: 0, // 厨余垃圾总和
@@ -135,6 +162,8 @@
 				this.otherTotal= 0 // 其它垃圾总和
 				this.jianzhuTotal= 0 // 建筑垃圾总和
 				this.chuyuTotal= 0 // 厨余垃圾总和
+				this.harmTotal= 0
+				this.huishouTotal=0
 				this.searchForm.beginDate = getDate.getRecentday().starttime
 				this.searchForm.endDate = getDate.getRecentday().endtime
 				console.log(this.searchForm,'this.searchForm')
@@ -237,9 +266,14 @@
 							const a = res.data.find(item=>item.rubbishType=='GATHER_BUILDING')
 							const b = res.data.find(item=>item.rubbishType=='GATHER_OTHER')
 							const c = res.data.find(item=>item.rubbishType=='GATHER_KITCHEN')
+							const d = res.data.find(item=>item.rubbishType=='GATHER_HARM')
+							const e = res.data.find(item=>item.rubbishType=='GATHER_RECYCLING')
 							this.jianzhuTotal= a ? (a.rubbishWeight/1000).toFixed(3)/1 : '0'
 							this.chuyuTotal= c ? (c.rubbishWeight/1000).toFixed(3)/1 : '0'
-							this.otherTotal= b ? (b.rubbishWeight/1000).toFixed(3)/1 : '0'
+							this.otherTotal= b ? (b.rubbishWeight/1000).toFixed(3)/1 : '0' 
+							this.harmTotal= d ? (d.rubbishWeight/1000).toFixed(3)/1 : '0'
+							this.huishouTotal= e ? (e.rubbishWeight/1000).toFixed(3)/1 : '0'
+							
 						}
 					console.log(res)
 					this.titleStatus = false
@@ -287,12 +321,13 @@
 		align-items: center;
 		.header{
 			width: 100%;
-			background-color: #FFFFFF;
+			background: #456990;
+			opacity: 1;
+			border-radius: 12px;
 			display: flex;
 			flex-direction: column;
-			border-radius: 15upx;
-			padding: 30upx;
-			box-shadow: 0upx 3upx 6upx #eee;
+			padding: 20upx 30upx;
+			color: #fff;
 			margin-bottom: 20upx;
 			:first-child {
 				display: flex;
@@ -302,12 +337,15 @@
 			.header-cont{
 				margin-top: 20upx;
 				display: flex;
+				flex-direction: row;
+				flex-wrap:wrap;
 				align-items: center;
-				justify-content: space-around;
+				// justify-content: space-around;
 				.cont-item{
 					display: flex;
 					flex-direction: column;
 					align-items: center;
+					width: 33%;
 					text{
 						line-height: 50upx;
 					}
@@ -315,15 +353,19 @@
 						font-weight: 600;
 						font-size: 28upx;
 					}
+					.item-title{
+						font-family: PingFang SC;
+						font-weight: 400;
+						color: #444444;
+						opacity: 1;
+					}
 				}
 				.other{
-					color: #FB1E1E;
-				}
-				.chuyu{
-					color: #FCAE53;
-				}
-				.jianzhu{
-					color: #4EACFA;
+					font-size: 24px;
+					font-weight: normal;
+					color: #FFFFFF;
+					opacity: 1;
+					font-style: italic;
 				}
 			}
 			.filter-img{
@@ -367,8 +409,8 @@
 						width: 33%;
 						// border-right: 1px solid #e6e6e6;
 						:first-child {
-							width: 120upx;
-							height: 120upx;
+							width: 90upx;
+							height: 90upx;
 							margin-bottom: 20upx;
 						}
 					}

BIN
static/chuyu.png


BIN
static/huishou.png


BIN
static/jianzhu.png


BIN
static/qita.png


BIN
static/youhai.png