Commit 09497a1d authored by 袁玲利's avatar 袁玲利

校园报告

parent 7d1a3d23
...@@ -454,18 +454,18 @@ export default { ...@@ -454,18 +454,18 @@ export default {
AuthOauthToken: uni.getStorageSync("AuthOauthToken") || "", AuthOauthToken: uni.getStorageSync("AuthOauthToken") || "",
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
}, },
url: `${az_gHost}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalGroupList`, url: `${az_gHost}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalGroupListV2`,
}, },
params params
); );
if (data.code != 10000) { if (data.code != 200) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: data.message || "发生异常!", title: data.message || "发生异常!",
}); });
return; return;
} }
let res = data.data; let res = data.obj;
this.cateringAbnormalGroupList = res; this.cateringAbnormalGroupList = res;
if (res.length) { if (res.length) {
this.lastMeal = this.lastMeal =
......
...@@ -1754,7 +1754,6 @@ export default { ...@@ -1754,7 +1754,6 @@ export default {
}, },
async mounted() { async mounted() {
await this.init(); await this.init();
}, },
methods: { methods: {
async init() { async init() {
...@@ -1856,10 +1855,10 @@ export default { ...@@ -1856,10 +1855,10 @@ export default {
this.diningSituations.diningSituationsDate = this.formatDate( this.diningSituations.diningSituationsDate = this.formatDate(
this.minDate this.minDate
); );
this.queryConsumerSummaryAmount(1).then(()=>{ this.queryConsumerSummaryAmount(1).then(() => {
self.piechart(); self.piechart();
}); });
this.queryLivingCostsAmount(); this.queryLivingCostsAmount();
// this.queryDayConsumerTrend(1).then((e) => // this.queryDayConsumerTrend(1).then((e) =>
// // this.linechart(this.reportTypeIndex) // // this.linechart(this.reportTypeIndex)
...@@ -1903,7 +1902,7 @@ export default { ...@@ -1903,7 +1902,7 @@ export default {
}, },
// 当天11:00 ~ 13:00属于高峰期 // 当天11:00 ~ 13:00属于高峰期
isPeakPeriod() { isPeakPeriod() {
let first = this.timeIn("11:00:00", "13:00:00"); let first = this.timeIn("11:00:00", "11:01:00");
return first; return first;
}, },
nodataClick: function () { nodataClick: function () {
...@@ -1965,9 +1964,9 @@ export default { ...@@ -1965,9 +1964,9 @@ export default {
this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this.dataRangeIndex].startDate,
this.dataRangeArr[this.dataRangeIndex].endDate this.dataRangeArr[this.dataRangeIndex].endDate
); );
this.queryConsumerSummaryAmount(1).then(()=>{ this.queryConsumerSummaryAmount(1).then(() => {
self.piechart() self.piechart();
}) });
// this.queryConsumerSummaryAmount(); // this.queryConsumerSummaryAmount();
// this.queryIsDredgeMember(1002, 1).then(() => { // this.queryIsDredgeMember(1002, 1).then(() => {
// if (this.isOpen) { // if (this.isOpen) {
...@@ -2309,33 +2308,68 @@ export default { ...@@ -2309,33 +2308,68 @@ export default {
this.dataRangeArr[this.dataRangeIndex].endDate this.dataRangeArr[this.dataRangeIndex].endDate
); );
try { try {
await $.ajax({ let data = {};
url: if (this.from == "wechat") {
gHost + data = await this.$http.post(
"/report-push/cateringAbnormal/getCateringAbnormalGroupList", {
type: "POST", header: {
contentType: "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
data: params, },
success: function (data) { url:
self.cateringAbnormalGroupList = []; gHost +
if (data.code == 10000) { "/report-push/cateringAbnormal/getCateringAbnormalGroupList",
let res = data.data; },
self.cateringAbnormalGroupList = res; params
console.log( );
self.cateringAbnormalGroupList, self.cateringAbnormalGroupList = [];
"aaaaaaaaaaaaaaaaaaaaaaaa" if (data.code == 10000) {
); let res = data.data;
// if (res.length) { self.cateringAbnormalGroupList = res;
// this.lastMeal = }
// new Date(res[0].statisticalDate).getMonth() + } else if (this.from == "alipay") {
// 1 + data = await this.$http.post(
// "月" + {
// new Date(res[0].statisticalDate).getDate() + header: {
// "日"; "Content-Type": "application/x-www-form-urlencoded",
// } },
} url: `${az_gHost}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalGroupListV2`,
}, },
}); params
);
self.cateringAbnormalGroupList = [];
if (data.code == 200) {
let res = data.obj;
self.cateringAbnormalGroupList = res;
}
}
// await $.ajax({
// url:
// gHost +
// "/report-push/cateringAbnormal/getCateringAbnormalGroupList",
// type: "POST",
// contentType: "application/x-www-form-urlencoded",
// data: params,
// success: function (data) {
// self.cateringAbnormalGroupList = [];
// if (data.code == 10000) {
// let res = data.data;
// self.cateringAbnormalGroupList = res;
// console.log(
// self.cateringAbnormalGroupList,
// "aaaaaaaaaaaaaaaaaaaaaaaa"
// );
// // if (res.length) {
// // this.lastMeal =
// // new Date(res[0].statisticalDate).getMonth() +
// // 1 +
// // "月" +
// // new Date(res[0].statisticalDate).getDate() +
// // "日";
// // }
// }
// },
// });
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
...@@ -2349,13 +2383,11 @@ export default { ...@@ -2349,13 +2383,11 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
let arr = this.pieDatas; let arr = this.pieDatas;
let domChart = document.getElementById("consumer-preferences-pie"); let domChart = document.getElementById("consumer-preferences-pie");
if(!domChart){ if (!domChart) {
return; return;
} }
let myChart = echarts.init( let myChart = echarts.init(domChart);
domChart console.log(myChart, "zzzzzzzzzzzzzzzzz");
);
console.log(myChart, 'zzzzzzzzzzzzzzzzz')
let option = { let option = {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
...@@ -2403,12 +2435,14 @@ export default { ...@@ -2403,12 +2435,14 @@ export default {
? year + "-" + month + "-" + "0" + i ? year + "-" + month + "-" + "0" + i
: year + "-" + month + "-" + i; : year + "-" + month + "-" + i;
} }
const saturdayDate = (allDate.length || []) && allDate.filter((e) => { const saturdayDate =
const date = new Date(e); (allDate.length || []) &&
if (date.getDay() == 6) { allDate.filter((e) => {
return true; const date = new Date(e);
} if (date.getDay() == 6) {
}); return true;
}
});
return saturdayDate; return saturdayDate;
}, },
linechart: function (num) { linechart: function (num) {
...@@ -2559,9 +2593,10 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -2559,9 +2593,10 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
mySize.style.width = 350 + "px"; mySize.style.width = 350 + "px";
mySize.style.height = 260 + "px"; mySize.style.height = 260 + "px";
var myBreakfastTimeLineChart = echarts.init(mySize); var myBreakfastTimeLineChart = echarts.init(mySize);
var cateringList = (this.mealtimeTrendsData.length || []) && this.mealtimeTrendsData.filter( var cateringList =
(e) => e.mealtype == mealtype (this.mealtimeTrendsData.length || []) &&
)[0].cateringList; this.mealtimeTrendsData.filter((e) => e.mealtype == mealtype)[0]
.cateringList;
var breakfastTimeData = JSON.parse(JSON.stringify(cateringList)); var breakfastTimeData = JSON.parse(JSON.stringify(cateringList));
var breakfastTimeDataTwo = JSON.parse(JSON.stringify(cateringList)); var breakfastTimeDataTwo = JSON.parse(JSON.stringify(cateringList));
breakfastTimeData.forEach((e) => { breakfastTimeData.forEach((e) => {
...@@ -2584,8 +2619,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -2584,8 +2619,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}); });
var xInterval = this.reportTypeIndex ? 0 : 6; var xInterval = this.reportTypeIndex ? 0 : 6;
var yMidPoint = var yMidPoint =
"2022/07/01 " + "2022/07/01 " + (this.mealtimeTrendsData.length || []) &&
(this.mealtimeTrendsData.length || []) && this.mealtimeTrendsData.filter((e) => e.mealtype == 1)[0].earliestTime; this.mealtimeTrendsData.filter((e) => e.mealtype == 1)[0].earliestTime;
var maxDate = new Date(yMidPoint).setHours( var maxDate = new Date(yMidPoint).setHours(
new Date(yMidPoint).getHours() == 23 new Date(yMidPoint).getHours() == 23
? "00" ? "00"
...@@ -3467,24 +3502,61 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3467,24 +3502,61 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// 查询就餐情况 // 查询就餐情况
async queryNotRepastDetails(startDate, endDate) { async queryNotRepastDetails(startDate, endDate) {
try { try {
let data = await this.$http.get( // let data = await this.$http.get(
{ // {
url: // url:
gHost + // gHost +
"/report-push/campus-consumer-report/queryNotRepastDetails", // "/report-push/campus-consumer-report/queryNotRepastDetails",
}, // },
{
schoolId: getQueryParams("schoolId"), // );
userId: getQueryParams("userId"), let params = {
startDate, schoolId: getQueryParams("schoolId"),
endDate, userId: getQueryParams("userId"),
timeType: this.reportTypeIndex == 0 ? 2 : 1, startDate,
statisticalMonth: moment( endDate,
this.dataRangeArr[this.dataRangeIndex].startDate timeType: this.reportTypeIndex == 0 ? 2 : 1,
).format("YYYYMM"), statisticalMonth: moment(
userType: this.usertype, this.dataRangeArr[this.dataRangeIndex].startDate
} ).format("YYYYMM"),
); userType: this.usertype,
};
let data = {};
if (this.from == "wechat") {
data = await this.$http.get(
{
url:
gHost +
"/report-push/campus-consumer-report/queryNotRepastDetails",
},
params
);
// if (data.code != 200) {
// uni.showToast({
// icon: "none",
// mask: true,
// title: data.msg,
// });
// return;
// }
// if (!data.obj) {
// this.diningSituations = {};
// return;
// }
// this.diningSituations.notRepastDay = data.obj.notRepastDay;
// this.diningSituations.notRepastDetailsDTOS =
// data.obj.notRepastDetailsDTOS;
} else if (this.from == "alipay") {
data = await this.$http.get(
{
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
url: `${az_gHost}/cloud-gateway/bill/campusConsumerReport/queryNotRepastDetails`,
},
params
);
}
if (data.code != 200) { if (data.code != 200) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
...@@ -3500,19 +3572,19 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3500,19 +3572,19 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
this.diningSituations.notRepastDay = data.obj.notRepastDay; this.diningSituations.notRepastDay = data.obj.notRepastDay;
this.diningSituations.notRepastDetailsDTOS = this.diningSituations.notRepastDetailsDTOS =
data.obj.notRepastDetailsDTOS; data.obj.notRepastDetailsDTOS;
this.diningSituations.cateringLevel = data.obj.cateringLevel; // this.diningSituations.cateringLevel = data.obj.cateringLevel;
this.diningSituations.notCateringNumber = data.obj.notCateringNumber; // this.diningSituations.notCateringNumber = data.obj.notCateringNumber;
this.diningSituations.notCateringType = this.diningSituations // this.diningSituations.notCateringType = this.diningSituations
.cateringLevel // .cateringLevel
? ["早餐", "午餐", "晚餐"][this.diningSituations.cateringLevel - 1] // ? ["早餐", "午餐", "晚餐"][this.diningSituations.cateringLevel - 1]
: ""; // : "";
this.diningSituations.clues = this.diningSituations.cateringLevel // this.diningSituations.clues = this.diningSituations.cateringLevel
? [ // ? [
"早餐吃好,一天才能活力满满哦", // "早餐吃好,一天才能活力满满哦",
"及时补充能量,下午才能集中精神学习哦", // "及时补充能量,下午才能集中精神学习哦",
"晚餐好好吃,身体才能更健康", // "晚餐好好吃,身体才能更健康",
][this.diningSituations.cateringLevel - 1] // ][this.diningSituations.cateringLevel - 1]
: ""; // : "";
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
...@@ -3769,14 +3841,18 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3769,14 +3841,18 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
let newArr = []; let newArr = [];
// 早餐 mealType = 1 // 早餐 mealType = 1
let arr = (array_ && array_.length || []) && array_.filter((x) => x.mealType == 1); let arr =
((array_ && array_.length) || []) &&
array_.filter((x) => x.mealType == 1);
if (arr.length) { if (arr.length) {
newArr.push(arr[0]); newArr.push(arr[0]);
} else { } else {
newArr.push(nullObj); newArr.push(nullObj);
} }
// 午餐 mealType = 2 // 午餐 mealType = 2
let arr1 = (array_ && array_.length || []) && array_.filter((x) => x.mealType == 2); let arr1 =
((array_ && array_.length) || []) &&
array_.filter((x) => x.mealType == 2);
if (arr1.length) { if (arr1.length) {
newArr.push(arr1[0]); newArr.push(arr1[0]);
} else { } else {
...@@ -3784,7 +3860,9 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3784,7 +3860,9 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} }
// 晚餐 mealType = 3 // 晚餐 mealType = 3
let arr2 = (array_ && array_.length || []) && array_.filter((x) => x.mealType == 3); let arr2 =
((array_ && array_.length) || []) &&
array_.filter((x) => x.mealType == 3);
if (arr2.length) { if (arr2.length) {
newArr.push(arr2[0]); newArr.push(arr2[0]);
} else { } else {
...@@ -3792,8 +3870,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -3792,8 +3870,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} }
// 其他 mealType = 4 夜宵 mealType = 5 夜夜宵 // 其他 mealType = 4 夜宵 mealType = 5 夜夜宵
let arr3 = (array_ && array_.length || []) && array_.filter((x) => x.mealType == 4); let arr3 =
let arr4 = (array_ && array_.length || []) && array_.filter((x) => x.mealType == 5); ((array_ && array_.length) || []) &&
array_.filter((x) => x.mealType == 4);
let arr4 =
((array_ && array_.length) || []) &&
array_.filter((x) => x.mealType == 5);
if (arr3.length) { if (arr3.length) {
let obj = JSON.parse(JSON.stringify(arr3[0])); let obj = JSON.parse(JSON.stringify(arr3[0]));
if (arr4.length) { if (arr4.length) {
...@@ -4509,7 +4591,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`, ...@@ -4509,7 +4591,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// 跳转云平台权益中心-支付宝 // 跳转云平台权益中心-支付宝
async openAzMenber_() { async openAzMenber_() {
my.navigateTo({ my.navigateTo({
url: "/pages/OpenMemberGui/OpenMemberGui", url: "/pages/ToCloudOrder/ToCloudOrder",
}); });
}, },
// equityPay: function () { // equityPay: function () {
......
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