qmsModules.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. /**
  2. * QMS 质量管理系统模块配置:定义不同检验业务在导航、列表、表单等方面的差异。
  3. * 通过集中配置,页面组件可以根据当前模块动态渲染对应的文案、字段和表格列。
  4. */
  5. export const QMS_MODULES: Record<string, any> = {
  6. iqc: {
  7. code: 'iqc',
  8. name: 'IQC',
  9. label: '来料检验',
  10. systemTitle: '来料检验管理系统',
  11. defaultRoute: '/qms/iqc/task/list',
  12. navItems: [
  13. { key: 'applications', label: '来料检验申请', path: '/qms/iqc/apply/list' },
  14. { key: 'tasks', label: '来料检验任务', path: '/qms/iqc/task/list' },
  15. { key: 'favorites', label: '我的关注', path: '/qms/iqc/favorites' },
  16. { key: 'help', label: '帮助', path: '/qms/iqc/help' }
  17. ],
  18. applicationList: {
  19. title: '来料检验申请',
  20. actionButtons: {
  21. create: '新建申请',
  22. guide: true
  23. },
  24. keywordFields: ['id'],
  25. keywordPlaceholder: '搜索单据编号',
  26. columns: [
  27. { type: 'selection', width: 55 },
  28. { key: 'id', label: '单据编号', width: 200, type: 'applicationLink' },
  29. { key: 'applicantName', label: '申请人', width: 100 },
  30. { key: 'applyTime', label: '申请时间', width: 160, type: 'datetime' },
  31. { key: 'materialCount', label: '物料数', width: 100, type: 'number' },
  32. { key: 'remark', label: '备注', minWidth: 200, type: 'tooltip' }
  33. ],
  34. advancedFilters: [
  35. { key: 'statusList', label: '单据状态', type: 'select', multiple: true, optionsKey: 'applicationStatuses' }
  36. ]
  37. },
  38. applicationForm: {
  39. title: '来料检验申请单',
  40. baseFields: [
  41. { key: 'applicantName', label: '申请人', type: 'input', required: true, span: 8 },
  42. { key: 'applyTime', label: '申请时间', type: 'datetime', required: true, span: 8 },
  43. { key: 'businessType', label: '业务类型', type: 'select', span: 8, options: ['常规', '精密', '特殊'] },
  44. { key: 'department', label: '组织/部门', type: 'input', span: 8 }
  45. ],
  46. detail: {
  47. title: '物料明细',
  48. addable: true,
  49. columns: [
  50. { key: 'materialCode', label: '物料编码', type: 'input', width: 140, required: true },
  51. { key: 'materialName', label: '名称', type: 'input', width: 160, required: true },
  52. { key: 'specification', label: '规格', type: 'input', width: 160 },
  53. { key: 'batch', label: '批次', type: 'input', width: 140 },
  54. { key: 'inspectStatus', label: '状态', type: 'select', width: 120, options: ['待检验', '检验中', '检验完成'] },
  55. { key: 'quantity', label: '数量', type: 'number', width: 120, min: 0 },
  56. { key: 'unit', label: '单位', type: 'input', width: 100 },
  57. { key: 'remark', label: '备注', type: 'input', minWidth: 200 }
  58. ],
  59. defaultRow: {
  60. materialCode: '',
  61. materialName: '',
  62. specification: '',
  63. batch: '',
  64. inspectStatus: '待检验',
  65. quantity: 1,
  66. unit: 'PCS',
  67. remark: ''
  68. }
  69. },
  70. extraSections: [],
  71. remarkLabel: '总体备注'
  72. },
  73. taskList: {
  74. title: '来料检验任务',
  75. tabs: [
  76. { key: 'pending', label: '待检验' },
  77. { key: 'processing', label: '检验中' },
  78. { key: 'completed', label: '已完成' }
  79. ],
  80. keywordFields: ['applicationId', 'sourceOrderNum', 'batch'],
  81. columns: [
  82. { type: 'selection', width: 55 },
  83. { key: 'status', label: '状态', width: 90, type: 'status' },
  84. { key: 'id', label: '任务编号', width: 140 },
  85. { key: 'applicationId', label: '单据编号', width: 160, type: 'taskLink' },
  86. { key: 'sourceOrderNum', label: '来源单号', width: 160 },
  87. { key: 'batch', label: '批次', width: 130, type: 'batch' },
  88. { key: 'quantity', label: '数量', width: 100 },
  89. { key: 'unit', label: '单位', width: 80 },
  90. { key: 'applyTime', label: '申请时间', width: 170, type: 'datetime' },
  91. { key: 'remark', label: '备注', minWidth: 200, type: 'tooltip' }
  92. ],
  93. advancedFilters: []
  94. },
  95. },
  96. ipqc: {
  97. code: 'ipqc',
  98. name: 'IPQC',
  99. label: '过程检验',
  100. systemTitle: 'IPQC 过程检验管理',
  101. defaultRoute: '/qms/ipqc/task/list',
  102. navItems: [
  103. { key: 'applications', label: '过程检验申请', path: '/qms/ipqc/apply/list' },
  104. { key: 'tasks', label: '过程检验任务', path: '/qms/ipqc/task/list' },
  105. { key: 'favorites', label: '我的关注', path: '/qms/ipqc/favorites' },
  106. { key: 'help', label: '帮助', path: '/qms/ipqc/help' }
  107. ],
  108. applicationList: {
  109. title: '过程检验申请',
  110. actionButtons: { create: '新建申请', import: true, export: true, guide: true },
  111. keywordFields: ['id', 'workOrder', 'remark'],
  112. columns: [
  113. { type: 'selection', width: 55 },
  114. { key: 'id', label: '单据编号', width: 140, type: 'applicationLink' },
  115. { key: 'workOrder', label: '生产订单', width: 160 },
  116. { key: 'processStep', label: '工序/工步', width: 160, type: 'formatter', formatter: (row: any) => `${row.process || ''}/${row.step || ''}` },
  117. { key: 'lineStationEquipment', label: '线体/工位/设备', minWidth: 220, type: 'formatter', formatter: (row: any) => `${row.line || ''} / ${row.station || ''} / ${row.equipment || ''}` },
  118. { key: 'shift', label: '班次', width: 90 },
  119. { key: 'applicantName', label: '申请人', width: 100 },
  120. { key: 'applyTime', label: '申请时间', width: 170, type: 'datetime' },
  121. { key: 'status', label: '单据状态', width: 110, type: 'status' },
  122. { key: 'detailCount', label: '明细条数', width: 110, type: 'number' },
  123. { key: 'remark', label: '备注', minWidth: 200, type: 'tooltip' }
  124. ],
  125. advancedFilters: [
  126. { key: 'applicantIds', label: '申请人', type: 'select', multiple: true, optionsKey: 'applicants' },
  127. { key: 'statusList', label: '单据状态', type: 'select', multiple: true, optionsKey: 'applicationStatuses' },
  128. { key: 'processes', label: '工序/工步', type: 'select', multiple: true, optionsKey: 'processes' },
  129. { key: 'lines', label: '线体/工位/设备', type: 'select', multiple: true, optionsKey: 'lines' },
  130. { key: 'shifts', label: '班次', type: 'select', multiple: true, optionsKey: 'shifts' },
  131. { key: 'timeRange', label: '申请时间', type: 'datetimerange' }
  132. ]
  133. },
  134. applicationForm: {
  135. title: 'IPQC 过程检验申请单',
  136. baseFields: [
  137. { key: 'applicantName', label: '申请人', type: 'input', required: true, span: 8 },
  138. { key: 'applyTime', label: '申请时间', type: 'datetime', required: true, span: 8 },
  139. { key: 'workOrder', label: '生产订单/工单号', type: 'input', required: true, span: 8 },
  140. { key: 'process', label: '工序/工步', type: 'input', required: true, span: 8 },
  141. { key: 'line', label: '线体/工位/设备', type: 'input', required: true, span: 8 },
  142. { key: 'shift', label: '班次', type: 'select', span: 8, options: ['早班', '中班', '夜班'] },
  143. { key: 'samplingPlan', label: '抽样方案', type: 'input', span: 8 },
  144. { key: 'inspectionLevel', label: '检验水准', type: 'input', span: 8 },
  145. { key: 'aql', label: 'AQL', type: 'input', span: 8 },
  146. { key: 'processStage', label: '过程阶段', type: 'select', span: 8, options: ['首件', '巡检', '完工'] }
  147. ],
  148. detail: {
  149. title: '检验项目',
  150. addable: true,
  151. columns: [
  152. { key: 'category', label: '项目类别', type: 'select', width: 140, options: ['尺寸', '外观', '功能'] },
  153. { key: 'itemName', label: '项目名称', type: 'input', width: 200 },
  154. { key: 'standard', label: '标准', type: 'input', width: 200 },
  155. { key: 'upperLimit', label: '上限', type: 'input', width: 120 },
  156. { key: 'lowerLimit', label: '下限', type: 'input', width: 120 },
  157. { key: 'unit', label: '单位', type: 'input', width: 100 },
  158. { key: 'sampleSize', label: '抽样量', type: 'number', width: 110, min: 0 },
  159. { key: 'remark', label: '备注', type: 'input', minWidth: 200 }
  160. ],
  161. defaultRow: { category: '尺寸', itemName: '', standard: '', upperLimit: '', lowerLimit: '', unit: '', sampleSize: 0, remark: '' }
  162. },
  163. extraSections: [{ key: 'attachments', title: '附件', enable: true }],
  164. remarkLabel: '总体备注'
  165. },
  166. taskList: {
  167. title: '过程检验任务',
  168. tabs: [
  169. { key: 'pending', label: '待检验' },
  170. { key: 'processing', label: '检验中' },
  171. { key: 'completed', label: '已完成' }
  172. ],
  173. keywordFields: ['applicationId', 'workOrder', 'materialName'],
  174. columns: [
  175. { type: 'selection', width: 55 },
  176. { key: 'status', label: '状态', width: 90, type: 'status' },
  177. { key: 'id', label: '任务编号', width: 130 },
  178. { key: 'applicationId', label: '单据编号', width: 140, type: 'taskLink' },
  179. { key: 'workOrder', label: '生产订单', width: 160 },
  180. { key: 'process', label: '工序/工步', width: 160, type: 'formatter', formatter: (row: any) => `${row.process || ''}/${row.step || ''}` },
  181. { key: 'lineStationEquipment', label: '线体/工位/设备', minWidth: 220, type: 'formatter', formatter: (row: any) => `${row.line || ''} / ${row.station || ''} / ${row.equipment || ''}` },
  182. { key: 'materialInfo', label: '物料信息', minWidth: 220, type: 'textLines', lines: ['materialCode', 'materialName'] },
  183. { key: 'batch', label: '批次', width: 130, type: 'batch' },
  184. { key: 'responsibleName', label: '负责人', width: 100 },
  185. { key: 'priority', label: '优先级', width: 100, type: 'priority' },
  186. { key: 'startTime', label: '开始时间', width: 170, type: 'datetime' },
  187. { key: 'completeTime', label: '完成时间', width: 170, type: 'datetime' },
  188. { key: 'remark', label: '备注', minWidth: 200, type: 'tooltip' }
  189. ],
  190. advancedFilters: [
  191. { key: 'statusList', label: '状态', type: 'select', multiple: true, optionsKey: 'taskStatuses' },
  192. { key: 'workOrders', label: '生产订单', type: 'select', multiple: true, optionsKey: 'workOrders' },
  193. { key: 'processes', label: '工序/工步', type: 'select', multiple: true, optionsKey: 'processes' },
  194. { key: 'lines', label: '线体/工位/设备', type: 'select', multiple: true, optionsKey: 'lines' },
  195. { key: 'responsibleIds', label: '负责人', type: 'select', multiple: true, optionsKey: 'responsibles' },
  196. { key: 'priorities', label: '优先级', type: 'select', multiple: true, options: [{ label: '高', value: 'high' }, { label: '中', value: 'medium' }, { label: '低', value: 'low' }] },
  197. { key: 'timeRange', label: '时间范围', type: 'datetimerange' }
  198. ]
  199. },
  200. },
  201. fqc: {
  202. code: 'fqc',
  203. name: 'FQC',
  204. label: '成品检验',
  205. systemTitle: 'FQC 成品检验管理',
  206. defaultRoute: '/qms/fqc/task/list',
  207. navItems: [
  208. { key: 'applications', label: '成品检验申请', path: '/qms/fqc/apply/list' },
  209. { key: 'tasks', label: '成品检验任务', path: '/qms/fqc/task/list' },
  210. { key: 'favorites', label: '我的关注', path: '/qms/fqc/favorites' },
  211. { key: 'help', label: '帮助', path: '/qms/fqc/help' }
  212. ],
  213. applicationList: {
  214. title: '成品检验申请',
  215. actionButtons: { create: '新建申请', import: true, export: true, guide: true },
  216. keywordFields: ['id', 'productCode', 'customer', 'remark'],
  217. columns: [
  218. { type: 'selection', width: 55 },
  219. { key: 'id', label: '单据编号', width: 140, type: 'applicationLink' },
  220. { key: 'productInfo', label: '成品编码/名称/型号', minWidth: 260, type: 'textLines', lines: ['productCode', 'productName', 'productModel'] },
  221. { key: 'customer', label: '客户', width: 160 },
  222. { key: 'orderInfo', label: '订单/出货单', width: 200, type: 'formatter', formatter: (row: any) => `${row.salesOrder || ''} / ${row.shippingOrder || ''}` },
  223. { key: 'packageBatch', label: '包装批次/箱号', width: 180 },
  224. { key: 'applicantName', label: '申请人', width: 100 },
  225. { key: 'applyTime', label: '申请时间', width: 170, type: 'datetime' },
  226. { key: 'status', label: '单据状态', width: 110, type: 'status' },
  227. { key: 'detailCount', label: '明细条数', width: 110, type: 'number' },
  228. { key: 'remark', label: '备注', minWidth: 200, type: 'tooltip' }
  229. ],
  230. advancedFilters: [
  231. { key: 'applicantIds', label: '申请人', type: 'select', multiple: true, optionsKey: 'applicants' },
  232. { key: 'statusList', label: '单据状态', type: 'select', multiple: true, optionsKey: 'applicationStatuses' },
  233. { key: 'customers', label: '客户', type: 'select', multiple: true, optionsKey: 'customers' },
  234. { key: 'orders', label: '订单/出货单', type: 'select', multiple: true, optionsKey: 'orders' },
  235. { key: 'packageBatchList', label: '批次/箱号', type: 'select', multiple: true, optionsKey: 'packageBatches' },
  236. { key: 'timeRange', label: '申请时间', type: 'datetimerange' }
  237. ]
  238. },
  239. applicationForm: {
  240. title: 'FQC 成品检验申请单',
  241. baseFields: [
  242. { key: 'applicantName', label: '申请人', type: 'input', required: true, span: 8 },
  243. { key: 'applyTime', label: '申请时间', type: 'datetime', required: true, span: 8 },
  244. { key: 'customer', label: '客户', type: 'input', required: true, span: 8 },
  245. { key: 'salesOrder', label: '销售订单/出货单', type: 'input', required: true, span: 8 },
  246. { key: 'packageBatch', label: '包装批次/箱号范围', type: 'input', span: 8 },
  247. { key: 'productModel', label: '成品型号', type: 'input', span: 8 },
  248. { key: 'samplingPlan', label: '抽样方案', type: 'input', span: 8 },
  249. { key: 'inspectionLevel', label: '检验水准', type: 'input', span: 8 },
  250. { key: 'aql', label: 'AQL', type: 'input', span: 8 },
  251. { key: 'customerRequirement', label: '客户特殊要求', type: 'textarea', span: 24 }
  252. ],
  253. detail: {
  254. title: '检验项目',
  255. addable: true,
  256. columns: [
  257. { key: 'category', label: '项目类别', type: 'select', width: 160, options: ['外观', '功能', '尺寸', '可靠性抽测'] },
  258. { key: 'itemName', label: '项目名称', type: 'input', width: 200 },
  259. { key: 'standard', label: '标准', type: 'input', width: 200 },
  260. { key: 'upperLimit', label: '上限', type: 'input', width: 120 },
  261. { key: 'lowerLimit', label: '下限', type: 'input', width: 120 },
  262. { key: 'unit', label: '单位', type: 'input', width: 100 },
  263. { key: 'sampleSize', label: '抽样量', type: 'number', width: 110, min: 0 },
  264. { key: 'remark', label: '备注', type: 'input', minWidth: 200 }
  265. ],
  266. defaultRow: { category: '外观', itemName: '', standard: '', upperLimit: '', lowerLimit: '', unit: '', sampleSize: 0, remark: '' }
  267. },
  268. extraSections: [{ key: 'attachments', title: '附件', enable: true }],
  269. remarkLabel: '总体备注'
  270. },
  271. taskList: {
  272. title: '成品检验任务',
  273. tabs: [
  274. { key: 'pending', label: '待检验' },
  275. { key: 'processing', label: '检验中' },
  276. { key: 'completed', label: '已完成' }
  277. ],
  278. keywordFields: ['applicationId', 'productName', 'customer'],
  279. columns: [
  280. { type: 'selection', width: 55 },
  281. { key: 'status', label: '状态', width: 90, type: 'status' },
  282. { key: 'id', label: '任务编号', width: 130 },
  283. { key: 'applicationId', label: '单据编号', width: 150, type: 'taskLink' },
  284. { key: 'productInfo', label: '成品信息', minWidth: 240, type: 'textLines', lines: ['productCode', 'productName', 'productModel'] },
  285. { key: 'customer', label: '客户', width: 160 },
  286. { key: 'packageBatch', label: '包装批次/箱号', width: 180 },
  287. { key: 'releaseStatus', label: '判定/放行', width: 140 },
  288. { key: 'responsibleName', label: '负责人', width: 100 },
  289. { key: 'priority', label: '优先级', width: 100, type: 'priority' },
  290. { key: 'startTime', label: '开始时间', width: 170, type: 'datetime' },
  291. { key: 'completeTime', label: '完成时间', width: 170, type: 'datetime' },
  292. { key: 'remark', label: '备注', minWidth: 200, type: 'tooltip' }
  293. ],
  294. advancedFilters: [
  295. { key: 'statusList', label: '状态', type: 'select', multiple: true, optionsKey: 'taskStatuses' },
  296. { key: 'customers', label: '客户', type: 'select', multiple: true, optionsKey: 'customers' },
  297. { key: 'productModels', label: '型号', type: 'select', multiple: true, optionsKey: 'productModels' },
  298. { key: 'packageBatchList', label: '批次/箱号', type: 'select', multiple: true, optionsKey: 'packageBatches' },
  299. { key: 'responsibleIds', label: '负责人', type: 'select', multiple: true, optionsKey: 'responsibles' },
  300. { key: 'priorities', label: '优先级', type: 'select', multiple: true, options: [{ label: '高', value: 'high' }, { label: '中', value: 'medium' }, { label: '低', value: 'low' }] },
  301. { key: 'timeRange', label: '时间范围', type: 'datetimerange' }
  302. ]
  303. },
  304. }
  305. }
  306. export const QMS_MODULE_CODES = Object.keys(QMS_MODULES)
  307. export const DEFAULT_QMS_MODULE = 'iqc'
  308. export const SPEC_MODULE = {
  309. code: 'spec',
  310. label: '检规管理',
  311. systemTitle: '检规管理中心',
  312. navItems: [
  313. { key: 'index', label: '检规索引', path: '/qms/spec/index' },
  314. { key: 'import', label: '导入检规', path: '/qms/spec/import' }
  315. ]
  316. }
  317. export const QMS_MODULE_OPTIONS = Object.values(QMS_MODULES).map((item: any) => ({
  318. code: item.code,
  319. label: `${item.name} ${item.label}`
  320. }))
  321. export const getQmsModuleConfig = (code: string) => QMS_MODULES[code] || QMS_MODULES[DEFAULT_QMS_MODULE]