周末修改内容
This commit is contained in:
parent
57e6e8f12b
commit
6f73a2196f
@ -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}`
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user