8 Commits

Author SHA1 Message Date
1f467a25be feat(报表模块): 更新增加妇幼生殖vip和退款功能相关 2026-06-16 10:21:39 +08:00
7eeecab824 feat(考试模块): 优化题库添加功能及事件处理
- 添加对表格引用的检查,避免空引用错误
- 优化选择行的逻辑,确保正确处理单选和多选情况
- 引入行键获取和比较功能,提升行数据的处理准确性
- 清理冗余代码,增强代码可读性和维护性
2026-05-20 13:43:26 +08:00
3518573db2 feat(订单模块): 优化退款申请对话框及计算逻辑
- 更新退款申请表单,修改运费退回选项的标签和逻辑
- 添加计算属性以支持退款金额和运费的动态计算
- 优化退款申请对话框的样式,提升用户体验
- 更新课程列表中的VIP配置过滤条件,支持新类型的显示
2026-05-20 13:43:15 +08:00
c6c88786a3 feat(订单模块): 添加退款状态及相关功能
- 更新订单状态,新增“退款中”和“已退款”状态选项
- 在订单列表中添加退款申请和退款详情按钮
- 更新订单详情页面,显示退款状态信息
- 添加退款申请对话框,支持用户输入退款备注及选择是否退运费
- 优化样式以提升用户体验
2026-04-30 11:29:50 +08:00
677bda77c0 改本地ip 2026-04-22 20:14:30 +08:00
b71a4464e7 feat(统计业务): 课程统计添加排序;用户统计修改数据卡片显示;
- 更新课程统计和标签统计页面,添加自定义排序功能
- 实现刷新按钮,重置排序状态并重新获取数据
- 优化数据请求,支持排序参数的传递
- 更新用户统计页面,调整显示逻辑以提升用户体验
2026-04-09 16:52:36 +08:00
3e1b8917a8 feat(课程模块): 添加购课明细功能及相关路由
- 在课程模块中新增购课明细页面,支持查看课程购买详情
- 更新路由配置,添加购课明细的路由路径
- 在课程列表中添加“查看购课明细”按钮,优化用户操作体验
- 更新状态管理,支持动态更新主标签的查询和参数信息
2026-04-09 09:29:24 +08:00
822f42cd96 feat(心理论坛模块): 更新新增/修改弹窗表单,添加同步功能
- 修改弹窗标题为“修改”,并移除链接地址输入项
- 更新表单数据结构,确保只保留分类信息
- 添加同步按钮,替换新增按钮,优化用户操作流程
- 实现同步弹窗的显示逻辑,支持数据列表的刷新
2026-04-07 14:31:48 +08:00
30 changed files with 1176 additions and 169 deletions

View File

@@ -23,7 +23,7 @@ module.exports = {
}, },
// Various Dev Server settings // Various Dev Server settings
host: '192.168.110.161', // can be overwritten by process.env.HOST host: '192.168.110.160', // can be overwritten by process.env.HOST
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true, autoOpenBrowser: true,
errorOverlay: true, errorOverlay: true,

View File

@@ -65,6 +65,7 @@ const mainRoutes = {
{ path: '/course-courseCatalogue', component: _import('modules/course/courseCatalogue'), name: 'course-courseCatalogue', meta: { title: '课程目录列表', isTab: true } }, { path: '/course-courseCatalogue', component: _import('modules/course/courseCatalogue'), name: 'course-courseCatalogue', meta: { title: '课程目录列表', isTab: true } },
{ path: '/course-courseChapter', component: _import('modules/course/courseChapter'), name: 'course-courseChapter', meta: { title: '课程目录章节列表', isTab: true } }, { path: '/course-courseChapter', component: _import('modules/course/courseChapter'), name: 'course-courseChapter', meta: { title: '课程目录章节列表', isTab: true } },
{ path: '/course-courseVideo', component: _import('modules/course/courseVideo'), name: 'course-courseVideo', meta: { title: '课程目录章节视频列表', isTab: true } }, { path: '/course-courseVideo', component: _import('modules/course/courseVideo'), name: 'course-courseVideo', meta: { title: '课程目录章节视频列表', isTab: true } },
{ path: '/course-coursePurchaseDetails', component: _import('modules/course/coursePurchaseDetails'), name: 'course-coursePurchaseDetails', meta: { title: '购课明细', isTab: true } },
{ path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } }, { path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } },
{ path: '/userCourse', component: _import('modules/user/userCourse'), name: 'userCourse', meta: { title: '用户课程列表', isTab: true } }, { path: '/userCourse', component: _import('modules/user/userCourse'), name: 'userCourse', meta: { title: '用户课程列表', isTab: true } },
{ path: '/userCertificate', component: _import('modules/user/userCertificate'), name: 'userCertificate', meta: { title: '用户证书列表', isTab: true } }, { path: '/userCertificate', component: _import('modules/user/userCertificate'), name: 'userCertificate', meta: { title: '用户证书列表', isTab: true } },

View File

