Sfoglia il codice sorgente

监督问题修改,任务卡片布局调整,诱捕器填报布局修改

yf_zhb 2 anni fa
parent
commit
55fa6bed88

+ 41 - 20
MingGaoApp/components/task-card/task-card.vue

@@ -25,29 +25,30 @@
 			<view class="start-btn" v-if="dataSource.task_status === '待处理'">
 				<u-button text="接收任务" size="mini" type="primary" @click="handleReceiveClick"></u-button>
 			</view>
-			<template v-if="dataSource.task_status === '处理中'">
-				<view class="actions__list">
-					<view class="actions__item ">
-						<view class="actions__icon">
-							<image src="@/static/image/task/icon/progress.png" mode="aspectFit" class="img"></image>
-						</view>
-						<view class="actions__text">{{dataSource.clock_in_count||0}}次</view>
+			<view class="actions__list" :class="{'border-none':dataSource.task_status === '已完成'}"
+				v-if="dataSource.task_status !== '待处理'">
+				<view class="actions__item ">
+					<view class="actions__icon">
+						<image src="@/static/image/task/icon/progress.png" mode="aspectFit" class="img"></image>
 					</view>
-					<view class="actions__item middle">
-						<view class="actions__icon">
-							<image src="@/static/image/task/icon/tool.png" mode="aspectFit" class="img"></image>
-						</view>
-						<view class="actions__text">
-							{{dataSource.walk_length/1000>=1?`${Math.ceil(dataSource.walk_length/1000)}km`:`${dataSource.walk_length}m`}}
-						</view>
+					<view class="actions__text">{{dataSource.clock_in_count||0}}次</view>
+				</view>
+				<view class="actions__item middle">
+					<view class="actions__icon">
+						<image src="@/static/image/task/icon/tool.png" mode="aspectFit" class="img"></image>
 					</view>
-					<view class="actions__item right">
-						<view class="actions__icon">
-							<image src="@/static/image/task/icon/area.png" mode="aspectFit" class="img"></image>
-						</view>
-						<view class="actions__text">{{dataSource.walk_area}} ㎡</view>
+					<view class="actions__text">
+						{{dataSource.walk_length | meter}}
+					</view>
+				</view>
+				<view class="actions__item right">
+					<view class="actions__icon">
+						<image src="@/static/image/task/icon/area.png" mode="aspectFit" class="img"></image>
 					</view>
+					<view class="actions__text">{{dataSource.walk_area | numberFixed}} ㎡ </view>
 				</view>
+			</view>
+			<template v-if="dataSource.task_status === '处理中'">
 				<view class="actions__btns">
 					<view class="actions__btn blocked" v-if="dataSource.walk_status === TASK_WALK_TYPE.IS_READY"
 						@click="handleBtnClick(TASK_ACTION_TYPE.START)">
@@ -131,8 +132,15 @@
 				TASK_WALK_TYPE
 			}
 		},
-		mounted() {
+		filters: {
+			numberFixed: function(val) {
+				return Number(val) ? Number(val).toFixed(2) : val
+			},
+			meter: function(val) {
+				return val/1000>1 ? (val/1000).toFixed(2) +'km' : Number(val).toFixed(2) +'m'
+			},
 		},
+		mounted() {},
 		methods: {
 			handleClick() {
 				this.$emit('click', this.dataSource.task_id);
@@ -212,6 +220,7 @@
 			}
 
 			&__desc {
+				height: 56rpx;
 				padding: 10rpx 0;
 				color: #656565;
 				font-size: 12px;
@@ -236,20 +245,27 @@
 					align-items: center;
 					padding: 20rpx 0;
 					border-bottom: 1px solid rgba(2, 2, 2, 0.3);
+
+					&.border-none {
+						border-bottom-color: transparent;
+					}
 				}
 
 				&__item {
+					width: 0;
 					flex: 1 1 auto;
 					height: 50rpx;
 					display: flex;
 					align-items: center;
 					@include hairline-right(rgba(0, 0, 0, 0.3));
+					@include line;
 
 					&.middle {
 						justify-content: center;
 					}
 
 					&.right {
+						padding-left: 10rpx;
 						justify-content: flex-end;
 					}
 
@@ -259,6 +275,7 @@
 				}
 
 				&__icon {
+					flex: 0 0 auto;
 					width: 32rpx;
 					height: 32rpx;
 					margin-right: 36rpx;
@@ -268,6 +285,10 @@
 						height: 100%;
 					}
 				}
+				
+				&__text {
+					@include line;
+				}
 
 				&__btns {
 					display: flex;

+ 21 - 12
MingGaoApp/components/task-details.vue

@@ -172,6 +172,10 @@
 	import {
 		Debounce
 	} from "../util/anitthro.js"
+	import {
+		concat,
+		reduce
+	} from 'lodash-es';
 	export default {
 		name: "task-details",
 		components: {
@@ -290,14 +294,19 @@
 						task_id: id,
 					}
 				})
-				console.log(res)
-				this.taskinfo = res
-				if (this.taskinfo.img_list == "" || this.taskinfo.img_list.length == 0) {
+				console.log(res, 'get task info 0221')
+				const newImgList = reduce(res.clock_in_list, (pre, current) => concat(pre, current.img_list || []), [])
+				console.log(newImgList, 'new img list')
+				if (!this.taskinfo.img_list || this.taskinfo.img_list.length == 0) {
 					this.taskinfo.img_list = []
 				} else {
 					this.taskinfo.img_list = JSON.parse(this.taskinfo.img_list)
 				}
 
+				if (!this.taskinfo.img_list.length && newImgList.length > 0) {
+					this.taskinfo.img_list = newImgList;
+				}
+
 				if (this.taskinfo.task_type == "有害生物监测") {
 					this.task_type = true
 				} else {
@@ -349,14 +358,14 @@
 			},
 			async taskfillingdraft() { //任务填报接口
 				// this.gettaskinfo()
-				
+
 				var arr = JSON.parse(JSON.stringify(this.$store.state.worndatabase))
 				console.log(this.draft)
 				console.log(arr)
 				for (var i = 0; i < arr.length; i++) {
 					for (var j = 0; j < this.draft.length; j++) {
 						if (arr[i].id == this.draft[j].record_id) {
-							arr.splice(i,1)
+							arr.splice(i, 1)
 						}
 					}
 				}
@@ -368,15 +377,15 @@
 						}
 					}
 				}
