|
@@ -1,104 +1,13 @@
|
|
|
import request from '@/router/axios';
|
|
|
|
|
|
/**
|
|
|
- * 客户查询参数类型定义
|
|
|
- * @typedef {Object} CustomerQueryParams
|
|
|
- * @property {number} [current=1] - 当前页码
|
|
|
- * @property {number} [size=10] - 每页数量
|
|
|
- * @property {string} [Customer_CODE] - 客户编码
|
|
|
- * @property {string} [Customer_NAME] - 客户名称
|
|
|
- * @property {string} [Customer_ShortName] - 客户简称
|
|
|
- * @property {string} [CustomerCategory_CODE] - 客户分类编码
|
|
|
- * @property {string} [Department_CODE] - 部门编码
|
|
|
- * @property {string} [Saleser_CODE] - 销售员编码
|
|
|
- * @property {number} [status] - 状态 0-禁用 1-启用
|
|
|
- */
|
|
|
-
|
|
|
-/**
|
|
|
- * 客户数据项类型定义
|
|
|
- * @typedef {Object} CustomerItem
|
|
|
- * @property {string} id - 客户ID
|
|
|
- * @property {string} createUser - 创建用户ID
|
|
|
- * @property {string} createDept - 创建部门ID
|
|
|
- * @property {string} createTime - 创建时间
|
|
|
- * @property {string} updateUser - 更新用户ID
|
|
|
- * @property {string} updateTime - 更新时间
|
|
|
- * @property {number} status - 状态
|
|
|
- * @property {number} isDeleted - 是否删除
|
|
|
- * @property {number} ORG_ID - 组织ID
|
|
|
- * @property {string} ORG_CODE - 组织编码
|
|
|
- * @property {string} ORG_NAME - 组织名称
|
|
|
- * @property {number} Customer_ID - 客户ID
|
|
|
- * @property {string} Customer_CODE - 客户编码
|
|
|
- * @property {string} Customer_NAME - 客户名称
|
|
|
- * @property {string} Customer_ShortName - 客户简称
|
|
|
- * @property {number|null} CustomerCategory_ID - 客户分类ID
|
|
|
- * @property {string|null} CustomerCategory_CODE - 客户分类编码
|
|
|
- * @property {string|null} CustomerCategory_NAME - 客户分类名称
|
|
|
- * @property {string} CreatedBy - 创建人
|
|
|
- * @property {string} CreatedOn - 创建时间
|
|
|
- * @property {string} ModifiedBy - 修改人
|
|
|
- * @property {string} ModifiedOn - 修改时间
|
|
|
- * @property {string} StateTaxNo - 税号
|
|
|
- * @property {string} BuyerNoteName - 买方备注名称
|
|
|
- * @property {string} BuyerBankAccount - 买方银行账户
|
|
|
- * @property {string} BuyerBankAccountCode - 买方银行账户编码
|
|
|
- * @property {string} extend9 - 扩展字段9
|
|
|
- * @property {number} TaxSchedule_ID - 税率表ID
|
|
|
- * @property {string} TaxSchedule_CODE - 税率表编码
|
|
|
- * @property {string} TaxSchedule_NAME - 税率表名称
|
|
|
- * @property {string} TaxRate - 税率
|
|
|
- * @property {string|null} DescFlexField_PrivateDescSeg1 - 描述弹性字段1
|
|
|
- * @property {string|null} DescFlexField_PrivateDescSeg2 - 描述弹性字段2
|
|
|
- * @property {string|null} DescFlexField_PrivateDescSeg3 - 描述弹性字段3
|
|
|
- * @property {number|null} Department_ID - 部门ID
|
|
|
- * @property {string} Department_CODE - 部门编码
|
|
|
- * @property {string} Department_NAME - 部门名称
|
|
|
- * @property {number|null} Saleser_ID - 销售员ID
|
|
|
- * @property {string} Saleser_CODE - 销售员编码
|
|
|
- * @property {string} Saleser_NAME - 销售员名称
|
|
|
- * @property {number} TradeCurrency_ID - 交易货币ID
|
|
|
- * @property {string} TradeCurrency_CODE - 交易货币编码
|
|
|
- * @property {string} TradeCurrency_NAME - 交易货币名称
|
|
|
- * @property {number} PriceList_ID - 价格表ID
|
|
|
- * @property {string} PriceList_CODE - 价格表编码
|
|
|
- * @property {string} PriceList_NAME - 价格表名称
|
|
|
- * @property {boolean} IsTaxPrice - 是否含税价格
|
|
|
- * @property {number} ShippmentRule_ID - 发货规则ID
|
|
|
- * @property {string} ShippmentRule_CODE - 发货规则编码
|
|
|
- * @property {string} ShippmentRule_NAME - 发货规则名称
|
|
|
- * @property {number} RecervalTerm_ID - 收款条件ID
|
|
|
- * @property {string} RecervalTerm_CODE - 收款条件编码
|
|
|
- * @property {string} RecervalTerm_NAME - 收款条件名称
|
|
|
- * @property {number} ARConfirmTerm_ID - 应收立账条件ID
|
|
|
- * @property {string} ARConfirmTerm_CODE - 应收立账条件编码
|
|
|
- * @property {string} ARConfirmTerm_NAME - 应收立账条件名称
|
|
|
- */
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- * API响应数据类型定义
|
|
|
- * @typedef {Object} ApiResponse
|
|
|
- * @property {number} code - 响应码
|
|
|
- * @property {boolean} success - 是否成功
|
|
|
- * @property {string} statusText - 响应消息
|
|
|
- * @property {Object} data - 响应数据
|
|
|
- */
|
|
|
-
|
|
|
-/**
|
|
|
- * 分页响应数据类型定义
|
|
|
- * @typedef {Object} PageResponse
|
|
|
- * @property {CustomerItem[]} records - 数据记录
|
|
|
- * @property {number} total - 总记录数
|
|
|
- * @property {number} size - 每页数量
|
|
|
- * @property {number} current - 当前页码
|
|
|
- * @property {Array} orders - 排序信息
|
|
|
- * @property {boolean} optimizeCountSql - 是否优化count查询
|
|
|
- * @property {boolean} hitCount - 是否命中count缓存
|
|
|
- * @property {string|null} countId - count查询ID
|
|
|
- * @property {number|null} maxLimit - 最大限制
|
|
|
- * @property {boolean} searchCount - 是否查询count
|
|
|
- * @property {number} pages - 总页数
|
|
|
+ * @typedef {import('../types/common').CustomerQueryParams} CustomerQueryParams
|
|
|
+ * @typedef {import('../types/common').CustomerItem} CustomerItem
|
|
|
+ * @typedef {import('../types/common').CustomerListResponse} CustomerListResponse
|
|
|
+ * @typedef {import('../types/common').CustomerDetailResponse} CustomerDetailResponse
|
|
|
+ * @typedef {import('../types/common').ItemQueryParams} ItemQueryParams
|
|
|
+ * @typedef {import('../types/common').ItemRecord} ItemRecord
|
|
|
+ * @typedef {import('../types/common').ItemListResponse} ItemListResponse
|
|
|
*/
|
|
|
|
|
|
/**
|
|
@@ -106,7 +15,7 @@ import request from '@/router/axios';
|
|
|
* @param {number} [current=1] - 当前页码
|
|
|
* @param {number} [size=10] - 每页数量
|
|
|
* @param {CustomerQueryParams} [params={}] - 查询参数
|
|
|
- * @returns {Promise<ApiResponse<PageResponse>>} 客户档案列表响应
|
|
|
+ * @returns {Promise<CustomerListResponse>} 客户档案列表响应
|
|
|
*/
|
|
|
export const getCustomerList = async (current = 1, size = 10, params = {}) => {
|
|
|
return request({
|
|
@@ -123,7 +32,7 @@ export const getCustomerList = async (current = 1, size = 10, params = {}) => {
|
|
|
/**
|
|
|
* 获取客户档案详情
|
|
|
* @param {string} customerId - 客户ID
|
|
|
- * @returns {Promise<AxiosResponse<CustomerItem>>} 客户档案详情响应
|
|
|
+ * @returns {Promise<CustomerDetailResponse>} 客户档案详情响应
|
|
|
*/
|
|
|
export const getCustomerDetail = async (customerId) => {
|
|
|
return request({
|
|
@@ -132,76 +41,14 @@ export const getCustomerDetail = async (customerId) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-/**
|
|
|
- * 物料查询参数类型定义
|
|
|
- * @typedef {Object} ItemQueryParams
|
|
|
- * @property {number} [current=1] - 当前页码
|
|
|
- * @property {number} [size=10] - 每页数量
|
|
|
- * @property {string} [itemName] - 物料名称(模糊查询)
|
|
|
- */
|
|
|
-
|
|
|
-/**
|
|
|
- * 物料数据项类型定义
|
|
|
- * @typedef {Object} ItemRecord
|
|
|
- * @property {string} id - 记录ID
|
|
|
- * @property {string} createUser - 创建用户ID
|
|
|
- * @property {string} createDept - 创建部门ID
|
|
|
- * @property {string} createTime - 创建时间
|
|
|
- * @property {string} updateUser - 更新用户ID
|
|
|
- * @property {string} updateTime - 更新时间
|
|
|
- * @property {number} status - 状态 1-正常 0-禁用
|
|
|
- * @property {number} isDeleted - 是否删除 0-未删除 1-已删除
|
|
|
- * @property {number} ORG_ID - 组织ID
|
|
|
- * @property {string} ORG_CODE - 组织编码
|
|
|
- * @property {string} ORG_NAME - 组织名称
|
|
|
- * @property {number} Item_ID - 物料ID
|
|
|
- * @property {string} Item_Code - 物料编码
|
|
|
- * @property {string} Item_Name - 物料名称
|
|
|
- * @property {string} Item_PECS - 物料规格
|
|
|
- * @property {string} Item_Description - 物料描述
|
|
|
- * @property {string} Item_Code1 - 物料编码1
|
|
|
- * @property {string} Item_Code2 - 物料编码2
|
|
|
- * @property {number} MainItemCategory_ID - 主物料分类ID
|
|
|
- * @property {string} MainItemCategory_Code - 主物料分类编码
|
|
|
- * @property {string} MainItemCategory_Name - 主物料分类名称
|
|
|
- * @property {number} InventoryInfo_ID - 库存信息ID
|
|
|
- * @property {string} InventoryInfo_Code - 库存信息编码
|
|
|
- * @property {string} InventoryInfo_Name - 库存信息名称(单位)
|
|
|
- * @property {number|null} Warehouse_ID - 仓库ID
|
|
|
- * @property {string|null} Warehouse_Code - 仓库编码
|
|
|
- * @property {string|null} Warehouse_Name - 仓库名称
|
|
|
- * @property {number|null} Saleser_ID - 销售员ID
|
|
|
- * @property {string|null} Saleser_CODE - 销售员编码
|
|
|
- * @property {string|null} Saleser_NAME - 销售员名称
|
|
|
- * @property {number|null} ShipmentWarehouse_ID - 发货仓库ID
|
|
|
- * @property {string|null} ShipmentWarehouse_Code - 发货仓库编码
|
|
|
- * @property {string|null} ShipmentWarehouse_Name - 发货仓库名称
|
|
|
- * @property {string} createdon - 创建日期
|
|
|
- * @property {string} ModifiedOn - 修改日期
|
|
|
- */
|
|
|
|
|
|
-/**
|
|
|
- * 物料分页响应数据类型定义
|
|
|
- * @typedef {Object} ItemPageResponse
|
|
|
- * @property {ItemRecord[]} records - 物料数据记录
|
|
|
- * @property {number} total - 总记录数
|
|
|
- * @property {number} size - 每页数量
|
|
|
- * @property {number} current - 当前页码
|
|
|
- * @property {Array} orders - 排序信息
|
|
|
- * @property {boolean} optimizeCountSql - 是否优化count查询
|
|
|
- * @property {boolean} hitCount - 是否命中count缓存
|
|
|
- * @property {string|null} countId - count查询ID
|
|
|
- * @property {number|null} maxLimit - 最大限制
|
|
|
- * @property {boolean} searchCount - 是否查询count
|
|
|
- * @property {number} pages - 总页数
|
|
|
- */
|
|
|
|
|
|
/**
|
|
|
* 获取物料列表
|
|
|
* @param {number} [current=1] - 当前页码
|
|
|
* @param {number} [size=10] - 每页数量
|
|
|
* @param {ItemQueryParams} [params={}] - 查询参数
|
|
|
- * @returns {Promise<ApiResponse<ItemPageResponse>>} 物料列表响应
|
|
|
+ * @returns {Promise<ItemListResponse>} 物料列表响应
|
|
|
* @description 获取物料档案列表,支持按物料名称模糊查询和分页
|
|
|
* @example
|
|
|
* // 获取第一页10条数据
|
|
@@ -210,13 +57,6 @@ export const getCustomerDetail = async (customerId) => {
|
|
|
* // 按物料名称查询
|
|
|
* const result = await getItemList(1, 10, { itemName: '炭黑' });
|
|
|
*/
|
|
|
-/**
|
|
|
- * 获取物料列表
|
|
|
- * @param {number|string} current - 当前页码
|
|
|
- * @param {number|string} size - 每页数量
|
|
|
- * @param {ItemQueryParams} params - 查询参数
|
|
|
- * @returns {Promise<AxiosResponse<ItemPageResponse>>} 物料列表响应
|
|
|
- */
|
|
|
export const getItemList = async (current = 1, size = 10, params = {}) => {
|
|
|
return request({
|
|
|
url: '/api/blade-factory/api/factory/view-item',
|