Browse Source

feat(api): 添加获取客户信息的接口及类型定义

yz 2 days ago
parent
commit
05bfdb2acc
2 changed files with 85 additions and 0 deletions
  1. 18 0
      src/api/common/index.js
  2. 67 0
      src/api/types/common.d.ts

+ 18 - 0
src/api/common/index.js

@@ -9,6 +9,8 @@ import request from '@/router/axios';
  * @typedef {import('@/api/types/common').ItemQueryParams} ItemQueryParams
  * @typedef {import('@/api/types/common').ItemRecord} ItemRecord
  * @typedef {import('@/api/types/common').ItemListResponse} ItemListResponse
+ * @typedef {import('@/api/types/common').CustomerInfoData} CustomerInfoData
+ * @typedef {import('@/api/types/common').GetCustomerInfoResponse} GetCustomerInfoResponse
  */
 
 /**
@@ -69,3 +71,19 @@ export const getItemList = async (current = 1, size = 10, params = {}) => {
     }
   });
 };
+
+/**
+ * 获取客户信息
+ * @returns {Promise<GetCustomerInfoResponse>} 客户信息响应
+ * @description 获取当前用户的客户信息详情
+ * @example
+ * // 获取客户信息
+ * const result = await getCustomerInfo();
+ * console.log(result.data.data); // 客户信息数据
+ */
+export const getCustomerInfo = async () => {
+  return request({
+    url: '/api/blade-factory/api/factory/salesOrder/getCustomerInfo',
+    method: 'get'
+  });
+};

+ 67 - 0
src/api/types/common.d.ts

@@ -176,3 +176,70 @@ export type CustomerDetailResponse = AxiosResponse<ApiResponseData<CustomerItem>
  * 物料列表响应类型
  */
 export type ItemListResponse = AxiosResponse<ApiResponseData<PageResult<ItemRecord>>>;
+
+/**
+ * 客户信息响应数据接口
+ */
+export interface CustomerInfoData {
+  id: string;
+  createUser: string;
+  createDept: string;
+  createTime: string;
+  updateUser: string;
+  updateTime: string;
+  status: number;
+  isDeleted: number;
+  ORG_ID: number;
+  ORG_CODE: string;
+  ORG_NAME: string;
+  Customer_ID: string;
+  Customer_CODE: string;
+  Customer_NAME: string;
+  Customer_ShortName: string;
+  CustomerCategory_ID: number | null;
+  CustomerCategory_CODE: string | null;
+  CustomerCategory_NAME: string | null;
+  CreatedBy: string;
+  CreatedOn: string;
+  ModifiedBy: string;
+  ModifiedOn: string;
+  StateTaxNo: string;
+  BuyerNoteName: string;
+  BuyerBankAccount: string;
+  BuyerBankAccountCode: string;
+  extend9: string;
+  TaxSchedule_ID: number | null;
+  TaxSchedule_CODE: string;
+  TaxSchedule_NAME: string;
+  TaxRate: string;
+  DescFlexField_PrivateDescSeg1: string | null;
+  DescFlexField_PrivateDescSeg2: string | null;
+  DescFlexField_PrivateDescSeg3: string | null;
+  Department_ID: number | null;
+  Department_CODE: string;
+  Department_NAME: string;
+  Saleser_ID: number | null;
+  Saleser_CODE: string;
+  Saleser_NAME: string;
+  TradeCurrency_ID: number;
+  TradeCurrency_CODE: string;
+  TradeCurrency_NAME: string;
+  PriceList_ID: number;
+  PriceList_CODE: string;
+  PriceList_NAME: string;
+  IsTaxPrice: boolean;
+  ShippmentRule_ID: number;
+  ShippmentRule_CODE: string;
+  ShippmentRule_NAME: string;
+  RecervalTerm_ID: number;
+  RecervalTerm_CODE: string;
+  RecervalTerm_NAME: string;
+  ARConfirmTerm_ID: number;
+  ARConfirmTerm_CODE: string;
+  ARConfirmTerm_NAME: string;
+}
+
+/**
+ * 获取客户信息API响应类型
+ */
+export type GetCustomerInfoResponse = AxiosResponse<ApiResponseData<CustomerInfoData>>;