车间能级提升-智能设备管理系统
zhuguifei
2025-04-27 d7862b2890b68743ec9c4fc05800bb23ec9b412e
eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx
@@ -3,9 +3,14 @@
import { DictEnum } from '@vben/constants';
import { getPopupContainer } from '@vben/utils';
import dayjs from 'dayjs';
import { type FormSchemaGetter } from '#/adapter/form';
import { REPAIR_REQ_TYPE } from '#/constants/dict';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
const curDateTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
export const querySchema: FormSchemaGetter = () => [
  {
@@ -27,7 +32,7 @@
    // 在drawer里更新 这里不需要默认的componentProps
    defaultValue: undefined,
    fieldName: 'reqDept',
    label: '报修部门',
    label: '报修部门'
    // rules: 'selectRequired',
  },
  {
@@ -74,6 +79,23 @@
export const columns: VxeGridProps['columns'] = [
  { type: 'checkbox', width: 60, fixed: 'left' },
  {
    title: '设备(工具)名称',
    sortable: true,
    minWidth: 150,
    fixed: 'left',
    slots: {
      default: ({ row }) => {
        if (row.reqType === REPAIR_REQ_TYPE.EQU) {
          return row.equName;
        } else if (row.reqType === REPAIR_REQ_TYPE.FIXTURE) {
          return row.fixtureName;
        } else {
          return '';
        }
      }
    }
  },
  {
    title: '报修单号',
    field: 'code',
    minWidth: 160,
@@ -89,6 +111,11 @@
        return renderDict(row.status, DictEnum.REPAIR_REQ_STATUS);
      }
    }
  },
  {
    title: '维修单号',
    field: 'resCode',
    minWidth: 200
  },
  {
    title: '报修类型',
@@ -108,10 +135,10 @@
    minWidth: 200
  },
  {
    title: '设备名称',
    field: 'equName',
    title: '发生时间',
    field: 'occTime',
    sortable: true,
    minWidth: 120
    minWidth: 200
  },
  {
    title: '故障类别',
@@ -119,6 +146,9 @@
    minWidth: 100,
    slots: {
      default: ({ row }) => {
        if(!row.faultType){
          return ''
        }
        return renderDict(row.faultType, DictEnum.REPAIR_FAULT_TYPE);
      }
    }
@@ -159,7 +189,7 @@
  {
    component: 'Select',
    componentProps: {
      getPopupContainer,
      getPopupContainer
    },
    fieldName: 'reqType',
    label: '报修类型',
@@ -212,7 +242,12 @@
      getPopupContainer,
      options: getDictOptions(DictEnum.REPAIR_REQ_STATUS)
    },
    dependencies: {
      show: () => false,
      triggerFields: ['']
    },
    fieldName: 'status',
    defaultValue: '0',
    label: '处理状态'
  },
  {
@@ -223,6 +258,7 @@
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      getPopupContainer
    },
    defaultValue: curDateTime,
    fieldName: 'reqTime',
    label: '报修时间'
  },
@@ -281,3 +317,41 @@
    label: '报修人'
  }
];
export const modalSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: ['']
    },
    fieldName: 'id'
  },
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: ['']
    },
    fieldName: 'batchReqIds'
  },
  {
    component: 'TreeSelect',
    // 在drawer里更新 这里不需要默认的componentProps
    defaultValue: undefined,
    fieldName: 'resDept',
    label: '维修部门',
    help: `报修人员所属部门`
    // rules: 'selectRequired',
  },
  {
    component: 'Select',
    componentProps: {
      showSearch: true,
      allowClear: true,
      getPopupContainer
    },
    fieldName: 'resUser',
    label: '维修人'
  }
];