高峰期进入中转页

parent a73c6a26
...@@ -806,7 +806,7 @@ ...@@ -806,7 +806,7 @@
</view> </view>
</view> </view>
</view> </view>
<view v-else class="nodata"> <view v-else class="nodata" @click="nodataClick">
<view class="nodataImg"> <view class="nodataImg">
<img style="width: 100%" <img style="width: 100%"
src="https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/images/purchaseChart.gif" /> src="https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/images/purchaseChart.gif" />
...@@ -942,38 +942,63 @@ ...@@ -942,38 +942,63 @@
}, },
containerHeight: '', containerHeight: '',
pubTalkSummaryHeight: 525, pubTalkSummaryHeight: 525,
pubTalkNoopenHeight:1260 pubTalkNoopenHeight: 1260,
isnodataClick: false
} }
}, },
mounted() { mounted() {
// if (this.isPeakPeriod()) { this.init()
// this.showReport = false; },
// return methods: {
// } init() {
this.showReport = true; if (this.isPeakPeriod() && !this.isnodataClick) {
// 有无消费报告入口 this.showReport = false;
if (new Date().getTime() <= new Date('2022/06/30').getTime()) { return
this.isService = true; }
} else { this.showReport = true;
// 有无消费报告入口
if (new Date().getTime() <= new Date('2022/06/30').getTime()) {
this.isService = true;
} else {
this.queryMemberServcieItem().then(() => {
if (this.queryMemberServcieItemList.length) {
this.isService = this.queryMemberServcieItemList.indexOf(1002) == -1 ? false : true;
}
})
}
// 有无进出校、公话入口
this.queryMemberServcieItem().then(() => { this.queryMemberServcieItem().then(() => {
if (this.queryMemberServcieItemList.length) { if (this.queryMemberServcieItemList.length) {
this.isService = this.queryMemberServcieItemList.indexOf(1002) == -1 ? false : true; this.isAttendanceService = this.queryMemberServcieItemList.indexOf(3002) == -1 ? false :
true;
this.isPubTalkService = this.queryMemberServcieItemList.indexOf(2002) == -1 ? false : true;
} }
}) })
} // 消费报告
// 有无进出校、公话入口 this.queryIsDredgeMember(1002).then(() => {
this.queryMemberServcieItem().then(() => { if (this.isOpen) {
if (this.queryMemberServcieItemList.length) { this.queryMemberValidTime(1002).then(e => {
this.isAttendanceService = this.queryMemberServcieItemList.indexOf(3002) == -1 ? false : true; if (new Date(this.memberInfo.invalidDate).getTime() <= new Date('2022/06/30')
this.isPubTalkService = this.queryMemberServcieItemList.indexOf(2002) == -1 ? false : true; .getTime()) {
} this.isOpen = true;
}) this.flag = 0;
// 消费报告 this.memberInfo.invalidDateStr = '2022年6月30日';
this.queryIsDredgeMember(1002).then(() => { this.memberInfo.differDay = dayjs('2022/06/30').diff(dayjs(), 'day') + 1;
if (this.isOpen) { this.containerHeight = 4200;
this.queryMemberValidTime(1002).then(e => { this.queryConsumerSummaryAmount(1).then(e => this.piechart());
if (new Date(this.memberInfo.invalidDate).getTime() <= new Date('2022/06/30') this.queryDayConsumerTrend(1).then(e => this.linechart(this
.getTime()) { .reportTypeIndex));
} else {
this.queryIsDredgeMember(1002, 1).then(() => {
this.queryConsumerSummaryAmount(1).then(e => this
.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this
.reportTypeIndex));
});
}
})
} else {
if (new Date().getTime() <= new Date('2022/06/30').getTime()) {
this.isOpen = true; this.isOpen = true;
this.flag = 0; this.flag = 0;
this.memberInfo.invalidDateStr = '2022年6月30日'; this.memberInfo.invalidDateStr = '2022年6月30日';
...@@ -983,71 +1008,54 @@ ...@@ -983,71 +1008,54 @@
this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex)); this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex));
} else { } else {
this.queryIsDredgeMember(1002, 1).then(() => { this.queryIsDredgeMember(1002, 1).then(() => {
this.queryConsumerSummaryAmount(1).then(e => this this.queryConsumerSummaryAmount();
.piechart()); this.queryDayConsumerTrend();
this.queryDayConsumerTrend(1).then(e => this.linechart(this
.reportTypeIndex));
}); });
} }
}
});
let tmpArr = []
// 获取时间
for (let i = 1; i <= 11; i++) {
let startWeek = dayjs().subtract(i, 'month').startOf('month');
let endWeek = dayjs().$d.getTime() > dayjs().subtract(i, 'month').endOf('month').$d.getTime() ? dayjs()
.subtract(i, 'month').endOf('month') : dayjs();
tmpArr.push({
week: (startWeek.format("YYYY/MM/DD")) + '~' + (endWeek.format("YYYY/MM/DD")),
weekstr: (startWeek.format("MM/DD")) + '~' + (endWeek.format("MM/DD")),
startDate: startWeek.format("YYYY-MM-DD"),
endDate: endWeek.format("YYYY-MM-DD")
}) })
} else { }
if (new Date().getTime() <= new Date('2022/06/30').getTime()) { this.dataRangeArr = tmpArr
this.isOpen = true; this.minDate = new Date(this.dataRangeArr[this.dataRangeIndex].startDate);
this.flag = 0; this.maxDate = new Date(this.dataRangeArr[this.dataRangeIndex].endDate);
this.memberInfo.invalidDateStr = '2022年6月30日'; this.diningSituations.diningSituationsRequestDate = this.dataRangeArr[this.dataRangeIndex].startDate;
this.memberInfo.differDay = dayjs('2022/06/30').diff(dayjs(), 'day') + 1; this.diningSituations.diningSituationsDate = this.formatDate(this.minDate);
this.containerHeight = 4200; this.attendanceSituations.attendanceDate = this.formatDate(this.minDate);
this.queryConsumerSummaryAmount(1).then(e => this.piechart()); this.queryCampusStudentInfo();
this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex)); let tmpDate = this.formatDateTwo(this.minDate);
this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this
.dataRangeIndex].endDate).then(() => {
if (this.diningSituations.notRepastDetailsDTOS) {
let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate ===
tmpDate)[
0];
this.diningSituations.notRepastDetails = today;
} else { } else {
this.queryIsDredgeMember(1002, 1).then(() => { this.diningSituations.notRepastDetails = {};
this.queryConsumerSummaryAmount();
this.queryDayConsumerTrend();
});
} }
} });
}); this.getPubTalkReport();
let tmpArr = [] },
// 获取时间 // 当天11:00 ~ 13:00属于高峰期
for (let i = 1; i <= 11; i++) {
let startWeek = dayjs().subtract(i, 'month').startOf('month');
let endWeek = dayjs().$d.getTime() > dayjs().subtract(i, 'month').endOf('month').$d.getTime() ? dayjs()
.subtract(i, 'month').endOf('month') : dayjs();
tmpArr.push({
week: (startWeek.format("YYYY/MM/DD")) + '~' + (endWeek.format("YYYY/MM/DD")),
weekstr: (startWeek.format("MM/DD")) + '~' + (endWeek.format("MM/DD")),
startDate: startWeek.format("YYYY-MM-DD"),
endDate: endWeek.format("YYYY-MM-DD")
})
}
this.dataRangeArr = tmpArr
this.minDate = new Date(this.dataRangeArr[this.dataRangeIndex].startDate);
this.maxDate = new Date(this.dataRangeArr[this.dataRangeIndex].endDate);
this.diningSituations.diningSituationsRequestDate = this.dataRangeArr[this.dataRangeIndex].startDate;
this.diningSituations.diningSituationsDate = this.formatDate(this.minDate);
this.attendanceSituations.attendanceDate = this.formatDate(this.minDate);
this.queryCampusStudentInfo();
let tmpDate = this.formatDateTwo(this.minDate);
this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this
.dataRangeIndex].endDate).then(() => {
if (this.diningSituations.notRepastDetailsDTOS) {
let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate === tmpDate)[
0];
this.diningSituations.notRepastDetails = today;
} else {
this.diningSituations.notRepastDetails = {};
}
});
this.getPubTalkReport(1);
},
methods: {
// 当天6:30 ~ 9:00,11:30 ~ 12:00, 17:30 ~ 19:00属于高峰期
isPeakPeriod() { isPeakPeriod() {
let first = this.timeIn("06:30:00", "09:00:00"); let first = this.timeIn("11:00:00", "13:00:00");
let second = this.timeIn("11:00:00", "12:00:00"); return first;
let three = this.timeIn("17:30:00", "19:00:00"); },
console.log(first, "first", second, "second", three, "three"); nodataClick: function() {
return first || second || three; this.isnodataClick = true
this.init()
}, },
/*在某段时间内*/ /*在某段时间内*/
timeIn(s, e) { timeIn(s, e) {
...@@ -1139,22 +1147,20 @@ ...@@ -1139,22 +1147,20 @@
this.memberInfo.differDay = ''; this.memberInfo.differDay = '';
this.memberInfo.invalidDateStr = ''; this.memberInfo.invalidDateStr = '';
this.memberInfo.leastAmount = ''; this.memberInfo.leastAmount = '';
this.queryIsDredgeMember(2002).then(e => { this.getPubTalkReport().then(() => {
if (this.isPubTalkOpen) { this.queryIsDredgeMember(2002).then(e => {
this.getPubTalkReport().then(() => { if (this.isPubTalkOpen) {
this.$nextTick(() => { this.$nextTick(() => {
this.callNumberBarchart(); this.callNumberBarchart();
this.callDurationBarchart(); this.callDurationBarchart();
this.leaveMessageBarchart(); this.leaveMessageBarchart();
}) })
}) } else {
} else {
this.getPubTalkReport().then(() => {
this.$nextTick(() => { this.$nextTick(() => {
this.callNumberBarchart(); this.callNumberBarchart();
}) })
}) }
} })
}) })
} }
} }
...@@ -1972,7 +1978,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1972,7 +1978,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} }
}, },
// 获取公话报告 // 获取公话报告
async getPubTalkReport(num) { async getPubTalkReport() {
try { try {
let data = await this.$http.post({ let data = await this.$http.post({
url: gHost + url: gHost +
...@@ -1992,14 +1998,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1992,14 +1998,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
return return
} }
this.pubTalkReport = data.data || {}; this.pubTalkReport = data.data || {};
if (num == 1) { if (!this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) {
if (!this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) { this.pubTalkSummaryHeight = 275;
this.pubTalkSummaryHeight = 275; } else if (this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) {
} else if (this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) { this.pubTalkSummaryHeight = 387;
this.pubTalkSummaryHeight = 387; } else {
} else { this.pubTalkSummaryHeight = 525;
this.pubTalkSummaryHeight = 525;
}
} }
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
...@@ -2111,13 +2115,13 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -2111,13 +2115,13 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} }
switch (serviceItemCode) { switch (serviceItemCode) {
case 1002: case 1002:
this.isOpen = data.obj.status; this.isOpen = data.obj && data.obj.status || false;
if (!this.isOpen) { if (!this.isOpen) {
this.flag = 1; this.flag = 1;
} }
break; break;
case 2002: case 2002:
this.isPubTalkOpen = data.obj.status; this.isPubTalkOpen = data.obj && data.obj.status || false;
if (this.isPubTalkOpen) { if (this.isPubTalkOpen) {
this.queryMemberValidTime(serviceItemCode); this.queryMemberValidTime(serviceItemCode);
this.containerHeight = 2765 + this.pubTalkSummaryHeight; this.containerHeight = 2765 + this.pubTalkSummaryHeight;
...@@ -2125,12 +2129,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -2125,12 +2129,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} else { } else {
this.queryMemberConsumerAmount(serviceItemCode); this.queryMemberConsumerAmount(serviceItemCode);
this.containerHeight = 1605 + this.pubTalkSummaryHeight; this.containerHeight = 1605 + this.pubTalkSummaryHeight;
this.pubTalkNoopenHeight=735+this.pubTalkSummaryHeight; this.pubTalkNoopenHeight = 735 + this.pubTalkSummaryHeight;
this.flag = 3; this.flag = 3;
} }
break; break;
case 3002: case 3002:
this.isAttendanceOpen = data.obj.status; this.isAttendanceOpen = data.obj && data.obj.status || false;
if (this.isAttendanceOpen) { if (this.isAttendanceOpen) {
this.queryMemberValidTime(serviceItemCode); this.queryMemberValidTime(serviceItemCode);
this.containerHeight = 2762; this.containerHeight = 2762;
...@@ -3205,8 +3209,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3205,8 +3209,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
font-weight: 500; font-weight: 500;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
line-height: 40rpx; line-height: 40rpx;
.attendance-report-time-txt{ .attendance-report-time-txt {
width: 56rpx; width: 56rpx;
} }
...@@ -3246,14 +3250,14 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3246,14 +3250,14 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} }
} }
} }
.attendance-report-time-details { .attendance-report-time-details {
width: 212rpx; width: 212rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
margin: 0 0 11rpx; margin: 0 0 11rpx;
.attendance-report-time-details-item { .attendance-report-time-details-item {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
...@@ -3265,7 +3269,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3265,7 +3269,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.attendance-report-time-details-icon { .attendance-report-time-details-icon {
width: 21rpx; width: 21rpx;
height: 12rpx; height: 12rpx;
...@@ -3273,7 +3277,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3273,7 +3277,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// margin-left: 30rpx; // margin-left: 30rpx;
} }
} }
} }
.attendance-report-details-img-item { .attendance-report-details-img-item {
...@@ -3286,6 +3290,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3286,6 +3290,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
.attendance-report-details-img-box { .attendance-report-details-img-box {
width: 155rpx; width: 155rpx;
height: 95rpx; height: 95rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment