周末修改内容

This commit is contained in:
cclu 2023-05-22 09:10:12 +08:00
parent 57e6e8f12b
commit 6f73a2196f
3 changed files with 135 additions and 21 deletions

View File

@ -318,7 +318,7 @@ function getThisMonthDateList(value){
if (i>howDay){
break
}else{
list.push({label:`${m}${i}`,value:`${y}-${m}-${i}`})
list.push({label:`${m}${i}`,value:`${y}-${m<10?'0'+m:m}-${i<10?'0'+i:i}`})
}
}
return list
@ -333,42 +333,119 @@ function handleReduceAMonth(nowTime,newTime){
const newDate = new Date(newTime)
let newY = newDate.getFullYear()
let newM = newDate.getMonth() + 1
console.log('newM',newM)
let thisMonth = newM<10?'0'+newM:newM
let howDay = this.getThisMonthDay(`${y}-${m}`)
let newHowDay = this.getThisMonthDay(`${newY}-${newM}`)
let newHowDay = this.getThisMonthDay(`${newY}-${thisMonth}`)
const nowDate = new Date()
let nowM =nowDate.getMonth() + 1
let nowD = nowDate.getDate()
if (d === newHowDay){
if (d<nowD){
if (newM<10){
newM = '0' + newM
}
if (newHowDay<10){
newHowDay = '0' + newHowDay
}
console.log('handleReduceAMonth',newHowDay)
console.log('handleReduceAMonth',`${newY}-${newM}-${newHowDay}`)
return `${newY}-${newM}-${newHowDay}`
}else{
if (newM===nowM){
if (newM<10){
newM = '0' + newM
}
if (nowD<10){
nowD = '0' + nowD
}
console.log('handleReduceAMonth',nowD)
console.log('handleReduceAMonth',`${newY}-${newM}-${nowD}`)
return `${newY}-${newM}-${nowD}`
}else{
if (newM<10){
newM = '0' + newM
}
if (newHowDay<10){
newHowDay = '0' + newHowDay
}
console.log('handleReduceAMonth',newHowDay)
console.log('handleReduceAMonth',`${newY}-${newM}-${newHowDay}`)
return `${newY}-${newM}-${newHowDay}`
}
}
}else{
if (newM===2){
if (d>newHowDay){
if (newM<10){
newM = '0' + newM
}
if (newHowDay<10){
newHowDay = '0' + newHowDay
}
console.log('handleReduceAMonth',newHowDay)
console.log('handleReduceAMonth',`${newY}-${newM}-${newHowDay}`)
return `${newY}-${newM}-${newHowDay}`
}else{
if (newM<10){
newM = '0' + newM
}
if (d<10){
d = '0' + d
}
console.log('handleReduceAMonth',d)
console.log('handleReduceAMonth',`${newY}-${newM}-${d}`)
return `${newY}-${newM}-${d}`
}
}else{
if (nowD<d){
if (nowM===newM){
if (newM<10){
newM = '0' + newM
}
if (nowD<10){
nowD = '0' + nowD
}
console.log('handleReduceAMonth',nowD)
console.log('handleReduceAMonth',`${newY}-${newM}-${nowD}`)
return `${newY}-${newM}-${nowD}`
}else{
if (d<newHowDay){
if (newM<10){
newM = '0' + newM
}
if (d<10){
d = '0' + d
}
console.log('handleReduceAMonth',d)
console.log('handleReduceAMonth',`${newY}-${newM}-${d}`)
return `${newY}-${newM}-${d}`
}else{
if (newM<10){
newM = '0' + newM
}
if (newHowDay<10){
newHowDay = '0' +newHowDay
}
console.log('handleReduceAMonth',newHowDay)
console.log('handleReduceAMonth',`${newY}-${newM}-${newHowDay}`)
return `${newY}-${newM}-${newHowDay}`
}
}
}else {
if (newM<10){
newM = '0' + newM
}
if (d<10){
d = '0' +d
}
console.log('handleReduceAMonth',d)
console.log('handleReduceAMonth',`${newY}-${newM}-${d}`)
return `${newY}-${newM}-${d}`
}
}

View File

@ -86,7 +86,7 @@
</view>
</view>
<view v-if="selectTab===2" class="serviceList" style="height:calc(100vh - 300px);">
<view v-if="inspectionList.length>0">
<view v-if="inspectionList.length && inspectionList.length>0 ">
<view class="dailyInspection" v-for="(item,index) in inspectionList" :key="index">
<view class="itemTitle">
<span class="title">{{item.SERVERPART_NAME}}</span>
@ -118,14 +118,14 @@
<p class="label">路线</p>
</view>
<view class="person">
<image v-if="subItem.SERVERPARTList[0].PATROL_IMG.length>0" class="icon" src="https://eshangtech.com/ShopICO/ahyd-BID/examine/haveImg.svg"></image>
<p v-if="subItem.SERVERPARTList[0].PATROL_IMG.length>0" class="label">图片</p>
<image v-if="subItem.SERVERPARTList[0].PATROL_IMG" class="icon" src="https://eshangtech.com/ShopICO/ahyd-BID/examine/haveImg.svg"></image>
<p v-if="subItem.SERVERPARTList[0].PATROL_IMG" class="label">图片</p>
</view>
</view>
</view>
</view>
</view>
<view v-if="inspectionList.length>0" class="load-more" style="height: 20px">
<view v-if="inspectionList.length && inspectionList.length>0" class="load-more" style="height: 20px">
<text>{{'——— 我是有底线的 ———'}}</text>
</view>
<view class="noData" v-else>
@ -249,8 +249,8 @@ export default {
return {
searchTime:'',//
lastDay:'',//
monthList:[{label:'1月',value:1},{label:'2月',value:2},{label:'3月',value:3},{label:'4月',value:4},{label:'5月',value:5},{label:'6月',value:6},{label:'7月',value:7},
{label:'8月',value:8},{label:'9月',value:9},{label:'10月',value:10},{label:'11月',value:11},{label:'12月',value:12}],
monthList:[{label:'1月',value:'01'},{label:'2月',value:'02'},{label:'3月',value:'03'},{label:'4月',value:'04'},{label:'5月',value:'05'},{label:'6月',value:'06'},{label:'7月',value:'07'},
{label:'8月',value:'08'},{label:'9月',value:'09'},{label:'10月',value:'10'},{label:'11月',value:'11'},{label:'12月',value:'12'}],
selectMonth:0,
current:'',
menu:{},
@ -291,9 +291,16 @@ export default {
const date = new Date(this.searchTime)
let month = date.getMonth() + 1
//
this.monthList = this.monthList.filter(item=>item.value<=month)
let list = []
this.monthList.forEach((item)=>{
if (item.value<=month){
list.push(item)
}
})
this.monthList = list
//
this.dateList = this.$util.getThisMonthDateList(date)
console.log('this.dateList1',this.dateList)
//
this.getAreaList()
},
@ -306,15 +313,23 @@ export default {
//
getThisMonth(){
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
let year = date.getFullYear()
let month = date.getMonth() + 1
if (month<10){
month = '0' + month
}
let day = date.getDate()
let showDay = day - 4 >0? day - 4:1
if (showDay<10){
showDay = '0'+showDay
}
//
this.selectMonth = month
this.current='item'+month
//
this.selectDate = `${year}-${month}-${day}`
this.currentDate = 'item'+`${year}-${month}-${day - 4>0?day - 4:1}`
this.currentDate = 'item'+`${year}-${month}-${showDay}`
console.log('this.currentDate',this.currentDate)
},
//
handleShowPopup(value,obj){
@ -347,11 +362,16 @@ export default {
},
//
handleSelectMonth(value){
console.log('value',value)
this.selectMonth = value
//
const nowDate = new Date()
let nowMonth = nowDate.getMonth() + 1
if (nowMonth<10){
nowMonth = '0' + nowMonth
}
//
console.log('this.searchTime',this.searchTime)
const date = new Date(this.searchTime)
let y = date.getFullYear()
//
@ -361,18 +381,38 @@ export default {
let howDay = this.$util.getThisMonthDay(`${y}-${this.selectMonth}`)
this.searchTime = `${y}-${this.selectMonth}-${howDay}`
}
console.log(' this.searchTime', this.searchTime)
let howDay = this.$util.getThisMonthDay(`${y}-${this.selectMonth}`)
const listDate = new Date(`${y}-${this.selectMonth}`)
let listY = listDate.getFullYear()
let listM = listDate.getMonth() + 1
let list = []
for (let i = 0;i <= howDay,++i;) {
if (i>howDay){
break
}else{
list.push({label:`${listM}${i}`,value:`${listY}-${listM<10?'0'+listM:listM}-${i<10?'0'+i:i}`})
}
}
//
this.dateList = this.$util.getThisMonthDateList(`${y}-${this.selectMonth}`)
this.dateList = list
console.log('this.dateList',this.dateList)
//
console.log('this.selectDate',this.selectDate)
console.log('111',`${y}-${this.selectMonth}`)
this.selectDate = this.$util.handleReduceAMonth(`${this.selectDate}`,`${y}-${this.selectMonth}`)
console.log('this.selectDate2',this.selectDate)
//
const selectTime = new Date(this.selectDate)
let selectY = selectTime.getFullYear()
let selectM = selectTime.getMonth() + 1
console.log('selectTime',selectTime)
//
let selectD = selectTime.getDate() - 4 > 0?selectTime.getDate() - 4:1
this.currentDate = 'item' + `${selectY}-${selectM}-${selectD}`
console.log('selectD',selectD)
this.currentDate = 'item' + `${selectY}-${selectM<10?'0'+selectM:selectM}-${selectD<10?'0'+selectD:selectD}`
console.log('this.currentDate',this.currentDate)
if (this.selectTab===1){
//
this.getManagerList()
@ -400,10 +440,6 @@ export default {
this.getMeetingDetail()
}
},
//
handlePageScroll(e){
this.scrollTop = e.detail.scrollTop
},
//
handleBack(){
uni.switchTab({
@ -412,6 +448,7 @@ export default {
},
//
handleChangeDate(value){
console.log('value',value)
let time = `${value.split('-')[0]}-${value.split('-')[1]<10?'0'+value.split('-')[1]:value.split('-')[1]}-${value.split('-')[2]}`
const date = new Date()
let m = date.getMonth() +1

View File

@ -7,7 +7,7 @@
<image class="dateIcon" src="/static/images/index/dateTime.svg"></image>
<!-- <picker mode="date" :value="single" @change="bindDateChange" >-->
<picker mode="date" :value="single" :end="endData" @change="bindDateChange" >
<view class="time">
<view class="time">
<text class="day">{{ thisDay }}</text>
<view class="uni-input" style="background: transparent;padding: 0;height:100%">{{ single }}</view>
<image class="icon" src="/static/images/index/arrow_bottom.svg"></image>