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
8ab7d0e6
Commit
8ab7d0e6
authored
Jun 07, 2022
by
aifen@azjy1.onexmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生活费额度提交更新
parent
076f9730
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
124 additions
and
83 deletions
+124
-83
src/pages/SchoolReport/SchoolReport.vue
src/pages/SchoolReport/SchoolReport.vue
+124
-83
No files found.
src/pages/SchoolReport/SchoolReport.vue
View file @
8ab7d0e6
...
...
@@ -103,8 +103,8 @@
</view>
</view>
<view
class=
"school-report-context-card-one-context-txt"
>
消费
<text
class=
"txt-important"
>
{{
consumerAmountObj
.
consumer
Amount
}}
</text>
元,超过全校
<text
class=
"txt-important"
>
{{
consumerAmountObj
.
exceedR
ate
}}
%
</text>
消费
<text
class=
"txt-important"
>
{{
consumerAmountObj
.
consumer
rental
}}
</text>
元,超过全校
<text
class=
"txt-important"
>
{{
consumerAmountObj
.
gtgrader
ate
}}
%
</text>
的同学
<text
v-if=
"isReasonable"
>
,请及时评估生活费是否合理
</text>
</view>
</view>
...
...
@@ -285,15 +285,15 @@
<view
class=
"school-report-context-card-four-conclusion"
>
<view
class=
"school-report-context-card-four-conclusion-item"
>
<text>
消费
<text
class=
"consume-total"
>
{{
consumerAmountObj
.
consumer
Amount
}}
</text>
元,超过全校
<text
class=
"consume-total"
>
{{
consumerAmountObj
.
exceedR
ate
}}
%
</text>
的同学
<text
class=
"consume-total"
>
{{
consumerAmountObj
.
consumer
rental
}}
</text>
元,超过同年级
<text
class=
"consume-total"
>
{{
consumerAmountObj
.
gtgrader
ate
}}
%
</text>
的同学
<text
v-if=
"isReasonable"
>
,请及时评估生活费是否合理
</text></text>
</view>
</view>
<view
class=
"consume-total-img"
>
<view
class=
"school-average"
:style=
"
{height:schoolAverageHeight+'rpx'}">
<view
class=
"school-average-num"
>
<text>
{{
consumerAmountObj
.
school
A
mount
}}
</text>
<text>
{{
consumerAmountObj
.
school
avga
mount
}}
</text>
</view>
<view
class=
"school-average-img"
>
<image
src=
"../../static/images/greenArrow.png"
mode=
""
></image>
...
...
@@ -301,20 +301,31 @@
</view>
<view
class=
"user-consume"
:style=
"
{height:userConsumeHeight+'rpx'}">
<view
class=
"user-consume-num"
>
<text>
{{
consumerAmountObj
.
consumer
Amount
}}
</text>
<text>
{{
consumerAmountObj
.
consumer
rental
}}
</text>
</view>
<view
class=
"user-consume-img"
>
<image
src=
"../../static/images/yellowArrow.png"
mode=
""
></image>
</view>
</view>
<view
class=
"school-average"
:style=
"
{height:gradeAverageHeight+'rpx'}">
<view
class=
"school-average-num"
>
<text>
{{
consumerAmountObj
.
gradeavgamount
}}
</text>
</view>
<view
class=
"school-average-img"
>
<image
src=
"../../static/images/greenArrow.png"
mode=
""
></image>
</view>
</view>
</view>
<view
class=
"consume-total-img-des"
>
<view
class=
"consume-total-img-des-item
school-average-des
"
>
<view
class=
"consume-total-img-des-item"
>
<text>
全校平均
</text>
</view>
<view
class=
"consume-total-img-des-item"
>
<view
class=
"consume-total-img-des-item
consume-des
"
>
<text>
本人消费
</text>
</view>
<view
class=
"consume-total-img-des-item"
>
<text>
全年级平均
</text>
</view>
</view>
</view>
<view
v-if=
"tabIndex==1&&isOpen"
class=
"school-report-context-card-five"
>
...
...
@@ -785,6 +796,7 @@
isReasonable
:
false
,
schoolAverageHeight
:
''
,
userConsumeHeight
:
''
,
gradeAverageHeight
:
''
,
// 消费趋势
consumerTrend
:
{},
isAbnormal
:
false
,
...
...
@@ -832,10 +844,10 @@
}
},
mounted
()
{
if
(
this
.
isPeakPeriod
())
{
this
.
showReport
=
false
;
return
}
//
if (this.isPeakPeriod()) {
//
this.showReport = false;
//
return
//
}
this
.
showReport
=
true
;
// 有无消费报告入口
if
(
new
Date
().
getTime
()
<=
new
Date
(
'
2022/06/30
'
).
getTime
())
{
...
...
@@ -865,11 +877,11 @@
this
.
memberInfo
.
invalidDateStr
=
'
2022年6月30日
'
;
this
.
memberInfo
.
differDay
=
dayjs
(
'
2022/06/30
'
).
diff
(
dayjs
(),
'
day
'
);
this
.
containerHeight
=
4200
;
this
.
query
StudentConsumerPreference
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
query
ConsumerSummaryAmount
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
}
else
{
this
.
queryIsDredgeMember
(
1002
,
1
).
then
(()
=>
{
this
.
query
StudentConsumerPreference
(
1
).
then
(
e
=>
this
this
.
query
ConsumerSummaryAmount
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
...
...
@@ -883,11 +895,11 @@
this
.
memberInfo
.
invalidDateStr
=
'
2022年6月30日
'
;
this
.
memberInfo
.
differDay
=
dayjs
(
'
2022/06/30
'
).
diff
(
dayjs
(),
'
day
'
);
this
.
containerHeight
=
4200
;
this
.
query
StudentConsumerPreference
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
query
ConsumerSummaryAmount
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
}
else
{
this
.
queryIsDredgeMember
(
1002
,
1
).
then
(()
=>
{
this
.
query
StudentConsumerPreference
();
this
.
query
ConsumerSummaryAmount
();
this
.
queryDayConsumerTrend
();
});
}
...
...
@@ -924,7 +936,6 @@
this
.
diningSituations
.
notRepastDetails
=
{};
}
});
this
.
queryConsumerTrend
();
},
methods
:
{
// 当天6:30 ~ 9:00,11:30 ~ 12:00, 17:30 ~ 19:00属于高峰期
...
...
@@ -969,14 +980,14 @@
this
.
diningSituations
.
notRepastDetails
=
{};
}
});
this
.
queryConsumer
Trend
();
this
.
queryConsumer
SummaryAmount
();
this
.
$nextTick
(()
=>
{
if
(
this
.
isOpen
)
{
this
.
query
StudentConsumerPreference
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
query
ConsumerSummaryAmount
(
1
).
then
(
e
=>
this
.
piechart
());
this
.
queryDayConsumerTrend
(
1
).
then
(
e
=>
this
.
linechart
(
this
.
reportTypeIndex
));
}
else
{
this
.
query
StudentConsumerPreference
();
this
.
query
ConsumerSummaryAmount
();
this
.
queryDayConsumerTrend
();
}
})
...
...
@@ -1640,7 +1651,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
schoolId
:
getQueryParams
(
'
schoolId
'
),
userId
:
getQueryParams
(
'
userId
'
),
startDate
,
endDate
endDate
,
timeType
:
this
.
dataRangeIndex
==
0
?
2
:
1
})
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
...
...
@@ -1676,17 +1688,61 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
})
}
},
// 查询学生消费偏好类型
async
queryStudentConsumerPreference
(
num
)
{
// 三数排序
numsort
(
obj1
,
obj2
,
obj3
)
{
obj1
.
num
<
obj2
.
num
&&
(
obj1
.
num
=
obj1
.
num
^
obj2
.
num
,
obj2
.
num
=
obj2
.
num
^
obj1
.
num
,
obj1
.
num
=
obj1
.
num
^
obj2
.
num
);
obj2
.
num
<
obj3
.
num
&&
(
obj2
.
num
=
obj2
.
num
^
obj3
.
num
,
obj3
.
num
=
obj3
.
num
^
obj2
.
num
,
obj2
.
num
=
obj2
.
num
^
obj3
.
num
);
obj1
.
num
<
obj2
.
num
&&
(
obj1
.
num
=
obj1
.
num
^
obj2
.
num
,
obj2
.
num
=
obj2
.
num
^
obj1
.
num
,
obj1
.
num
=
obj1
.
num
^
obj2
.
num
);
return
[{
name
:
obj1
.
name
,
value
:
obj1
.
num
,
tag
:
0
},
{
name
:
obj2
.
name
,
value
:
obj2
.
num
,
tag
:
1
},
{
name
:
obj3
.
name
,
value
:
obj3
.
num
,
tag
:
2
}];
},
// 数组中数据的个数
counterArray
(
arr
)
{
var
obj
=
{}
arr
.
forEach
(
function
(
v
,
k
)
{
if
(
obj
[
v
])
{
obj
[
v
]
++
;
}
else
{
obj
[
v
]
=
1
;
}
})
return
obj
;
},
// 查询消费总额及学生消费偏好类型
async
queryConsumerSummaryAmount
(
num
)
{
try
{
let
data
=
await
this
.
$http
.
get
({
url
:
gHost
+
'
/report-push/campus-consumer-report/query
StudentConsumerPreference
'
'
/report-push/campus-consumer-report/query
ConsumerSummaryAmount
'
},
{
schoolId
:
getQueryParams
(
'
schoolId
'
),
userId
:
getQueryParams
(
'
userId
'
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
dataRangeIndex
==
0
?
2
:
1
})
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
...
...
@@ -1697,63 +1753,47 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
return
}
if
(
!
data
.
obj
)
return
;
const
tmpObj
=
data
.
obj
;
this
.
isEatLow
=
tmpObj
.
canteenAmount
/
tmpObj
.
grossAmount
<
0.5
?
true
:
false
;
if
(
data
.
obj
.
length
)
{
const
tmpObj
=
data
.
obj
[
0
];
this
.
isEatLow
=
tmpObj
.
canteenamount
/
tmpObj
.
consumerrental
<
0.5
?
true
:
false
;
if
(
num
)
{
this
.
pieDatas
=
[
[{
name
:
'
正餐
'
,
value
:
tmpObj
.
canteenA
mount
value
:
tmpObj
.
canteena
mount
},
{
name
:
'
超市
'
,
value
:
tmpObj
.
supermarketA
mount
value
:
tmpObj
.
supermarketa
mount
},
{
name
:
'
其他
'
,
value
:
tmpObj
.
otherA
mount
value
:
tmpObj
.
othera
mount
}]
]
}
}
catch
(
e
)
{
//TODO handle the exception
console
.
log
(
e
);
uni
.
showToast
({
icon
:
"
none
"
,
mask
:
true
,
title
:
e
.
message
})
}
},
// 查询生活费额度
async
queryConsumerTrend
()
{
try
{
let
data
=
await
this
.
$http
.
get
({
url
:
gHost
+
'
/report-push/campus-consumer-report/queryConsumerTrend
'
this
.
consumerAmountObj
=
tmpObj
;
this
.
isReasonable
=
this
.
consumerAmountObj
.
gtgraderate
>=
40
&&
this
.
consumerAmountObj
.
gtgraderate
<=
60
?
false
:
true
;
const
sortArr
=
this
.
numsort
({
name
:
'
schoolAverageHeight
'
,
num
:
this
.
consumerAmountObj
.
schoolavgamount
},
{
schoolId
:
getQueryParams
(
'
schoolId
'
),
userId
:
getQueryParams
(
'
userId
'
),
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
})
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
icon
:
"
none
"
,
mask
:
true
,
title
:
data
.
msg
name
:
'
userConsumeHeight
'
,
num
:
this
.
consumerAmountObj
.
consumerrental
},
{
name
:
'
gradeAverageHeight
'
,
num
:
this
.
consumerAmountObj
.
gradeavgamount
});
const
tempArr
=
[
this
.
consumerAmountObj
.
schoolavgamount
,
this
.
consumerAmountObj
.
consumerrental
,
this
.
consumerAmountObj
.
gradeavgamount
];
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
]
})
return
}
if
(
!
data
.
obj
)
return
;
this
.
consumerAmountObj
=
data
.
obj
;
this
.
isReasonable
=
this
.
consumerAmountObj
.
exceedRate
>=
40
&&
this
.
consumerAmountObj
.
exceedRate
<=
60
?
false
:
true
;
this
.
schoolAverageHeight
=
this
.
consumerAmountObj
.
schoolAmount
<=
this
.
consumerAmountObj
.
consumerAmount
?
139
:
192
;
this
.
userConsumeHeight
=
this
.
consumerAmountObj
.
consumerAmount
<=
this
.
consumerAmountObj
.
schoolAmount
?
139
:
192
;
}
catch
(
e
)
{
//TODO handle the exception
console
.
log
(
e
);
...
...
@@ -1776,6 +1816,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
startDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
]
.
startDate
,
endDate
:
this
.
dataRangeArr
[
this
.
dataRangeIndex
].
endDate
,
timeType
:
this
.
dataRangeIndex
==
0
?
2
:
1
})
if
(
data
.
code
!=
200
)
{
uni
.
showToast
({
...
...
@@ -3223,7 +3264,6 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
width
:
110rpx
;
background
:
linear-gradient
(
360deg
,
#04B871
0%
,
#07D66A
100%
);
border-radius
:
16rpx
16rpx
0
0
;
margin-right
:
74rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
...
...
@@ -3253,6 +3293,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
align-items
:
center
;
padding
:
14rpx
0
0
;
box-sizing
:
border-box
;
margin
:
0
74rpx
0
;
.user-consume-img
{
width
:
52rpx
;
...
...
@@ -3272,7 +3313,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
.consume-total-img-des
{
margin
:
16rpx
0
0
;
display
:
flex
;
justify-content
:
center
;
padding-left
:
100rpx
;
.consume-total-img-des-item
{
height
:
40rpx
;
...
...
@@ -3282,8 +3323,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
color
:
rgba
(
0
,
0
,
0
,
0
.5
);
line-height
:
40rpx
;
&
.
school-averag
e-des
{
margin
-right
:
74rpx
;
&
.
consum
e-des
{
margin
:
0
64rpx
0
74rpx
;
}
}
}
...
...
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