Jelajahi Sumber

更新数据填报页面UI

yf_zhb 2 tahun lalu
induk
melakukan
a7e78327af

+ 32 - 8
MingGaoApp/pages.json

@@ -322,6 +322,30 @@
 				"navigationBarBackgroundColor": "#ffffff"
 			}
 		
+		},
+		{
+			"path": "pages/my/formRecord/fieldSurveys",
+			"style": {
+				"navigationBarTitleText": "踏查记录表",
+				"navigationBarBackgroundColor": "#ffffff"
+			}
+		
+		},
+		{
+			"path": "pages/my/formRecord/samplePlot",
+			"style": {
+				"navigationBarTitleText": "样地调查表",
+				"navigationBarBackgroundColor": "#ffffff"
+			}
+		
+		},
+		{
+			"path": "pages/my/formRecord/trapRecord",
+			"style": {
+				"navigationBarTitleText": "诱捕器调查记录表",
+				"navigationBarBackgroundColor": "#ffffff"
+			}
+		
 		}
 	],
 	"globalStyle": {
@@ -337,26 +361,26 @@
 		"backgroundColor": "#fff",
 		"list": [{
 				"pagePath": "pages/index/index",
-				"iconPath": "static/image/indeximg/renwuon.png",
-				"selectedIconPath": "static/image/indeximg/renwu.png",
+				"iconPath": "static/tab/home.png",
+				"selectedIconPath": "static/tab/home-active.png",
 				"text": "任务"
 			},
 			{
 				"pagePath": "pages/supervise/index",
-				"iconPath": "static/image/indeximg/yingjianon.png",
-				"selectedIconPath": "static/image/indeximg/yingjian.png",
+				"iconPath": "static/tab/supervise.png",
+				"selectedIconPath": "static/tab/supervise-active.png",
 				"text": "监督"
 			},
 			{
 				"pagePath": "pages/response/index",
-				"iconPath": "static/image/indeximg/huidaon.png",
-				"selectedIconPath": "static/image/indeximg/huida.png",
+				"iconPath": "static/tab/info.png",
+				"selectedIconPath": "static/tab/info-active.png",
 				"text": "应答"
 			},
 			{
 				"pagePath": "pages/my/index",
-				"iconPath": "static/image/indeximg/meon.png",
-				"selectedIconPath": "static/image/indeximg/me.png",
+				"iconPath": "static/tab/profile.png",
+				"selectedIconPath": "static/tab/profile-active.png",
 				"text": "我的"
 			}
 		]

+ 325 - 0
MingGaoApp/pages/my/formRecord/fieldSurveys.vue

@@ -0,0 +1,325 @@
+<!-- 踏查记录表 -->
+<template>
+	<view class="record-form">
+		<view class="record-form__content">
+			<u--form labelPosition="left" :model="baseForm" :rules="rules" ref="uForm">
+				<u-form-item label="踏查点名称:" labelWidth="100" prop="inspect_name" borderBottom>
+					<u--input v-model="baseForm.inspect_name" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="经度:" labelWidth="100" prop="lng" borderBottom>
+					<u--input v-model="baseForm.lng" border="none">
+					</u--input>
+				</u-form-item>
+				<u-form-item label="纬度:" labelWidth="100" prop="lat" borderBottom>
+					<u--input v-model="baseForm.lat" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="海拔:" labelWidth="100" prop="height" borderBottom>
+					<u--input v-model="baseForm.height" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="踏查点面积:" labelWidth="100" prop="inspect_area" borderBottom>
+					<u--input v-model="baseForm.inspect_area" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="发生境:" labelWidth="100" prop="occurs_name" borderBottom @click="handleOccursClick">
+					<u--input v-model="baseForm.occurs_name" placeholder="请选择" disabled disabledColor="#ffffff"
+						border="none">
+					</u--input>
+					<uni-icons type="forward" slot="right"></uni-icons>
+				</u-form-item>
+				<u-form-item label="物种名称:" labelWidth="100" prop="pest_name" borderBottom>
+					<u--input v-model="baseForm.pest_name" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="危害对象:" labelWidth="100" prop="harm_obj" borderBottom>
+					<u--input v-model="baseForm.harm_obj" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="发生面积:" labelWidth="100" prop="occurs_area" borderBottom>
+					<u--input v-model="baseForm.occurs_area" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="是否设置标准样地:" labelWidth="140" prop="is_std" borderBottom>
+					<u-switch v-model="baseForm.is_std"></u-switch>
+				</u-form-item>
+				<u-form-item label="调查株数:" labelWidth="100" prop="check_num" borderBottom>
+					<u--input v-model="baseForm.check_num" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="危害株数:" labelWidth="100" prop="harm_num" borderBottom>
+					<u--input v-model="baseForm.harm_num" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="危害部位:" labelWidth="100" prop="harm_place" borderBottom>
+					<u--input v-model="baseForm.harm_place" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="危害率:" labelWidth="100" prop="harm_rate" borderBottom>
+					<u--input v-model="baseForm.harm_rate" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="是否采集样本:" labelWidth="140" prop="is_std" borderBottom>
+					<u-switch v-model="baseForm.is_std"></u-switch>
+				</u-form-item>
+				<u-form-item label="样本编号:" labelWidth="100" prop="sample_num" borderBottom>
+					<u--input v-model="baseForm.sample_num" border="none"></u--input>
+				</u-form-item>
+			</u--form>
+		</view>
+		<view class="record-form__actions">
+			<u-button @click="submit" type="primary">提交</u-button>
+		</view>
+		<view class="record-form__tips">
+			<view class="title">发生境选择信息如下:</view>
+			<view class="text" v-for="item in habitatList" :key="item.value">
+				<view>{{`${item.value} ${item.label}`}}</view>
+				<view v-if="item.children">
+					{{item.children.map(childItem=>`${childItem.value} ${childItem.label}`).join(' ')}}
+				</view>
+			</view>
+		</view>
+		<u-picker :show="show" keyName="label" :columns="occurs_columns" @confirm="confirm" @cancel="show = false"
+			@change="changeHandler" ref="uPicker">
+		</u-picker>
+	</view>
+</template>
+
+<script>
+	import {
+		first,
+		last
+	} from 'lodash-es';
+	import {
+		forEach,
+		isEmpty
+	} from 'lodash-es';
+	export default {
+		data() {
+			return {
+				baseForm: {
+					inspect_id: '', //id
+					inspect_name: '', // 踏查点名称
+					lng: '', // 经度,
+					lat: '', // 纬度,
+					height: '', // 海拔
+					inspect_area: '', //踏查点面积
+					occurs: '', // 发生境
+					occurs_name: '', // 发生境名称
+					pest_name: '', //物种名称
+					harm_obj: '', //危害对象
+					occurs_area: '', // 发生面积
+					is_std: '', // 是否设置标准样地   是/否
+					check_num: '', // 调查株数
+					harm_num: '', // 危害株数
+					harm_rate: '', // 危害率
+					harm_place: '', // 危害部位
+					sample_num: '', // 样本编号
+				},
+				rules: {
+					'inspect_name': {
+						type: 'string',
+						required: true,
+						message: '请填写踏查点名称',
+						trigger: ['blur', 'change']
+					},
+					'lng': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写经度',
+						trigger: ['blur', 'change']
+					},
+					'lat': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写纬度',
+						trigger: ['blur', 'change']
+					},
+					'height': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写海拔',
+						trigger: ['blur', 'change']
+					},
+					'inspect_area': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写踏查点面积',
+						trigger: ['blur', 'change']
+					},
+					'occurs': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请选择发生境',
+						trigger: ['blur', 'change']
+					},
+				},
+				habitatList: [{
+						label: '公共绿地',
+						value: '1',
+						children: [{
+								label: '学校',
+								value: '1-1'
+							},
+							{
+								label: '公园',
+								value: '1-2'
+							},
+							{
+								label: '医院',
+								value: '1-3'
+							},
+							{
+								label: '道路绿化带',
+								value: '1-4'
+							}
+						]
+					},
+					{
+						label: '农地',
+						value: '2',
+						children: [{
+								label: '水稻等农田作物种植区',
+								value: '2-1'
+							},
+							{
+								label: '蔬菜种植区',
+								value: '2-2'
+							},
+							{
+								label: '水果种植区',
+								value: '2-3'
+							}
+						]
+					},
+					{
+						label: '农产品储蓄交易场所',
+						value: '3',
+						children: [{
+								label: '粮食储备仓库',
+								value: '3-1'
+							},
+							{
+								label: '粮食加工厂',
+								value: '3-2'
+							},
+							{
+								label: '水果批发市场',
+								value: '3-3'
+							}
+						]
+					},
+					{
+						label: '水库道路周边地块',
+						value: '4'
+					},
+					{
+						label: '荒地',
+						value: '5',
+						children: [{
+							label: '待建地',
+							value: '5-1'
+						}, {
+							label: '城乡失管地',
+							value: '5-2'
+						}, ]
+					}
+				],
+				show: false,
+				currentSelectedData: null,
+				columnData: [],
+			}
+		},
+		computed: {
+			occurs_columns() {
+				const level1DataList = [];
+
+				forEach(this.habitatList, item => {
+					level1DataList.push({
+						label: item.label,
+						value: item.value
+					})
+
+					if (isEmpty(item.children)) {
+						this.columnData.push([])
+					} else {
+						this.columnData.push(item.children)
+					}
+				})
+
+				return [
+					level1DataList,
+					this.columnData[0]
+				]
+			},
+		},
+		methods: {
+			handleOccursClick() {
+				this.show = true;
+				console.log('click occurs click')
+			},
+			confirm({
+				value
+			}) {
+				console.log('before confirm --------------14', value)
+				const firstInfo = first(value);
+				const lastInfo = last(value);
+
+				this.baseForm.occurs = lastInfo ? lastInfo.value : firstInfo.value;
+				this.baseForm.occurs_name = lastInfo ? firstInfo.label + '/' + lastInfo.label : firstInfo.label;
+				this.show = false;
+			},
+			changeHandler(e) {
+				const {
+					columnIndex,
+					value,
+					values, // values为当前变化列的数组内容
+					index,
+					// 微信小程序无法将picker实例传出来,只能通过ref操作
+					picker = this.$refs.uPicker
+				} = e
+				// 当第一列值发生变化时,变化第二列(后一列)对应的选项
+				if (columnIndex === 0) {
+					// picker为选择器this实例,变化第二列对应的选项
+					picker.setColumnValues(1, this.columnData[index])
+				}
+			},
+			submit() {
+				this.$refs.uForm.validate().then(res => {
+					uni.$u.toast('校验通过')
+				}).catch(errors => {
+					uni.$u.toast('校验失败')
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.record-form {
+		padding: 40rpx;
+
+		&__content {
+			margin-bottom: 40rpx;
+		}
+
+		&__actions {
+			margin-bottom: 40rpx;
+		}
+
+		&__tips {
+			color: #333;
+			font-size: 14px;
+			line-height: 32rpx;
+
+			.title {
+				color: #333;
+				font-size: 16px;
+				line-height: 40rpx;
+				margin-bottom: 40rpx;
+			}
+
+			.text {
+				font-size: 16px;
+				line-height: 40rpx;
+				color: #F33E43;
+				margin-bottom: 20rpx;
+			}
+		}
+	}
+</style>

+ 365 - 0
MingGaoApp/pages/my/formRecord/samplePlot.vue

@@ -0,0 +1,365 @@
+<!-- 样地调查表(外来入侵) -->
+<template>
+	<view class="record-form">
+		<view class="record-form__content">
+			<u--form labelPosition="left" :model="baseForm" :rules="rules" ref="uForm">
+				<u-form-item label="标准样地地点:" labelWidth="100" prop="sample_addr" borderBottom>
+					<u--input v-model="baseForm.sample_addr" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="标准样地编号:" labelWidth="100" prop="lng" borderBottom>
+					<u--input v-model="baseForm.lng" border="none">
+					</u--input>
+				</u-form-item>
+				<u-form-item label="标准样地面积:" labelWidth="100" prop="sample_area" borderBottom>
+					<u--input v-model="baseForm.sample_area" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="经度:" labelWidth="100" prop="lng" borderBottom>
+					<u--input v-model="baseForm.lng" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="纬度:" labelWidth="100" prop="lat" borderBottom>
+					<u--input v-model="baseForm.lat" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="海拔:" labelWidth="100" prop="height" borderBottom>
+					<u--input v-model="baseForm.height" border="none"></u--input>
+				</u-form-item>
+				<!-- <u-form-item label="发生境:" labelWidth="100" prop="occurs" borderBottom>
+					<u--input v-model="baseForm.occurs" placeholder="请选择" disabled disabledColor="#ffffff"
+						border="none">
+					</u--input>
+					<uni-icons type="forward" slot="right"></uni-icons>
+				</u-form-item> -->
+				<u-form-item label="物种名称:" labelWidth="100" prop="pest_name" borderBottom>
+					<u--input v-model="baseForm.pest_name" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="拉丁学名:" labelWidth="100" prop="pest_name_1" borderBottom>
+					<u--input v-model="baseForm.pest_name_1" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="当地俗名:" labelWidth="100" prop="pest_name_2" borderBottom>
+					<u--input v-model="baseForm.pest_name_2" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="是否需要协助调查:" labelWidth="140" prop="is_check" borderBottom>
+					<u-switch v-model="baseForm.is_check"></u-switch>
+				</u-form-item>
+				<u-form-item label="危害对象:" labelWidth="80" prop="harm_obj" borderBottom>
+					<!-- <u--input v-model="baseForm.harm_obj" border="none"></u--input> -->
+					<u-radio-group v-model="baseForm.harm_obj">
+						<u-radio :customStyle="{marginRight: '8px'}" v-for="(item, index) in harmObjectList"
+							:key="item.value" :label="item.label" :name="item.value">
+						</u-radio>
+					</u-radio-group>
+				</u-form-item>
+				<u-form-item label="危害作物:" labelWidth="100" prop="harm_crop" borderBottom>
+					<u--input v-model="baseForm.harm_crop" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="危害部位:" labelWidth="60" prop="harm_place" borderBottom>
+					<!-- <u--input v-model="baseForm.harm_place" border="none"></u--input> -->
+					<u-radio-group v-model="baseForm.harm_place">
+						<u-radio :customStyle="{marginRight: '2px'}" v-for="(item, index) in harmPlaceList"
+							:key="item.value" :label="item.label" :name="item.value">
+						</u-radio>
+					</u-radio-group>
+				</u-form-item>
+				<u-collapse :accordion="false">
+					<u-collapse-item title="样方/样线编号:1">
+						<u-form-item label="调查株数样线长度:" labelWidth="100" prop="check_num_1" borderBottom>
+							<u--input v-model="baseForm.check_num_1" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="受害株数/受害病株所垮长度:" labelWidth="100" prop="harm_num_1" borderBottom>
+							<u--input v-model="baseForm.harm_num_1" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="危害率:" labelWidth="100" prop="harm_rate_1" borderBottom>
+							<u--input v-model="baseForm.harm_rate_1" border="none"></u--input>
+						</u-form-item>
+					</u-collapse-item>
+					<u-collapse-item title="样方/样线编号:2">
+						<u-form-item label="调查株数样线长度:" labelWidth="100" prop="baseForm.check_num_2" borderBottom>
+							<u--input v-model="baseForm.check_num_2" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="受害株数/受害病株所垮长度:" labelWidth="100" prop="harm_num_2" borderBottom>
+							<u--input v-model="baseForm.harm_num_2" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="危害率:" labelWidth="100" prop="harm_rate_2" borderBottom>
+							<u--input v-model="baseForm.harm_rate_2" border="none"></u--input>
+						</u-form-item>
+					</u-collapse-item>
+					<u-collapse-item title="样方/样线编号:3">
+						<u-form-item label="调查株数样线长度:" labelWidth="100" prop="check_num_3" borderBottom>
+							<u--input v-model="baseForm.check_num_3" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="受害株数/受害病株所垮长度:" labelWidth="100" prop="harm_num_3" borderBottom>
+							<u--input v-model="baseForm.harm_num_3" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="危害率:" labelWidth="100" prop="harm_rate_3" borderBottom>
+							<u--input v-model="baseForm.harm_rate_3" border="none"></u--input>
+						</u-form-item>
+					</u-collapse-item>
+					<u-collapse-item title="样方/样线编号:4">
+						<u-form-item label="调查株数样线长度:" labelWidth="100" prop="check_num_4" borderBottom>
+							<u--input v-model="baseForm.check_num_4" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="受害株数/受害病株所垮长度:" labelWidth="100" prop="harm_num_4" borderBottom>
+							<u--input v-model="baseForm.harm_num_4" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="危害率:" labelWidth="100" prop="harm_rate_4" borderBottom>
+							<u--input v-model="baseForm.harm_rate_4" border="none"></u--input>
+						</u-form-item>
+					</u-collapse-item>
+					<u-collapse-item title="样方/样线编号:5">
+						<u-form-item label="调查株数样线长度:" labelWidth="100" prop="check_num_5" borderBottom>
+							<u--input v-model="baseForm.check_num_5" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="受害株数/受害病株所垮长度:" labelWidth="100" prop="harm_num_5" borderBottom>
+							<u--input v-model="baseForm.harm_num_5" border="none"></u--input>
+						</u-form-item>
+						<u-form-item label="危害率:" labelWidth="100" prop="harm_rate_5" borderBottom>
+							<u--input v-model="baseForm.harm_rate_5" border="none"></u--input>
+						</u-form-item>
+					</u-collapse-item>
+				</u-collapse>
+				<u-form-item label="是否采集样本:" labelWidth="140" prop="is_gather" borderBottom>
+					<u-switch v-model="baseForm.is_gather"></u-switch>
+				</u-form-item>
+			</u--form>
+		</view>
+		<view class="record-form__actions">
+			<u-button @click="submit" type="primary">提交</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				baseForm: {
+					as_id: '', //id
+					sample_addr: '', // 标准样地地点
+					sample_num: '', // 标准样地编号
+					lng: '', // 经度,
+					lat: '', // 纬度,
+					height: '', // 海拔
+					sample_area: '', //踏查点面积
+					occurs: '', // 发生境
+					pest_name: '', //物种名称
+					pest_name_2: '', //拉丁学名
+					pest_name_3: '', //当地俗名
+					is_check: '', // 是否需要辅助调查    是/否
+					harm_obj: '', //危害对象
+					harm_crop: '', //危害植物
+					sample_no_1: '', // 样方/样线编号1
+					check_num_1: '', // 调查株数/样线长度
+					harm_num_1: '', // 受害株数
+					harm_rate_1: '', // 危害率
+					sample_no_2: '', // 样方/样线编号2
+					check_num_2: '', // 调查株数/样线长度
+					harm_num_2: '', // 受害株数
+					harm_rate_2: '', // 危害率
+					sample_no_3: '', // 样方/样线编号3
+					check_num_3: '', // 调查株数/样线长度
+					harm_num_3: '', // 受害株数
+					harm_rate_3: '', // 危害率
+					sample_no_4: '', // 样方/样线编号4
+					check_num_4: '', // 调查株数/样线长度
+					harm_num_4: '', // 受害株数
+					harm_rate_4: '', // 危害率
+					sample_no_5: '', // 样方/样线编号5
+					check_num_5: '', // 调查株数/样线长度
+					harm_num_5: '', // 受害株数
+					harm_rate_5: '', // 危害率
+					harm_place: '', // 危害部位
+					is_gather: '', //  是否采集标本 是/否
+				},
+				rules: {
+					'sample_addr': {
+						type: 'string',
+						required: true,
+						message: '请填写踏查点名称',
+						trigger: ['blur', 'change']
+					},
+					'lng': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写经度',
+						trigger: ['blur', 'change']
+					},
+					'lat': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写纬度',
+						trigger: ['blur', 'change']
+					},
+					'height': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写海拔',
+						trigger: ['blur', 'change']
+					},
+					'sample_area': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请填写踏查点面积',
+						trigger: ['blur', 'change']
+					},
+					'occurs': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请选择发生境',
+						trigger: ['blur', 'change']
+					},
+				},
+				habitatList: [{
+						label: '公共绿地',
+						value: '1',
+						children: [{
+								label: '学校',
+								value: '1-1'
+							},
+							{
+								label: '公园',
+								value: '1-2'
+							},
+							{
+								label: '医院',
+								value: '1-3'
+							},
+							{
+								label: '道路绿化带',
+								value: '1-4'
+							}
+						]
+					},
+					{
+						label: '农地',
+						value: '2',
+						children: [{
+								label: '水稻等农田作物种植区',
+								value: '2-1'
+							},
+							{
+								label: '蔬菜种植区',
+								value: '2-2'
+							},
+							{
+								label: '水果种植区',
+								value: '2-3'
+							}
+						]
+					},
+					{
+						label: '农产品储蓄交易场所',
+						value: '3',
+						children: [{
+								label: '粮食储备仓库',
+								value: '3-1'
+							},
+							{
+								label: '粮食加工厂',
+								value: '3-2'
+							},
+							{
+								label: '水果批发市场',
+								value: '3-3'
+							}
+						]
+					},
+					{
+						label: '水库道路周边地块',
+						value: '4'
+					},
+					{
+						label: '荒地',
+						value: '5',
+						children: [{
+							label: '待建地',
+							value: '5-1'
+						}, {
+							label: '城乡失管地',
+							value: '5-2'
+						}, ]
+					}
+				],
+				harmObjectList: [{
+					label: '农作物',
+					value: '农作物'
+				}, {
+					label: '人畜健康',
+					value: '人畜健康'
+				}, {
+					label: '生态系统',
+					value: '生态系统'
+				}, ],
+				harmPlaceList: [{
+					label: '根',
+					value: '根'
+				}, {
+					label: '茎',
+					value: '茎'
+				}, {
+					label: '叶',
+					value: '叶'
+				}, 
+				{
+					label: '花',
+					value: '花'
+				},
+				{
+					label: '果实',
+					value: '果实'
+				},
+				{
+					label: '其他',
+					value: '其他'
+				},
+				],
+			}
+		},
+		methods: {
+			submit() {
+				this.$refs.uForm.validate().then(res => {
+					uni.$u.toast('校验通过')
+				}).catch(errors => {
+					uni.$u.toast('校验失败')
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.record-form {
+		padding: 40rpx;
+
+		&__content {
+			margin-bottom: 40rpx;
+		}
+
+		&__actions {
+			margin-bottom: 40rpx;
+		}
+
+		&__tips {
+			color: #333;
+			font-size: 14px;
+			line-height: 32rpx;
+
+			.title {
+				color: #333;
+				font-size: 16px;
+				line-height: 40rpx;
+				margin-bottom: 40rpx;
+			}
+
+			.text {
+				font-size: 16px;
+				line-height: 40rpx;
+				color: #F33E43;
+				margin-bottom: 20rpx;
+			}
+		}
+	}
+</style>

+ 363 - 0
MingGaoApp/pages/my/formRecord/trapRecord.vue

@@ -0,0 +1,363 @@
+<!-- 诱捕法调查记录表 -->
+<template>
+	<view class="record-form">
+		<view class="record-form__content">
+			<u--form labelPosition="left" :model="baseForm" :rules="rules" ref="uForm">
+				<u-form-item label="标准样地地点:" labelWidth="100" prop="sample_addr" borderBottom>
+					<u--input v-model="baseForm.sample_addr" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="标准样地编号:" labelWidth="100" prop="sample_num" borderBottom>
+					<u--input v-model="baseForm.sample_num" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="标准样地面积:" labelWidth="100" prop="sample_area" borderBottom>
+					<u--input v-model="baseForm.sample_area" border="none" type="type" suffixIcon="亩"></u--input>
+				</u-form-item>
+				<u-form-item label="经度:" labelWidth="100" prop="lng" borderBottom>
+					<u--input v-model="baseForm.lng" border="none">
+					</u--input>
+				</u-form-item>
+				<u-form-item label="纬度:" labelWidth="100" prop="lat" borderBottom>
+					<u--input v-model="baseForm.lat" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="海拔:" labelWidth="100" prop="height" borderBottom>
+					<u--input v-model="baseForm.height" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="诱虫灯名称:" labelWidth="100" prop="trap_number" borderBottom>
+					<u--input v-model="baseForm.trap_number" border="none"></u--input>
+				</u-form-item>
+				<u-form-item label="引诱剂名称:" labelWidth="100" prop="inducer_name" borderBottom>
+					<u--input v-model="baseForm.inducer_name" border="none"></u--input>
+				</u-form-item>
+
+				<view class="form-panel" v-for="(item,index) in baseForm.pest_list" :key="item.pest_id+index">
+					<view class="icon" @click="handleRemove(index)" v-if="baseForm.pest_list.length>1">
+						<u-icon name="close" color="#fff"></u-icon>
+					</view>
+					<view class="form-panel__content">
+						<u-row class="mb-10">
+							<u-col span="12" @click="handleSelectPest(item)">
+								<!-- <u-form-item borderBottom>
+									
+								</u-form-item> -->
+								<u--input v-model="item.pest_name" placeholder="请选择" disabled disabledColor="#ffffff"
+									border="surround">
+								</u--input>
+							</u-col>
+						</u-row>
+						<u-row class="mb-10">
+							<u-col span="12">
+								<u--input style="background-color: #fff;" v-model="item.harm_crop" placeholder="危害农作物"
+									border="surround"></u--input>
+							</u-col>
+						</u-row>
+						<u-row class="mb-10" gutter="10">
+							<u-col span="6">
+								<u--input type="number" style="background-color: #fff;" v-model="item.female_num"
+									border="surround" placeholder="雌"></u--input>
+							</u-col>
+							<u-col span="6">
+								<u--input type="number" style="background-color: #fff;" v-model="item.male_num"
+									placeholder="雄" border="surround"></u--input>
+							</u-col>
+						</u-row>
+						<u-row class="mb-10">
+							<u-col span="12">
+								<u--textarea v-model="item.remarks" placeholder="备注" border="surround"></u--textarea>
+							</u-col>
+						</u-row>
+					</view>
+				</view>
+
+			</u--form>
+			<u-button type="info" @click="handleAddPestInfo">点击添加害虫信息</u-button>
+		</view>
+		<view class="record-form__actions">
+			<u-button @click="submit" :disabled="submitLoading" :loading="submitLoading" type="primary">提交</u-button>
+		</view>
+		<u-picker :show="show" keyName="pest_name" :columns="pestDataList" @confirm="confirm" @cancel="show = false">
+		</u-picker>
+	</view>
+</template>
+
+<script>
+	import * as pestService from '@/service/pest.js'
+	import * as formRecordService from '@/service/formRecord.js'
+	import {
+		assign,
+		first
+	} from 'lodash-es';
+
+	export default {
+		data() {
+			return {
+				currentSelectedData: null,
+				baseForm: {
+					tc_id: '', //id
+					sample_addr: '', // 标准样地地点
+					sample_num: '', // 标准样地编号
+					sample_area: '', //标准样地面积
+					lng: '', // 经度,
+					lat: '', // 纬度,
+					height: '', // 海拔
+					trap_number: '', // 诱捕器编号
+					inducer_name: '', // 诱剂名称
+					pest_list: [],
+					/**
+					 * {
+						 pest_id //害虫id
+						 pest_name // 害虫名称
+						 harm_crop // 危害农作物
+						 pest_total // 害虫总数
+						 male_num // 雄性数量
+						 female_num // 雌性数量
+						 remarks // 备注
+					 }
+					 */
+				},
+				rules: {
+					'sample_addr': {
+						type: 'string',
+						required: true,
+						message: '请填写标准样地地点',
+						trigger: ['blur', 'change']
+					},
+					'lng': {
+						type: 'string',
+						required: true,
+						message: '请填写经度',
+						trigger: ['blur', 'change']
+					},
+					'lat': {
+						type: 'string',
+						required: true,
+						message: '请填写纬度',
+						trigger: ['blur', 'change']
+					},
+					'height': {
+						type: 'string',
+						required: true,
+						message: '请填写海拔',
+						trigger: ['blur', 'change']
+					},
+				},
+				habitatList: [{
+						label: '公共绿地',
+						value: '1',
+						children: [{
+								label: '学校',
+								value: '1-1'
+							},
+							{
+								label: '公园',
+								value: '1-2'
+							},
+							{
+								label: '医院',
+								value: '1-3'
+							},
+							{
+								label: '道路绿化带',
+								value: '1-4'
+							}
+						]
+					},
+					{
+						label: '农地',
+						value: '2',
+						children: [{
+								label: '水稻等农田作物种植区',
+								value: '2-1'
+							},
+							{
+								label: '蔬菜种植区',
+								value: '2-2'
+							},
+							{
+								label: '水果种植区',
+								value: '2-3'
+							}
+						]
+					},
+					{
+						label: '农产品储蓄交易场所',
+						value: '3',
+						children: [{
+								label: '粮食储备仓库',
+								value: '3-1'
+							},
+							{
+								label: '粮食加工厂',
+								value: '3-2'
+							},
+							{
+								label: '水果批发市场',
+								value: '3-3'
+							}
+						]
+					},
+					{
+						label: '水库道路周边地块',
+						value: '4'
+					},
+					{
+						label: '荒地',
+						value: '5',
+						children: [{
+							label: '待建地',
+							value: '5-1'
+						}, {
+							label: '城乡失管地',
+							value: '5-2'
+						}, ]
+					}
+				],
+				pestDataList: [],
+				show: false,
+				submitLoading: false
+			}
+		},
+		onLoad() {
+			this.baseForm.pest_list = [{
+				pest_id: '', //害虫id
+				pest_name: '', // 害虫名称
+				harm_crop: '', // 危害农作物
+				pest_total: 0, // 害虫总数
+				male_num: '', // 雄性数量
+				female_num: '', // 雌性数量
+				remarks: '' // 备注
+			}]
+
+			this.getPestList();
+		},
+		methods: {
+			handleSelectPest(row) {
+				console.log(row, 'seleted pest')
+				this.currentSelectedData = row;
+				this.show = true;
+			},
+			confirm({
+				value
+			}) {
+				console.log(this.currentSelectedData, 'before confirm --------------14', value)
+				const pestInfo = first(value) || {};
+				this.currentSelectedData.pest_id = pestInfo.pest_id;
+				this.currentSelectedData.pest_name = pestInfo.pest_name;
+
+				console.log(this.currentSelectedData, 'confirm ----------------- 121441')
+
+				this.show = false;
+			},
+			getPestList() {
+				pestService.fetchPestList({
+					page: '1',
+					page_item: "1000000000000000000"
+				}).then(res => {
+					console.log(res, '------- get pest list')
+					this.pestDataList = [res.page_list];
+				})
+			},
+			handleRemove(index) {
+				this.baseForm.pest_list.splice(index, 1)
+			},
+			handleAddPestInfo() {
+				const payload = {
+					pest_id: '', //害虫id
+					pest_name: '', // 害虫名称
+					harm_crop: '', // 危害农作物
+					pest_total: 0, // 害虫总数
+					male_num: '', // 雄性数量
+					female_num: '', // 雌性数量
+					remarks: '' // 备注
+				}
+
+				this.baseForm.pest_list.push(payload);
+			},
+			submit() {
+				this.$refs.uForm.validate().then(res => {
+					uni.$u.toast('校验通过')
+					this.submitLoading = true;
+					const payload = assign({}, this.baseForm);
+					formRecordService.addTrapRecordForm(payload).then(res => {
+						console.log(res,'------------- add form success')
+						uni.$u.toast('提交成功')
+						
+						setTimeout(()=>{
+							uni.navigateBack({
+								delta: 1
+							})
+						},1000)
+						
+					}).finally(() => {
+						this.submitLoading = false;
+					})
+				}).catch(errors => {
+					uni.$u.toast('校验失败')
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.record-form {
+		padding: 40rpx;
+
+		&__content {
+			margin-bottom: 40rpx;
+		}
+
+		&__actions {
+			margin-bottom: 40rpx;
+		}
+
+		&__tips {
+			color: #333;
+			font-size: 14px;
+			line-height: 32rpx;
+
+			.title {
+				color: #333;
+				font-size: 16px;
+				line-height: 40rpx;
+				margin-bottom: 40rpx;
+			}
+
+			.text {
+				font-size: 16px;
+				line-height: 40rpx;
+				color: #F33E43;
+				margin-bottom: 20rpx;
+			}
+		}
+
+		.form-panel {
+			position: relative;
+			margin-top: 30rpx;
+			margin-bottom: 20rpx;
+			background-color: #f6f6f6;
+			border-radius: 16rpx;
+
+			.icon {
+				position: absolute;
+				top: -20rpx;
+				right: -20rpx;
+				z-index: 9;
+				width: 40rpx;
+				height: 40rpx;
+				border-radius: 50%;
+				display: flex;
+				justify-content: space-around;
+				background-color: red;
+			}
+
+			&__content {
+				padding: 20rpx;
+			}
+		}
+
+
+		.mb-10 {
+			margin-bottom: 20rpx;
+		}
+	}
+</style>

+ 16 - 4
MingGaoApp/pages/my/index.vue

@@ -14,10 +14,10 @@
 					{{item}}
 				</view>
 				<view class="item_info">
-					<view class="" v-if="index==5">
+					<view class="" v-if="index==tablist.length-1">
 						{{ids}}
 					</view>
-					<view class="item_info_dian" v-if="index==5&&newversion || index==4 && unreadNum>0">
+					<view class="item_info_dian" v-if="index==tablist.length-1&&newversion || index==4 && unreadNum>0">
 
 					</view>
 					<u-icon name="arrow-right" color="#606060"></u-icon>
@@ -41,7 +41,7 @@
 					},
 					username: ""
 				},
-				tablist: ["个人中心", "监测日志", "监督记录", "我的轨迹", '我的消息', "版本信息", ],
+				tablist: ["个人中心", "监测日志", "监督记录", "我的轨迹", '我的消息', "踏查记录表", "样地调查表", "诱捕器调查记录表", "版本信息", ],
 				newversion: false,
 				ids: plus.runtime.version,
 				unreadNum: 0
@@ -122,7 +122,19 @@
 					uni.navigateTo({
 						url: '/pages/my/warnList',
 					});
-				} else if (index == 5) {
+				}else if (index == 5) {
+					uni.navigateTo({
+						url: './formRecord/fieldSurveys',
+					});
+				}else if (index == 6) {
+					uni.navigateTo({
+						url: './formRecord/samplePlot',
+					});
+				}else if (index == 7) {
+					uni.navigateTo({
+						url: './formRecord/trapRecord',
+					});
+				} else if (index == 8) {
 					uni.navigateTo({
 						url: './version',
 					});

+ 27 - 0
MingGaoApp/service/formRecord.js

@@ -0,0 +1,27 @@
+import {
+	myRequest
+} from '@/util/api.js';
+
+// 踏查记录填报
+export function addFieldSurveysRecordForm(data) {
+	return myRequest({
+		url: '/api/api_gateway?method=data_report.info.inspect_add',
+		data
+	})
+}
+
+// 诱捕器调查记录填报
+export function addTrapRecordForm(data) {
+	return myRequest({
+		url: '/api/api_gateway?method=data_report.info.trap_check_add',
+		data
+	})
+}
+
+// 外来入侵记录填报
+export function addSampleRecordForm(data) {
+	return myRequest({
+		url: '/api/api_gateway?method=data_report.info.alien_specie_add',
+		data
+	})
+}

+ 12 - 0
MingGaoApp/service/pest.js

@@ -0,0 +1,12 @@
+
+import {
+	myRequest
+} from '@/util/api.js';
+
+// 获取害虫列表
+export function fetchPestList(data) {
+	return myRequest({
+		url: '/api/api_gateway?method=sysmenage.maintain.pest_list',
+		data
+	})
+}

TEMPAT SAMPAH
MingGaoApp/static/tab/home-active.png


TEMPAT SAMPAH
MingGaoApp/static/tab/home.png


TEMPAT SAMPAH
MingGaoApp/static/tab/info-active.png


TEMPAT SAMPAH
MingGaoApp/static/tab/info.png


TEMPAT SAMPAH
MingGaoApp/static/tab/pest-active.png


TEMPAT SAMPAH
MingGaoApp/static/tab/profile-active.png


TEMPAT SAMPAH
MingGaoApp/static/tab/profile.png


TEMPAT SAMPAH
MingGaoApp/static/tab/supervise-active.png


TEMPAT SAMPAH
MingGaoApp/static/tab/supervise.png


File diff ditekan karena terlalu besar
+ 1 - 1
MingGaoApp/unpackage/dist/dev/app-plus/__uniapppicker.js


File diff ditekan karena terlalu besar
+ 2 - 2
MingGaoApp/unpackage/dist/dev/app-plus/app-config-service.js


File diff ditekan karena terlalu besar
+ 4070 - 836
MingGaoApp/unpackage/dist/dev/app-plus/app-service.js


File diff ditekan karena terlalu besar
+ 3424 - 925
MingGaoApp/unpackage/dist/dev/app-plus/app-view.js


File diff ditekan karena terlalu besar
+ 1 - 1
MingGaoApp/unpackage/dist/dev/app-plus/manifest.json


+ 3 - 0
MingGaoApp/unpackage/dist/dev/app-plus/pages/response/video.js

@@ -1793,6 +1793,9 @@ function normalizeComponent (
   }
   // fixed by xxxxxx renderjs
   if (renderjs) {
+    if(typeof renderjs.beforeCreate === 'function'){
+			renderjs.beforeCreate = [renderjs.beforeCreate]
+		}
     (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
       this[renderjs.__module] = this
     });

File diff ditekan karena terlalu besar
+ 1 - 1
MingGaoApp/unpackage/dist/dev/app-plus/view.css


File diff ditekan karena terlalu besar
+ 2 - 2
MingGaoApp/unpackage/dist/dev/app-plus/view.umd.min.js