|
|
<template>
|
|
|
<view class="boxContent">
|
|
|
|
|
|
<view class="box-header">
|
|
|
<view class="search-wrap">
|
|
|
<!-- 如果使用u-search组件,必须要给v-model绑定一个变量 -->
|
|
|
<u-search v-model="searchEntity.keyword" placeholder="地址/河道等" @custom="tosearch()" @search="tosearch()"
|
|
|
height="56" :action-style="{color: '#fff'}">
|
|
|
</u-search>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
<view :class="mask?'list listfixed':'list'" style="padding-top: 100rpx;">
|
|
|
<u-dropdown ref="uDropdown" @open="openmask" @close="closemask" :class="mask?'':'overflowmask'">
|
|
|
<u-dropdown-item v-model="searchEntity.ask_type_id"
|
|
|
:title="searchEntity.ask_type_id==''?'问题类型':searchEntity.ask_type" @change="toChangeAsk"
|
|
|
:options="askTypeArr">
|
|
|
</u-dropdown-item>
|
|
|
|
|
|
<u-dropdown-item v-model="searchEntity.status"
|
|
|
:title="searchEntity.status==''?'工单状态':searchEntity.statusName" @change="toChangeStatus"
|
|
|
:options="statusArr">
|
|
|
</u-dropdown-item>
|
|
|
</u-dropdown>
|
|
|
<block v-for="(item, index) in dataList">
|
|
|
<u-card :title="item.created_at" padding="20" margin="20rpx" :border="true" :sub-title="item.statusName"
|
|
|
thumb-width="36">
|
|
|
<view class="" slot="body" @click="todetail(item.id)">
|
|
|
<u-row gutter="16">
|
|
|
<u-col span="4">
|
|
|
<view class="demo-layout bg-purple">问题类别:</view>
|
|
|
</u-col>
|
|
|
<u-col span="8">
|
|
|
<view class="demo-layout bg-purple-light">{{item.ask_type_detail.value}}</view>
|
|
|
</u-col>
|
|
|
<u-col span="4">
|
|
|
<view class="demo-layout bg-purple">问题内容:</view>
|
|
|
</u-col>
|
|
|
<u-col span="8">
|
|
|
<view class="demo-layout bg-purple-light">{{item.ask_content_detail.value}}</view>
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
<u-row gutter="16">
|
|
|
<u-col span="4">
|
|
|
<view class="demo-layout bg-purple">反馈科室:</view>
|
|
|
</u-col>
|
|
|
<u-col span="8">
|
|
|
<view class="demo-layout bg-purple-light">{{item.feedback_department.name}}</view>
|
|
|
</u-col>
|
|
|
|
|
|
</u-row>
|
|
|
<!-- <u-row gutter="16">
|
|
|
<u-col span="3">
|
|
|
<view class="demo-layout bg-purple">所属道路:</view>
|
|
|
</u-col>
|
|
|
<u-col span="9">
|
|
|
<view class="demo-layout bg-purple-light">{{item.road_name}}</view>
|
|
|
</u-col>
|
|
|
|
|
|
</u-row> -->
|
|
|
<u-row gutter="16">
|
|
|
<u-col span="3">
|
|
|
<view class="demo-layout bg-purple">描述:</view>
|
|
|
</u-col>
|
|
|
<u-col span="12">
|
|
|
<view class="demo-layout bg-purple-light">{{item.content}}</view>
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
</view>
|
|
|
<view class="footer" slot="foot">
|
|
|
<block>
|
|
|
<u-button :custom-style="editStyle" type="primary" size="medium" @click="toedit(item.id)"
|
|
|
:ripple="true">编辑
|
|
|
</u-button>
|
|
|
</block>
|
|
|
<block>
|
|
|
<u-button type="error" size="medium" @click="del(item.id)" :custom-style="customStyle"
|
|
|
:ripple="true">删除
|
|
|
</u-button>
|
|
|
</block>
|
|
|
</view>
|
|
|
</u-card>
|
|
|
|
|
|
</block>
|
|
|
<u-loadmore class="loadmore" :status="loadStatus" :load-text="loadText" />
|
|
|
<u-empty text="暂无数据" margin-top="200" v-if="dataList.length==0" mode="list"></u-empty>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
background: {
|
|
|
backgroundColor: '#0385e5'
|
|
|
},
|
|
|
mask: false,
|
|
|
loadStatus: "loadmore",
|
|
|
loadText: {
|
|
|
loadmore: "加载更多",
|
|
|
nomore: "已经到底了"
|
|
|
},
|
|
|
dataList: [],
|
|
|
currentPage: 0,
|
|
|
lastPage: 0,
|
|
|
editStyle: {
|
|
|
fontSize: '30rpx'
|
|
|
},
|
|
|
customStyle: {
|
|
|
marginLeft: '20px',
|
|
|
fontSize: '30rpx'
|
|
|
},
|
|
|
searchEntity: {
|
|
|
status: "",
|
|
|
ask_type_id: "",
|
|
|
keyword: "",
|
|
|
statusName: "",
|
|
|
ask_type: ""
|
|
|
},
|
|
|
askTypeArr: [],
|
|
|
statusArr: [{
|
|
|
label: "所有",
|
|
|
value: "",
|
|
|
}, {
|
|
|
label: "已提交",
|
|
|
value: "1"
|
|
|
}, {
|
|
|
label: "已审核",
|
|
|
value: "2"
|
|
|
}, {
|
|
|
label: "已办结",
|
|
|
value: "3"
|
|
|
}]
|
|
|
}
|
|
|
},
|
|
|
onReachBottom: function(e) {
|
|
|
if (this.currentPage >= this.lastPage) {
|
|
|
this.loadStatus = "nomore"
|
|
|
return;
|
|
|
}
|
|
|
this.loadPage(this.currentPage + 1);
|
|
|
},
|
|
|
onPullDownRefresh: function(e) {
|
|
|
this.loadPage(1);
|
|
|
},
|
|
|
onShow: function() {
|
|
|
var that = this;
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
let that = this;
|
|
|
this.loadPage(1);
|
|
|
this.loadType({
|
|
|
'number': "general_type",
|
|
|
}, function(res) {
|
|
|
console.log(res)
|
|
|
var arr = [];
|
|
|
arr.push({
|
|
|
label: "所有",
|
|
|
value: "",
|
|
|
})
|
|
|
for (var m of res) {
|
|
|
arr.push({
|
|
|
label: m.value,
|
|
|
value: m.id,
|
|
|
})
|
|
|
}
|
|
|
that.askTypeArr = arr;
|
|
|
});
|
|
|
},
|
|
|
onNavigationBarButtonTap(val) {
|
|
|
window.android.finish();
|
|
|
},
|
|
|
methods: {
|
|
|
loadType(data, call) {
|
|
|
let that = this;
|
|
|
this.util.request({
|
|
|
api: '/api/admin/parameter/show',
|
|
|
data: data,
|
|
|
utilSuccess: function(res) {
|
|
|
call(res.detail)
|
|
|
},
|
|
|
utilFail: function(res) {
|
|
|
this.util.alert(res);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
openmask() {
|
|
|
this.mask = true
|
|
|
// this.isPullDown(false);
|
|
|
},
|
|
|
closemask() {
|
|
|
this.mask = false
|
|
|
// this.isPullDown(true);
|
|
|
},
|
|
|
toChangeStatus: function(value) {
|
|
|
var jsonSearch = this.statusArr.filter(function(e) {
|
|
|
return e.value == value;
|
|
|
});
|
|
|
this.searchEntity.statusName = jsonSearch[0].label;
|
|
|
this.loadPage(1)
|
|
|
this.$refs.uDropdown.close();
|
|
|
},
|
|
|
toChangeAsk: function(value) {
|
|
|
var jsonSearch = this.askTypeArr.filter(function(e) {
|
|
|
return e.value == value;
|
|
|
});
|
|
|
this.searchEntity.ask_type = jsonSearch[0].label;
|
|
|
this.loadPage(1)
|
|
|
this.$refs.uDropdown.close();
|
|
|
},
|
|
|
tosearch() {
|
|
|
this.loadPage(1)
|
|
|
this.$refs.uDropdown.close();
|
|
|
},
|
|
|
tagClick(index) {
|
|
|
this.options1[index].active = !this.options1[index].active;
|
|
|
},
|
|
|
|
|
|
toedit(id) {
|
|
|
uni.navigateTo({
|
|
|
url: "../generalPatrol/generalPatrol?id=" + id
|
|
|
})
|
|
|
},
|
|
|
|
|
|
todetail: function(id) {
|
|
|
uni.navigateTo({
|
|
|
url: "../generalPatrol/viewPatrol?id=" + id
|
|
|
})
|
|
|
},
|
|
|
|
|
|
loadPage: function(page) {
|
|
|
uni.hideKeyboard()
|
|
|
var that = this;
|
|
|
this.util.request({
|
|
|
bindThis: that,
|
|
|
api: '/api/mobile/common-inspection/index',
|
|
|
customLoading: false,
|
|
|
data: {
|
|
|
page: page,
|
|
|
page_size: 4,
|
|
|
...that.searchEntity
|
|
|
},
|
|
|
utilSuccess: function(r) {
|
|
|
var res = r.data;
|
|
|
that.lastPage = r.last_page;
|
|
|
uni.stopPullDownRefresh(); // 服务器总条数 < 每页条数, 会将第一页的条数重新返回
|
|
|
if (r.total < 5) {
|
|
|
that.loadStatus = "nomore";
|
|
|
}
|
|
|
var hasNoMore = that.dataList.length < 4 && page > 1;
|
|
|
if (hasNoMore || res.length == 0 && page > 1) {
|
|
|
// 已加载到最后一页
|
|
|
that.loadStatus = "nomore";
|
|
|
uni.showToast({
|
|
|
title: '已加载到最后一页',
|
|
|
icon: 'none'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
var dataList = that.dataList;
|
|
|
|
|
|
|
|
|
if (page == 1) {
|
|
|
dataList = res;
|
|
|
} else {
|
|
|
dataList.push(...res);
|
|
|
}
|
|
|
for (var m of dataList) {
|
|
|
m.created_at = m.created_at.split("T")[0]
|
|
|
m.road_name = m.road ? m.road.name : ""
|
|
|
switch (m.status) {
|
|
|
case 1:
|
|
|
m.statusName = "已提交"
|
|
|
break
|
|
|
case 2:
|
|
|
m.statusName = "已复核"
|
|
|
break
|
|
|
case 3:
|
|
|
m.statusName = "已处理"
|
|
|
break
|
|
|
case 4:
|
|
|
m.statusName = "已办结"
|
|
|
break
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
console.log(dataList)
|
|
|
|
|
|
that.currentPage = page;
|
|
|
that.dataList = dataList;
|
|
|
},
|
|
|
utilFail: function(res) {
|
|
|
uni.stopPullDownRefresh();
|
|
|
|
|
|
if (page == 1) {
|
|
|
|
|
|
that.currentPage = page;
|
|
|
}
|
|
|
|
|
|
this.util.alert(res);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
del(id) {
|
|
|
var that = this;
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '是否确定删除?',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
that.util.request({
|
|
|
api: '/api/mobile/common-inspection/destroy',
|
|
|
customLoading: false,
|
|
|
method: "get",
|
|
|
data: {
|
|
|
id: id
|
|
|
},
|
|
|
utilSuccess: function(r) {
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "提交成功",
|
|
|
complete() {
|
|
|
that.loadPage(1)
|
|
|
},
|
|
|
duration: 2000
|
|
|
})
|
|
|
},
|
|
|
utilFail: function(r) {
|
|
|
this.util.alert(res);
|
|
|
},
|
|
|
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
</script>
|
|
|
<style>
|
|
|
.boxContent {
|
|
|
background: #f3f4f6;
|
|
|
min-height: 100vh;
|
|
|
}
|
|
|
|
|
|
.footer {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
|
|
|
.box-header {
|
|
|
|
|
|
position: fixed;
|
|
|
/* top: 0; */
|
|
|
width: 100%;
|
|
|
z-index: 99;
|
|
|
}
|
|
|
|
|
|
|
|
|
.u-row {
|
|
|
margin: 10rpx 0;
|
|
|
font-size: 28rpx;
|
|
|
}
|
|
|
|
|
|
.u-card {
|
|
|
z-index: 1;
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.search-wrap {
|
|
|
background: #0385e5;
|
|
|
padding: 20rpx;
|
|
|
}
|
|
|
|
|
|
.overflowmask {
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|
|
|
.loadmore {
|
|
|
padding: 24rpx !important
|
|
|
}
|
|
|
|
|
|
.listfixed {
|
|
|
position: fixed;
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
.u-config-wrap {
|
|
|
padding: 30rpx;
|
|
|
}
|
|
|
|
|
|
.bg-purple {
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.slot-content {
|
|
|
background-color: #FFFFFF;
|
|
|
padding: 24rpx;
|
|
|
|
|
|
.item-box {
|
|
|
margin-bottom: 50rpx;
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
justify-content: space-between;
|
|
|
|
|
|
.item {
|
|
|
border: 1px solid $u-type-primary;
|
|
|
color: $u-type-primary;
|
|
|
padding: 8rpx 40rpx;
|
|
|
border-radius: 100rpx;
|
|
|
margin-top: 30rpx;
|
|
|
}
|
|
|
|
|
|
.active {
|
|
|
color: #FFFFFF;
|
|
|
background-color: $u-type-primary;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style>
|