| | |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | import { getUnitPage } from '#/api/mdm/unit'; |
| | | import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse'; |
| | | |
| | | /** 物料类型选项 */ |
| | | export const ITEM_TYPE_OPTIONS = [ |
| | |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'specification', |
| | | label: '规格型号', |
| | | componentProps: { |
| | | placeholder: '请输入规格型号', |
| | | }, |
| | | }, |
| | | { |
| | | component: 'ApiSelect', |
| | | fieldName: 'unitMeasureId', |
| | | label: '计量单位', |
| | | rules: 'required', |
| | | formItemClass: 'col-span-1', |
| | | componentProps: { |
| | | placeholder: '请选择计量单位', |
| | | allowClear: true, |
| | |
| | | const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 }); |
| | | return res.list || []; |
| | | }, |
| | | labelField: 'name', |
| | | valueField: 'id', |
| | | }, |
| | | }, |
| | | { |
| | | component: 'ApiSelect', |
| | | fieldName: 'unitMeasureId2', |
| | | label: '辅单位1', |
| | | formItemClass: 'col-span-1', |
| | | componentProps: { |
| | | placeholder: '请选择辅单位1', |
| | | allowClear: true, |
| | | api: async () => { |
| | | const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 }); |
| | | return res.list || []; |
| | | }, |
| | | 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: async () => { |
| | | const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 }); |
| | | return res.list || []; |
| | | }, |
| | | 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: '默认仓库', |
| | | componentProps: { |
| | | placeholder: '请选择默认仓库', |
| | | allowClear: true, |
| | | api: getWarehouseSimpleList, |
| | | labelField: 'name', |
| | | valueField: 'id', |
| | | }, |
| | |
| | | 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: 'itemType', |
| | | title: '物料类型', |
| | | minWidth: 100, |