刘翔宇-旅管家 4 years ago
parent 8e51cfad02
commit 695d5b2f3d

@ -4,32 +4,27 @@
<view class="box-header">
<view class="search-wrap">
<!-- 如果使用u-search组件必须要给v-model绑定一个变量 -->
<u-search v-model="keyword" placeholder="地址/河道等" @change="tosearch()" @search="tosearch()" height="56"
:action-style="{color: '#fff'}">
<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 title="问题类型">
<view class="slot-content">
<view class="item-box">
<view class="item" :class="[item.active ? 'active' : '']" @tap="tagClick(index)"
v-for="(item, index) in options1" :key="index">
{{item.label}}
</view>
</view>
<u-button type="primary" @click="tosearch"></u-button>
</view>
<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="value3" :title="value3==''?'工单状态':value3" @change="toChangeStatus()"
:options="options3">
<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="thumb" thumb-width="36">
<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="3">
@ -52,7 +47,7 @@
<u-col span="3">
<view class="demo-layout bg-purple-light">{{item.feedback_department.name}}</view>
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
@ -61,7 +56,7 @@
<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">
@ -73,21 +68,21 @@
</u-row>
</view>
<view class="footer" slot="foot">
<block >
<u-button :custom-style="editStyle" type="primary" size="medium"
@click="toedit(item.id)" :ripple="true">编辑
<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">删除
<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-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>
@ -103,54 +98,46 @@
backgroundColor: '#0385e5'
},
mask: false,
loadStatus:"loadmore",
loadText:{
loadmore:"加载更多",
nomore:"已经到底了"
loadStatus: "loadmore",
loadText: {
loadmore: "加载更多",
nomore: "已经到底了"
},
dataList: [],
thumb: "/static/img/location.png",
currentPage: 0,
lastPage:0,
editStyle:{
fontSize:'30rpx'
lastPage: 0,
editStyle: {
fontSize: '30rpx'
},
customStyle: {
marginLeft: '20px',
fontSize:'30rpx'
fontSize: '30rpx'
},
searchEntity: {
status: "",
ask_type_id: "",
keyword: "",
statusName: "",
ask_type: ""
},
currentRole: "inspector", //inspectormanageroperator
value1Arr: [],
value1: "",
value2: '',
value3: '',
value3v: '',
keyword: "",
title: "",
stat: [],
options1: [],
options2: [],
options3: [{
askTypeArr: [],
statusArr: [{
label: "所有",
value: "所有",
v: ""
value: "",
}, {
label: "待处理",
value: "待处理",
v: "save"
label: "已提交",
value: "1"
}, {
label: "处理中",
value: "处理中",
v: "ongong"
label: "已审核",
value: "2"
}, {
label: "已处理",
value: "已处理",
v: "finashed"
label: "已办结",
value: "3"
}]
}
},
onReachBottom: function(e) {
if(this.currentPage>=this.lastPage){
if (this.currentPage >= this.lastPage) {
this.loadStatus = "nomore"
return;
}
@ -163,33 +150,65 @@
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;
});
},
methods: {
openmask(){
this.mask=true
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
closemask() {
this.mask = false
// this.isPullDown(true);
},
toChangeStatus: function(value) {
var jsonSearch = this.options3.filter(function(e) {
var jsonSearch = this.statusArr.filter(function(e) {
return e.value == value;
});
this.value3v = jsonSearch[0].v;
console.log(jsonSearch)
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.value1Arr = [];
for (var m of this.options1) {
if (m.active) {
this.value1Arr.push(m.value);
}
}
this.loadPage(1)
this.$refs.uDropdown.close();
},
@ -197,18 +216,18 @@
this.options1[index].active = !this.options1[index].active;
},
toedit(id){
toedit(id) {
uni.navigateTo({
url:"../generalPatrol/generalPatrol?id="+id
url: "../generalPatrol/generalPatrol?id=" + id
})
},
todetail: function(id) {
uni.navigateTo({
url: "../generalPatrol/viewPatrol?id=" + id
})
},
loadPage: function(page) {
uni.hideKeyboard()
var that = this;
@ -219,13 +238,13 @@
data: {
page: page,
page_size: 4,
keyword: that.keyword
...that.searchEntity
},
utilSuccess: function(r) {
var res = r.data;
that.lastPage = r.last_page;
uni.stopPullDownRefresh(); // < ,
if(r.total<5){
if (r.total < 5) {
that.loadStatus = "nomore";
}
var hasNoMore = that.dataList.length < 4 && page > 1;
@ -248,8 +267,8 @@
}
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){
m.road_name = m.road ? m.road.name : ""
switch (m.status) {
case 1:
m.statusName = "已提交"
break
@ -262,9 +281,9 @@
case 4:
m.statusName = "已办结"
break
default:
break;
}
}
@ -285,43 +304,43 @@
}
});
},
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){
}
}
})
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) {
}
}
})
}
}
@ -352,7 +371,8 @@
margin: 10rpx 0;
font-size: 28rpx;
}
.u-card{
.u-card {
z-index: 1;
}
</style>
@ -363,16 +383,20 @@
background: #0385e5;
padding: 20rpx;
}
.overflowmask{
.overflowmask {
overflow: hidden;
}
.loadmore{
padding:24rpx!important
.loadmore {
padding: 24rpx !important
}
.listfixed{
.listfixed {
position: fixed;
width:100%;
width: 100%;
}
.u-config-wrap {
padding: 30rpx;
}
@ -405,4 +429,4 @@
}
}
}
</style>
</style>