-				this.draft = this.draft.concat(arr) 
+				this.draft = this.draft.concat(arr)
 				this.$store.state.worndatabase = JSON.parse(JSON.stringify(this.draft))
 				// console.log(arr)
-				for(var i = 0; i < this.draft.length; i++){
-					if(this.draft[i].id){
+				for (var i = 0; i < this.draft.length; i++) {
+					if (this.draft[i].id) {
 						this.draft[i]["record_id"] = this.draft[i].id
 					}
 				}
-				console.log(this.draft,"0000")
+				console.log(this.draft, "0000")
 				var data = {}
 				if (this.task_type) {
 					data = {
@@ -385,16 +394,16 @@
 						img_list: JSON.stringify(this.urllist), //            是       图片列表					['http://www.c.com']
 						trap_record_list: JSON.stringify(this.draft),
 					}
-					console.log("有数据",data)
+					console.log("有数据", data)
 				} else {
 					data = {
 						task_id: this.task_id, //            是       任务id
 						report_msg: this.textareavalue, //            是       任务汇报内容
 						img_list: JSON.stringify(this.urllist), //            是       图片列表					['http://www.c.com']
 					}
-					console.log("无数据",data)
+					console.log("无数据", data)
 				}
-				console.log(data,555)
+				console.log(data, 555)
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=app.task.task_filling_draft',
 					data: data,

+ 8 - 2
MingGaoApp/pages/index/clockDetail.vue

@@ -59,8 +59,10 @@
 		data() {
 			return {
 				isEdit: false,
-				latitude: 39.909,
-				longitude: 116.39742,
+				// latitude: 39.909,
+				// longitude: 116.39742,
+				latitude: 0,
+				longitude: 0,
 				address: '',
 				taskID: '',
 				message: "",
@@ -126,6 +128,10 @@
 				});
 			},
 			validate() {
+				if (!this.address) {
+					throw new Error('请重新获取下定位信息');
+				}
+
 				if (!this.taskID) {
 					throw new Error('请返回重新进行打卡操作');
 				}

+ 4 - 2
MingGaoApp/pages/index/components/EntrapmentAdd.vue

@@ -458,7 +458,7 @@
 						arr.push(obj)
 					}
 				}
-				console.warn(arr,'已带回')
+				console.warn(arr, '已带回')
 				// this.$store.state.wornlist = arr
 				this.$store.state.wornlist = {
 					record_id: this.baseinfo.id, //      			填报记录id
@@ -498,7 +498,7 @@
 				var tf = arr.every((item) => {
 					return item.pest_number
 				})
-				console.warn(tf, arr,'提交 1213131313331')
+				console.warn(tf, arr, '提交 1213131313331')
 				if (arr.length != 0 && tf) {
 					// this.$store.state.wornlist = arr
 					this.$store.state.wornlist = {
@@ -669,6 +669,8 @@
 				line-height: 18px;
 				color: #555555;
 				margin: 0 24rpx;
+				width: 100rpx;
+				@include line;
 			}
 
 			.fill-icon {

File diff suppressed because it is too large
+ 720 - 719
MingGaoApp/unpackage/dist/dev/app-plus/app-service.js


File diff suppressed because it is too large
+ 112 - 106
MingGaoApp/unpackage/dist/dev/app-plus/app-view.js


File diff suppressed because it is too large
+ 3072 - 3073
MingGaoApp/unpackage/dist/dev/app-plus/pages/response/video.js