staff-member-pages.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. const { pages } = require('@alancnet/material-framework/app/crud')
  2. pages({
  3. camelName: 'staffMember',
  4. apiPrefix: '/api/staff-members/:terminal',
  5. appPrefix: '/staff-members/:terminal',
  6. titles: {
  7. details: ctrl => ctrl.isNew
  8. ? `New ${ctrl.$routeParams.terminal == 'all' ? '' : ctrl.$routeParams.terminal} Staff Member`
  9. : `${ctrl.$routeParams.terminal == 'all' ? '' : ctrl.$routeParams.terminal} Staff Member Details`,
  10. list: ctrl => `${ctrl.$routeParams.terminal == 'all' ? 'All' : ctrl.$routeParams.terminal} Staff Members`
  11. },
  12. columns: [
  13. { camelName: 'name', row: 1 },
  14. { camelName: 'title', row: 2 },
  15. {
  16. titleName: 'Category',
  17. camelName: 'laborCategoryId',
  18. type: 'autocomplete',
  19. apiPrefix: '/api/labor-categories'
  20. },
  21. {
  22. titleName: 'terminal',
  23. camelName: 'terminalId',
  24. routeParam: 'terminal',
  25. type: 'autocomplete',
  26. apiPrefix: '/api/terminals'
  27. },
  28. {
  29. titleName: 'Staffing Agency',
  30. camelName: 'staffingAgencyId',
  31. type: 'autocomplete',
  32. apiPrefix: '/api/staffing-agencies'
  33. },
  34. {
  35. inList: false,
  36. camelName: 'wage',
  37. type: 'currency'
  38. },
  39. {
  40. inList: false,
  41. camelName: 'salary',
  42. type: 'currency'
  43. }
  44. ],
  45. layout: [
  46. {
  47. section: null,
  48. rows: [
  49. [ 'name', 'title', 'terminalId' ],
  50. [ 'wage', 'salary' ]
  51. ]
  52. },
  53. {
  54. section: 'Staffing information',
  55. rows: [
  56. [ 'laborCategoryId', 'staffingAgencyId' ]
  57. ]
  58. }
  59. ]
  60. })