Browse Source

修改特种作业人员

“yueshang” 1 year ago
parent
commit
bd050359bf
4 changed files with 450 additions and 8 deletions
  1. 43 0
      api/fireSpecial/index.js
  2. 7 0
      pages.json
  3. 1 0
      pagesA/fire/architecture/index.vue
  4. 399 8
      pagesB/fire/fireSpecial/index.vue

+ 43 - 0
api/fireSpecial/index.js

@@ -0,0 +1,43 @@
+import request from '@/utils/request'
+//  获取本单位下的人员信息 
+export function fireSpecialPage(data) {
+	return request({
+		url: '/admin-api/backend/fire-special/page',
+		method: 'get',
+		params: data
+	})
+}
+//  获取本单位下的人员信息 
+export function fireSpecialIdGet(data) {
+	return request({
+		url: '/admin-api/backend/fire-special/get',
+		method: 'get',
+		params: data
+	})
+}
+//  修改
+export function fireSpecialUpdate(data) {
+	return request({
+		url: '/admin-api/backend/fire-special/update',
+		method: 'post',
+		data: data
+	})
+}
+//  新增
+export function fireSpecialCreate(data) {
+	return request({
+			url: '/admin-api/backend/fire-special/create',
+			method: 'post',
+			data: data
+		}
+
+	)
+}
+//  删除
+export function fireSpecialDelete(data) {
+	return request({
+		url: '/admin-api/backend/fire-special/delete',
+		method: 'post',
+		data: data
+	})
+}

+ 7 - 0
pages.json

@@ -911,6 +911,13 @@
 				"navigationBarTitleText": "动火审批",
 				"enablePullDownRefresh": false
 			}
+		}, {
+			"path": "fire/fireSpecial/addSpecial/index",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
 		}]
 	}],
 	"tabBar": {

+ 1 - 0
pagesA/fire/architecture/index.vue

@@ -213,6 +213,7 @@
 					this.isLoaded = true
 					this.tableData = [...this.tableData, ...response.data]
 					this.loading = false
+					this.total=response.total
 					// this.tableData = response.data;
 				});
 			},

+ 399 - 8
pagesB/fire/fireSpecial/index.vue

@@ -1,22 +1,413 @@
 <template>
-	<view>
-		
+	<view class="uni-container uni-container-bg">
+		<view class="example container" :style="'height: ' + (screenHeight - 100) + 'px'">
+			<!-- 搜索框 -->
+			<uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
+				<uni-col :span="24">
+					<view class="u-page__tag-item">
+						<u-search placeholder="请输入人员姓名" bgColor="#edf6f9" borderColor="#4cb2b6" v-model="keyword"
+							:show-action="true" @custom="search"></u-search>
+					</view>
+				</uni-col>
+			</uni-row>
+			<!-- 下拉框 -->
+			<view class="u-page__tag-item"
+				style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;background-color: #f5f7fa;">
+				<u-form>
+					<u-form-item prop="orgName" @click="
+						showOrg = true;
+						hideKeyboard();
+					" label="单位选择:" labelWidth="100px">
+						<u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
+						<u-icon slot="right" name="arrow-down"></u-icon>
+					</u-form-item>
+				</u-form>
+			</view>
+			<!-- 卡片栏 -->
+			<view v-if="tableData.length>0 && isLoaded" style="margin-bottom: 120rpx">
+				<view v-for="(item, index) in tableData" :key="index"
+					v-if="formData.orgName === item.orgName || formData.orgId === item.orgId">
+					<uni-card>
+						<!-- 简要内容 -->
+						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+							<text class="name-align-drill">姓名:</text>
+							<text class="conts">{{ item.empName }}</text>
+						</view>
+						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+							<text class="name-align-drill">特种证书编号:</text>
+							<text class="conts">{{ item.numberCode }}</text>
+						</view>
+						<view style="margin-top: 60rpx;">
+							<!-- 删除按钮 -->
+							<view class="an-niu" @click.native="showModal(item)">
+								<view class="detailDel">删除</view>
+							</view>
+							<view class="an-niu" @click.native="onClick(item.id)" link><text class="detail">查看详情</text>
+									<view class="an-niu" @click.native="editClick(item.id)" link><text class="detail">编辑</text></view>
+							</view>
+						</view>
+					</uni-card>
+				</view>
+			</view>
+			<!-- tableData为空时显示  -->
+			<view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
+				<view class="text-gray" style="padding-top: 20px;">
+					<img :src="tan90" alt="暂无数据" />
+				</view>
+			</view>
+			<view>
+				<image :src="Group" @click="addClick" class="tiantupian"></image>
+			</view>
+			<u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false"
+				@select="sexSelect"></u-action-sheet>
+			<u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
+				showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
+			<!-- 加载中 -->
+			<!-- <isLodingModel></isLodingModel> -->
+		</view>
 	</view>
 </template>
