feat(订单详情页): 新增搜索条件“地区”,对接查询订单总数的接口

This commit is contained in:
hzj 2025-10-17 17:01:31 +08:00
parent 3ab78cdb57
commit c29dec3af6
3 changed files with 203 additions and 142 deletions

View File

@ -46,6 +46,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "7.0.0", "@babel/core": "7.0.0",
"@babel/register": "7.0.0", "@babel/register": "7.0.0",
"@types/minimatch": "^6.0.0",
"@vue/cli-plugin-babel": "3.6.0", "@vue/cli-plugin-babel": "3.6.0",
"@vue/cli-plugin-eslint": "^3.9.1", "@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.6.3", "@vue/cli-plugin-unit-jest": "3.6.3",

View File

@ -1,142 +1,153 @@
import request from "@/utils/request";
import request from '@/utils/request' import { httpGetExport } from "@/utils/export-excel";
import { httpGetExport } from '@/utils/export-excel'
// 今日内购总额 // 今日内购总额
export function purchaseTodayTotal(params) { export function purchaseTodayTotal(params) {
return request({ return request({
url: '/order/purchase/history/purchase/today/total', url: "/order/purchase/history/purchase/today/total",
method: 'get', method: "get",
params params
}) });
} }
// 今日内购总额 // 今日内购总额
export function purchaseTodayTotalBySysOrigin(sysOrigin) { export function purchaseTodayTotalBySysOrigin(sysOrigin) {
return request({ return request({
url: `/order/purchase/history/${sysOrigin}/purchase/today/total`, url: `/order/purchase/history/${sysOrigin}/purchase/today/total`,
method: 'get' method: "get"
}) });
} }
// 金币收支流水 // 金币收支流水
export function listGoldRunningWater(params) { export function listGoldRunningWater(params) {
return request({ return request({
url: '/user-wallet/gold/running-water/list', url: "/user-wallet/gold/running-water/list",
method: 'get', method: "get",
params params
}) });
} }
// 金币收支流水cls // 金币收支流水cls
export function getClsGoldRunningWater(params) { export function getClsGoldRunningWater(params) {
return request({ return request({
url: '/user-wallet/gold/running-water/cls', url: "/user-wallet/gold/running-water/cls",
method: 'get', method: "get",
params params
}) });
} }
// 用户购买总额 // 用户购买总额
export function getBuyTotalByUserId(userId) { export function getBuyTotalByUserId(userId) {
return request({ return request({
url: `/order/purchase/history/buy/total/${userId}`, url: `/order/purchase/history/buy/total/${userId}`,
method: 'get' method: "get"
}) });
} }
// 购买记录 // 购买记录
export function getPurchaseTable(params) { export function getPurchaseTable(params) {
return request({ return request({
url: '/order/purchase/history/page', url: "/order/purchase/history/page",
method: 'get', method: "get",
params params
}) });
} }
// 购买消耗类型列表 - 导出 // 购买消耗类型列表 - 导出
export function exportPurchaseConsumeTable(params, excelName) { export function exportPurchaseConsumeTable(params, excelName) {
return httpGetExport('/order/purchase/history/consume/export', params, excelName) return httpGetExport(
"/order/purchase/history/consume/export",
params,
excelName
);
} }
// 内购订单详情 // 内购订单详情
export function getInAppPurchase(id) { export function getInAppPurchase(id) {
return request({ return request({
url: '/order/in-app-purchase/details', url: "/order/in-app-purchase/details",
method: 'get', method: "get",
params: { id } params: { id }
}) });
} }
// 内购订单详情- list // 内购订单详情- list
export function listInAppPurchase(params) { export function listInAppPurchase(params) {
return request({ return request({
url: '/order/in-app-purchase/details/list', url: "/order/in-app-purchase/details/list",
method: 'get', method: "get",
params params
}) });
}
// 订单数量&总金额查询
export function getOrderAmount(params) {
return request({
url: "/order/in-app-purchase/statistics",
method: "get",
params
});
} }
// 获取异常订单日志列表 // 获取异常订单日志列表
export function getOrderAbnormalPage(params) { export function getOrderAbnormalPage(params) {
return request({ return request({
url: '/order/abnormal/log/page', url: "/order/abnormal/log/page",
method: 'get', method: "get",
params params
}) });
} }
// 获取异常订单日志,凭证 // 获取异常订单日志,凭证
export function getOrderAbnormalCertificate(id) { export function getOrderAbnormalCertificate(id) {
return request({ return request({
url: '/order/abnormal/log/certificate', url: "/order/abnormal/log/certificate",
method: 'get', method: "get",
params: { id } params: { id }
}) });
} }
// 修改异常订单日志,装态 // 修改异常订单日志,装态
export function updateOrderAbnormalStatus(params) { export function updateOrderAbnormalStatus(params) {
return request({ return request({
url: '/order/abnormal/log/status', url: "/order/abnormal/log/status",
method: 'put', method: "put",
params params
}) });
} }
// 订单补偿 // 订单补偿
export function orderPurchaseHistoryCompensate(data) { export function orderPurchaseHistoryCompensate(data) {
return request({ return request({
url: '/order/purchase/history/compensate', url: "/order/purchase/history/compensate",
method: 'post', method: "post",
data data
}) });
} }
// 补偿糖果 // 补偿糖果
export function compensateCandy(params) { export function compensateCandy(params) {
return request({ return request({
url: '/order/purchase/history/compensate/candy', url: "/order/purchase/history/compensate/candy",
method: 'post', method: "post",
params params
}) });
} }
// 其他支付订单分页 // 其他支付订单分页
export function orderOtherRechargePage(params) { export function orderOtherRechargePage(params) {
return request({ return request({
url: '/order/other-recharge/page', url: "/order/other-recharge/page",
method: 'get', method: "get",
params params
}) });
} }
// 处理订单信息-添加 // 处理订单信息-添加
export function orderOtherRechargeProcess(data) { export function orderOtherRechargeProcess(data) {
return request({ return request({
url: '/order/other-recharge/process', url: "/order/other-recharge/process",
method: 'post', method: "post",
data data
}) });
} }

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索栏 -->
<div class="filter-container"> <div class="filter-container">
<el-select <el-select
v-model="sysOrigins" v-model="sysOrigins"
@ -17,10 +18,8 @@
:value="item.value" :value="item.value"
> >
<span style="float: left;"> <span style="float: left;">
<sys-origin-icon <sys-origin-icon :icon="item.value" :desc="item.value"
:icon="item.value" /></span>
:desc="item.value"
/></span>
<span style="float: left;margin-left:10px">{{ item.label }}</span> <span style="float: left;margin-left:10px">{{ item.label }}</span>
</el-option> </el-option>
</el-select> </el-select>
@ -110,6 +109,21 @@
end-placeholder="结束日期" end-placeholder="结束日期"
/> />
</div> </div>
<el-select
v-model="listQuery.countryCode"
placeholder="地区"
clearable
style="width:150px;"
class="filter-item"
@change="handleSearch"
>
<el-option
v-for="(item, index) in regions"
:key="index"
:label="item.regionName"
:value="item.regionCode"
/>
</el-select>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
@ -120,6 +134,16 @@
搜索 搜索
</el-button> </el-button>
</div> </div>
<!-- 总信息 -->
<el-alert type="warning" :closable="false">
<strong
>当前查询到订单总数为:{{
total.totalOrderCount || "-"
}}订单总金额为:{{ total.totalAmountUsd || "-" }}</strong
>
</el-alert>
<!-- 表单 -->
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="list" :data="list"
@ -234,7 +258,8 @@
<el-tag <el-tag
v-if="statusMap[scope.row.details.status]" v-if="statusMap[scope.row.details.status]"
:type="statusMap[scope.row.details.status].tagType" :type="statusMap[scope.row.details.status].tagType"
>{{ statusMap[scope.row.details.status].lable }}</el-tag> >{{ statusMap[scope.row.details.status].lable }}</el-tag
>
<el-tag v-else type="info">未知</el-tag> <el-tag v-else type="info">未知</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -257,10 +282,9 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="50"> <el-table-column fixed="right" label="操作" align="center" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button type="text" @click="clickQueryDetails(scope.row)"
type="text" >详情</el-button
@click="clickQueryDetails(scope.row)" >
>详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -273,7 +297,8 @@
:disabled="loadMoreLoading" :disabled="loadMoreLoading"
:loading="loadMoreLoading" :loading="loadMoreLoading"
@click="clickLoadMore" @click="clickLoadMore"
>加载更多</el-button> >加载更多</el-button
>
</div> </div>
<in-app-purchase-details <in-app-purchase-details
@ -285,13 +310,20 @@
</template> </template>
<script> <script>
import { listInAppPurchase } from '@/api/purchase' import {
import { pickerOptions } from '@/constant/el-const' regionAssistConfigTable,
import { sysOriginPlatforms } from '@/constant/origin' updateRegionAssistConfig,
import { mapGetters } from 'vuex' addRegionAssistConfig,
import PlatformSvgIcon from '@/components/PlatformSvgIcon' deleteRegionAssistConfig,
import { originPlatforms } from '@/constant/origin' regionConfigTable
import InAppPurchaseDetails from '@/components/data/InAppPurchaseDetails' } from "@/api/sys";
import { listInAppPurchase, getOrderAmount } from "@/api/purchase";
import { pickerOptions } from "@/constant/el-const";
import { sysOriginPlatforms } from "@/constant/origin";
import { mapGetters } from "vuex";
import PlatformSvgIcon from "@/components/PlatformSvgIcon";
import { originPlatforms } from "@/constant/origin";
import InAppPurchaseDetails from "@/components/data/InAppPurchaseDetails";
export default { export default {
components: { PlatformSvgIcon, InAppPurchaseDetails }, components: { PlatformSvgIcon, InAppPurchaseDetails },
@ -305,79 +337,81 @@ export default {
sysOriginPlatforms, sysOriginPlatforms,
gameRedPacketReceivingUsers: false, gameRedPacketReceivingUsers: false,
roomDeatilsDrawerVisible: false, roomDeatilsDrawerVisible: false,
thatSelectedUserId: '', thatSelectedUserId: "",
pickerOptions, pickerOptions,
list: [], list: [],
notData: false, notData: false,
loadMoreLoading: false, loadMoreLoading: false,
checkList: [], checkList: [],
total: 0, total: {},
sysOrigins: [], sysOrigins: [],
regions: [], //
listQuery: { listQuery: {
limit: 20, limit: 20,
acceptUserId: '', acceptUserId: "",
factoryPlatform: '', factoryPlatform: "",
startTime: '', startTime: "",
endTime: '', endTime: "",
status: '', status: "",
sysOrigin: '', sysOrigin: "",
id: '', id: "",
orderId: '', orderId: "",
lastId: '', lastId: "",
receiptType: '', receiptType: "",
trackId: '' trackId: "",
countryCode: "" //
}, },
listLoading: false, listLoading: false,
rangeDate: '', rangeDate: "",
redPacketId: '', redPacketId: "",
searchLoading: false, searchLoading: false,
searchDisabled: false, searchDisabled: false,
receiptTypes: [ receiptTypes: [
{ name: '付款', value: 'PAYMENT' }, { name: "付款", value: "PAYMENT" },
{ name: '收款', value: 'RECEIPT' } { name: "收款", value: "RECEIPT" }
], ],
statusList: [ statusList: [
{ name: '创建付款', value: 'CREATE' }, { name: "创建付款", value: "CREATE" },
{ name: '支付成功', value: 'SUCCESS' }, { name: "支付成功", value: "SUCCESS" },
{ name: '支付失败', value: 'FAIL' }, { name: "支付失败", value: "FAIL" },
{ name: '取消支付', value: 'CANCEL' }, { name: "取消支付", value: "CANCEL" },
{ name: '交易被挂起', value: 'HANG' }, { name: "交易被挂起", value: "HANG" },
{ name: '退款', value: 'REFUND' } { name: "退款", value: "REFUND" }
], ],
statusMap: { statusMap: {
CREATE: { CREATE: {
tagType: '', tagType: "",
lable: '创建付款' lable: "创建付款"
}, },
SUCCESS: { SUCCESS: {
tagType: 'success', tagType: "success",
lable: '支付成功' lable: "支付成功"
}, },
FAIL: { FAIL: {
tagType: 'danger', tagType: "danger",
lable: '支付失败' lable: "支付失败"
}, },
CANCEL: { CANCEL: {
tagType: 'info', tagType: "info",
lable: '取消支付' lable: "取消支付"
}, },
HANG: { HANG: {
tagType: 'warning', tagType: "warning",
lable: '交易被挂起' lable: "交易被挂起"
}, },
REFUND: { REFUND: {
tagType: 'danger', tagType: "danger",
lable: '退款' lable: "退款"
} }
} }
} };
}, },
computed: { computed: {
...mapGetters(['permissionsSysOriginPlatforms']), ...mapGetters(["permissionsSysOriginPlatforms"]),
sysOriginStr() { sysOriginStr() {
return !this.sysOrigins || this.sysOrigins.length === 0 return !this.sysOrigins || this.sysOrigins.length === 0
? this.permissionsSysOriginPlatforms.map(item => item.value).join(',') ? this.permissionsSysOriginPlatforms.map(item => item.value).join(",")
: this.sysOrigins.join(',') : this.sysOrigins.join(",");
} }
}, },
@ -387,84 +421,99 @@ export default {
deep: true, deep: true,
handler(newVal) { handler(newVal) {
if (newVal && newVal.length > 0) { if (newVal && newVal.length > 0) {
this.listQuery.startTime = newVal[0] this.listQuery.startTime = newVal[0];
this.listQuery.endTime = newVal[1] this.listQuery.endTime = newVal[1];
return return;
} }
this.listQuery.startTime = '' this.listQuery.startTime = "";
this.listQuery.endTime = '' this.listQuery.endTime = "";
} }
} }
}, },
created() { created() {
const that = this const that = this;
const querySystem = this.permissionsSysOriginPlatforms[0] this.listRegion();
const querySystem = this.permissionsSysOriginPlatforms[0];
if (!querySystem) { if (!querySystem) {
return return;
} }
that.sysOrigins.push(querySystem.value) that.sysOrigins.push(querySystem.value);
that.renderData(true, true) that.renderData(true, true);
}, },
methods: { methods: {
//
listRegion() {
const that = this;
regionConfigTable({ sysOrigin: "LIKEI" })
.then(res => {
that.regions = res.body || [];
})
.catch(er => {});
},
renderData(isReset, isLoading) { renderData(isReset, isLoading) {
const that = this const that = this;
if (!that.sysOriginStr) { if (!that.sysOriginStr) {
return return;
} }
that.listQuery.sysOrigins = that.sysOriginStr that.listQuery.sysOrigins = that.sysOriginStr;
if (isReset === true) { if (isReset === true) {
that.list = [] that.list = [];
that.listQuery.lastId = '' that.listQuery.lastId = "";
} }
that.listLoading = isLoading that.listLoading = isLoading;
listInAppPurchase(that.listQuery) listInAppPurchase(that.listQuery)
.then(res => { .then(res => {
that.listLoading = false that.listLoading = false;
that.loadMoreLoading = false that.loadMoreLoading = false;
const { body } = res const { body } = res;
const list = body || [] const list = body || [];
that.notData = list.length <= 0 that.notData = list.length <= 0;
if (!that.notData) { if (!that.notData) {
that.list = that.list.concat(list) that.list = that.list.concat(list);
that.listQuery.lastId = that.list[that.list.length - 1].details.id that.listQuery.lastId = that.list[that.list.length - 1].details.id;
} }
}) })
.catch(er => { .catch(er => {
that.listLoading = false that.listLoading = false;
that.loadMoreLoading = false that.loadMoreLoading = false;
}) });
getOrderAmount(that.listQuery).then(res => {
const { body } = res;
that.total = body || {};
});
}, },
handleSearch() { handleSearch() {
this.searchLoading = true this.searchLoading = true;
this.renderData(true, true) this.renderData(true, true);
}, },
clickQueryDetails(row) { clickQueryDetails(row) {
this.inAppPurchaseDetailsVisible = true this.inAppPurchaseDetailsVisible = true;
this.thisRow = row this.thisRow = row;
}, },
changeSysorigin(val) { changeSysorigin(val) {
if (!val || val.length === 0) { if (!val || val.length === 0) {
this.sysOrigins = this.permissionsSysOriginPlatforms.map( this.sysOrigins = this.permissionsSysOriginPlatforms.map(
item => item.value item => item.value
) );
this.listRegion();
} }
}, },
queryRoomDetails(row) { queryRoomDetails(row) {
this.thatRow = row this.thatRow = row;
this.roomDeatilsDrawerVisible = true this.roomDeatilsDrawerVisible = true;
}, },
getReceiveUsersLength(row) { getReceiveUsersLength(row) {
return row.receiveUsers ? row.receiveUsers.length : 0 return row.receiveUsers ? row.receiveUsers.length : 0;
}, },
clickLoadMore() { clickLoadMore() {
const that = this const that = this;
that.loadMoreLoading = true that.loadMoreLoading = true;
that.renderData() that.renderData();
} }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.room-avatar { .room-avatar {