3 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
7 changed files with 429 additions and 29 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

@@ -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'] = './'; // 域名