| | |
| | | }, |
| | | }, |
| | | { |
| | | component: "ApiSelect", |
| | | fieldName: "unitMeasureId2", |
| | | label: "辅单位1", |
| | | formItemClass: "col-span-1", |
| | | componentProps: { |
| | | placeholder: "请选择辅单位1", |
| | | allowClear: true, |
| | | api: getUnitListCached, |
| | | labelField: "name", |
| | | valueField: "id", |
| | | }, |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "unitMeasureRate1", |
| | | label: "辅单位1换算比率", |
| | | formItemClass: "col-span-1", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | precision: 6, |
| | | placeholder: "请输入换算比率", |
| | | }, |
| | | }, |
| | | { |
| | | component: "ApiSelect", |
| | | fieldName: "unitMeasureId3", |
| | | label: "辅单位2", |
| | | formItemClass: "col-span-1", |
| | | componentProps: { |
| | | placeholder: "请选择辅单位2", |
| | | allowClear: true, |
| | | api: getUnitListCached, |
| | | labelField: "name", |
| | | valueField: "id", |
| | | }, |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "unitMeasureRate2", |
| | | label: "辅单位2换算比率", |
| | | formItemClass: "col-span-1", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | precision: 6, |
| | | placeholder: "请输入换算比率", |
| | | }, |
| | | }, |
| | | { |
| | | component: 'ApiSelect', |
| | | fieldName: 'warehouseId', |
| | | label: '默认仓库', |
| | |
| | | }, |
| | | }, |
| | | { |
| | | component: "Input", |
| | | fieldName: "barCode", |
| | | label: "条码", |
| | | componentProps: { |
| | | placeholder: "请输入条码", |
| | | }, |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "salesPrice", |
| | | label: "销售价", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: "请输入销售价", |
| | | }, |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "costPrice", |
| | | label: "成本价", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: "请输入成本价", |
| | | }, |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "safetyStock", |
| | | label: "安全库存", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: "请输入安全库存", |
| | | }, |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "minStock", |
| | | label: "最低库存", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: "请输入最低库存", |
| | | }, |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "maxStock", |
| | | label: "最高库存", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: "请输入最高库存", |
| | | }, |
| | | }, |
| | | { |
| | | component: 'Switch', |
| | | fieldName: 'isBatchManaged', |
| | | label: '批次管理', |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | rules: z.boolean().default(false), |
| | | }, |
| | | { |
| | | component: "InputNumber", |
| | | fieldName: "expiryDay", |
| | | label: "有效期(天)", |
| | | componentProps: { |
| | | class: "!w-full", |
| | | min: 0, |
| | | placeholder: "请输入有效期", |
| | | }, |
| | | }, |
| | | { |
| | | component: 'Switch', |
| | | fieldName: 'syncMes', |
| | | label: '同步到MES', |
| | | defaultValue: true, |
| | | componentProps: { |
| | | checkedChildren: '是', |
| | | unCheckedChildren: '否', |
| | | }, |
| | | rules: z.boolean().default(true), |
| | | }, |
| | | { |
| | | component: "RadioGroup", |
| | | fieldName: "status", |
| | | label: "状态", |
| | |
| | | optionType: "button", |
| | | }, |
| | | rules: z.number().default(CommonStatusEnum.ENABLE), |
| | | }, |
| | | { |
| | | component: "Textarea", |
| | | fieldName: "remark", |
| | | label: "备注", |
| | | formItemClass: "col-span-2", |
| | | componentProps: { |
| | | placeholder: "请输入备注", |
| | | rows: 3, |
| | | }, |
| | | }, |
| | | // ===== 批次属性配置(isBatchManaged = true 时显示) ===== |
| | | { |
| | | component: "Divider", |
| | | fieldName: "batchConfigDivider", |
| | | label: "批次属性配置", |
| | | formItemClass: "col-span-2", |
| | | componentProps: { |
| | | orientation: "left", |
| | | plain: true, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "Switch", |
| | | fieldName: "produceDateFlag", |
| | | label: "生产日期必填", |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "Switch", |
| | | fieldName: "expireDateFlag", |
| | | label: "有效期必填", |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "Switch", |
| | | fieldName: "receiptDateFlag", |
| | | label: "入库日期必填", |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "Switch", |
| | | fieldName: "vendorFlag", |
| | | label: "供应商必填", |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "Switch", |
| | | fieldName: "purchaseOrderCodeFlag", |
| | | label: "采购订单号必填", |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "Switch", |
| | | fieldName: "lotNumberFlag", |
| | | label: "生产批号必填", |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | { |
| | | component: "Switch", |
| | | fieldName: "qualityStatusFlag", |
| | | label: "质量状态必填", |
| | | defaultValue: false, |
| | | componentProps: { |
| | | class: "w-auto", |
| | | checkedChildren: "是", |
| | | unCheckedChildren: "否", |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ["isBatchManaged"], |
| | | show: (values) => values.isBatchManaged === true, |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | |
| | | minWidth: 80, |
| | | }, |
| | | { |
| | | field: "unitMeasureName2", |
| | | title: "辅单位1", |
| | | minWidth: 80, |
| | | }, |
| | | { |
| | | field: "unitMeasureRate1", |
| | | title: "辅单位1换算比率", |
| | | minWidth: 130, |
| | | }, |
| | | { |
| | | field: "unitMeasureName3", |
| | | title: "辅单位2", |
| | | minWidth: 80, |
| | | }, |
| | | { |
| | | field: "unitMeasureRate2", |
| | | title: "辅单位2换算比率", |
| | | minWidth: 130, |
| | | }, |
| | | { |
| | | field: "warehouseName", |
| | | title: "默认仓库", |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: "salesPrice", |
| | | title: "销售价", |
| | | minWidth: 100, |
| | | formatter: ({ cellValue }) => { |
| | | return cellValue != null ? `¥${Number(cellValue).toFixed(2)}` : ""; |
| | | }, |
| | | }, |
| | | { |
| | | field: "createTime", |
| | | title: "创建时间", |
| | | minWidth: 180, |
| | | formatter: "formatDateTime", |
| | | }, |
| | | { |
| | | field: "isBatchManaged", |
| | | title: "批次管理", |
| | | width: 80, |
| | | fixed: "right", |
| | | slots: { default: "isBatchManaged" }, |
| | | }, |
| | | { |
| | | field: "syncedMes", |
| | | title: "同步状态", |
| | | width: 100, |
| | | fixed: "right", |
| | | slots: { default: "syncedMes" }, |
| | | }, |
| | | { |
| | | field: "status", |