|
@@ -1,10 +1,10 @@
|
|
|
/**
|
|
|
- * @fileoverview 订单表单相关常量定义
|
|
|
- * @description 定义订单表单组件使用的枚举值和常量
|
|
|
+ * @fileoverview 订单表单相关常量定义和类型定义
|
|
|
+ * @description 定义订单表单组件使用的枚举值、常量和TypeScript类型注释
|
|
|
*/
|
|
|
|
|
|
// 导入明细管理中的状态定义和工具函数
|
|
|
-import {
|
|
|
+import {
|
|
|
ORDER_ITEM_STATUS,
|
|
|
getOrderItemStatusLabel,
|
|
|
getOrderItemStatusTagType,
|
|
@@ -46,11 +46,30 @@ export const OrderStatus = {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 物料明细状态枚举 - 使用明细管理中的标准状态定义
|
|
|
+ * 物料明细数据来源枚举
|
|
|
* @readonly
|
|
|
- * @enum {number}
|
|
|
+ * @enum {string}
|
|
|
+ */
|
|
|
+export const MaterialDetailDataSource = {
|
|
|
+ /** 远程加载的数据(从订单获取) */
|
|
|
+ REMOTE: 'REMOTE',
|
|
|
+ /** 用户导入的数据 */
|
|
|
+ IMPORTED: 'IMPORTED'
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 物料明细状态枚举
|
|
|
+ * @readonly
|
|
|
+ * @enum {string}
|
|
|
*/
|
|
|
-export const MaterialDetailStatus = ORDER_ITEM_STATUS
|
|
|
+export const MaterialDetailStatus = {
|
|
|
+ /** 待处理 */
|
|
|
+ PENDING: '0',
|
|
|
+ /** 已确认 */
|
|
|
+ CONFIRMED: '1',
|
|
|
+ /** 已取消 */
|
|
|
+ CANCELLED: '2'
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 订单类型选项列表
|
|
@@ -98,8 +117,107 @@ export const MATERIAL_DETAIL_STATUS_OPTIONS = [
|
|
|
]
|
|
|
|
|
|
// 导出明细状态工具函数供其他组件使用
|
|
|
-export {
|
|
|
+export {
|
|
|
getOrderItemStatusLabel as getMaterialDetailStatusLabel,
|
|
|
getOrderItemStatusTagType as getMaterialDetailStatusTagType,
|
|
|
getOrderItemStatusColor as getMaterialDetailStatusColor
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+// ==================== JSDoc 类型定义 ====================
|
|
|
+
|
|
|
+/**
|
|
|
+ * 物料明细记录
|
|
|
+ * @typedef {Object} MaterialDetailRecord
|
|
|
+ * @property {string} id - 记录ID
|
|
|
+ * @property {string} materialCode - 物料编码
|
|
|
+ * @property {string} materialName - 物料名称
|
|
|
+ * @property {string} specs - 规格型号
|
|
|
+ * @property {string} unit - 单位
|
|
|
+ * @property {number} quantity - 数量
|
|
|
+ * @property {number} unitPrice - 单价
|
|
|
+ * @property {number} totalPrice - 总价
|
|
|
+ * @property {string} remark - 备注
|
|
|
+ * @property {string} status - 状态
|
|
|
+ * @property {string} dataSource - 数据来源
|
|
|
+ * @property {string} mainItemCategoryId - 主物料分类ID
|
|
|
+ * @property {string} mainItemCategoryName - 主物料分类名称
|
|
|
+ * @property {string} subItemCategoryId - 子物料分类ID
|
|
|
+ * @property {string} subItemCategoryName - 子物料分类名称
|
|
|
+ * @property {string} brandId - 品牌ID
|
|
|
+ * @property {string} brandName - 品牌名称
|
|
|
+ * @property {string} supplierCode - 供应商编码
|
|
|
+ * @property {string} supplierName - 供应商名称
|
|
|
+ * @property {Date} createTime - 创建时间
|
|
|
+ * @property {Date} updateTime - 更新时间
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * 订单表单模型
|
|
|
+ * @typedef {Object} OrderFormModel
|
|
|
+ * @property {string} orderCode - 订单编码
|
|
|
+ * @property {string} orderType - 订单类型
|
|
|
+ * @property {string} orderStatus - 订单状态
|
|
|
+ * @property {string} customerCode - 客户编码
|
|
|
+ * @property {string} customerName - 客户名称
|
|
|
+ * @property {string} contactPerson - 联系人
|
|
|
+ * @property {string} contactPhone - 联系电话
|
|
|
+ * @property {string} deliveryAddress - 交货地址
|
|
|
+ * @property {Date} expectedDeliveryDate - 预期交货日期
|
|
|
+ * @property {string} remark - 备注
|
|
|
+ * @property {MaterialDetailRecord[]} materialDetails - 物料明细列表
|
|
|
+ * @property {number} totalAmount - 订单总金额
|
|
|
+ * @property {Date} createTime - 创建时间
|
|
|
+ * @property {Date} updateTime - 更新时间
|
|
|
+ * @property {string} createdBy - 创建人
|
|
|
+ * @property {string} updatedBy - 更新人
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * 物料明细查询参数
|
|
|
+ * @typedef {Object} MaterialDetailQueryParams
|
|
|
+ * @property {string} [materialCode] - 物料编码
|
|
|
+ * @property {string} [materialName] - 物料名称
|
|
|
+ * @property {string} [mainItemCategoryId] - 主物料分类ID
|
|
|
+ * @property {string} [subItemCategoryId] - 子物料分类ID
|
|
|
+ * @property {string} [brandId] - 品牌ID
|
|
|
+ * @property {number} [pageNum] - 页码
|
|
|
+ * @property {number} [pageSize] - 每页大小
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * 物料删除事件数据
|
|
|
+ * @typedef {Object} MaterialDeleteEventData
|
|
|
+ * @property {string} id - 要删除的物料明细ID
|
|
|
+ * @property {number} index - 在列表中的索引
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * 验证规则
|
|
|
+ * @typedef {Object} ValidationRule
|
|
|
+ * @property {boolean} required - 是否必填
|
|
|
+ * @property {string} message - 验证失败消息
|
|
|
+ * @property {string} [trigger] - 触发方式
|
|
|
+ * @property {Function} [validator] - 自定义验证函数
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * API响应数据结构
|
|
|
+ * @typedef {Object} ApiResponse
|
|
|
+ * @property {number} code - 响应状态码
|
|
|
+ * @property {string} message - 响应消息
|
|
|
+ * @property {*} data - 响应数据
|
|
|
+ * @property {boolean} success - 是否成功
|
|
|
+ * @property {number} timestamp - 时间戳
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * 分页响应数据结构
|
|
|
+ * @typedef {Object} PaginatedResponse
|
|
|
+ * @property {Array} records - 数据记录列表
|
|
|
+ * @property {number} total - 总记录数
|
|
|
+ * @property {number} size - 每页大小
|
|
|
+ * @property {number} current - 当前页码
|
|
|
+ * @property {number} pages - 总页数
|
|
|
+ * @property {boolean} hasNext - 是否有下一页
|
|
|
+ * @property {boolean} hasPrevious - 是否有上一页
|
|
|
+ */
|