mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-18 06:16:43 +08:00
今日和本月改为昨日,默认昨日
This commit is contained in:
@@ -13,5 +13,42 @@ export default {
|
|||||||
//获取“多少天数”之前的时间 例如28天前 即days=28
|
//获取“多少天数”之前的时间 例如28天前 即days=28
|
||||||
let currentTime = new Date().getTime()
|
let currentTime = new Date().getTime()
|
||||||
return new Date(currentTime - 1000 * 60 * 60 * 24 * days)
|
return new Date(currentTime - 1000 * 60 * 60 * 24 * days)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取上个月
|
||||||
|
*/
|
||||||
|
getLastMonth:function(){
|
||||||
|
var nowDate = new Date();
|
||||||
|
var year = nowDate.getFullYear();
|
||||||
|
var month = nowDate.getMonth();
|
||||||
|
if(month == 0){
|
||||||
|
month = 12;
|
||||||
|
year = year - 1;
|
||||||
|
}
|
||||||
|
if (month <= 9) {
|
||||||
|
month = '0' + month
|
||||||
|
}
|
||||||
|
var yyyyMM = year+"-"+month;
|
||||||
|
console.log(yyyyMM);
|
||||||
|
return yyyyMM
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取上个月月底日期
|
||||||
|
*/
|
||||||
|
getLastMonthAndDay:function(){
|
||||||
|
var nowDate = new Date();
|
||||||
|
var year = nowDate.getFullYear();
|
||||||
|
var month = nowDate.getMonth();
|
||||||
|
if(month == 0){
|
||||||
|
month = 12;
|
||||||
|
year = year - 1;
|
||||||
|
}
|
||||||
|
if (month <= 9) {
|
||||||
|
month = '0' + month
|
||||||
|
}
|
||||||
|
var lastDay = new Date(year,month,0);
|
||||||
|
var yyyyMMdd = year+"-"+month+"-"+lastDay.getDate();
|
||||||
|
console.log(yyyyMMdd);
|
||||||
|
return yyyyMMdd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class='pt10 pb10' style='background-color: #f5f5f5'>
|
<div class='pt10 pb10' style='background-color: #f5f5f5'>
|
||||||
<div class='m-filterDate'>
|
<div class='m-filterDate'>
|
||||||
<div class='number'>
|
<div class='number'>
|
||||||
<span :class="[currentIndex? 'checked' : 'unChecked']" @click='selectThisMonth(currentIndex)'>本月</span>
|
<!-- <span :class="[currentIndex? 'checked' : 'unChecked']" @click='selectThisMonth(currentIndex)'>本月</span> -->
|
||||||
</div>
|
</div>
|
||||||
<div class='filterTime'>
|
<div class='filterTime'>
|
||||||
<FieldDatePicter
|
<FieldDatePicter
|
||||||
@@ -45,6 +45,7 @@ import { uploadImg } from '@/api/ebiz/sale/sale'
|
|||||||
import backgroundImg from '../../../assets/images/laurelClub/posters-background-img.png'
|
import backgroundImg from '../../../assets/images/laurelClub/posters-background-img.png'
|
||||||
import crownImg from '@/assets/images/laurelClub/crown.png'
|
import crownImg from '@/assets/images/laurelClub/crown.png'
|
||||||
import nameCardImg from '../../../assets/images/laurelClub/posters-name-card-img.png'
|
import nameCardImg from '../../../assets/images/laurelClub/posters-name-card-img.png'
|
||||||
|
import beforeDate from '@/assets/js/utils/getBeforeDate.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'exclusivePosters',
|
name: 'exclusivePosters',
|
||||||
@@ -55,7 +56,7 @@ export default {
|
|||||||
// 选择时间模块使用到的数据对象
|
// 选择时间模块使用到的数据对象
|
||||||
datePickerObj: {
|
datePickerObj: {
|
||||||
filterDate: '', // 当前的时间(年月)
|
filterDate: '', // 当前的时间(年月)
|
||||||
maxDate: new Date(), // 可以选择的最大时间
|
maxDate: new Date(beforeDate.getLastMonth()), // 可以选择的最大时间
|
||||||
minDate: new Date('2019-10') // 可以选择的最小时间
|
minDate: new Date('2019-10') // 可以选择的最小时间
|
||||||
},
|
},
|
||||||
// 海报canvas绘图工具中使用到的数据对象
|
// 海报canvas绘图工具中使用到的数据对象
|
||||||
@@ -76,7 +77,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
//默认展示当月数据
|
//默认展示当月数据
|
||||||
this.datePickerObj.filterDate = this.getCurrentDateFunc()
|
this.datePickerObj.filterDate = beforeDate.getLastMonth()
|
||||||
// this.canvasHeight = this.$refs.element.offsetHeight
|
// this.canvasHeight = this.$refs.element.offsetHeight
|
||||||
// 调用获取当前海报数据的方法
|
// 调用获取当前海报数据的方法
|
||||||
this.queryPosterDataFunc()
|
this.queryPosterDataFunc()
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<div class="pt10 pb10 bgf5" style="background-color: #f5f5f5">
|
<div class="pt10 pb10 bgf5" style="background-color: #f5f5f5">
|
||||||
<div class="m-filterDate">
|
<div class="m-filterDate">
|
||||||
<div class="number">
|
<div class="number">
|
||||||
<span :class="[currentIndex == '0' ? 'checkedLeft' : 'unCheckedLeft']" @click="switchDayOrMonth(1)">今日</span>
|
<span :class="[currentIndex == '0' ? 'checkedLeft' : 'unCheckedLeft']" @click="switchDayOrMonth(1)">昨日</span>
|
||||||
<span :class="[currentIndex == '1' ? 'checkedRight' : 'unCheckedRight']" @click="switchDayOrMonth(0)">本月</span>
|
<!-- <span :class="[currentIndex == '1' ? 'checkedRight' : 'unCheckedRight']" @click="switchDayOrMonth(0)">本月</span> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="filterTime">
|
<div class="filterTime">
|
||||||
<FieldDatePicter
|
<FieldDatePicter
|
||||||
@@ -128,6 +128,7 @@ import FieldDatePicter from '@/components/ebiz/FieldDatePicter'
|
|||||||
import { getBranchByUser } from '@/api/ebiz/billingDetail/billingDetail'
|
import { getBranchByUser } from '@/api/ebiz/billingDetail/billingDetail'
|
||||||
import { queryPersonal, queryTeamList } from '@/api/ebiz/laurelClub/laurelClub'
|
import { queryPersonal, queryTeamList } from '@/api/ebiz/laurelClub/laurelClub'
|
||||||
import crownImg from '@/assets/images/laurelClub/crown.png'
|
import crownImg from '@/assets/images/laurelClub/crown.png'
|
||||||
|
import beforeDate from '@/assets/js/utils/getBeforeDate.js'
|
||||||
|
|
||||||
// 当前时间
|
// 当前时间
|
||||||
const currentDate = new Date()
|
const currentDate = new Date()
|
||||||
@@ -183,7 +184,7 @@ export default {
|
|||||||
currentIndex: '0', //0 当月 1当天
|
currentIndex: '0', //0 当月 1当天
|
||||||
theads: ['姓名', '预收佣金(元)', '承保佣金(元)', '桂冠差距(元)', '上月桂冠冠级', '双冠差距(元)', '上月双冠冠级'],
|
theads: ['姓名', '预收佣金(元)', '承保佣金(元)', '桂冠差距(元)', '上月桂冠冠级', '双冠差距(元)', '上月双冠冠级'],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
maxDate: new Date(),
|
maxDate: new Date(beforeDate.getLastMonth()),
|
||||||
minDate: new Date('2019-10'),
|
minDate: new Date('2019-10'),
|
||||||
filterDate: '',
|
filterDate: '',
|
||||||
postDate: '', //实际给后台传的时间
|
postDate: '', //实际给后台传的时间
|
||||||
@@ -243,7 +244,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.postDate = date.year + '-' + date.month + '-' + date.date
|
this.postDate = date.year + '-' + date.month + '-' + date.date
|
||||||
}
|
}
|
||||||
//选择当月,当天时,日期选择器默认到当年当月
|
//选择当月,当天时,日期选择器默认到当年当月--之前逻辑
|
||||||
|
//今日和本月改为昨日,默认昨日--现有逻辑
|
||||||
this.filterDate = date.year + '-' + date.month
|
this.filterDate = date.year + '-' + date.month
|
||||||
this.dateFlag = index == 0 ? 'm' : 'd'
|
this.dateFlag = index == 0 ? 'm' : 'd'
|
||||||
this.currentIndex = index == 0 ? 1 : 0
|
this.currentIndex = index == 0 ? 1 : 0
|
||||||
@@ -282,8 +284,10 @@ export default {
|
|||||||
month = '0' + month
|
month = '0' + month
|
||||||
}
|
}
|
||||||
//默认展示当天数据
|
//默认展示当天数据
|
||||||
this.postDate = date.getFullYear() + '-' + month + '-' + date.getDate()
|
// this.postDate = date.getFullYear() + '-' + month + '-' + date.getDate()
|
||||||
this.filterDate = date.getFullYear() + '-' + month
|
// this.filterDate = date.getFullYear() + '-' + month
|
||||||
|
this.postDate = beforeDate.getLastMonth()
|
||||||
|
this.filterDate = beforeDate.getLastMonth()
|
||||||
this.dateFlag = 'd'
|
this.dateFlag = 'd'
|
||||||
this.currentIndex = '0'
|
this.currentIndex = '0'
|
||||||
//数据重置--结束
|
//数据重置--结束
|
||||||
@@ -504,14 +508,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
let date = new Date()
|
// let date = new Date()
|
||||||
let month = date.getMonth() + 1
|
// let month = date.getMonth() + 1
|
||||||
if (month <= 9) {
|
// if (month <= 9) {
|
||||||
month = '0' + month
|
// month = '0' + month
|
||||||
}
|
// }
|
||||||
//默认展示当天数据
|
//默认展示当天数据
|
||||||
this.postDate = date.getFullYear() + '-' + month + '-' + date.getDate()
|
// this.postDate = date.getFullYear() + '-' + month + '-' + date.getDate()
|
||||||
this.filterDate = date.getFullYear() + '-' + month
|
this.postDate = beforeDate.getLastMonth()
|
||||||
|
this.filterDate = beforeDate.getLastMonth()
|
||||||
this.initDataPersonal()
|
this.initDataPersonal()
|
||||||
window.addEventListener('scroll', this.handleScroll)
|
window.addEventListener('scroll', this.handleScroll)
|
||||||
}
|
}
|
||||||
@@ -546,52 +551,55 @@ export default {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin: 0 7px;
|
margin: 0 7px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
.unCheckedLeft {
|
|
||||||
background-color: #fff;
|
.unCheckedLeft {
|
||||||
color: #333333;
|
background-color: #fff;
|
||||||
border: 1px solid #2e4591;
|
color: #333333;
|
||||||
border-radius: 6px 0 0 6px;
|
border: 1px solid #2e4591;
|
||||||
width: 54px;
|
border-radius: 6px;
|
||||||
height: 24px;
|
// border-radius: 6px 0 0 6px;
|
||||||
line-height: 24px;
|
width: 54px;
|
||||||
display: inline-block;
|
height: 24px;
|
||||||
text-align: center;
|
line-height: 24px;
|
||||||
border-right: 0;
|
display: inline-block;
|
||||||
}
|
text-align: center;
|
||||||
.checkedLeft {
|
// border-right: 0;
|
||||||
background-color: #2e4591;
|
|
||||||
color: #fff;
|
|
||||||
border: 1px solid #2e4591;
|
|
||||||
border-radius: 6px 0 0 6px;
|
|
||||||
width: 54px;
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.unCheckedRight {
|
|
||||||
background-color: #fff;
|
|
||||||
color: #333333;
|
|
||||||
border: 1px solid #2e4591;
|
|
||||||
border-radius: 0 6px 6px 0;
|
|
||||||
width: 54px;
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.checkedRight {
|
|
||||||
background-color: #2e4591;
|
|
||||||
color: #fff;
|
|
||||||
border: 1px solid #2e4591;
|
|
||||||
border-radius: 0 6px 6px 0;
|
|
||||||
width: 54px;
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
.checkedLeft {
|
||||||
|
background-color: #2e4591;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #2e4591;
|
||||||
|
border-radius: 6px;
|
||||||
|
// border-radius: 6px 0 0 6px;
|
||||||
|
width: 54px;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.unCheckedRight {
|
||||||
|
background-color: #fff;
|
||||||
|
color: #333333;
|
||||||
|
border: 1px solid #2e4591;
|
||||||
|
border-radius: 0 6px 6px 0;
|
||||||
|
width: 54px;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.checkedRight {
|
||||||
|
background-color: #2e4591;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #2e4591;
|
||||||
|
border-radius: 0 6px 6px 0;
|
||||||
|
width: 54px;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
.filterTime {
|
.filterTime {
|
||||||
width: 70px;
|
width: 70px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
|||||||
Reference in New Issue
Block a user