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": {
"@babel/core": "7.0.0",
"@babel/register": "7.0.0",
"@types/minimatch": "^6.0.0",
"@vue/cli-plugin-babel": "3.6.0",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.6.3",

View File

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

View File

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