zhengkaixin 4 yıl önce
ebeveyn
işleme
06541de3f5

+ 8 - 0
src/projects/business/apis/Guest/current.js

@@ -17,4 +17,12 @@ export function add(params) {
             "Content-Type": "application/json"
         }
     });
+}
+
+export function pageList(params) {
+    return request({
+        url: '/mobile/guestInfoRecordApi/currentPageList',
+        data: Qs.stringify(params),
+        method: 'post',
+    })
 }

+ 9 - 0
src/projects/business/apis/Guest/from.js

@@ -44,4 +44,13 @@ export function add(params) {
             "Content-Type": "application/json"
         }
     });
+}
+
+export function approval(params) {
+
+    return request({
+        url: '/mobile/guestInfoRecordApi/approval',
+        data: Qs.stringify(params),
+        method: 'post',
+    })
 }

+ 22 - 1
src/projects/business/router/guest.js

@@ -47,7 +47,17 @@ const routesGuest = [
 							role: [],
 							title: '访客详情',
 						}
-					},
+					},//访客审批
+                    {
+                        path: 'approval',
+                        name: 'GuestFromApproval',
+                        component: () => import('../views/Guest/From/Approval.vue'),
+                        meta: {
+                            requireAuth: false,
+                            role: [],
+                            title: '访客审批',
+                        }
+                    },
 
 				]
 			},
@@ -98,6 +108,17 @@ const routesGuest = [
 							title: '访客身份信息',
 						}
 					},
+                    //访客身份信息(注册)
+                    {
+                        path: 'list',
+                        name: 'GuestCurrentList',
+                        component: () => import('../views/Guest/Current/List.vue'),
+                        meta: {
+                            requireAuth: false,
+                            role: [],
+                            title: '访客列表',
+                        }
+                    },
 				]
 			},
 		],

+ 112 - 110
src/projects/business/views/Guest/Current/Info.vue

@@ -3,10 +3,10 @@
 	<green-code ref="greenCode"   @callBack="callBack"></green-code>
 
 
-	<header class="mui-bar mui-bar-nav" v-if="step==1">
-		<h1 class="mui-title">访客信息登记</h1>
-	</header>
-	<div class="mui-content margin60" v-if="step==1">
+
+    <top-header :pageTitle="pageTitle" ></top-header>
+
+    <div class="mui-content margin60" v-if="step==1">
 		<div class="mui-content-padded vongi-editme vongi-qingjiadt">
 			<form class="mui-input-group">
 				<div class="mui-input-row">
@@ -53,82 +53,95 @@
 		</div>
 	</div>
 	<div class="fyy-footer" v-if="step==1">
-		<div class="bindfyy-btn"><button type="submit" class="mui-btn mui-btn-primary " @click="stepNext()">下一步</button></div>
+		<div class="bindfyy-btn"><button type="submit" class="mui-btn mui-btn-primary " @click="insert()">提交审核</button></div>
 	</div>
