Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
X
xzf_uniapp-wechat-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李智书
xzf_uniapp-wechat-web
Commits
93e07448
Commit
93e07448
authored
Sep 06, 2024
by
袁玲利
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消费报告和异常报告
parent
00eeff5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
567 additions
and
360 deletions
+567
-360
src/manifest.json
src/manifest.json
+2
-2
src/pages/ApplyConsumption/Home/Home.vue
src/pages/ApplyConsumption/Home/Home.vue
+17
-6
src/pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption.vue
...umptionSystem/AbnormalConsumption/AbnormalConsumption.vue
+5
-11
src/pages/SchoolReport/SchoolReport.vue
src/pages/SchoolReport/SchoolReport.vue
+543
-341
No files found.
src/manifest.json
View file @
93e07448
...
...
@@ -89,12 +89,12 @@
"disableHostCheck"
:
true
,
"proxy"
:
{
"/"
:
{
"target"
:
"https://
fpdev
.xiaopay.net"
,
"target"
:
"https://
uat-pay
.xiaopay.net"
,
"changeOrigin"
:
true
,
"secure"
:
false
},
"/cgi-xpay"
:
{
"target"
:
"https://
fpdev
.xiaopay.net"
,
"target"
:
"https://
uat-pay
.xiaopay.net"
,
"changeOrigin"
:
true
,
"secure"
:
false
,
"pathRewrite"
:
{
...
...
src/pages/ApplyConsumption/Home/Home.vue
View file @
93e07448
...
...
@@ -130,7 +130,7 @@
return
{
path
:
[
'
../ConsumptIoninfo/ConsumptIoninfo
'
,
'
../ConsumptionQuota/ConsumptionQuota
'
,
'
/pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption
'
,
'
../CommonProblem/CommonProblem
'
,
'
../campusReport/campus
Report
'
'
../CommonProblem/CommonProblem
'
,
'
/pages/SchoolReport/School
Report
'
][
index
],
title
:
[
'
消费记录
'
,
'
消费限额
'
,
'
消费异常
'
,
'
常见问题
'
,
'
校园报告
'
][
index
],
sketch
:
[
'
消费记录 笔笔可查
'
,
'
设置额度 管控消费
'
,
'
消费异常 每日提醒
'
,
'
使用疑问 一一解答
'
,
'
校园报告
'
][
index
],
...
...
@@ -183,7 +183,8 @@
// 跳转内部页面path
path
:
''
,
// 支付宝小程序
aliMini
:
AliAppMini
aliMini
:
AliAppMini
,
fromProgm
:
'
wechat
'
,
// 来源
};
},
onLoad
(
options
)
{
...
...
@@ -198,6 +199,8 @@
return
;
}
this
.
UserLogin
(
options
[
'
token
'
])
console
.
log
(
options
,
'
options
'
)
this
.
fromProgm
=
options
.
from
||
'
wechat
'
if
(
options
[
'
path
'
])
{
this
.
path
=
options
[
'
path
'
]
||
""
}
...
...
@@ -282,9 +285,10 @@
sessionStorage
.
setItem
(
'
accountId
'
,
this
.
HomeDataInfo
[
'
accountId
'
])
// 查询消费会员权益项
await
this
.
QueryProductContractItem
()
console
.
log
(
this
[
'
path
'
],
'
this[path]
'
)
// 20231031
if
(
this
[
'
path
'
])
{
if
(
'
/pages/
ApplyConsumption/campusReport/campus
Report
'
==
this
[
'
path
'
])
{
if
(
'
/pages/
SchoolReport/School
Report
'
==
this
[
'
path
'
])
{
this
.
menuClick
(
this
.
menuList
[
4
],
5
)
return
}
...
...
@@ -324,18 +328,25 @@
if
(
!
item
.
path
)
{
return
}
if
(
this
.
HomeDataInfo
[
'
membershipStatus
'
]
==
1
)
{
const
result
=
await
this
.
QueryProductContractItem
(
item
[
'
serviceItemCode
'
])
const
authFlag
=
result
==
'
pass
'
?
'
true
'
:
'
false
'
console
.
log
(
result
,
'
this.homeDataInfo
'
)
if
(
this
.
HomeDataInfo
[
'
membershipStatus
'
]
==
1
&&
index
!=
5
)
{
// 消费报告不弹弹窗
if
(
item
[
'
auth
'
]
&&
item
[
'
serviceItemCode
'
])
{
// 查询消费会员权益项
const
result
=
await
this
.
QueryProductContractItem
(
item
[
'
serviceItemCode
'
])
if
(
result
==
"
fail
"
)
{
this
.
contractMenber
=
true
throw
(
'
您还未开通消费会员,
'
)
}
}
}
cons
t
query
=
le
t
query
=
`?name=
${
this
.
HomeDataInfo
[
'
userName
'
]}
&accountId=
${
this
.
HomeDataInfo
[
'
accountId
'
]}
&userId=
${
this
.
userInfo
[
'
userId
'
]}
&schoolId=
${
this
.
userInfo
[
'
schoolId
'
]}
&userType=
${
this
.
userInfo
[
'
userType
'
]}
`
if
(
index
==
5
){
//消费报告加鉴权结果
query
+=
'
&auth=
'
+
authFlag
+
"
&from=
"
+
this
.
fromProgm
}
console
.
log
(
item
.
path
+
query
)
uni
.
switchTab
({
url
:
item
.
path
+
query
,
...
...
src/pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption.vue
View file @
93e07448
...
...
@@ -259,9 +259,9 @@
// 时间处理模块
import
dayjs
from
"
dayjs
"
;
import
{
Dialog
}
from
"
vant
"
;
let
gHost
=
"
https://
"
+
window
.
location
.
host
;
let
gHost
=
"
https://
"
+
window
.
location
.
host
;
if
(
window
.
location
.
protocol
!=
"
https:
"
)
{
gHost
=
"
https://
dev
-az-cloud-api.xiaopay.net
"
;
gHost
=
"
https://
test
-az-cloud-api.xiaopay.net
"
;
}
if
(
window
.
location
.
host
==
"
fpdev.xiaopay.net
"
)
{
gHost
=
"
https://dev-az-cloud-api.xiaopay.net
"
;
...
...
@@ -406,7 +406,7 @@ export default {
},
params
);
if
(
data
.
code
!=
100
00
)
{
if
(
data
.
code
!=
2
00
)
{
uni
.
showToast
({
icon
:
"
none
"
,
title
:
data
.
message
||
"
发生异常!
"
,
...
...
@@ -474,6 +474,7 @@ export default {
background
:
#f8f8f8
;
display
:
flex
;
flex-direction
:
column
;
border-radius
:
12rpx
;
.what
{
margin-top
:
18rpx
;
...
...
@@ -760,14 +761,6 @@ export default {
}
}
.tips
{
padding
:
16rpx
50rpx
0
50rpx
;
height
:
30rpx
;
font-size
:
22rpx
;
color
:
rgba
(
0
,
0
,
0
,
0
.5
);
line-height
:
30rpx
;
}
.lastBar
{
width
:
100%
;
display
:
flex
;
...
...
@@ -802,6 +795,7 @@ export default {
.week
{
display
:
flex
;
height
:
56rpx
;
line-height
:
56rpx
;
font-size
:
44rpx
;
font-weight
:
500
;
color
:
rgba
(
0
,
0
,
0
,
0
.85
);
...
...
src/pages/SchoolReport/SchoolReport.vue
View file @
93e07448
...
...
@@ -105,7 +105,7 @@
</view>
</view>
<view
class=
"school-report-context-card-one-context-txt"
>
本
{{
[
'
月
'
,
'
周
'
][
reportTypeIndex
]
}}
生活费
本
{{
[
'
月
'
,
'
周
'
][
reportTypeIndex
]
}}
生活费
<text
class=
"txt-important"
>
{{
consumerDetailCalculateObj
.
totalData
}}
</text>
元,
<text
v-if=
"consumerSummaryAmountOBj.gtgraderate >= 80"
>
{{
consumerSummaryAmountOBj
.
gtgraderate
}}
<text
class=
"txt-important"
>
超过了
</text>
同年级
<text
class=
"txt-important"
>
80%
</text>
的学生。要注意引导孩子习惯,培养健康的消费观念哦~
</text>
<text
v-else-if=
"consumerSummaryAmountOBj.gtgraderate >= 60 && consumerSummaryAmountOBj.gtgraderate
<
80
"
>
{{
consumerSummaryAmountOBj
.
gtgraderate
}}
<text
class=
"txt-important"
>
超过了
</text>
同年级
<text
class=
"txt-important"
>
60%
</text>
的学生。要注意引导孩子习惯,培养健康的消费观念哦~
</text>
...
...
@@ -380,17 +380,17 @@
<view
class=
"firstLine"
>
<view
class=
"firstCol"
>
合计
</view>
<view
class=
"lastCol"
>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[0].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[0].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[0].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].schoolMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[0].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[0].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[0].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].schoolMealTypeTotalAmount : '--'}}
</view>
</view>
</view>
<view
class=
"secondLine"
>
<view
class=
"firstCol"
>
餐均
</view>
<view
class=
"lastCol"
>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[0].mealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].mealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[0].gradeMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].gradeMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[0].schoolMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].schoolMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[0].mealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].mealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[0].gradeMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].gradeMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[0].schoolMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[0].schoolMealTypeAvgAmount : '--'}}
</view>
</view>
</view>
</view>
...
...
@@ -406,17 +406,17 @@
<view
class=
"firstLine"
>
<view
class=
"firstCol"
>
合计
</view>
<view
class=
"lastCol"
>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[1].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[1].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[1].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].schoolMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[1].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[1].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[1].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].schoolMealTypeTotalAmount : '--'}}
</view>
</view>
</view>
<view
class=
"secondLine"
>
<view
class=
"firstCol"
>
餐均
</view>
<view
class=
"lastCol"
>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[1].mealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].mealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[1].gradeMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].gradeMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[1].schoolMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].schoolMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[1].mealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].mealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[1].gradeMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].gradeMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[1].schoolMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[1].schoolMealTypeAvgAmount : '--'}}
</view>
</view>
</view>
</view>
...
...
@@ -432,17 +432,17 @@
<view
class=
"firstLine"
>
<view
class=
"firstCol"
>
合计
</view>
<view
class=
"lastCol"
>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[2].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[2].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[2].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].schoolMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[2].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[2].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[2].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].schoolMealTypeTotalAmount : '--'}}
</view>
</view>
</view>
<view
class=
"secondLine"
>
<view
class=
"firstCol"
>
餐均
</view>
<view
class=
"lastCol"
>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[2].mealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].mealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[2].gradeMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].gradeMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[2].schoolMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].schoolMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[2].mealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].mealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[2].gradeMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].gradeMealTypeAvgAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[2].schoolMealTypeAvgAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[2].schoolMealTypeAvgAmount : '--'}}
</view>
</view>
</view>
</view>
...
...
@@ -458,9 +458,9 @@
<view
class=
"firstLine"
>
<view
class=
"firstCol"
>
合计
</view>
<view
class=
"lastCol"
>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[3].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[3].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[3].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[3].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList[3].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[3].schoolMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[3].mealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[3].mealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[3].gradeMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[3].gradeMealTypeTotalAmount : '--'}}
</view>
<view>
{{consumerAmountObj.campusMealTypeConsumerSummaryList
.length
&&
consumerAmountObj.campusMealTypeConsumerSummaryList
[3].schoolMealTypeTotalAmount ? consumerAmountObj.campusMealTypeConsumerSummaryList[3].schoolMealTypeTotalAmount : '--'}}
</view>
</view>
</view>
</view>
...
...
@@ -710,15 +710,14 @@
</view> -->
</view>
<!-- 消费偏好 -->
<view
v-show=
"tabIndex==1&&isOpen"
class=
"school-report-context-card-three"
>
<view
class=
"school-report-context-card-three"
>
<view
class=
"school-report-context-card-title"
>
<view
class=
"school-report-context-card-title-img school-report-context-card-title-img3"
>
<text></text>
</view>
</view>
<view
class=
"school-report-context-card-three-conclusion"
>
<view
class=
"school-report-context-card-three-conclusion-item"
:class=
"consumerDetailCalculateObj.totalData>0?'':'card-three-conclusion-nodata'"
v-if=
"consumerSummaryAmountOBj.canteenamount || consumerSummaryAmountOBj.superAndOtherAmount"
>
<view
class=
"school-report-context-card-three-conclusion-item"
v-if=
"consumerSummaryAmountOBj.canteenamount || consumerSummaryAmountOBj.superAndOtherAmount"
>
<text>
<!-- <text v-if="isEatLow">正餐消费占比<text
class="school-report-context-card-three-conclusion-item-describe">过低</text>,请及时调整饮食习惯</text> -->
...
...
@@ -743,7 +742,8 @@
</view>
</view>
</view>
<view
id=
"consumer-preferences-pie"
v-if=
"consumerSummaryAmountOBj.canteenamount || consumerSummaryAmountOBj.superAndOtherAmount"
>
<view
id=
"consumer-preferences-pie"
style=
"width: 100%; height: 205px;"
v-if=
"consumerSummaryAmountOBj.canteenamount || consumerSummaryAmountOBj.superAndOtherAmount"
>
</view>
</view>
<!-- 消费明细 -->
...
...
@@ -1519,9 +1519,23 @@
<
script
>
// import html2cancas from "html2canvas"
import
{
requestPost
}
from
"
../ApplyConsumption/common/request.js
"
;
var
gHost
=
"
https://
"
+
window
.
location
.
host
;
if
(
window
.
location
.
protocol
!=
"
https:
"
)
{
gHost
=
"
https://fpdev.xiaopay.net
"
;
gHost
=
"
https://uat-pay.xiaopay.net
"
;
}
let
az_gHost
=
"
https://
"
+
window
.
location
.
host
;
if
(
window
.
location
.
protocol
!=
"
https:
"
)
{
az_gHost
=
"
https://uat-az-cloud-api.xiaopay.net
"
;
}
if
(
window
.
location
.
host
==
"
fpdev.xiaopay.net
"
)
{
az_gHost
=
"
https://dev-az-cloud-api.xiaopay.net
"
;
}
if
(
window
.
location
.
host
==
"
uat.xiaopay.net
"
)
{
az_gHost
=
"
https://uat-az-cloud-api.xiaopay.net
"
;
}
if
(
window
.
location
.
host
==
"
pay.xiaopay.net
"
)
{
az_gHost
=
"
https://az-cloud-api.xiaopay.net
"
;
}
//获取参数
function
getQueryParams
(
params
)
{
...
...
@@ -1674,6 +1688,9 @@ export default {
cateringAbnormalGroupList
:
[],
//就餐异常列表
cateringAbnormalGroupList_
:
[],
// 当日就餐异常列表
dateForStr
:
""
,
from
:
"
wechat
"
,
homeDataInfo
:
{},
usertype
:
""
,
};
},
computed
:
{
...
...
@@ -1703,14 +1720,26 @@ export default {
return
str
;
},
},
mounted
()
{
this
.
init
();
async
mounted
()
{
await
this
.
init
();
this
.
piechart
()
},
methods
:
{
async
init
()
{
const
self
=
this
;
// 消费报告用户鉴权
this
.
homeDataInfo
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"
HomeDataInfo
"
));
this
.
auth
=
getQueryParams
(
"
auth
"
);
console
.
log
(
this
.
auth
==
"
false
"
,
"
个人用户鉴权
"
);
this
.
from
=
getQueryParams
(
"
from
"
)
||
"
wechat
"
;
this
.
usertype
=
getQueryParams
(
"
userType
"
);
console
.
log
(
this
.
auth
==
"
false
"
,
"
个人用户鉴权
"
,
this
.
from
,
this
.
homeDataInfo
,
"
aaaaaa
"
,
this
.
usertype
);
if
(
this
.
isPeakPeriod
()
&&
!
this
.
isnodataClick
)
{
this
.
showReport
=
false
;
return
;
...
...
@@ -1742,101 +1771,28 @@ export default {
// this.queryIsDredgeMember(1002).then(() => {
// if (this.isOpen) {
// if (true) {
this
.
queryMemberValidTime
(
1002
).
then
((
e
)
=>
{
if
(
new
Date
(
this
.
memberInfo
.
invalidDate
).
getTime
()
<=
new
Date
(
"
2022/06/30
"
).
getTime
()
)
{
this
.
flag
=
0
;
this
.
tabIndex
=
1
;
this
.
memberInfo
.
invalidDateStr
=
"
2022年6月30日
"
;
this
.
memberInfo
.
differDay
=
dayjs
(
"
2022/06/30
"
).
diff
(
dayjs
(),
"
day
"
)
+
1
;
this
.
containerHeight
=
4200
;
}
else
{
this
.
tabIndex
=
1
;
// this.queryIsDredgeMember(1002, 1);
}
// this.queryMealPalAnalyse().then(() => this.mealPalBarchart());
// this.queryRepastTimeTrend().then(() => {
// if (this.mealtypeArr.indexOf(1) != -1) {
// this.breakfastTimeLinechart(this
// .reportTypeIndex,
// 'breakfast-time-line',
// 1);
// }
// if (this.mealtypeArr.indexOf(2) != -1) {
// this.breakfastTimeLinechart(this
// .reportTypeIndex, 'lunch-time-line',
// 2);
// }
// if (this.mealtypeArr.indexOf(3) != -1) {
// this.breakfastTimeLinechart(this
// .reportTypeIndex, 'dinner-time-line',
// 3);
// }
// })
this
.
queryConsumerSummaryAmount
(
1
).
then
((
e
)
=>
this
.
piechart
());
this
.
queryLivingCostsAmount
();
this
.
queryDayConsumerTrend
(
1
).
then
((
e
)
=>
this
.
linechart
(
this
.
reportTypeIndex
)
);
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
=
{};
}
});
});
// }
// else {
// if (new Date().getTime()
<=
new
Date
(
"
2022/06/30
"
).
getTime
())
{
// this.isOpen = true;
// this.flag = 0;
// this.tabIndex = 1;
// this.memberInfo.invalidDateStr = "2022年6月30日";
// this.memberInfo.differDay =
// dayjs("2022/06/30").diff(dayjs(), "day") + 1;
// this.containerHeight = 4200;
// this.queryConsumerSummaryAmount(1).then((e) => this.piechart());
// this.queryLivingCostsAmount();
// this.queryDayConsumerTrend(1).then((e) =>
// this.linechart(this.reportTypeIndex)
// );
// // this.queryMealPalAnalyse().then(() => this.mealPalBarchart());
// // this.queryRepastTimeTrend().then(() => {
// // if (this.mealtypeArr.indexOf(1) != -1) {
// // this.breakfastTimeLinechart(this.reportTypeIndex,
// // 'breakfast-time-line',
// // 1);
// // }
// // if (this.mealtypeArr.indexOf(2) != -1) {
// // this.breakfastTimeLinechart(this.reportTypeIndex, 'lunch-time-line',
// // 2);
// // }
// // if (this.mealtypeArr.indexOf(3) != -1) {
// // this.breakfastTimeLinechart(this.reportTypeIndex, 'dinner-time-line',
// // 3);
// // }
// // })
// } else {
// this.tabIndex = 1;
// this.queryIsDredgeMember(1002, 1).then(() => {
// this.queryConsumerSummaryAmount();
// this.queryDayConsumerTrend();
// // this.queryMealPalAnalyse();
// // this.queryRepastTimeTrend();
// });
// }
// }
// });
if
(
this
.
from
==
"
alipay
"
)
{
// 支付宝消费会员到期日
await
this
.
QueryProductContractItemDetailResp
();
console
.
log
(
this
.
memberInfo
,
"
this.memberInfo
"
);
}
else
{
// 微信消费会员到期日
await
this
.
queryMemberValidTime
(
1002
);
}
if
(
new
Date
(
this
.
memberInfo
.
invalidDate
).
getTime
()
<=
new
Date
(
"
2022/06/30
"
).
getTime
()
)
{
this
.
flag
=
0
;
this
.
tabIndex
=
1
;
this
.
memberInfo
.
invalidDateStr
=
"
2022年6月30日
"
;
this
.
memberInfo
.
differDay
=
dayjs
(
"
2022/06/30
"
).
diff
(
dayjs
(),
"
day
"
)
+
1
;
this
.
containerHeight
=
4200
;
}
else
{
this
.
tabIndex
=
1
;
}
let
tmpArr
=
[];
// 获取时间
for
(
let
i
=
1
;
i
<=
11
;
i
++
)
{
...
...
@@ -1862,6 +1818,27 @@ export default {
this
.
diningSituations
.
diningSituationsDate
=
this
.
formatDate
(
this
.
minDate
);
await
this
.
queryConsumerSummaryAmount
(
1
);
this
.
queryLivingCostsAmount
();
// this.queryDayConsumerTrend(1).then((e) =>
// // this.linechart(this.reportTypeIndex)
// );
this
.
queryDayConsumerTrend
();
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
=
{};
}
});
await
this
.
getCateringAbnormalGroupList
();
let
arr
=
this
.
cateringAbnormalGroupList
;
let
str
=
""
;
...
...
@@ -1887,7 +1864,7 @@ export default {
},
// 当天11:00 ~ 13:00属于高峰期
isPeakPeriod
()
{
let
first
=
this
.
timeIn
(
"
11:00:00
"
,
"
1
1:01
:00
"
);
let
first
=
this
.
timeIn
(
"
11:00:00
"
,
"
1
3:00
:00
"
);
return
first
;
},
nodataClick
:
function
()
{
...
...
@@ -1945,15 +1922,18 @@ export default {
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
);
this
.
queryConsumerSummaryAmount
();
//
this.queryConsumerSummaryAmount();
// this.queryIsDredgeMember(1002, 1).then(() => {
// if (this.isOpen) {
// if (true) {
this
.
queryConsumerSummaryAmount
(
1
).
then
((
e
)
=>
this
.
piechart
());
await
this
.
queryConsumerSummaryAmount
(
1
);
this
.
piechart
()
this
.
queryLivingCostsAmount
();
this
.
queryDayConsumerTrend
(
1
).
then
((
e
)
=>
this
.
linechart
(
this
.
reportTypeIndex
)
);
// this.queryDayConsumerTrend(1).then((e) =>
// // this.linechart(this.reportTypeIndex)
// );
this
.
queryDayConsumerTrend
();
this
.
queryNotRepastDetails
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
...
...
@@ -2028,7 +2008,7 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
callNumberBarchart
();
this
.
callDurationBarchart
();
this
.
leaveMessageBarchart
();
//
this.leaveMessageBarchart();
});
});
}
else
{
...
...
@@ -2048,7 +2028,7 @@ export default {
this
.
$nextTick
(()
=>
{
this
.
callNumberBarchart
();
this
.
callDurationBarchart
();
this
.
leaveMessageBarchart
();
//
this.leaveMessageBarchart();
});
}
else
{
this
.
$nextTick
(()
=>
{
...
...
@@ -2092,6 +2072,7 @@ export default {
},
schoolReportChange
:
function
(
e
)
{
this
.
reportTypeIndex
=
e
.
target
.
value
;
console
.
log
(
e
.
target
.
value
,
"
e.target.valuee.target.valuee.target.value
"
);
this
.
getDataRangeArr
(
this
.
reportTypeIndex
);
},
dataRangeChange
:
function
(
e
)
{
...
...
@@ -2268,6 +2249,10 @@ export default {
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
statisticalMonth
:
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
format
(
"
YYYYMM
"
),
userType
:
this
.
usertype
,
};
console
.
log
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
...
...
@@ -2310,44 +2295,49 @@ export default {
this
.
attendanceSituations
.
attendanceDate
=
this
.
formatDate
(
date
);
this
.
attendanceReprotDatail
(
this
.
formatDateTwo
(
date
));
},
piechart
:
function
()
{
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
"
consumer-preferences-pie
"
)
);
var
option
=
{
tooltip
:
{
trigger
:
"
item
"
,
},
series
:
this
.
pieDatas
.
map
(
function
(
data
,
idx
)
{
return
{
type
:
"
pie
"
,
radius
:
[
"
33
"
,
"
58
"
],
data
:
data
,
itemStyle
:
{
borderColor
:
"
#fff
"
,
borderWidth
:
3
,
},
label
:
{
formatter
:
function
(
e
)
{
return
e
.
name
+
"
\n
"
+
e
.
value
+
"
元
"
;
piechart
()
{
this
.
$nextTick
(()
=>
{
console
.
log
(
document
.
getElementById
(
"
consumer-preferences-pie
"
),
'
xxxxxxxxxxxxxxxxxxxxxx
'
,
this
.
pieDatas
);
let
arr
=
this
.
pieDatas
;
let
myChart
=
echarts
.
init
(
document
.
getElementById
(
"
consumer-preferences-pie
"
)
);
let
option
=
{
tooltip
:
{
trigger
:
"
item
"
,
},
series
:
arr
.
map
(
function
(
data
,
idx
)
{
return
{
type
:
"
pie
"
,
radius
:
[
"
33
"
,
"
58
"
],
data
:
data
,
itemStyle
:
{
borderColor
:
"
#fff
"
,
borderWidth
:
3
,
},
padding
:
[
0
,
2
],
rich
:
{
color
:
"
rgba(0, 0, 0, 0.85)
"
,
fontSize
:
12
,
fontFamily
:
"
PingFangSC-Regular, PingFang SC
"
,
fontWeight
:
400
,
lineHeight
:
17
,
label
:
{
formatter
:
function
(
e
)
{
return
e
.
name
+
"
\n
"
+
e
.
value
+
"
元
"
;
},
padding
:
[
0
,
2
],
rich
:
{
color
:
"
rgba(0, 0, 0, 0.85)
"
,
fontSize
:
12
,
fontFamily
:
"
PingFangSC-Regular, PingFang SC
"
,
fontWeight
:
400
,
lineHeight
:
17
,
},
},
},
};
}),
color
:
[
"
#00C47C
"
,
"
#F6C723
"
,
"
#FF8646
"
],
};
option
&&
myChart
.
setOption
(
option
);
window
.
addEventListener
(
"
resize
"
,
function
()
{
myChart
.
resize
();
});
};
}),
color
:
[
"
#00C47C
"
,
"
#F6C723
"
,
"
#FF8646
"
],
};
option
&&
myChart
.
setOption
(
option
);
window
.
addEventListener
(
"
resize
"
,
function
()
{
myChart
.
resize
();
});
})
},
// 获取某月的所有周六
getMonthSaturdayDate
:
function
(
year
,
month
)
{
...
...
@@ -3141,17 +3131,54 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// 查询学生信息
async
queryCampusStudentInfo
()
{
try
{
let
data
=
await
this
.
$http
.
get
(
{
url
:
gHost
+
"
/report-push/campus-consumer-report/queryCampusStudentInfo
"
,
},
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
}
);
// let url = gHost +
// "/report-push/campus-consumer-report/queryCampusStudentInfo"
// if(this.from == 'alipay'){
// url = `${az_gHost}/cloud-gateway/bill/campusConsumerReport/queryCampusStudentInfo`
// }
let
params
=
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
statisticalMonth
:
moment
(
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/queryCampusStudentInfo
"
,
},
params
);
}
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/queryCampusStudentInfo`
,
},
params
);
}
// let data = await this.$http.get(
// {
// url:
// url
// },
// {
// schoolId: getQueryParams("schoolId"),
// userId: getQueryParams("userId"),
// statisticalMonth: moment(
// this.dataRangeArr[this.dataRangeIndex].startDate
// ).format("YYYYMM"),
// userType: this.usertype,
// }
// );
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
icon
:
"
none
"
,
...
...
@@ -3161,7 +3188,6 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
return
;
}
this
.
userInfo
=
data
.
obj
||
{};
console
.
log
(
this
.
userInfo
,
"
用户信息
"
);
}
catch
(
e
)
{
//TODO handle the exception
console
.
log
(
e
);
...
...
@@ -3193,19 +3219,39 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// 查询消费明细
async
queryConsumerDetail
(
startDate
,
endDate
)
{
try
{
let
data
=
await
this
.
$http
.
get
(
{
url
:
gHost
+
"
/report-push/campus-consumer-report/queryConsumerDetail
"
,
},
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
,
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
}
);
let
params
=
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
,
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
statisticalMonth
:
moment
(
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/queryConsumerDetail
"
,
},
params
);
}
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/queryConsumerDetail`
,
},
params
);
}
if
(
data
.
code
==
200
)
{
if
(
data
.
obj
&&
...
...
@@ -3370,6 +3416,10 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
startDate
,
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
statisticalMonth
:
moment
(
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
).
format
(
"
YYYYMM
"
),
userType
:
this
.
usertype
,
}
);
if
(
data
.
code
!=
200
)
{
...
...
@@ -3461,20 +3511,38 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// 查询消费总额及学生消费偏好类型
async
queryConsumerSummaryAmount
(
num
)
{
try
{
let
data
=
await
this
.
$http
.
get
(
{
url
:
gHost
+
"
/report-push/campus-consumer-report/queryConsumerSummaryAmount
"
,
},
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
}
);
let
params
=
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
statisticalMonth
:
moment
(
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/queryConsumerSummaryAmount
"
,
},
params
);
}
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/queryConsumerSummaryAmount`
,
},
params
);
}
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
icon
:
"
none
"
,
...
...
@@ -3491,7 +3559,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
);
tmpObj
.
gradeavgamount_
=
(
tmpObj
.
gradeavgamount
+
""
).
split
(
"
.
"
);
tmpObj
.
schoolavgamount_
=
(
tmpObj
.
schoolavgamount
+
""
).
split
(
"
.
"
);
this
.
consumerSummaryAmountOBj
=
tmpObj
;
this
.
consumerSummaryAmountOBj
=
JSON
.
parse
(
JSON
.
stringify
(
tmpObj
))
;
// 超市和其它场景消费金额
this
.
consumerSummaryAmountOBj
.
superAndOtherAmount
=
tmpObj
.
supermarketamount
+
tmpObj
.
otheramount
;
...
...
@@ -3499,11 +3567,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
tmpObj
.
canteenamount
/
tmpObj
.
consumergrossamount
<
0.5
?
true
:
false
;
console
.
log
(
(
tmpObj
.
canteenamount
/
tmpObj
.
consumergrossamount
)
*
100
,
"
tmpObj.canteenamount / tmpObj.consumergrossamount
"
,
this
.
isEatLow
);
this
.
pieDatas
=
[];
if
(
num
)
{
this
.
pieDatas
=
[
[
...
...
@@ -3522,6 +3586,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
],
];
}
this
.
$forceUpdate
()
// this.consumerAmountObj = tmpObj;
// this.isReasonable = this.consumerAmountObj.gtgraderate >= 40 && this
// .consumerAmountObj.gtgraderate
<=
...
...
@@ -3568,20 +3633,50 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// 查询生活费额度
async
queryLivingCostsAmount
()
{
try
{
let
data
=
await
this
.
$http
.
get
(
{
url
:
gHost
+
"
/report-push/campus-consumer-report/queryLivingCostsAmount
"
,
},
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
}
);
// let url = gHost +
// "/report-push/campus-consumer-report/queryLivingCostsAmount";
// if(this.from == 'alipay'){
// url = az_gHost + '/bill/campusConsumerReport/queryLivingCostsAmount'
// }
let
params
=
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
statisticalMonth
:
moment
(
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/queryLivingCostsAmount
"
,
},
params
);
}
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/queryLivingCostsAmount`
,
},
params
);
}
// let data = await this.$http.get(
// {
// url:
// url,
// },
// params
// );
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
icon
:
"
none
"
,
...
...
@@ -3594,106 +3689,130 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
if
(
data
.
obj
)
{
this
.
consumerAmountObj
=
data
.
obj
;
// 分别取出早餐,午餐,晚餐,其他
let
array_
=
data
.
obj
.
campusMealTypeConsumerSummaryList
console
.
log
(
array_
,
'
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
'
,
array_
.
length
)
if
(
array_
.
length
){
this
.
consumerAmountObj
.
campusMealTypeConsumerSummaryList
=
[]
let
newArr
=
[]
let
nullObj
=
{
mealTypeTotalAmount
:
0
,
gradeMealTypeTotalAmount
:
0
,
schoolMealTypeTotalAmount
:
0
,
mealTypeAvgAmount
:
0
,
gradeMealTypeAvgAmount
:
0
,
schoolMealTypeAvgAmount
:
0
,
};
let
array_
=
data
.
obj
.
campusMealTypeConsumerSummaryList
;
// if (array_.length) {
this
.
consumerAmountObj
.
campusMealTypeConsumerSummaryList
=
[];
let
newArr
=
[];
// 早餐 mealType = 1
let
arr
=
array_
.
filter
(
x
=>
x
.
mealType
==
1
)
console
.
log
(
arr
,
'
arr
'
)
if
(
arr
.
length
){
newArr
.
push
(
arr
[
0
])
let
arr
=
array_
.
filter
((
x
)
=>
x
.
mealType
==
1
);
if
(
arr
.
length
)
{
newArr
.
push
(
arr
[
0
]);
}
else
{
newArr
.
push
(
nullObj
);
}
// 午餐 mealType = 2
let
arr1
=
array_
.
filter
(
x
=>
x
.
mealType
==
2
)
if
(
arr1
.
length
){
newArr
.
push
(
arr1
[
0
])
let
arr1
=
array_
.
filter
((
x
)
=>
x
.
mealType
==
2
);
if
(
arr1
.
length
)
{
newArr
.
push
(
arr1
[
0
]);
}
else
{
newArr
.
push
(
nullObj
);
}
// 晚餐 mealType = 3
let
arr2
=
array_
.
filter
(
x
=>
x
.
mealType
==
3
)
if
(
arr2
.
length
){
newArr
.
push
(
arr2
[
0
])
let
arr2
=
array_
.
filter
((
x
)
=>
x
.
mealType
==
3
);
if
(
arr2
.
length
)
{
newArr
.
push
(
arr2
[
0
]);
}
else
{
newArr
.
push
(
nullObj
);
}
// 其他 mealType = 4 夜宵 mealType = 5 夜夜宵
let
arr3
=
array_
.
filter
(
x
=>
x
.
mealType
==
4
)
let
arr4
=
array_
.
filter
(
x
=>
x
.
mealType
==
5
)
if
(
arr3
.
length
){
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
arr3
[
0
]));
if
(
arr4
.
length
){
obj
.
mealTypeTotalAmount
=
obj
.
mealTypeTotalAmount
+
arr
[
4
].
mealTypeTotalAmount
;
obj
.
gradeMealTypeTotalAmount
=
obj
.
gradeMealTypeTotalAmount
+
arr
[
4
].
gradeMealTypeTotalAmount
;
obj
.
schoolMealTypeTotalAmount
=
obj
.
schoolMealTypeTotalAmount
+
arr
[
4
].
schoolMealTypeTotalAmount
;
}
newArr
.
push
(
obj
)
}
else
if
(
arr4
.
length
){
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
arr4
[
0
]));
if
(
arr3
.
length
){
obj
.
mealTypeTotalAmount
=
obj
.
mealTypeTotalAmount
+
arr
[
3
].
mealTypeTotalAmount
;
obj
.
gradeMealTypeTotalAmount
=
obj
.
gradeMealTypeTotalAmount
+
arr
[
3
].
gradeMealTypeTotalAmount
;
obj
.
schoolMealTypeTotalAmount
=
obj
.
schoolMealTypeTotalAmount
+
arr
[
3
].
schoolMealTypeTotalAmount
;
}
newArr
.
push
(
obj
)
let
arr3
=
array_
.
filter
((
x
)
=>
x
.
mealType
==
4
);
let
arr4
=
array_
.
filter
((
x
)
=>
x
.
mealType
==
5
);
if
(
arr3
.
length
)
{
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
arr3
[
0
]));
if
(
arr4
.
length
)
{
obj
.
mealTypeTotalAmount
=
obj
.
mealTypeTotalAmount
+
arr
[
4
].
mealTypeTotalAmount
;
obj
.
gradeMealTypeTotalAmount
=
obj
.
gradeMealTypeTotalAmount
+
arr
[
4
].
gradeMealTypeTotalAmount
;
obj
.
schoolMealTypeTotalAmount
=
obj
.
schoolMealTypeTotalAmount
+
arr
[
4
].
schoolMealTypeTotalAmount
;
}
newArr
.
push
(
obj
);
}
else
if
(
arr4
.
length
)
{
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
arr4
[
0
]));
if
(
arr3
.
length
)
{
obj
.
mealTypeTotalAmount
=
obj
.
mealTypeTotalAmount
+
arr
[
3
].
mealTypeTotalAmount
;
obj
.
gradeMealTypeTotalAmount
=
obj
.
gradeMealTypeTotalAmount
+
arr
[
3
].
gradeMealTypeTotalAmount
;
obj
.
schoolMealTypeTotalAmount
=
obj
.
schoolMealTypeTotalAmount
+
arr
[
3
].
schoolMealTypeTotalAmount
;
}
newArr
.
push
(
obj
);
}
this
.
consumerAmountObj
.
campusMealTypeConsumerSummaryList
=
newArr
;
console
.
log
(
newArr
,
'
bbbbbbbbbbbbbbbbbb
'
)
console
.
log
(
this
.
consumerAmountObj
.
campusMealTypeConsumerSummaryList
,
'
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
'
)
}
else
{
this
.
consumerAmountObj
.
campusMealTypeConsumerSummaryList
=
[]
}
return
this
.
consumerAmountObj
.
sort
(
this
.
livingCostType
);
const
sortArr
=
this
.
numsort
(
{
name
:
"
schoolAverageHeight
"
,
num
:
this
.
consumerAmountObj
[
2
].
livingCostAmount
,
},
{
name
:
"
gradeAverageHeight
"
,
num
:
this
.
consumerAmountObj
[
1
].
livingCostAmount
,
},
{
name
:
"
userConsumeHeight
"
,
num
:
this
.
consumerAmountObj
[
0
].
livingCostAmount
,
if
(
arr3
.
length
==
0
&&
arr4
.
length
==
0
)
{
newArr
.
push
(
nullObj
);
}
);
const
tempArr
=
[
this
.
consumerAmountObj
[
2
].
livingCostAmount
,
this
.
consumerAmountObj
[
1
].
livingCostAmount
,
this
.
consumerAmountObj
[
0
].
livingCostAmount
,
];
const
heightArr
=
Object
.
keys
(
this
.
counterArray
(
tempArr
)).
length
==
1
?
[
139
,
139
,
139
]
:
Object
.
keys
(
this
.
counterArray
(
tempArr
)).
length
==
2
?
[
139
,
139
,
160
]
:
[
139
,
160
,
192
];
sortArr
.
forEach
((
e
)
=>
{
this
[
e
.
name
]
=
heightArr
[
e
.
tag
];
});
if
(
this
.
consumerAmountObj
[
0
])
{
this
.
livingExpensesAllowance
.
userConsumeAmount
=
this
.
consumerAmountObj
[
0
].
livingCostAmount
;
//本月
this
.
livingExpensesAllowance
.
lastMonthRate
=
this
.
consumerAmountObj
[
0
].
rate
;
this
.
livingExpensesAllowance
.
lastMonthRateStr
=
this
.
consumerAmountObj
[
0
].
rate
>
0
?
this
.
consumerAmountObj
[
0
].
rate
+
"
%
"
:
this
.
consumerAmountObj
[
0
].
rate
<
0
?
this
.
consumerAmountObj
[
0
].
rate
.
toString
().
slice
(
1
)
+
"
%
"
:
0
+
"
%
"
;
}
if
(
this
.
consumerAmountObj
[
1
])
{
this
.
livingExpensesAllowance
.
gradeAverageAmount
=
this
.
consumerAmountObj
[
1
].
livingCostAmount
;
//上月
}
if
(
this
.
consumerAmountObj
[
2
])
{
this
.
livingExpensesAllowance
.
schoolAverageAmount
=
this
.
consumerAmountObj
[
2
].
livingCostAmount
;
//上上月
}
this
.
consumerAmountObj
.
campusMealTypeConsumerSummaryList
=
newArr
;
console
.
log
(
this
.
consumerAmountObj
.
campusMealTypeConsumerSummaryList
)
// } else {
// this.consumerAmountObj.campusMealTypeConsumerSummaryList = [];
// }
// return;
// this.consumerAmountObj.sort(this.livingCostType);
// const sortArr = this.numsort(
// {
// name: "schoolAverageHeight",
// num: this.consumerAmountObj[2].livingCostAmount,
// },
// {
// name: "gradeAverageHeight",
// num: this.consumerAmountObj[1].livingCostAmount,
// },
// {
// name: "userConsumeHeight",
// num: this.consumerAmountObj[0].livingCostAmount,
// }
// );
// const tempArr = [
// this.consumerAmountObj[2].livingCostAmount,
// this.consumerAmountObj[1].livingCostAmount,
// this.consumerAmountObj[0].livingCostAmount,
// ];
// const heightArr =
// Object.keys(this.counterArray(tempArr)).length == 1
// ? [139, 139, 139]
// : Object.keys(this.counterArray(tempArr)).length == 2
// ? [139, 139, 160]
// : [139, 160, 192];
// sortArr.forEach((e) => {
// this[e.name] = heightArr[e.tag];
// });
// if (this.consumerAmountObj[0]) {
// this.livingExpensesAllowance.userConsumeAmount =
// this.consumerAmountObj[0].livingCostAmount; //本月
// this.livingExpensesAllowance.lastMonthRate =
// this.consumerAmountObj[0].rate;
// this.livingExpensesAllowance.lastMonthRateStr =
// this.consumerAmountObj[0].rate > 0
// ? this.consumerAmountObj[0].rate + "%"
// : this.consumerAmountObj[0].rate
<
0
// ? this.consumerAmountObj[0].rate.toString().slice(1) + "%"
// : 0 + "%";
// }
// if (this.consumerAmountObj[1]) {
// this.livingExpensesAllowance.gradeAverageAmount =
// this.consumerAmountObj[1].livingCostAmount; //上月
// }
// if (this.consumerAmountObj[2]) {
// this.livingExpensesAllowance.schoolAverageAmount =
// this.consumerAmountObj[2].livingCostAmount; //上上月
// }
}
}
catch
(
e
)
{
//TODO handle the exception
...
...
@@ -3708,20 +3827,60 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// 日消费趋势
async
queryDayConsumerTrend
(
num
)
{
try
{
let
data
=
await
this
.
$http
.
get
(
{
url
:
gHost
+
"
/report-push/campus-consumer-report/queryDayConsumerTrend
"
,
},
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
}
);
// let url = gHost +
// "/report-push/campus-consumer-report/queryDayConsumerTrend";
// if(this.from == 'alipay'){
// url = az_gHost + "/bill/campusConsumerReport/queryDayConsumerTrend"
// }
let
params
=
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
userId
:
getQueryParams
(
"
userId
"
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
reportTypeIndex
==
0
?
2
:
1
,
statisticalMonth
:
moment
(
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/queryDayConsumerTrend
"
,
},
params
);
}
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/queryDayConsumerTrend`
,
},
params
);
}
// let data = await this.$http.get(
// {
// url:
// url,
// },
// {
// schoolId: getQueryParams("schoolId"),
// userId: getQueryParams("userId"),
// startDate: this.dataRangeArr[this.dataRangeIndex].startDate,
// endDate: this.dataRangeArr[this.dataRangeIndex].endDate,
// timeType: this.reportTypeIndex == 0 ? 2 : 1,
// statisticalMonth: moment(
// this.dataRangeArr[this.dataRangeIndex].startDate
// ).format("YYYYMM"),
// userType: this.usertype,
// }
// );
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
icon
:
"
none
"
,
...
...
@@ -4063,7 +4222,13 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
case
2002
:
this
.
isPubTalkOpen
=
(
data
.
obj
&&
data
.
obj
.
status
)
||
false
;
if
(
this
.
isPubTalkOpen
)
{
this
.
queryMemberValidTime
(
serviceItemCode
);
if
(
this
.
from
==
"
alipay
"
)
{
// 支付宝消费会员到期日
this
.
QueryProductContractItemDetailResp
();
}
else
{
// 微信消费会员到期日
this
.
queryMemberValidTime
(
serviceItemCode
);
}
this
.
containerHeight
=
2765
+
this
.
pubTalkSummaryHeight
;
this
.
flag
=
0
;
}
else
{
...
...
@@ -4076,7 +4241,13 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
case
3002
:
this
.
isAttendanceOpen
=
(
data
.
obj
&&
data
.
obj
.
status
)
||
false
;
if
(
this
.
isAttendanceOpen
)
{
this
.
queryMemberValidTime
(
serviceItemCode
);
if
(
this
.
from
==
"
alipay
"
)
{
// 支付宝消费会员到期日
this
.
QueryProductContractItemDetailResp
();
}
else
{
// 微信消费会员到期日
this
.
queryMemberValidTime
(
serviceItemCode
);
}
this
.
containerHeight
=
2762
;
this
.
flag
=
0
;
}
else
{
...
...
@@ -4088,14 +4259,20 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
if
(
num
==
1
)
{
// if (this.isOpen) {
if
(
true
)
{
this
.
queryMemberValidTime
(
serviceItemCode
);
this
.
containerHeight
=
4200
;
this
.
flag
=
0
;
//
if (true) {
if
(
this
.
from
==
"
alipay
"
)
{
// 支付宝消费会员到期日
this
.
QueryProductContractItemDetailResp
()
;
}
else
{
this
.
queryMemberConsumerAmount
(
serviceItemCode
);
this
.
containerHeight
=
2207
;
// 微信消费会员到期日
this
.
queryMemberValidTime
(
serviceItemCode
)
;
}
this
.
containerHeight
=
4200
;
this
.
flag
=
0
;
// } else {
// this.queryMemberConsumerAmount(serviceItemCode);
// this.containerHeight = 2207;
// }
}
}
catch
(
e
)
{
//TODO handle the exception
...
...
@@ -4175,12 +4352,36 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
});
}
},
// 查询消费会员权益项
async
QueryProductContractItemDetailResp
(
serviceItemCode
=
"
1002
"
)
{
const
data
=
await
requestPost
(
"
/cgi-xpay/app/h5/QueryProductContractItemDetail
"
,
{
accountId
:
this
.
homeDataInfo
[
"
accountId
"
],
serviceItemCode
,
}
);
if
(
data
[
"
code
"
]
!=
200
)
{
await
Dialog
({
title
:
"
温馨提示
"
,
message
:
data
[
"
message
"
],
confirmButtonText
:
"
知道了
"
,
});
return
;
}
this
.
memberInfo
.
invalidDateStr
=
data
.
data
.
expiredDt
?
moment
(
data
.
data
.
expiredDt
).
format
(
"
YYYY年MM月DD日
"
)
:
""
;
this
.
memberInfo
.
differDay
=
data
.
data
.
daysRemaining
||
0
;
this
.
memberInfo
.
invalidDate
=
data
.
data
.
expiredDt
;
},
// 查询会员有效期
async
queryMemberValidTime
(
serviceItemCode
)
{
try
{
let
url
=
gHost
+
"
/report-push/member-info/queryMemberValidTime
"
;
let
data
=
await
this
.
$http
.
get
(
{
url
:
gHost
+
"
/report-push/member-info/queryMemberValidTime
"
,
url
:
url
,
},
{
schoolId
:
getQueryParams
(
"
schoolId
"
),
...
...
@@ -4695,7 +4896,8 @@ uni-page-wrapper {
width
:
100%
;
.school-report-context-card-one-context-item
{
display
:
flex
;
display
:
inline-flex
;
line-height
:
40rpx
;
.school-report-context-card-one-context-dot
{
margin-left
:
27rpx
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment