From 645834e1c3efb3a8c50dcbda98d87caba04bd421 Mon Sep 17 00:00:00 2001
From: fei.wang <wf18701153496@163.com>
Date: 星期三, 13 八月 2025 14:34:02 +0800
Subject: [PATCH] v1.2.8

---
 components/personBox.vue |  305 ++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 266 insertions(+), 39 deletions(-)

diff --git a/components/personBox.vue b/components/personBox.vue
index b00c41c..2c049cd 100644
--- a/components/personBox.vue
+++ b/components/personBox.vue
@@ -3,24 +3,29 @@
 		<view class="link-bottom">
 			<view class="userinfo-box">
 				<view class="userinfo-img" style="width: 20%;">
-					
+
 					<image src="../static/user.png" style="width:50px;height:50px;"></image>
 				</view>
 				<view class="userinfo-value-box" style="width: 80%;">
 					<view class="user-nickname">{{perlist.personname}}</view>
-					<view class="user-company">{{perlist.department}} |鍗″彿锛� {{perlist.tagid}}
-					 	<tn-button v-if="perlist.type=='鍚婅溅'" size="sm" style="margin-left: 3%;" backgroundColor="#00aaff" @click="calibration(perlist.height)">鏍″噯</tn-button></view>
-				
+					<view class="user-company">{{perlist.department}} |缂栧彿锛� {{perlist.tagid}}
+						<tn-button v-if="perlist.type=='鍚婅溅' || perlist.type=='鐧婚珮浣滀笟浜�'" size="sm" style="margin-left: 3%;"
+							backgroundColor="#00aaff" @click="calibration(perlist.height)">鏍″噯</tn-button>
+					</view>
+
 				</view>
-				<span v-if="perlist.type=='鍚婅溅'" style="position: absolute;right:100px;top:10px;height:20px;">
-					楂樺害锛歿{ jisuan(perlist.height) }}m
+				<span v-if="perlist.type=='鍚婅溅' || perlist.type=='鐧婚珮浣滀笟浜�'"
+					style="position: absolute;right:80px;top:10px;height:20px;">
+					楂樺害锛歿{ jisuan(perlist) }}m
 				</span>
 				<!-- <view style="position: absolute;right:10px;top:10px;"> -->
-					<!-- <button plain @click="refresh" style="width:20px;"> -->
-						<image src="../static/refresh.png" class="icon-image" @click="refresh" style="position: absolute;right:40px;top:10px;width:20px;height:20px;"></image>
-					<!-- </button> -->
-					<image src="../static/close.png" style="position: absolute;right:10px;top:10px;width:20px;height:20px;" @click="closeinfo">
-					</image>
+				<!-- <button plain @click="refresh" style="width:20px;"> -->
+				<image src="../static/refresh.png" class="icon-image" @click="refresh"
+					style="position: absolute;right:40px;top:10px;width:20px;height:20px;"></image>
+				<!-- </button> -->
+				<image src="../static/close.png" style="position: absolute;right:10px;top:10px;width:20px;height:20px;"
+					@click="closeinfo">
+				</image>
 				<!-- </view> -->
 			</view>
 			<view class="content-box">
@@ -34,23 +39,30 @@
 					<span style="margin-left: 3%;">
 						宸垎淇℃簮锛歿{perlist.rtcm}}
 					</span>
-					
+
 				</view>
 				<view style="margin-top: 3%;">
 					<span style="margin-left: 3%;">
-						娴锋嫈锛歿{perlist.height}}
-						
+						娴锋嫈锛歿{perlist.height}}m
+
 					</span>
-					{{perlist.encryption}}
-					<span v-if="perlist.encryption!=''" style="width: 47%; float: right;margin-right: 3%;">
-						鍔犲瘑
+
+					<span style="width: 47%; float: right;margin-right: 3%;">
+						閫熷害锛氭棤
+						<!-- 鍔犲瘑:{{perlist.encryption}} -->
 					</span>
 				</view>
 				<view style="margin-top: 3%;">
 					<span style="margin-left: 3%;">
 						鐢甸噺锛歿{perlist.power}}%
 					</span>
-					<span style="width: 47%; float: right;margin-right: 3%;">
+
+					<span v-if="perlist.encryption!=''" style="width: 20%;margin-left: 5%; ">
+
+						鍔犲瘑:{{perlist.encryption}}
+					</span>
+
+					<span style="width: 37%; float: right;margin-right: 3%;">
 						鐘舵�侊細{{ getGpsStatusText(perlist.gpsstatus) }}
 					</span>
 				</view>
@@ -60,19 +72,88 @@
 				<button style="width: 80%;left: 5px;" type="primary" @click="copyInfo">澶嶅埗</button>
 			</view> -->
 		</view>
