xiaoyi
5 天以前 5c243d9d05da668a32b1bc9a4f543ea081488d11
src/views/mes/md/item/data.ts
@@ -9,8 +9,8 @@
  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';
@@ -111,7 +111,7 @@
      component: 'RadioGroup',
      componentProps: {
        buttonStyle: 'solid',
        disabled: false,
        disabled: true,
        optionType: 'button',
        options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
      },
@@ -176,6 +176,15 @@
        show: (values) => Boolean(values.safeStockFlag),
      },
      rules: z.number().default(0),
    },
    {
      fieldName: 'materialCategory',
      label: '物资分类',
      component: 'Select',
      componentProps: {
        options: getDictOptions(DICT_TYPE.MES_MATERIAL_CATEGORY, 'number'),
        placeholder: '请选择物资分类',
      },
    },
    {
      fieldName: 'remark',
@@ -257,12 +266,7 @@
}
/** 列表的字段 */
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',
@@ -303,6 +307,16 @@
      },
    },
    {
      field: 'materialCategory',
      title: '物资分类',
      width: 120,
      align: 'center',
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.MES_MATERIAL_CATEGORY },
      },
    },
    {
      field: 'safeStockFlag',
      title: '安全库存',
      width: 120,
@@ -315,15 +329,11 @@
    {
      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 },
      },
    },
    {