From 23a788bd7cc50fb82e61117a58778f9e2928f9b5 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Fri, 10 May 2024 14:24:23 +0800
Subject: [PATCH] bug修復

---
 subPackage/school/clockIn.vue  |    1 
 subPackage/school/security.vue |  123 +++++++++++++++++++++-------------------
 2 files changed, 65 insertions(+), 59 deletions(-)

diff --git a/subPackage/school/clockIn.vue b/subPackage/school/clockIn.vue
index f7f8847..f3c4557 100644
--- a/subPackage/school/clockIn.vue
+++ b/subPackage/school/clockIn.vue
@@ -238,6 +238,7 @@
 
 			onScan() {
 				uni.scanCode({
+					onlyFromCamera: true,
 					success: (res) => {
 						let obj = this.getUrlParams(res.result);
 						this.getHouseType(obj.stdId);
diff --git a/subPackage/school/security.vue b/subPackage/school/security.vue
index 67c0998..a1340da 100644
--- a/subPackage/school/security.vue
+++ b/subPackage/school/security.vue
@@ -1,8 +1,16 @@
 <template>
 	<view class="wrap">
 
+		<view class="top item flex j-c-s-b a-i-c bgc-ff" @click="onScan()" v-if="roleName =='mj'">
+			<view class="flex a-i-c">
+				<u-icon name="/static/icon/nav-05.png" width="90rpx" height="90rpx"></u-icon>
+				<text class="f-28 ml-10">扫码获取信息</text>
+			</view>
+			<u-icon name="arrow-right" size="20"></u-icon>
+		</view>
+
 		<view class="info-row flex j-c-s-b a-i-c bgc-ff" @click="isShowPopup = true" v-if="!from">
-			<text class="f-28">场所名称</text>
+			<text class="f-28">校园名称</text>
 			<view class="flex">
 				<text class="mr-10">{{selectedPlace.placeName}}</text>
 				<u-icon name="arrow-right"></u-icon>
@@ -15,7 +23,7 @@
 					<u-form :model="info" ref="form">
 						<block v-for="(i,k) in item.children">
 							<view class="f-30 c-33">
-								{{i.title}}
+								<text style="color: red; padding-right: 5rpx;">* </text> {{i.title}}
 							</view>
 							<u-form-item labelWidth="90" prop="gateStatus">
 								<view class="btn-group flex">
@@ -29,24 +37,7 @@
 									</view>
 								</view>
 							</u-form-item>
-							<!-- <view class="" v-if="i.state == 0">
-								<u-form-item labelWidth="100" label="照片" prop="gateStatus">
-									<u-upload :fileList="i.urls" :previewFullImage="uploadConfig.previewFullImage"
-										:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
-										:maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture"
-										@afterRead="afterReadImgs($event,i,index,k)"
-										@delete="deleteImages($event,index,k)">
-										<view class="upload-item upload-icon flex_base">
-											<u-icon name="/static/icon/upload.png" width="60rpx"
-												height="60rpx"></u-icon>
-										</view>
-									</u-upload>
-								</u-form-item>
-								<u-form-item labelWidth="100" label="描述" prop="gateStatus">
-									<u-textarea v-model="i.remark" placeholder="请输入描述"
-										placeholderClass="c-99 f-26"></u-textarea>
-								</u-form-item>
-							</view> -->
+
 						</block>
 					</u-form>
 				</u-collapse-item>
@@ -64,7 +55,7 @@
 					</view>
 				</view>
 				<view class="mt-20">
-					<view class="f-28 mb-20">整改文件</view>
+					<view class="f-28 mb-20"> <text style="color: red;">* </text> 整改文件</view>
 					<u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
 						:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
 						:maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg"
@@ -190,7 +181,8 @@
 				selectedPlace: {},
 				placeList: [],
 				placeName: "",
-				from: "" //页面进入来源
+				from: "", //页面进入来源
+				roleName: uni.getStorageSync("activeRole").roleAlias,
 			}
 		},
 		async onLoad(option) {
@@ -203,9 +195,6 @@
 				if (uni.getStorageSync("houseCode")) {
 					let houseCode = uni.getStorageSync("houseCode");
 					this.getHouseType(houseCode);
-				} else {
-					this.info.houseCode = "d8460d16ec5a40ccbfe64ba65d34159c7427";
-					this.info.placeName = "校学小学场所"
 				}
 			}
 			this.getPlaceList();
@@ -215,6 +204,55 @@
 		},
 
 		methods: {
+			onScan() {
+				uni.scanCode({
+					onlyFromCamera: true,
+					success: (res) => {
+						let obj = this.getUrlParams(res.result);
+						this.getHouseType(obj.stdId);
+					}
+				})
+			},
+			getUrlParams(url) {
+				let urlStr = url.split('?')[1]
+				let obj = {};
+				let paramsArr = urlStr.split('&')
+				for (let i = 0, len = paramsArr.length; i < len; i++) {
+					let arr = paramsArr[i].split('=')
+					obj[arr[0]] = arr[1];
+				}
+				return obj
+			},
+
+			getHouseType(code) {
+				getQrCodeDetail({
+					roleName: uni.getStorageSync("activeRole").roleName,
+					addressCode: code
+				}).then(res => {
+					let {
+						isJur,
+						doorplateType,
+						addressLevel
+					} = res.data;
+					if (isJur == 1) {
+						if (doorplateType == "中门牌" || doorplateType == "小门牌") {
+							this.info.houseCode = code;
+							this.info.placeName = res.data.aoiName;
+							this.selectedPlace.placeName = res.data.aoiName;
+							this.info.location = res.data.addressName;
+							this.info.lng = res.data.x;
+							this.info.lat = res.data.y;
+						}
+					} else {
+						uni.showModal({
+							title: "提示!",
+							content: "该区域不是您管辖范围",
+							showCancel: false
+						})
+					}
+
+				})
+			},
 			getPlaceList() {
 				getLocationRecord({
 					roleName: uni.getStorageSync('activeRole').roleName,
@@ -440,7 +478,7 @@
 
 
 				this.info.taskPlaceRecordVOList = this.getSelected()
-				if (this.dangerCount == 0) {
+				if (this.dangerCount > 0) {
 					this.info.status = 2;
 					if (!this.form.images.length) {
 						this.$showTips("请上传整改文件");
@@ -498,39 +536,6 @@
 				this.info.houseCode = item.houseCode;
 				this.isShowPopup = false;
 			},
-
-			getHouseType(code) {
-				getQrCodeDetail({
-					roleName: uni.getStorageSync("activeRole").roleName,
-					addressCode: code
-				}).then(res => {
-					let {
-						isJur,
-						doorplateType,
-						addressLevel
-					} = res.data;
-					if (isJur == 1) {
-						if (doorplateType == "中门牌" || doorplateType == "小门牌") {
-							if (res.data.labelCode == 160102 || res.data.labelCode == 160103) {
-								this.info.houseCode = code;
-								this.info.placeName = poi;
-								this.from = "jump"
-							} else {
-								this.$showTips("该场所不是校园类型");
-							}
-						}
-					} else {
-						uni.showModal({
-							title: "提示!",
-							content: "该区域不是您管辖范围",
-							showCancel: false
-						})
-					}
-
-				})
-			},
-
-
 		}
 	}
 </script>

--
Gitblit v1.9.3