| | |
| | | CommonStatusEnum, |
| | | DICT_TYPE, |
| | | MesAutoCodeRuleCode, |
| | | } from '..\..\..\..\packages\constants\src'; |
| | | import { getDictOptions } from '..\..\..\..\packages\effects\hooks\src'; |
| | | } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | |
| | | import { Button } from 'ant-design-vue'; |
| | | |
| | |
| | | label: '物料分类', |
| | | component: markRaw(MdItemTypeSelect), |
| | | componentProps: { |
| | | onChange: async (itemType: any) => { |
| | | onChange: async (itemType: { itemOrProduct?: string }) => { |
| | | await formApi?.setFieldValue( |
| | | 'itemOrProduct', |
| | | itemType?.itemOrProduct, |
| | |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | disabled: false, |
| | | disabled: true, |
| | | optionType: 'button', |
| | | options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), |
| | | }, |
| | |
| | | } |
| | | |
| | | /** 列表的字段 */ |
| | | export function useGridColumns( |
| | | onStatusChange?: ( |
| | | newStatus: number, |
| | | row: MesMdItemApi.Item, |
| | | ) => PromiseLike<boolean | undefined>, |
| | | ): VxeTableGridOptions<MesMdItemApi.Item>['columns'] { |
| | | export function useGridColumns(): VxeTableGridOptions<MesMdItemApi.Item>['columns'] { |
| | | return [ |
| | | { |
| | | field: 'code', |
| | |
| | | { |
| | | field: 'status', |
| | | title: '状态', |
| | | width: 120, |
| | | width: 100, |
| | | align: 'center', |
| | | cellRender: { |
| | | attrs: { beforeChange: onStatusChange }, |
| | | name: 'CellSwitch', |
| | | props: { |
| | | checkedValue: CommonStatusEnum.ENABLE, |
| | | unCheckedValue: CommonStatusEnum.DISABLE, |
| | | }, |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.COMMON_STATUS }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | ]; |
| | | } |
| | | |
| | | /** 物料选择弹窗搜索表单 */ |
| | | /** 品种选择弹窗搜索表单 */ |
| | | export function useItemSelectGridFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'code', |
| | | label: '物料编码', |
| | | label: '品种编码', |
| | | component: 'Input', |
| | | componentProps: { |
| | | allowClear: true, |
| | | placeholder: '请输入物料编码', |
| | | placeholder: '请输入品种编码', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'name', |
| | | label: '物料名称', |
| | | label: '品种名称', |
| | | component: 'Input', |
| | | componentProps: { |
| | | allowClear: true, |
| | | placeholder: '请输入物料名称', |
| | | placeholder: '请输入品种名称', |
| | | }, |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | /** 物料选择弹窗列表字段 */ |
| | | /** 品种选择弹窗列表字段 */ |
| | | export function useItemSelectGridColumns( |
| | | multiple = true, |
| | | ): VxeTableGridOptions<MesMdItemApi.Item>['columns'] { |
| | |
| | | { type: multiple ? 'checkbox' : 'radio', width: 50 }, |
| | | { |
| | | field: 'code', |
| | | title: '物料编码', |
| | | title: '品种编码', |
| | | width: 180, |
| | | }, |
| | | { |
| | | field: 'name', |
| | | title: '物料名称', |
| | | title: '品种名称', |
| | | minWidth: 160, |
| | | align: 'left', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | field: 'itemOrProduct', |
| | | title: '物料/产品', |
| | | title: '品种/产品', |
| | | width: 110, |
| | | align: 'center', |
| | | cellRender: { |