@ -4,7 +4,7 @@
<view class="box-header">
<view class="search-wrap">
<!-- 如果使用u-search组件必须要给v-model绑定一个变量 -->
<u-search v-model="keyword" placeholder="请输入关键词" @search="tosearch()" height="56"
<u-search v-model="serachEntity.keyword" placeholder="请输入关键词" @custom="tosearch()" @search="tosearch()" height="56"
:action-style="{color: '#fff'}">
</u-search>
</view>
@ -12,10 +12,10 @@
</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="typeId" :title="typeStatus==''?'巡查类型':typeStatus" @change="toChangeTypeStatus"
<u-dropdown-item v-model="serachEntity.type" :title="typeStatus==''?'巡查类型':typeStatus" @change="toChangeTypeStatus"
:options="typeList">
</u-dropdown-item>
<u-dropdown-item v-model="statusId" :title="proStatus==''?'状态':proStatus" @change="toChangeStatus"
<u-dropdown-item v-model="serachEntity.status" :title="proStatus==''?'状态':proStatus" @change="toChangeStatus"
:options="statusList">
</u-dropdown-item>
@ -93,6 +93,11 @@
export default {
data() {
return {
serachEntity: {
keyword: "",
status: "",
type: ""
},
background: {
backgroundColor: '#0385e5'
},
@ -221,8 +226,8 @@
customLoading: false,
data: {
page: page,
page_size: 4,
keyword: that.keyword
page_size: 4,
...that.serachEntity
},
utilSuccess: function(r) {
var res = r.data;

@ -4,24 +4,24 @@
<view class="box-header">
<view class="search-wrap">
<!-- 如果使用u-search组件必须要给v-model绑定一个变量 -->
<u-search v-model="keyword" placeholder="请输入关键词" @search="tosearch()" height="56"
<u-search v-model="serachEntity.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="typeId" :title="typeStatus==''?'养护类型':typeStatus" @change="toChangeTypeStatus"
:options="typeList">
<u-dropdown ref="uDropdown" @open="openmask" @close="closemask" :class="mask?'':'overflowmask'">
<u-dropdown-item v-model="serachEntity.type" :title="typeStatus==''?'养护类型':typeStatus"
@change="toChangeTypeStatus" :options="typeList">
</u-dropdown-item>
<u-dropdown-item v-model="statusId" :title="proStatus==''?'状态':proStatus" @change="toChangeStatus"
:options="statusList">
<u-dropdown-item v-model="serachEntity.status" :title="proStatus==''?'状态':proStatus"
@change="toChangeStatus" :options="statusList">
</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="thumb" thumb-width="36">
<u-card :title="item.created_at" padding="20" margin="20rpx" :border="true" :sub-title="item.statusName"
:thumb="thumb" thumb-width="36">
<view class="" slot="body" @click="todetail(item.id)">
<u-row gutter="16">
<u-col span="4">
@ -42,7 +42,8 @@
<view class="demo-layout bg-purple">所属片区</view>
</u-col>
<u-col span="9">
<view class="demo-layout bg-purple-light">{{item.area_info?item.area_info.name:""}}</view>
<view class="demo-layout bg-purple-light">{{item.area_info?item.area_info.name:""}}
</view>
</u-col>
<u-col span="3">
<view class="demo-layout bg-purple">所属道路</view>
@ -62,25 +63,25 @@
</view>
<view class="footer" slot="foot">
<block v-if="item.status==0">
<u-button :custom-style="editStyle" type="primary" size="medium"
@click="toedit(item.id)" :ripple="true">编辑
<u-button :custom-style="editStyle" type="primary" size="medium" @click="toedit(item.id)"
:ripple="true">编辑
</u-button>
</block>
<block v-if="item.status!=0">
<u-button :custom-style="editStyle" type="primary" size="medium"
@click="todetail(item.id)" :ripple="true">查看
<u-button :custom-style="editStyle" type="primary" size="medium" @click="todetail(item.id)"
:ripple="true">查看
</u-button>
</block>
<block >
<u-button type="error" size="medium" @click="del(item.id)"
:custom-style="customStyle" :ripple="true">删除
<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-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>
@ -95,56 +96,66 @@
background: {
backgroundColor: '#0385e5'
},
serachEntity: {
keyword: "",
status: "",
type: ""
},
mask: false,
loadStatus:"loadmore",
loadText:{
loadmore:"加载更多",
nomore:"已经到底了"
loadStatus: "loadmore",
loadText: {
loadmore: "加载更多",
nomore: "已经到底了"
},
dataList: [],
thumb: "/static/img/location.png",
currentPage: 0,
lastPage:0,
editStyle:{
fontSize:'30rpx'
lastPage: 0,
editStyle: {
fontSize: '30rpx'
},
customStyle: {
marginLeft: '20px',
fontSize:'30rpx'
fontSize: '30rpx'
},
value1Arr: [],
keyword: "",
title: "",
stat: [],
statusId:"",
proStatus:"",
typeId:"",
typeStatus:"",
statusId: "",
proStatus: "",
typeId: "",
typeStatus: "",
typeList: [{
label: "所有",
value: ''
}, {
value:1,
label:"雨水管道疏挖"
},
{
value:2,
label:"雨水管道疏通"
},
{
value:3,
label:"汛期助排"
},
{
value:4,
label:"污泥外运"
}],
label: "所有",
value: ''
}, {
value: 1,
label: "雨水管道疏挖"
},
{
value: 2,
label: "雨水管道疏通"
},
{
value: 3,
label: "汛期助排"
},
{
value: 4,
label: "污泥外运"
},
{
value: 5,
label: "出水口排查"
}
],
statusList: [{
label: "所有",
value: ''
}, {
label: "待审核",
value: "0"
value: 0
}, {
label: "已审核",
value: 1
@ -154,14 +165,11 @@
}, {
label: "已退回",
value: 3
}, {
label: "缺陷办结",
value: 4
}]
}
},
onReachBottom: function(e) {
if(this.currentPage>=this.lastPage){
if (this.currentPage >= this.lastPage) {
this.loadStatus = "nomore"
return;
}
@ -177,12 +185,12 @@
this.loadPage(1);
},
methods: {
openmask(){
this.mask=true
openmask() {
this.mask = true
// this.isPullDown(false);
},
closemask(){
this.mask=false
closemask() {
this.mask = false
// this.isPullDown(true);
},
tosearch() {
@ -190,18 +198,18 @@
this.$refs.uDropdown.close();
},
toChangeStatus: function(value) {
for(var m of this.statusList){
if(value == m.value){
for (var m of this.statusList) {
if (value == m.value) {
this.proStatus = m.label
}
}
console.log(this.proStatus )
console.log(this.proStatus)
this.loadPage(1);
this.$refs.uDropdown.close();
},
toChangeTypeStatus: function(value) {
for(var m of this.typeList){
if(value == m.value){
for (var m of this.typeList) {
if (value == m.value) {
this.typeStatus = m.label
}
}
@ -212,9 +220,9 @@
this.options1[index].active = !this.options1[index].active;
},
toedit(id){
toedit(id) {
uni.navigateTo({
url:"../rainmaintain/rainmaintain?id="+id
url: "../rainmaintain/rainmaintain?id=" + id
})
},
todetail: function(id) {
@ -222,10 +230,10 @@
url: "../rainmaintaininfo/rainmaintainInfo?id=" + id
})
},
loadAllArea(){
loadAllArea() {
},
loadPage: function(page) {
uni.hideKeyboard()
var that = this;
@ -236,14 +244,13 @@
data: {
page: page,
page_size: 4,
keyword: that.keyword,
area_id:that.areaId
...that.serachEntity
},
utilSuccess: function(r) {
var res = r.data;
that.lastPage = r.last_page;
uni.stopPullDownRefresh(); // < ,
if(r.total<5){
if (r.total < 5) {
that.loadStatus = "nomore";
}
var hasNoMore = that.dataList.length < 4 && page > 1;
@ -266,7 +273,7 @@
}
for (var m of dataList) {
m.created_at = m.created_at.split("T")[0]
switch(m.status){
switch (m.status) {
case 0:
m.statusName = "待审核"
break
@ -282,39 +289,42 @@
case 4:
m.statusName = "缺陷办结"
break
default:
break;
}
switch(m.type){
switch (m.type) {
case 1:
m.typeName = "雨水管道疏挖"
m.road_name = m.circulation_info.road?m.circulation_info.road.name:""
m.road_name = m.circulation_info.road ? m.circulation_info.road.name :
""
break
case 2:
m.typeName = "雨水管道疏通"
m.road_name = m.circulation_info.road?m.circulation_info.road.name:""
m.road_name = m.circulation_info.road ? m.circulation_info.road.name :
""
break
case 3:
m.typeName = "汛期助排"
m.road_name = m.help_discharge_info.road?m.help_discharge_info.road.name:""
m.road_name = m.help_discharge_info.road ? m.help_discharge_info.road
.name : ""
break
case 4:
m.typeName = "污泥外运"
m.road_name = m.mire_info.road?m.mire_info.road.name:""
break
case 5:
m.typeName = "出水口排查"
m.road_name = m.out_water_info.road?m.out_water_info.road.name:""
break
m.road_name = m.mire_info.road ? m.mire_info.road.name : ""
break
case 5:
m.typeName = "出水口排查"
m.road_name = m.out_water_info.road ? m.out_water_info.road.name : ""
break
default:
break;
}
}
@ -335,43 +345,43 @@
}
});
},
del(id){
var that = this;
uni.showModal({
title: '提示',
content: '是否确定删除?',
success(res) {
if(res.confirm){
that.util.request({
api: '/api/mobile/rain-maintains/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){
}
}
})
del(id) {
var that = this;
uni.showModal({
title: '提示',
content: '是否确定删除?',
success(res) {
if (res.confirm) {
that.util.request({
api: '/api/mobile/rain-maintains/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) {
}
}
})
}
}
@ -402,7 +412,8 @@
margin: 10rpx 0;
font-size: 28rpx;
}
.u-card{
.u-card {
z-index: 1;
}
</style>
@ -413,16 +424,20 @@
background: #0385e5;
padding: 20rpx;
}
.overflowmask{
.overflowmask {
overflow: hidden;
}
.loadmore{
padding:24rpx!important
.loadmore {
padding: 24rpx !important
}
.listfixed{
.listfixed {
position: fixed;
width:100%;
width: 100%;
}
.u-config-wrap {
padding: 30rpx;
}
@ -455,4 +470,4 @@
}
}
}
</style>
</style>

Loading…
Cancel
Save