hz-zhhq-app/pages/visitStatistics/visitorAppointment.vue

332 lines
7.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="container">
<view class="interviewee">
<!-- <view>
<text class="input_left">到访地点</text>
<input type="text" placeholder="无到访地点名" :value="place" disabled="true">
</view> -->
<view>
<text class="input_left">申请状态</text>
<input type="text" placeholder="无申请状态" :value="stateList[first_status]" disabled="true" />
</view>
<!-- <view>
<text class="input_left">来访人单位</text>
<input type="text" placeholder="无" :value="dpname" disabled="true">
</view> -->
<view>
<text class="input_left">被访人姓名</text>
<input type="text" placeholder="无被访人姓名" :value="person" disabled="true" />
</view>
<view>
<text class="input_left">手机号码</text>
<input type="tel" placeholder="无被访人手机号码" :value="visited_person_tel" disabled="true" />
</view>
<view>
<text class="input_left">来访时间</text>
<input type="tel" placeholder="无来访时间" :value="start" disabled="true" />
</view>
<view>
<text class="input_left">离开时间</text>
<input type="tel" placeholder="无离开时间" :value="end" disabled="true" />
</view>
<view>
<text class="input_left">来访事由</text>
<input type="text" placeholder="无来访事由" :value="reason" disabled="true" />
</view>
</view>
<view class="visitor_2">
<view class="visitor_2_text mar-none">
<view>
<text>&nbsp;&nbsp;&nbsp;:</text>
{{ person2 }}
</view>
<view>
<text>&nbsp;&nbsp;&nbsp;:</text>
{{ dpname || '未知' }}
</view>
<view>
<text>手机号:</text>
{{ tel }}
</view>
<view>
<text>身份证:</text>
{{ idcard }}
</view>
</view>
<view class="pic" v-if="picture0 || picture1 || picture2">
<image :src="picture0" mode="" @tap="previewImage(picture0)" v-if="picture0"></image>
<image :src="picture1" mode="" @tap="previewImage(picture1)" v-if="picture1"></image>
<image :src="picture2" mode="" @tap="previewImage(picture2)" v-if="picture2"></image>
</view>
</view>
<view v-if="retinueList.length > 0">
<view class="visitor_2" v-for="(item, index) in retinueList" :key="index">
<view class="visitor_2_text mar-none">
<view>
<text>&nbsp;&nbsp;&nbsp;:</text>
{{ item.retinue_name }}
</view>
<view>
<text>手机号:</text>
{{ item.visitor_tel }}
</view>
<view>
<text>身份证:</text>
{{ item.idcard }}
</view>
</view>
</view>
</view>
<!-- <view id="result">
<view class="ing">
<i></i>
<text>被拜访人已同意 2019-11-28 19:36:24</text>
</view>
</view> -->
<view style="clear: both;"></view>
<view class="occupied"></view>
<view class="footer-btn" @click="submit(id, 0)" v-if="role == '1' && first_status == '0'">
<view class="btn">{{ button_text }}</view>
</view>
</view>
</template>
<script>
import { getApplyInfo, greenVisitorInfo } from '@/common/api.js';
import { callbackRequest, alertTip } from '@/common/util.js';
export default {
data() {
return {
button_class: 'submit_button',
button_text: '取消',
first_status: '',
picture0: '../../static/IDpic1.png',
picture1: '../../static/IDpic1.png',
picture2: '../../static/IDpic1.png',
stateList: ['待审核', '已通过', '已拒绝', '待本人确认', '已取消'],
role: '',
userId: '',
id: '', //记录的id
person: '',
person2: '',
place: '',
tel: ' ',
visited_person_tel: '',
start: '',
end: '',
dpname: '',
reason: '',
idcard: '',
retinueList: []
};
},
onLoad(options) {
this.id = options.id;
this.role = options.role;
this.userId = options.userId;
this.reFresh(this.userId, this.id, '02'); //必须是02
},
methods: {
// 预览图片
previewImage(image) {
var imgArr = [];
imgArr.push(image);
//预览图片
uni.previewImage({
urls: imgArr,
current: imgArr[0]
});
},
reFresh(userId, id, type) {
console.log('执行onload' + type);
var data = { userId: userId, id: id, applyType: type };
let params = {
method: getApplyInfo, //根据id和申请类型查询申请详情
data: data
};
// console.log(params);
callbackRequest(params).then(res => {
console.log(res);
this.person = res.data.returnData[0].visited_person_name;
this.person2 = res.data.returnData[0].visitor_name;
this.place = res.data.returnData[0].visit_place;
this.tel = res.data.returnData[0].visitor_tel;
this.visited_person_tel = res.data.returnData[0].visited_person_tel;
this.start = res.data.returnData[0].visit_start_time;
this.end = res.data.returnData[0].visit_end_time;
// this.dp = res.data.returnData[0].name == null?"":res.data.returnData[0].name;
this.dpname = res.data.returnData[0].dpname;
this.reason = res.data.returnData[0].visit_reason;
this.idcard = res.data.returnData[0].idcard;
this.first_status = res.data.returnData[0].first_status;
this.picture0 = res.data.returnData[0].face_pic1;
this.picture1 = res.data.returnData[0].picture1;
this.picture2 = res.data.returnData[0].picture2;
this.retinueList = res.data.returnData[1].greenRetinueInfoList;
});
},
submit(id, type) {
let params = {
method: greenVisitorInfo, // 申请的审批
data: { userId: this.userId, applyId: this.id, applyType: type } //分三种情况
};
var self = this;
uni.showModal({
title: '提示',
content: '是否确认',
success: function(res) {
if (res.confirm) {
callbackRequest(params).then(res => {
alertTip(res.data.returnMsg);
//刷新页面
self.reFresh(self.userId, self.id, '02');
});
}
}
});
}
}
};
</script>
<style lang="scss">
@import '@/static/css/common.scss';
.container {
min-height: 100vh;
background: #f5f5f5;
overflow: hidden;
}
.interviewee {
padding: 0upx 30upx 0;
background: #fff;
margin: 30rpx 30rpx 0;
border-radius: 10rpx;
.input_left {
width: 150rpx;
color: #333333;
font-size: 28rpx;
font-weight: bold;
}
}
.interviewee view {
line-height: 40rpx;
padding: 20rpx 0;
color: #333333;
font-size: 28rpx;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
position: relative;
}
.interviewee view:last-child {
border-bottom: 0px;
}
.interviewee view input {
font-size: 28rpx;
margin-left: 20rpx;
}
.visitor_2 {
margin: 20rpx 30rpx 20rpx;
background: #ffffff;
border-radius: 10upx;
}
.visitor_2 {
border-radius: 15upx;
padding: 30rpx 30rpx;
overflow: hidden;
}
.visitor_2 .pic {
padding-top: 20rpx;
}
.visitor_2 image {
width: 180rpx;
height: 180rpx;
vertical-align: top;
margin-right: 20rpx;
}
.visitor_2_text {
margin-left: 170upx;
padding: 0rpx 0;
view {
font-size: 28upx;
color: #666;
line-height: 40rpx;
text {
font-weight: bold;
display: inline-block;
width: 110rpx;
text-align: right;
padding-right: 10rpx;
color: #333;
}
}
}
.visitor_2 .mar-none {
margin-left: 0;
}
/* 已同意 */
#result .ing {
background: #ffffff;
height: 2.2rem;
line-height: 1.2rem;
border-radius: 0.133333rem;
}
#result .ing i {
width: 0.566667rem;
height: 0.566667rem;
border: 0.033333rem solid #00c277;
display: inline-block;
margin-left: 0.8rem;
margin-right: 0.24rem;
border-radius: 50%;
margin-top: 0.9rem;
}
#result .ing text {
color: #00c277;
font-size: 0.745333rem;
}
.submit {
width: 100%;
position: fixed;
bottom: 20upx;
/* bottom: 0upx; */
height: 80upx;
display: inline;
background-color: #00c277;
}
button {
font-size: 38upx;
font_weight: bold;
height: 80upx;
}
.submit_button {
width: 100%;
color: #ffffff;
background-color: #00c277;
margin: 0;
}
.btn_refuse {
width: 50%;
color: #ffffff;
background-color: red;
margin: 0;
}
.btn_agree {
width: 50%;
color: #ffffff;
background-color: #00c277;
margin-left: 50%;
margin-top: -80upx;
}
</style>