-	<header class="mui-bar mui-bar-nav" v-if="step==2">
-		<h1 class="mui-title">扫码通行</h1>
-		<a class=" mui-icon mui-icon-left-nav mui-pull-left" @click="step='1'"></a>
-	</header>
-			<div class="mui-content"  v-if="step==2">
-				<div class="fyy-scon">
-					<div class="fyy-scon-top">
-						<div class="fyy-scon-head mui-col-xs-5">
-							<img src="~$project/assets/img/default_photo.png" alt="">
-						</div>
-						<div class="fyy-scon-det mui-col-xs-7">
-							<div class="fyy-scon-det-top">
-								<div class="fyy-scon-det-top-left">
-									姓名
-									<div class="mui-h3" v-text="detail.name"></div>
-								</div>
-								<div class="fyy-scon-det-top-right">
-									健康码
-									<a  @click="showGreenCode" class="mui-h3">绿码<span class="mui-icon iconfont icon-icon-"></span><span class="mui-icon mui-icon-arrowright"></span></a>
-								</div>
-							</div>
-							<div class="fyy-scon-det-down">
-								单位
-								<div class="mui-h3" v-text="detail.unit">湖北荆盛商贸有限公司</div>
-							</div>
-							<div class="fyy-scon-det-down">
-								手机号码
-								<div class="mui-h3" v-text="showphone(detail.mobilePhone)">155****8888</div>
-							</div>
-						</div>
-					</div>
-					<div class="fyy-scon-center mui-card">
-						<p>当前健康状态</p>
-						<form class="mui-input-group">
-							<div class="mui-input-row mui-radio mui-left">
-								<label>健康</label>
-								<input name="radio1" type="radio" checked>
-							</div>
-							<div class="mui-input-row mui-radio mui-left">
-								<label>≥37.3°C</label>
-								<input name="radio1" type="radio">
-							</div>
-						</form>
-					</div>
-				</div>
-				<div class="mui-card fyy-scon-bot">
-					<div class="fyy-scon-group">
-						<label>受访人</label>
-						<span>{{detail.intervieweeName}}  {{detail.intervieweePhone}}<a class="mui-icon mui-icon-phone" v-if="detail.intervieweePhone" :href="'tel:'+detail.intervieweePhone"></a></span>
-						
-					</div>
-					<div class="fyy-scon-group">
-						<label>核验地点</label>
-						<span>{{info.name}}</span>
-					</div>
-					<div class="fyy-scon-group">
-						<label>扫码时间</label>
-						<span>{{today()}}</span>
-					</div>
-					<div class="fyy-scon-group" v-if="detail.comeInTime">
-						<label>进入时间</label>
-						<span>{{detail.comeInTime}}</span>
-					</div>
-					<div class="fyy-scon-group" v-if="detail.outTime">
-						<label>离开时间</label>
-						<span>{{detail.outTime}}</span>
-					</div>
-				</div>
-				<div class="fyy-scon-botton">
-					<div class="examine-btn examine-btn1"  :class="detail.comeInTime&&!detail.outTime?'examine-btn1':'examine-btn3'"  @click="update(detail.comeInTime&&!detail.outTime)">离开</div>
-					<div class="examine-btn examine-btn2"  :class="!detail.comeInTime?'examine-btn2':'examine-btn3'"  @click="insert(!detail.comeInTime)" >进入</div>
-					<!--<div class="examine-btn examine-btn3">灰色按钮</div>-->
-				</div>
-			</div>
+
+    <div class="mui-content margin60 "   v-if="step==2"  >
+        <div class="mui-content-padded vongi-qingjiadt">
+            <form class="mui-input-group">
+                <div class="mui-input-row">
+                    <label>访客姓名</label>
+                    <span>{{detail.name}}</span>
+                </div>
+                <div class="mui-input-row">
+                    <label>访客手机号码</label>
+                    <span>{{detail.mobilePhone}}</span>
+                </div>
+                <div class="mui-input-row">
+                    <label>身份证号</label>
+                    <span>{{detail.idCard}}</span>
+                </div>
+
+                <div class="mui-input-row">
+                    <label>访客单位</label>
+                    <span>{{detail.unit}}</span>
+                </div>
+                <div class="mui-input-row">
+                    <label>访问事由</label>
+                    <span>{{detail.visitReasons}}</span>
+                </div>
+                <div class="mui-input-row">
+                    <label>拜访时间</label>
+                    <span>{{detail.visitDate}}</span>
+                </div>
+
+
+                <div class="mui-input-row">
+                    <label>车牌号</label>
+                    <span>{{detail.numberPlate}}</span>
+                </div>
+            </form>
+        </div>
+        <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+            <form class="mui-input-group vongi-login-form">
+                <div class="mui-input-row">
+                    <label>受访人</label>
+                    <span>{{detail.intervieweeName}}</span>
+                </div>
+                <div class="mui-input-row">
+                    <label>受访手机号码</label>
+                    <span>{{detail.intervieweePhone}}</span>
+                </div>
+            </form>
+        </div>
+        <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+            <form class="mui-input-group vongi-login-form">
+                <div class="mui-input-row">
+                    <label>邀请单状态</label>
+                    <span :class="statusColor[detail.status]" v-text="status[detail.status]"></span>
+                    <!--<span class="colorf8b155">待确认</span>
+                                <span class="color999">已过期</span>-->
+                </div>
+
+                <div class="mui-input-row">
+                    <label>发送时间</label>
+                    <span>{{detail.createTime}}</span>
+                </div>
+                <div class="mui-input-row" v-if="detail.confirmationTime">
+                    <label>确认时间</label>
+                    <span>{{detail.confirmationTime}} </span>
+                </div>
+
+            </form>
+        </div>
+        <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+            <form class="mui-input-group vongi-login-form">
+
+                <div class="mui-input-row" v-if="detail.comeInTime">
+                    <label>进入时间</label>
+                    <span>{{detail.comeInTime}}</span>
+                </div>
+                <div class="mui-input-row" v-if="detail.outTime">
+                    <label>离开时间</label>
+                    <span>{{detail.outTime}} </span>
+                </div>
+
+            </form>
+        </div>
+
+
+
+    </div>
 
 	<loading :visible="isLoading"></loading>
 
