“yueshang” 1 жил өмнө
parent
commit
a1f5eaf9c7

+ 1 - 1
config.js

@@ -1,6 +1,6 @@
 // 应用全局配置
 module.exports = {
-	baseUrl: 'http://api-security.byants.com',
+	// baseUrl: 'http://api-security.byants.com',
 	// baseUrlImg:'http://security.byants.com/static/appimg',
 	baseUrl: 'https://byant.jujutong.cloud',
 	baseUrlImg: 'https://byant.jujutong.cloud/static/appimg',

+ 31 - 28
main.js

@@ -7,6 +7,9 @@ import {refreshToken} from "@/api/login";
 // import uView from 'uview-ui'
 import uView from '@/uni_modules/uview-ui'
 import $ from '@/pages/common/fun.js'
+import {
+	showConfirm,
+} from '@/utils/common'
 import {	
 	getRefreshToken,	
 	getExpiresTime,
@@ -29,34 +32,34 @@ const app = new Vue({
 })
 app.$mount()
 var rsing=0
-rs()
-let isrefresh=false
-function rs(){
-	const nowTime = new Date().getTime()
-	if (rsing==0 && nowTime > (getExpiresTime()-10*1000)&& !isrefresh) {
-		refreshToken({
-			refreshToken: getRefreshToken()
-		}).then((res) => {
-			setToken(res.data)
-			 isrefresh = true; // 设置标志变量为 true
-			rsing=0
-			setTimeout(function() {
-				isrefresh = false;
-			}, 11 * 1000)
-		}).catch(() => {
-			showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
-				if (res.confirm) {
-					uni.navigateTo({
-						url: '/pages/login'
-					})
-				}
-			})
-		})
-	}
-	 setTimeout(function(){
-		 rs()
-	 },1*1000)
-}
+// rs()
+// let isrefresh=false
+// function rs(){
+// 	const nowTime = new Date().getTime()
+// 	if (rsing==0 && nowTime > (getExpiresTime()-10*1000)&& !isrefresh) {
+// 		refreshToken({
+// 			refreshToken: getRefreshToken()
+// 		}).then((res) => {
+// 			setToken(res.data)
+// 			 isrefresh = true; // 设置标志变量为 true
+// 			rsing=0
+// 			setTimeout(function() {
+// 				isrefresh = false;
+// 			}, 11 * 1000)
+// 		}).catch(() => {
+// 			showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
+// 				if (res.confirm) {
+// 					uni.navigateTo({
+// 						url: '/pages/login'
+// 					})
+// 				}
+// 			})
+// 		})
+// 	}
+// 	 setTimeout(function(){
+// 		 rs()
+// 	 },1*1000)
+// }
 // 判断是否断网的函数
 function isOffline() {
   return !navigator.onLine;

+ 22 - 10
pagesA/fire/check_active/check_implement/check_implement.vue

@@ -423,6 +423,11 @@
 		methods: {
 			// ----隐患
 			checkboxConfirm2(index) {
+				this.choiceDanger.map(i => {
+					if (i.name == this.checkedListDanger[this.checkedListDanger.length - 1]) {
+						this.tableData[index].dengerType = i.value
+					}
+				});
 				this.tableData[index].description = this.checkedListDanger.toString()
 				if (this.tableData[index].description.startsWith(',')) {
 					this.tableData[index].description = this.tableData[index].description.slice(1);
@@ -481,6 +486,12 @@
 
 			},
 			checkboxConfirm3(index) {
+				this.choiceDanger.map(i => {
+					if (i.name == this.checkedPopupDanger[this.checkedPopupDanger.length - 1]) {
+						this.insTypeData[0].dengerType = i.value
+					}
+				});
+				console.log(this.insTypeData[0].dengerType,'this.insTypeData[0].dengerType');
 				this.description2 = this.checkedPopupDanger.toString()
 				if (this.description2.startsWith(',')) {
 					this.description2 = this.description2.slice(1);
@@ -940,23 +951,22 @@
 							// this.newInsTypeData = uni.getStorageSync('newInsTypeDatas')
 							this.tableData.map(i => {
 								if (i.id == this.checkTableDataId) {
-									i.hisFpdCreateReqVOList = [...i.hisFpdCreateReqVOList, ...
-										this.insTypeData
-									]
+									i.dengerType=this.insTypeData[0].dengerType
+									i.hisFpdCreateReqVOList = [...i.hisFpdCreateReqVOList, ...this.insTypeData]
 									i.hisFpdCreateReqVOList.map(k => {
 										k['broadId'] = that.formData.broadId
 										if (k.id == fpdId) {
 											k['dangerDescribe'] = this.description2
 											this.description2 = ''
 										}
-
 									})
 								}
 							})
 							this.insTypeData = []
 							this.insTypeData.map(k => {
 								k.attUrl = [],
-									k.loading = false
+									k.loading = false,
+									k.dengerType = ''
 							})
 							this.maShow = false
 
@@ -1000,7 +1010,7 @@
 			photoUpload(val, index) {
 				let pictures = [];
 				var that = this;
-					if (val.inspType != 'fpd') {
+				if (val.inspType != 'fpd') {
 					that.tableData[index].loading = true
 				} else {
 					that.insTypeData[index].loading = true
@@ -1050,8 +1060,9 @@
 														.loading) {
 														that.tableData[index]
 															.loading = false
-													} else if(that.insTypeData[index]
-															.loading){
+													} else if (that.insTypeData[
+															index]
+														.loading) {
 														that.insTypeData[index]
 															.loading = false
 													}
@@ -1093,8 +1104,9 @@
 														.loading) {
 														that.tableData[index]
 															.loading = false
-													} else if(that.insTypeData[index]
-															.loading){
+													} else if (that.insTypeData[
+															index]
+														.loading) {
 														that.insTypeData[index]
 															.loading = false
 													}

+ 27 - 13
pagesA/fire/check_inspection/check_inspection.vue

@@ -332,7 +332,7 @@
 				screenHeight: this.$screenHeight,
 				// ----扫码选择隐患
 				showPopupDanger: false,
-				dangerDict:getDictDatas(DICT_TYPE.DANGER_RESULT),
+				dangerDict: getDictDatas(DICT_TYPE.DANGER_RESULT),
 				choiceDanger: getDictDatas(DICT_TYPE.DANGER_TYPE),
 				checkedPopupDanger: [], //
 				// ----扫码选择隐患
@@ -345,7 +345,9 @@
 				erWeiMaShu: '', //二维码内容对象
 				tableData: [],
 				loading: false,
+				dengerType: 0,
 				saveImplement: {
+					dengerType: 0,
 					attUrl: [],
 					dangerDescribe: "", //隐患描述
 					fpdId: "",
@@ -453,9 +455,14 @@
 
 			},
 			checkboxConfirm3(index) {
+				this.choiceDanger.map(i => {
+					if (i.name == this.checkedPopupDanger[this.checkedPopupDanger.length - 1]) {
+						this.dengerType = i.value
+					}
+				});
 				this.dangerDescribe = this.checkedPopupDanger.toString()
 				if (this.dangerDescribe.startsWith(',')) {
-					this.dangerDescribe =this.dangerDescribe.slice(1);
+					this.dangerDescribe = this.dangerDescribe.slice(1);
 				}
 				this.showPopupDanger = false
 				this.$forceUpdate()
@@ -577,13 +584,13 @@
 				}).then(response => {
 					this.loading = false
 					this.tableData = [...this.tableData, ...response.data.list]
-					this.dangerDict.map(i=>{
-						this.tableData.map(k=>{
-							if(k?.handleResult==i.value){
-								k.handleResult=i.label
+					this.dangerDict.map(i => {
+						this.tableData.map(k => {
+							if (k?.handleResult == i.value) {
+								k.handleResult = i.label
 							}
 						})
-						
+
 					})
 					// this.tableData = response.data.list
 					this.total = response.data.total
@@ -663,14 +670,14 @@
 			descriptFpd() { //隐患描述点击确认
 				this.show5 = false
 				// this.handleResult = this.handleResult
-				this.handleMethod=this.handleResult
+				this.handleMethod = this.handleResult
 				if (this.manualPopup) {
 					// this.checkManualData[0].handleResult = this.handleResult
-					this.checkManualData[0].handleMethod= this.handleResult
-					this.checkManualData[0].handleResult=1
-					
+					this.checkManualData[0].handleMethod = this.handleResult
+					this.checkManualData[0].handleResult = 1
+
 				}
-				this.handleResult =1
+				this.handleResult = 1
 				this.checkPopupConfirm()
 
 				// this.maShow=false
@@ -683,6 +690,7 @@
 				}
 			},
 			checkPopupYinHuan() {
+				console.log(this.dengerType, 'this.dengerType');
 				this.handleMethod = "生成隐患" //生成隐患
 				// this.handleResult = "不正常"
 				this.handleResult = 2
@@ -834,6 +842,8 @@
 			checkPopupConfirm() { //弹出得到的那一条数据insTypeData的id    弹出保存
 				if (this.manualPopup) { //手动检查
 					this.saveImplement = this.checkManualData[0]
+					
+					this.saveImplement.dengerType = this.dengerType
 					this.saveImplement.hisResultCreateReqVOList = this.checkManualData[0].inspectSubDOList
 					this.saveImplement.dangerDescribe = this.dangerDescribe
 					this.saveImplement.handleTime = shijianc(new Date().getTime())
@@ -878,6 +888,7 @@
 						})
 						this.saveImplement = this.insTypeData
 						this.saveImplement.map(i => {
+							i.dengerType = this.dengerType
 							i.handleTime = shijianc(new Date().getTime())
 							i.inspectTime = shijianc(new Date().getTime())
 							i.orgId = this.formData.orgId
@@ -1095,6 +1106,7 @@
 	::v-deep .u-icon__icon {
 		margin-right: 0px !important;
 	}
+
 	.child {
 		margin: 20rpx 0 0 20rpx;
 		border-radius: 10rpx;
@@ -1250,11 +1262,13 @@
 		font-size: 16px;
 		padding: 25rpx 0;
 	}
-    .manual:last-child{
+
+	.manual:last-child {
 		font-size: 25px;
 		padding: 60rpx 0;
 		background-color: red;
 	}
+
 	.manual-hand {
 		margin-left: 30rpx;
 		display: flex;

+ 3 - 3
pagesA/fire/fire_device/add_device/add_device.vue

@@ -217,10 +217,10 @@
 				let pictures = [];
 				var that = this;
 				uni.chooseImage({
-					sourceType: ['camera'], //实现拍照
+					// sourceType: ['camera'], //实现拍照
 					count: 3,
 					sizeType: ['original', 'compressed'],
-					// sourceType: ['album','camera'], //打开系统相册
+					sourceType: ['album','camera'], //打开系统相册
 					success(res) {
 						that.loading = true
 						if (Array.isArray(res.tempFilePaths)) { //从相册选择有三张的情况
@@ -253,7 +253,7 @@
 														picname: ''
 													})
 
-													that.$forceUpdate();
+													// that.$forceUpdate();
 													// // 返回的url
 												},
 												fail: () => {

+ 17 - 3
pagesA/fire/fire_inspetItem/add-street/streetXfsssbpczl.vue

@@ -176,6 +176,11 @@
 							</u-form-item>
 						</view>
 					</picker>
+					<u-form-item label="填报描述:" prop="descr" class="beizhu">
+						<u-textarea v-model="formData.descr" placeholder="请输入内容" :disabled="isview" :maxlength="500"
+							height="150">
+						</u-textarea>
+					</u-form-item>
 					<view>
 						<view class="paizhao" style="color:#383838 !important">现场照片</view>
 						<view class="paizhao-posit" v-if="!isview">
@@ -239,6 +244,7 @@
 	export default {
 		data() {
 			return {
+				remark: '',
 				contentText: {
 					contentrefresh: '上传照片中',
 				},
@@ -267,7 +273,8 @@
 					zdmhssGhwh: '',
 					qtXz: '',
 					reporttime: '',
-					streetRepPicsDOList: []
+					streetRepPicsDOList: [],
+					descr:''
 				},
 				rules: {
 					szxhsXz: NumericRule(),
@@ -383,8 +390,7 @@
 						})
 					}
 
-				}).catch(err => {
-				})
+				}).catch(err => {})
 			}
 		}
 	}
@@ -473,4 +479,12 @@
 	.example {
 		overflow-y: auto;
 	}
+	.beizhu{
+		/deep/.u-form-item__body{
+			flex-direction: column !important;
+		}
+		/deep/.u-form-item__body__left__content__label{
+			margin-bottom: 10px
+		}
+	}
 </style>

+ 24 - 5
pagesA/fire/fpd_detection/add_detection/add_detection.vue

@@ -52,8 +52,13 @@
 				@close="showInspOption = false" @select="setInsp"></u-action-sheet> -->
 			<!-- ----隐患 -->
 			<u-popup :show="showInspOption" :round="10" @close="showInspOption=false">
-				<view style="width: 70vw;overflow-y: auto;margin-bottom: 80rpx;padding:10px">
-					<text class="text-xl">选择检测项目:</text>
+				<view style="width: 70vw;overflow-y: auto;margin-bottom: 80rpx;padding:0 10px">
+					<view style="position: sticky; top: 0; background-color: white;height:50px;padding-top: 10px;">
+						<text class="text-xl">选择检测项目:</text>
+						<text class="btn" @tap="onSelectAll">
+							{{selectAll?'取消全选':'全选'}}
+						</text>
+					</view>
 					<view class="person-forward" style="margin-top: 10px;">
 						<u-checkbox-group placement="column" v-model="checkArr" @change="checkboxChange2"
 							activeColor="#4CB2B6" iconSize="red">
@@ -105,6 +110,7 @@
 	export default {
 		data() {
 			return {
+				isCheckAll: false,
 				screenHeight: this.$screenHeight,
 				wheight: '',
 				showSex5: false, //所属单位
@@ -126,6 +132,7 @@
 				total: 0,
 				unitTime: false,
 				loading: false,
+				selectAll: false,
 				title: '生成隐患',
 				content: '确认将此检查项目生成为隐患',
 				// 自定义表单数据
@@ -245,6 +252,10 @@
 		},
 
 		methods: {
+			onSelectAll() {
+				this.selectAll = !this.selectAll;
+				this.checkArr = this.selectAll ? this.detinspectOptions.map(item => item.name) : [];
+			},
 			submit(ref) {
 				// console.log(this.formData, 'alertalertalert');
 				// if (!this.formData.orgName) {
@@ -349,7 +360,7 @@
 			},
 			//检测项目多选框选中
 			checkboxChange2(arr) { //勾选的事件
-				// console.log('arr', arr);
+				console.log('arr', arr);
 				this.checkArr = [...arr]
 
 			},
@@ -366,7 +377,7 @@
 				if (this.formData.detinspect) {
 					const nowArr = this.formData.detinspect.split(',')
 					this.checkArr = [...nowArr]
-				}else{
+				} else {
 					this.checkArr = []
 				}
 
@@ -620,7 +631,8 @@
 		background-color: #4cb2b6;
 	}
 
-	/deep/.u-action-sheet {
+	/deep/.u-action-sheet,
+	/deep/.u-transition {
 		overflow-y: auto;
 		height: 1000rpx;
 		background-color: #fff;
@@ -629,4 +641,11 @@
 	.example {
 		overflow-y: auto;
 	}
+	.btn{
+		color: #4CB2B6;
+		margin-left: 20px;
+		padding:10rpx 40rpx;
+		border: 1px solid #4CB2B6;
+		border-radius: 8rpx;
+	}
 </style>

+ 1 - 1
utils/common.js

@@ -100,7 +100,7 @@ export function delSure(delInterface, val, context) {
 			context.queryParams.pageNo = 1;
 			context.list = []
 			context.getData()
-			this.$forceUpdate()
+			context.$forceUpdate()
 		}
 	});
 }

+ 55 - 55
utils/request.js

@@ -58,51 +58,51 @@ const request = config => {
 				const msg = errorCode[code] || res.data.msg || errorCode['default']
 				if (code === 401) {
 					//token无效或已过期
-					// if (!isRefreshing) {
-					// 	// 是否已经执行刷新
-					// 	isRefreshing = true
-					// 	let token = getAccessToken(); // 获取到过期的token
-					// 	try {
-					// 		refreshToken({
-					// 			refreshToken: getRefreshToken() // 刷新token的令牌存在token的对象里面,需要传给后端
-					// 		}).then(reshRespore => {
-					// 			// console.log(reshRespore,
-					// 			// 	'reshResporereshResporereshRespore');
-					// 			// 请求成功把新的token存到本地
-					// 			setToken(reshRespore.data);
-					// 			// 已经刷新了token,将所有队列中的请求进行重试
-					// 			requests.forEach((item) => item(reshRespore.data
-					// 				.accessToken))
-					// 			// requests = []
-					// 			// // 每个接口请求都要存入队列,等刷新完以后都需要执行
-					// 			// return new Promise((resolve) => {
-					// 			// 	// 将resolve放进队列,用一个函数形式来保存,等token刷新后直接执行
-					// 			// 	requests.push((token) => {
-					// 			// 		//这一步一定要有,刷新token,因为存入的信息是旧的token
-					// 			// 		response.config.header[
-					// 			// 				'Authorization'] =
-					// 			// 			'Bearer ' + token;
-					// 			// 		resolve(uni.$u.http.request(response
-					// 			// 			.config)) //执行请求
+					if (!isRefreshing) {
+						// 是否已经执行刷新
+						isRefreshing = true
+						let token = getAccessToken(); // 获取到过期的token
+						try {
+							refreshToken({
+								refreshToken: getRefreshToken() // 刷新token的令牌存在token的对象里面,需要传给后端
+							}).then(reshRespore => {
+								// console.log(reshRespore,
+								// 	'reshResporereshResporereshRespore');
+								// 请求成功把新的token存到本地
+								setToken(reshRespore.data);
+								// 已经刷新了token,将所有队列中的请求进行重试
+								requests.forEach((item) => item(reshRespore.data
+									.accessToken))
+								// requests = []
+								// // 每个接口请求都要存入队列,等刷新完以后都需要执行
+								// return new Promise((resolve) => {
+								// 	// 将resolve放进队列,用一个函数形式来保存,等token刷新后直接执行
+								// 	requests.push((token) => {
+								// 		//这一步一定要有,刷新token,因为存入的信息是旧的token
+								// 		response.config.header[
+								// 				'Authorization'] =
+								// 			'Bearer ' + token;
+								// 		resolve(uni.$u.http.request(response
+								// 			.config)) //执行请求
 
-					// 			// 	})
-					// 			// that.$forceUpdate()
-					// 			// })
-					// 			requests = []
-					// 			// 刷新完token后重新调用上一次的接口
-					// 			resolve(uni.$u.http.request(config)) // 执行请求
-					// 			if (reshRespore.code == 400) {
-					// 				showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
-					// 					if (res.confirm) {
-					// 						uni.navigateTo({
-					// 							url: '/pages/login'
-					// 						})
-					// 					}
-					// 				});
-					// 			}
-					// 		})
-
-					// 	} catch {
+								// 	})
+								// that.$forceUpdate()
+								// })
+								requests = []
+								// 刷新完token后重新调用上一次的接口
+								resolve(uni.$u.http.request(config)) // 执行请求
+								if (reshRespore.code == 400||reshRespore.code == 500) {
+									showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
+										if (res.confirm) {
+											uni.navigateTo({
+												url: '/pages/login'
+											})
+										}
+									});
+								}
+							})
+                           
+						} catch {
 							// 		uni.$u.toast('未知错误')
 							showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
 								if (res.confirm) {
@@ -111,17 +111,17 @@ const request = config => {
 									})
 								}
 							});
-					// 	} finally {
-					// 		// 请求成功,开启刷新标识
-					// 		isRefreshing = false
-					// 	}
-					// } else {
-					// 	// 添加到请求队列中
-					// 	requests.push(token => {
-					// 		config.header['Authorization'] = 'Bearer ' + token;
-					// 		resolve(uni.$u.http.request(config)) // 执行请求
-					// 	})
-					// }
+						} finally {
+							// 请求成功,开启刷新标识
+							isRefreshing = false
+						}
+					} else {
+						// 添加到请求队列中
+						requests.push(token => {
+							config.header['Authorization'] = 'Bearer ' + token;
+							resolve(uni.$u.http.request(config)) // 执行请求
+						})
+					}
 				} else if (code === 500) {
 					toast(msg)
 					reject('500')