-
 <script>
+	var that = '';
+	import {
+		getOrgId //获取orgId
+	} from '@/api/architecture';
+	import {
+		fireSpecialPage,
+		fireSpecialUpdate,
+		fireSpecialDelete
+	} from '@/api/fireSpecial';
+	import config from '@/config'
+	const baseUrlImg = config.baseUrlImg
 	export default {
 		data() {
 			return {
-				
+				screenHeight: this.$screenHeight,
+				wheight: '',
+				isLoaded: false,
+				Group: `${baseUrlImg}/checkActive/Group.png`,
+				showOrg: false,
+				actions: [],
+				// 数据
+				tableData: {},
+				title: '是否删除该数据项?',
+				content: '确认删除?',
+				id: '',
+				tan90: `${baseUrlImg}/tan90.png`,
+				// 每页数据量
+				pageSize: 5,
+				// 当前页
+				pageNo: 1,
+				// 数据总量
+				total: 0,
+				// tableData数据加载中
+				loading: false,
+				// 初始化时搜索框的值
+				keyword: '',
+				// 存放orgid,orgname
+				formData: {},
+				show: false,
+				showtimeStart: false,
+				showtimeEnd: false
+			};
+		},
+		// 在 vue页面,向起始页通过事件传递数据
+		onLoad: function(option) {
+
+			// this.init();
+		},
+		watch: {
+			loading: {
+				handler(newLength, oldLength) {
+					this.$modal.isLoadingModel(this.loading)
+				},
+				immediate: true
 			}
 		},
+		onShow() {
+			this.actions = []
+			that = this;
+			getOrgId({
+				pageNo: this.pageNo,
+				pageSize: this.pageSize,
+				userId: this.$store.state.user.id
+			}).then(response => {
+				console.log(response, 'response');
+				// 取到用户对应的单位名称与id
+				response.data.map(v => {
+					this.actions.push({
+						id: v.dwid,
+						name: v.orgName
+					});
+				});
+				console.log(response.data, '21321312');
+				this.formData.orgName = response.data[0].orgName ? response.data[0].orgName : '';
+				this.formData.orgId = response.data[0].dwid;
+				this.tableData = []
+				this.getData();
+			});
+
+		},
+		onReady() {},
+		mixins: [uni.$u.mixin],
 		methods: {
-			
+			search(val) {
+				console.log(val, 'valvals');
+				this.tableData = []
+				this.getData()
+			},
+			async init() {
+				var t = this;
+				t.$.getlocation()
+					.then(res => {
+						console.log(res, 'res');
+					})
+					.catch(err => {
+						console.log(err, 'err');
+					});
+			},
+			// 模态框内容
+			showModal(val) {
+				this.show = true;
+				this.id = val.id;
+			},
+			confirm() {
+				this.show = false;
+				fireSpecialDelete({
+					id: this.id
+				}).then(response => {
+					this.loading = true;
+					this.isLoaded = false
+					this.tableData = []
+					this.getData();
+					console.log(this.tableData, '获取建筑信息详细信息获取建筑信息详细信息获取建筑信息详细信息获取建筑信息详细信息');
+				});
+			},
+			close() {
+				this.show = false;
+				console.log('close');
+			},
+			cancel() {
+				this.show = false;
+				console.log('cancel');
+			},
+			//查看详情
+			addClickDetail(val) {
+				uni.navigateTo({
+					url: `/pagesA/fire/architecture/add_architecture/add_architecture?item=${JSON.stringify(val)}`
+				});
+			},
+			// 获取数据
+			getData() {
+				this.loading = true;
+				// 获取建筑信息详细信息
+				fireSpecialPage({
+					pageNo: this.pageNo,
+					pageSize: this.pageSize,
+					orgId: this.formData.orgId,	
+				}).then(response => {
+					console.log(response,'sdsdsd');
+					this.isLoaded = true
+					this.tableData = response.data?[...this.tableData, ...response.data]:[]
+					this.total=response.total
+					this.loading = false
+				});
+			},
+
+
+			// 传递数据
+			onClick(val) {
+				this.isLoaded = false
+				uni.navigateTo({
+					url: `/pagesB/fire/fireSpecial/addSpecial/index?title=查看特种作业人员&&viewData=${item}`
+				})
+			},
+			editClick(val) {
+				this.isLoaded = false
+				uni.navigateTo({
+					url: `/pagesB/fire/fireSpecial/addSpecial/index?title=查看特种作业人员&&viewData=${item}`
+				})
+			},
+			addClick() {
+				this.isLoaded = false
+				uni.navigateTo({
+					url: `/pagesB/fire/fireSpecial/addSpecial/index?title=新增特种作业人员`
+				});
+			},
+
+			sexSelect(e) {
+				this.formData.orgId = e.id;
+				this.formData.orgName = e.name;
+				this.getData()
+			},
+			// 触底的事件
+			onReachBottom() {
+				// 判断是否还有下一页数据
+				if (this.pageNo * this.pageSize >= this.total)
+					return uni.showToast({
+						title: `数据加载完毕`
+					});
+				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
+				if (this.loading) return;
+				this.pageNo += 1;
+				this.getData(this.pageNo);
+			},
+
+			// 隐藏键盘
+			hideKeyboard() {
+				uni.hideKeyboard();
+			},
 		}
-	}
+	};
 </script>
 
