刘翔宇-旅管家 4 years ago
parent 10e2389c67
commit 65dae29716

@ -31,5 +31,8 @@ Vue.prototype.util = util;
import gcoord from "@/utils/gcoord.js"; import gcoord from "@/utils/gcoord.js";
Vue.prototype.gcoord = gcoord; Vue.prototype.gcoord = gcoord;
import moment from "moment"
Vue.prototype.$moment = moment;
import {VueJsonp} from 'vue-jsonp' //中间有忘记大括号出现install undefind问题 import {VueJsonp} from 'vue-jsonp' //中间有忘记大括号出现install undefind问题
Vue.use(VueJsonp) Vue.use(VueJsonp)

@ -1,5 +1,6 @@
{ {
"dependencies": { "dependencies": {
"moment": "^2.29.4",
"uview-ui": "^1.8.4", "uview-ui": "^1.8.4",
"vue-jsonp": "^2.0.0" "vue-jsonp": "^2.0.0"
} }

@ -114,6 +114,14 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
// "disableScroll": true // "disableScroll": true
}
}, {
"path": "plan/plan",
"style": {
"navigationBarTitleText": "雨管养护",
"enablePullDownRefresh": false
// "disableScroll": true
} }
}] }]
}, { }, {
@ -138,6 +146,14 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
// "disableScroll": true // "disableScroll": true
}
}, {
"path": "plan/plan",
"style": {
"navigationBarTitleText": "雨管巡查",
"enablePullDownRefresh": false
// "disableScroll": true
} }
}] }]
}, { }, {

@ -20,6 +20,8 @@
<text class="navtxt">雨管巡查</text> <text class="navtxt">雨管巡查</text>
</view> </view>
</u-col> </u-col>
</u-row>
<u-row gutter="16">
<u-col span="6" v-if="isshowyh"> <u-col span="6" v-if="isshowyh">
<view class="demo-layout bg-purple" @click="toviewplan(2)"> <view class="demo-layout bg-purple" @click="toviewplan(2)">
<text class="iconfont icon-zuzhijiagouguanli"></text> <text class="iconfont icon-zuzhijiagouguanli"></text>

@ -4,50 +4,67 @@
<view :class="mask?'list listfixed':'list'" style="padding-top: 20rpx;"> <view :class="mask?'list listfixed':'list'" style="padding-top: 20rpx;">
<block v-for="(item, index) in dataList"> <block v-for="(item, index) in dataList">
<u-card :title="item.created_at" padding="20" margin="20rpx" :border="true" <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" >
<view class="" slot="body" @click="todetail(item.id)">
<u-row gutter="16"> <u-row gutter="16">
<u-col span="12"> <u-col span="24">
<view class="demo-layout bg-purple">地址/排放点</view> <view class="demo-layout bg-purple-light">{{item.name}}</view>
</u-col>
<u-col span="12">
<view class="demo-layout bg-purple-light">{{item.address}}</view>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16"> <u-row gutter="16">
<u-col span="4"> <u-col span="4">
<view class="demo-layout bg-purple">巡查类型</view> <view class="demo-layout bg-purple">巡查频率</view>
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<view class="demo-layout bg-purple-light">{{item.typeName}}</view> <view class="demo-layout bg-purple-light">{{item.day}}一个循环</view>
</u-col> </u-col>
<u-col span="4"> <u-col span="4">
<view class="demo-layout bg-purple">所属片区</view> <view class="demo-layout bg-purple">所属片区</view>
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<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>
<u-col span="4"> <u-col span="4">
<view class="demo-layout bg-purple">所属道路</view> <view class="demo-layout bg-purple">开始日期</view>
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<view class="demo-layout bg-purple-light">{{item.road_name}}</view> <view class="demo-layout bg-purple-light">{{item.start_date}}</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.end_date}}</view>
</u-col> </u-col>
</u-row> </u-row>
<!-- <u-row gutter="16"> <u-row gutter="16">
<u-col span="3"> <u-col span="3">
<view class="demo-layout bg-purple">描述</view> <view class="demo-layout bg-purple">描述</view>
</u-col> </u-col>
<u-col span="12"> <u-col span="12">
<view class="demo-layout bg-purple-light">{{item.content}}</view> <view class="demo-layout bg-purple-light">{{item.remark}}</view>
</u-col> </u-col>
</u-row> --> </u-row>
<div>所属道路</div>
<block v-for="(mod,index) of item.roads" :key="index">
<div style="display: flex;justify-content: space-between;height: 60px;line-height: 60px;
align-items: center;">
<div>
{{mod.road.name}}
</div>
<div>
<u-button :ripple="true" @click="toInspection(mod.road.id,mod.road.name)"
ripple-bg-color="#909399">去巡查
</u-button>
</div>
</div>
</block>
</view> </view>
</u-card> </u-card>
</block> </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> <u-empty text="暂无数据" margin-top="200" v-if="dataList.length==0" mode="list"></u-empty>
</view> </view>
</view> </view>
@ -68,20 +85,20 @@
backgroundColor: '#0385e5' backgroundColor: '#0385e5'
}, },
mask: false, mask: false,
loadStatus:"loadmore", loadStatus: "loadmore",
loadText:{ loadText: {
loadmore:"加载更多", loadmore: "加载更多",
nomore:"已经到底了" nomore: "已经到底了"
}, },
dataList: [], dataList: [],
thumb: "/static/img/location.png", thumb: "/static/img/location.png",
currentPage: 0, currentPage: 0,
lastPage:0, lastPage: 0,
} }
}, },
onReachBottom: function(e) { onReachBottom: function(e) {
if(this.currentPage>=this.lastPage){ if (this.currentPage >= this.lastPage) {
this.loadStatus = "nomore" this.loadStatus = "nomore"
return; return;
} }
@ -97,12 +114,18 @@
this.loadPage(1); this.loadPage(1);
}, },
methods: { methods: {
openmask(){ toInspection(road_id, road_name) {
this.mask=true let url = "/raininspection/raininspection/raininspection?roadid=" + road_id + "&roadname=" + road_name
uni.navigateTo({
url: url
})
},
openmask() {
this.mask = true
// this.isPullDown(false); // this.isPullDown(false);
}, },
closemask(){ closemask() {
this.mask=false this.mask = false
// this.isPullDown(true); // this.isPullDown(true);
}, },
tosearch() { tosearch() {
@ -126,7 +149,7 @@
var res = r.data; var res = r.data;
that.lastPage = r.last_page; that.lastPage = r.last_page;
uni.stopPullDownRefresh(); // < , uni.stopPullDownRefresh(); // < ,
if(r.total<5){ if (r.total < 5) {
that.loadStatus = "nomore"; that.loadStatus = "nomore";
} }
var hasNoMore = that.dataList.length < 4 && page > 1; var hasNoMore = that.dataList.length < 4 && page > 1;
@ -190,7 +213,8 @@
margin: 10rpx 0; margin: 10rpx 0;
font-size: 28rpx; font-size: 28rpx;
} }
.u-card{
.u-card {
z-index: 1; z-index: 1;
} }
</style> </style>
@ -201,16 +225,20 @@
background: #0385e5; background: #0385e5;
padding: 20rpx; padding: 20rpx;
} }
.overflowmask{
.overflowmask {
overflow: hidden; overflow: hidden;
} }
.loadmore{
padding:24rpx!important .loadmore {
padding: 24rpx !important
} }
.listfixed{
.listfixed {
position: fixed; position: fixed;
width:100%; width: 100%;
} }
.u-config-wrap { .u-config-wrap {
padding: 30rpx; padding: 30rpx;
} }

