feat(报表模块): 更新增加妇幼生殖vip和退款功能相关
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="calendar" style="min-width: 1000px;overflow-x: auto;min-height: 100%;">
|
<div class="calendar" style="min-width: 1080px;overflow-x: auto;min-height: 100%;">
|
||||||
<div v-if="allMonthData.length>0" @click="handleExportAll()" style="position: absolute; left: 360px;top:30px;cursor: pointer;color: #006699;font-size: 14px;"><i class="el-icon-download"></i>下载 {{selectYear}} 年全部VIP报表</div>
|
<div v-if="allMonthData.length>0" @click="handleExportAll()" style="position: absolute; left: 360px;top:30px;cursor: pointer;color: #006699;font-size: 14px;"><i class="el-icon-download"></i>下载 {{selectYear}} 年全部VIP报表</div>
|
||||||
|
|
||||||
<el-card class="box-card" v-for="(month, mIndex) in allMonthData"
|
<el-card class="box-card" v-for="(month, mIndex) in allMonthData"
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
allMonthData: [],
|
allMonthData: [],
|
||||||
list: [
|
list: [
|
||||||
{title:'收入',val:'fee'} ,
|
{title:'收入',val:'fee'} ,
|
||||||
|
{title:'退款',val:'refundFee'},
|
||||||
{title:'月摊销',val:'currentTanxiao'},
|
{title:'月摊销',val:'currentTanxiao'},
|
||||||
{title:'已摊销',val:'alreadyTanxiao'},
|
{title:'已摊销',val:'alreadyTanxiao'},
|
||||||
{title:'剩余摊销',val:'notyetTanxiao'},
|
{title:'剩余摊销',val:'notyetTanxiao'},
|
||||||
@@ -296,7 +297,7 @@
|
|||||||
.calendar {
|
.calendar {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 20px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
.month {
|
.month {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@@ -311,15 +312,16 @@
|
|||||||
}
|
}
|
||||||
.days {
|
.days {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(4, 1fr);
|
grid-template-columns: repeat(5, minmax(max-content, 1fr));
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
.day {
|
.day {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 4px;
|
padding: 4px 8px;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.day.header {
|
.day.header {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -332,7 +334,7 @@
|
|||||||
padding: 4px 20px !important;
|
padding: 4px 20px !important;
|
||||||
}
|
}
|
||||||
/deep/ .el-card .el-card__body {
|
/deep/ .el-card .el-card__body {
|
||||||
padding: 15px !important;
|
padding: 15px 5px !important;
|
||||||
overflow-x: auto !important;
|
overflow-x: auto !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -34,11 +34,7 @@
|
|||||||
class="days"
|
class="days"
|
||||||
style=""
|
style=""
|
||||||
:style="{
|
:style="{
|
||||||
'grid-template-columns': `repeat(${
|
'grid-template-columns': `repeat(${list.length}, 1fr)`
|
||||||
month.total.length && month.total.length > 2
|
|
||||||
? 2
|
|
||||||
: month.total.length
|
|
||||||
}, 1fr)`
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -184,6 +180,29 @@ export default {
|
|||||||
// {title:'报名VIP',val:'vip'},
|
// {title:'报名VIP',val:'vip'},
|
||||||
{ title: "后台扣费", val: "deduction" }
|
{ title: "后台扣费", val: "deduction" }
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "退款",
|
||||||
|
val: "refund",
|
||||||
|
bg: "#ff00000a",
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
title: "实物商品退款",
|
||||||
|
realTitle: "订单退款实物"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "课程退款",
|
||||||
|
realTitle: "订单退款课程"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "VIP商品退款",
|
||||||
|
realTitle: "订单退款VIP"
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: "培训班退款",
|
||||||
|
// realTitle: "订单退款培训班"
|
||||||
|
// }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
weekDays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
weekDays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
||||||
@@ -212,12 +231,18 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAmount(d, index, month) {
|
getAmount(d, index, month) {
|
||||||
if (!month || !month.total || !Array.isArray(month.total)) {
|
const section = this.list[index];
|
||||||
|
const isRefund = section && section.val === "refund";
|
||||||
|
const dataSource = isRefund
|
||||||
|
? month && month.refundInfo
|
||||||
|
: month && month.total;
|
||||||
|
|
||||||
|
if (!dataSource || !Array.isArray(dataSource)) {
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d.val === "other") {
|
if (d.val === "other") {
|
||||||
const list = month.total.filter(item => {
|
const list = dataSource.filter(item => {
|
||||||
return (
|
return (
|
||||||
item.type === d.realTitle &&
|
item.type === d.realTitle &&
|
||||||
(item.payMethod === "" || item.payMethod === "其他")
|
(item.payMethod === "" || item.payMethod === "其他")
|
||||||
@@ -239,11 +264,12 @@ export default {
|
|||||||
item => item.type === d.realTitle,
|
item => item.type === d.realTitle,
|
||||||
item => `${item.payMethod}${item.type}` === d.realTitle,
|
item => `${item.payMethod}${item.type}` === d.realTitle,
|
||||||
item => `${item.type}${item.payMethod}` === d.realTitle,
|
item => `${item.type}${item.payMethod}` === d.realTitle,
|
||||||
item => `${item.type}${item.goodsType}` === d.realTitle
|
item => `${item.type}${item.goodsType}` === d.realTitle,
|
||||||
|
item => item.goodsType === d.goodsType
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const rule of matchRules) {
|
for (const rule of matchRules) {
|
||||||
const matchedItem = month.total.find(rule);
|
const matchedItem = dataSource.find(rule);
|
||||||
if (matchedItem) {
|
if (matchedItem) {
|
||||||
return matchedItem.amount;
|
return matchedItem.amount;
|
||||||
}
|
}
|
||||||
@@ -407,7 +433,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
month: monthNum,
|
month: monthNum,
|
||||||
total: res.data.total,
|
total: res.data.total,
|
||||||
surplus: res.data.surplus
|
surplus: res.data.surplus,
|
||||||
|
refundInfo: res.data.refundInfo || []
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return { month: monthNum, total: null, error: "获取失败" };
|
return { month: monthNum, total: null, error: "获取失败" };
|
||||||
@@ -428,7 +455,10 @@ export default {
|
|||||||
console.log("所有月份结果:", resArr);
|
console.log("所有月份结果:", resArr);
|
||||||
loading.close();
|
loading.close();
|
||||||
this.allMonthData = resArr.filter(
|
this.allMonthData = resArr.filter(
|
||||||
r => r.total !== null && r.total.length !== 0
|
r =>
|
||||||
|
r.total !== null &&
|
||||||
|
(r.total.length !== 0 ||
|
||||||
|
(r.refundInfo && r.refundInfo.length !== 0))
|
||||||
);
|
);
|
||||||
if (this.allMonthData.length == 0) {
|
if (this.allMonthData.length == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@@ -35,9 +35,7 @@
|
|||||||
style=""
|
style=""
|
||||||
|
|
||||||
:style="{
|
:style="{
|
||||||
'grid-template-columns': `repeat(${
|
'grid-template-columns': `repeat(${list.length}, 1fr)`
|
||||||
2
|
|
||||||
}, 1fr)`
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -57,22 +55,29 @@
|
|||||||
|
|
||||||
<div style="font-weight: 500;color: #888;margin-top:10px;font-size: 15px;padding:0 4px;">
|
<div style="font-weight: 500;color: #888;margin-top:10px;font-size: 15px;padding:0 4px;">
|
||||||
<li v-for="item in d.list" style="text-align: left;margin-top: 10px;">
|
<li v-for="item in d.list" style="text-align: left;margin-top: 10px;">
|
||||||
|
<span style="">
|
||||||
<span style=""> {{item.title}} :<span v-if="item.otherTitle" style="font-size: 12px;color: #808080;"><br/>{{ item.otherTitle}}</span> </span>
|
{{ item.title }} :<span
|
||||||
|
v-if="item.otherTitle"
|
||||||
|
style="font-size: 12px;color: #808080;"
|
||||||
|
><br />{{ item.otherTitle }}</span
|
||||||
|
>
|
||||||
<span style="margin-left: 10px;color: #333;letter-spacing: 0.5px;" v-if="index==0" :style="{
|
|
||||||
color: getAmount(item, index, month) == 0 ? '#888' : '#333'
|
|
||||||
}">
|
|
||||||
{{ getAmount(item,index,month) }}
|
|
||||||
</span>
|
</span>
|
||||||
<span style="margin-left: 10px;color: #333;letter-spacing: 0.5px;" v-if="index==1">
|
<span
|
||||||
|
style="margin-left: 10px;color: #333;letter-spacing: 0.5px;"
|
||||||
|
v-if="index == 0 || index == 2"
|
||||||
|
:style="{
|
||||||
|
color: getAmount(item, index, month) == 0 ? '#888' : '#333'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ getAmount(item, index, month) }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style="margin-left: 10px;color: #333;letter-spacing: 0.5px;"
|
||||||
|
v-if="index == 1"
|
||||||
|
>
|
||||||
{{ month.total[0][item.val] }}
|
{{ month.total[0][item.val] }}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -155,6 +160,16 @@ export default {
|
|||||||
{title:'剩余摊销',val:'surplusTanxiao'},
|
{title:'剩余摊销',val:'surplusTanxiao'},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "退款",
|
||||||
|
val: "refund",
|
||||||
|
bg: "#ff00000a",
|
||||||
|
list: [
|
||||||
|
{ title: "App微信退款", realTitle: "App微信" },
|
||||||
|
{ title: "App支付宝退款", realTitle: "App支付宝" },
|
||||||
|
{ title: "App天医币退款", realTitle: "App天医币" }
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
weekDays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
weekDays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
||||||
monthNames: [
|
monthNames: [
|
||||||
@@ -182,25 +197,28 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAmount(d, index, month) {
|
getAmount(d, index, month) {
|
||||||
|
const section = this.list[index];
|
||||||
// 定义所有可能的匹配规则
|
const isRefund = section && section.val === "refund";
|
||||||
|
const dataSource = isRefund
|
||||||
|
? month && month.refund
|
||||||
|
: month && month.total;
|
||||||
|
|
||||||
|
if (!dataSource || !Array.isArray(dataSource)) {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
const matchRules = [
|
const matchRules = [
|
||||||
|
|
||||||
item => item.pay_type === d.title,
|
item => item.pay_type === d.title,
|
||||||
item => item.pay_type === d.realTitle,
|
item => item.pay_type === d.realTitle
|
||||||
|
|
||||||
// 更复杂的条件组合
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 依次检查每个规则,返回第一个匹配项
|
|
||||||
for (const rule of matchRules) {
|
for (const rule of matchRules) {
|
||||||
const matchedItem = month.total.find(rule);
|
const matchedItem = dataSource.find(rule);
|
||||||
if (matchedItem) {
|
if (matchedItem) {
|
||||||
return matchedItem.fee;
|
return matchedItem.fee;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 没有匹配项时返回空字符串
|
|
||||||
return "0";
|
return "0";
|
||||||
},
|
},
|
||||||
async handleExportAll() {
|
async handleExportAll() {
|
||||||
@@ -354,7 +372,11 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.data && res.data.code === 0) {
|
if (res.data && res.data.code === 0) {
|
||||||
return { month: monthNum, total: [res.data.tanxiaoTotal[0],...res.data.income]};
|
return {
|
||||||
|
month: monthNum,
|
||||||
|
total: [res.data.tanxiaoTotal[0], ...res.data.income],
|
||||||
|
refund: res.data.refund || []
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
return { month: monthNum, total: null, error: "获取失败" };
|
return { month: monthNum, total: null, error: "获取失败" };
|
||||||
}
|
}
|
||||||
@@ -374,7 +396,10 @@ export default {
|
|||||||
console.log("所有月份结果:", resArr);
|
console.log("所有月份结果:", resArr);
|
||||||
loading.close();
|
loading.close();
|
||||||
this.allMonthData = resArr.filter(
|
this.allMonthData = resArr.filter(
|
||||||
r => r.total !== null && r.total.length !== 0
|
r =>
|
||||||
|
r.total !== null &&
|
||||||
|
(r.total.length !== 0 ||
|
||||||
|
(r.refund && r.refund.length !== 0))
|
||||||
);
|
);
|
||||||
if (this.allMonthData.length == 0) {
|
if (this.allMonthData.length == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@@ -63,24 +63,15 @@
|
|||||||
}`
|
}`
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span style="font-size: 16px;color:#888;"
|
<span style="font-size: 16px;color:#888;">
|
||||||
>共计:{{
|
共计:{{ getPayTypeStat(allMonthData[mIndex].total, d.title, 'count') }}笔
|
||||||
allMonthData[mIndex].total.filter(
|
</span>
|
||||||
item => item.payType == d.title
|
|
||||||
)[0] ? allMonthData[mIndex].total.filter(
|
|
||||||
item => item.payType == d.title
|
|
||||||
)[0].count : 0
|
|
||||||
}}笔</span
|
|
||||||
>
|
|
||||||
|
|
||||||
<span style="display: block;margin-top: 10px;font-weight: bold;"
|
<span style="display: block;margin-top: 10px;font-weight: bold;"
|
||||||
>{{
|
>{{ getPayTypeStat(allMonthData[mIndex].total, d.title, 'totalPrice') }}
|
||||||
allMonthData[mIndex].total.filter(
|
</span>
|
||||||
item => item.payType == d.title
|
<span style="display: block;font-weight: bold; color: red; font-size: 14px;"
|
||||||
)[0] ? allMonthData[mIndex].total.filter(
|
>退款:{{ getPayTypeStat(allMonthData[mIndex].total, d.title, 'refundTotalPrice') }}
|
||||||
item => item.payType == d.title
|
|
||||||
)[0].totalPrice : 0
|
|
||||||
}}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -285,6 +276,16 @@ export default {
|
|||||||
pad(num) {
|
pad(num) {
|
||||||
return num < 10 ? "0" + num : num;
|
return num < 10 ? "0" + num : num;
|
||||||
},
|
},
|
||||||
|
hasMonthTotal(total) {
|
||||||
|
return Array.isArray(total) && total.some(item => item != null);
|
||||||
|
},
|
||||||
|
getPayTypeStat(total, payType, field) {
|
||||||
|
if (!Array.isArray(total)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const item = total.find(entry => entry && entry.payType == payType);
|
||||||
|
return item && item[field] != null ? item[field] : 0;
|
||||||
|
},
|
||||||
fetchAllMonthData() {
|
fetchAllMonthData() {
|
||||||
const loading = this.$loading({
|
const loading = this.$loading({
|
||||||
lock: true,
|
lock: true,
|
||||||
@@ -324,9 +325,7 @@ export default {
|
|||||||
.then(resArr => {
|
.then(resArr => {
|
||||||
console.log("所有月份结果:", resArr);
|
console.log("所有月份结果:", resArr);
|
||||||
loading.close();
|
loading.close();
|
||||||
this.allMonthData = resArr.filter(
|
this.allMonthData = resArr.filter(r => this.hasMonthTotal(r.total));
|
||||||
r => r.total !== null && r.total.length !== 0
|
|
||||||
);
|
|
||||||
console.log("this.allMonthData at line 295:", this.allMonthData);
|
console.log("this.allMonthData at line 295:", this.allMonthData);
|
||||||
if(this.allMonthData.length==0){
|
if(this.allMonthData.length==0){
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="vipType" label="VIP类型" min-width="160">
|
<el-table-column prop="vipType" label="VIP类型" min-width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ formatText(scope.row.vipType) }}
|
{{ formatVipType(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="year" label="年限" min-width="100">
|
<el-table-column prop="year" label="年限" min-width="100">
|
||||||
@@ -90,6 +90,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import http from '@/utils/httpRequest'
|
import http from '@/utils/httpRequest'
|
||||||
|
import { formatVipType } from './vipStatisticsHelper'
|
||||||
|
|
||||||
function createEmptySummary() {
|
function createEmptySummary() {
|
||||||
return {
|
return {
|
||||||
@@ -99,6 +100,8 @@ function createEmptySummary() {
|
|||||||
zxhtCount: 0,
|
zxhtCount: 0,
|
||||||
zlCount: 0,
|
zlCount: 0,
|
||||||
xlCount: 0,
|
xlCount: 0,
|
||||||
|
fyszCount: 0,
|
||||||
|
gxCount: 0,
|
||||||
yxSuperCount: 0,
|
yxSuperCount: 0,
|
||||||
gxSuperCount: 0
|
gxSuperCount: 0
|
||||||
}
|
}
|
||||||
@@ -153,9 +156,11 @@ export default {
|
|||||||
return [
|
return [
|
||||||
{ key: 'total', label: '总人数', value: summary.total },
|
{ key: 'total', label: '总人数', value: summary.total },
|
||||||
{ key: 'zyCount', label: '中医学', value: summary.zyCount },
|
{ key: 'zyCount', label: '中医学', value: summary.zyCount },
|
||||||
{ key: 'zjCount', label: '针灸学', value: summary.zjCount },
|
|
||||||
{ key: 'zxhtCount', label: '中西汇通学', value: summary.zxhtCount },
|
{ key: 'zxhtCount', label: '中西汇通学', value: summary.zxhtCount },
|
||||||
|
{ key: 'zjCount', label: '针灸学', value: summary.zjCount },
|
||||||
{ key: 'zlCount', label: '肿瘤学', value: summary.zlCount },
|
{ key: 'zlCount', label: '肿瘤学', value: summary.zlCount },
|
||||||
|
{ key: 'fyszCount', label: '妇幼生殖', value: summary.fyszCount },
|
||||||
|
{ key: 'gxCount', label: '国学', value: summary.gxCount },
|
||||||
{ key: 'xlCount', label: '心理学', value: summary.xlCount },
|
{ key: 'xlCount', label: '心理学', value: summary.xlCount },
|
||||||
{ key: 'yxSuperCount', label: '医学超级', value: summary.yxSuperCount },
|
{ key: 'yxSuperCount', label: '医学超级', value: summary.yxSuperCount },
|
||||||
{ key: 'gxSuperCount', label: '国学心理学超级', value: summary.gxSuperCount }
|
{ key: 'gxSuperCount', label: '国学心理学超级', value: summary.gxSuperCount }
|
||||||
@@ -169,6 +174,8 @@ export default {
|
|||||||
zxhtCount: counts.zxhtCount || 0,
|
zxhtCount: counts.zxhtCount || 0,
|
||||||
zlCount: counts.zlCount || counts.zlcount || 0,
|
zlCount: counts.zlCount || counts.zlcount || 0,
|
||||||
xlCount: counts.xlCount || 0,
|
xlCount: counts.xlCount || 0,
|
||||||
|
fyszCount: counts.fyszCount || 0,
|
||||||
|
gxCount: counts.gxCount || 0,
|
||||||
yxSuperCount: counts.yxSuperCount || 0,
|
yxSuperCount: counts.yxSuperCount || 0,
|
||||||
gxSuperCount: counts.gxSuperCount || 0
|
gxSuperCount: counts.gxSuperCount || 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="tel" label="注册电话" min-width="140" />
|
<el-table-column prop="tel" label="注册电话" min-width="140" />
|
||||||
<el-table-column prop="vipType" label="VIP类型" min-width="160" />
|
<el-table-column prop="vipType" label="VIP类型" min-width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ formatVipType(scope.row) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="year" label="年限" min-width="100">
|
<el-table-column prop="year" label="年限" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ formatYear(scope.row.year) }}
|
{{ formatYear(scope.row.year) }}
|
||||||
@@ -62,6 +66,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import http from '@/utils/httpRequest'
|
import http from '@/utils/httpRequest'
|
||||||
|
import { formatVipType } from './vipStatisticsHelper'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -87,6 +92,8 @@ export default {
|
|||||||
zxhtCount: 0,
|
zxhtCount: 0,
|
||||||
zlcount: 0,
|
zlcount: 0,
|
||||||
xlCount: 0,
|
xlCount: 0,
|
||||||
|
fyszCount: 0,
|
||||||
|
gxCount: 0,
|
||||||
yxSuperCount: 0,
|
yxSuperCount: 0,
|
||||||
gxSuperCount: 0
|
gxSuperCount: 0
|
||||||
}
|
}
|
||||||
@@ -100,9 +107,11 @@ export default {
|
|||||||
return [
|
return [
|
||||||
{ key: 'total', label: '总人数', value: this.summaryData.total },
|
{ key: 'total', label: '总人数', value: this.summaryData.total },
|
||||||
{ key: 'zyCount', label: '中医学', value: this.summaryData.zyCount },
|
{ key: 'zyCount', label: '中医学', value: this.summaryData.zyCount },
|
||||||
{ key: 'zjcount', label: '针灸学', value: this.summaryData.zjcount },
|
|
||||||
{ key: 'zxhtCount', label: '中西汇通学', value: this.summaryData.zxhtCount },
|
{ key: 'zxhtCount', label: '中西汇通学', value: this.summaryData.zxhtCount },
|
||||||
|
{ key: 'zjcount', label: '针灸学', value: this.summaryData.zjcount },
|
||||||
{ key: 'zlcount', label: '肿瘤学', value: this.summaryData.zlcount },
|
{ key: 'zlcount', label: '肿瘤学', value: this.summaryData.zlcount },
|
||||||
|
{ key: 'fyszCount', label: '妇幼生殖', value: this.summaryData.fyszCount },
|
||||||
|
{ key: 'gxCount', label: '国学', value: this.summaryData.gxCount },
|
||||||
{ key: 'xlCount', label: '心理学', value: this.summaryData.xlCount },
|
{ key: 'xlCount', label: '心理学', value: this.summaryData.xlCount },
|
||||||
{ key: 'yxSuperCount', label: '医学超级', value: this.summaryData.yxSuperCount },
|
{ key: 'yxSuperCount', label: '医学超级', value: this.summaryData.yxSuperCount },
|
||||||
{ key: 'gxSuperCount', label: '国学心理学超级', value: this.summaryData.gxSuperCount }
|
{ key: 'gxSuperCount', label: '国学心理学超级', value: this.summaryData.gxSuperCount }
|
||||||
@@ -157,6 +166,8 @@ export default {
|
|||||||
zxhtCount: countData.zxhtCount || 0,
|
zxhtCount: countData.zxhtCount || 0,
|
||||||
zlcount: countData.zlCount || countData.zlcount || 0,
|
zlcount: countData.zlCount || countData.zlcount || 0,
|
||||||
xlCount: countData.xlCount || 0,
|
xlCount: countData.xlCount || 0,
|
||||||
|
fyszCount: countData.fyszCount || 0,
|
||||||
|
gxCount: countData.gxCount || 0,
|
||||||
yxSuperCount: countData.yxSuperCount || 0,
|
yxSuperCount: countData.yxSuperCount || 0,
|
||||||
gxSuperCount: countData.gxSuperCount || 0
|
gxSuperCount: countData.gxSuperCount || 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { formatVipType } from './vipStatisticsHelper'
|
||||||
|
|
||||||
function toNumber(value) {
|
function toNumber(value) {
|
||||||
const num = Number(value)
|
const num = Number(value)
|
||||||
return Number.isNaN(num) ? 0 : num
|
return Number.isNaN(num) ? 0 : num
|
||||||
@@ -129,7 +131,7 @@ function buildTableRows(list) {
|
|||||||
time: formatText(item.payTime),
|
time: formatText(item.payTime),
|
||||||
name: formatText(item.name),
|
name: formatText(item.name),
|
||||||
tel: formatText(item.tel),
|
tel: formatText(item.tel),
|
||||||
vipType: formatText(item.vipType),
|
vipType: formatVipType(item),
|
||||||
isYan: formatText(item.isYan),
|
isYan: formatText(item.isYan),
|
||||||
currentYear: formatYear(item.year),
|
currentYear: formatYear(item.year),
|
||||||
currentAmount: getAmount(item.price),
|
currentAmount: getAmount(item.price),
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
const VIP_TYPE_MAP = {
|
||||||
|
4: '中医学',
|
||||||
|
5: '针灸学',
|
||||||
|
6: '肿瘤学',
|
||||||
|
9: '中西汇通学',
|
||||||
|
10: '妇幼生殖',
|
||||||
|
7: '国学',
|
||||||
|
8: '心理学'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatVipType(row = {}) {
|
||||||
|
const vipType = row.vipType
|
||||||
|
if (vipType !== '' && vipType !== null && vipType !== undefined) {
|
||||||
|
const text = String(vipType).trim()
|
||||||
|
if (text) {
|
||||||
|
return text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const type = row.type
|
||||||
|
if (type !== '' && type !== null && type !== undefined && VIP_TYPE_MAP[type]) {
|
||||||
|
return VIP_TYPE_MAP[type]
|
||||||
|
}
|
||||||
|
|
||||||
|
return '--'
|
||||||
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
const TYPE_ORDER = [
|
const TYPE_ORDER = [
|
||||||
'中医学',
|
'中医学',
|
||||||
'中西汇通学',
|
'中西汇通学',
|
||||||
'肿瘤学',
|
|
||||||
'针灸学',
|
'针灸学',
|
||||||
'心理学',
|
'肿瘤学',
|
||||||
|
'妇幼生殖',
|
||||||
'国学',
|
'国学',
|
||||||
|
'心理学',
|
||||||
'医学超级',
|
'医学超级',
|
||||||
'心理国学超级'
|
'心理国学超级'
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
<el-option label="针灸VIP" value="5"></el-option>
|
<el-option label="针灸VIP" value="5"></el-option>
|
||||||
<el-option label="肿瘤VIP" value="6"></el-option>
|
<el-option label="肿瘤VIP" value="6"></el-option>
|
||||||
<el-option label="中西汇通VIP" value="9"></el-option>
|
<el-option label="中西汇通VIP" value="9"></el-option>
|
||||||
|
<el-option label="妇幼生殖VIP" value="10"></el-option>
|
||||||
<el-option label="国学VIP" value="7"></el-option>
|
<el-option label="国学VIP" value="7"></el-option>
|
||||||
<el-option label="心理学VIP" value="8"></el-option>
|
<el-option label="心理学VIP" value="8"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -699,7 +700,8 @@ export default {
|
|||||||
6: "肿瘤VIP",
|
6: "肿瘤VIP",
|
||||||
7: "国学VIP",
|
7: "国学VIP",
|
||||||
8: "心理学VIP",
|
8: "心理学VIP",
|
||||||
9: "中西汇通VIP"
|
9: "中西汇通VIP",
|
||||||
|
10: "妇幼生殖VIP"
|
||||||
};
|
};
|
||||||
|
|
||||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ export default {
|
|||||||
{ value: "4", label: "中医学" },
|
{ value: "4", label: "中医学" },
|
||||||
{ value: "5", label: "针灸学" },
|
{ value: "5", label: "针灸学" },
|
||||||
{ value: "6", label: "肿瘤学" },
|
{ value: "6", label: "肿瘤学" },
|
||||||
|
{ value: "10", label: "妇幼生殖" },
|
||||||
{ value: "9", label: "中西汇通学" },
|
{ value: "9", label: "中西汇通学" },
|
||||||
{ value: "7", label: "国学" },
|
{ value: "7", label: "国学" },
|
||||||
{ value: "8", label: "心理学" }
|
{ value: "8", label: "心理学" }
|
||||||
@@ -250,9 +250,9 @@ export default {
|
|||||||
{ value: "4", label: "4年" }
|
{ value: "4", label: "4年" }
|
||||||
],
|
],
|
||||||
superVipTypeDict: {
|
superVipTypeDict: {
|
||||||
"11": ["4", "5", "6", "9", "7", "8"],
|
"11": ["4", "5", "6", "9", "10", "7", "8"],
|
||||||
"12": ["4", "5", "6", "9", "8"],
|
"12": ["4", "5", "6", "9", "10", "8"],
|
||||||
"1": ["4", "5", "6", "9"],
|
"1": ["4", "5", "6", "9", "10"],
|
||||||
"2": ["7", "8"]
|
"2": ["7", "8"]
|
||||||
},
|
},
|
||||||
hasVipList: [],
|
hasVipList: [],
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
<el-option label="中医VIP" value="4"></el-option>
|
<el-option label="中医VIP" value="4"></el-option>
|
||||||
<el-option label="针灸VIP" value="5"></el-option>
|
<el-option label="针灸VIP" value="5"></el-option>
|
||||||
<el-option label="肿瘤VIP" value="6"></el-option>
|
<el-option label="肿瘤VIP" value="6"></el-option>
|
||||||
|
<el-option label="妇幼生殖VIP" value="10"></el-option>
|
||||||
<el-option label="国学VIP" value="7"></el-option>
|
<el-option label="国学VIP" value="7"></el-option>
|
||||||
<el-option label="心理学VIP" value="8"></el-option>
|
<el-option label="心理学VIP" value="8"></el-option>
|
||||||
<el-option label="中西汇通VIP" value="9"></el-option>
|
<el-option label="中西汇通VIP" value="9"></el-option>
|
||||||
@@ -600,7 +601,8 @@ if (latest && latest.endTime) {
|
|||||||
6: "肿瘤VIP",
|
6: "肿瘤VIP",
|
||||||
7: "国学VIP",
|
7: "国学VIP",
|
||||||
8: "心理学VIP",
|
8: "心理学VIP",
|
||||||
9: "中西汇通VIP"
|
9: "中西汇通VIP",
|
||||||
|
10: "妇幼生殖VIP"
|
||||||
};
|
};
|
||||||
|
|
||||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||||
@@ -620,7 +622,7 @@ if (latest && latest.endTime) {
|
|||||||
|
|
||||||
const tags = [];
|
const tags = [];
|
||||||
vipTypes.forEach(e => {
|
vipTypes.forEach(e => {
|
||||||
if (e.type == 4 || e.type == 5 || e.type == 6 || e.type == 9) {
|
if (e.type == 4 || e.type == 5 || e.type == 6 || e.type == 9 || e.type == 10) {
|
||||||
tags.push(
|
tags.push(
|
||||||
`<el-tag size="mini" type="info" style="text-align:center;width:76px;font-weight: bold; color: ${
|
`<el-tag size="mini" type="info" style="text-align:center;width:76px;font-weight: bold; color: ${
|
||||||
e.state == 0 ? "#fff" : "#888"
|
e.state == 0 ? "#fff" : "#888"
|
||||||
|
|||||||
@@ -152,6 +152,7 @@
|
|||||||
<span v-if="item.type == 7">国学VIP</span>
|
<span v-if="item.type == 7">国学VIP</span>
|
||||||
<span v-if="item.type == 8">心理学VIP</span>
|
<span v-if="item.type == 8">心理学VIP</span>
|
||||||
<span v-if="item.type == 9">中西汇通VIP</span>
|
<span v-if="item.type == 9">中西汇通VIP</span>
|
||||||
|
<span v-if="item.type == 10">妇幼生殖VIP</span>
|
||||||
明细
|
明细
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -407,6 +408,7 @@ export default {
|
|||||||
{ value: 5, label: "针灸学VIP" },
|
{ value: 5, label: "针灸学VIP" },
|
||||||
{ value: 6, label: "肿瘤学VIP" },
|
{ value: 6, label: "肿瘤学VIP" },
|
||||||
{ value: 9, label: "中西汇通学VIP" },
|
{ value: 9, label: "中西汇通学VIP" },
|
||||||
|
{ value: 10, label: "妇幼生殖VIP" },
|
||||||
{ value: 7, label: "国学VIP" },
|
{ value: 7, label: "国学VIP" },
|
||||||
{ value: 8, label: "心理学VIP" }
|
{ value: 8, label: "心理学VIP" }
|
||||||
],
|
],
|
||||||
@@ -690,7 +692,8 @@ if (this.dataForm.type == "master") {
|
|||||||
6: "肿瘤VIP",
|
6: "肿瘤VIP",
|
||||||
7: "国学VIP",
|
7: "国学VIP",
|
||||||
8: "心理学VIP",
|
8: "心理学VIP",
|
||||||
9: "中西汇通VIP"
|
9: "中西汇通VIP",
|
||||||
|
10: "妇幼生殖VIP"
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("at line 274:", vipMap[data.type]);
|
console.log("at line 274:", vipMap[data.type]);
|
||||||
@@ -729,7 +732,8 @@ if (this.dataForm.type == "master") {
|
|||||||
6: "肿瘤VIP",
|
6: "肿瘤VIP",
|
||||||
7: "国学VIP",
|
7: "国学VIP",
|
||||||
8: "心理学VIP",
|
8: "心理学VIP",
|
||||||
9: "中西汇通VIP"
|
9: "中西汇通VIP",
|
||||||
|
10: "妇幼生殖VIP"
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("at line 274:", vipMap[data.type]);
|
console.log("at line 274:", vipMap[data.type]);
|
||||||
@@ -776,19 +780,18 @@ if (this.dataForm.type == "master") {
|
|||||||
6: "肿瘤VIP",
|
6: "肿瘤VIP",
|
||||||
7: "国学VIP",
|
7: "国学VIP",
|
||||||
8: "心理学VIP",
|
8: "心理学VIP",
|
||||||
9: "中西汇通VIP"
|
9: "中西汇通VIP",
|
||||||
|
10: "妇幼生殖VIP"
|
||||||
};
|
};
|
||||||
const tags = [];
|
const tags = [];
|
||||||
let vipTypes = [];
|
let vipTypes = [];
|
||||||
if (typeof userVips === "number") {
|
if (typeof userVips === "number") {
|
||||||
vipTypes = String(userVips)
|
vipTypes = [userVips];
|
||||||
.split("")
|
|
||||||
.map(Number); // 数字转为数组
|
|
||||||
} else {
|
} else {
|
||||||
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type
|
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type
|
||||||
}
|
}
|
||||||
vipTypes.forEach(type => {
|
vipTypes.forEach(type => {
|
||||||
if (type == 4 || type == 5 || type == 6 || type == 9) {
|
if (type == 4 || type == 5 || type == 6 || type == 9 || type == 10) {
|
||||||
tags.push(
|
tags.push(
|
||||||
`<span style="font-weight: bold; color: ${
|
`<span style="font-weight: bold; color: ${
|
||||||
data.state == 0 ? "#fff" : "#888"
|
data.state == 0 ? "#fff" : "#888"
|
||||||
|
|||||||
Reference in New Issue
Block a user