feat(order): 新增导出订单数据功能及订单卡号卡密展示
- 在API中新增导出订单数据接口`apiJdV2OrderExportGet` - 添加导出订单所需的请求参数类型和相关枚举定义 - 订单列表和订单详情中增加卡号、卡密字段显示 - 优化订单状态、支付状态、回调状态映射函数,使用对应枚举类型 - 在订单列表页实现导出按钮点击逻辑,支持导出当前筛选条件下的订单数据 - 导出文件名根据响应头自动解析,支持文件下载和提示 - 调整订单列表滚动宽度,增强字段展示空间 - 补充导出订单接口文档和示例说明
This commit is contained in:
@@ -46,6 +46,7 @@ docs/KamiApiCamelOilV1DeleteExpiredAccountsRes.md
|
||||
docs/KamiApiCamelOilV1DeleteTokenReq.md
|
||||
docs/KamiApiCamelOilV1DeleteTokenRes.md
|
||||
docs/KamiApiCamelOilV1DenominationSetting.md
|
||||
docs/KamiApiCamelOilV1ExportOrderReq.md
|
||||
docs/KamiApiCamelOilV1GetPrefetchOrderLogsReq.md
|
||||
docs/KamiApiCamelOilV1GetPrefetchOrderLogsRes.md
|
||||
docs/KamiApiCamelOilV1GetSettingsRes.md
|
||||
@@ -493,6 +494,7 @@ models/kami-api-camel-oil-v1-delete-expired-accounts-res.ts
|
||||
models/kami-api-camel-oil-v1-delete-token-req.ts
|
||||
models/kami-api-camel-oil-v1-delete-token-res.ts
|
||||
models/kami-api-camel-oil-v1-denomination-setting.ts
|
||||
models/kami-api-camel-oil-v1-export-order-req.ts
|
||||
models/kami-api-camel-oil-v1-get-prefetch-order-logs-req.ts
|
||||
models/kami-api-camel-oil-v1-get-prefetch-order-logs-res.ts
|
||||
models/kami-api-camel-oil-v1-get-settings-res.ts
|
||||
|
||||
@@ -237,6 +237,97 @@ export const JDV2OrderApiAxiosParamCreator = function (
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 导出订单数据
|
||||
* @param {number} current 页数
|
||||
* @param {ApiJdV2OrderExportGetPageSizeEnum} pageSize 页码
|
||||
* @param {string} [merchantOrderId] 商户订单号
|
||||
* @param {string} [orderNo] 系统订单号
|
||||
* @param {number} [accountId] 账号ID
|
||||
* @param {ApiJdV2OrderExportGetStatusEnum} [status] 订单状态
|
||||
* @param {ApiJdV2OrderExportGetPayStatusEnum} [payStatus] 支付状态
|
||||
* @param {Array<string>} [dateRange] 时间范围
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiJdV2OrderExportGet: async (
|
||||
current: number,
|
||||
pageSize: ApiJdV2OrderExportGetPageSizeEnum,
|
||||
merchantOrderId?: string,
|
||||
orderNo?: string,
|
||||
accountId?: number,
|
||||
status?: ApiJdV2OrderExportGetStatusEnum,
|
||||
payStatus?: ApiJdV2OrderExportGetPayStatusEnum,
|
||||
dateRange?: Array<string>,
|
||||
options: RawAxiosRequestConfig = {}
|
||||
): Promise<RequestArgs> => {
|
||||
// verify required parameter 'current' is not null or undefined
|
||||
assertParamExists('apiJdV2OrderExportGet', 'current', current);
|
||||
// verify required parameter 'pageSize' is not null or undefined
|
||||
assertParamExists('apiJdV2OrderExportGet', 'pageSize', pageSize);
|
||||
const localVarPath = `/api/jd-v2/order/export`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = {
|
||||
method: 'GET',
|
||||
...baseOptions,
|
||||
...options
|
||||
};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
if (current !== undefined) {
|
||||
localVarQueryParameter['current'] = current;
|
||||
}
|
||||
|
||||
if (pageSize !== undefined) {
|
||||
localVarQueryParameter['pageSize'] = pageSize;
|
||||
}
|
||||
|
||||
if (merchantOrderId !== undefined) {
|
||||
localVarQueryParameter['merchantOrderId'] = merchantOrderId;
|
||||
}
|
||||
|
||||
if (orderNo !== undefined) {
|
||||
localVarQueryParameter['orderNo'] = orderNo;
|
||||
}
|
||||
|
||||
if (accountId !== undefined) {
|
||||
localVarQueryParameter['accountId'] = accountId;
|
||||
}
|
||||
|
||||
if (status !== undefined) {
|
||||
localVarQueryParameter['status'] = status;
|
||||
}
|
||||
|
||||
if (payStatus !== undefined) {
|
||||
localVarQueryParameter['payStatus'] = payStatus;
|
||||
}
|
||||
|
||||
if (dateRange) {
|
||||
localVarQueryParameter['dateRange'] = dateRange;
|
||||
}
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions =
|
||||
baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {
|
||||
...localVarHeaderParameter,
|
||||
...headersFromBaseOptions,
|
||||
...options.headers
|
||||
};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 订单历史记录
|
||||
@@ -563,6 +654,58 @@ export const JDV2OrderApiFp = function (configuration?: Configuration) {
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 导出订单数据
|
||||
* @param {number} current 页数
|
||||
* @param {ApiJdV2OrderExportGetPageSizeEnum} pageSize 页码
|
||||
* @param {string} [merchantOrderId] 商户订单号
|
||||
* @param {string} [orderNo] 系统订单号
|
||||
* @param {number} [accountId] 账号ID
|
||||
* @param {ApiJdV2OrderExportGetStatusEnum} [status] 订单状态
|
||||
* @param {ApiJdV2OrderExportGetPayStatusEnum} [payStatus] 支付状态
|
||||
* @param {Array<string>} [dateRange] 时间范围
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiJdV2OrderExportGet(
|
||||
current: number,
|
||||
pageSize: ApiJdV2OrderExportGetPageSizeEnum,
|
||||
merchantOrderId?: string,
|
||||
orderNo?: string,
|
||||
accountId?: number,
|
||||
status?: ApiJdV2OrderExportGetStatusEnum,
|
||||
payStatus?: ApiJdV2OrderExportGetPayStatusEnum,
|
||||
dateRange?: Array<string>,
|
||||
options?: RawAxiosRequestConfig
|
||||
): Promise<
|
||||
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>
|
||||
> {
|
||||
const localVarAxiosArgs =
|
||||
await localVarAxiosParamCreator.apiJdV2OrderExportGet(
|
||||
current,
|
||||
pageSize,
|
||||
merchantOrderId,
|
||||
orderNo,
|
||||
accountId,
|
||||
status,
|
||||
payStatus,
|
||||
dateRange,
|
||||
options
|
||||
);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath =
|
||||
operationServerMap['JDV2OrderApi.apiJdV2OrderExportGet']?.[
|
||||
localVarOperationServerIndex
|
||||
]?.url;
|
||||
return (axios, basePath) =>
|
||||
createRequestFunction(
|
||||
localVarAxiosArgs,
|
||||
globalAxios,
|
||||
BASE_PATH,
|
||||
configuration
|
||||
)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 订单历史记录
|
||||
@@ -761,6 +904,31 @@ export const JDV2OrderApiFactory = function (
|
||||
.apiJdV2OrderDetailGet(requestParameters.orderNo, options)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 导出订单数据
|
||||
* @param {JDV2OrderApiApiJdV2OrderExportGetRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiJdV2OrderExportGet(
|
||||
requestParameters: JDV2OrderApiApiJdV2OrderExportGetRequest,
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<object> {
|
||||
return localVarFp
|
||||
.apiJdV2OrderExportGet(
|
||||
requestParameters.current,
|
||||
requestParameters.pageSize,
|
||||
requestParameters.merchantOrderId,
|
||||
requestParameters.orderNo,
|
||||
requestParameters.accountId,
|
||||
requestParameters.status,
|
||||
requestParameters.payStatus,
|
||||
requestParameters.dateRange,
|
||||
options
|
||||
)
|
||||
.then(request => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 订单历史记录
|
||||
@@ -867,6 +1035,18 @@ export interface JDV2OrderApiInterface {
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<KamiApiCamelOilV1OrderDetailRes>;
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 导出订单数据
|
||||
* @param {JDV2OrderApiApiJdV2OrderExportGetRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiJdV2OrderExportGet(
|
||||
requestParameters: JDV2OrderApiApiJdV2OrderExportGetRequest,
|
||||
options?: RawAxiosRequestConfig
|
||||
): AxiosPromise<object>;
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 订单历史记录
|
||||
@@ -956,6 +1136,51 @@ export interface JDV2OrderApiApiJdV2OrderDetailGetRequest {
|
||||
readonly orderNo: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for apiJdV2OrderExportGet operation in JDV2OrderApi.
|
||||
*/
|
||||
export interface JDV2OrderApiApiJdV2OrderExportGetRequest {
|
||||
/**
|
||||
* 页数
|
||||
*/
|
||||
readonly current: number;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
readonly pageSize: ApiJdV2OrderExportGetPageSizeEnum;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
readonly merchantOrderId?: string;
|
||||
|
||||
/**
|
||||
* 系统订单号
|
||||
*/
|
||||
readonly orderNo?: string;
|
||||
|
||||
/**
|
||||
* 账号ID
|
||||
*/
|
||||
readonly accountId?: number;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
readonly status?: ApiJdV2OrderExportGetStatusEnum;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
readonly payStatus?: ApiJdV2OrderExportGetPayStatusEnum;
|
||||
|
||||
/**
|
||||
* 时间范围
|
||||
*/
|
||||
readonly dateRange?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request parameters for apiJdV2OrderHistoryGet operation in JDV2OrderApi.
|
||||
*/
|
||||
@@ -1091,6 +1316,32 @@ export class JDV2OrderApi extends BaseAPI implements JDV2OrderApiInterface {
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 导出订单数据
|
||||
* @param {JDV2OrderApiApiJdV2OrderExportGetRequest} requestParameters Request parameters.
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public apiJdV2OrderExportGet(
|
||||
requestParameters: JDV2OrderApiApiJdV2OrderExportGetRequest,
|
||||
options?: RawAxiosRequestConfig
|
||||
) {
|
||||
return JDV2OrderApiFp(this.configuration)
|
||||
.apiJdV2OrderExportGet(
|
||||
requestParameters.current,
|
||||
requestParameters.pageSize,
|
||||
requestParameters.merchantOrderId,
|
||||
requestParameters.orderNo,
|
||||
requestParameters.accountId,
|
||||
requestParameters.status,
|
||||
requestParameters.payStatus,
|
||||
requestParameters.dateRange,
|
||||
options
|
||||
)
|
||||
.then(request => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary 订单历史记录
|
||||
@@ -1178,6 +1429,26 @@ export enum ApiJdV2OrderAccountOrdersGetPayStatusEnum {
|
||||
NUMBER_3 = 3,
|
||||
NUMBER_0 = 0
|
||||
}
|
||||
export enum ApiJdV2OrderExportGetPageSizeEnum {
|
||||
NUMBER_5 = 5,
|
||||
NUMBER_10 = 10,
|
||||
NUMBER_15 = 15,
|
||||
NUMBER_20 = 20,
|
||||
NUMBER_50 = 50,
|
||||
NUMBER_100 = 100
|
||||
}
|
||||
export enum ApiJdV2OrderExportGetStatusEnum {
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3,
|
||||
NUMBER_0 = 0,
|
||||
NUMBER_1 = 1
|
||||
}
|
||||
export enum ApiJdV2OrderExportGetPayStatusEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3,
|
||||
NUMBER_0 = 0
|
||||
}
|
||||
export enum ApiJdV2OrderHistoryGetPageSizeEnum {
|
||||
NUMBER_5 = 5,
|
||||
NUMBER_10 = 10,
|
||||
|
||||
@@ -7,6 +7,7 @@ All URIs are relative to _http://localhost_
|
||||
| [**apiJdV2OrderAccountOrdersGet**](#apijdv2orderaccountordersget) | **GET** /api/jd-v2/order/accountOrders | 账号历史订单 |
|
||||
| [**apiJdV2OrderCallbackPost**](#apijdv2ordercallbackpost) | **POST** /api/jd-v2/order/callback | 手动回调 |
|
||||
| [**apiJdV2OrderDetailGet**](#apijdv2orderdetailget) | **GET** /api/jd-v2/order/detail | 订单详情 |
|
||||
| [**apiJdV2OrderExportGet**](#apijdv2orderexportget) | **GET** /api/jd-v2/order/export | 导出订单数据 |
|
||||
| [**apiJdV2OrderHistoryGet**](#apijdv2orderhistoryget) | **GET** /api/jd-v2/order/history | 订单历史记录 |
|
||||
| [**apiJdV2OrderListGet**](#apijdv2orderlistget) | **GET** /api/jd-v2/order/list | 订单列表 |
|
||||
| [**apiJdV2OrderSubmitPost**](#apijdv2ordersubmitpost) | **POST** /api/jd-v2/order/submit | 提交订单 |
|
||||
@@ -166,6 +167,73 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **apiJdV2OrderExportGet**
|
||||
|
||||
> object apiJdV2OrderExportGet()
|
||||
|
||||
### Example
|
||||
|
||||
```typescript
|
||||
import { JDV2OrderApi, Configuration } from './api';
|
||||
|
||||
const configuration = new Configuration();
|
||||
const apiInstance = new JDV2OrderApi(configuration);
|
||||
|
||||
let current: number; //页数 (default to undefined)
|
||||
let pageSize: 5 | 10 | 15 | 20 | 50 | 100; //页码 (default to undefined)
|
||||
let merchantOrderId: string; //商户订单号 (optional) (default to undefined)
|
||||
let orderNo: string; //系统订单号 (optional) (default to undefined)
|
||||
let accountId: number; //账号ID (optional) (default to undefined)
|
||||
let status: 2 | 3 | 0 | 1; //订单状态 (optional) (default to undefined)
|
||||
let payStatus: 1 | 2 | 3 | 0; //支付状态 (optional) (default to undefined)
|
||||
let dateRange: Array<string>; //时间范围 (optional) (default to undefined)
|
||||
|
||||
const { status, data } = await apiInstance.apiJdV2OrderExportGet(
|
||||
current,
|
||||
pageSize,
|
||||
merchantOrderId,
|
||||
orderNo,
|
||||
accountId,
|
||||
status,
|
||||
payStatus,
|
||||
dateRange
|
||||
);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------------- | ----------------------- | ----------- | -------------------------------- | --------------------------------------------- | -------- | ----------------------------------------------------------------------- | ---- | --------------------- |
|
||||
| **current** | [**number**] | 页数 | defaults to undefined |
|
||||
| **pageSize** | [\*\*5 | 10 | 15 | 20 | 50 | 100**]**Array<5 | 10 | 15 | 20 | 50 | 100>\*\* | 页码 | defaults to undefined |
|
||||
| **merchantOrderId** | [**string**] | 商户订单号 | (optional) defaults to undefined |
|
||||
| **orderNo** | [**string**] | 系统订单号 | (optional) defaults to undefined |
|
||||
| **accountId** | [**number**] | 账号ID | (optional) defaults to undefined |
|
||||
| **status** | [\*\*2 | 3 | 0 | 1**]**Array<2 | 3 | 0 | 1>\*\* | 订单状态 | (optional) defaults to undefined |
|
||||
| **payStatus** | [\*\*1 | 2 | 3 | 0**]**Array<1 | 2 | 3 | 0>\*\* | 支付状态 | (optional) defaults to undefined |
|
||||
| **dateRange** | **Array<string>** | 时间范围 | (optional) defaults to undefined |
|
||||
|
||||
### Return type
|
||||
|
||||
**object**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
| ----------- | ----------- | ---------------- |
|
||||
| **200** | | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **apiJdV2OrderHistoryGet**
|
||||
|
||||
> KamiApiCamelOilV1OrderHistoryRes apiJdV2OrderHistoryGet()
|
||||
|
||||
33
src/api/generated/docs/KamiApiCamelOilV1ExportOrderReq.md
Normal file
33
src/api/generated/docs/KamiApiCamelOilV1ExportOrderReq.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# KamiApiCamelOilV1ExportOrderReq
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------------- | ----------------------- | ----------- | --------------------------------- |
|
||||
| **current** | **number** | 页数 | [default to undefined] |
|
||||
| **pageSize** | **number** | 页码 | [default to undefined] |
|
||||
| **merchantOrderId** | **string** | 商户订单号 | [optional] [default to undefined] |
|
||||
| **orderNo** | **string** | 系统订单号 | [optional] [default to undefined] |
|
||||
| **accountId** | **number** | 账号ID | [optional] [default to undefined] |
|
||||
| **status** | **number** | 订单状态 | [optional] [default to undefined] |
|
||||
| **payStatus** | **number** | 支付状态 | [optional] [default to undefined] |
|
||||
| **dateRange** | **Array<string>** | 时间范围 | [optional] [default to undefined] |
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import { KamiApiCamelOilV1ExportOrderReq } from './api';
|
||||
|
||||
const instance: KamiApiCamelOilV1ExportOrderReq = {
|
||||
current,
|
||||
pageSize,
|
||||
merchantOrderId,
|
||||
orderNo,
|
||||
accountId,
|
||||
status,
|
||||
payStatus,
|
||||
dateRange
|
||||
};
|
||||
```
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
@@ -10,6 +10,8 @@
|
||||
| **accountName** | **string** | 账号名称 | [optional] [default to undefined] |
|
||||
| **amount** | **number** | 订单金额 | [optional] [default to undefined] |
|
||||
| **alipayUrl** | **string** | 支付宝支付链接 | [optional] [default to undefined] |
|
||||
| **cardNumber** | **string** | 提取的卡号 | [optional] [default to undefined] |
|
||||
| **cardPassword** | **string** | 提取的卡密 | [optional] [default to undefined] |
|
||||
| **status** | **number** | 订单状态 | [optional] [default to undefined] |
|
||||
| **payStatus** | **number** | 支付状态 | [optional] [default to undefined] |
|
||||
| **notifyStatus** | **number** | 回调状态 | [optional] [default to undefined] |
|
||||
@@ -32,6 +34,8 @@ const instance: KamiApiCamelOilV1OrderListItem = {
|
||||
accountName,
|
||||
amount,
|
||||
alipayUrl,
|
||||
cardNumber,
|
||||
cardPassword,
|
||||
status,
|
||||
payStatus,
|
||||
notifyStatus,
|
||||
|
||||
@@ -21,6 +21,7 @@ export * from './kami-api-camel-oil-v1-delete-expired-accounts-res';
|
||||
export * from './kami-api-camel-oil-v1-delete-token-req';
|
||||
export * from './kami-api-camel-oil-v1-delete-token-res';
|
||||
export * from './kami-api-camel-oil-v1-denomination-setting';
|
||||
export * from './kami-api-camel-oil-v1-export-order-req';
|
||||
export * from './kami-api-camel-oil-v1-get-prefetch-order-logs-req';
|
||||
export * from './kami-api-camel-oil-v1-get-prefetch-order-logs-res';
|
||||
export * from './kami-api-camel-oil-v1-get-settings-res';
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document:
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface KamiApiCamelOilV1ExportOrderReq {
|
||||
/**
|
||||
* 页数
|
||||
*/
|
||||
current: number;
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
pageSize: KamiApiCamelOilV1ExportOrderReqPageSizeEnum;
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
merchantOrderId?: string;
|
||||
/**
|
||||
* 系统订单号
|
||||
*/
|
||||
orderNo?: string;
|
||||
/**
|
||||
* 账号ID
|
||||
*/
|
||||
accountId?: number;
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
status?: KamiApiCamelOilV1ExportOrderReqStatusEnum;
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
payStatus?: KamiApiCamelOilV1ExportOrderReqPayStatusEnum;
|
||||
/**
|
||||
* 时间范围
|
||||
*/
|
||||
dateRange?: Array<string>;
|
||||
}
|
||||
|
||||
export enum KamiApiCamelOilV1ExportOrderReqPageSizeEnum {
|
||||
NUMBER_5 = 5,
|
||||
NUMBER_10 = 10,
|
||||
NUMBER_15 = 15,
|
||||
NUMBER_20 = 20,
|
||||
NUMBER_50 = 50,
|
||||
NUMBER_100 = 100
|
||||
}
|
||||
export enum KamiApiCamelOilV1ExportOrderReqStatusEnum {
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3,
|
||||
NUMBER_0 = 0,
|
||||
NUMBER_1 = 1
|
||||
}
|
||||
export enum KamiApiCamelOilV1ExportOrderReqPayStatusEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3,
|
||||
NUMBER_0 = 0
|
||||
}
|
||||
@@ -37,6 +37,14 @@ export interface KamiApiCamelOilV1OrderListItem {
|
||||
* 支付宝支付链接
|
||||
*/
|
||||
alipayUrl?: string;
|
||||
/**
|
||||
* 提取的卡号
|
||||
*/
|
||||
cardNumber?: string;
|
||||
/**
|
||||
* 提取的卡密
|
||||
*/
|
||||
cardPassword?: string;
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
<a-descriptions-item label="商户ID">
|
||||
{{ order.merchantId || '-' }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="卡号">
|
||||
{{ order.cardNumber || '-' }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="卡密">
|
||||
{{ order.cardPassword || '-' }}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
|
||||
@@ -74,6 +80,10 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import {
|
||||
KamiApiCamelOilV1OrderListItemStatusEnum,
|
||||
KamiApiCamelOilV1OrderListItemPayStatusEnum
|
||||
} from '@/api/generated/models/index';
|
||||
|
||||
// Props 定义
|
||||
interface Props {
|
||||
@@ -99,46 +109,35 @@ const modalVisible = computed({
|
||||
set: value => emit('update:visible', value)
|
||||
});
|
||||
|
||||
/**
|
||||
* 订单状态映射器
|
||||
* 基于后端Go定义的CamelOilOrderStatus
|
||||
* @param status 状态值
|
||||
* @returns 状态文本和颜色
|
||||
*/
|
||||
// 状态映射函数,复用主组件的逻辑
|
||||
const statusMapper = (status: number): { text: string; color: string } => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return { text: '待处理', color: 'orange' }; // CamelOilOrderStatusPending
|
||||
case 1:
|
||||
return { text: '处理中', color: 'blue' }; // CamelOilOrderStatusProcessing
|
||||
case 2:
|
||||
return { text: '已完成', color: 'green' }; // CamelOilOrderStatusCompleted
|
||||
case 3:
|
||||
return { text: '已失败', color: 'red' }; // CamelOilOrderStatusFailed
|
||||
default:
|
||||
return { text: '未知状态', color: 'gray' };
|
||||
}
|
||||
const statusMap = {
|
||||
0: { text: '待处理', color: 'orange' },
|
||||
1: { text: '处理中', color: 'blue' },
|
||||
2: { text: '已完成', color: 'green' },
|
||||
3: { text: '已失败', color: 'red' }
|
||||
};
|
||||
return (
|
||||
statusMap[status as keyof typeof statusMap] || {
|
||||
text: '未知状态',
|
||||
color: 'gray'
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 支付状态映射器
|
||||
* 基于后端Go定义的CamelOilPayStatus
|
||||
* @param status 支付状态
|
||||
* @returns 支付状态文本和颜色
|
||||
*/
|
||||
const payStatusMapper = (status: number): { text: string; color: string } => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return { text: '未支付', color: 'orange' }; // CamelOilPaymentStatusUnpaid
|
||||
case 1:
|
||||
return { text: '已支付', color: 'green' }; // CamelOilPaymentStatusPaid
|
||||
case 2:
|
||||
return { text: '已退款', color: 'blue' }; // CamelOilPaymentStatusRefunded
|
||||
case 3:
|
||||
return { text: '已超时', color: 'red' }; // CamelOilPaymentStatusTimeout
|
||||
default:
|
||||
return { text: '未知状态', color: 'gray' };
|
||||
}
|
||||
const statusMap = {
|
||||
0: { text: '未支付', color: 'orange' },
|
||||
1: { text: '已支付', color: 'green' },
|
||||
2: { text: '已退款', color: 'blue' },
|
||||
3: { text: '已超时', color: 'red' }
|
||||
};
|
||||
return (
|
||||
statusMap[status as keyof typeof statusMap] || {
|
||||
text: '未知状态',
|
||||
color: 'gray'
|
||||
}
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<!-- 操作按钮区域 -->
|
||||
<a-row style="margin-bottom: 16px">
|
||||
<a-space>
|
||||
<a-button @click="download">
|
||||
<a-button :loading="exportLoading" @click="download">
|
||||
<template #icon>
|
||||
<icon-download />
|
||||
</template>
|
||||
@@ -112,7 +112,7 @@
|
||||
}"
|
||||
:columns="columns"
|
||||
:data="renderData"
|
||||
:scroll="{ x: 1400 }"
|
||||
:scroll="{ x: 1720 }"
|
||||
@page-change="onPageChange"
|
||||
@page-size-change="onPageSizeChange"
|
||||
>
|
||||
@@ -184,17 +184,21 @@ import { Message, Notification, TableColumnData } from '@arco-design/web-vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { Pagination } from '@/types/global';
|
||||
import { jdV2OrderClient } from '@/api/index.ts';
|
||||
import { handleDownLoadFile } from '@/api/utils';
|
||||
import type { KamiApiCamelOilV1OrderListItem } from '@/api/generated/models/index.ts';
|
||||
import type {
|
||||
ApiJdV2OrderListGetPageSizeEnum,
|
||||
ApiJdV2OrderListGetStatusEnum,
|
||||
ApiJdV2OrderListGetPayStatusEnum
|
||||
ApiJdV2OrderListGetPayStatusEnum,
|
||||
ApiJdV2OrderExportGetPageSizeEnum,
|
||||
ApiJdV2OrderExportGetStatusEnum,
|
||||
ApiJdV2OrderExportGetPayStatusEnum
|
||||
} from '@/api/generated/apis/jdv2-order-api';
|
||||
import type {
|
||||
import {
|
||||
KamiApiCamelOilV1OrderListItemStatusEnum,
|
||||
KamiApiCamelOilV1OrderListItemPayStatusEnum,
|
||||
KamiApiCamelOilV1OrderListItemNotifyStatusEnum
|
||||
} from '@/api/generated/models/index.ts';
|
||||
} from '@/api/generated/models/index';
|
||||
import OrderDetailModal from './components/order-detail-modal.vue';
|
||||
import OrderHistoryModal from './components/order-history-modal.vue';
|
||||
|
||||
@@ -207,6 +211,7 @@ const basePagination: Pagination = {
|
||||
// 状态管理
|
||||
const pagination = reactive({ ...basePagination });
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const exportLoading = ref(false);
|
||||
const renderData = ref<KamiApiCamelOilV1OrderListItem[]>([]);
|
||||
const selectedOrder = ref<any>(null);
|
||||
const selectedOrderNo = ref('');
|
||||
@@ -281,6 +286,20 @@ const columns: TableColumnData[] = [
|
||||
dataIndex: 'accountName',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '卡号',
|
||||
dataIndex: 'cardNumber',
|
||||
width: 160,
|
||||
ellipsis: true,
|
||||
tooltip: true
|
||||
},
|
||||
{
|
||||
title: '卡密',
|
||||
dataIndex: 'cardPassword',
|
||||
width: 160,
|
||||
ellipsis: true,
|
||||
tooltip: true
|
||||
},
|
||||
{
|
||||
title: '订单金额',
|
||||
dataIndex: 'amount',
|
||||
@@ -454,75 +473,146 @@ const showOrderHistory = (record: KamiApiCamelOilV1OrderListItem) => {
|
||||
state.historyModalVisible = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 订单状态映射器
|
||||
* 基于后端Go定义的CamelOilOrderStatus
|
||||
* @param status 状态值
|
||||
* @returns 状态文本和颜色
|
||||
*/
|
||||
const statusMapper = (status: number): { text: string; color: string } => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return { text: '待处理', color: 'orange' }; // CamelOilOrderStatusPending
|
||||
case 1:
|
||||
return { text: '处理中', color: 'blue' }; // CamelOilOrderStatusProcessing
|
||||
case 2:
|
||||
return { text: '已完成', color: 'green' }; // CamelOilOrderStatusCompleted
|
||||
case 3:
|
||||
return { text: '已失败', color: 'red' }; // CamelOilOrderStatusFailed
|
||||
default:
|
||||
return { text: '未知状态', color: 'gray' };
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 支付状态映射器
|
||||
* 基于后端Go定义的CamelOilPayStatus
|
||||
* @param status 支付状态
|
||||
* @returns 支付状态文本和颜色
|
||||
*/
|
||||
const payStatusMapper = (status: number): { text: string; color: string } => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return { text: '未支付', color: 'orange' }; // CamelOilPaymentStatusUnpaid
|
||||
case 1:
|
||||
return { text: '已支付', color: 'green' }; // CamelOilPaymentStatusPaid
|
||||
case 2:
|
||||
return { text: '已退款', color: 'blue' }; // CamelOilPaymentStatusRefunded
|
||||
case 3:
|
||||
return { text: '已超时', color: 'red' }; // CamelOilPaymentStatusTimeout
|
||||
default:
|
||||
return { text: '未知状态', color: 'gray' };
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 回调状态映射器
|
||||
* 基于后端Go定义的CamelOilNotifyStatus
|
||||
* @param status 回调状态
|
||||
* @returns 回调状态文本和颜色
|
||||
*/
|
||||
const callbackStatusMapper = (
|
||||
status: number
|
||||
// 状态映射函数
|
||||
const statusMapper = (
|
||||
status: KamiApiCamelOilV1OrderListItemStatusEnum
|
||||
): { text: string; color: string } => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return { text: '未回调', color: 'orange' }; // CamelOilCallbackStatusPending
|
||||
case 1:
|
||||
return { text: '回调成功', color: 'green' }; // CamelOilCallbackStatusSuccess
|
||||
case 2:
|
||||
return { text: '回调失败', color: 'red' }; // CamelOilCallbackStatusFailed
|
||||
default:
|
||||
return { text: '未知状态', color: 'gray' };
|
||||
}
|
||||
const statusMap = {
|
||||
[KamiApiCamelOilV1OrderListItemStatusEnum.NUMBER_0]: {
|
||||
text: '待处理',
|
||||
color: 'orange'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemStatusEnum.NUMBER_1]: {
|
||||
text: '处理中',
|
||||
color: 'blue'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemStatusEnum.NUMBER_2]: {
|
||||
text: '已完成',
|
||||
color: 'green'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemStatusEnum.NUMBER_3]: {
|
||||
text: '已失败',
|
||||
color: 'red'
|
||||
}
|
||||
};
|
||||
return (
|
||||
statusMap[status] || {
|
||||
text: '未知状态',
|
||||
color: 'gray'
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const payStatusMapper = (
|
||||
status: KamiApiCamelOilV1OrderListItemPayStatusEnum
|
||||
): { text: string; color: string } => {
|
||||
const statusMap = {
|
||||
[KamiApiCamelOilV1OrderListItemPayStatusEnum.NUMBER_0]: {
|
||||
text: '未支付',
|
||||
color: 'orange'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemPayStatusEnum.NUMBER_1]: {
|
||||
text: '已支付',
|
||||
color: 'green'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemPayStatusEnum.NUMBER_2]: {
|
||||
text: '已退款',
|
||||
color: 'blue'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemPayStatusEnum.NUMBER_3]: {
|
||||
text: '已超时',
|
||||
color: 'red'
|
||||
}
|
||||
};
|
||||
return (
|
||||
statusMap[status] || {
|
||||
text: '未知状态',
|
||||
color: 'gray'
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const callbackStatusMapper = (
|
||||
status: KamiApiCamelOilV1OrderListItemNotifyStatusEnum
|
||||
): { text: string; color: string } => {
|
||||
const statusMap = {
|
||||
[KamiApiCamelOilV1OrderListItemNotifyStatusEnum.NUMBER_0]: {
|
||||
text: '未回调',
|
||||
color: 'orange'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemNotifyStatusEnum.NUMBER_1]: {
|
||||
text: '回调成功',
|
||||
color: 'green'
|
||||
},
|
||||
[KamiApiCamelOilV1OrderListItemNotifyStatusEnum.NUMBER_2]: {
|
||||
text: '回调失败',
|
||||
color: 'red'
|
||||
}
|
||||
};
|
||||
return (
|
||||
statusMap[status] || {
|
||||
text: '未知状态',
|
||||
color: 'gray'
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出功能
|
||||
*/
|
||||
const download = () => {
|
||||
// TODO: 实现导出功能
|
||||
Message.info('导出功能开发中');
|
||||
const download = async () => {
|
||||
exportLoading.value = true;
|
||||
try {
|
||||
// 转换枚举类型 - 由于两个枚举的数值相同,可以直接转换
|
||||
const convertToExportStatus = (
|
||||
status: ApiJdV2OrderListGetStatusEnum | undefined
|
||||
): ApiJdV2OrderExportGetStatusEnum | undefined => {
|
||||
if (status === undefined) return undefined;
|
||||
return status as unknown as ApiJdV2OrderExportGetStatusEnum;
|
||||
};
|
||||
|
||||
const convertToExportPayStatus = (
|
||||
payStatus: ApiJdV2OrderListGetPayStatusEnum | undefined
|
||||
): ApiJdV2OrderExportGetPayStatusEnum | undefined => {
|
||||
if (payStatus === undefined) return undefined;
|
||||
return payStatus as unknown as ApiJdV2OrderExportGetPayStatusEnum;
|
||||
};
|
||||
|
||||
const response = await jdV2OrderClient.apiJdV2OrderExportGet(
|
||||
{
|
||||
current: pagination.current,
|
||||
pageSize: pagination.pageSize as ApiJdV2OrderExportGetPageSizeEnum,
|
||||
orderNo: formModel.value.orderNo,
|
||||
merchantOrderId: formModel.value.merchantOrderId,
|
||||
status: convertToExportStatus(formModel.value.status),
|
||||
payStatus: convertToExportPayStatus(formModel.value.payStatus),
|
||||
dateRange: formModel.value.dateRange as unknown as string[]
|
||||
},
|
||||
{
|
||||
responseType: 'blob'
|
||||
}
|
||||
);
|
||||
|
||||
// 从响应头获取文件名,如果没有则使用默认名称
|
||||
const contentDisposition = response.headers['content-disposition'];
|
||||
let fileName = '骆驼加油订单导出.xlsx';
|
||||
if (contentDisposition) {
|
||||
const fileNameMatch = contentDisposition.match(
|
||||
/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
|
||||
);
|
||||
if (fileNameMatch && fileNameMatch[1]) {
|
||||
fileName = decodeURIComponent(fileNameMatch[1].replace(/['"]/g, ''));
|
||||
}
|
||||
}
|
||||
|
||||
handleDownLoadFile(response.data as Blob, fileName);
|
||||
Message.success('导出成功');
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error);
|
||||
Message.error('导出失败,请稍后重试');
|
||||
} finally {
|
||||
exportLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 组件挂载时获取数据
|
||||
|
||||
Reference in New Issue
Block a user