<template>
|
<view>
|
<u-sticky>
|
<view class="hander">
|
<view class="tab">
|
<u-tabs :list="tabList" :current="tabIndex" @click="changeTab" :inactiveStyle="{color:'#999999'}"
|
:activeStyle="{color:'#017BFC'}" :scrollable="false">
|
</u-tabs>
|
</view>
|
|
<view class="search flex j-c-s-b a-i-c">
|
<view class="tab-filter flex j-c-c a-i-c" slot="right" @click="showDateModal">
|
<text class="f-28">时间筛选</text>
|
<u-icon name="arrow-down"></u-icon>
|
</view>
|
<u-search placeholder="请输入场所名称" v-model="keyWord" :clearabled="true" :showAction="true"
|
:animation="true" @search="searchConfirm" @clear="clearConfirm"
|
@custom="searchConfirm"></u-search>
|
</view>
|
|
</view>
|
</u-sticky>
|
<view class="list">
|
<view class="list-item bgc-ff mb-20" v-for="item in siteList" :key="item.id"
|
@click="pushPage(item.placeId, item.id)">
|
<view class="item-title flex a-i-c j-c-s-b mb-20">
|
<text class="f-32 fw">{{ item.placeName ? item.placeName : '场所信息未完善' }}</text>
|
<!-- <u-tag text="待审批" type="warning" plain plainFill></u-tag> -->
|
<u-tag class="u_tag" size="mini" :text="findObjValue(item.confirmFlag, tabList).name"
|
:type="findObjValue(item.confirmFlag, tabList).type" plain plainFill></u-tag>
|
<!-- <u-tag text="审核拒绝" type="error" plain plainFill></u-tag> -->
|
</view>
|
<view class="item-row flex a-i-c j-c-s-b">
|
<text class="f-28">地址</text>
|
<text class="address f-28 c-66">{{ item.location ? item.location : '未完善' }}</text>
|
</view>
|
<view class="item-row flex a-i-c j-c-s-b" v-if="type == 2">
|
<text class="f-28">法人信息</text>
|
<text class="f-28 c-66">{{ item.legalPerson ? item.legalPerson : '未完善'}}</text>
|
</view>
|
<view class="item-row flex a-i-c j-c-s-b f-28">
|
<text>时间</text>
|
<text class="c-66">{{item.createTime}}</text>
|
</view>
|
</view>
|
</view>
|
<u-toast ref="uToast"></u-toast>
|
<u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
|
|
|
|
|
|
<date-range-modal ref="dateRane" @comfirm="handleComfirmDate" @rest="handleRestDate" />
|
</view>
|
</template>
|
|
<script>
|
import {
|
getSiteMaintenanceData,
|
getPlacePractitionerPage
|
} from '@/api/placeExp/placeExp.js'
|
|
import dateRangeModal from '@/components/dateRangeModal/modal.vue';
|
|
export default {
|
components: {
|
dateRangeModal
|
},
|
data() {
|
return {
|
siteList: [],
|
pagingParams: {
|
current: 1,
|
size: 10
|
},
|
tabList: [{
|
name: "全部",
|
status: "",
|
},
|
{
|
name: "待审核",
|
status: 1,
|
type: 'warning'
|
},
|
{
|
name: "审核通过",
|
status: 2,
|
type: 'success'
|
},
|
{
|
name: "已拒绝",
|
status: 3,
|
type: 'error'
|
},
|
],
|
tabIndex: 0,
|
tabStatus: "",
|
keyWord: '',
|
loadingStatus: 'nomore',
|
clickInfo: {},
|
currentRole: {},
|
selectDate: [],
|
type: ""
|
}
|
},
|
|
|
onLoad(option) {
|
if (option.from) {
|
this.tabIndex = 1;
|
this.tabStatus = 1;
|
}
|
if (option.placeId) {
|
this.pagingParams.placeId = option.placeId
|
}
|
if (option.type) {
|
this.type = option.type;
|
if (option.type == 1) {
|
uni.setNavigationBarTitle({
|
title: '从业人员审核' // 设置为你想要显示的标题
|
});
|
}
|
}
|
|
|
},
|
|
onShow() {
|
this.currentRole = uni.getStorageSync("activeRole")
|
this.resetParams()
|
this.getSiteList()
|
},
|
onReachBottom() {
|
this.pagingParams.current++
|
this.getSiteList()
|
},
|
|
|
methods: {
|
|
|
async getSiteList() {
|
this.$nextTick(() => {
|
this.$refs.uToast.show({
|
type: 'loading',
|
message: '正在加载',
|
duration: 9999999
|
})
|
this.loadingStatus = 'loadingmore'
|
})
|
|
const params = {
|
placeName: this.keyWord,
|
confirmFlag: this.tabStatus
|
}
|
if (this.selectDate.length) {
|
params.startTime = this.selectDate[0],
|
params.endTime = this.selectDate[1]
|
}
|
const {
|
roleName
|
} = this.currentRole
|
// 过滤掉待完善状态的
|
const isApp = 1;
|
let res = ""
|
if (this.type == 1) {
|
res = await getPlacePractitionerPage({
|
...params,
|
roleName,
|
isApp,
|
...this.pagingParams
|
})
|
} else {
|
res = await getSiteMaintenanceData({
|
...params,
|
roleName,
|
isApp,
|
...this.pagingParams
|
})
|
}
|
// console.log(res);
|
const {
|
code,
|
data: {
|
records
|
}
|
} = res
|
if (code !== 200) {
|
uni.showToast({
|
title: '数据请求失败',
|
icon: 'error'
|
})
|
return
|
}
|
this.siteList = [...this.siteList, ...records]
|
this.$nextTick(() => {
|
this.$refs.uToast.isShow = false
|
})
|
this.loadingStatus = 'nomore'
|
},
|
changeTab(e) {
|
this.tabStatus = e.status;
|
this.resetParams()
|
this.getSiteList()
|
},
|
searchConfirm() {
|
this.resetParams()
|
this.getSiteList()
|
},
|
clearConfirm() {
|
this.keyWord = ''
|
this.resetParams()
|
this.searchConfirm()
|
},
|
|
|
showDateModal() {
|
this.$refs.dateRane.open();
|
},
|
|
|
resetParams() {
|
this.siteList = []
|
this.pagingParams.current = 1
|
},
|
findObjValue(value, obj) {
|
const res = obj.find(item => {
|
return item.status == value
|
})
|
return res
|
},
|
pushPage(placeId, id) {
|
const {
|
roleAlias
|
} = this.currentRole
|
if (roleAlias === "inhabitant") {
|
return
|
}
|
if (this.type == 1) {
|
this.$u.func.globalNavigator(
|
`/subPackage/workbench/views/examine?id=${id}&placeId=${placeId}&type=${this.type}`)
|
} else {
|
this.$u.func.globalNavigator(`/subPackage/workbench/views/examine?id=${id}&placeId=${placeId}`)
|
}
|
},
|
|
handleRestDate() {
|
this.selectDate = [];
|
this.resetParams();
|
this.getSiteList()
|
},
|
handleComfirmDate(val) {
|
this.selectDate = val;
|
this.resetParams();
|
this.getSiteList()
|
}
|
|
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
page {
|
background-color: #F5F5F5;
|
}
|
|
.hander {
|
background-color: #fff;
|
|
.tab {
|
width: 100%;
|
}
|
|
.tab-filter {
|
padding: 0 20rpx;
|
}
|
|
|
.search {
|
padding: 20rpx 30rpx;
|
}
|
}
|
|
.list {
|
margin: 20rpx 30rpx 0;
|
}
|
|
.list-item {
|
padding: 0 30rpx 20rpx;
|
border-radius: 8rpx;
|
|
.item-title {
|
padding: 30rpx 0;
|
border-bottom: 1px solid #F5F5F5;
|
}
|
|
.item-row {
|
padding: 10rpx 0;
|
|
.address {
|
width: 65%;
|
text-align: right;
|
}
|
}
|
}
|
</style>
|