You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

292 lines
8.0 KiB

3 years ago
<template>
<view class="containers">
<view class="dbbtns justify-between">
1 month ago
<view v-for="item in btnList" :key="item.value" :class="{'active':btnActive===item.value}" @click="btnActiveList(item.value)" class="label-with-en-inline btn-item">
<text>{{item.label}}</text>
<text class="en-text">{{item.labelEn}}</text>
</view>
3 years ago
<!-- <text >已完成</text>
<text>待完成</text> -->
</view>
<view class="db">
<view class="dblist">
<view>
<view v-for="(item, index) in list" :key="index">
<view class="dbitem" @click="toDetail(item.id)">
<text class="dbtype">{{item.type_text}}</text>
<view class="dbstatus bm">
1 month ago
<view class="justify-start">
{{item.audit_status_text}}
<!-- <button class="signBtn" @click.stop='signPic(item.id)' type="primary" v-if="nowadminID==item.accompany_id&&item.audit_status==3&&!item.accept_admin_sign"></button> -->
3 years ago
</view>
3 years ago
<view>
1 month ago
<view class="label-with-en-inline">
<view>访问日期{{item.date}}{{ item.end_date?'至'+item.end_date:'' }}</view>
<view class="en-text">Visit Date: {{item.date}}{{ item.end_date?' to '+item.end_date:'' }}</view>
2 weeks ago
</view>
<view class="label-with-en-inline">
<view>访问时间{{item.time?item.time:''}}</view>
<view class="en-text">Visit Time: {{item.time?item.time:''}}</view>
1 month ago
</view>
2 weeks ago
<!-- <view class="label-with-en-inline">
1 month ago
<view>访问时间{{item.visit_time.start_time}}{{item.visit_time.end_time}}</view>
<view class="en-text">Visit Time: {{item.visit_time.start_time}} to {{item.visit_time.end_time}}</view>
2 weeks ago
</view> -->
3 years ago
</view>
</view>
<view class="dbinfo justify-left">
<view>
1 month ago
<view class="label-with-en-inline">
<view>被访人<text>{{item.accept_admin.name}}</text></view>
<view class="en-text">Host: <text>{{item.accept_admin.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>部门<text>{{item.accept_admin.department.name}}</text></view>
<view class="en-text">Department: <text>{{item.accept_admin.department.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>访问区域<text>{{item.visit_area.name}}</text></view>
<view class="en-text">Visit Area: <text>{{item.visit_area.name}}</text></view>
</view>
3 years ago
</view>
<view>
1 month ago
<view class="label-with-en-inline">
<view>拜访人<text>{{item.name}}</text></view>
<view class="en-text">Visitor: <text>{{item.name}}</text></view>
</view>
<view class="label-with-en-inline">
<view>电话{{item.mobile}}</view>
<view class="en-text">Phone: {{item.mobile}}</view>
</view>
<view v-if="item.type=='1'" class="label-with-en-inline">
<view>事由<text>{{item.reason}}</text></view>
<view class="en-text">Reason: <text>{{item.reason}}</text></view>
</view>
<view v-else-if="item.type=='3'" class="label-with-en-inline">
<view>车牌<text>{{item.plate}}</text></view>
<view class="en-text">License Plate: <text>{{item.plate}}</text></view>
</view>
3 years ago
</view>
1 month ago
</view>
<view class="company">
1 month ago
<view class="label-with-en-inline">
<view>拜访公司<text>{{item.company_name?item.company_name:''}}</text></view>
<view class="en-text">Company: <text>{{item.company_name?item.company_name:''}}</text></view>
1 month ago
</view>
3 years ago
</view>
<!-- <view class="dblong">
3 years ago
<view>长期访客申请<text>{{item.long_time==0?'否':'是'}}</text></view>
2 years ago
<text v-if="item.long_time==1">访{{item.start_date?item.start_date:''}} {{item.end_date?item.end_date:''}}</text>
</view> -->
3 years ago
</view>
</view>
</view>
3 years ago
<view v-if="isEmpty">
<u-empty mode="data">
</u-empty>
</view>
3 years ago
</view>
</view>
</view>
</template>
<script>
import '@/static/css/bd.css'
export default {
data() {
return {
1 month ago
btnActive: "",
3 years ago
nowadminID:'',
3 years ago
btnList: [{
label: "全部",
1 month ago
labelEn: "All",
3 years ago
value: ''
3 years ago
},
{
label: "已完成",
1 month ago
labelEn: "Completed",
3 years ago
value: 4
3 years ago
},
{
label: "待完成",
1 month ago
labelEn: "Pending",
3 years ago
value: 0
3 years ago
}
],
list: [],
select: {
page: 1,
page_size: 5,
total: 0,
1 month ago
audit_status: '',
my_self:0,
my_audit:0,
my_accept_admin:0,
9 months ago
is_auth:0
1 month ago
},
isEmpty:false,
3 years ago
recordType:""
3 years ago
}
},
1 month ago
onLoad(options) {
this.recordType = options.type
this.select.my_audit = this.recordType=='mycheck'?1:0
this.select.my_self = this.recordType=='call'?1:0
this.select.my_accept_admin = this.recordType=='myrecord'?1:0
this.nowadminID = uni.getStorageSync('userInfo_Bd').id
3 years ago
console.log("this.nowadminID",this.nowadminID)
3 years ago
this.loadList()
},
onPullDownRefresh() {
this.select.page = 1
this.loadList()
uni.stopPullDownRefresh();
},
//上拉加载
onReachBottom() {
//当当前列表数据长度>=数据总长度时
if (this.list.length >= this.select.total) {
//提示
uni.showToast({
1 month ago
title: '没有更多了 / No more data',
3 years ago
duration: 1000,
icon: 'none'
})
} else {
//否则,页码+1继续请求列表
this.select.page++
this.loadList()
}
},
1 month ago
methods: {
signPic(id){
uni.navigateTo({
url:'/pages/bd/signpic?id='+id
})
3 years ago
},
3 years ago
toDetail(id) {
3 years ago
uni.navigateTo({
3 years ago
url: '/pages/bd/bddetail?id=' + id
3 years ago
})
},
3 years ago
btnActiveList(val) {
this.btnActive = val
1 month ago
this.select.audit_status = val
this.select.page = 1
this.list = []
3 years ago
this.isEmpty = false
this.loadList()
},
3 years ago
loadList() {
let that = this
this.util.request({
api: '/api/admin/visit/index',
method: "get",
3 years ago
requestType: "bd",
1 month ago
data: {
3 years ago
...this.select,
3 years ago
page: this.select.page,
3 years ago
// page_size: this.select.page_size,
// audit_status: this.select.audit_status
3 years ago
},
1 month ago
utilSuccess: function(res) {
if(res.total==0){
that.isEmpty=true
3 years ago
}
3 years ago
if (that.select.page == 1) {
that.list = res.data
} else {
that.list.push(...res.data)
}
that.select.total = res.total
},
utilFail: function(res) {
uni.showToast({
3 years ago
title: res,
3 years ago
duration: 2000,
icon: 'none'
})
}
})
},
}
}
</script>
<style scoped>
.containers {
background-color: #eceefe;
min-height: 100vh;
/* padding-top:20rpx; */
}
1 month ago
/deep/ .u-empty{
min-height: 60vh;
}
.signBtn{
background-color: #4f607e;
padding: 0 30rpx;
margin-left: 40rpx;
font-size: 32rpx;
line-height: 2.3;
}
.company{
padding-bottom:30rpx;
margin-top:-10rpx;
}
.company text{
color: #8f9596;
}
1 month ago
.label-with-en-inline {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.en-text {
font-size: 20rpx;
color: #8f9596;
margin-top: 4rpx;
opacity: 0.8;
}
.dbbtns text{
padding: 0;
background:transparent;
border-radius: 20rpx 20rpx 0 0;
margin-bottom: 0px;
width: auto;
text-align: center;
}
.dbbtns .btn-item {
padding: 20rpx 50rpx;
background: #eceefe;
border-radius:20rpx 20rpx 0 0;
// margin-bottom: 10px;
width: 15%;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
}
.dbbtns .btn-item.active {
margin-bottom: 0;
border-radius: 20rpx 20rpx 0 0;
background-color: #4f607e;
color: #fff;
}
.dbbtns .btn-item.active .en-text {
color: #fff;
opacity: 0.9;
}
1 month ago
</style>