5 Commits

Author SHA1 Message Date
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
15 changed files with 849 additions and 65 deletions

View File

@@ -23,7 +23,7 @@ module.exports = {
},
// 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
autoOpenBrowser: 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-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-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: '/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 } },

View File

@@ -43,6 +43,16 @@ export default {
updateMainTabs (state, 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) {
state.mainTabsActiveName = name
}

View File

@@ -132,15 +132,11 @@ export default {
};
this.mainTabs = this.mainTabs.concat(tab);
} else {
// this.mainTabs = this.mainTabs.concat({
// ...tab,
// 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.$store.commit("common/updateMainTabRoute", {
name: route.name,
query: route.query,
params: route.params
});
}
this.menuActiveName = tab.menuId + "";
this.mainTabsActiveName = tab.name;

View File

@@ -1,7 +1,7 @@
<template>
<el-dialog
width="1260px"
:title="!dataForm.id ? '新增' : '修改'"
title="修改"
:close-on-click-modal="false"
:visible.sync="visible"
@close="handlereset"
@@ -16,13 +16,6 @@
ref="dataForm"
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-select v-model="dataForm.type" placeholder="请选择分类" clearable>
<el-option
@@ -45,7 +38,7 @@
</template>
<script>
import global from "../../common/common.vue"; //引入共用组间
import global from "../../common/common.vue";
export default {
data() {
return {
@@ -56,21 +49,15 @@ export default {
typeList: [],
dataForm: {
id: null,
title: '',
url: '',
type: ''
type: ""
},
dataRule: {
type: [
{ required: true, message: "分类不能为空", trigger: "change" }
],
url: [
{ required: true, message: "链接地址不能为空", trigger: "change" }
]
},
urlList: {
info: "/master/message/getMessageById",
add: "/common/wxPublicAccount/addWxPublicAccountArticle",
update: "/common/wxPublicAccount/updateWxPublicAccountArticle"
}
};
@@ -92,8 +79,7 @@ export default {
this.getTypeList();
this.dataForm = {
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.$nextTick(() => {
@@ -102,22 +88,24 @@ export default {
}
});
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
// 这里应该是提交数据的逻辑
const loading = this.$loading({
lock: true,
fullscreen: true
});
this.$http
.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",
data: this.dataForm,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
.then(({ data }) => {
loading.close();
if (data && data.code === 0) {
this.$message({
message: "操作成功",
@@ -131,6 +119,9 @@ export default {
} else {
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 type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button type="primary" @click="syncHandle()">同步</el-button>
</el-form-item>
</el-form>
<div style="height: calc(100% - 80px );">
@@ -131,7 +131,13 @@
</el-pagination>
</div>
<!-- 弹窗, 新增 / 修改 -->
<!-- 弹窗同步 -->
<psychological-forum-add
v-if="addVisible"
ref="psychologicalForumAdd"
@refreshDataList="getDataList"
></psychological-forum-add>
<!-- 弹窗修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@@ -142,6 +148,7 @@
<script>
import AddOrUpdate from "./psychologicalForum-add-or-update";
import PsychologicalForumAdd from "./psychologicalForum-add";
export default {
data() {
return {
@@ -162,6 +169,7 @@ export default {
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addVisible: false,
addOrUpdateVisible: false,
urlList: {
list: "/common/wxPublicAccount/getWxPublicAccountArticleList"
@@ -169,7 +177,8 @@ export default {
};
},
components: {
AddOrUpdate
AddOrUpdate,
PsychologicalForumAdd
},
activated() {
if (this.$route.query.upPageInde != null) {
@@ -242,7 +251,13 @@ export default {
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// 新增 / 修改
syncHandle() {
this.addVisible = true;
this.$nextTick(() => {
this.$refs.psychologicalForumAdd.init();
});
},
// 修改
addOrUpdateHandle(row) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {

View File

@@ -210,7 +210,7 @@
fixed="right"
header-align="center"
align="center"
width="280"
width="360"
label="操作"
>
<template slot-scope="scope">
@@ -280,6 +280,13 @@
<!-- </el-dropdown-menu>
</el-dropdown> -->
</div>
<div>
<el-button
type="text"
size="small"
@click="showCoursePurchaseDetails(scope.row)"
>查看购课明细</el-button>
</div>
</template>
</el-table-column>
</el-table>
@@ -872,6 +879,31 @@ export default {
this.$forceUpdate();
// 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) {
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

@@ -13,6 +13,8 @@
<el-radio-button label="1">待发出</el-radio-button>
<el-radio-button label="2">已发出</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>
<div class="order_type_block">
@@ -255,6 +257,9 @@
<div><el-button style=" line-height: 6px;" type="primary" size="mini"
@click="orderDeliver(fitem)">发出</el-button>
</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 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 prop="shippingTime" header-align="center" align="center" label="发出时间">
</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">
<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 == 2" type="danger">已发出</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 == 7" type="warning">退款中</el-tag>
<el-tag v-if="scope.row.orderStatus == 6" type="info">已退款</el-tag>
</template>
</el-table-column>
<!-- <el-table-column prop="successTime" header-align="center" align="center" label="交易成功时间">
</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">
<router-link
:to="{ path: 'order-buyorderdetail', query: { orderSn: scope.row.orderSn, ordertype: scope.row.orderStatus} }">
<el-button type="text" size="small">订单详情</el-button>
</router-link>
<el-button type="text" size="small" @click="deleteOrder(scope.row)" v-if="tabChange.tabActiveName == 0&&tabChange.tabActiveName != ''"
style="color: #f11f3b;">删除</el-button>
<div style="display: flex; flex-direction: column; align-items: center; line-height: 1.6;">
<router-link
:to="{ path: 'order-buyorderdetail', query: { orderSn: scope.row.orderSn, ordertype: scope.row.orderStatus} }">
<el-button type="text" size="small">订单详情</el-button>
</router-link>
<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">
<el-button type="text" size="small" @click="deliverDetail(scope.row)"
v-if="isAuth('book:buyorderdetail:deliver')">物流详情</el-button>
@@ -507,6 +531,52 @@
<el-button type="primary" @click="booksHandleClose"> </el-button>
</span>
</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-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">
<el-button @click="refundApplyVisible = false"> </el-button>
<el-button type="primary" :loading="refundApplySubmitting" @click="refundApplySubmit"> </el-button>
</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"
:current-page="pageIndex" :page-sizes="[20, 40, 60, 100, 150]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
@@ -584,7 +654,7 @@
sheetVisible: false,
dataList: [],
tabChange: {
tabActiveName: '', // tab筛选默认all全部 0待付款 1待发出 2已发出 3已完成
tabActiveName: '', // tab筛选默认all全部 0待付款 1待发出 2已发出 3已完成 7退款中 6已退款
isPrint: 0, // 已发出列表筛选 0显示订单 1显示可打印列表,
orderName: '0', //订单名称筛选 all:全部 0:健康超市 1:电子书 2:充值订单
sheetCode: 2, // 面单状态2 未打印1 已打印 0全部
@@ -594,6 +664,18 @@
text: '',
orderId: ''
},
refundApplyVisible: false,
refundApplySubmitting: false,
refundApplyOrder: {},
refundApplyForm: {
refundShipping: 0,
refundRemark: ''
},
refundDetailVisible: false,
refundDetailLoading: false,
refundDetail: {},
refundFlowList: [],
refundAmountItems: [],
pageIndex: 1,
sheetPageIndex: 1,
pageSize: 20,
@@ -1084,6 +1166,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) {
this.$confirm(`确定对订单编号${row.orderSn}进行删除操作?`, '提示', {
@@ -1389,7 +1604,7 @@
//console.log(val)
this.getDataList()
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'
}
if (this.tabChange.isPrint === '1') {
@@ -1712,4 +1927,107 @@
line-height: 28px;
font-size: 12px;
}
.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>

View File

@@ -14,6 +14,12 @@
<span v-if="orderDetails.orderStatus == 3" class="item hightLight3"
>已完成</span
>
<span v-if="orderDetails.orderStatus == 7" class="item hightLight7"
>退款中</span
>
<span v-if="orderDetails.orderStatus == 6" class="item hightLight6"
>已退款</span
>
</div>
<div>
<ul class="list">
@@ -56,6 +62,12 @@
<span v-if="orderDetails.orderStatus == 3" class="hightLight"
>已完成</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> -->
</li>
<!-- <li><span class="infoTitle">商品总数</span><span>{{orderDetails.}}</span></li> -->
@@ -1156,6 +1168,14 @@ export default {
.hightLight3 {
background-color: #67c23a;
}
.hightLight7 {
background-color: #f56c6c;
}
.hightLight6 {
background-color: #f56c6c;
}
}
.noinfo {

View File

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

View File

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

View File

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

View File

@@ -6,7 +6,8 @@
// api接口请求地址
// 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地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名