“yueshang” 2 жил өмнө
parent
commit
c95647001e

+ 26 - 27
main.js

@@ -33,33 +33,32 @@ var rsing=0
 rs()
 let isrefresh=false
 function rs(){
-	const nowTime = new Date().getTime()
-	if (rsing==0 && nowTime > (getExpiresTime()-10*1000)&& !isrefresh) {
-		console.log("===rs call",)
-		refreshToken({
-			refreshToken: getRefreshToken()
-		}).then((res) => {
-			console.log(res.data, 'ressss')
-			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)
+	// const nowTime = new Date().getTime()
+	// if (rsing==0 && nowTime > (getExpiresTime()-10*1000)&& !isrefresh) {
+	// 	console.log("===rs call",)
+	// 	refreshToken({
+	// 		refreshToken: getRefreshToken()
+	// 	}).then((res) => {
+	// 		console.log(res.data, 'ressss')
+	// 		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)
 }
 // #ifdef H5
 Vue.mixin({

+ 4 - 4
pages/index.vue

@@ -144,8 +144,8 @@
 			<!-- 图表-->
 			<view class="charts-box">
 				<!-- 注意:这里的opts是uCharts的配置,eopts是ECharts的配置,不要搞混,如果不需要用在各种小程序端,是不需要传uCharts的opts的,只需要传eopts即可!!!这里加opts是为了覆盖uCharts的rose图的默认图例配置的位置 -->
-				<qiun-data-charts type="column" :eopts="opts" :opts="opts" :chartData="chartsDataLine3"  v-if="chartsDataLine3.series[0].itemStyle.normal.color=='#D2D8E2'"
-					:echartsH5="true" :echartsApp="true" />
+			<!-- 	<qiun-data-charts type="column" :eopts="opts" :opts="opts" :chartData="chartsDataLine3"  v-if="chartsDataLine3.series[0].itemStyle.normal.color=='#D2D8E2'"
+					:echartsH5="true" :echartsApp="true" /> -->
 			</view>
 
 		</view>
@@ -391,8 +391,8 @@
 					this.LoadingModel = false;
 					this.$modal.isLoadingModel(this.LoadingModel);
 					// 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
-					this.tableData = [...this.tableData, ...response.data.list];
-					if (this.tableData.length != []) {
+					this.tableData = response.data??[...this.tableData, ...response.data.list];
+					if (this.tableData&&this.tableData.length>0) {
 						this.arrtongzhi = this.tableData.filter(i => i.type == 1);
 						this.arrgonggao = this.tableData.filter(i => i.type == 2);
 					}

+ 11 - 8
pages/mine/instruct/instruct.vue

@@ -1,15 +1,18 @@
 <template>
 	<view>
-		<view class="">
+		<view class="" style="margin-left: 50rpx;margin-bottom: 30px;">
 			操作文档说明:
 		</view>
-		<!-- #ifdef MP-WEIXIN -->
-		<text style="color:#00a3f4;cursor: pointer;margin-left: 50rpx !important;"
-			@click.native="viewSee('')">点击预览文件</text>
-		<!-- #endif -->
-		<!-- #ifdef H5 -->
-		<a style="color:#00a3f4;cursor: pointer;margin-left: 50rpx !important;" @click="viewSee('')">点击预览文件</a>
-		<!-- #endif -->
+		<view class="" style="margin-left: 50rpx">
+			<!-- #ifdef MP-WEIXIN -->
+			<text style="color:#00a3f4;cursor: pointer;"
+				@click.native="viewSee('')">点击预览文件</text>
+			<!-- #endif -->
+			<!-- #ifdef H5 -->
+			<a style="color:#00a3f4;cursor: pointer;margin-left: 50rpx !important;" @click="viewSee('')">点击预览文件</a>
+			<!-- #endif -->
+		</view>
+		
 	</view>
 </template>
 

+ 2 - 1
pagesA/fire/check_active/check_implement/check_implement.vue

@@ -998,13 +998,14 @@
 			photoUpload(val,index) {
 				let pictures = [];
 				var that = this;
+				that.tableData[index].loading=true
+				this.$forceUpdate()
 				uni.chooseImage({
 					sourceType: ['camera'], //实现拍照
 					count: 3,
 					sizeType: ['original', 'compressed'],
 					// sourceType: ['album','camera'], //打开系统相册
 					success(res) {
-						that.tableData[index].loading=true
 						// that.loading = true
 						if (Array.isArray(res.tempFilePaths)) { //从相册选择有三张的情况
 							// if (res.tempFilePaths.length === 3) {

+ 27 - 16
pagesA/fire/fire_station/add_fireStation/add_fireStation.vue

@@ -35,9 +35,9 @@
 					<u-form-item label="报警电话">
 						<u-input v-model="formData.alarmTel" placeholder="请输入报警电话	" />
 					</u-form-item>
-					<u-form-item label="负责人">
-						<u-input v-model="formData.charger" placeholder="请输入负责人" />
-						<button @click="goBigNum" class="manyBtn">添加负责人</button>
+					<u-form-item label="站长">
+						<u-input v-model="formData.charger" placeholder="请输入站长人数" />
+						<button @click="goBigNum" class="manyBtn">添加站长</button>
 					</u-form-item>
 
 					<u-form-item label="人员信息" prop="members">
@@ -188,17 +188,28 @@
 			empList = JSON.parse(empList)
 			console.log(empList,'emplddddddd');
 			if(empList&&empList.length!=0){
-				let pack = {
-					duty: empList[0].power,
-					empName: empList[0].name,
-					mobile: empList[0].phone,
-					idcardno: empList[0].userNum
-				}
-				this.newEmpList = pack
+				empList.map(i=>{
+					i.duty=i.power
+					i.empName=i.name
+					i.mobile=i.phone
+					i.idcardno=i.userNum
+					delete i.power
+					delete i.name
+					delete i.phone
+					delete i.userNum
+				})
+				// let pack = {
+				// 	duty: empList[0].power,
+				// 	empName: empList[0].name,
+				// 	mobile: empList[0].phone,
+				// 	idcardno: empList[0].userNum
+				// }
+				this.newEmpList = empList
 			}
 		},
 		methods: {
 			submit(ref) {
+				console.log(this.$refs[ref],'this.$refs[ref]');
 				this.$refs[ref]
 					.validate()
 					.then(res => {
@@ -208,7 +219,7 @@
 							this.formData.builtOn = this.formData.builtOn
 						}
 						if (this.newEmpList) {
-							this.formData.empList = [this.newEmpList]
+							this.formData.empList = this.newEmpList
 						}
 						var jsdata = JSON.stringify(this.formData);
 						createStation(jsdata).then(response => {
@@ -220,7 +231,7 @@
 								// console.log('新增成功!');
 								uni.hideLoading();
 								uni.navigateBack({
-									delta: 1
+									delta: 2
 								})
 							}, 0);
 						});
@@ -286,19 +297,19 @@
 			// 值班
 			goWorkNum() {
 				uni.navigateTo({
-					url: "/pagesA/fire/fire_station/people_fireStation/people_fireStation"
+					url: `/pagesA/fire/fire_station/people_fireStation/people_fireStation?type=1`
 				})
 			},
-			// 负责人
+			// 站长
 			goBigNum() {
 				uni.navigateTo({
-					url: "/pagesA/fire/fire_station/people_fireStation/people_fireStation"
+					url: `/pagesA/fire/fire_station/people_fireStation/people_fireStation?type=2`
 				})
 			},
 			// 普通人
 			goPeopleMes() {
 				uni.navigateTo({
-					url: "/pagesA/fire/fire_station/people_fireStation/people_fireStation"
+					url: `/pagesA/fire/fire_station/people_fireStation/people_fireStation?type=0`
 				})
 			}
 		}

+ 6 - 6
pagesA/fire/fire_station/edit_fireStation/edit_fireStation.vue

@@ -35,9 +35,9 @@
 					<u-form-item label="报警电话">
 						<u-input v-model="formData.alarmTel" placeholder="请输入报警电话	" />
 					</u-form-item>
-					<u-form-item style="width: 700rpx;" label="负责人">
-						<u-input v-model="formData.charger" placeholder="请输入负责人" />
-						<button @click="goBigNum" class="manyBtn">添加负责人</button>
+					<u-form-item style="width: 700rpx;" label="站长">
+						<u-input v-model="formData.charger" placeholder="请输入站长人数" />
+						<button @click="goBigNum" class="manyBtn">添加站长</button>
 					</u-form-item>
 					
 					<u-form-item style="width: 700rpx;" label="人员信息" prop="members">
@@ -274,19 +274,19 @@
 			// 值班
 			goWorkNum(){
 				uni.navigateTo({
-					url:"/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=1"
+					url:`/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=1`
 				})
 			},
 			// 负责人
 			goBigNum(){
 				uni.navigateTo({
-					url:"/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=2"
+					url:`/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=2`
 				})
 			},
 			// 普通人
 			goPeopleMes(){
 				uni.navigateTo({
-					url:"/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=0"
+					url:`/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=0`
 				})
 			}
 		}

+ 1 - 1
pagesA/fire/fire_station/index.vue

@@ -347,7 +347,7 @@
 		padding-bottom: 30rpx;
 		// margin-top: 50rpx;
 		color: #fff;
-		font-size: 30rpx;
+		font-size: 20rpx;
 
 		.detail {
 			width: 120rpx;

+ 110 - 55
pagesA/fire/fire_station/people_fireStation/people_fireStation.vue

@@ -16,9 +16,9 @@
 								<text>职务:{{getDuty(item.empType)}}</text>
 							</view>
 							<view style="display: flex;justify-content: space-around;align-items: center;">
-								<button @click="delUser(item)" class="editBtn"
-									style="background-color: red;">删除</button>
-								<button @click="editUser(item)" class="editBtn">编辑</button>
+								<button @click="delUser(item)" class="editBtn" style="background-color: red;"
+									v-if="addIds">删除</button>
+								<button @click="editUser(item)" class="editBtn" v-if="addIds">编辑</button>
 							</view>
 						</view>
 					</uni-card>
@@ -155,7 +155,7 @@
 				],
 				range1: [{
 						value: '2',
-						text: "负责人"
+						text: "站长"
 					},
 					{
 						value: '1',
@@ -186,6 +186,9 @@
 				delId: '',
 				show123: false,
 				selectType: [], //选项
+				addIds: '',
+				empList: null,
+				type: ''
 			}
 		},
 		methods: {
@@ -204,7 +207,7 @@
 				})
 			},
 			addNewPeople() {
-				if (this.$route.query.addId) {
+				if (this.addIds) {
 					const MAX_LENGTH = 1; // 假设你想限制数组最大长度为6
 					if (this.membersList.length < MAX_LENGTH) {
 						const newPerson = {
@@ -230,39 +233,14 @@
 							}
 						});
 					}
-				}else{
-					const MAX_LENGTH = 1; // 假设你想限制数组最大长度为6
-					if (this.membersList.length < MAX_LENGTH) {
-						const newPerson = {
-							name: '',
-							userNum: '',
-							phone: '',
-							worker: '',
-							// 其他字段
-						};
-						this.membersList.push(newPerson);
-					} else {
-						// 达到最大数量,给出提示或执行其他操作
-						uni.showToast({
-							title: '超出限制',
-							icon: 'none', // 图标类型,可选值:'success', 'loading', 'none'
-							duration: 2000, // 持续时间,单位为毫秒,默认值为 1500
-							mask: false, // 是否显示透明蒙层,防止触摸穿透,默认值为 false
-							success() {
-								// console.log('toast消息提示显示成功');
-							},
-							fail(err) {
-								// console.error('toast消息提示显示失败', err);
-							}
-						});
-					}
 				}
 			},
 
 			addSure() {
-				console.log(this.$route.query.addId, 'this.$route.query.addId');
-				if (this.$route.query.addId) {
+				if (this.addIds) {
+
 					if (!this.userRules && !this.phoneRules && !this.nameRules) {
+						// console.log(this.membersList[0].worker,'988');
 						creatFirePeople({
 							empName: this.membersList[0].name,
 							empType: this.membersList[0].worker,
@@ -284,7 +262,13 @@
 										// console.error('toast消息提示显示失败', err);
 									}
 								});
-								this.membersList = []
+								this.membersList = [{
+									name: '',
+									userNum: '',
+									phone: '',
+									worker: '',
+								}]
+
 							}
 						})
 					} else {
@@ -300,23 +284,38 @@
 								// console.error('toast消息提示显示失败', err);
 							}
 						});
+
 					}
 				} else {
-					// let ground = localStorage.getItem('empList')
-					// if (ground) {
-					// 	ground = JSON.parse(ground)
-					// 	ground.push({
-					// 		...this.membersList[0]
-					// 	})
+					let ground = []
+					if (localStorage.getItem('empList')) {
+						this.empList = JSON.parse(localStorage.getItem('empList'))
+
+					}
+					if (this.empList != null) {
+						ground = [...this.empList, ...this.membersList]
+						this.tableList = [...ground]
+					} else {
+						this.tableList = [...this.membersList]
+					}
+					this.tableList.map(i => {
+						i.empName = i.name
+						i.mobile = i.phone
+						i.idcardno = i.userNum
+						i.empType = i.power
+					})
 					// 	localStorage.setItem('empList', JSON.stringify(ground))
 					// } else {
 					// 	localStorage.setItem("empList", JSON.stringify(this.membersList))
 					// }
-					localStorage.setItem("empList", JSON.stringify(this.membersList))
+					localStorage.setItem("empList", JSON.stringify(this.tableList))
 					uni.navigateBack({
 						delta: 1
 					})
 				}
