feat(eims): 优化点检记录和点检汇总查询
| | |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'equName', |
| | | // label: '设备名称' |
| | | // }, |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'assetNo', |
| | | // label: '资产编号' |
| | | // }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设备名称' |
| | | fieldName: 'params.searchValue', |
| | | label: '关键字' |
| | | }, |
| | | // { |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // options: getDictOptions(DictEnum.EIMS_INSPECT_STATUS) |
| | | // }, |
| | | // fieldName: 'status', |
| | | // label: '状态' |
| | | // }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: '资产编号' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspName', |
| | | label: '点检项' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_STATUS) |
| | | }, |
| | | fieldName: 'status', |
| | | label: '状态' |
| | | component: 'RangePicker', |
| | | fieldName: 'planTime', |
| | | label: '点检日期' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_RESULT) |
| | | }, |
| | | fieldName: 'maintType', |
| | | fieldName: 'inspResult', |
| | | label: '点检结果' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // 在drawer里更新 这里不需要默认的componentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'inspDept', |
| | | label: '点检部门' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'inspUser', |
| | | label: '点检人' |
| | | } |
| | | // { |
| | | // component: 'TreeSelect', |
| | | // // 在drawer里更新 这里不需要默认的componentProps |
| | | // defaultValue: undefined, |
| | | // fieldName: 'inspDept', |
| | | // label: '点检部门' |
| | | // }, |
| | | // { |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // allowClear: true, |
| | | // showSearch: true, |
| | | // getPopupContainer |
| | | // }, |
| | | // fieldName: 'inspUser', |
| | | // label: '点检人' |
| | | // } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | // { |
| | | // title: '点检类型', |
| | | // field: 'inspType', |
| | | // minWidth: 120, |
| | | // slots: { |
| | | // default: ({ row }) => { |
| | | // return renderDict(row.inspType, DictEnum.EIMS_INSPECT_TYPE); |
| | | // } |
| | | // } |
| | | // }, |
| | | { |
| | | title: '点检类型', |
| | | field: 'inspType', |
| | | minWidth: 120, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.inspType, DictEnum.EIMS_INSPECT_TYPE); |
| | | } |
| | | } |
| | | title: '点检描述', |
| | | field: 'inspDesc', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: '点检人', |
| | |
| | | field: 'inspTime', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: '点检描述', |
| | | field: 'inspDesc', |
| | | minWidth: 200 |
| | | }, |
| | | |
| | | { |
| | | title: '验证人', |
| | | field: 'verifyUserName', |
| | |
| | | }, |
| | | collapsed: true, |
| | | schema: querySchema(), |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4' |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', |
| | | handleReset: async () => { |
| | | // eslint-disable-next-line no-use-before-define |
| | | const { formApi, reload } = tableApi; |
| | | await formApi.resetForm(); |
| | | const formValues = formApi.form.values; |
| | | formApi.setLatestSubmissionValues(formValues); |
| | | await reload(formValues); |
| | | }, |
| | | // 日期选择格式化 |
| | | fieldMappingTime: [['planTime', ['params[beginPlanTime]', 'params[endPlanTime]'], ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']]] |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'title', |
| | | // label: '标题' |
| | | // }, |
| | | // { |
| | | // component: 'Input', |
| | | // fieldName: 'assetNo', |
| | | // label: '资产编号' |
| | | // }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'title', |
| | | label: '标题' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: '资产编号' |
| | | fieldName: 'params.searchValue', |
| | | label: '关键字' |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | | fieldName: 'planTime', |
| | | label: '保养日期' |
| | | label: '点检日期' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | |
| | | Month = 'Month' |
| | | } |
| | | |
| | | const curViewMode = ref<ViewMode>(ViewMode.Month); |
| | | const curViewMode = ref<ViewMode>(ViewMode.Day); |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | | labelWidth: 80, |
| | |
| | | return tableApi.grid.getCheckboxRecords(); |
| | | } |
| | | |
| | | const dayBtn = ref<any>('default'); |
| | | const monBtn = ref<any>('primary'); |
| | | const dayBtn = ref<any>('primary'); |
| | | const monBtn = ref<any>('default'); |
| | | |
| | | function queryData(type: ViewMode) { |
| | | // TODO 日视图和月视图后端已统一方法 前端可删除日视图多余配置 |