@ -1,22 +1,277 @@
<template> <template>
<view> <view class="boxContent">
<view :class="mask?'list listfixed':'list'" style="padding-top: 20rpx;">
<block v-for="(item, index) in dataList">
<u-card :title="item.created_at" padding="20" margin="20rpx" :border="true">
<view class="" slot="body">
<u-row gutter="16">
<u-col span="24">
<view class="demo-layout bg-purple-light">{{item.name}}</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.day}}一个循环</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.area_info?item.area_info.name:''}}
</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.start_date}}</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.end_date}}</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.remark}}</view>
</u-col>
</u-row>
<div>所属道路</div>
<block v-for="(mod,index) of item.roads" :key="index">
<div style="display: flex;justify-content: space-between;height: 60px;line-height: 60px;
align-items: center;">
<div>
{{mod.road.name}}
</div>
<div>
<u-button :ripple="true" @click="toInspection(mod.road.id,mod.road.name)"
ripple-bg-color="#909399">去巡查
</u-button>
</div>
</div>
</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> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
serachEntity: {
keyword: "",
status: "",
type: "",
date: "2022-10",
area_id: ""
},
background: {
backgroundColor: '#0385e5'
},
mask: false,
loadStatus: "loadmore",
loadText: {
loadmore: "加载更多",
nomore: "已经到底了"
},
dataList: [],
thumb: "/static/img/location.png",
currentPage: 0,
lastPage: 0,
} }
}, },
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) {
this.serachEntity.date = this.$moment().format("YYYY-MM");
this.loadPage(1);
},
methods: { methods: {
toInspection(road_id, road_name) {
let url = "/raininspection/rainmaintain/rainmaintain?roadid=" + road_id + "&roadname=" + road_name
uni.navigateTo({
url: url
})
},
openmask() {
this.mask = true
// this.isPullDown(false);
},
closemask() {
this.mask = false
// this.isPullDown(true);
},
tosearch() {
this.loadPage(1)
this.$refs.uDropdown.close();
},
loadPage: function(page) {
uni.hideKeyboard()
var that = this;
this.util.request({
bindThis: that,
api: '/api/mobile/maintain-plan/index',
customLoading: false,
data: {
page: page,
page_size: 4,
...that.serachEntity
},
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;
} }
</script> var dataList = that.dataList;
if (page == 1) {
dataList = res;
} else {
dataList.push(...res);
}
that.currentPage = page;
that.dataList = dataList;
},
utilFail: function(res) {
uni.stopPullDownRefresh();
if (page == 1) {
that.currentPage = page;
}
this.util.alert(res);
}
});
}
}
}
</script>
<style> <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> </style>

