|
|
@@ -553,6 +553,35 @@
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
</el-table>
|
|
|
|
|
|
+ <div style="margin-top: 20px">
|
|
|
+ <span class="font-small">积分明细</span>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="integralLogs"
|
|
|
+ size="small"
|
|
|
+ style="width: 100%;margin-top: 20px"
|
|
|
+ empty-text="该订单暂无积分变动记录">
|
|
|
+ <el-table-column label="类型" align="center" min-width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="mini" :type="scope.row.integral >= 0 ? 'success' : 'danger'">
|
|
|
+ {{ formatLogType(scope.row.logType) }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="积分变动" align="center" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span :style="{ color: scope.row.integral >= 0 ? '#67C23A' : '#F56C6C', fontWeight: 'bold' }">
|
|
|
+ {{ scope.row.integral >= 0 ? '+' + scope.row.integral : scope.row.integral }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="变动后余额" align="center" prop="balance" width="120" />
|
|
|
+ <el-table-column label="业务订单ID" align="center" prop="businessId" width="140" />
|
|
|
+ <el-table-column label="时间" align="center" prop="createTime" width="160" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
|
|
+ </el-table>
|
|
|
+
|
|
|
<div style="margin-top: 20px">
|
|
|
<span class="font-small">审批信息</span>
|
|
|
</div>
|
|
|
@@ -760,6 +789,7 @@ import {auditPayRemain,addTuiMoney,syncExpress,updateExpress,getEroOrder,refundO
|
|
|
getStoreOrderPhone,getCommentInfo,updateCommentInfo} from "@/api/hisStore/storeOrder";
|
|
|
import { getOrderPromotionDetail } from "@/api/hisStore/storePromotion";
|
|
|
import { getTcmScheduleList } from "@/api/company/schedule";
|
|
|
+import { getIntegralLogsByOrderId } from "@/api/his/userIntegralLogs";
|
|
|
export default {
|
|
|
name: "order",
|
|
|
data() {
|
|
|
@@ -837,6 +867,9 @@ export default {
|
|
|
auditLogs: [],
|
|
|
storeScrm: null,
|
|
|
orderPromotion: null,
|
|
|
+ integralLogs: [],
|
|
|
+ // 积分日志类型字典(字典 + 本地兜底,与 FsUserIntegralLogTypeEnum 对齐)
|
|
|
+ integralLogTypeOptions: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -862,6 +895,10 @@ export default {
|
|
|
getTcmScheduleList().then(response => {
|
|
|
this.scheduleOptions = response.data;
|
|
|
});
|
|
|
+ // 加载积分日志类型字典(合并本地兜底,确保所有已知 logType 都有中文名称)
|
|
|
+ this.getDicts("sys_integral_log_type").then((response) => {
|
|
|
+ this.integralLogTypeOptions = this.mergeLogTypeOptions(response.data || []);
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
formatPromotionDiscount(amount) {
|
|
|
@@ -1130,8 +1167,48 @@ export default {
|
|
|
this.tuiMoneyLogs=response.tuiMoneyLogs;
|
|
|
this.auditLogs = response.auditLogs;
|
|
|
this.loadOrderPromotion(orderId);
|
|
|
+ this.loadIntegralLogs(orderId);
|
|
|
});
|
|
|
},
|
|
|
+ // 加载积分明细
|
|
|
+ loadIntegralLogs(orderId) {
|
|
|
+ getIntegralLogsByOrderId(orderId).then(response => {
|
|
|
+ this.integralLogs = response.data || [];
|
|
|
+ }).catch(() => {
|
|
|
+ this.integralLogs = [];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 合并字典与本地兜底类型,确保所有已知 logType 都有对应名称 */
|
|
|
+ mergeLogTypeOptions(dictOptions) {
|
|
|
+ // 本地完整映射(与后端 FsUserIntegralLogTypeEnum 对齐),字典缺失时兜底
|
|
|
+ const localMap = {
|
|
|
+ 1: '签到获得积分', 2: '消费获得积分', 3: '分享获得积分', 4: '退款扣除积分',
|
|
|
+ 5: '购买积分商品', 6: '平台取消售后', 7: '积分过期', 8: '螳螂同步积分',
|
|
|
+ 9: '购买课程小节扣除', 10: '观看课程获取积分', 11: '新用户完善就诊人获得积分',
|
|
|
+ 12: '新用户填写收货地址获取积分', 13: '浏览商品获得积分', 14: '浏览视频获得积分',
|
|
|
+ 15: '首次下单疗法获得积分', 16: '点播看课获得积分', 17: '点播答题获得积分',
|
|
|
+ 18: '邀请新用户获取积分', 19: '填写邀请码获取积分', 20: '首次完成手机号绑定注册',
|
|
|
+ 21: '首次完成专家咨询', 22: '首次完成积分商城下单', 23: '管理员添加',
|
|
|
+ 24: '付费课程订阅', 25: '下单使用积分抵扣', 26: '取消订单退回积分', 27: '退款订单退回积分'
|
|
|
+ };
|
|
|
+ // 字典已有项优先,收集已有 value
|
|
|
+ const result = [...dictOptions];
|
|
|
+ const existValues = new Set(dictOptions.map(o => Number(o.dictValue)));
|
|
|
+ // 补充字典缺失的类型
|
|
|
+ Object.keys(localMap).forEach(key => {
|
|
|
+ const val = Number(key);
|
|
|
+ if (!existValues.has(val)) {
|
|
|
+ result.push({ dictValue: String(val), dictLabel: localMap[val] });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ },
|
|
|
+ /** 将 logType 数值转换为中文名称 */
|
|
|
+ formatLogType(logType) {
|
|
|
+ if (logType == null) return '-';
|
|
|
+ const item = this.integralLogTypeOptions.find(o => Number(o.dictValue) === Number(logType));
|
|
|
+ return item ? item.dictLabel : ('类型' + logType);
|
|
|
+ },
|
|
|
loadOrderPromotion(orderId) {
|
|
|
getOrderPromotionDetail(orderId).then(response => {
|
|
|
this.orderPromotion = response.data || null;
|