@@ -43,6 +43,16 @@ export default {
updateMainTabs (state, tabs) { updateMainTabs (state, tabs) {
state.mainTabs = tabs state.mainTabs = tabs
}, },
updateMainTabRoute (state, { name, query, params }) {
const tabIndex = state.mainTabs.findIndex(item => item.name === name)
if (tabIndex === -1) return
const tab = state.mainTabs[tabIndex]
state.mainTabs.splice(tabIndex, 1, {
...tab,
query: query != null ? query : tab.query,
params: params != null ? params : tab.params
})
},
updateMainTabsActiveName (state, name) { updateMainTabsActiveName (state, name) {
state.mainTabsActiveName = name state.mainTabsActiveName = name
} }

View File

@@ -132,15 +132,11 @@ export default {
}; };
this.mainTabs = this.mainTabs.concat(tab); this.mainTabs = this.mainTabs.concat(tab);
} else { } else {
this.$store.commit("common/updateMainTabRoute", {
// this.mainTabs = this.mainTabs.concat({ name: route.name,
// ...tab, query: route.query,
// params: route.params, params: route.params
// query: route.query });
// });
this.mainTabs[tabIndex].query=route.query
this.mainTabs[tabIndex].params=route.query
console.log("at line 107:", "存在先添加",tab);
} }
this.menuActiveName = tab.menuId + ""; this.menuActiveName = tab.menuId + "";
this.mainTabsActiveName = tab.name; this.mainTabsActiveName = tab.name;

View File

@@ -1,7 +1,7 @@
<template> <template>
<el-dialog <el-dialog
width="1260px" width="1260px"
:title="!dataForm.id ? '新增' : '修改'" title="修改"
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="visible" :visible.sync="visible"
@close="handlereset" @close="handlereset"
@@ -16,13 +16,6 @@
ref="dataForm" ref="dataForm"
label-width="80px" label-width="80px"
> >
<el-form-item label="链接地址" prop="url">
<el-input
v-model="dataForm.url"
placeholder="链接地址"
:rows="3"
></el-input>
</el-form-item>
<el-form-item label="分类" prop="type"> <el-form-item label="分类" prop="type">
<el-select v-model="dataForm.type" placeholder="请选择分类" clearable> <el-select v-model="dataForm.type" placeholder="请选择分类" clearable>
<el-option <el-option
@@ -45,7 +38,7 @@
</template> </template>
<script> <script>
import global from "../../common/common.vue"; //引入共用组间 import global from "../../common/common.vue";
export default { export default {
data() { data() {
return { return {
@@ -56,21 +49,15 @@ export default {
typeList: [], typeList: [],
dataForm: { dataForm: {
id: null, id: null,
title: '', type: ""
url: '',
type: ''
}, },
dataRule: { dataRule: {
type: [ type: [
{ required: true, message: "分类不能为空", trigger: "change" } { required: true, message: "分类不能为空", trigger: "change" }
],
url: [
{ required: true, message: "链接地址不能为空", trigger: "change" }
] ]
}, },
urlList: { urlList: {
info: "/master/message/getMessageById", info: "/master/message/getMessageById",
add: "/common/wxPublicAccount/addWxPublicAccountArticle",
update: "/common/wxPublicAccount/updateWxPublicAccountArticle" update: "/common/wxPublicAccount/updateWxPublicAccountArticle"
} }
}; };
@@ -92,8 +79,7 @@ export default {
this.getTypeList(); this.getTypeList();
this.dataForm = { this.dataForm = {
id: row && row.id || null, id: row && row.id || null,
url: row && row.url || '', type: row && row.type != null ? String(row.type) : ""
type: row && row.type != null ? String(row.type) : ''
}; };
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
@@ -102,22 +88,24 @@ export default {
} }
}); });
}, },
// 表单提交
dataFormSubmit() { dataFormSubmit() {
this.$refs["dataForm"].validate(valid => { this.$refs["dataForm"].validate(valid => {
if (valid) { if (valid) {
// 这里应该是提交数据的逻辑 const loading = this.$loading({
lock: true,
fullscreen: true
});
this.$http this.$http
.request({ .request({
url: this.dataForm.id ? this.$http.adornUrl(this.urlList.update) : this.$http.adornUrl(this.urlList.add), url: this.$http.adornUrl(this.urlList.update),
method: "POST", method: "POST",
data: this.dataForm, data: this.dataForm,
header: { header: {
//默认 无 说明:请求头
"Content-Type": "application/json" "Content-Type": "application/json"
} }
}) })
.then(({ data }) => { .then(({ data }) => {
loading.close();
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: "操作成功", message: "操作成功",
@@ -131,6 +119,9 @@ export default {
} else { } else {
this.$message.error(data.msg); this.$message.error(data.msg);
} }
})
.catch(() => {
loading.close();
}); });
} }
}); });

View File

