<template>
|
<view class="container">
|
<u-sticky v-if="from == 'home'">
|
<view class="tabsAndSearch">
|
<view class="tabs">
|
<u-tabs :list="tabsList" @click="tabClick" :inactiveStyle="{color:'#999999'}"
|
:activeStyle="{color:'#017BFC'}" :scrollable="false"></u-tabs>
|
</view>
|
<view class="search flex j-c-s-b a-i-c f-28">
|
|
<view class="filter-box flex a-i-c" @click="isShowPopup = true">
|
<text class="f-28 " style="margin-right:5rpx;">筛选</text>
|
<u-icon name="arrow-down"></u-icon>
|
</view>
|
|
<u-search placeholder="请输入场所名称" v-model="iptContext" :clearabled="true" :showAction="true"
|
:animation="true" @change="keyWordChange" @search="searchConfirm" @clear="clearConfirm"
|
@custom="searchConfirm"></u-search>
|
</view>
|
</view>
|
</u-sticky>
|
<view class="info-box">
|
<view class="records-card" v-for="(records, index) in recordsData" :key="records.id"
|
@click="pushPage(records)">
|
<view class="item-title flex j-c-s-b a-i-c">
|
<text class="title">{{ records.placeName }}</text>
|
<u-tag v-if="records.status == 1" text="待完善" type="warning" plain plainFill></u-tag>
|
<u-tag v-if="records.status == 2" text="已完善" type="success" plain plainFill></u-tag>
|
</view>
|
<view class="info">
|
<view class="charge-man">
|
<text>场所负责人:</text>
|
<text>{{ records.principal || '未完善' }}</text>
|
</view>
|
<view class="phone">
|
<text>手机号:</text>
|
<text>{{ records.phone || '未完善' }}</text>
|
</view>
|
<view class="phone">
|
<text>时间:</text>
|
<text>{{records.createTime}}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<u-toast ref="uToast"></u-toast>
|
<u-loadmore :status="status" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
|
<u-popup :show="isShowPopup" @close="closePopup()" mode="top" :safeAreaInsetTop="true">
|
<view class="popup">
|
<view class="popup-title f-30">
|
是否有二维码
|
</view>
|
<view class="popup-select flex">
|
<block v-for="(i,k) in filterList" :key="k">
|
<view :class="['popup-cell',tempFilterIndex == k?'bgc-main c-ff':'cell-before c-main']"
|
@click="selectItem(i,k)">
|
{{i.name}}
|
</view>
|
</block>
|
</view>
|
<view class="popup-btn flex j-c-s-b a-i-c">
|
<button class="popup-btn-item f-30 c-main" @click="restSelect()">重置</button>
|
<button class="popup-btn-item bgc-main c-ff f-30" @click="comfirmSelect()">确定</button>
|
</view>
|
</view>
|
</u-popup>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getLocationRecord
|
} from '@/api/place/place.js'
|
export default {
|
data() {
|
return {
|
tabsList: [{
|
type: 0,
|
name: '全部'
|
},
|
{
|
type: 1,
|
name: '待完善'
|
},
|
{
|
type: 2,
|
name: '已完善'
|
}
|
],
|
recordsData: [],
|
iptContext: '',
|
pagingParams: {
|
current: 1,
|
size: 10
|
},
|
tabsType: 0,
|
status: 'nomore',
|
currentRole: {},
|
from: "home", //页面跳入来源
|
houseCode: "",
|
isShowPopup: false,
|
filterList: [{
|
name: "全部",
|
type: ""
|
},
|
{
|
name: "有",
|
type: 1
|
},
|
{
|
name: "无",
|
type: 2
|
},
|
|
],
|
filterIndex: 0,
|
selectType: "",
|
tempFilterIndex: 0
|
}
|
},
|
onLoad(option) {
|
if (option.from) {
|
this.from = option.from;
|
// this.iptContext = option.name;
|
// this.getrRecordList(option.name);
|
}
|
if (option.stdId) {
|
this.houseCode = option.stdId
|
}
|
},
|
|
onShow() {
|
this.recordsData = []
|
this.currentRole = uni.getStorageSync('activeRole')
|
|
this.getrRecordList()
|
},
|
onReachBottom() {
|
this.pagingParams.current++
|
this.getrRecordList()
|
},
|
methods: {
|
async getrRecordList(placeName = this.iptContext, isPerfect = this.tabsType) {
|
this.$nextTick(() => {
|
this.$refs.uToast.show({
|
type: 'loading',
|
message: '正在加载',
|
duration: 9999999
|
})
|
this.status = 'loadmore'
|
})
|
const {
|
roleName
|
} = this.currentRole
|
const {
|
code,
|
data: {
|
records
|
}
|
} = await getLocationRecord({
|
placeName,
|
isPerfect,
|
roleName,
|
...this.pagingParams,
|
houseCode: this.houseCode
|
})
|
if (code !== 200) {
|
this.$u.func.showToast({
|
title: "获取数据失败",
|
icon: "error"
|
})
|
return
|
}
|
this.recordsData = [...this.recordsData, ...records]
|
this.$nextTick(() => {
|
this.$refs.uToast.isShow = false
|
})
|
this.status = 'nomore'
|
},
|
tabClick({
|
type
|
}) {
|
this.pagingParams = {
|
current: 1,
|
size: 10
|
}
|
this.recordsData = []
|
this.tabsType = type
|
this.getrRecordList(this.iptContext, this.tabsType)
|
},
|
searchConfirm() {
|
this.recordsData = []
|
this.pagingParams = {
|
current: 1,
|
size: 10
|
}
|
this.getrRecordList(this.iptContext, this.tabsType)
|
},
|
clearConfirm() {
|
this.iptContext = ''
|
this.searchConfirm()
|
},
|
pushPage({
|
id,
|
status,
|
houseCode
|
}) {
|
if (!id) {
|
uni.showToast({
|
title: "关键参数为空",
|
icon: "error"
|
})
|
return
|
}
|
if (status == 1) {
|
this.$u.func.globalNavigator(
|
`/subPackage/workbench/views/editCscj?id=${id}&houseCode=${houseCode}`)
|
} else {
|
this.$u.func.globalNavigator(`/subPackage/workbench/views/cscj?id=${id}&type=1`)
|
}
|
},
|
|
selectItem(item, index) {
|
this.tempFilterIndex = index;
|
this.selectType = item.type;
|
},
|
comfirmSelect() {
|
this.filterIndex = this.tempFilterIndex;
|
this.pagingParams = {
|
current: 1,
|
size: 10,
|
source: this.selectType
|
}
|
this.recordsData = []
|
this.getrRecordList(this.iptContext, this.tabsType)
|
this.isShowPopup = false;
|
},
|
|
restSelect() {
|
this.filterIndex = 0;
|
this.tempFilterIndex = 0;
|
this.pagingParams = {
|
current: 1,
|
size: 10,
|
source: ""
|
}
|
this.recordsData = []
|
this.getrRecordList(this.iptContext, this.tabsType)
|
this.isShowPopup = false;
|
},
|
|
closePopup() {
|
this.selectType = this.pagingParams.source || "";
|
this.tempFilterIndex = this.filterIndex;
|
this.isShowPopup = false;
|
}
|
|
|
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
page {
|
background-color: #F5F5F5;
|
}
|
|
.tabsAndSearch {
|
background-color: #fff;
|
|
.tabs {}
|
|
.search {
|
padding: 20rpx 50rpx;
|
|
.filter-box {
|
padding: 0 20rpx;
|
margin-right: 20rpx;
|
}
|
|
.search-ipt {
|
border: 0;
|
border-radius: 9999rpx;
|
background-color: #F5F5F5;
|
}
|
}
|
|
}
|
|
.info-box {
|
padding: 20rpx 30rpx;
|
|
// background-color: #f6f6f6;
|
.records-card {
|
background: #fff;
|
padding: 0 30rpx 30rpx;
|
border-radius: 10rpx;
|
margin-bottom: 20rpx;
|
|
.item-title {
|
padding: 20rpx 0;
|
border-bottom: 1rpx solid #F5F5F5;
|
}
|
|
.title {
|
font-size: 32rpx;
|
font-weight: bold;
|
max-width: 80%;
|
white-space: nowrap;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
}
|
|
.charge-man,
|
.phone {
|
display: flex;
|
justify-content: space-between;
|
font-weight: 30rpx;
|
color: #717171;
|
margin-top: 25rpx;
|
font-size: 30rpx;
|
}
|
|
&:last-child {
|
margin-bottom: 20rpx;
|
}
|
}
|
}
|
|
.popup-title {
|
padding: 20rpx 30rpx;
|
}
|
|
.popup-select {
|
padding: 20rpx 30rpx;
|
}
|
|
.popup-cell {
|
padding: 6rpx 30rpx;
|
margin-right: 30rpx;
|
font-size: 28rpx;
|
border-radius: 6rpx;
|
}
|
|
.cell-before {
|
border: 1px solid currentColor;
|
}
|
|
.popup-btn {
|
padding: 30rpx;
|
|
.popup-btn-item {
|
width: 310rpx;
|
height: 78rpx;
|
line-height: 78rpx;
|
border-radius: 10rpx;
|
border: none;
|
margin: 0;
|
}
|
|
.popup-btn-item:first-child {
|
border: 1px solid currentColor;
|
background-color: rgb(236, 244, 255);
|
}
|
|
.popup-btn-item::after {
|
border: none;
|
}
|
}
|
</style>
|