-<style>
+<style lang="scss" scoped>
+	body {
+		background-color: #f5f7f9;
+	}
+
+	page {
+		background-color: #f5f7f9;
+	}
+
+	/deep/ .u-tabs__wrapper[data-v-0de61367],
+	.u-tabs__wrapper.data-v-0de61367 {
+		width: 99%;
+	}
+
+	.uni-container {
+		height: 100vh;
+		padding-right: 20upx;
+	}
+
+	.addInsp {
+		width: 40px;
+		position: fixed;
+		right: 4px;
+		z-index: 99999;
+	}
+
+	::v-deep .u-icon__icon {
+		margin-right: 0px !important;
+	}
+
+	.an-niu {
+		float: right;
+		font-size: 10px;
+		text-align: center;
+		display: flex;
+		margin-top: -64upx;
+		padding-bottom: 30rpx;
+		// margin-top: 50rpx;
+		color: #fff;
+
+		.detail {
+			width: 60px;
+			height: 60rpx;
+			padding: 0 20rpx;
+			border-radius: 30px;
+			background-color: #f7c41e;
+			margin-right: 20rpx;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: 27upx;
+		}
+
+		.detailDel {
+			width: 60px;
+			height: 60rpx;
+			padding: 0 20rpx;
+			border-radius: 30px;
+			background-color: #ff2e31;
+			color: white;
+			margin-right: 20rpx;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: 30upx;
+		}
 
-</style>
+		.solve {
+			width: 62px;
+			height: 60rpx;
+			margin-right: 20rpx;
+			border-radius: 30px;
+			background-color: #4cb2b6;
+			line-height: 60rpx;
+		}
+
+		/deep/ .padding-tb-sm {
+			padding-top: 0px;
+			padding-bottom: 10px;
+		}
+
+		.deletes {
+			width: 62px;
+			height: 60rpx;
+			border-radius: 60rpx;
+			background-color: red;
+			color: #fff;
+			line-height: 60rpx;
+		}
+	}
+
+	/deep/.segmented-control__item--button {
+		background-color: rgb(76, 178, 182) !important;
+	}
+
+	/deep/.segmented-control__item--button--active {
+		background-color: #ffffff !important;
+	}
+
+	/deep/.uni-card {
+		box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
+		border-radius: 30rpx;
+	}
+
+	.tiantupian {
+		width: 110rpx;
+		height: 110rpx;
+		position: fixed;
+		right: 15px;
+		bottom: 30rpx;
+	}
+
+	//列表样式
+	.titles {
+		font-weight: 600;
+		margin-bottom: 10rpx;
+		color: black;
+		font-size: 32rpx;
+	}
+
+	/deep/ .u-form-item__body__left__content__label {
+		font-size: 28upx !important;
+	}
+
+	.conts {
+		max-width: 470upx;
+		display: -webkit-box;
+		/*弹性伸缩盒子模型显示*/
+		-webkit-box-orient: vertical;
+		/*排列方式*/
+		-webkit-line-clamp: 1;
+		/*显示文本行数*/
+		overflow: hidden;
+		/*溢出隐藏*/
+		color: #274647;
+		text-overflow: ellipsis;
+	}
+
+	.max-width {
+		max-width: 180upx;
+	}
+
+	/deep/.u-action-sheet {
+		overflow-y: auto;
+		height: 1000rpx;
+		background-color: #fff;
+	}
+
+	.example {
+		overflow-y: auto;
+	}
+</style>