master
xielei 2024-11-08 15:11:23 +08:00
parent b02e418a72
commit 99420a1e87
18 changed files with 326 additions and 312 deletions

18
App.vue
View File

@ -87,4 +87,22 @@
display: flex;
justify-content: space-between;
}
page {
height: 100%;
background-color: #f3f5f8;
}
.time-ranger{
background-color: #ffffff;
padding-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn{
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
</style>

View File

@ -133,21 +133,6 @@
<style lang="scss" scoped>
.jcsj-box{
.time-ranger{
// display: flex;
// align-items: center;
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn{
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.jcsj-content{
max-height:100vh;
overflow-y:auto

View File

@ -76,6 +76,7 @@
},
onPullDownRefresh() {
setTimeout(function () {
console.log(11);
uni.stopPullDownRefresh();
}, 1000);
},
@ -127,6 +128,7 @@
}
},
methods: {
getYlzList() {
uni.$http.post('/gunshiApp/xyt/stPptnRReal/list').then(res => {
if (res.data.code == 200) {
@ -171,13 +173,14 @@
}
},
onLoad() {
this.getList()
// this.getList()
this.getYlzList()
this.userList = uni.getStorageSync('value')
},
onShow() {
this.setInsert()
this.getList()
}
}

View File

@ -1,6 +1,6 @@
<template>
<view :style="{height:'100vh',overflow:'hidden',backgroundColor: '#f0f0f0',}">
<u-navbar title="消息中心" :autoBack="true" :titleStyle="{
<u-navbar title="消息中心1" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
@ -57,15 +57,12 @@
};
},
onLoad(options){
console.log(options);
this.list.push(JSON.parse(options.item))
this.yd(item)
this.yd(JSON.parse(options.item))
},
methods: {
yd(item){
uni.$http.post('/gunshiApp/xyt/messageCenter/update').then(res => {
})
uni.$http.post('/gunshiApp/xyt/messageCenter/update',{...item,status:1})
},
confirm(e) {
console.log(e);

View File

@ -76,9 +76,10 @@
list: []
};
},
onLoad(options) {
onShow(options) {
this.getList()
},
computed:{
startTime:function (){
return this.stm?moment(this.stm).format('YYYY-MM-DD HH:mm:ss'):this.start
@ -135,22 +136,6 @@
</script>
<style lang="scss" scoped>
.time-ranger {
margin-bottom: 10px;
.start-time,
.end-time {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn {
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.uni-input-placeholder {
text-align: center;

View File

@ -6,7 +6,7 @@
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view class=""
style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;overflow: auto;">
style="margin-top: 50px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;overflow: auto;">
<view style="padding:0 10px;backgroundColor:#fff">
<view class="time-ranger">
<view class="start-time">
@ -22,7 +22,7 @@
</view>
</view>
</view>
<view style="height:calc(100vh - 150px);overflow: auto;">
<view style="height:calc(100vh - 150px);overflow: auto;" v-if='list.length !== 0'>
<view class="" v-for="(item,index) in list" :key="index"
style="margin:10px;background-color: #fff;padding: 10px;">
<view class="item">
@ -53,6 +53,9 @@
</view>
</view>
</view>
<view style="height:calc(100vh - 150px);display: flex;align-items: center;justify-content: center;background-color: #fff;" v-else>
<image src="../../../../static/empty.png" mode="" ></image>
</view>
</view>
<u-datetime-picker :show="showTime" v-model="stm" mode="datetime" @confirm="showTime=false"
@ -87,10 +90,10 @@
computed: {
startTime: function () {
return this.stm ? moment(this.stm).format('YYYY-MM-DD HH:mm:ss') : this.start
return this.stm ? moment(this.stm).format('YYYY-MM-DD') : this.start
},
endTime: function () {
return this.etm ? moment(this.etm).format('YYYY-MM-DD HH:mm:ss') : this.end
return this.etm ? moment(this.etm).format('YYYY-MM-DD') : this.end
}
},
methods: {
@ -101,12 +104,12 @@
console.log(uni.getStorageSync('value'));
let params = {
"pageSo": {
"pageSize": 10,
"pageSize": 999,
"pageNumber": 1
},
"dateTimeRangeSo": {
start: this.stm ? moment(this.stm).format('YYYY-MM-DD HH:mm:ss') : '',
end: this.etm ? moment(this.etm).format('YYYY-MM-DD HH:mm:ss') : ''
start:this.stm?moment(this.stm).format('YYYY-MM-DD 00:00:00'):'',
end:this.etm?moment(this.etm).format('YYYY-MM-DD 23:59:59'):''
},
"isHandle": 1,
"inspectUserId": uni.getStorageSync('value').userId
@ -134,23 +137,6 @@
</script>
<style lang="scss" scoped>
.time-ranger {
margin-bottom: 10px;
.start-time,
.end-time {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn {
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.myTitleStyle {
font-size: 30px;
background-color: red;

View File

@ -4,18 +4,38 @@
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view style="background-color: #f0f0f0;padding: 10px;overflow: auto;margin-top: 44px;">
<view class="" v-for="item in dataList" class="contentItemWx" @click="toDetail(item)">
<view class="contentItem">
<view class="itemWxyhT">
<text>{{type[item.maintainType]}}</text>
<uni-icons type="right"></uni-icons>
<view style="background-color: #f0f0f0;padding: 10px;margin-top: 44px;">
<view style="padding:0 10px;backgroundColor:#fff">
<view class="time-ranger">
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{startTime}}</text>
</view>
<view class="itemWxyhB">
<text>{{item.reportTime}}</text>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{endTime}}</text>
<view class="search-btn" @click="searchTm">
搜索
</view>
</view>
</view>
</view>
<view class="" style="height:calc(100vh - 150px);overflow: auto;" v-if="dataList.length !== 0">
<view class="" v-for="item in dataList" class="contentItemWx" @click="toDetail(item)">
<view class="contentItem">
<view class="itemWxyhT">
<text>{{type[item.maintainType]}}</text>
<uni-icons type="right"></uni-icons>
</view>
<view class="itemWxyhB">
<text>{{item.reportTime}}</text>
</view>
</view>
</view>
</view>
<view style="height:calc(100vh - 150px);display: flex;align-items: center;justify-content: center;background-color: #fff;" v-else>
<image src="../../../../static/empty.png" mode="" ></image>
</view>
<!-- <view class="content">
<formTop labelWidth="150rpx" />
</view> -->
@ -24,6 +44,10 @@
</view> -->
</view>
<!-- <button @click="submitForm">Submit</button> -->
<u-datetime-picker :show="showTime" v-model="stm" mode="datetime" @confirm="showTime=false"
@cancel="showTime=false"></u-datetime-picker>
<u-datetime-picker :show="showTime1" v-model="etm" mode="datetime" @confirm="showTime1=false"
@cancel="showTime1=false"></u-datetime-picker>
</view>
</template>
@ -43,6 +67,12 @@
reportTime: moment().format('YYYY-MM-DD HH:mm:ss'),
userId: ''
},
showTime: false,
showTime1: false,
start: '请选择开始时间',
end: '请选择结束时间',
stm: '',
etm: '',
dataList: [],
type: {
1: "溢洪道清障",
@ -57,6 +87,15 @@
onShow() {
this.getList()
},
computed: {
startTime: function () {
return this.stm ? moment(this.stm).format('YYYY-MM-DD') : this.start
},
endTime: function () {
return this.etm ? moment(this.etm).format('YYYY-MM-DD') : this.end
}
},
methods: {
toDetail(item){
uni.navigateTo({
@ -66,12 +105,12 @@
getList() {
let params = {
"pageSo": {
"pageSize": 10,
"pageSize": 999,
"pageNumber": 1
},
"dateTimeSo": {
"start": "2023-11-06 00:00:00",
"end": "2024-11-06 00:00:00"
start:this.stm?moment(this.stm).format('YYYY-MM-DD 00:00:00'):'',
end:this.etm?moment(this.etm).format('YYYY-MM-DD 23:59:59'):''
}
}
uni.$http.post('/gunshiApp/xyt/maintain/service/page', params).then(res => {
@ -103,7 +142,7 @@
}
</script>
<style>
<style lang="scss" scoped>
.content {
/* margin: 10px; */
padding: 10px;
@ -131,5 +170,6 @@
background-color: rgba(255, 255, 255, 1);
padding: 10px;
margin-bottom: 10px;
margin-top: 10px;
}
</style>

View File

@ -20,8 +20,8 @@
</view>
</view>
<view class="" style="style='overflow: auto;height:calc(100vh - 150px)'">
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;">
<view class="" style='overflow: auto;height:calc(100vh - 150px)' v-if="list.length !== 0">
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;padding: 10px;">
<view class="item">
<!-- {{item.title}} -->
<view class="title">
@ -46,7 +46,9 @@
</view>
</view>
</view>
<view style="height:calc(100vh - 150px);display: flex;align-items: center;justify-content: center;background-color: #fff;" v-else>
<image src="../../../../static/empty.png" mode="" ></image>
</view>
</view>
<u-datetime-picker
:show="showTime"
@ -131,19 +133,6 @@
</script>
<style lang="scss" scoped>
.time-ranger{
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn{
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.myTitleStyle {
font-size: 30px;
background-color: red;

View File

@ -135,7 +135,7 @@
margin-bottom: 2vh;
width: 95%;
height: 15vh;
background-color: #fff;
/* background-color: #fff; */
}

View File

@ -144,21 +144,6 @@
<style lang="scss" scoped>
.jcsj-box{
.time-ranger{
// display: flex;
// align-items: center;
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn{
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.jcsj-content{
max-height:calc(100vh - 89px - 43px - 45px);
overflow-y:auto

View File

@ -138,21 +138,6 @@
<style lang="scss" scoped>
.jcsj-box{
.time-ranger{
// display: flex;
// align-items: center;
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn{
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.jcsj-content{
max-height:100vh;
width: 100%;

View File

@ -1,8 +1,9 @@
<template>
<view class="skinfo" @click="toDetail()">
<view class="skinfo">
<view class="title">
<view class="left">
<u-icon name="file-text" color="#f59d29" size="20"></u-icon>
<text style="margin-left:5px">{{dataform.resName}}</text>
</view>
<view class="right">
@ -11,23 +12,24 @@
</view>
<view class="content">
<view class="" style="display: flex;">
<image src="../../static/c1.png" mode="" style="width:30%;height: 120px;"></image>
<view class="listItem">
<!-- <image src="../../static/c1.png" mode="" style="width:30%;height: 120px;"></image> -->
<image :src="showImg" style="width: 30%;height: 120px;margin: 5px;" @click="previewImage(showImg)"></image>
<view class="listItem" @click="toDetail()">
<view class="item-text" v-for="(v,k) of list" :key="k">
<text>{{v}}</text>:
<text>{{dataform[k]}}</text>
</view>
</view>
</view>
<view class="bottom">
<view class="bottom" @click="toDetail()">
<view class="bottomItem">
<view class="withd-2">
<text>生活供水m³/s</text>:
<text>0</text>
<text>{{shgs}}</text>
</view>
<view class="withd-2">
<text>生态供水m³/s</text>:
<text>2.1</text>
<text>{{stgs}}</text>
</view>
</view>
</view>
@ -45,10 +47,10 @@
"rz":'当前水位m',
"today":'今日雨量mm',
'flLowLimLev':'汛限水位m',
"demo":'比汛期m',
"afsltdz":'比汛期m',
'wcrstel':'堰顶高程m',
'crestElev':'坝顶高程m',
"24h":'24h预报mm',
"h24":'24h预报mm',
"yesterdayDrp":'昨日雨量mm',
'totCap':'总库容m³',
"cap":'蓄水量万m³'
@ -66,15 +68,72 @@
// 8:15.4,
// 9:129.06,
// 10:75.34
}
},
stgs:'',
shgs:'',
imageList:[],
baseUrl:'http://223.75.53.141:9102/test.by-lyf.tmp',
showImg:''
}
},
mounted() {
console.log('小玉潭水库222');
this.getList()
this.getDrp()
},
methods:{
previewImage(item){
uni.previewImage({
urls: [this.showImg],
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
},
fail: function(err) {
console.log(err.errMsg);
}
}
});
},
getDrp(){
uni.$http.get('/gunshiApp/xyt/reservoir/water/detail?stcd=716164061&_=1731028927554').then(res=>{
this.dataform={...this.dataform,...res.data.data}
console.log(this.dataform,'drp yesterdayDrp');
})
uni.$http.post('/gunshiApp/xyt/reservoir/water/list').then(res=>{
console.log(res,'drp list');
this.dataform={...this.dataform,...res.data.data[0]}
console.log(this.dataform,'drp list');
})
uni.$http.post('/gunshiApp/xyt/stWaterRReal/list').then(res=>{
res.data.data.forEach(item=>{
if(item.sttp == 'QQ'){
this.stgs=item.q
}
if(item.sttp == 'PQ'){
this.shgs=item.q
}
})
})
uni.$http.post('/gunshiApp/xyt/resProjectImg/list',{resCode:42120250085}).then(res=>{
res.data.data.forEach(item=>{
if(item.projType == 1){
this.imageList = item.files.map((item,index)=>
{item.url = this.baseUrl + item.filePath
if(index == 0){
this.showImg = item.url
console.log(this.showImg,'this.showImg');
}
return item})
}
})
})
},
toDetail(){
uni.navigateTo({
url:'/pages/skInfo/detail/index'

View File

@ -5,7 +5,7 @@
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;overflow: auto;">
<view class="" style="margin-top: 50px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;overflow: auto;">
<view style="padding:0 10px;backgroundColor:#fff">
<view class="time-ranger">
<view class="start-time">
@ -21,39 +21,44 @@
</view>
</view>
</view>
<view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item">
<!-- {{item.title}} -->
<view class="title">
{{item.taskTitle}}
</view>
<view class="titleRight" @click="toDetail(item)">
<view class="border">
{{isHandle==0?'已处理':'待处理'}}
<view class="" v-if="list.length !== 0">
<view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;" >
<view class="item">
<!-- {{item.title}} -->
<view class="title">
{{item.taskTitle}}
</view>
<view class="titleRight" @click="toDetail(item)">
<view class="border">
{{isHandle==0?'已处理':'待处理'}}
</view>
<u-icon name="arrow-right" size="20"></u-icon>
</view>
<u-icon name="arrow-right" size="20"></u-icon>
</view>
</view>
<view class="contentItem">
<view class="itemC">
<text>巡检项</text>
<text>{{item.itemDesc}}</text>
</view>
<view class="itemC">
<text>巡查人</text>
<text>{{item.inspectUserName}}</text>
</view>
<view class="itemC">
<text>巡查时间</text>
<text>{{item.finishTime}}</text>
<view class="contentItem">
<view class="itemC">
<text>巡检项</text>
<text>{{item.itemDesc}}</text>
</view>
<view class="itemC">
<text>巡查人</text>
<text>{{item.inspectUserName}}</text>
</view>
<view class="itemC">
<text>巡查时间</text>
<text>{{item.finishTime}}</text>
</view>
</view>
</view>
</view>
<view style="height:calc(100vh - 150px);display: flex;align-items: center;justify-content: center;background-color: #fff;" v-else>
<image src="../../static/empty.png" mode="" ></image>
</view>
</view>
<u-datetime-picker :show="showTime" v-model="stm" mode="datetime" @confirm="showTime=false"
<u-datetime-picker :show="showTime" v-model="stm" mode="date" @confirm="showTime=false"
@cancel="showTime=false"></u-datetime-picker>
<u-datetime-picker :show="showTime1" v-model="etm" mode="datetime" @confirm="showTime1=false"
<u-datetime-picker :show="showTime1" v-model="etm" mode="date" @confirm="showTime1=false"
@cancel="showTime1=false"></u-datetime-picker>
</view>
</template>
@ -84,10 +89,10 @@
computed:{
startTime:function (){
return this.stm?moment(this.stm).format('YYYY-MM-DD HH:mm:ss'):this.start
return this.stm?moment(this.stm).format('YYYY-MM-DD'):this.start
},
endTime:function (){
return this.etm?moment(this.etm).format('YYYY-MM-DD HH:mm:ss'):this.end
return this.etm?moment(this.etm).format('YYYY-MM-DD'):this.end
}
},
methods: {
@ -98,15 +103,15 @@
console.log(uni.getStorageSync('value'));
let params = {
"pageSo": {
"pageSize": 10,
"pageSize": 999,
"pageNumber": 1
},
"dateTimeRangeSo": {
start:this.stm?moment(this.stm).format('YYYY-MM-DD HH:mm:ss'):'',
end:this.etm?moment(this.etm).format('YYYY-MM-DD HH:mm:ss'):''
start:this.stm?moment(this.stm).format('YYYY-MM-DD 00:00:00'):'',
end:this.etm?moment(this.etm).format('YYYY-MM-DD 23:59:59'):''
},
"isHandle": 0,
"inspectUserId": uni.getStorageSync('value').userId
"handleUserId": uni.getStorageSync('value').userId
}
uni.$http.post('/gunshiApp/xyt/inspect/detail/page', params).then(res => {
this.list=res.data.data.records
@ -131,22 +136,6 @@
</script>
<style lang="scss" scoped>
.time-ranger {
margin-bottom: 10px;
.start-time,
.end-time {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn {
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.myTitleStyle {
font-size: 30px;
background-color: red;

View File

@ -13,13 +13,13 @@
<u-form-item label="内容说明" prop="maintainContent" borderBottom labelPosition='top' required labelWidth="100px">
<u--textarea v-model="model1.maintainContent" placeholder="请输入内容"></u--textarea>
</u-form-item>
<u-form-item label="现场图片" prop="fileListpics" borderBottom labelPosition='top' labelWidth="100px">
<u-upload :fileList="fileListpics" @afterRead="afterRead" @delete="deletePic" name="pics" multiple
<u-form-item label="现场图片" prop="pics" borderBottom labelPosition='top' labelWidth="100px" required>
<u-upload :fileList="model1.pics" @afterRead="(e)=>afterRead(e,'pics')" @delete="deletePic" name="pics" multiple
multiple accept='image' :maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="现场视频" prop="fileListvideos" borderBottom labelPosition='top' labelWidth="100px">
<u-upload :fileList="fileListvideos" @afterRead="afterRead" @delete="deletePic" name="videos" multiple
<u-form-item label="现场视频" prop="videos" borderBottom labelPosition='top' labelWidth="100px">
<u-upload :fileList="model1.videos" @afterRead="(e)=>afterRead(e,'videos')" @delete="deletePic" name="videos" multiple
multiple accept='video' :maxCount="10"></u-upload>
</u-form-item>
@ -80,6 +80,11 @@
message: '请选择管护类型',
trigger: ['blur', 'change']
},
'fileListpics': {
required: true,
message: '请选择上传现场图片',
trigger: ['blur', 'change']
},
},
radio: '',
switchVal: false
@ -91,13 +96,14 @@
this.$refs.uForm.validateField('maintainType')
},
submit() {
this.$refs.uForm.validate().then(res => {
let params = {
...this.model1,
maintainType: this.actions.find(item => item.name == this.model1.maintainType).value,
}
console.log(params);
this.$emit('submitForm', params)
}).catch(errors => {
uni.$u.toast('校验失败')
@ -105,16 +111,15 @@
},
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
this.model1[`${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
async afterRead(event,key) {
// multiple true , file
let lists = [].concat(event.file)
console.log(`fileList${event.name}`,event);
let fileListLen = this[`fileList${event.name}`].length
let fileListLen = this.model1[`${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
this.model1[`${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
@ -122,14 +127,17 @@
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url,event.name)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
let item = this.model1[`${event.name}`][fileListLen]
console.log(this.model1[`${event.name}`],fileListLen,item);
this.model1[`${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
...result
}))
console.log(this.model1[`${event.name}`],this.model1);
fileListLen++
}
},
uploadFilePromise(url,name) {
return new Promise((resolve, reject) => {
@ -146,9 +154,12 @@
// if(obj){
// }
console.log(JSON.parse(res.data),this.model1,name);
this.model1[name].push({fileId:JSON.parse(res.data).data.fileId})
resolve(res.data.data)
// console.log(JSON.parse(res.data),this.model1,name);
console.log(JSON.parse(res.data).data);
let params = JSON.parse(res.data).data
params.url = 'http://223.75.53.141:9102/test.by-lyf.tmp' +JSON.parse(res.data).data.filePath
// this.model1[name].push({fileId:JSON.parse(res.data).data.fileId})
resolve(params)
}, 1000)
}
});

View File

@ -52,10 +52,14 @@ export default {
console.log({...params,...this.formData});
uni.$http.post('/gunshiApp/xyt/maintain/service/insert',{...params,...this.formData}).then(res=>{
if(res.data.code == 200){
// uni.$u.toast('')
uni.$u.toast('新增成功')
uni.switchTab({
url: '/pages/homeIndex/index'
});
setTimeout(()=>{
uni.switchTab({
url: '/pages/homeIndex/index'
});
},500)
}
})
},

View File

@ -1,132 +1,131 @@
<template>
<view :style="{height:'100vh',overflow:'hidden'}">
<u-status-bar></u-status-bar>
<u-navbar title="巡查任务" :autoBack="true" :titleStyle="{
<u-navbar title="巡查任务1" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view style="padding:0 10px; margin-top:50px">
<view class="time-ranger" >
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
</view>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{etm}}</text>
<view class="search-btn" @click="searchHandle">
搜索
</view>
</view>
</view >
<view class="" style='overflow: auto;height:calc(100vh - 150px)'>
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;">
<view class="item">
<!-- {{item.title}} -->
<view class="title">
{{item.taskTitle}}
<view class="time-ranger">
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
</view>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{etm}}</text>
<view class="search-btn" @click="searchHandle">
搜索
</view>
<view class="titleRight" @click="toDetail(item)">
<view class="border">
{{status[item.status]}}
</view>
</view>
<view class="" style='overflow: auto;height:calc(100vh - 150px)' v-if="list.length !== 0">
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;padding: 10px;">
<view class="item">
<!-- {{item.title}} -->
<view class="title">
{{item.taskTitle}}
</view>
<view class="titleRight" @click="toDetail(item)">
<view class="border">
{{status[item.status]}}
</view>
<u-icon name="arrow-right" size="20"></u-icon>
</view>
<u-icon name="arrow-right" size="20"></u-icon>
</view>
</view>
<view class="contentItem">
<view class="itemC">
<text>开始日期</text>
<text>{{item.startDate}}</text>
</view>
<view class="itemC">
<text>结束日期</text>
<text>{{item.endDate}}</text>
<view class="contentItem">
<view class="itemC">
<text>开始日期</text>
<text>{{item.startDate}}</text>
</view>
<view class="itemC">
<text>结束日期</text>
<text>{{item.endDate}}</text>
</view>
</view>
</view>
</view>
<view
style="height:calc(100vh - 150px);display: flex;align-items: center;justify-content: center;background-color: #fff;"
v-else>
<image src="../../static/empty.png" mode=""></image>
</view>
</view>
<u-datetime-picker
:show="showTime"
v-model="startTime"
mode="datetime"
@confirm="handleStartTime"
@cancel="showTime=false"
></u-datetime-picker>
<u-datetime-picker
:show="showTime1"
v-model="endTime"
mode="datetime"
@confirm="handleEndTime"
@cancel="showTime1=false"
></u-datetime-picker>
<u-datetime-picker :show="showTime" v-model="startTime" mode="date" @confirm="handleStartTime"
@cancel="showTime=false"></u-datetime-picker>
<u-datetime-picker :show="showTime1" v-model="endTime" mode="date" @confirm="handleEndTime"
@cancel="showTime1=false"></u-datetime-picker>
</view>
</template>
<script>
import moment from 'moment'
const stm = moment().subtract(7, 'months').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD");
const etm = moment().add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD");
const stm = moment().subtract(7, 'months').add(1, 'hour').set({
minute: 0,
second: 0
}).format("YYYY-MM-DD");
const etm = moment().add(1, 'hour').set({
minute: 0,
second: 0
}).format("YYYY-MM-DD");
export default {
data() {
return {
status:{
0:'开始任务',
1:'继续任务',
// 2:''
status: {
0: '开始任务',
1: '继续任务',
2: '已完成'
},
startTime:stm,
endTime:etm,
stm,
etm,
showTime:false,
showTime1:false,
list: []
startTime: stm,
endTime: etm,
stm,
etm,
showTime: false,
showTime1: false,
list: []
};
},
mounted() {
this.getData()
},
methods: {
searchHandle(){
this.getData()
},
handleStartTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.stm = time
this.showTime = false
},
handleEndTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.etm = time;
this.showTime1 = false
},
async getData(){
searchHandle() {
this.getData()
},
handleStartTime(e) {
let time = moment(e.value).format("YYYY-MM-DD")
this.stm = time
this.showTime = false
},
handleEndTime(e) {
let time = moment(e.value).format("YYYY-MM-DD")
this.etm = time;
this.showTime1 = false
},
async getData() {
const userId = uni.getStorageSync('value')?.userId
const params = {
dateRangeSo:{
start:moment(this.stm).format("YYYY-MM-DD"),
end:moment(this.etm).format("YYYY-MM-DD"),
dateRangeSo: {
start: moment(this.stm).format("YYYY-MM-DD"),
end: moment(this.etm).format("YYYY-MM-DD"),
},
inspectUserId:userId,
statusList:[0,1]
inspectUserId: userId,
statusList: [0, 1]
}
try {
const res = await uni.$http.post("/gunshiApp/xyt/inspect/task/list",params)
this.list = [...res.data.data];
const res = await uni.$http.post("/gunshiApp/xyt/inspect/task/list", params)
this.list = [...res.data.data];
} catch (error) {
uni.$showMsg();
}
},
toDetail(record){
toDetail(record) {
console.log(record);
uni.navigateTo({
url:`/pages/xcrw/detail/index?taskTitle=${record.taskTitle}&taskType=${record.taskType}&taskContent=${record.taskContent}&startDate=${record.startDate}&endDate=${record.endDate}&status=${record.status}&id=${record.id}`
url: `/pages/xcrw/detail/index?taskTitle=${record.taskTitle}&taskType=${record.taskType}&taskContent=${record.taskContent}&startDate=${record.startDate}&endDate=${record.endDate}&status=${record.status}&id=${record.id}`
})
}
}
@ -134,19 +133,7 @@
</script>
<style lang="scss" scoped>
.time-ranger{
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn{
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.myTitleStyle {
font-size: 30px;
background-color: red;
@ -178,6 +165,7 @@
.titleRight {
display: flex;
.border {
border-width: 0px;
background-color: rgba(236, 245, 255, 1);
@ -195,8 +183,9 @@
}
}
.contentItem{
.itemC{
.contentItem {
.itemC {
display: flex;
justify-content: space-between;
display: flex;

View File

@ -152,17 +152,6 @@
</script>
<style lang="scss" scoped>
.time-ranger {
margin-bottom: 10px;
.start-time,
.end-time {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
}
.tab-bar {
display: flex;

BIN
static/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB