Compare commits
3 Commits
c6c88786a3
...
1f467a25be
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f467a25be | |||
| 7eeecab824 | |||
| 3518573db2 |
@@ -360,23 +360,29 @@ export default {
|
||||
this.tableColumn = tableColumn;
|
||||
var that = this;
|
||||
this.$nextTick(() => {
|
||||
if (!this.$refs.xTable) {
|
||||
return;
|
||||
}
|
||||
this.clearRadioRowEevnt();
|
||||
this.clearCheckboxEevnt();
|
||||
if (this.tableData.length > 0) {
|
||||
console.log("this.tableData.length at line 354:", this.tableData);
|
||||
this.tableData.forEach((e, i) => {
|
||||
if (e.rightWrong == 1) {
|
||||
console.log("e.rightWrong at line 356:", e);
|
||||
setTimeout(() => {
|
||||
if (!that.$refs.xTable) {
|
||||
return;
|
||||
}
|
||||
if (this.dataForm.type == 1) {
|
||||
that.$refs.xTable.setCheckboxRow(this.tableData[i], true);
|
||||
that.selectData = that.$refs.xTable.getCheckboxRecords();
|
||||
} else {
|
||||
that.$refs.xTable.setRadioRow(this.tableData[i]);
|
||||
that.selectRow = this.tableData[i];
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.clearRadioRowEevnt();
|
||||
this.clearCheckboxEevnt();
|
||||
this.$forceUpdate();
|
||||
});
|
||||
},
|
||||
@@ -406,35 +412,58 @@ export default {
|
||||
this.selectRow = null;
|
||||
this.$refs.xTable.clearRadioRow();
|
||||
},
|
||||
getRowKey(row) {
|
||||
if (!row) {
|
||||
return "";
|
||||
}
|
||||
if (row.id !== undefined && row.id !== null && row.id !== "") {
|
||||
return String(row.id);
|
||||
}
|
||||
return (
|
||||
row._X_ROW_KEY ||
|
||||
row._XID ||
|
||||
row._X_ROW_ID ||
|
||||
""
|
||||
);
|
||||
},
|
||||
isSameOptionRow(rowA, rowB) {
|
||||
if (!rowA || !rowB) {
|
||||
return false;
|
||||
}
|
||||
if (rowA === rowB) {
|
||||
return true;
|
||||
}
|
||||
const keyA = this.getRowKey(rowA);
|
||||
const keyB = this.getRowKey(rowB);
|
||||
return keyA && keyB && keyA === keyB;
|
||||
},
|
||||
getRadioEvent1() {
|
||||
var selectIds = [];
|
||||
let selectedRows = [];
|
||||
if (this.dataForm.type == 0) {
|
||||
var data = this.$refs.xTable.getRadioRecord();
|
||||
console.log("data at line 402:", data);
|
||||
if (data && (data.id || data._X_ROW_KEY)) {
|
||||
selectIds.push(data.id || data._X_ROW_KEY);
|
||||
console.log("selectIds.push at line 404:", selectIds);
|
||||
const data =
|
||||
(this.$refs.xTable && this.$refs.xTable.getRadioRecord()) ||
|
||||
this.selectRow;
|
||||
if (data) {
|
||||
selectedRows = [data];
|
||||
}
|
||||
} else {
|
||||
var data = this.$refs.xTable.getCheckboxRecords();
|
||||
selectIds = data.map(e => {
|
||||
return e.id || e._X_ROW_KEY;
|
||||
});
|
||||
console.log("selectIds at line 369:", selectIds);
|
||||
const data =
|
||||
(this.$refs.xTable && this.$refs.xTable.getCheckboxRecords()) ||
|
||||
[];
|
||||
selectedRows = data.length ? data : this.selectData;
|
||||
}
|
||||
|
||||
var list = [...this.tableData];
|
||||
list.map(e => {
|
||||
const list = [...this.tableData];
|
||||
list.forEach(e => {
|
||||
e.rightWrong = 0;
|
||||
});
|
||||
if (selectIds.length > 0) {
|
||||
list.map(e => {
|
||||
if (selectIds.includes(e.id || e._X_ROW_KEY)) {
|
||||
if (selectedRows.length > 0) {
|
||||
list.forEach(e => {
|
||||
if (selectedRows.some(row => this.isSameOptionRow(row, e))) {
|
||||
e.rightWrong = 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log("list at line 428:", list);
|
||||
return list;
|
||||
},
|
||||
|
||||
|
||||
@@ -533,11 +533,11 @@
|
||||
</el-dialog>
|
||||
<el-dialog title="申请退款" :visible.sync="refundApplyVisible" width="480px" append-to-body
|
||||
@close="refundApplyDialogClose">
|
||||
<el-form ref="refundApplyFormRef" :model="refundApplyForm" label-width="100px">
|
||||
<el-form-item label="是否退运费">
|
||||
<el-radio-group v-model="refundApplyForm.refundShipping">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-form ref="refundApplyFormRef" :model="refundApplyForm" label-width="150px">
|
||||
<el-form-item label="是否连运费一并退回">
|
||||
<el-radio-group v-model="refundApplyForm.refundShipping" :disabled="!refundApplyHasShipping">
|
||||
<el-radio :label="0">是</el-radio>
|
||||
<el-radio :label="1">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="退款备注">
|
||||
@@ -545,9 +545,21 @@
|
||||
maxlength="500" show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="refundApplyVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="refundApplySubmitting" @click="refundApplySubmit">确 定</el-button>
|
||||
<span slot="footer" class="dialog-footer refund-apply-dialog-footer">
|
||||
<div class="refund-apply-footer-amount">
|
||||
<span class="refund-apply-footer-label">实际退款金额</span>
|
||||
<span class="refund-apply-footer-value">¥{{ formatMoney(refundApplyPreviewAmount) }}</span>
|
||||
<span v-if="refundApplyHasShipping" class="refund-apply-footer-breakdown">
|
||||
实付金额 ¥{{ formatMoney(refundApplyPaidMoney) }}
|
||||
<template v-if="refundApplyForm.refundShipping !== 0">
|
||||
{{ ',扣除运费 ¥' + formatMoney(refundApplyDeductShippingFee) }}
|
||||
</template>
|
||||
</span>
|
||||
</div>
|
||||
<div class="refund-apply-footer-actions">
|
||||
<el-button @click="refundApplyVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="refundApplySubmitting" @click="refundApplySubmit">确 定</el-button>
|
||||
</div>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog title="钱款去向" :visible.sync="refundDetailVisible" width="420px" append-to-body>
|
||||
@@ -780,6 +792,40 @@
|
||||
this.isMultipleDisabled()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
refundApplyHasShipping() {
|
||||
const row = this.refundApplyOrder
|
||||
if (!row || row.orderId == null) return false
|
||||
const ship = Number(row.shippingMoney)
|
||||
return !isNaN(ship) && ship > 0
|
||||
},
|
||||
refundApplyPaidMoney() {
|
||||
const row = this.refundApplyOrder
|
||||
if (!row || row.orderId == null) return 0
|
||||
const n = Number(row.realMoney)
|
||||
return isNaN(n) ? 0 : n
|
||||
},
|
||||
refundApplyDeductShippingFee() {
|
||||
const row = this.refundApplyOrder
|
||||
if (!row || row.orderId == null) return 0
|
||||
const ship = Number(row.shippingMoney)
|
||||
if (isNaN(ship) || ship <= 0) return 0
|
||||
return this.refundApplyForm.refundShipping === 1 ? ship : 0
|
||||
},
|
||||
refundApplyPreviewAmount() {
|
||||
const row = this.refundApplyOrder
|
||||
if (!row || row.orderId == null) return 0
|
||||
const paid = Number(row.realMoney)
|
||||
const shipping = Number(row.shippingMoney)
|
||||
const paidNum = isNaN(paid) ? 0 : paid
|
||||
const shipNum = isNaN(shipping) ? 0 : shipping
|
||||
if (this.refundApplyForm.refundShipping === 1) {
|
||||
const n = paidNum - shipNum
|
||||
return n > 0 ? n : 0
|
||||
}
|
||||
return paidNum
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
computedVipType(userVips) {
|
||||
if (!userVips || userVips.length === 0) return '';
|
||||
@@ -1928,6 +1974,44 @@
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.refund-apply-dialog-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.refund-apply-footer-amount {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.refund-apply-footer-label {
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.refund-apply-footer-value {
|
||||
color: #e6a23c;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.refund-apply-footer-breakdown {
|
||||
display: inline-block;
|
||||
margin-left: 6px;
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.refund-apply-footer-actions {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.refund-detail-dialog {
|
||||
.refund-total-card {
|
||||
background: #f5f7fa;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<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>
|
||||
|
||||
<el-card class="box-card" v-for="(month, mIndex) in allMonthData"
|
||||
@@ -76,6 +76,7 @@
|
||||
allMonthData: [],
|
||||
list: [
|
||||
{title:'收入',val:'fee'} ,
|
||||
{title:'退款',val:'refundFee'},
|
||||
{title:'月摊销',val:'currentTanxiao'},
|
||||
{title:'已摊销',val:'alreadyTanxiao'},
|
||||
{title:'剩余摊销',val:'notyetTanxiao'},
|
||||
@@ -296,7 +297,7 @@
|
||||
.calendar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 20px;
|
||||
gap: 10px;
|
||||
}
|
||||
.month {
|
||||
background: #fff;
|
||||
@@ -311,15 +312,16 @@
|
||||
}
|
||||
.days {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-template-columns: repeat(5, minmax(max-content, 1fr));
|
||||
font-size: 17px;
|
||||
}
|
||||
.day {
|
||||
text-align: center;
|
||||
padding: 4px;
|
||||
padding: 4px 8px;
|
||||
margin: 2px;
|
||||
border-radius: 4px;
|
||||
min-height: 20px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.day.header {
|
||||
font-weight: bold;
|
||||
@@ -332,7 +334,7 @@
|
||||
padding: 4px 20px !important;
|
||||
}
|
||||
/deep/ .el-card .el-card__body {
|
||||
padding: 15px !important;
|
||||
padding: 15px 5px !important;
|
||||
overflow-x: auto !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -34,11 +34,7 @@
|
||||
class="days"
|
||||
style=""
|
||||
:style="{
|
||||
'grid-template-columns': `repeat(${
|
||||
month.total.length && month.total.length > 2
|
||||
? 2
|
||||
: month.total.length
|
||||
}, 1fr)`
|
||||
'grid-template-columns': `repeat(${list.length}, 1fr)`
|
||||
}"
|
||||
>
|
||||
<div
|
||||
@@ -184,6 +180,29 @@ export default {
|
||||
// {title:'报名VIP',val:'vip'},
|
||||
{ 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"],
|
||||
@@ -212,12 +231,18 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
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";
|
||||
}
|
||||
|
||||
if (d.val === "other") {
|
||||
const list = month.total.filter(item => {
|
||||
const list = dataSource.filter(item => {
|
||||
return (
|
||||
item.type === d.realTitle &&
|
||||
(item.payMethod === "" || item.payMethod === "其他")
|
||||
@@ -239,11 +264,12 @@ export default {
|
||||
item => item.type === d.realTitle,
|
||||
item => `${item.payMethod}${item.type}` === 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) {
|
||||
const matchedItem = month.total.find(rule);
|
||||
const matchedItem = dataSource.find(rule);
|
||||
if (matchedItem) {
|
||||
return matchedItem.amount;
|
||||
}
|
||||
@@ -407,7 +433,8 @@ export default {
|
||||
return {
|
||||
month: monthNum,
|
||||
total: res.data.total,
|
||||
surplus: res.data.surplus
|
||||
surplus: res.data.surplus,
|
||||
refundInfo: res.data.refundInfo || []
|
||||
};
|
||||
} else {
|
||||
return { month: monthNum, total: null, error: "获取失败" };
|
||||
@@ -428,7 +455,10 @@ export default {
|
||||
console.log("所有月份结果:", resArr);
|
||||
loading.close();
|
||||
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) {
|
||||
this.$message({
|
||||
|
||||
@@ -35,9 +35,7 @@
|
||||
style=""
|
||||
|
||||
:style="{
|
||||
'grid-template-columns': `repeat(${
|
||||
2
|
||||
}, 1fr)`
|
||||
'grid-template-columns': `repeat(${list.length}, 1fr)`
|
||||
}"
|
||||
>
|
||||
<div
|
||||
@@ -57,22 +55,29 @@
|
||||
|
||||
<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;">
|
||||
|
||||
<span style=""> {{item.title}} :<span v-if="item.otherTitle" style="font-size: 12px;color: #808080;"><br/>{{ item.otherTitle}}</span> </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 style="">
|
||||
{{ item.title }} :<span
|
||||
v-if="item.otherTitle"
|
||||
style="font-size: 12px;color: #808080;"
|
||||
><br />{{ item.otherTitle }}</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] }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -155,6 +160,16 @@ export default {
|
||||
{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"],
|
||||
monthNames: [
|
||||
@@ -182,25 +197,28 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
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 = [
|
||||
|
||||
item => item.pay_type === d.title,
|
||||
item => item.pay_type === d.realTitle,
|
||||
|
||||
// 更复杂的条件组合
|
||||
item => item.pay_type === d.realTitle
|
||||
];
|
||||
|
||||
// 依次检查每个规则,返回第一个匹配项
|
||||
for (const rule of matchRules) {
|
||||
const matchedItem = month.total.find(rule);
|
||||
const matchedItem = dataSource.find(rule);
|
||||
if (matchedItem) {
|
||||
return matchedItem.fee;
|
||||
}
|
||||
}
|
||||
|
||||
// 没有匹配项时返回空字符串
|
||||
return "0";
|
||||
},
|
||||
async handleExportAll() {
|
||||
@@ -354,7 +372,11 @@ export default {
|
||||
})
|
||||
.then(res => {
|
||||
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 {
|
||||
return { month: monthNum, total: null, error: "获取失败" };
|
||||
}
|
||||
@@ -374,7 +396,10 @@ export default {
|
||||
console.log("所有月份结果:", resArr);
|
||||
loading.close();
|
||||
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) {
|
||||
this.$message({
|
||||
|
||||
@@ -63,24 +63,15 @@
|
||||
}`
|
||||
"
|
||||
>
|
||||
<span style="font-size: 16px;color:#888;"
|
||||
>共计:{{
|
||||
allMonthData[mIndex].total.filter(
|
||||
item => item.payType == d.title
|
||||
)[0] ? allMonthData[mIndex].total.filter(
|
||||
item => item.payType == d.title
|
||||
)[0].count : 0
|
||||
}}笔</span
|
||||
>
|
||||
<span style="font-size: 16px;color:#888;">
|
||||
共计:{{ getPayTypeStat(allMonthData[mIndex].total, d.title, 'count') }}笔
|
||||
</span>
|
||||
|
||||
<span style="display: block;margin-top: 10px;font-weight: bold;"
|
||||
>{{
|
||||
allMonthData[mIndex].total.filter(
|
||||
item => item.payType == d.title
|
||||
)[0] ? allMonthData[mIndex].total.filter(
|
||||
item => item.payType == d.title
|
||||
)[0].totalPrice : 0
|
||||
}}
|
||||
>{{ getPayTypeStat(allMonthData[mIndex].total, d.title, 'totalPrice') }}
|
||||
</span>
|
||||
<span style="display: block;font-weight: bold; color: red; font-size: 14px;"
|
||||
>退款:{{ getPayTypeStat(allMonthData[mIndex].total, d.title, 'refundTotalPrice') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -285,6 +276,16 @@ export default {
|
||||
pad(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() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
@@ -324,9 +325,7 @@ export default {
|
||||
.then(resArr => {
|
||||
console.log("所有月份结果:", resArr);
|
||||
loading.close();
|
||||
this.allMonthData = resArr.filter(
|
||||
r => r.total !== null && r.total.length !== 0
|
||||
);
|
||||
this.allMonthData = resArr.filter(r => this.hasMonthTotal(r.total));
|
||||
console.log("this.allMonthData at line 295:", this.allMonthData);
|
||||
if(this.allMonthData.length==0){
|
||||
this.$message({
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="vipType" label="VIP类型" min-width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatText(scope.row.vipType) }}
|
||||
{{ formatVipType(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="year" label="年限" min-width="100">
|
||||
@@ -90,6 +90,7 @@
|
||||
|
||||
<script>
|
||||
import http from '@/utils/httpRequest'
|
||||
import { formatVipType } from './vipStatisticsHelper'
|
||||
|
||||
function createEmptySummary() {
|
||||
return {
|
||||
@@ -99,6 +100,8 @@ function createEmptySummary() {
|
||||
zxhtCount: 0,
|
||||
zlCount: 0,
|
||||
xlCount: 0,
|
||||
fyszCount: 0,
|
||||
gxCount: 0,
|
||||
yxSuperCount: 0,
|
||||
gxSuperCount: 0
|
||||
}
|
||||
@@ -153,9 +156,11 @@ export default {
|
||||
return [
|
||||
{ key: 'total', label: '总人数', value: summary.total },
|
||||
{ key: 'zyCount', label: '中医学', value: summary.zyCount },
|
||||
{ key: 'zjCount', label: '针灸学', value: summary.zjCount },
|
||||
{ key: 'zxhtCount', label: '中西汇通学', value: summary.zxhtCount },
|
||||
{ key: 'zjCount', label: '针灸学', value: summary.zjCount },
|
||||
{ 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: 'yxSuperCount', label: '医学超级', value: summary.yxSuperCount },
|
||||
{ key: 'gxSuperCount', label: '国学心理学超级', value: summary.gxSuperCount }
|
||||
@@ -169,6 +174,8 @@ export default {
|
||||
zxhtCount: counts.zxhtCount || 0,
|
||||
zlCount: counts.zlCount || counts.zlcount || 0,
|
||||
xlCount: counts.xlCount || 0,
|
||||
fyszCount: counts.fyszCount || 0,
|
||||
gxCount: counts.gxCount || 0,
|
||||
yxSuperCount: counts.yxSuperCount || 0,
|
||||
gxSuperCount: counts.gxSuperCount || 0
|
||||
}
|
||||
|
||||
@@ -42,7 +42,11 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
{{ formatYear(scope.row.year) }}
|
||||
@@ -62,6 +66,7 @@
|
||||
|
||||
<script>
|
||||
import http from '@/utils/httpRequest'
|
||||
import { formatVipType } from './vipStatisticsHelper'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -87,6 +92,8 @@ export default {
|
||||
zxhtCount: 0,
|
||||
zlcount: 0,
|
||||
xlCount: 0,
|
||||
fyszCount: 0,
|
||||
gxCount: 0,
|
||||
yxSuperCount: 0,
|
||||
gxSuperCount: 0
|
||||
}
|
||||
@@ -100,9 +107,11 @@ export default {
|
||||
return [
|
||||
{ key: 'total', label: '总人数', value: this.summaryData.total },
|
||||
{ key: 'zyCount', label: '中医学', value: this.summaryData.zyCount },
|
||||
{ key: 'zjcount', label: '针灸学', value: this.summaryData.zjcount },
|
||||
{ key: 'zxhtCount', label: '中西汇通学', value: this.summaryData.zxhtCount },
|
||||
{ key: 'zjcount', label: '针灸学', value: this.summaryData.zjcount },
|
||||
{ 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: 'yxSuperCount', label: '医学超级', value: this.summaryData.yxSuperCount },
|
||||
{ key: 'gxSuperCount', label: '国学心理学超级', value: this.summaryData.gxSuperCount }
|
||||
@@ -157,6 +166,8 @@ export default {
|
||||
zxhtCount: countData.zxhtCount || 0,
|
||||
zlcount: countData.zlCount || countData.zlcount || 0,
|
||||
xlCount: countData.xlCount || 0,
|
||||
fyszCount: countData.fyszCount || 0,
|
||||
gxCount: countData.gxCount || 0,
|
||||
yxSuperCount: countData.yxSuperCount || 0,
|
||||
gxSuperCount: countData.gxSuperCount || 0
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { formatVipType } from './vipStatisticsHelper'
|
||||
|
||||
function toNumber(value) {
|
||||
const num = Number(value)
|
||||
return Number.isNaN(num) ? 0 : num
|
||||
@@ -129,7 +131,7 @@ function buildTableRows(list) {
|
||||
time: formatText(item.payTime),
|
||||
name: formatText(item.name),
|
||||
tel: formatText(item.tel),
|
||||
vipType: formatText(item.vipType),
|
||||
vipType: formatVipType(item),
|
||||
isYan: formatText(item.isYan),
|
||||
currentYear: formatYear(item.year),
|
||||
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 = [
|
||||
'中医学',
|
||||
'中西汇通学',
|
||||
'肿瘤学',
|
||||
'针灸学',
|
||||
'心理学',
|
||||
'肿瘤学',
|
||||
'妇幼生殖',
|
||||
'国学',
|
||||
'心理学',
|
||||
'医学超级',
|
||||
'心理国学超级'
|
||||
]
|
||||
|
||||
@@ -858,7 +858,7 @@ export default {
|
||||
data: this.$http.adornData({}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.vipList = data.vipBuyConfigList.filter(item => item.type >= 4 && item.type <= 9);
|
||||
this.vipList = data.vipBuyConfigList.filter(item => item.type >= 4 && item.type <= 10);
|
||||
this.svipList = data.vipBuyConfigList.filter(item => item.type === 1 || item.type === 2);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<el-option label="针灸VIP" value="5"></el-option>
|
||||
<el-option label="肿瘤VIP" value="6"></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="8"></el-option>
|
||||
</el-select>
|
||||
@@ -699,7 +700,8 @@ export default {
|
||||
6: "肿瘤VIP",
|
||||
7: "国学VIP",
|
||||
8: "心理学VIP",
|
||||
9: "中西汇通VIP"
|
||||
9: "中西汇通VIP",
|
||||
10: "妇幼生殖VIP"
|
||||
};
|
||||
|
||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||
|
||||
@@ -239,7 +239,7 @@ export default {
|
||||
{ value: "4", label: "中医学" },
|
||||
{ value: "5", label: "针灸学" },
|
||||
{ value: "6", label: "肿瘤学" },
|
||||
|
||||
{ value: "10", label: "妇幼生殖" },
|
||||
{ value: "9", label: "中西汇通学" },
|
||||
{ value: "7", label: "国学" },
|
||||
{ value: "8", label: "心理学" }
|
||||
@@ -250,9 +250,9 @@ export default {
|
||||
{ value: "4", label: "4年" }
|
||||
],
|
||||
superVipTypeDict: {
|
||||
"11": ["4", "5", "6", "9", "7", "8"],
|
||||
"12": ["4", "5", "6", "9", "8"],
|
||||
"1": ["4", "5", "6", "9"],
|
||||
"11": ["4", "5", "6", "9", "10", "7", "8"],
|
||||
"12": ["4", "5", "6", "9", "10", "8"],
|
||||
"1": ["4", "5", "6", "9", "10"],
|
||||
"2": ["7", "8"]
|
||||
},
|
||||
hasVipList: [],
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<el-option label="中医VIP" value="4"></el-option>
|
||||
<el-option label="针灸VIP" value="5"></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="8"></el-option>
|
||||
<el-option label="中西汇通VIP" value="9"></el-option>
|
||||
@@ -600,7 +601,8 @@ if (latest && latest.endTime) {
|
||||
6: "肿瘤VIP",
|
||||
7: "国学VIP",
|
||||
8: "心理学VIP",
|
||||
9: "中西汇通VIP"
|
||||
9: "中西汇通VIP",
|
||||
10: "妇幼生殖VIP"
|
||||
};
|
||||
|
||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||
@@ -620,7 +622,7 @@ if (latest && latest.endTime) {
|
||||
|
||||
const tags = [];
|
||||
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(
|
||||
`<el-tag size="mini" type="info" style="text-align:center;width:76px;font-weight: bold; color: ${
|
||||
e.state == 0 ? "#fff" : "#888"
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
<span v-if="item.type == 7">国学VIP</span>
|
||||
<span v-if="item.type == 8">心理学VIP</span>
|
||||
<span v-if="item.type == 9">中西汇通VIP</span>
|
||||
<span v-if="item.type == 10">妇幼生殖VIP</span>
|
||||
明细
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -407,6 +408,7 @@ export default {
|
||||
{ value: 5, label: "针灸学VIP" },
|
||||
{ value: 6, label: "肿瘤学VIP" },
|
||||
{ value: 9, label: "中西汇通学VIP" },
|
||||
{ value: 10, label: "妇幼生殖VIP" },
|
||||
{ value: 7, label: "国学VIP" },
|
||||
{ value: 8, label: "心理学VIP" }
|
||||
],
|
||||
@@ -690,7 +692,8 @@ if (this.dataForm.type == "master") {
|
||||
6: "肿瘤VIP",
|
||||
7: "国学VIP",
|
||||
8: "心理学VIP",
|
||||
9: "中西汇通VIP"
|
||||
9: "中西汇通VIP",
|
||||
10: "妇幼生殖VIP"
|
||||
};
|
||||
|
||||
console.log("at line 274:", vipMap[data.type]);
|
||||
@@ -729,7 +732,8 @@ if (this.dataForm.type == "master") {
|
||||
6: "肿瘤VIP",
|
||||
7: "国学VIP",
|
||||
8: "心理学VIP",
|
||||
9: "中西汇通VIP"
|
||||
9: "中西汇通VIP",
|
||||
10: "妇幼生殖VIP"
|
||||
};
|
||||
|
||||
console.log("at line 274:", vipMap[data.type]);
|
||||
@@ -776,19 +780,18 @@ if (this.dataForm.type == "master") {
|
||||
6: "肿瘤VIP",
|
||||
7: "国学VIP",
|
||||
8: "心理学VIP",
|
||||
9: "中西汇通VIP"
|
||||
9: "中西汇通VIP",
|
||||
10: "妇幼生殖VIP"
|
||||
};
|
||||
const tags = [];
|
||||
let vipTypes = [];
|
||||
if (typeof userVips === "number") {
|
||||
vipTypes = String(userVips)
|
||||
.split("")
|
||||
.map(Number); // 数字转为数组
|
||||
vipTypes = [userVips];
|
||||
} else {
|
||||
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 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(
|
||||
`<span style="font-weight: bold; color: ${
|
||||
data.state == 0 ? "#fff" : "#888"
|
||||
|
||||
Reference in New Issue
Block a user