Forráskód Böngészése

docs(forecast-form): 完善类型定义和注释

yz 2 hete
szülő
commit
f381182fcf

+ 1 - 0
src/components/forecast-form/forecast-form-mixin.js

@@ -879,6 +879,7 @@ export default {
 
     /**
      * 收集当前可见表单项的必填与数值规则错误信息(用于控制台打印)
+     * @this {ForecastFormMixinComponent & Vue}
      * @returns {string[]} 错误消息列表
      */
     collectValidationErrors() {

+ 15 - 1
src/components/forecast-form/types.d.ts

@@ -158,7 +158,7 @@ export interface ForecastFormMixinData {
   /** 品牌选项列表 */
   brandOptions: Array<SelectOption<number>>;
   /** 物料表格数据(来自用户关联商品 pjpfStockDescList),带预测数量字段 */
-  stockTableData: Array<Partial<import('@/api/types/order').PjpfStockDesc> & { forecastQuantity: number }>;
+  stockTableData: Array<Partial<import('@/api/types/order').PjpfStockDesc> & { forecastQuantity: number; brandCode?: string; storeInventory?: string }>;
   /** 表格加载状态 */
   tableLoading: boolean;
   /** 品牌描述列表(用于品牌信息匹配) */
@@ -204,6 +204,10 @@ export interface ForecastFormEvents {
   reset: () => void;
   /** 表单提交事件 */
   submit: (data: any) => void;
+  /** 表单提交错误事件 */
+  'submit-error': (error: any) => void;
+  /** v-model 可见性更新事件 */
+  'update:visible': (visible: boolean) => void;
 }
 
 /**
@@ -270,6 +274,14 @@ export interface ForecastFormMethods {
   handleMaterialSelected(materialData: MaterialSelectData): void;
   /** 获取当前库存 */
   getCurrentInventory(itemId: string | number): void;
+  /** 收集可见表单项的校验错误 */
+  collectValidationErrors(): string[];
+  /** 导入所选物料到下方表格 */
+  handleImportSelectedStock(): void;
+  /** 删除物料行 */
+  handleDelete(row: ForecastFormMixinData['stockTableData'][number], index: number): Promise<void>;
+  /** 合并编辑回显行的库存数量 */
+  mergeEchoStoreInventory(): Promise<void>;
   /** 提交(Avue 回调) */
   handleSubmit(): void;
   /** 重置 */
@@ -278,6 +290,8 @@ export interface ForecastFormMethods {
   submitForm(): Promise<void>;
   /** 加载当前用户客户信息(新增态) */
   loadCurrentCustomerInfo(): Promise<void>;
+  /** 可选:宿主组件用于禁用年月选择器的辅助方法 */
+  setYearMonthDisabled?: (disabled: boolean) => void;
 }
 
 /**