|
@@ -1,12 +1,10 @@
|
|
|
import { ProColumns } from "@ant-design/pro-components";
|
|
|
import { useModel } from "@umijs/max";
|
|
|
-import { Badge } from "antd";
|
|
|
+import { Badge, Button, Space, Tag } from "antd";
|
|
|
|
|
|
-export const columns = (): ProColumns<any>[] => {
|
|
|
+export const columns = (submit: (params: { orderNo: string }) => void): ProColumns<any>[] => {
|
|
|
let { getEnum } = useModel("global")
|
|
|
- let payChannelObj: any = { '1': '微信小程序支付' };
|
|
|
let orderTypeObj: any = { '1': '书币充值', "2": "vip充值", "3": "购买整本" };
|
|
|
- let orderStatusObj: any = { '1': '待支付', "2": "已支付" };
|
|
|
return [
|
|
|
{
|
|
|
title: 'openId',
|
|
@@ -33,10 +31,7 @@ export const columns = (): ProColumns<any>[] => {
|
|
|
key: "payChannel",
|
|
|
align: "center",
|
|
|
valueType: 'select',
|
|
|
- valueEnum: payChannelObj,
|
|
|
- render: (a: any, b: any) => {
|
|
|
- return payChannelObj[b.payChannel]
|
|
|
- },
|
|
|
+ valueEnum: getEnum("PAY_CHANNEL",'map'),
|
|
|
},
|
|
|
{
|
|
|
title: "支付金额",
|
|
@@ -50,22 +45,16 @@ export const columns = (): ProColumns<any>[] => {
|
|
|
dataIndex: 'orderType',
|
|
|
key: "orderType",
|
|
|
valueType: 'select',
|
|
|
- valueEnum: orderTypeObj,
|
|
|
+ valueEnum: getEnum("ORDER_TYPE","map"),
|
|
|
align: "center",
|
|
|
- render: (a: any, b: any) => {
|
|
|
- return orderTypeObj[b.orderType]
|
|
|
- }
|
|
|
},
|
|
|
{
|
|
|
title: "订单状态",
|
|
|
dataIndex: 'orderStatus',
|
|
|
key: "orderStatus",
|
|
|
valueType: 'select',
|
|
|
- valueEnum: orderStatusObj,
|
|
|
align: "center",
|
|
|
- render: (a: any, b: any) => {
|
|
|
- return <Badge text={orderStatusObj[b.orderStatus]} status={b.orderStatus != 1 ? "success" : "warning"} />
|
|
|
- }
|
|
|
+ valueEnum:getEnum("ORDER_STATUS",'stateObj',{2:'success',1:"warning"})
|
|
|
},
|
|
|
{
|
|
|
title: "用户订单号",
|
|
@@ -114,7 +103,11 @@ export const columns = (): ProColumns<any>[] => {
|
|
|
key: "backStatus",
|
|
|
hideInSearch: true,
|
|
|
align: "center",
|
|
|
- valueEnum: getEnum("BACK_STATUS", "stateObj", { "0": 'default', "-1": "error", "1": "processing", "2": "success", "3": "warning" }),
|
|
|
+ render: (_, row) => {
|
|
|
+ let obj = getEnum("BACK_STATUS", "stateObj", { "0": 'default', "-1": "error", "1": "processing", "2": "success", "3": "warning" })
|
|
|
+ let isShowBtn = [1, -1].includes(row?.backStatus)
|
|
|
+ return <Space>{obj[row.backStatus]?.text}{isShowBtn && <Tag.CheckableTag checked onClick={() => {submit({orderNo:row.orderNo}) }}>上报</Tag.CheckableTag>}</Space>
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: '归因渠道',
|