form.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. import type { FormConfig } from '@/types/basic-form';
  2. // 特种设备设施 - 基础表单配置(新增/编辑可用,查看时外层禁用)
  3. export const SPECIAL_EQUIPMENT_FORM_CONFIG: FormConfig[] = [
  4. {
  5. prop: 'deviceId',
  6. label: '设备ID:',
  7. component: 'ElInput',
  8. componentProps: {
  9. placeholder: '',
  10. },
  11. },
  12. {
  13. prop: 'assetId',
  14. label: '设备固资ID:',
  15. component: 'ElInput',
  16. componentProps: {
  17. placeholder: '',
  18. },
  19. },
  20. {
  21. prop: 'deviceName',
  22. label: '设备名称:',
  23. component: 'ElInput',
  24. componentProps: {
  25. placeholder: '',
  26. },
  27. },
  28. {
  29. prop: 'useUnit',
  30. label: '使用单位:',
  31. component: 'ElInput',
  32. componentProps: {
  33. placeholder: '',
  34. },
  35. },
  36. {
  37. prop: 'categoryName',
  38. label: '设备类别:',
  39. component: 'ElInput',
  40. componentProps: {
  41. placeholder: '',
  42. },
  43. },
  44. {
  45. prop: 'typeName',
  46. label: '设备种类:',
  47. component: 'ElInput',
  48. componentProps: {
  49. placeholder: '',
  50. },
  51. },
  52. {
  53. prop: 'registerCode',
  54. label: '注册代码:',
  55. component: 'ElInput',
  56. componentProps: {
  57. placeholder: '',
  58. },
  59. },
  60. {
  61. prop: 'licenseNo',
  62. label: '使用证号:',
  63. component: 'ElInput',
  64. componentProps: {
  65. placeholder: '',
  66. },
  67. },
  68. {
  69. prop: 'deviceCode',
  70. label: '设备编码:',
  71. component: 'ElInput',
  72. componentProps: {
  73. placeholder: '',
  74. },
  75. },
  76. {
  77. prop: 'safeLocation',
  78. label: '安全地点:',
  79. component: 'ElInput',
  80. componentProps: {
  81. placeholder: '',
  82. },
  83. },
  84. {
  85. prop: 'useDepartment',
  86. label: '使用部门:',
  87. component: 'ElInput',
  88. componentProps: {
  89. placeholder: '',
  90. },
  91. },
  92. {
  93. prop: 'responsibilityDeptId',
  94. label: '责任部门:',
  95. slot: 'responsibilityDept',
  96. },
  97. {
  98. prop: 'responsiblePerson',
  99. label: '责任人:',
  100. component: 'ElInput',
  101. componentProps: {
  102. placeholder: '',
  103. },
  104. },
  105. {
  106. prop: 'jobNo',
  107. label: '工号:',
  108. component: 'ElInput',
  109. componentProps: {
  110. placeholder: '',
  111. },
  112. },
  113. {
  114. prop: 'factoryNo',
  115. label: '出厂编号:',
  116. component: 'ElInput',
  117. componentProps: {
  118. placeholder: '',
  119. },
  120. },
  121. {
  122. prop: 'productionDate',
  123. label: '生产日期:',
  124. component: 'ElDatePicker',
  125. componentProps: {
  126. type: 'date',
  127. valueFormat: 'YYYY-MM-DD',
  128. placeholder: '请选择生产日期',
  129. },
  130. },
  131. {
  132. prop: 'startUseDate',
  133. label: '启用日期:',
  134. component: 'ElDatePicker',
  135. componentProps: {
  136. type: 'date',
  137. valueFormat: 'YYYY-MM-DD',
  138. placeholder: '请选择启用日期',
  139. },
  140. },
  141. {
  142. prop: 'inspectionCycle',
  143. label: '检测周期(天):',
  144. component: 'ElInputNumber',
  145. componentProps: {
  146. min: 1,
  147. precision: 0,
  148. controlsPosition: 'right',
  149. },
  150. },
  151. {
  152. prop: 'useYears',
  153. label: '使用年限(年):',
  154. component: 'ElInputNumber',
  155. componentProps: {
  156. min: 1,
  157. precision: 0,
  158. controlsPosition: 'right',
  159. },
  160. },
  161. {
  162. prop: 'inspectionTime',
  163. label: '检测时间:',
  164. component: 'ElDatePicker',
  165. componentProps: {
  166. type: 'date',
  167. valueFormat: 'YYYY-MM-DD',
  168. placeholder: '请选择检测时间',
  169. },
  170. },
  171. {
  172. prop: 'deviceStatus',
  173. label: '设备状态:',
  174. slot: 'deviceStatus',
  175. },
  176. {
  177. prop: 'isUseDepartment',
  178. label: '是否使用部门:',
  179. slot: 'isUseDepartment',
  180. },
  181. {
  182. prop: 'nextInspectionDate',
  183. label: '下次检测时间:',
  184. component: 'ElDatePicker',
  185. componentProps: {
  186. type: 'date',
  187. valueFormat: 'YYYY-MM-DD',
  188. placeholder: '请选择下次检测时间',
  189. },
  190. },
  191. ];
  192. export const SPECIAL_EQUIPMENT_FORM_DATA = {
  193. deviceId: '',
  194. assetId: '',
  195. deviceName: '',
  196. useUnit: '',
  197. categoryName: '',
  198. typeName: '',
  199. registerCode: '',
  200. licenseNo: '',
  201. deviceCode: '',
  202. safeLocation: '',
  203. useDepartment: '',
  204. responsibilityDeptId: undefined as number | undefined,
  205. responsiblePerson: '',
  206. jobNo: '',
  207. factoryNo: '',
  208. productionDate: '',
  209. startUseDate: '',
  210. inspectionCycle: undefined as number | undefined,
  211. useYears: undefined as number | undefined,
  212. inspectionTime: '',
  213. deviceStatus: 1,
  214. isUseDepartment: 1,
  215. nextInspectionDate: '',
  216. };
  217. export const SPECIAL_EQUIPMENT_FORM_RULES = {
  218. deviceName: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
  219. useUnit: [{ required: true, message: '使用单位不能为空', trigger: 'blur' }],
  220. deviceStatus: [{ required: true, message: '请选择设备状态', trigger: 'change' }],
  221. };