@@ -161,21 +174,23 @@
 		},
 		data() {
 			return {
-				pageTitle: '扫码通行',
+				pageTitle: '访客信息登记',
 				detail: {
 
 				},
-				info:{},
 
+                currentId:this.$route.query.currentId,
 				id:this.$route.query.id,
 				step:'1',
 				isLoading: false,
 				lineColor: '#e5aa37',
-				statusColor: '#e5aa37',
-				statusTitleColor: '#d39d33',
+ 				statusTitleColor: '#d39d33',
 				statusName: '异常',
+                status: ['待确认', '已确认', '待确认','已过期','已拒绝'],
+                statusColor: ['colorf8b155', 'color55f868','colorf8b155','color999', 'colorfe616c'],
+
 
-			}
+            }
 		},
 		created() {
 
@@ -184,17 +199,15 @@
 			showGreenCode(){
  				this.$refs.greenCode.showGreenCode();
 			},
-			insert(bl){
-				if(bl){
-					this.detail.openId=this.openId;
-					this.detail.comeInTime=parseUnixTime(currentTimeStamp());
-					this.detail.visitDate=parseUnixTime(currentTimeStamp());
-					this.detail.createTime=parseUnixTime(currentTimeStamp());
+			insert(){
+                this.detail.openId=this.openId;
+                //this.detail.comeInTime=parseUnixTime(currentTimeStamp());
+                this.detail.visitDate=parseUnixTime(currentTimeStamp());
+                this.detail.createTime=parseUnixTime(currentTimeStamp());
 
-					this.detail.status=0;
-					this.detail.temperature=36;
-					this.save();
-				}
+                this.detail.status=2;
+               // this.detail.temperature=36;
+                this.save();
 			},
 			update(bl){
 				if(bl){
@@ -211,8 +224,8 @@
 				API_Current.add(this.detail).then(response => {
 					this.isLoading = false;
 					this.detail=response;
-					mui.toast("操作成功,请将此页面展示给工作人员");
-
+					mui.toast("提交成功,请等待受访者审批");
+                    this.$router.go(-1);
 				}).catch(error => {
 					this.isLoading = false;
 					mui.toast(error);
@@ -269,11 +282,10 @@
 			getDetail() {
 				this.isLoading = true;
 
-				API_Current.info({qrcode:this.id,openId:this.openId }).then(response => {
+				API_Current.info({qrcode:this.id,openId:this.openId,id:this.currentId }).then(response => {
 					this.isLoading = false;
 
-					this.detail = response.data;
-					this.info = response.info;
+					this.detail = response;
 
 					if(this.detail.id){
 						this.step='2';
@@ -286,15 +298,7 @@
 			},asynCallBack(){},
 		},
 		mounted() {
-
-			if(!this.openId){
-				mui.toast("请先关注【小鹏管家】")
-			}else if(!this.id){
-				mui.toast("请通过扫描二维码访问本页面")
-
-			}else  if(this.id&&this.openId){
-				this.getDetail();
-			}
+            this.getDetail();
 		},
 		destroyed() {
 
@@ -303,8 +307,6 @@
 			...mapGetters({
 				openId: 'wx_openid',
 				token: 'token',
-				person_data: 'person_data',
-				person_popedom: 'person_popedom',
 			})
 		}
 	}

+ 178 - 0
src/projects/business/views/Guest/Current/List.vue

@@ -0,0 +1,178 @@
+<template>
+<div>
+    <header class="mui-bar mui-bar-nav" >
+        <h1 class="mui-title">拜访申请记录</h1>
+    </header>
+		<div class="mui-content margin60">
+			<template v-for="item in recordList">
+				<div class="mui-content-padded" >
+
+					<ul class="mui-table-view fyy-view" @click="detail(item)">
+                        <li class="mui-table-view-cell"  >
+                            <div>{{item.unit}}</div>
+                        </li>
+                        <li class="mui-table-view-cell" >
+							<label>拜  访 人:</label>
+							<span>{{item.name}}<span class="mui-pull-right " :class="statusColor[item.status]">{{status[item.status]}}</span></span>
+						</li>
+                        <li class="mui-table-view-cell"  >
+                            <label>拜访时间:</label>
+                            <span>{{item.visitDate}}</span>
+                        </li>
+						<li class="mui-table-view-cell"  >
+							<label>拜访事由:</label>
+							<span>{{item.visitReasons}}</span>
+						</li>
+
+
+					</ul>
+
+				</div>
+
+			</template>
+
+
+		</div>
+	<NullList :remark="'暂无拜访记录'" v-if="!recordList.length"></NullList>
+
+	<div class="fyy-footer" v-if="id">
+			<div class="bindfyy-btn">
+				<button type="button" class="mui-btn mui-btn-primary " @click="save">
+                    我要拜访
+				</button>
+			</div>
+	</div>
+	<loading :visible="isLoading"></loading>
+
+</div>
+</template>
+
+
+<script>
+    import * as API_Current from '@/apis/Guest/current'
+	import Common from '$project/components/Common.vue'
+	import Loading from '$project/components/Loading.vue'
+	import TopHeader from '$project/components/TopHeader.vue'
+	import isReachBottom from '$project/utils/isReachBottom'
+	import NullList from '$project/components/NullList.vue'
+
+	import {
+		mapGetters,
+		mapMutations
+	} from 'vuex'
+	export default {
+		name: 'GuestFromList',
+		components: {
+			Common,
+			Loading,
+			TopHeader,NullList
+		},
+		data() {
+			return {
+				pageTitle: '申请记录',
+
+				isLoading: false,
+                id:this.$route.query.id,
+				listForm: {
+					pageIndex: 1,
+					pageSize: 20,
+					//	token: '',
+					totalPage: 1,
+					result: 0,
+				},
+				recordList: [],
+                status: ['待确认', '已确认', '待确认','已过期','已拒绝'],
+                statusColor: ['colorf8b155', 'color55f868','colorf8b155','color999', 'colorfe616c'],routeName: "Master",
+			}
+		},
+		created() {
+
+		},
+		methods: {
+			//info
+
+			detail(mod) {
+ 				 this.$router.push({
+					name: "GuestCurrentInfo",
+					query: {
+                        currentId: mod.id,
+					}
+				})
+			},
+			save() {
+			    if(this.id){
+                    this.$router.push({
+                        name: 'GuestCurrentInfo',
+                        query: {
+                            id:this.id
+                        }
+                    })
+                }else{
+                    mui.toast("请通过扫描园区二维码,进行访客登记");
+                }
+
+			},
+			//获取列表
+			getList() {
+				this.isLoading = true;
+                this.listForm.openId=this.openId;
+                API_Current.pageList(this.listForm).then(response => {
+					if (response) {
+						if (this.listForm.pageIndex == 1) {
+							this.recordList = response.data;
+							this.listForm.pageIndex = response.pageNumber;
+							this.listForm.totalPage = response.totalPage;
+						} else {
+							this.recordList = [
+								...this.recordList,
+								...response.data
+							];
+						}
+					}
+					this.listForm.pageIndex++;
+					this.isLoading = false;
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+				})
+			},
+			//下拉事件
+			handleScrool() {
+				if (isReachBottom()) {
+					console.log('到达底部')
+					if (this.listForm.pageIndex <= this.listForm.totalPage && this.isLoading == false) {
+						this.getList();
+					} else {
+						return;
+					}
+				}
+			},
+
+			asynCallBack() {
+
+			},
+		},
+		mounted() {
+			this.getList();
+			//监控下拉加载事件
+			var _this = this;
+			window.addEventListener('scroll', _this.handleScrool);
+		},
+		destroyed() {
+			//销毁监听事件
+			var _this = this;
+			window.removeEventListener('scroll', _this.handleScrool);
+		},
+		computed: {
+			...mapGetters({
+				openId: 'wx_openid',
+				token: 'token',
+			})
+		},
+
+	}
+</script>
+
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style>
+</style>

+ 199 - 0
src/projects/business/views/Guest/From/Approval.vue

@@ -0,0 +1,199 @@
+<template>
+    <div>
+
+
+        <common @asynCallBack="asynCallBack"></common>
+        <header class="mui-bar mui-bar-nav" >
+            <h1 class="mui-title">访客申请</h1>
+        </header>
+        <div class="mui-content margin60 "    >
+            <div class="mui-content-padded vongi-qingjiadt">
+                <form class="mui-input-group">
+                    <div class="mui-input-row">
+                        <label>拜访人</label>
+                        <span>{{detail.name}}</span>
+                    </div>
+                    <div class="mui-input-row">
+                        <label>手机号码</label>
+                        <span>{{detail.mobilePhone}}</span>
+                    </div>
+                    <div class="mui-input-row">
+                        <label>身份证号</label>
+                        <span>{{detail.idCard}}</span>
+                    </div>
+                    <div class="mui-input-row" v-if="detail.isUpPhoto">
+                        <label style="width: 50%">人脸识别照片</label>
+
+                        <span  style="width: 50%" v-if="!detail.photo" >未上传</span>
+                        <span class="vongi-qingjiadt-photo"  v-if="detail.photo" >
+               <img  :src="detail.photo">
+            </span>
+                    </div>
+                    <div class="mui-input-row">
+                        <label>拜访单位</label>
+                        <span>{{detail.unit}}</span>
+                    </div>
+                    <div class="mui-input-row">
+                        <label>拜访事由</label>
+                        <span>{{detail.visitReasons}}</span>
+                    </div>
+                    <div class="mui-input-row">
+                        <label>拜访时间</label>
+                        <span>{{detail.visitDate}}</span>
+                    </div>
+                    <div class="mui-input-row">
+                        <label>结束时间</label>
+                        <span>{{detail.expirationTime}}</span>
+                    </div>
+
+                    <div class="mui-input-row">
+                        <label>车牌号</label>
+                        <span>{{detail.numberPlate}}</span>
+                    </div>
+                </form>
+            </div>
+            <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+                <form class="mui-input-group vongi-login-form">
+                    <div class="mui-input-row">
+                        <label>邀请单状态</label>
+                        <span :class="statusColor[detail.status]" v-text="status[detail.status]"></span>
+                        <!--<span class="colorf8b155">待确认</span>
+                                    <span class="color999">已过期</span>-->
+                    </div>
+                    <div class="mui-input-row">
+                        <label>发送时间</label>
+                        <span>{{detail.createTime}}</span>
+                    </div>
+                    <div class="mui-input-row" v-if="detail.confirmationTime">
+                        <label>确认时间</label>
+                        <span>{{detail.confirmationTime}} </span>
+                    </div>
+                </form>
+            </div>
+
+
+
+
+        </div>
+
+
+        <div v-if="detail.status=='2'" class="fyy-scon-botton">
+            <div class="examine-btn examine-btn1" @click="openFrom('4')">拒绝</div>
+            <div class="examine-btn examine-btn2" @click="openFrom('1')">通过</div>
+        </div>
+        <loading :visible="isLoading"></loading>
+
+    </div>
+</template>
+
+
+<script>
+
+    import * as API_From from '@/apis/Guest/from'
+    import Common from '$project/components/Common.vue'
+    import Loading from '$project/components/Loading.vue'
+    import TopHeader from '$project/components/TopHeader.vue'
+    import {
+        mapGetters,
+        mapMutations
+    } from 'vuex'
+    import {
+        currentTimeStamp,
+        parseUnixTime
+    } from '$project/utils'
+    export default {
+        name: 'GuestFromInfo',
+        components: {
+            Common,
+            Loading,
+            TopHeader
+        },
+        data() {
+            return {
+                pageTitle: '访客申请',
+                step:'1',
+                id: '',
+                detail: {
+                    id:'',
+                    name:'',
+                    mobilePhone:'',
+                    unit:'',
+                    visitReasons:'',
+
+                    visitDate: '请选择',
+                    expirationTime: '请选择',
+                    issueDevice: '',
+                    isUpPhoto:1,
+                },
+                list:[],
+                isLoading: false,
+
+                status: ['待确认', '已确认', '待确认','已过期','已拒绝'],
+                statusColor: ['colorf8b155', 'color55f868','colorf8b155','color999', 'colorfe616c'],
+            }
+        },
+        created() {
+            this.id = this.$route.query.id;
+        },
+        methods:  {
+            openFrom(status){
+
+
+                this.isLoading = true;
+
+                API_From.approval({id:this.id,status:status}).then(response => {
+                    this.isLoading = false;
+
+                    this.detail=response ;
+
+                }).catch(error => {
+                    this.isLoading = false;
+                    mui.toast(error);
+                })
+            },
+
+
+
+            //获取详情
+            getDetail() {
+                this.isLoading = true;
+
+                API_From.getDetail(this.id ).then(response => {
+                    this.isLoading = false;
+
+                    this.detail = response.info;
+                    this.list=response.list;
+                }).catch(error => {
+                    this.isLoading = false;
+                    mui.toast(error);
+                })
+            },asynCallBack(){},
+        },
+        mounted() {
+            if(this.id){
+                this.detail.id=this.id;
+                this.getDetail();
+            }
+
+
+        },
+
+
+        destroyed() {
+
+        },
+        computed: {
+            ...mapGetters({
+                openId: 'wx_openid',
+                token: 'token',
+                person_data: 'person_data',
+                person_popedom: 'person_popedom',
+            })
+        }
+    }
+</script>
+
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style src="$project/assets/css/iconfont.css"></style>
+<style>
+</style>

+ 3 - 4
src/projects/business/views/Guest/From/Info.vue

@@ -39,7 +39,7 @@
             <label>邀访时间</label>
             <span>{{detail.visitDate}}</span>
           </div>
-          <div class="mui-input-row">
+          <div class="mui-input-row" v-if="detail.expirationTime">
             <label>结束时间</label>
             <span>{{detail.expirationTime}}</span>
           </div>
@@ -178,9 +178,8 @@
         list:[],
         isLoading: false,
 
-        status: ['待确认', '已确认', '已拒绝','已过期'],
-        statusColor: ['colorf8b155', 'color55f868', 'colorfe616c','color999'],
-
+          status: ['待确认', '已确认', '待确认','已过期','已拒绝'],
+          statusColor: ['colorf8b155', 'color55f868','colorf8b155','color999', 'colorfe616c'],
       }
     },
     created() {

+ 2 - 3
src/projects/business/views/Guest/From/List.vue

@@ -80,9 +80,8 @@
 					result: 0,
 				},
 				recordList: [],
-				status: ['待确认', '已确认', '已拒绝','已过期'],
-				statusColor: ['colorf8b155', 'color55f868', 'colorfe616c','color999'],
-				routeName: "Master",
+                status: ['待确认', '已确认', '待确认','已过期','已拒绝'],
+                statusColor: ['colorf8b155', 'color55f868','colorf8b155','color999', 'colorfe616c'],		routeName: "Master",
 			}
 		},
 		created() {