@@ -0,0 +1,134 @@
<template>
<el-dialog
width="1260px"
title="同步"
:close-on-click-modal="false"
:visible.sync="visible"
@close="handlereset"
style="height: auto;"
>
<div style="margin-bottom: 60px;">
<el-form
style="height: auto;"
class="addFormBox"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
label-width="80px"
>
<el-form-item label="token" prop="token">
<el-input
v-model="dataForm.token"
type="textarea"
:rows="4"
placeholder="token"
></el-input>
</el-form-item>
<el-form-item label="cookie" prop="cookie">
<el-input
v-model="dataForm.cookie"
type="textarea"
:rows="4"
placeholder="cookie"
></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handlereset">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import global from "../../common/common.vue";
export default {
data() {
return {
baseUrl: global.baseUrl,
visible: false,
dataForm: {
token: "",
cookie: ""
},
dataRule: {
token: [
{ required: true, message: "token不能为空", trigger: "blur" }
],
cookie: [
{ required: true, message: "cookie不能为空", trigger: "blur" }
]
},
urlList: {
add: "/common/wxPublicAccount/addWxPublicAccountArticle"
}
};
},
methods: {
init() {
this.dataForm = {
token: "",
cookie: ""
};
this.visible = true;
this.$nextTick(() => {
if (this.$refs["dataForm"]) {
this.$refs["dataForm"].clearValidate();
}
});
},
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
const loading = this.$loading({
lock: true,
fullscreen: true
});
this.$http
.request({
url: this.$http.adornUrl(this.urlList.add),
method: "POST",
data: this.dataForm,
header: {
"Content-Type": "application/json"
}
})
.then(({ data }) => {
loading.close();
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
})
.catch(() => {
loading.close();
});
}
});
},
handlereset() {
if (this.$refs["dataForm"]) {
this.$refs["dataForm"].clearValidate();
}
this.visible = false;
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .addFormBox.el-form-item {
margin-bottom: 10px !important;
}
</style>

View File

@@ -32,7 +32,7 @@
" "
>查询</el-button >查询</el-button
> >
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button type="primary" @click="syncHandle()">同步</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="height: calc(100% - 80px );"> <div style="height: calc(100% - 80px );">
@@ -131,7 +131,13 @@
</el-pagination> </el-pagination>
</div> </div>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗同步 -->
<psychological-forum-add
v-if="addVisible"
ref="psychologicalForumAdd"
@refreshDataList="getDataList"
></psychological-forum-add>
<!-- 弹窗修改 -->
<add-or-update <add-or-update
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@@ -142,6 +148,7 @@
<script> <script>
import AddOrUpdate from "./psychologicalForum-add-or-update"; import AddOrUpdate from "./psychologicalForum-add-or-update";
import PsychologicalForumAdd from "./psychologicalForum-add";
export default { export default {
data() { data() {
return { return {
@@ -162,6 +169,7 @@ export default {
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addVisible: false,
addOrUpdateVisible: false, addOrUpdateVisible: false,
urlList: { urlList: {
list: "/common/wxPublicAccount/getWxPublicAccountArticleList" list: "/common/wxPublicAccount/getWxPublicAccountArticleList"
@@ -169,7 +177,8 @@ export default {
}; };
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
PsychologicalForumAdd
}, },
activated() { activated() {
if (this.$route.query.upPageInde != null) { if (this.$route.query.upPageInde != null) {
@@ -242,7 +251,13 @@ export default {
selectionChangeHandle(val) { selectionChangeHandle(val) {
this.dataListSelections = val; this.dataListSelections = val;
}, },
// 新增 / 修改 syncHandle() {
this.addVisible = true;
this.$nextTick(() => {
this.$refs.psychologicalForumAdd.init();
});
},
// 修改
addOrUpdateHandle(row) { addOrUpdateHandle(row) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {

View File

@@ -210,7 +210,7 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="280" width="360"
label="操作" label="操作"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@@ -280,6 +280,13 @@
<!-- </el-dropdown-menu> <!-- </el-dropdown-menu>
</el-dropdown> --> </el-dropdown> -->
</div> </div>
<div>
<el-button
type="text"
size="small"
@click="showCoursePurchaseDetails(scope.row)"
>查看购课明细</el-button>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -872,6 +879,31 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
// row ? (this.courseId = row.id) : ""; // row ? (this.courseId = row.id) : "";
}, },
showCoursePurchaseDetails(row) {
const list = (row && row.courseCatalogueEntityList) || [];
const catalogue = Array.isArray(list)
? list.map(item => ({
id: item.id,
title: item.title
}))
: [];
if (!catalogue.length) {
this.$message.warning("该课程未设置目录,无法查看购买明细。");
return;
}
const firstCatalogueId =
catalogue && catalogue.length > 0 ? String(catalogue[0].id) : "";
this.$router.push({
name: "course-coursePurchaseDetails",
query: {
courseId: row.id,
courseName: row.title || "",
catalogueId: firstCatalogueId,
catalogue: encodeURIComponent(JSON.stringify(catalogue || []))
}
});
},
// 删除 // 删除
deleteHandle(id) { deleteHandle(id) {
var ids = id var ids = id

View File

@@ -0,0 +1,205 @@
<template>
<div class="mod-config">
<div class="tab-header">
<el-tabs
v-model="activeCatalogueId"
type="card"
@tab-click="onTabClick"
>
<el-tab-pane
v-for="item in catalogue"
:key="String(item.id)"
:label="item.title"
:name="String(item.id)"
/>
</el-tabs>
<el-button
class="download-btn"
type="success"
size="small"
:loading="exportLoading"
:disabled="exportLoading"
@click="downloadReport"
>
{{ exportLoading ? "下载中..." : "下载报表" }}
</el-button>
</div>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;"
>
<el-table-column prop="name" header-align="center" align="center" label="姓名" width="120" />
<el-table-column prop="tel" header-align="center" align="center" label="电话" width="140" />
<el-table-column prop="orderSn" header-align="center" align="center" label="订单编号" min-width="180" />
<el-table-column prop="payTime" header-align="center" align="center" label="支付时间" width="170" />
<el-table-column prop="allDays" header-align="center" align="center" label="总天数" width="90" />
<el-table-column prop="productName" header-align="center" align="center" label="商品名称" min-width="220" show-overflow-tooltip />
<el-table-column prop="type" header-align="center" align="center" label="开通渠道" width="100" />
<el-table-column prop="payType" header-align="center" align="center" label="支付方式" width="100" />
<el-table-column prop="days" header-align="center" align="center" label="天数" width="80" />
<el-table-column prop="fee" header-align="center" align="center" label="金额" width="90" />
<el-table-column prop="jf" header-align="center" align="center" label="积分" width="90" />
<el-table-column prop="come" header-align="center" align="center" label="来源" min-width="200" show-overflow-tooltip />
<el-table-column prop="remark" header-align="center" align="center" label="备注" min-width="160" show-overflow-tooltip />
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
style="padding: 30px 0; text-align: center;"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
</div>
</template>
<script>
export default {
data() {
return {
courseId: "",
courseName: "",
catalogue: [],
activeCatalogueId: "",
dataListLoading: false,
exportLoading: false,
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0
};
},
activated() {
this.initFromRoute();
this.getDataList();
},
watch: {
$route() {
this.initFromRoute();
this.pageIndex = 1;
this.getDataList();
}
},
methods: {
initFromRoute() {
const q = (this.$route && this.$route.query) || {};
this.courseId = q.courseId || "";
this.courseName = q.courseName || "";
let catalogue = [];
try {
const raw = q.catalogue ? decodeURIComponent(q.catalogue) : "[]";
catalogue = JSON.parse(raw || "[]") || [];
} catch (e) {
catalogue = [];
}
this.catalogue = Array.isArray(catalogue) ? catalogue : [];
const routeCatalogueId = q.catalogueId ? String(q.catalogueId) : "";
if (routeCatalogueId) {
this.activeCatalogueId = routeCatalogueId;
} else if (this.catalogue.length > 0) {
this.activeCatalogueId = String(this.catalogue[0].id);
} else {
this.activeCatalogueId = "";
}
},
onTabClick() {
this.pageIndex = 1;
this.getDataList();
},
getDataList() {
if (!this.courseId || !this.activeCatalogueId) {
this.dataList = [];
this.totalPage = 0;
return;
}
this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/master/course/getCoursePurchaseDetails"),
method: "post",
data: this.$http.adornData({
courseId: String(this.courseId),
catalogueId: String(this.activeCatalogueId),
limit: String(this.pageSize),
page: String(this.pageIndex)
})
})
.then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.coursePurchaseDetails || [];
this.totalPage = data.totalSize || 0;
} else {
this.dataList = [];
this.totalPage = 0;
}
})
.finally(() => {
this.dataListLoading = false;
});
},
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
async downloadReport() {
if (!this.courseId) return;
this.exportLoading = true;
try {
const response = await this.$http({
url: this.$http.adornUrl("/master/course/exportCoursePurchaseDetails"),
method: "post",
data: this.$http.adornData({
courseId: String(this.courseId)
}),
responseType: "blob"
});
const blob = new Blob([response.data]);
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
const safeCourseName = String(this.courseName || `课程_${this.courseId}`)
.replace(/[\\/:*?"<>|]/g, "_")
.trim();
link.download = `购课明细_${safeCourseName || this.courseId}.xlsx`;
link.click();
URL.revokeObjectURL(link.href);
} catch (e) {
this.$message.error("下载失败,请稍后重试");
} finally {
this.exportLoading = false;
}
}
}
};
</script>
<style lang="scss" scoped>
.tab-header {
display: flex;
align-items: flex-end;
justify-content: space-between;
}
.tab-header /deep/ .el-tabs {
flex: 1;
min-width: 0;
}
.download-btn {
margin-left: 12px;
margin-bottom: 20px;
}
</style>

View File

@@ -360,23 +360,29 @@ export default {
this.tableColumn = tableColumn; this.tableColumn = tableColumn;
var that = this; var that = this;
this.$nextTick(() => { this.$nextTick(() => {
if (!this.$refs.xTable) {
return;
}
this.clearRadioRowEevnt();
this.clearCheckboxEevnt();
if (this.tableData.length > 0) { if (this.tableData.length > 0) {
console.log("this.tableData.length at line 354:", this.tableData);
this.tableData.forEach((e, i) => { this.tableData.forEach((e, i) => {
if (e.rightWrong == 1) { if (e.rightWrong == 1) {
console.log("e.rightWrong at line 356:", e);
setTimeout(() => { setTimeout(() => {
if (!that.$refs.xTable) {
return;
}
if (this.dataForm.type == 1) { if (this.dataForm.type == 1) {
that.$refs.xTable.setCheckboxRow(this.tableData[i], true); that.$refs.xTable.setCheckboxRow(this.tableData[i], true);
that.selectData = that.$refs.xTable.getCheckboxRecords();
} else { } else {
that.$refs.xTable.setRadioRow(this.tableData[i]); that.$refs.xTable.setRadioRow(this.tableData[i]);
that.selectRow = this.tableData[i];
} }
}, 50); }, 50);
} }
}); });
} }
this.clearRadioRowEevnt();
this.clearCheckboxEevnt();
this.$forceUpdate(); this.$forceUpdate();
}); });
}, },
@@ -406,35 +412,58 @@ export default {
this.selectRow = null; this.selectRow = null;
this.$refs.xTable.clearRadioRow(); 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() { getRadioEvent1() {
var selectIds = []; let selectedRows = [];
if (this.dataForm.type == 0) { if (this.dataForm.type == 0) {
var data = this.$refs.xTable.getRadioRecord(); const data =
console.log("data at line 402:", data); (this.$refs.xTable && this.$refs.xTable.getRadioRecord()) ||
if (data && (data.id || data._X_ROW_KEY)) { this.selectRow;
selectIds.push(data.id || data._X_ROW_KEY); if (data) {
console.log("selectIds.push at line 404:", selectIds); selectedRows = [data];
} }
} else { } else {
var data = this.$refs.xTable.getCheckboxRecords(); const data =
selectIds = data.map(e => { (this.$refs.xTable && this.$refs.xTable.getCheckboxRecords()) ||
return e.id || e._X_ROW_KEY; [];
}); selectedRows = data.length ? data : this.selectData;
console.log("selectIds at line 369:", selectIds);
} }
var list = [...this.tableData]; const list = [...this.tableData];
list.map(e => { list.forEach(e => {
e.rightWrong = 0; e.rightWrong = 0;
}); });
if (selectIds.length > 0) { if (selectedRows.length > 0) {
list.map(e => { list.forEach(e => {
if (selectIds.includes(e.id || e._X_ROW_KEY)) { if (selectedRows.some(row => this.isSameOptionRow(row, e))) {
e.rightWrong = 1; e.rightWrong = 1;
} }
}); });
} }
console.log("list at line 428:", list);
return list; return list;
}, },

View File

@@ -13,6 +13,8 @@
<el-radio-button label="1">待发出</el-radio-button> <el-radio-button label="1">待发出</el-radio-button>
<el-radio-button label="2">已发出</el-radio-button> <el-radio-button label="2">已发出</el-radio-button>
<el-radio-button label="3">已完成</el-radio-button> <el-radio-button label="3">已完成</el-radio-button>
<el-radio-button label="7">退款中</el-radio-button>
<el-radio-button label="6">已退款</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="order_type_block"> <div class="order_type_block">
@@ -255,6 +257,9 @@
<div><el-button style=" line-height: 6px;" type="primary" size="mini" <div><el-button style=" line-height: 6px;" type="primary" size="mini"
@click="orderDeliver(fitem)">发出</el-button> @click="orderDeliver(fitem)">发出</el-button>
</div> </div>
<div v-if="rowRefundable(fitem)" style="margin-top: 8px;">
<el-button type="warning" size="mini" plain @click="openRefundApply(fitem)">申请退款</el-button>
</div>
</div> </div>
</div> </div>
<div class="td5 flexbox" style="justify-content: center; align-items: center; width: 150px; text-align:center"> <div class="td5 flexbox" style="justify-content: center; align-items: center; width: 150px; text-align:center">
@@ -397,25 +402,44 @@
</el-table-column> </el-table-column>
<!-- <el-table-column prop="shippingTime" header-align="center" align="center" label="发出时间"> <!-- <el-table-column prop="shippingTime" header-align="center" align="center" label="发出时间">
</el-table-column> --> </el-table-column> -->
<el-table-column prop="orderStatus" header-align="center" align="center" label="订单状态" width="80"> <el-table-column
v-if="tabChange.tabActiveName === '7' || tabChange.tabActiveName === '6'"
header-align="center"
align="left"
label="退款备注"
min-width="160"
show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.refundRemark || '—' }}</span>
</template>
</el-table-column>
<el-table-column prop="orderStatus" fixed="right" header-align="center" align="center" label="订单状态" width="90">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.orderStatus == 0" type="success">待付款</el-tag> <el-tag v-if="scope.row.orderStatus == 0" type="success">待付款</el-tag>
<el-tag v-if="scope.row.orderStatus == 1" type="success">待发出</el-tag> <el-tag v-if="scope.row.orderStatus == 1" type="success">待发出</el-tag>
<el-tag v-if="scope.row.orderStatus == 2" type="danger">已发出</el-tag> <el-tag v-if="scope.row.orderStatus == 2" type="danger">已发出</el-tag>
<el-tag v-if="scope.row.orderStatus == 3" type="warning">已完成</el-tag> <el-tag v-if="scope.row.orderStatus == 3" type="warning">已完成</el-tag>
<el-tag v-if="scope.row.orderStatus == 4" type="info">交易失败</el-tag> <el-tag v-if="scope.row.orderStatus == 4" type="info">交易失败</el-tag>
<el-tag v-if="scope.row.orderStatus == 7" type="warning">退款中</el-tag>
<el-tag v-if="scope.row.orderStatus == 6" type="info">已退款</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="successTime" header-align="center" align="center" label="交易成功时间"> <!-- <el-table-column prop="successTime" header-align="center" align="center" label="交易成功时间">
</el-table-column> --> </el-table-column> -->
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作"> <el-table-column fixed="right" header-align="center" align="center" width="220" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<router-link <div style="display: flex; flex-direction: column; align-items: center; line-height: 1.6;">
:to="{ path: 'order-buyorderdetail', query: { orderSn: scope.row.orderSn, ordertype: scope.row.orderStatus} }"> <router-link
<el-button type="text" size="small">订单详情</el-button> :to="{ path: 'order-buyorderdetail', query: { orderSn: scope.row.orderSn, ordertype: scope.row.orderStatus} }">
</router-link> <el-button type="text" size="small">订单详情</el-button>
<el-button type="text" size="small" @click="deleteOrder(scope.row)" v-if="tabChange.tabActiveName == 0&&tabChange.tabActiveName != ''" </router-link>
style="color: #f11f3b;">删除</el-button> <el-button v-if="rowRefundable(scope.row)" type="text" size="small" style="color: #e6a23c;"
@click="openRefundApply(scope.row)">申请退款</el-button>
<el-button v-if="scope.row.orderStatus == 7 || scope.row.orderStatus == 6" type="text" size="small"
style="color: #409eff;" @click="openRefundDetail(scope.row)">钱款去向</el-button>
<el-button type="text" size="small" @click="deleteOrder(scope.row)" v-if="tabChange.tabActiveName == 0&&tabChange.tabActiveName != ''"
style="color: #f11f3b;">删除</el-button>
</div>
<!-- <span v-if="scope.row.orderStatus"> <!-- <span v-if="scope.row.orderStatus">
<el-button type="text" size="small" @click="deliverDetail(scope.row)" <el-button type="text" size="small" @click="deliverDetail(scope.row)"
v-if="isAuth('book:buyorderdetail:deliver')">物流详情</el-button> v-if="isAuth('book:buyorderdetail:deliver')">物流详情</el-button>
@@ -507,6 +531,64 @@
<el-button type="primary" @click="booksHandleClose"> </el-button> <el-button type="primary" @click="booksHandleClose"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="申请退款" :visible.sync="refundApplyVisible" width="480px" append-to-body
@close="refundApplyDialogClose">
<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="退款备注">
<el-input v-model="refundApplyForm.refundRemark" type="textarea" :rows="4" placeholder="请输入退款备注"
maxlength="500" show-word-limit></el-input>
</el-form-item>
</el-form>
<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>
<div v-loading="refundDetailLoading" class="refund-detail-dialog">
<div class="refund-total-card">
<div class="refund-total-label">退款金额</div>
<div class="refund-total-value">{{ formatMoney(refundDetail.refundFee) }}</div>
</div>
<div class="refund-amount-card">
<div class="refund-amount-item" v-for="(item, idx) in refundAmountItems" :key="idx">
<span>{{ item.label }}</span>
<span :class="item.valueClass">{{ item.value }}</span>
</div>
<div v-if="refundAmountItems.length === 0" class="refund-empty-text">暂无金额明细</div>
</div>
<div class="refund-flow-card">
<el-timeline v-if="refundFlowList.length > 0">
<el-timeline-item v-for="(item, idx) in refundFlowList" :key="idx" :timestamp="item.createTime">
<div class="refund-flow-title">{{ item.title }}</div>
<div class="refund-flow-content">{{ item.content }}</div>
</el-timeline-item>
</el-timeline>
<div v-if="refundFlowList.length === 0" class="refund-empty-text">暂无退款进度</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="refundDetailVisible = false"> </el-button>
</span>
</el-dialog>
<el-pagination v-if="tabChange.isPrint != 1" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" <el-pagination v-if="tabChange.isPrint != 1" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
:current-page="pageIndex" :page-sizes="[20, 40, 60, 100, 150]" :page-size="pageSize" :total="totalPage" :current-page="pageIndex" :page-sizes="[20, 40, 60, 100, 150]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
@@ -584,7 +666,7 @@
sheetVisible: false, sheetVisible: false,
dataList: [], dataList: [],
tabChange: { tabChange: {
tabActiveName: '', // tab筛选默认all全部 0待付款 1待发出 2已发出 3已完成 tabActiveName: '', // tab筛选默认all全部 0待付款 1待发出 2已发出 3已完成 7退款中 6已退款
isPrint: 0, // 已发出列表筛选 0显示订单 1显示可打印列表, isPrint: 0, // 已发出列表筛选 0显示订单 1显示可打印列表,
orderName: '0', //订单名称筛选 all:全部 0:健康超市 1:电子书 2:充值订单 orderName: '0', //订单名称筛选 all:全部 0:健康超市 1:电子书 2:充值订单
sheetCode: 2, // 面单状态2 未打印1 已打印 0全部 sheetCode: 2, // 面单状态2 未打印1 已打印 0全部
@@ -594,6 +676,18 @@
text: '', text: '',
orderId: '' orderId: ''
}, },
refundApplyVisible: false,
refundApplySubmitting: false,
refundApplyOrder: {},
refundApplyForm: {
refundShipping: 0,
refundRemark: ''
},
refundDetailVisible: false,
refundDetailLoading: false,
refundDetail: {},
refundFlowList: [],
refundAmountItems: [],
pageIndex: 1, pageIndex: 1,
sheetPageIndex: 1, sheetPageIndex: 1,
pageSize: 20, pageSize: 20,
@@ -698,6 +792,40 @@
this.isMultipleDisabled() 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: { methods: {
computedVipType(userVips) { computedVipType(userVips) {
if (!userVips || userVips.length === 0) return ''; if (!userVips || userVips.length === 0) return '';
@@ -1084,6 +1212,139 @@
}) })
}) })
}, },
rowRefundable(row) {
if (!row) return false
const v = row.refundableStatus
return v === true || v === 1 || v === '1' || v === 'true'
},
openRefundApply(row) {
this.refundApplyOrder = row || {}
this.refundApplyForm = {
refundShipping: 0,
refundRemark: ''
}
this.refundApplyVisible = true
this.$nextTick(() => {
if (this.$refs.refundApplyFormRef) {
this.$refs.refundApplyFormRef.clearValidate()
}
})
},
refundApplyDialogClose() {
this.refundApplyOrder = {}
},
refundApplySubmit() {
const orderId = this.refundApplyOrder.orderId
if (!orderId) {
this.$message.error('订单信息异常')
return
}
this.refundApplySubmitting = true
this.$http({
url: this.$http.adornUrl('/book/buyOrder/refundOrder'),
method: 'post',
data: this.$http.adornData({
orderId: orderId,
deductShipping: this.refundApplyForm.refundShipping,
remark: this.refundApplyForm.refundRemark
})
}).then(({ data }) => {
this.refundApplySubmitting = false
if (data && data.code === 0) {
this.$message.success('提交成功')
this.refundApplyVisible = false
this.getDataList()
} else {
this.$message.error((data && data.msg) || '提交失败')
}
}).catch(() => {
this.refundApplySubmitting = false
})
},
formatMoney(value) {
const n = Number(value)
if (isNaN(n)) return '0.00'
return n.toFixed(2)
},
hasAmount(value) {
if (value === null || value === undefined || value === '') return false
const n = Number(value)
return !isNaN(n) && n !== 0
},
payTypeLabel(payType) {
const map = {
1: '微信',
2: '支付宝',
3: 'ios内购',
4: '天医币'
}
return map[payType] || '其他'
},
buildRefundAmountItems(detail, row) {
const amountItems = []
const payType = Number(detail.payType || row.paymentMethod || row.payType)
const payMoney = detail.refundFee
const orderMoney = detail.orderMoney || row.orderMoney
const shippingMoney = detail.shippingMoney || row.shippingMoney
if (this.hasAmount(orderMoney)) {
amountItems.push({
label: '订单支付金额',
value: `${this.formatMoney(orderMoney)}`
})
}
if (this.hasAmount(detail.shippingMoney)) {
amountItems.push({
label: '运费金额',
value: `-¥${this.formatMoney(shippingMoney)}`,
valueClass: 'refund-amount-orange'
})
}
if (this.hasAmount(payMoney)) {
amountItems.push({
label: `${this.payTypeLabel(payType)}退回`,
value: `${this.formatMoney(payMoney)}`,
valueClass: 'refund-amount-green'
})
}
if (this.hasAmount(detail.refundJf)) {
amountItems.push({
label: '积分退回',
value: `${Number(detail.refundJf)}`,
valueClass: 'refund-amount-green'
})
}
return amountItems
},
openRefundDetail(row) {
if (!row || !row.orderId) {
this.$message.error('订单信息异常')
return
}
this.refundDetailVisible = true
this.refundDetailLoading = true
this.refundDetail = {}
this.refundFlowList = []
this.refundAmountItems = []
this.$http({
url: this.$http.adornUrl('/book/buyOrder/refundDetail'),
method: 'post',
data: this.$http.adornData({
orderId: row.orderId
})
}).then(({ data }) => {
this.refundDetailLoading = false
if (data && data.code === 0) {
const detail = data.info || {}
this.refundDetail = detail
this.refundFlowList = Array.isArray(detail.list) ? detail.list : []
this.refundAmountItems = this.buildRefundAmountItems(detail, row)
} else {
this.$message.error((data && data.msg) || '查询失败')
}
}).catch(() => {
this.refundDetailLoading = false
})
},
// 删除订单 // 删除订单
deleteOrder(row) { deleteOrder(row) {
this.$confirm(`确定对订单编号${row.orderSn}进行删除操作?`, '提示', { this.$confirm(`确定对订单编号${row.orderSn}进行删除操作?`, '提示', {
@@ -1389,7 +1650,7 @@
//console.log(val) //console.log(val)
this.getDataList() this.getDataList()
if (this.tabChange.tabActiveName === '' || this.tabChange.tabActiveName === '0' || this.tabChange if (this.tabChange.tabActiveName === '' || this.tabChange.tabActiveName === '0' || this.tabChange
.tabActiveName === '1' || this.tabChange.tabActiveName === '3') { .tabActiveName === '1' || this.tabChange.tabActiveName === '3' || this.tabChange.tabActiveName === '7' || this.tabChange.tabActiveName === '6') {
this.tabChange.isPrint = '0' this.tabChange.isPrint = '0'
} }
if (this.tabChange.isPrint === '1') { if (this.tabChange.isPrint === '1') {
@@ -1712,4 +1973,145 @@
line-height: 28px; line-height: 28px;
font-size: 12px; 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;
border-radius: 8px;
padding: 16px;
text-align: center;
margin-bottom: 12px;
}
.refund-total-label {
color: #909399;
font-size: 14px;
margin-bottom: 8px;
}
.refund-total-value {
font-size: 40px;
font-weight: 600;
color: #303133;
line-height: 1;
}
.refund-amount-card,
.refund-flow-card {
background: #f5f7fa;
border-radius: 8px;
padding: 10px 14px;
margin-bottom: 12px;
}
.refund-flow-card {
padding: 20px;
.el-timeline {
padding-left: 0;
/deep/ .el-timeline-item__node--normal {
left: 0;
}
}
}
.refund-amount-item {
display: flex;
justify-content: space-between;
line-height: 34px;
border-bottom: 1px solid #e4e7ed;
color: #303133;
font-size: 14px;
&:last-child {
border-bottom: none;
}
}
.refund-amount-highlight {
color: #13ce66;
}
.refund-amount-green {
color: #13ce66;
}
.refund-amount-orange {
color: #e6a23c;
}
.refund-flow-title {
color: #303133;
font-size: 16px;
margin-bottom: 4px;
}
.refund-flow-time {
color: #909399;
font-size: 13px;
margin-bottom: 6px;
}
.refund-flow-content {
color: #606266;
font-size: 14px;
line-height: 20px;
}
/deep/ .el-timeline-item__timestamp {
color: #909399;
font-size: 13px;
}
/deep/ .el-timeline-item__node {
width: 10px;
height: 10px;
}
.refund-empty-text {
color: #909399;
text-align: center;
line-height: 30px;
font-size: 13px;
}
}
</style> </style>

View File

@@ -14,6 +14,12 @@
<span v-if="orderDetails.orderStatus == 3" class="item hightLight3" <span v-if="orderDetails.orderStatus == 3" class="item hightLight3"
>已完成</span >已完成</span
> >
<span v-if="orderDetails.orderStatus == 7" class="item hightLight7"
>退款中</span
>
<span v-if="orderDetails.orderStatus == 6" class="item hightLight6"
>已退款</span
>
</div> </div>
<div> <div>
<ul class="list"> <ul class="list">
@@ -56,6 +62,12 @@
<span v-if="orderDetails.orderStatus == 3" class="hightLight" <span v-if="orderDetails.orderStatus == 3" class="hightLight"
>已完成</span >已完成</span
> >
<span v-if="orderDetails.orderStatus == 7" class="hightLight"
>退款中</span
>
<span v-if="orderDetails.orderStatus == 6" class="hightLight"
>已退款</span
>
<!-- <el-button v-if="orderDetails.orderStatus == 1" @click="godeliver" class="text_button" size="mini" type="text">去发出</el-button> --> <!-- <el-button v-if="orderDetails.orderStatus == 1" @click="godeliver" class="text_button" size="mini" type="text">去发出</el-button> -->
</li> </li>
<!-- <li><span class="infoTitle">商品总数</span><span>{{orderDetails.}}</span></li> --> <!-- <li><span class="infoTitle">商品总数</span><span>{{orderDetails.}}</span></li> -->
@@ -1156,6 +1168,14 @@ export default {
.hightLight3 { .hightLight3 {
background-color: #67c23a; background-color: #67c23a;
} }
.hightLight7 {
background-color: #f56c6c;
}
.hightLight6 {
background-color: #f56c6c;
}
} }
.noinfo { .noinfo {

View File

@@ -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>

View File

@@ -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({

View File

@@ -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({

View File

@@ -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({

View File

@@ -45,7 +45,7 @@
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@click="getDataList" @click="handleRefresh"
>刷新</el-button> >刷新</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@@ -59,11 +59,13 @@
<div class="table-container" ref="tableContainer"> <div class="table-container" ref="tableContainer">
<el-table <el-table
ref="dataTable"
:data="dataList" :data="dataList"
border border
:header-cell-style="{ textAlign: 'center' }" :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"
:max-height="tableHeight" :max-height="tableHeight"
@sort-change="handleSortChange"
> >
<el-table-column prop="courseTitle" label="课程名称" min-width="150" /> <el-table-column prop="courseTitle" label="课程名称" min-width="150" />
<el-table-column prop="catalogueTitle" label="目录名" min-width="150" /> <el-table-column prop="catalogueTitle" label="目录名" min-width="150" />
@@ -71,10 +73,13 @@
<el-table-column <el-table-column
:label="timeType === 'year' ? '年销量' : '月销量'" :label="timeType === 'year' ? '年销量' : '月销量'"
prop="sales" prop="sales"
sortable="custom"
min-width="100" min-width="100"
/> />
<el-table-column <el-table-column
:label="timeType === 'year' ? '年销售额(微信+支付宝+银行+天医币)' : '月销售额(微信+支付宝+银行+天医币)'" :label="timeType === 'year' ? '年销售额(微信+支付宝+银行+天医币)' : '月销售额(微信+支付宝+银行+天医币)'"
prop="salesFee"
sortable="custom"
min-width="280" min-width="280"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@@ -83,6 +88,8 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="timeType === 'year' ? '年销售额(微信+支付宝+银行)' : '月销售额(微信+支付宝+银行)'" :label="timeType === 'year' ? '年销售额(微信+支付宝+银行)' : '月销售额(微信+支付宝+银行)'"
prop="cashFee"
sortable="custom"
min-width="250" min-width="250"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@@ -235,7 +242,9 @@ export default {
timeType: 'year', timeType: 'year',
currentDate: new Date(), currentDate: new Date(),
dataForm: { dataForm: {
courseTitle: '' courseTitle: '',
sortKey: '',
sortValue: ''
}, },
dataList: [], dataList: [],
yearDetailDataList: [], yearDetailDataList: [],
@@ -290,6 +299,19 @@ export default {
} }
this.getDataList() this.getDataList()
}, },
handleSortChange({ prop, order }) {
this.dataForm.sortKey = prop
this.dataForm.sortValue = order
this.getDataList()
},
handleRefresh() {
this.dataForm.sortKey = ''
this.dataForm.sortValue = ''
this.$nextTick(() => {
this.$refs.dataTable.clearSort()
})
this.getDataList()
},
getDataList() { getDataList() {
const dateStr = this.timeType === 'year' const dateStr = this.timeType === 'year'
? this.currentDate.getFullYear().toString() ? this.currentDate.getFullYear().toString()
@@ -301,7 +323,9 @@ export default {
date: dateStr, date: dateStr,
page: this.page, page: this.page,
limit: this.limit, limit: this.limit,
courseTitle: this.dataForm.courseTitle courseTitle: this.dataForm.courseTitle,
sortKey: this.dataForm.sortKey,
sortValue: this.dataForm.sortValue
}) })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {

View File

@@ -37,7 +37,7 @@
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@click="getDataList" @click="handleRefresh"
>刷新</el-button> >刷新</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@@ -51,17 +51,31 @@
<div class="table-container" ref="tableContainer"> <div class="table-container" ref="tableContainer">
<el-table <el-table
ref="dataTable"
:data="dataList" :data="dataList"
border border
:header-cell-style="{ textAlign: 'center' }" :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"
:max-height="tableHeight" :max-height="tableHeight"
@sort-change="handleSortChange"
> >
<el-table-column prop="courseLabel" label="分类" min-width="150" /> <el-table-column prop="courseLabel" label="分类" min-width="150" />
<el-table-column prop="courseCount" label="总销售门数" min-width="120" /> <el-table-column
<el-table-column prop="sales" label="总销量" min-width="100" /> prop="courseCount"
label="总销售门数"
sortable="custom"
min-width="120"
/>
<el-table-column
prop="sales"
label="总销量"
sortable="custom"
min-width="100"
/>
<el-table-column <el-table-column
:label="timeType === 'year' ? '年销售额(微信+支付宝+银行+天医币)' : '月销售额(微信+支付宝+银行+天医币)'" :label="timeType === 'year' ? '年销售额(微信+支付宝+银行+天医币)' : '月销售额(微信+支付宝+银行+天医币)'"
prop="salesFee"
sortable="custom"
min-width="280" min-width="280"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@@ -70,6 +84,8 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="timeType === 'year' ? '年销售额(微信+支付宝+银行)' : '月销售额(微信+支付宝+银行)'" :label="timeType === 'year' ? '年销售额(微信+支付宝+银行)' : '月销售额(微信+支付宝+银行)'"
prop="cashFee"
sortable="custom"
min-width="250" min-width="250"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@@ -89,7 +105,10 @@ export default {
return { return {
timeType: 'year', timeType: 'year',
currentDate: new Date(), currentDate: new Date(),
dataForm: {}, dataForm: {
sortKey: '',
sortValue: ''
},
dataList: [], dataList: [],
tableHeight: null tableHeight: null
} }
@@ -135,6 +154,19 @@ export default {
} }
this.getDataList() this.getDataList()
}, },
handleSortChange({ prop, order }) {
this.dataForm.sortKey = prop
this.dataForm.sortValue = order
this.getDataList()
},
handleRefresh() {
this.dataForm.sortKey = ''
this.dataForm.sortValue = ''
this.$nextTick(() => {
this.$refs.dataTable.clearSort()
})
this.getDataList()
},
getDataList() { getDataList() {
const dateStr = this.timeType === 'year' const dateStr = this.timeType === 'year'
? this.currentDate.getFullYear().toString() ? this.currentDate.getFullYear().toString()
@@ -143,7 +175,9 @@ export default {
url: http.adornUrl('/master/statisticsBusiness/getCourseSaleInfoByCourseLabel'), url: http.adornUrl('/master/statisticsBusiness/getCourseSaleInfoByCourseLabel'),
method: 'post', method: 'post',
data: http.adornData({ data: http.adornData({
date: dateStr date: dateStr,
sortKey: this.dataForm.sortKey,
sortValue: this.dataForm.sortValue
}) })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {

View File

@@ -21,8 +21,8 @@
</el-form> </el-form>
</div> </div>
<div class="summary-section"> <div v-if="mode !== 'null'" class="summary-section">
<div class="summary-card"> <div v-if="showLoginAnd30DaySummary" class="summary-card">
<div class="summary-card__label">{{ timePrefix }}登录人数</div> <div class="summary-card__label">{{ timePrefix }}登录人数</div>
<div class="summary-card__value">{{ summary.loginCount }}</div> <div class="summary-card__value">{{ summary.loginCount }}</div>
</div> </div>
@@ -30,7 +30,7 @@
<div class="summary-card__label">{{ timePrefix }}注册人数</div> <div class="summary-card__label">{{ timePrefix }}注册人数</div>
<div class="summary-card__value">{{ summary.createCount }}</div> <div class="summary-card__value">{{ summary.createCount }}</div>
</div> </div>
<div class="summary-card"> <div v-if="showLoginAnd30DaySummary" class="summary-card">
<div class="summary-card__label">截止今日 近30天内活跃人数</div> <div class="summary-card__label">截止今日 近30天内活跃人数</div>
<div class="summary-card__value">{{ summary.userCountFor30Day }}</div> <div class="summary-card__value">{{ summary.userCountFor30Day }}</div>
</div> </div>
@@ -51,7 +51,7 @@
<el-table <el-table
:data="tableData" :data="tableData"
border border
:height="mode !== 'null' ? 470 : 520" :height="mode !== 'null' ? 470 : 640"
:header-cell-style="{ textAlign: 'center', padding: '6px 0' }" :header-cell-style="{ textAlign: 'center', padding: '6px 0' }"
:cell-style="{ textAlign: 'center', padding: '6px 0' }" :cell-style="{ textAlign: 'center', padding: '6px 0' }"
> >
@@ -172,11 +172,14 @@ export default {
return this.displayFormat return this.displayFormat
}, },
timePrefix() { timePrefix() {
// if (this.mode === 'day') return '当日' if (this.mode === 'day') return '当日'
// if (this.mode === 'month') return '当月' if (this.mode === 'month') return '当月'
// if (this.mode === 'year') return '当年' if (this.mode === 'year') return '当年'
return '当日' return '当日'
}, },
showLoginAnd30DaySummary() {
return this.mode === 'day'
},
pickerOptions() { pickerOptions() {
return { return {
disabledDate(time) { disabledDate(time) {

View File

@@ -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
} }

View File

@@ -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
} }

View File

@@ -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),

View File

@@ -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 '--'
}

View File

@@ -1,10 +1,11 @@
const TYPE_ORDER = [ const TYPE_ORDER = [
'中医学', '中医学',
'中西汇通学', '中西汇通学',
'肿瘤学',
'针灸学', '针灸学',
'心理学', '肿瘤学',
'妇幼生殖',
'国学', '国学',
'心理学',
'医学超级', '医学超级',
'心理国学超级' '心理国学超级'
] ]

View File

@@ -858,7 +858,7 @@ export default {
data: this.$http.adornData({}), data: this.$http.adornData({}),
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { 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); this.svipList = data.vipBuyConfigList.filter(item => item.type === 1 || item.type === 2);
} }
}); });

View File

@@ -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 转为数组形式,以便处理(如果是数字则转为数字数组)

View File

@@ -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: [],

View File

@@ -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"

View File

@@ -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"

View File

@@ -6,7 +6,8 @@
// api接口请求地址 // api接口请求地址
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境 // window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; // 川 // window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; // 川
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.131:9200/pb'; // 楠
// cdn地址 = 域名 + 版本号 // cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名 window.SITE_CONFIG['domain'] = './'; // 域名