@ -1,6 +1,5 @@
<template> <template>
<view class="boxContent"> <view class="boxContent">
<view class="box-header"> <view class="box-header">
<view class="search-wrap"> <view class="search-wrap">
<!-- 如果使用u-search组件必须要给v-model绑定一个变量 --> <!-- 如果使用u-search组件必须要给v-model绑定一个变量 -->
@ -11,6 +10,7 @@
</view> </view>
<view :class="mask?'list listfixed':'list'" style="padding-top: 100rpx;"> <view :class="mask?'list listfixed':'list'" style="padding-top: 100rpx;">
<view class='showclear' v-if='showClear'>附近道路:</view> <view class='showclear' v-if='showClear'>附近道路:</view>
<u-radio-group :wrap="true"> <u-radio-group :wrap="true">
<u-radio @change="radioChange" v-for="(item, index) in dataList" :key="index" <u-radio @change="radioChange" v-for="(item, index) in dataList" :key="index"
@ -23,6 +23,7 @@
</u-radio-group> </u-radio-group>
<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> <u-empty text="暂无数据" margin-top="200" v-if="dataList.length==0" mode="list"></u-empty>
</view> </view>
<view class="box-footer"> <view class="box-footer">
@ -58,7 +59,8 @@
totype: "", totype: "",
road_id: "", road_id: "",
road_name: "", road_name: "",
orderId:"" orderId: "",
locinfo: null
} }
}, },
@ -78,23 +80,27 @@
onLoad(options) { onLoad(options) {
let that = this; let that = this;
that.totype = options.type; that.totype = options.type;
that.orderId = options.orderId?options.orderId:"" that.orderId = options.orderId ? options.orderId : ""
uni.getLocation({ uni.getLocation({
type: "wgs84", type: "wgs84",
geocode: true, geocode: true,
success(res) { success(res) {
var loc = null var loc = null
console.log(typeof(window.android)) console.log(typeof(window.android))
if (typeof(window.android)!=undefined&&typeof(window.android)!="undefined") { if (typeof(window.android) != undefined && typeof(window.android) != "undefined") {
loc = window.android.getLocInfo(); that.locinfo = loc = window.android.getLocInfo();
} }
if (loc) { if (loc) {
that.latitude = JSON.parse(loc).lat; that.latitude = JSON.parse(loc).lat;
that.longitude = JSON.parse(loc).lon; that.longitude = JSON.parse(loc).lon;
} else { } else {
if (res) {
that.latitude = res.latitude; that.latitude = res.latitude;
that.longitude = res.longitude; that.longitude = res.longitude;
} }
}
that.loadPage(1); that.loadPage(1);
} }
}) })
@ -102,12 +108,11 @@
}, },
methods: { methods: {
towhichtype() { towhichtype() {
if(this.road_id==""){ if (this.road_id == "") {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "请选择道路", title: "请选择道路",
complete() { complete() {},
},
duration: 2000 duration: 2000
}) })
return return
@ -121,14 +126,15 @@
// } // }
if (totype == 'daily') { if (totype == 'daily') {
url = "/packageB/pages/dailyInspection/dailyInspection?roadid=" + this.road_id + "&roadname=" + this url = "/packageB/pages/dailyInspection/dailyInspection?roadid=" + this.road_id + "&roadname=" + this
.road_name+"&orderId="+this.orderId .road_name + "&orderId=" + this.orderId
} }
if (totype == 'rainmaintain') { if (totype == 'rainmaintain') {
url = "/rainmaintain/rainmaintain/rainmaintain?roadid=" + this.road_id + "&roadname=" + this.road_name+"&orderId="+this.orderId url = "/rainmaintain/rainmaintain/rainmaintain?roadid=" + this.road_id + "&roadname=" + this
.road_name + "&orderId=" + this.orderId
} }
if (totype == 'raininspection') { if (totype == 'raininspection') {
url = "/raininspection/raininspection/raininspection?roadid=" + this.road_id + "&roadname=" + this url = "/raininspection/raininspection/raininspection?roadid=" + this.road_id + "&roadname=" + this
.road_name+"&orderId="+this.orderId .road_name + "&orderId=" + this.orderId
} }
uni.navigateTo({ uni.navigateTo({
url: url url: url
@ -140,12 +146,11 @@
this.road_name = arr[1] this.road_name = arr[1]
}, },
tosearch() { tosearch() {
if(this.keyword==""){ if (this.keyword == "") {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "请输入关键字", title: "请输入关键字",
complete() { complete() {},
},
duration: 2000 duration: 2000
}) })
return return
@ -175,7 +180,7 @@
name: that.keyword, name: that.keyword,
}, },
utilSuccess: function(r) { utilSuccess: function(r) {
if (that.longitude != "") { if (that.longitude && that.longitude != "" && that.longitude != "0") {
// var res = r; // var res = r;
that.showClear = true that.showClear = true
that.loadStatus = "nomore"; that.loadStatus = "nomore";

@ -1,7 +1,7 @@
import md5 from "./md5.min"; import md5 from "./md5.min";
const HOSTARR = { const HOSTARR = {
'development': 'http://192.168.60.100:9001', //'development': 'http://192.168.60.100:9001',
//'development': 'http://patrol.115.langye.net', 'development': 'http://patrol.115.langye.net',
'production': 'http://192.168.60.100:9001' 'production': 'http://192.168.60.100:9001'
}; // 审核状态 }; // 审核状态

Loading…
Cancel
Save