| | |
| | | }, |
| | | }, |
| | | { |
| | | component: 'Switch', |
| | | fieldName: 'syncMes', |
| | | label: '同步到MES', |
| | | defaultValue: true, |
| | | componentProps: { |
| | | checkedChildren: '是', |
| | | unCheckedChildren: '否', |
| | | }, |
| | | rules: z.boolean().default(true), |
| | | }, |
| | | { |
| | | component: "RadioGroup", |
| | | fieldName: "status", |
| | | label: "状态", |
| | |
| | | title: "单位", |
| | | 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, |
| | | }, |
| | | // 辅单位1/辅单位1换算比率/辅单位2/辅单位2换算比率:物料列表不再展示(表单里仍可维护),需要恢复就取消注释 |
| | | // { |
| | | // 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: "purchasePrice", |
| | | title: "采购价", |
| | | minWidth: 100, |
| | | formatter: ({ cellValue }) => { |
| | | return cellValue != null ? `¥${Number(cellValue).toFixed(2)}` : ""; |
| | | }, |
| | | }, |
| | | { |
| | | field: "salesPrice", |
| | | title: "销售价", |
| | | minWidth: 100, |
| | | formatter: ({ cellValue }) => { |
| | | return cellValue != null ? `¥${Number(cellValue).toFixed(2)}` : ""; |
| | | }, |
| | | }, |
| | | // 销售价:物料列表不再展示,需要恢复就取消注释 |
| | | // { |
| | | // field: "salesPrice", |
| | | // title: "销售价", |
| | | // minWidth: 100, |
| | | // formatter: ({ cellValue }) => { |
| | | // return cellValue != null ? `¥${Number(cellValue).toFixed(2)}` : ""; |
| | | // }, |
| | | // }, |
| | | { |
| | | field: "createTime", |
| | | title: "创建时间", |
| | | minWidth: 180, |
| | | formatter: "formatDateTime", |
| | | formatter: 'formatDate', |
| | | }, |
| | | { |
| | | field: "isBatchManaged", |
| | |
| | | { |
| | | field: "syncedMes", |
| | | title: "同步状态", |
| | | width: 90, |
| | | width: 100, |
| | | fixed: "right", |
| | | slots: { default: "syncedMes" }, |
| | | }, |
| | |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** 物料导入的表单 */ |
| | | export function useImportFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'file', |
| | | label: '物料数据', |
| | | component: 'Upload', |
| | | rules: 'required', |
| | | help: '仅允许导入 xls、xlsx 格式文件', |
| | | }, |
| | | { |
| | | fieldName: 'updateSupport', |
| | | label: '是否覆盖', |
| | | component: 'Switch', |
| | | componentProps: { |
| | | checkedChildren: '是', |
| | | unCheckedChildren: '否', |
| | | }, |
| | | rules: z.boolean().default(false), |
| | | help: '是否更新已经存在的物料数据', |
| | | }, |
| | | ]; |
| | | } |