liyangzheng пре 1 година
родитељ
комит
f483f8cf59
1 измењених фајлова са 54 додато и 11 уклоњено
  1. 54 11
      pagesA/fire/fire_station/people_fireStation/people_fireStation.vue

+ 54 - 11
pagesA/fire/fire_station/people_fireStation/people_fireStation.vue

@@ -11,6 +11,7 @@
 						<th>名字</th>
 						<th>电话</th>
 						<th>身份证号</th>
+						<th>职务</th>
 						<th>操作</th>
 					</tr>
 				</thead>
@@ -19,6 +20,7 @@
 						<td>{{ item.empName }}</td>
 						<td style="width: 150rpx;">{{ item.mobile }}</td>
 						<td style="width: 210rpx;">{{item.idcardno}}</td>
+						<td>{{getDuty(item.duty)}}</td>
 						<td class="aTd">
 							<button @click="delUser(item)" class="editBtn">删除</button>
 							<button @click="editUser(item)" class="editBtn">编辑</button>
@@ -211,15 +213,42 @@
 				// console.log(x.data.userInfo.id, 'xxx');
 			},
 			getAllFire() {
-				getfirepage({
-					pageNo: 1,
-					pageSize: 10,
-					microstationid: this.fireStationId
-				}).then(res => {
-					// console.log(res, '888');
-					this.tableList = res.data.list
+				let num = 0
+				if (this.$route.query.addId === '1') {
+					num = '1'
+					getfirepage({
+						pageNo: 1,
+						pageSize: 10,
+						microstationid: this.fireStationId,
+						duty: num
+					}).then(res => {
+						// console.log(res, '888');
+						this.tableList = res.data.list
+					})
+				} else if (this.$route.query.addId === '2') {
+					num = '2'
+					getfirepage({
+						pageNo: 1,
+						pageSize: 10,
+						microstationid: this.fireStationId,
+						duty: num
+					}).then(res => {
+						// console.log(res, '888');
+						this.tableList = res.data.list
+					})
+				} else {
+					num = '3'
+					getfirepage({
+						pageNo: 1,
+						pageSize: 10,
+						microstationid: this.fireStationId,
+						duty: num
+					}).then(res => {
+						// console.log(res, '888');
+						this.tableList = res.data.list
+					})
+				}
 
-				})
 			},
 			delUser(row) {
 				delFirePeople(row.id).then(res => {
@@ -305,11 +334,11 @@
 					this.userRules = true
 				}
 			},
-			phoneBlur(){
+			phoneBlur() {
 				const regex = /^1[3-9]\d{9}$/;
-				if(regex.test(this.membersList[0].phone)){
+				if (regex.test(this.membersList[0].phone)) {
 					this.phoneRules = false
-				}else{
+				} else {
 					this.phoneRules = true
 				}
 			}
@@ -334,7 +363,21 @@
 		onShow() {
 			this.getAllFire()
 			this.getbackid()
+		},
+		computed: {
+			getDuty() {
+				return (num) => {
+					if (num === '1') {
+						return '值班人';
+					} else if (num === '2') {
+						return '负责人';
+					} else {
+						return '普通人员';
+					}
+				};
+			}
 		}
+
 	}
 </script>