| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- import { FormConfig } from '@/types/basic-form';
- /** 隐患问题类别:1-规章制度类,2-建筑安全类 */
- export const DANGER_TYPE_OPTIONS = [
- { label: '规章制度类', value: 1 },
- { label: '建筑安全类', value: 2 },
- ];
- /** 问题主要原因:1-人的不安全行为,2-物的不安全状态,3-环境的不利影响,4-管理缺陷 */
- export const REASON_OPTIONS = [
- { label: '人的不安全行为', value: 1 },
- { label: '物的不安全状态', value: 2 },
- { label: '环境的不利影响', value: 3 },
- { label: '管理缺陷', value: 4 },
- ];
- /** 隐患台账新增/编辑表单配置(字段顺序:隐患问题类别、隐患问题、问题主要原因、任务来源、整改要求、整改日期、复查人员所属部门、复查人员、举一反三是否推送、举一反三内容、举一反三责任部门、举一反三时限) */
- export const HIDDEN_DANGER_FORM_CONFIG: FormConfig[] = [
- {
- prop: 'typeId',
- label: '隐患问题类别:',
- component: 'ElSelect',
- componentProps: {
- placeholder: '请选择隐患问题类别',
- style: { width: '100%' },
- },
- selectOptions: DANGER_TYPE_OPTIONS,
- },
- {
- prop: 'dangerProblem',
- label: '隐患问题:',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入隐患问题描述',
- },
- },
- {
- prop: 'reasonId',
- label: '问题主要原因:',
- component: 'ElSelect',
- componentProps: {
- placeholder: '请选择问题主要原因',
- style: { width: '100%' },
- },
- selectOptions: REASON_OPTIONS,
- },
- {
- prop: 'taskSource',
- label: '任务来源:',
- component: 'ElInput',
- componentProps: {
- placeholder: '如:上级检查、院内自查',
- },
- },
- {
- prop: 'rectificationRequirement',
- label: '整改要求:',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入整改要求',
- },
- },
- {
- prop: 'rectificationDeadline',
- label: '整改日期:',
- component: 'ElDatePicker',
- componentProps: {
- type: 'date',
- placeholder: '请选择整改日期',
- valueFormat: 'YYYY-MM-DD',
- style: { width: '100%' },
- },
- },
- {
- prop: 'reviewDepartmentId',
- label: '复查人员所属部门:',
- slot: 'reviewDepartmentId',
- componentProps: {
- placeholder: '请选择复查人员所属部门',
- style: { width: '100%' },
- },
- },
- {
- prop: 'reviewPersonId',
- label: '复查人员:',
- slot: 'reviewPerson',
- componentProps: {
- placeholder: '请选择复查人员',
- style: { width: '100%' },
- },
- },
- {
- prop: 'isDrawLessonsPush',
- label: '举一反三是否推送:',
- slot: 'isDrawLessonsPush',
- },
- // {
- // prop: 'drawLessonsContent',
- // label: '举一反三内容:',
- // component: 'ElInput',
- // componentProps: {
- // placeholder: '选填,推送举一反三时建议填写',
- // },
- // },
- // {
- // prop: 'drawLessonsDepartmentIds',
- // label: '举一反三责任部门:',
- // slot: 'drawLessonsDepartmentIds',
- // componentProps: {
- // placeholder: '请选择举一反三责任部门,可多选',
- // style: { width: '100%' },
- // },
- // },
- // {
- // prop: 'drawLessonsDeadline',
- // label: '举一反三时限:',
- // component: 'ElDatePicker',
- // componentProps: {
- // type: 'date',
- // placeholder: '请选择举一反三时限',
- // valueFormat: 'YYYY-MM-DD',
- // style: { width: '100%' },
- // },
- // },
- ];
- /**
- * 整改详情完整表单配置:原有字段(只读)+ 整改完成情况、整改完成时间、附件
- * 直接用于整改隐患页的 BasicForm
- */
- export const HIDDEN_DANGER_RECTIFY_FORM_CONFIG: FormConfig[] = [
- {
- prop: 'typeId',
- label: '隐患问题类别:',
- component: 'ElSelect',
- componentProps: {
- placeholder: '请选择隐患问题类别',
- style: { width: '100%' },
- disabled: true,
- },
- selectOptions: DANGER_TYPE_OPTIONS,
- },
- {
- prop: 'dangerProblem',
- label: '隐患问题:',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入隐患问题描述',
- disabled: true,
- },
- },
- {
- prop: 'reasonId',
- label: '问题主要原因:',
- component: 'ElSelect',
- componentProps: {
- placeholder: '请选择问题主要原因',
- style: { width: '100%' },
- disabled: true,
- },
- selectOptions: REASON_OPTIONS,
- },
- {
- prop: 'taskSource',
- label: '任务来源:',
- component: 'ElInput',
- componentProps: {
- placeholder: '如:上级检查、院内自查',
- disabled: true,
- },
- },
- {
- prop: 'rectificationRequirement',
- label: '整改要求:',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入整改要求',
- disabled: true,
- },
- },
- {
- prop: 'rectificationDeadline',
- label: '整改日期:',
- component: 'ElDatePicker',
- componentProps: {
- type: 'date',
- placeholder: '请选择整改日期',
- valueFormat: 'YYYY-MM-DD',
- style: { width: '100%' },
- disabled: true,
- },
- },
- {
- prop: 'reviewDepartmentId',
- label: '复查人员所属部门:',
- slot: 'reviewDepartmentId',
- componentProps: {
- placeholder: '请选择复查人员所属部门',
- style: { width: '100%' },
- disabled: true,
- },
- },
- {
- prop: 'reviewPersonId',
- label: '复查人员:',
- slot: 'reviewPerson',
- componentProps: {
- placeholder: '请选择复查人员',
- style: { width: '100%' },
- disabled: true,
- },
- },
- {
- prop: 'isDrawLessonsPush',
- label: '举一反三是否推送:',
- slot: 'isDrawLessonsPush',
- componentProps: { disabled: true },
- },
- // {
- // prop: 'drawLessonsContent',
- // label: '举一反三内容:',
- // component: 'ElInput',
- // componentProps: {
- // placeholder: '选填,推送举一反三时建议填写',
- // disabled: true,
- // },
- // },
- // {
- // prop: 'drawLessonsDepartmentIds',
- // label: '举一反三责任部门:',
- // component: 'ElSelect',
- // // slot: 'drawLessonsDepartmentIds',
- // componentProps: {
- // placeholder: '请选择举一反三责任部门,可多选',
- // style: { width: '100%' },
- // disabled: true,
- // },
- // },
- // {
- // prop: 'drawLessonsDeadline',
- // label: '举一反三时限:',
- // component: 'ElDatePicker',
- // componentProps: {
- // type: 'date',
- // placeholder: '请选择举一反三时限',
- // valueFormat: 'YYYY-MM-DD',
- // style: { width: '100%' },
- // disabled: true,
- // },
- // },
- // 整改详情额外字段(可编辑,填写后点「整改」提交)
- {
- prop: 'rectificationCompletionStatus',
- label: '整改完成情况:',
- component: 'ElInput',
- componentProps: {
- placeholder: '请输入整改完成情况',
- },
- },
- {
- prop: 'rectificationCompletionTime',
- label: '整改完成时间:',
- component: 'ElDatePicker',
- componentProps: {
- type: 'date',
- placeholder: '请选择整改完成时间',
- valueFormat: 'YYYY-MM-DD',
- style: { width: '100%' },
- },
- },
- {
- prop: 'attachments',
- label: '附件:',
- slot: 'attachments',
- componentProps: {
- placeholder: '上传附件文档',
- },
- },
- ];
- /**
- * 复查详情完整表单配置:整改字段全部禁用 + 复查意见(可编辑,清空)
- * 从主列表「复查」进入,底部按钮为「审查通过」「审查不通过」
- * 说明:附件字段继续复用整改/新增时的 Upload 组件(通过插槽渲染),仅在复查详情中禁用交互
- */
- export const HIDDEN_DANGER_REVIEW_FORM_CONFIG: FormConfig[] = [
- ...HIDDEN_DANGER_RECTIFY_FORM_CONFIG.map((item) => ({
- ...item,
- componentProps: { ...item.componentProps, disabled: true },
- })),
- {
- prop: 'reviewComments',
- label: '复查意见:',
- slot: 'reviewComments',
- componentProps: {
- placeholder: '请输入复查意见(选填),限300字',
- },
- },
- ];
- export const HIDDEN_DANGER_FORM_DATA = {
- typeId: undefined as number | undefined,
- dangerProblem: '',
- reasonId: undefined as number | undefined,
- taskSource: '',
- rectificationRequirement: '',
- rectificationDeadline: '',
- reviewDepartmentId: undefined as number | undefined,
- reviewPersonId: undefined as number | undefined,
- reviewPersonName: '',
- isDrawLessonsPush: 0,
- drawLessonsContent: '',
- drawLessonsDepartmentIds: '',
- drawLessonsDeadline: '',
- // 提交接口需要,下发时再填
- rectificationDepartmentIds: '',
- rectificationResponsiblePerson: '',
- // 整改详情展示(接口可能返回)
- rectificationCompletionStatus: '',
- rectificationCompletionTime: '',
- attachments: '',
- reviewComments: '',
- };
- export const HIDDEN_DANGER_FORM_RULES = {
- typeId: [{ required: true, message: '请选择隐患问题类别', trigger: 'change' }],
- dangerProblem: [{ required: true, message: '请输入隐患问题', trigger: 'blur' }],
- reasonId: [{ required: true, message: '请选择问题主要原因', trigger: 'change' }],
- taskSource: [{ required: true, message: '请输入任务来源', trigger: 'blur' }],
- rectificationRequirement: [{ required: true, message: '请输入整改要求', trigger: 'blur' }],
- rectificationDeadline: [{ required: true, message: '请选择整改日期', trigger: 'change' }],
- reviewDepartmentId: [{ required: true, message: '请选择复查人员所属部门', trigger: 'change' }],
- reviewPersonId: [{ required: true, message: '请选择复查人员', trigger: 'change' }],
- isDrawLessonsPush: [{ required: true, message: '请选择举一反三是否推送', trigger: 'change' }],
- drawLessonsContent: [
- {
- required: true,
- message: '请输入举一反三内容',
- trigger: 'blur',
- },
- ],
- drawLessonsDepartmentIds: [
- {
- required: true,
- message: '请选择举一反三责任部门',
- trigger: 'change',
- },
- ],
- drawLessonsDeadline: [
- {
- required: true,
- message: '请选择举一反三截止日期',
- trigger: 'change',
- },
- ],
- };
|