+
+		<u-modal style="position: absolute;z-index: 99999999999999;" buttonReverse confirmText="淇濆瓨" cancelText="鍙栨秷"
+			:show="show" @cancel="cancelmodal" @confirm="startdraw" ref="uModal" :showCancelButton="true"
+			:closeOnClickOverlay="true">
+			<!-- <u-icon name="close" style="position: absolute;right: 10px;top:10px" @click="closemodal"></u-icon> -->
+			<view style="max-height: 600px; overflow-y: auto;">
+
+				<u--form style="" labelPosition="left" ref="uForm">
+					<u-form-item required label="缁堢缂栧彿:" borderBottom ref="item1" labelWidth="80px"
+						@click="showtagid = true">
+						<!-- <u-badge v-if="tagonlie==1 && code!=''" :isDot="true" type="success"></u-badge>
+						<u-badge v-else-if="tagonlie==0 && code!=''" :isDot="true" type="info"></u-badge> -->
+						<!-- <u--input v-model="code" border="none" placeholder="璇疯緭鍏ョ粓绔紪鍙�" @blur="seachcode"></u--input> -->
+						<!-- <tn-input v-model="code" type="select" @click="showtagid = true" placeholder="璇烽�夋嫨缁堢缂栧彿" /> -->
+						<u-input v-model="code" disabled disabledColor="#ffffff" placeholder="璇烽�夋嫨缁堢缂栧彿" border="none" />
+						<!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> -->
+						<u-icon slot="right" name="arrow-down"></u-icon>
+						<tn-select v-model="showtagid" mode="single" :list="tagidlist" @confirm="confirmtagid"
+							:searchShow="true"></tn-select>
+					</u-form-item>
+					<u-form-item required label="閫夋嫨鍥存爮:" borderBottom ref="item1" labelWidth="80px"
+						@click="showfname = true">
+						<!-- 	<tn-input v-model="fencename" type="select" @click="showfname = true" placeholder="璇烽�夋嫨鍥存爮" /> -->
+
+						<u-input v-model="fencename" disabled disabledColor="#ffffff" placeholder="璇烽�夋嫨鍥存爮"
+							border="none" />
+						<!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> -->
+						<u-icon slot="right" name="arrow-down"></u-icon>
+						<tn-select v-model="showfname" mode="single" :list="fencelist" @confirm="confirmfence"
+							:searchShow="true"></tn-select>
+					</u-form-item>
+
+					<u-form-item :label="'鐩稿楂樺害:'" borderBottom ref="item1" :labelWidth="labelWidth">
+						<tn-input v-show="xdgao!=''" v-model="xdgao" inputAlign="right"></tn-input>
+						<!-- <uni-tooltip :content="content" placement="top" style="width:100px"> -->
+						<u-button v-show="xdgao!=''" slot="right" type="warning" text="鍒犻櫎" size="mini"
+							@click="degao"></u-button>
+						<u-button style="width:100px" type="primary" v-show="xdgao==''" size="mini"
+							@click="acquisitionxy()">鏍″噯楂樺害</u-button>
+						<!-- </uni-tooltip> -->
+					</u-form-item>
+
+
+				</u--form>
+			</view>
+		</u-modal>
+		<successCom ref="refSuccess" style="position: absolute;z-index: 9999999999999999;"></successCom>
 	</view>
 </template>
 
 <script>
+	import successCom from '@/components/success.vue'
+	import {
+		updateperhe,
+		findtagid,
+		findAllFence,
+		acquisition
+	} from '@/config/api.js';
 	import {
 		minLogin
 	} from '@/js/minLogin.js'
 	export default {
+		components: {
+			successCom
+		},
 		mixins: [minLogin],
 		data() {
 			return {
-				jiaozhungao:0,
-				gao:0,
+				fencegao: '',
+				fencename: '',
+				showfname: false,
+				tagid: '',
+				xdgao: '',
+				labelWidth: 100,
+				tagonlie: '',
+				tagidlist: [],
+				fencelist: [],
+				showtagid: false,
+				code: '',
+				show: false,
+				jiaozhungao: 0,
+				gao: 0,
 			}
 		},
 		props: {
@@ -83,30 +164,175 @@
 				}
 			}
 		},
