校园报告提交更新1

parent a3919494
...@@ -219,11 +219,11 @@ ...@@ -219,11 +219,11 @@
<text>早餐</text> <text>早餐</text>
</view> </view>
<view class="school-report-context-card-two-details-meal-logo"> <view class="school-report-context-card-two-details-meal-logo">
<view v-if="diningSituations.notRepastDetails.breakfastStatus" <view v-if="diningSituations.notRepastDetails.breakfastStatus==1"
class="school-report-context-card-two-details-meal-img"> class="school-report-context-card-two-details-meal-img">
<image src="../../static/images/eatted.png" mode=""></image> <image src="../../static/images/eatted.png" mode=""></image>
</view> </view>
<view v-else class="school-report-context-card-two-details-meal-noeat"> <view v-else-if="diningSituations.notRepastDetails.breakfastStatus==0" class="school-report-context-card-two-details-meal-noeat">
<text></text> <text></text>
</view> </view>
</view> </view>
...@@ -232,11 +232,11 @@ ...@@ -232,11 +232,11 @@
</view> </view>
<view <view
class="school-report-context-card-two-details-meal-logo school-report-context-card-two-details-meal-logo-two"> class="school-report-context-card-two-details-meal-logo school-report-context-card-two-details-meal-logo-two">
<view v-if="diningSituations.notRepastDetails.lunchStatus" <view v-if="diningSituations.notRepastDetails.lunchStatus==1"
class="school-report-context-card-two-details-meal-img"> class="school-report-context-card-two-details-meal-img">
<image src="../../static/images/eatted.png" mode=""></image> <image src="../../static/images/eatted.png" mode=""></image>
</view> </view>
<view v-else class="school-report-context-card-two-details-meal-noeat"> <view v-else-if="diningSituations.notRepastDetails.lunchStatus==0" class="school-report-context-card-two-details-meal-noeat">
<text></text> <text></text>
</view> </view>
</view> </view>
...@@ -245,11 +245,11 @@ ...@@ -245,11 +245,11 @@
</view> </view>
<view <view
class="school-report-context-card-two-details-meal-logo school-report-context-card-two-details-meal-logo-three"> class="school-report-context-card-two-details-meal-logo school-report-context-card-two-details-meal-logo-three">
<view v-if="diningSituations.notRepastDetails.supperStatus" <view v-if="diningSituations.notRepastDetails.supperStatus==1"
class="school-report-context-card-two-details-meal-img"> class="school-report-context-card-two-details-meal-img">
<image src="../../static/images/eatted.png" mode=""></image> <image src="../../static/images/eatted.png" mode=""></image>
</view> </view>
<view v-else class="school-report-context-card-two-details-meal-noeat"> <view v-else-if="diningSituations.notRepastDetails.supperStatus==0" class="school-report-context-card-two-details-meal-noeat">
<text></text> <text></text>
</view> </view>
</view> </view>
...@@ -900,8 +900,13 @@ ...@@ -900,8 +900,13 @@
let tmpDate = this.formatDateTwo(this.minDate); let tmpDate = this.formatDateTwo(this.minDate);
this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this
.dataRangeIndex].endDate).then(() => { .dataRangeIndex].endDate).then(() => {
let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate === tmpDate)[0]; if (this.diningSituations.notRepastDetailsDTOS) {
this.diningSituations.notRepastDetails = today; let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate === tmpDate)[
0];
this.diningSituations.notRepastDetails = today;
} else {
this.diningSituations.notRepastDetails = {};
}
}); });
this.queryConsumerTrend(); this.queryConsumerTrend();
}, },
...@@ -1121,9 +1126,13 @@ ...@@ -1121,9 +1126,13 @@
let tmpDate = this.formatDateTwo(this.minDate); let tmpDate = this.formatDateTwo(this.minDate);
this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this
.dataRangeIndex].endDate).then(() => { .dataRangeIndex].endDate).then(() => {
let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate === if (this.diningSituations.notRepastDetailsDTOS) {
tmpDate)[0]; let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate ===
this.diningSituations.notRepastDetails = today; tmpDate)[0];
this.diningSituations.notRepastDetails = today;
} else {
this.diningSituations.notRepastDetails = {};
}
}); });
this.queryConsumerTrend(); this.queryConsumerTrend();
if (this.isOpen) { if (this.isOpen) {
...@@ -1155,17 +1164,19 @@ ...@@ -1155,17 +1164,19 @@
const datestr = date < 10 ? '0' + date : date; const datestr = date < 10 ? '0' + date : date;
const sum = year + '-' + monthstr + '-' + datestr; const sum = year + '-' + monthstr + '-' + datestr;
if (this.tabIndex == 1) { // 消费报告 if (this.tabIndex == 1) { // 消费报告
const contrastList = this.diningSituations.notRepastDetailsDTOS.filter(e => e if (this.diningSituations.notRepastDetailsDTOS) {
.dayNotEatNumber != 0); const contrastList = this.diningSituations.notRepastDetailsDTOS.filter(e => e
contrastList.forEach(item => { .dayNotEatNumber != 0);
if (sum == item.repastDate) { contrastList.forEach(item => {
const breakfastTxt = item.breakfastStatus ? '' : ''; if (sum == item.repastDate) {
const lunchTxt = item.lunchStatus ? '' : ''; const breakfastTxt = item.breakfastStatus ? '' : '';
const supperTxt = item.supperStatus ? '' : ''; const lunchTxt = item.lunchStatus ? '' : '';
day.topInfo = breakfastTxt + lunchTxt + supperTxt; const supperTxt = item.supperStatus ? '' : '';
day.className = 'notice-day' day.topInfo = breakfastTxt + lunchTxt + supperTxt;
} day.className = 'notice-day'
}) }
})
}
} else if (this.tabIndex == 2) { // 门禁报告 } else if (this.tabIndex == 2) { // 门禁报告
if (this.attendanceReport.abnomalDateList.length) { if (this.attendanceReport.abnomalDateList.length) {
const abnomalList = this.attendanceReport.abnomalDateList.filter(e => e.abnomalType == 2 || e const abnomalList = this.attendanceReport.abnomalDateList.filter(e => e.abnomalType == 2 || e
...@@ -1195,11 +1206,6 @@ ...@@ -1195,11 +1206,6 @@
} }
}) })
} }
// Todos 样式调整
if (sum == '2021-11-11') {
day.topInfo = '冠军';
day.className = 'champion-day';
}
} }
return day; return day;
}, },
...@@ -1213,8 +1219,12 @@ ...@@ -1213,8 +1219,12 @@
this.diningSituations.diningSituationsDate = this.formatDate(date); this.diningSituations.diningSituationsDate = this.formatDate(date);
var dateStr = var dateStr =
`${date.getFullYear()}-${date.getMonth()<9?'0'+(date.getMonth()+1):date.getMonth()+1}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`; `${date.getFullYear()}-${date.getMonth()<9?'0'+(date.getMonth()+1):date.getMonth()+1}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`;
let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate === dateStr)[0]; if (this.diningSituations.notRepastDetailsDTOS) {
this.diningSituations.notRepastDetails = today; let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate === dateStr)[0];
this.diningSituations.notRepastDetails = today;
} else {
this.diningSituations.notRepastDetails = {};
}
}, },
attendanceDateSelect(date) { attendanceDateSelect(date) {
this.attendanceSituations.attendanceDate = this.formatDate(date); this.attendanceSituations.attendanceDate = this.formatDate(date);
...@@ -1686,6 +1696,10 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1686,6 +1696,10 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}) })
return return
} }
if (!data.obj) {
this.diningSituations = {};
return;
}
this.diningSituations.notRepastDay = data.obj.notRepastDay; this.diningSituations.notRepastDay = data.obj.notRepastDay;
this.diningSituations.notRepastDetailsDTOS = data.obj.notRepastDetailsDTOS; this.diningSituations.notRepastDetailsDTOS = data.obj.notRepastDetailsDTOS;
this.diningSituations.cateringLevel = data.obj.cateringLevel; this.diningSituations.cateringLevel = data.obj.cateringLevel;
...@@ -1728,6 +1742,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1728,6 +1742,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}) })
return return
} }
if (!data.obj) return;
const tmpObj = data.obj; const tmpObj = data.obj;
this.isEatLow = tmpObj.canteenAmount / tmpObj.grossAmount < 0.5 ? true : false; this.isEatLow = tmpObj.canteenAmount / tmpObj.grossAmount < 0.5 ? true : false;
if (num) { if (num) {
...@@ -1774,6 +1789,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1774,6 +1789,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}) })
return return
} }
if (!data.obj) return;
this.consumerAmountObj = data.obj; this.consumerAmountObj = data.obj;
this.isReasonable = this.consumerAmountObj.exceedRate >= 40 && this this.isReasonable = this.consumerAmountObj.exceedRate >= 40 && this
.consumerAmountObj.exceedRate <= .consumerAmountObj.exceedRate <=
...@@ -1815,6 +1831,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1815,6 +1831,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}) })
return return
} }
if (!data.obj) return;
var exceptionDate = data.obj.exceptionDate; var exceptionDate = data.obj.exceptionDate;
this.isAbnormal = exceptionDate.length ? true : false; this.isAbnormal = exceptionDate.length ? true : false;
var clues = ''; var clues = '';
...@@ -1887,7 +1904,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1887,7 +1904,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
userId: getQueryParams('userId'), userId: getQueryParams('userId'),
startTime: this.dataRangeArr[this.dataRangeIndex].startDate, startTime: this.dataRangeArr[this.dataRangeIndex].startDate,
endTime: this.dataRangeArr[this.dataRangeIndex].endDate, endTime: this.dataRangeArr[this.dataRangeIndex].endDate,
classId:this.userInfo.classId classId: this.userInfo.classId
}) })
if (data.code != 200) { if (data.code != 200) {
uni.showToast({ uni.showToast({
...@@ -1918,7 +1935,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1918,7 +1935,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
schoolId: getQueryParams('schoolId'), schoolId: getQueryParams('schoolId'),
userId: getQueryParams('userId'), userId: getQueryParams('userId'),
currentDate, currentDate,
classId:this.userInfo.classId classId: this.userInfo.classId
}) })
if (data.code != 200) { if (data.code != 200) {
uni.showToast({ uni.showToast({
...@@ -1929,7 +1946,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -1929,7 +1946,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
return return
} }
var tempList = data.data; var tempList = data.data;
if (tempList.length) { if (tempList && tempList.length) {
tempList.forEach(e => { tempList.forEach(e => {
e.attendDetailReportDTOList.forEach(c => { e.attendDetailReportDTOList.forEach(c => {
c.border = c.describeContent && c.describeContent != '当日早到冠军' ? c.border = c.describeContent && c.describeContent != '当日早到冠军' ?
...@@ -2047,7 +2064,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -2047,7 +2064,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}) })
return return
} }
this.memberInfo.leastAmount = data.obj.leastAmount; this.memberInfo.leastAmount = data.obj.leastAmount || '';
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
...@@ -2079,14 +2096,18 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -2079,14 +2096,18 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} }
this.memberInfo.differDay = data.obj.differDay; this.memberInfo.differDay = data.obj.differDay;
this.memberInfo.invalidDate = data.obj.invalidDate; this.memberInfo.invalidDate = data.obj.invalidDate;
let month = data.obj.invalidDate.slice(5, 6) == 0 ? data if (data.obj.invalidDate) {
.obj.invalidDate.slice(6, 7) : data.obj let month = data.obj.invalidDate.slice(5, 6) == 0 ? data
.invalidDate.slice(5, 7); .obj.invalidDate.slice(6, 7) : data.obj
let date = data.obj.invalidDate.slice(8, 9) == 0 ? data.obj .invalidDate.slice(5, 7);
.invalidDate.slice(9) : data.obj let date = data.obj.invalidDate.slice(8, 9) == 0 ? data.obj
.invalidDate.slice(8); .invalidDate.slice(9) : data.obj
this.memberInfo.invalidDateStr = data.obj.invalidDate .invalidDate.slice(8);
.slice(0, 4) + '' + month + '' + date + ''; this.memberInfo.invalidDateStr = data.obj.invalidDate
.slice(0, 4) + '' + month + '' + date + '';
} else {
this.memberInfo.invalidDateStr = '';
}
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
......
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