columns.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. export default function useColumns() {
  2. // 科室信息
  3. const FormColumns = [
  4. {
  5. item: { key: "name", title: "科室名称", required: true },
  6. attr: {
  7. is: "el-input",
  8. clearable: true,
  9. placeholder: "请输入科室名称",
  10. },
  11. },
  12. {
  13. item: { key: "customersName", title: "客户名称" },
  14. attr: {
  15. is: "el-input",
  16. disabled: true,
  17. },
  18. },
  19. {
  20. item: { key: "responsiblePersonName", title: "负责人姓名" },
  21. attr: {
  22. is: "el-popover-select-v2",
  23. referName: "MKCMCONTACTS_PARAM",
  24. valueKey: "name",
  25. dataMapping: {
  26. responsiblePerson: 'id',
  27. responsiblePersonName: 'name',
  28. phone: 'cell'
  29. },
  30. placeholder: "请选择负责人",
  31. },
  32. },
  33. {
  34. item: { key: "phone", title: "联系人手机", },
  35. attr: {
  36. is: "el-input",
  37. clearable: true,
  38. placeholder: "请输入联系人手机",
  39. rules: [
  40. {
  41. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  42. message: "请输入正确的手机号码",
  43. trigger: "blur",
  44. },
  45. ]
  46. },
  47. },
  48. {
  49. item: { key: "address", title: "科室位置" },
  50. attr: {
  51. is: "el-input",
  52. clearable: true,
  53. placeholder: "请输入科室位置",
  54. },
  55. },
  56. {
  57. item: { key: "conventionalTherapy", title: "常规治疗" },
  58. attr: {
  59. is: "el-input",
  60. clearable: true,
  61. placeholder: "请输入常规治疗",
  62. },
  63. },
  64. {
  65. item: { key: "characteristic", title: "科室特色" },
  66. attr: {
  67. is: "el-input",
  68. clearable: true,
  69. placeholder: "请输入科室特色",
  70. },
  71. },
  72. {
  73. item: { key: "createByName", title: "业务员名称" },
  74. attr: {
  75. is: "el-input",
  76. disabled: true,
  77. },
  78. },
  79. {
  80. item: { key: "memo", title: "备注" },
  81. attr: {
  82. is: "el-input",
  83. clearable: true,
  84. placeholder: "请输入备注",
  85. },
  86. },
  87. ].map(({ item, attr }) => ({
  88. attr,
  89. item: {
  90. ...item,
  91. span: item.span || 6
  92. }
  93. }));
  94. return { FormColumns }
  95. }