-			mounted() {
-				console.log(this.perlist);
-				},
+		mounted() {
+			this.findtagidall()
+			this.findfenceall()
+			this.tagid = this.perlist.tagid
+			if (this.perlist.baoliu4 != '' && this.perlist.baoliu4 != null) {
+				this.xdgao = this.perlist.baoliu4
+			}
+		},
 		methods: {
-				
-			calibration(e){
-				this.jiaozhungao = e
-				this.jisuan()
+			degao() {
+				this.xdgao = ''
 			},
-			jisuan(e){
-				if (this.jiaozhungao=='') {
-					this.gao =0
-				} else{
-					this.gao =(parseFloat(e) - parseFloat(this.jiaozhungao)).toFixed(2)
+			findtagidall() {
+				if (this.vuex_is_login) {
+					const params = {
+						company: this.company,
+						juese: uni.getStorageSync('juese'),
+					}
+					findtagid(params).then((res) => {
+						if (res.code == 0) {
+							this.tagidlist = res.data.map(item => ({
+								value: item.online,
+								label: item.tagid,
+
+							}));
+						} else {
+							this.$refs.refSuccess.showBox({
+								type: 'error',
+								txt: res.msg
+							});
+						}
+					})
 				}
-				
+
+			},
+
+			findfenceall() {
+				if (this.vuex_is_login) {
+					const params = {
+						company: this.company,
+						juese: uni.getStorageSync('juese'),
+					}
+					findAllFence(params).then((res) => {
+						console.log(res);
+						if (res.code == 0) {
+							this.fencelist = res.data.map(item => ({
+								value: item.baoliu4 == '0' ? '0.00' : item.baoliu4,
+								label: item.name,
+
+							}));
+							console.log(this.fencelist);
+						} else {
+							this.$refs.refSuccess.showBox({
+								type: 'error',
+								txt: res.msg
+							});
+						}
+					})
+				}
+
+			},
+
+			acquisitionxy() {
+				if (this.code != '') {
+					const params = {
+						baoliu3: this.code,
+						company: this.company,
+						juese: uni.getStorageSync('juese'),
+					}
+					if (this.vuex_is_login) {
+						acquisition(params).then((res) => {
+							if (res.code == 0) {
+								this.xdgao = res.data.height
+							} else {
+								this.$refs.refSuccess.showBox({
+									type: 'error',
+									txt: res.msg
+								});
+							}
+						})
+					}
+				} else {
+					this.xdgao = this.fencegao
+				}
+			},
+			confirmtagid(e) {
+				this.code = e[0].label
+				// this.tagonlie = e[0].value
+				// this.seachcode()
+
+			},
+			confirmfence(e) {
+				this.fencename = e[0].label
+				this.fencegao = e[0].value
+			},
+			cancelmodal() {
+				this.show = false
+			},
+			startdraw() {
+				var json = {}
+				json.tagid = this.tagid
+				json.baoliu4 = this.xdgao
+				updateperhe(json).then((res) => {
+
+				})
+				this.show = false
+			},
+			calibration(e) {
+				this.show = true
+				// this.jiaozhungao = e
+				// this.jisuan()
+			},
+			jisuan(e) {
+				// console.log(e);
+				// console.log(e.baoliu4);
+				// if (e.baoliu4 == '' || e.baoliu4 == null) {
+				// 	if (e.baoliu3 == '' || e.baoliu3 == null) {
+				// 		this.gao = 0
+				// 	} else {
+				// 		this.gao = (parseFloat(e.height) - parseFloat(e.baoliu3)).toFixed(2)
+				// 	}
+
+				// } else {
+				// 	this.gao = (parseFloat(e.height) - parseFloat(e.baoliu4)).toFixed(2)
+				// }
+				// return this.gao
+
+				// if (e.baoliu2.split(";")[1] == 0) {
+				// 	if (e.baoliu4 == '' || e.baoliu4==null) {
+				// 		this.gao = 0
+				// 	} else{
+				// 		this.gao = (parseFloat(e.height) -parseFloat(e.baoliu4)).toFixed(2)
+				// 	}
+				// }else{
+				// 	console.log(111111);
+				// 	if (e.baoliu3) {
+
+				// 	} else{
+
+				// 	}
+				// }
+				// console.log(e.baoliu2);
+				// console.log(e.baoliu2.split(";")[1]);
+				if (e.baoliu2.split(";")[1] == '-1') {
+					if (e.baoliu4 == '' || e.baoliu4 == null) {
+						// if (e.baoliu3 == '' || e.baoliu3 == null) {
+						this.gao = 0
+						// } else {
+						// 	this.gao = (parseFloat(e.height) - parseFloat(e.baoliu3)).toFixed(2)
+						// }
+
+					} else {
+						console.log(111111);
+						this.gao = (parseFloat(e.height) - parseFloat(e.baoliu4)).toFixed(2)
+					}
+				} else {
+					this.gao = parseFloat(e.baoliu3).toFixed(2)
+					// if (e.baoliu3 == '' || e.baoliu3 == null) {
+					// 	this.gao = 0
+					// } else {
+					// 	this.gao = (parseFloat(e.height) - parseFloat(e.baoliu3)).toFixed(2)
+					// }
+
+
+				}
 				return this.gao
-				console.log(this.gao);
-				// setTimeout(() => {
-				// 	this.jisuan()
-				// }, 1000)
+
 			},
 			getGpsStatusText(status) {
-				console.log(status);
 				switch (status) {
 					case '4':
 						return '楂樼簿搴�';
@@ -178,7 +404,8 @@
 	}
 
 	.link-box {
-		width: 100%;
+		width: 90%;
+		margin-left: 10%;
 		background-color: #fff;
 		border-radius: 8px;
 		padding: 10px 0;

--
Gitblit v1.9.3