3 changed files with 360 additions and 0 deletions
@ -0,0 +1,34 @@ |
|||
import type { TagType } from "@/components/global/m_table"; |
|||
|
|||
export function OrderStatusOptions() { |
|||
return [ |
|||
{ value: 1, label: "待支付" }, |
|||
{ value: 2, label: "待审核" }, |
|||
{ value: 3, label: "完成关闭" }, |
|||
{ value: 4, label: "已完成" }, |
|||
{ value: 5, label: "已退回" }, |
|||
{ value: 6, label: "支付失败" }, |
|||
{ value: 7, label: "失败关闭" }, |
|||
{ value: 8, label: "待发送" }, |
|||
]; |
|||
} |
|||
export const IF_STATUS = [ |
|||
{ value: 1, label: "是", type: "success" }, |
|||
{ value: 2, label: "否", type: "danger" }, |
|||
] as TagType[]; |
|||
|
|||
export function RechargeOrderStatus() { |
|||
return [ |
|||
{ value: 1, label: "待支付" }, |
|||
{ value: 2, label: "已取消" }, |
|||
{ value: 3, label: "支付失败" }, |
|||
{ value: 4, label: "支付成功" }, |
|||
]; |
|||
} |
|||
|
|||
export const RECHARGE_STATUS = [ |
|||
{ value: 1, label: "待支付" }, |
|||
{ value: 2, label: "已取消" }, |
|||
{ value: 3, label: "支付失败" }, |
|||
{ value: 4, label: "支付成功" }, |
|||
] as TagType[]; |
@ -0,0 +1,315 @@ |
|||
<template> |
|||
<div class="full-page p-20 page-content" style="position: relative"> |
|||
<MTable |
|||
ref="table_ref" |
|||
:params="searchParam" |
|||
:columns="columns" |
|||
:table_config="table_config" |
|||
table_height="100%" |
|||
> |
|||
<template #table_form_content="{ form_param }"> |
|||
<el-form-item prop="orderNo" label="订单号"> |
|||
<el-input v-model="form_param.orderNo" /> |
|||
</el-form-item> |
|||
<el-form-item prop="pfOrderNum" label="平台订单号"> |
|||
<el-input v-model="form_param.pfOrderNum" /> |
|||
</el-form-item> |
|||
<el-form-item prop="userNo" label="用户ID"> |
|||
<el-input v-model="form_param.userNo" /> |
|||
</el-form-item> |
|||
<el-form-item prop="orderStatus" label="订单状态"> |
|||
<MSelection v-model="form_param.orderStatus" :optionEnumFn="RECHARGE_STATUS" /> |
|||
</el-form-item> |
|||
<el-form-item prop="payChannelType" label="支付通道"> |
|||
<MSelection v-model="form_param.payChannelType" :optionEnumFn="AppTypeOptions" /> |
|||
</el-form-item> |
|||
<el-form-item prop="adToken" label="渠道广告"> |
|||
<MSelection v-model="form_param.adToken" :optionEnumFn="getChannelPromotionOptions" /> |
|||
</el-form-item> |
|||
<el-form-item label="起止时间" prop="time_range"> |
|||
<ElDatePicker |
|||
v-model="form_param.time_range" |
|||
type="datetimerange" |
|||
start-placeholder="起点时间" |
|||
end-placeholder="终止时间" |
|||
:format="DEFAULT_TIME_FORMATTER" |
|||
:value-format="DEFAULT_TIME_FORMATTER" |
|||
/> |
|||
</el-form-item> |
|||
</template> |
|||
<template #operation_column="{ row }"> |
|||
</template> |
|||
</MTable> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup lang="tsx"> |
|||
import { ElCol, ElLink, ElPopper, ElRow, ElTree } from "element-plus"; |
|||
import { MIcon } from "@/components/global/m_icon"; |
|||
|
|||
import type { MTableInstance, TagType } from "@/components/global/m_table"; |
|||
import type { FormConfigPropType } from "@/components/global/m_form"; |
|||
import type { TableColumnType, TableType } from "@/components/global/m_table"; |
|||
|
|||
import { reactive, ref, unref, onMounted } from "vue"; |
|||
import { useRouter } from "vue-router"; |
|||
import { useRoute } from "vue-router"; |
|||
import { isArray } from "lodash"; |
|||
import moment from "moment"; |
|||
|
|||
import { IRechargeOrder, IRechargeOrderCount, FetchPageRechargeOrdersOfTime, deleteRechargeOrder } from "@/api/module/recharge_order"; |
|||
import { fetchPaymentChannelAll } from "@/api/module/payment_channel"; |
|||
import { fetchChannelPromotions } from "@/api/module/channel_promotion"; |
|||
import { AppTypeOptions, IF_STATUS, RechargePaymentStatusOptions } from "@/api/module/sys_dict"; |
|||
import { RECHARGE_STATUS } from "./enum"; |
|||
import { useHandleData } from "@/hooks/useHandleData"; |
|||
import { DEFAULT_TIME_FORMATTER } from "@/enum/formatter"; |
|||
|
|||
const route = useRoute(); |
|||
|
|||
// 支付渠道下拉 |
|||
var payChannelList: TagType[] = []; |
|||
const getPaymentChannelOptions= async () => { |
|||
const params: any = {}; |
|||
const { code, data } = await fetchPaymentChannelAll(params); |
|||
if (code) { |
|||
return []; |
|||
} |
|||
const list = data!.list.map((item:any) => ({ |
|||
value: item.id, |
|||
label: item.name, |
|||
})); |
|||
payChannelList.push(...list) |
|||
return list |
|||
}; |
|||
|
|||
// 推广渠道下拉 |
|||
var channelList: TagType[] = []; |
|||
const getChannelPromotionOptions= async () => { |
|||
const params: any = {}; |
|||
const { code, data } = await fetchChannelPromotions(params); |
|||
if (code) { |
|||
return []; |
|||
} |
|||
const list = data!.list.map((item:any) => ({ |
|||
value: item.adToken, |
|||
label: item.name, |
|||
})); |
|||
channelList.push(...list) |
|||
return list |
|||
}; |
|||
|
|||
interface FormParam { |
|||
time_range: [string, string]; |
|||
type: number | undefined; |
|||
code: string; |
|||
userNo:string; |
|||
} |
|||
|
|||
const getTimeRange = (): FormParam["time_range"] => [ |
|||
moment().startOf("day").format(DEFAULT_TIME_FORMATTER), |
|||
moment().endOf("day").format(DEFAULT_TIME_FORMATTER), |
|||
]; |
|||
|
|||
const searchParam = reactive<FormParam>({ |
|||
time_range: ["", ""], |
|||
type: undefined, |
|||
code: "", |
|||
userNo: "", |
|||
}); |
|||
|
|||
onMounted(() => { |
|||
getPaymentChannelOptions(); |
|||
const query = route.query as { user_no: string }; |
|||
if (!query.user_no) return; |
|||
searchParam.userNo = query.user_no; |
|||
handleGetData(); |
|||
}) |
|||
|
|||
const getDefaultValue = (): any => ({}); |
|||
|
|||
// 列表查询 |
|||
const table_config: TableType<IRechargeOrder> = { |
|||
handleLoadData: FetchPageRechargeOrdersOfTime, |
|||
handleProcseeData(data, set_pagination) { |
|||
if (!data) return []; |
|||
const { total, page: currentPage, limit: pageSize } = data; |
|||
set_pagination({ pageSize, currentPage, total }); |
|||
return isArray(data.list) ? data.list : []; |
|||
}, |
|||
handleProcessParam: (param, pagenation) => { |
|||
const params: Record<string, any> = { |
|||
...param, |
|||
page: pagenation.currentPage, |
|||
limit: pagenation.pageSize, |
|||
}; |
|||
if (isArray(param.time_range) && param.time_range.every((v) => v)) { |
|||
params.startTime = moment(param.time_range[0]).valueOf() / 1000; |
|||
params.endTime = moment(param.time_range[1]).valueOf() / 1000; |
|||
} |
|||
return params; |
|||
}, |
|||
defaultValue: "-", |
|||
}; |
|||
|
|||
// 表头 |
|||
const columns: TableColumnType<IRechargeOrder>[] = [ |
|||
// { |
|||
// label: "ID", |
|||
// uniqueKey: "id", |
|||
// prop: "id", |
|||
// sortable: "true", |
|||
// }, |
|||
{ |
|||
label: "发起时间", |
|||
uniqueKey: "createdTime", |
|||
prop: "createdTime", |
|||
width: "150", |
|||
}, |
|||
{ |
|||
label: "订单号", |
|||
uniqueKey: "orderNo", |
|||
prop: "orderNo", |
|||
width:"130", |
|||
}, |
|||
{ |
|||
label: "用户ID", |
|||
uniqueKey: "userNo", |
|||
prop: "userNo", |
|||
width:"100", |
|||
}, |
|||
{ |
|||
label: "渠道包ID", |
|||
uniqueKey: "channelId", |
|||
prop: "channelId", |
|||
width:"100", |
|||
}, |
|||
{ |
|||
label: "注册渠道广告", |
|||
uniqueKey: "adToken", |
|||
prop: "adToken", |
|||
width:"140", |
|||
renderType: "text", |
|||
optionEnumFn: channelList, |
|||
}, |
|||
{ |
|||
label: "最新渠道广告", |
|||
uniqueKey: "pkgAdToken", |
|||
prop: "pkgAdToken", |
|||
width:"140", |
|||
renderType: "text", |
|||
optionEnumFn: channelList, |
|||
}, |
|||
{ |
|||
label: "支付通道名称", |
|||
uniqueKey: "payChannelId", |
|||
prop: "payChannelId", |
|||
width:"120", |
|||
renderType: "text", |
|||
optionEnumFn: payChannelList, |
|||
}, |
|||
{ |
|||
label: "开始支付通道类型", |
|||
uniqueKey: "payChannelType", |
|||
prop: "payChannelType", |
|||
width:"140", |
|||
renderType: "text", |
|||
optionEnumFn: AppTypeOptions, |
|||
}, |
|||
{ |
|||
label: "结束支付通道类型", |
|||
uniqueKey: "usePayChannelType", |
|||
prop: "usePayChannelType", |
|||
width:"140", |
|||
renderType: "text", |
|||
optionEnumFn: AppTypeOptions, |
|||
}, |
|||
{ |
|||
label: "充值金额(卢比)", |
|||
uniqueKey: "rechargeAmount", |
|||
prop: "rechargeAmount", |
|||
width:"120", |
|||
}, |
|||
{ |
|||
label: "充值金币", |
|||
uniqueKey: "gold", |
|||
prop: "gold", |
|||
width:"100", |
|||
}, |
|||
{ |
|||
label: "订单状态", |
|||
uniqueKey: "orderStatus", |
|||
prop: "orderStatus", |
|||
width:"110", |
|||
renderType: "text", |
|||
optionEnumFn: RECHARGE_STATUS, |
|||
}, |
|||
{ |
|||
label: "平台订单号", |
|||
uniqueKey: "pfOrderNum", |
|||
prop: "pfOrderNum", |
|||
width:"100", |
|||
}, |
|||
{ |
|||
label: "获取请求时间", |
|||
uniqueKey: "getReqTime", |
|||
prop: "getReqTime", |
|||
width:"180", |
|||
}, |
|||
{ |
|||
label: "发送地址请求时间", |
|||
uniqueKey: "sendUrlTime", |
|||
prop: "sendUrlTime", |
|||
width:"180", |
|||
}, |
|||
{ |
|||
label: "获取地址请求时间", |
|||
uniqueKey: "getUrlTime", |
|||
prop: "getUrlTime", |
|||
width:"180", |
|||
}, |
|||
{ |
|||
label: "页面请求时间", |
|||
uniqueKey: "webReqTime", |
|||
prop: "webReqTime", |
|||
width:"180", |
|||
}, |
|||
{ |
|||
label: "支付加载开始时间", |
|||
uniqueKey: "webPayStartTime", |
|||
prop: "webPayStartTime", |
|||
width:"180", |
|||
}, |
|||
{ |
|||
label: "支付加载结束时间", |
|||
uniqueKey: "webPayEndTime", |
|||
prop: "webPayEndTime", |
|||
width:"180", |
|||
}, |
|||
]; |
|||
|
|||
const table_ref = ref<MTableInstance>(); |
|||
const handleGetData = () => unref(table_ref)?.handleGetTableData(); |
|||
|
|||
// const basic_info_ref = ref<InstanceType<typeof BasicInfoModal>>(); |
|||
// const handleOpenDialog = (type: "edit" | "view", data?: IRechargeOrder) => { |
|||
// unref(basic_info_ref)?.handleOpen(type, data); |
|||
// }; |
|||
// const handleDelRow = (id: number) => { |
|||
// useHandleData(deleteRechargeOrder, { id }, "删除当前订单").then( |
|||
// handleGetData |
|||
// ); |
|||
// }; |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
/* .importent-type-blue { |
|||
color: #4090ec; |
|||
font-weight: bold; |
|||
} |
|||
.importent-type-grey { |
|||
color: #a4a6a8; |
|||
font-weight: bold; |
|||
} */ |
|||
</style> |
Loading…
Reference in new issue