import { FormConfig } from '@/types/basic-form';

export const INVENTORY_FORM_CONFIG: FormConfig[] = [
  {
    prop: 'itemName',
    label: '姓名：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入姓名',
    },
  },
   {
    prop: 'applicantCode',
    label: '工号：',
    component: 'ElInput',
    componentProps: {
      placeholder: '请输入工号',
    },
  },
   {
    prop: 'departmentName',
    label: '所属部门：',
    slot: 'reviewDepartmentId',
  },
  {
    prop: 'warehouseDate',
    label: '受伤时间：',
    component: 'ElDatePicker',
    componentProps: {
      type: 'date',
      placeholder: '请选择受伤时间',
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    label: '受伤原因：',
    prop: 'remarks',
    component: 'ElInput',
    componentProps: {
      type: 'textarea',
      rows: 5,
      placeholder: '请输入受伤原因',
    },
  },
  {
    prop: 'approvalTemplateId',
    label: '审批流程：',
    slot: 'approvalTemplateId',
  },
  {
    prop: 'accidentCertUrl',
    label: '事故报告：',
    slot: 'accidentReport',
  },
  {
    prop: 'powerAttorneyUrl',
    label: '委托书：',
    slot: 'powerOfAttorney',
  },
  {
    prop: 'addressConfirmUrl',
    label: '地址确认书：',
    slot: 'addressConfirmation',
  },
  {
    prop: 'applicationFormUrl',
    label: '申请表：',
    slot: 'applicationForm',
  },
  {
    prop: 'idCardUrl',
    label: '身份证正反面：',
    slot: 'idCard',
  },
  {
    prop: 'laborContractUrl',
    label: '劳动合同：',
    slot: 'laborContract',
  },
  {
    prop: 'initialMedicalCertUrl',
    label: '初次医疗证明：',
    slot: 'initialMedicalCertificate',
  },
  {
    prop: 'trusteeIdCardUrl',
    label: '被委托人员身份证正反面：',
    slot: 'agentIdCard',
  },
];

export const INVENTORY_FORM_DATA = {
  status: 'ENABLE',
  itemName: '',
  warehouseDate: '',
  remarks: '',
  accidentCertUrl: '',
  powerAttorneyUrl: '',
  addressConfirmUrl: '',
  applicationFormUrl: '',
  idCardUrl: '',
  laborContractUrl: '',
  initialMedicalCertUrl: '',
  trusteeIdCardUrl: '',
  applicantName: '',
  applicantCode: '',
  departmentCode: '',
  departmentName: '',
  approvalTemplateId: '',
  approvalOrder: 0,
};

export const INVENTORY_FORM_RULES = {
  status: [{ required: true, message: '请选择状态', trigger: 'change' }],
  itemName: [{ required: true, message: '请输入物品名称', trigger: 'blur' }],
  warehouseDate: [{ required: true, message: '请选择入库日期', trigger: 'change' }],
  applicantCode: [{ required: true, message: '请输入工号', trigger: 'blur' }],
  departmentCode: [{ required: true, message: '请选择所属部门', trigger: 'change' }],
  remarks: [{ required: true, message: '请输入受伤原因', trigger: 'blur' }],
  departmentName: [{ required: true, message: '请选择所属部门', trigger: 'change' }],
  approvalTemplateId: [{ required: true, message: '请选择审批流程', trigger: 'change' }],
  accidentCertUrl: [{ required: true, message: '请上传事故报告', trigger: 'change' }],
  powerAttorneyUrl: [{ required: true, message: '请上传委托书', trigger: 'change' }],
  addressConfirmUrl: [{ required: true, message: '请上传地址确认书', trigger: 'change' }],
  applicationFormUrl: [{ required: true, message: '请上传申请表', trigger: 'change' }],
  idCardUrl: [{ required: true, message: '请上传身份证正反面', trigger: 'change' }],
  laborContractUrl: [{ required: true, message: '请上传劳动合同', trigger: 'change' }],
  initialMedicalCertUrl: [{ required: true, message: '请上传初次医疗证明', trigger: 'change' }],
  trusteeIdCardUrl: [{ required: true, message: '请上传被委托人员身份证正反面', trigger: 'change' }],
};