+				this.nameRules = false //对name的正则验证
+				this.userRules = false //对身份证的正则验证
+				this.phoneRules = false
 			},
 			change(e) {
 				this.membersList[0].worker = e
@@ -339,7 +338,7 @@
 			},
 			getAllFire() {
 				let num = 0
-				if (this.$route.query.addId === '1') {
+				if (this.addIds === '1') {
 					num = '1'
 					getfirepage({
 						pageNo: 1,
@@ -350,7 +349,7 @@
 						// console.log(res, '888');
 						this.tableList = res.data.list
 					})
-				} else if (this.$route.query.addId === '2') {
+				} else if (this.addIds === '2') {
 					num = '2'
 					getfirepage({
 						pageNo: 1,
@@ -361,7 +360,7 @@
 						// console.log(res, '888');
 						this.tableList = res.data.list
 					})
-				} else if (this.$route.query.addId === '0') {
+				} else if (this.addIds === '0') {
 					num = '0'
 					getfirepage({
 						pageNo: 1,
@@ -376,8 +375,8 @@
 
 			},
 			delUser(row) {
-				this.show123 = true
 				this.delId = row.id
+				this.show123 = true
 			},
 			makeSureDel() {
 
@@ -429,7 +428,7 @@
 			},
 			makeSureEdit() {
 				editFirePeople({
-					duty: this.formbox.fpower,
+					empType: this.formbox.fpower,
 					empName: this.formbox.fname,
 					// empType: this.formbox.fworker,
 					id: this.editPeopleId,
@@ -505,15 +504,17 @@
 			if (ids) {
 				this.fireStationId = ids
 			}
+			this.addIds = options.addId ? options.addId : ''
+			this.type = options.type ? options.type : ''
 		},
 		onShow() {
 			this.getTypePeople()
 			this.getGround()
-			if (this.$route.query.addId) {
+			if (this.addIds) {
 				this.getAllFire()
 				this.getbackid()
 				// console.log(options, 'options')
-				this.resultId = this.$route.query.addId
+				this.resultId = this.addIds
 				if (this.resultId === '2') {
 					this.tomole = '添加负责人'
 				} else if (this.resultId === '1') {
@@ -524,9 +525,61 @@
 
 				// console.log(this.$route.query, 'query'); // 输出传递的参数值
 			} else {
+				if (localStorage.getItem('empList')) {
+					const lists = JSON.parse(localStorage.getItem('empList'))
+					switch (this.type) {
+						case "0":
+							lists.map(i => {
+								if (i.empType == "0") {
+									this.tableList.push(i)
+								}
+							})
+							console.log(this.tableList,'this.tableList')
+							break;
+						case "1":
+							lists.map(i => {
+								if (i.empType == "1") {
+									this.tableList.push(i)
+								}
+							})
+							console.log(this.tableList,'this.tableList')
+							break;
+						case "2":
+							lists.map(i => {
+								if (i.empType =="2") {
+									this.tableList.push(i)
+								}
+							})
+							console.log(this.tableList,'this.tableList')
+							break;
+						default:
+							break;
+					}
+					this.tableList.map(i => {
+						i.empName = i.name
+						i.mobile = i.phone
+						i.idcardno = i.userNum
+						i.empType = i.power
+					})
+
+				}
+
+				this.membersList = [{
+					name: '',
+					userNum: '',
+					phone: '',
+					worker: '',
+					// 其他字段
+				}]
 				return
 			}
-
+			this.membersList = [{
+				name: '',
+				userNum: '',
+				phone: '',
+				worker: '',
+				// 其他字段
+			}]
 		},
 		computed: {
 			getDuty() {
@@ -617,18 +670,22 @@
 	.modalBox {
 		width: 700rpx;
 		height: 750rpx;
+
 		/deep/.uni-select {
 			width: 100%;
 			height: 50px;
 			border: 1px solid #4DB1B6;
 		}
-		/deep/ .u-line{
-			border:none !important;
+
+		/deep/ .u-line {
+			border: none !important;
 		}
-		/deep/ .uni-input-input{
+
+		/deep/ .uni-input-input {
 			padding: 0 10rpx;
 		}
-		/deep/ .u-form-item__body{
+
+		/deep/ .u-form-item__body {
 			width: 90%;
 		}
 	}
@@ -678,6 +735,4 @@
 	/deep/.u-button--primary {
 		border: none
 	}
-
-
 </style>

+ 122 - 19
pagesA/fire/metting_regsiter/metting_sigin.vue

@@ -52,6 +52,16 @@
 						<!-- <uni-data-select v-model="person.power" :localdata="range" @change="change"></uni-data-select> -->
 						<u-input v-model="person.power" :placeholder="'请输入职务'" />
 					</u-form-item>
+					<u-form-item class="typeStyle">
+						<p style="width: 150rpx;margin-left: 20rpx;">上传附件</p>
+						<!-- 选择文件上传,limit="1则最多选择一张图片,del-icon隐藏删除按钮 -->
+						<uni-file-picker v-model="person.attId" del-icon limit="1" auto-upload file-mediatype="all"
+							@select="selectFile" @delete="deleteFile">
+							<button type="primary" class="selectBtn">选择文件</button>
+							<!-- 加载中 -->
+							<isLodingModel v-if="loading"></isLodingModel>
+						</uni-file-picker>
+					</u-form-item>
 					<u-form-item class="antherStyle">
 						<button class="useBtn" @click="sureAdd">确认新增</button>
 						<button class="useBtn" @click="noAdd">取消</button>
@@ -61,22 +71,45 @@
 			<div>
 				<u-popup :show="showModal" mode="center" @close="closeModal" class="popup-box">
 					<view class="modalBox">
-						<u--form labelPosition="left" :model="modalList" ref="uForm">
-							<u-form-item style="width: 500rpx;" prop="modalList.name" borderBottom ref="item1">
+						<u--form labelPosition="left" :model="formData" ref="uForm">
+							<u-form-item style="width: 500rpx;" prop="formData.name" borderBottom ref="item1">
 								<span style="width: 100rpx;">姓名</span>
-								<u--input class="modalInput" v-model="modalList.mname" border="none"></u--input>
+								<u--input class="modalInput" v-model="formData.mname" border="none"></u--input>
 							</u-form-item>
-							<u-form-item style="width: 500rpx;" prop="modalList.mphone" borderBottom ref="item2">
+							<u-form-item style="width: 500rpx;" prop="formData.mphone" borderBottom ref="item2">
 								<span style="width: 100rpx;">电话号</span>
-								<u--input class="modalInput" v-model="modalList.mphone" border="none"></u--input>
+								<u--input class="modalInput" v-model="formData.mphone" border="none"></u--input>
 							</u-form-item>
-							<u-form-item style="width: 500rpx;" prop="modalList.mpower" borderBottom ref="item3">
+							<u-form-item style="width: 500rpx;" prop="formData.mpower" borderBottom ref="item3">
 								<span style="width: 100rpx;">职务</span>
-								<u--input class="modalInput" v-model="modalList.mpower" border="none"></u--input>
+								<u--input class="modalInput" v-model="formData.mpower" border="none"></u--input>
+							</u-form-item>
+							<u-form-item class="typeStyle">
+								<p style="width: 150rpx;">上传附件</p>
+								<!-- 选择文件上传,limit="1则最多选择一张图片,del-icon隐藏删除按钮 -->
+								<uni-file-picker v-model="formData.attId" del-icon limit="1" auto-upload file-mediatype="all"
+									@select="selectFile" @delete="deleteFile">
+									<button type="primary" class="selectBtn">选择文件</button>
+									<!-- 加载中 -->
+									<isLodingModel v-if="loading"></isLodingModel>
+								</uni-file-picker>
 							</u-form-item>
-							<!-- 	<u-form-item style="width: 500rpx;" label="状态" prop="modalList.mstatus" borderBottom
+							<u-form-item v-if="formData.att">
+								<p style="width: 150rpx;">已上传附件:</p>
+								<u-icon name="close" color="#4CB2B6" size="20" @click="closeImage()">
+								</u-icon>
+								<!-- #ifdef MP-WEIXIN -->
+								<text style="color:#00a3f4;cursor: pointer;margin-left: 20px !important;"
+									@click.native="viewSee(formData.att)">下载附件</text>
+								<!-- #endif -->
+								<!-- #ifdef H5 -->
+								<a style="color:#00a3f4;cursor: pointer;margin-left: 20px !important;"
+									@click="viewSee(formData.att)">下载附件</a>
+								<!-- #endif -->
+							</u-form-item>
+							<!-- 	<u-form-item style="width: 500rpx;" label="状态" prop="formData.mstatus" borderBottom
 								ref="item4">
-								<u--input class="modalInput" v-model="modalList.mstatus" border="none"></u--input>
+								<u--input class="modalInput" v-model="formData.mstatus" border="none"></u--input>
 							</u-form-item> -->
 						</u--form>
 						<div style="display: flex;justify-content: space-around;align-items: center;margin-top: 20rpx;">
@@ -111,6 +144,10 @@
 	import {
 		getUserProfile,
 	} from "@/api/system/user"
+	import {
+		uploadFile,
+		downSee,
+	} from '@/utils/common.js';
 	export default {
 		data() {
 			return {
@@ -133,11 +170,13 @@
 				tableList: [], //已经报名参会的人员
 				editId: "", //需要修改人员的id
 				showModal: false, //修改的模态框
-				modalList: {
+				formData: {
 					mname: '',
 					mphone: "",
 					mpower: '',
 					mstatus: '',
+					attId:[],
+					att:''
 				},
 				nameRules: false,
 				userRules: false,
@@ -148,9 +187,49 @@
 				makeDelId: "",
 				show123: false,
 				ifMeet: true,
+				loading:false,
+			}
+		},
+		watch: {
+			loading: {
+				handler(newLength, oldLength) {
+					this.$modal.isLoadingModel(this.loading)
+				},
+				immediate: true
 			}
 		},
 		methods: {
+			closeImage() {
+				this.formData.attId = []
+				this.formData.att = ''
+				this.$forceUpdate()
+			},
+			//查看已上传附件
+			viewSee(val) {
+				downSee(val)
+			},
+			// 移出图片函数
+			async deleteFile(e) {
+				this.formData.attId = [];
+			},
+			selectFile(e) {
+				this.formData.attId = [];
+				this.formData.att=''
+				let promises = [];
+				for (let i = 0; i < e.tempFilePaths.length; i++) {
+					const promise = uploadFile(e.tempFilePaths, i, this);
+					promises.push(promise);
+				}
+				Promise.all(promises).then(result => {
+					// 处理上传文件成功的结果
+				}).catch(error => {
+					// 处理上传文件失败的错误
+				});
+			},
+			// 移出图片函数
+			async deleteFile(e) {
+				this.formData.attId = [];
+			},
 			open() {
 				// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
 				this.$refs.popup.open('center')
@@ -187,6 +266,8 @@
 						phone: '',
 						power: "",
 						status: "",
+						att: '',
+						attId: []
 					};
 					this.meetList.push(newPerson);
 				}
@@ -205,9 +286,15 @@
 			sureAdd() {
 				console.log(this.meetList[0], '123');
 				if (!this.userRules && !this.phoneRules && !this.nameRules) {
+					if (this.formData.attId && this.formData.attId.length > 0) {
+						this.formData.att = this.formData.attId[0];
+					} else {
+						this.formData.att = this.formData.att;
+					}
 					creatPeople({
 						meetingId: parseInt(this.meetId),
 						orgId: this.doorId,
+						att:this.formData.att,
 						ppDuty: this.meetList[0].power,
 						ppName: this.meetList[0].name,
 						ppTel: this.meetList[0].phone,
@@ -262,10 +349,11 @@
 				}).then(res => {
 					// console.log(res.data, 'data');
 					this.editId = res.data.id
-					this.modalList.mname = row.ppName
-					this.modalList.mphone = res.data.ppTel
-					this.modalList.mpower = res.data.ppDuty
-					this.modalList.mstatus = res.data.status
+					this.formData.mname = row.ppName
+					this.formData.mphone = res.data.ppTel
+					this.formData.mpower = res.data.ppDuty
+					this.formData.mstatus = res.data.status
+					this.formData.att= res.data.att
 					this.showModal = true
 				})
 			},
@@ -291,14 +379,20 @@
 				this.showModal = false
 			},
 			sureUpdate() {
+				if (this.formData.attId && this.formData.attId.length > 0) {
+					this.formData.att = this.formData.attId[0];
+				} else {
+					this.formData.att = this.formData.att;
+				}
 				editPeople({
+					att:this.formData.att,
 					id: this.editId,
 					meetingId: parseInt(this.meetId),
 					orgId: this.doorId,
-					ppDuty: this.modalList.mpower,
-					ppName: this.modalList.mname,
-					ppTel: this.modalList.mphone,
-					status: this.modalList.mstatus,
+					ppDuty: this.formData.mpower,
+					ppName: this.formData.mname,
+					ppTel: this.formData.mphone,
+					status: this.formData.mstatus,
 				}).then(res => {
 					console.log(res, 'update');
 					if (res.data) {
@@ -316,6 +410,7 @@
 								console.error('toast消息提示显示失败', err);
 							}
 						});
+						this.formData.attId = [];
 					}
 				})
 			},
@@ -424,7 +519,7 @@
 
 	.modalBox {
 		width: 600rpx;
-		height: 400rpx;
+		height: 630rpx;
 		margin-left: 60rpx;
 	}
 
@@ -432,6 +527,13 @@
 		color: #4DB1B6;
 	}
 
+	.selectBtn {
+		width: 200rpx;
+		margin-left: 0;
+		font-size: 30rpx;
+		background-color: #4cb2b6;
+	}
+
 	.useBox {
 		width: 90%;
 		height: auto;
@@ -500,6 +602,7 @@
 		/* width: 800rpx; */
 		/* height: auto; */
 		border: none;
+		margin-bottom: 130rpx;
 		/* margin: 10rpx auto; */
 	}
 

+ 6 - 0
pagesB/fire/fireSpecial/addSpecial/index.vue

@@ -34,6 +34,9 @@
 							</u-form-item>
 						</view>
 					</picker>
+					<u-form-item>
+						<a @click="redirectToBaidu" style="color: #00a3f4;margin-left: 10px;">前往技能人才评价证书全国联网查询</a>
+					</u-form-item>
 					<u-form-item label="附件">
 						<!-- 选择文件上传,limit="1则最多选择一张图片,del-icon隐藏删除按钮 -->
 						<uni-file-picker v-model="formData.attId" del-icon limit="1" auto-upload file-mediatype="all"
@@ -175,6 +178,9 @@
 			}
 		},
 		methods: {
+			redirectToBaidu() {
+				window.location.href = 'http://zscx.osta.org.cn/'
+			},
 			//查看已上传附件
 			viewSee(val) {
 				downSee(val)

+ 3 - 2
utils/common.js

@@ -320,8 +320,9 @@ export function uploadFile(tempFilePaths, i, that) {
 				let data = JSON.parse(res.data);
 				
 				// that.formData.attId.push(data.data)
-				that.formData.attId=['']
-				that.formData.attId[0] = data.data
+				console.log(that.formData,that.meetList,'ddddddddd');
+					that.formData.attId=['']
+					that.formData.attId[0] = data.data
 				uni.showToast({
 					title: '文件上传成功!'
 				});

+ 39 - 37
utils/request.js

@@ -15,14 +15,14 @@ import {
 	showConfirm,
 	tansParams
 } from '@/utils/common'
-
+var that=this
 let timeout = 10000
 const baseUrl = config.baseUrl + config.baseApi;
 // 请求队列
 let requests = []
 // 是否正在刷新中
 let isRefreshing = false
-const request = async (config) => {
+const request = config=> {
 	// 是否需要设置 token
 	const isToken = (config.headers || {}).isToken === false
 	config.header = config.header || {}
@@ -57,36 +57,38 @@ const request = async (config) => {
 				const code = res.data.code || 200
 				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)) //执行请求
-					// 				})
-					// 			})
-					// 		})
+					//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)) //执行请求
+											
+									})
+									// that.$forceUpdate()
+								})
+							})
 							
-					// 	} catch {
+						} catch {
 					// 		uni.$u.toast('未知错误')
 							showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
 								if (res.confirm) {
@@ -95,13 +97,13 @@ const request = async (config) => {
 									})
 								}
 							});
-					// 	} finally {
-					// 		// 请求成功,开启刷新标识
-					// 		isRefreshing = false
-					// 	}
-					// } else {
+						} finally {
+							// 请求成功,开启刷新标识
+							isRefreshing = false
+						}
+					} else {
 					
-					// }
+					}
 				} else if (code === 500) {
 					toast(msg)
 					reject('500')