<template>
|
<view>
|
<u-sticky>
|
<view class="hander">
|
<view class="tab">
|
<u-tabs :list="tabList" :scrollable="false" :current="tabIndex" @click="changeTab"
|
:inactiveStyle="{color:'#999999'}" :activeStyle="{color:'#017BFC'}">
|
</u-tabs>
|
<view class="search flex j-c-s-b a-i-c">
|
<view class="tab-filter flex j-c-c a-i-c" @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"></u-search>
|
</view>
|
</view>
|
</view>
|
</u-sticky>
|
<view class="list">
|
<view class="list-item bgc-ff mb-20" v-for="item in reportList" :key="item.id" @click="pushPage(item)">
|
<view class="item-title flex a-i-c j-c-s-b mb-20">
|
<text class="f-32 fw">{{ findObjValue(item.type, typeList, 'type').name }}</text>
|
<u-tag class="u_tag" size="mini" plain plainFill
|
:text="findObjValue(item.confirmFlag, tabList, 'status').name"
|
:type="findObjValue(item.confirmFlag, tabList, 'status').type"></u-tag>
|
</view>
|
<view class="item-row flex a-i-c j-c-s-b">
|
<text class="f-28">姓名</text>
|
<text class="f-28 c-66">{{ item.realName }}</text>
|
</view>
|
<view class="item-row flex a-i-c j-c-s-b">
|
<text class="f-28">手机</text>
|
<text class="f-28 c-66">{{ item.phone }}</text>
|
</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.address || "" }}</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-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
|
<date-range-modal ref="dateRane" @comfirm="handleComfirmDate" @rest="handleRestDate" />
|
</view>
|
</template>
|
|
<script>
|
import {
|
getPage
|
} from '@/api/task/taskReportForRepairs.js'
|
import dateRangeModal from '@/components/dateRangeModal/modal.vue';
|
export default {
|
components: {
|
dateRangeModal
|
},
|
data() {
|
return {
|
reportList: [],
|
pagingParams: {
|
current: 1,
|
size: 10
|
},
|
tabList: [
|
|
{
|
name: "全部",
|
status: "",
|
},
|
{
|
name: "待处理",
|
status: 1,
|
type: 'warning'
|
},
|
{
|
name: "处理中",
|
status: 2,
|
type: 'success'
|
},
|
{
|
name: "已处理",
|
status: 3,
|
type: 'success'
|
},
|
],
|
typeList: [{
|
name: "公共维修",
|
type: 1
|
},
|
{
|
name: "居家维修",
|
type: 2
|
},
|
{
|
name: "矛盾纠纷",
|
type: 3
|
},
|
{
|
name: "投诉举报",
|
type: 4
|
},
|
{
|
name: "企业商户上报",
|
type: 5
|
},
|
{
|
name: "统战上报",
|
type: 6
|
}
|
],
|
tabIndex: 0,
|
tabStatus: "",
|
keyWord: '',
|
loadingStatus: 'nomore',
|
selectDate: [],
|
houseCode: ""
|
}
|
},
|
|
onLoad(option) {
|
if (option.from) {
|
this.tabIndex = 1;
|
this.tabStatus = 1;
|
}
|
if (option.code) {
|
this.houseCode = option.code;
|
}
|
},
|
|
onShow() {
|
this.currentRole = uni.getStorageSync("activeRole")
|
this.reportList = []
|
this.pagingParams.current = 1;
|
this.getPageList()
|
},
|
onReachBottom() {
|
this.pagingParams.current++
|
this.getPageList()
|
},
|
methods: {
|
async getPageList() {
|
this.loadingStatus = 'loadingmore'
|
const params = {
|
realName: this.keyWord,
|
confirmFlag: this.tabStatus
|
}
|
if (this.selectDate.length) {
|
params.startTime = this.selectDate[0]
|
params.endTime = this.selectDate[1]
|
}
|
if (this.houseCode) {
|
params.addressCode = this.houseCode;
|
}
|
const {
|
roleName
|
} = this.currentRole
|
const res = await getPage({
|
...params,
|
roleName,
|
...this.pagingParams
|
})
|
const {
|
code,
|
data: {
|
records
|
}
|
} = res
|
if (code !== 200) {
|
uni.showToast({
|
title: '数据请求失败',
|
icon: 'error'
|
})
|
return
|
}
|
this.reportList = [...this.reportList, ...records]
|
this.loadingStatus = 'nomore'
|
},
|
changeTab(e) {
|
this.tabStatus = e.status;
|
this.resetParams()
|
this.getPageList()
|
},
|
searchConfirm() {
|
this.resetParams()
|
this.getPageList()
|
},
|
clearConfirm() {
|
this.keyWord = ''
|
this.searchConfirm()
|
},
|
resetParams() {
|
this.reportList = []
|
this.pagingParams.current = 1
|
},
|
findObjValue(value, obj, word) {
|
const res = obj.find(item => {
|
return item[word] == value
|
})
|
return res
|
},
|
pushPage(item) {
|
const data = JSON.stringify(item)
|
// this.$u.func.globalNavigator('/subPackage/workbench/views/reportAudit?id='+id)
|
this.$u.func.globalNavigator('/subPackage/workbench/views/reportAudit?data=' + data)
|
},
|
|
showDateModal() {
|
this.$refs.dateRane.open();
|
},
|
|
handleRestDate() {
|
this.selectDate = [];
|
this.resetParams();
|
this.getPageList()
|
},
|
handleComfirmDate(val) {
|
this.selectDate = val;
|
this.resetParams();
|
this.getPageList()
|
}
|
}
|
}
|
</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: 75%;
|
text-align: right;
|
}
|
}
|
}
|
</style>
|