columns.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. export default function useColumns() {
  2. const TableColumns = [
  3. { item: { key: "orgName", title: "所属组织" }, attr: {} },
  4. { item: { key: "code", title: "单据编码" }, attr: {} },
  5. {
  6. item: { key: "applicationTime", title: "申请时间" },
  7. attr: { },
  8. },
  9. { item: { key: "status", title: "单据状态",width:120, },
  10. attr: {
  11. is: "el-dict-tag",
  12. dictName: "documents_status", // 字典名
  13. }
  14. },
  15. // { item: { key: "materialCode", title: "物料编码" }, attr: {} },
  16. // {
  17. // item: { key: "materialName", title: "物料名称" },
  18. // attr: {},
  19. // },
  20. { item: { key: "approverName", title: "最后审批人" }, attr: {} },
  21. { item: { key: "approvalTime", title: "最后审核时间" }, attr: {} },
  22. { item: { key: "createByName", title: "创建人" ,width:150, }, attr: {} },
  23. { item: { key: "createTime", title: "创建时间" }, attr: {} },
  24. {
  25. item: { key: "updateByName", title: "最后修改人" ,width:150, },
  26. attr: { },
  27. },
  28. { item: { key: "updateTime", title: "最后修改时间" }, attr: {} },
  29. ].map(({ item, attr }) => ({
  30. attr,
  31. item: { ...item, hidden: true, fixed: false },
  32. }));
  33. const SearchColumns = [
  34. {
  35. item: { key: "materialCode", title: "物料编码" },
  36. attr: {
  37. is: "el-popover-select-v2",
  38. referName: "MATERIAL_PARAM",
  39. valueKey: "code",
  40. clearable:true,
  41. dataMapping: {
  42. materialName: "name",
  43. },
  44. },
  45. },
  46. {
  47. item: { key: "materialName", title: "物料名称" },
  48. attr: {
  49. is: "el-popover-select-v2",
  50. referName: "MATERIAL_PARAM",
  51. valueKey: "name",
  52. clearable:true,
  53. dataMapping: {
  54. materialCode: "code",
  55. },
  56. },
  57. },
  58. {
  59. item: { key: "status", title: "单据状态" },
  60. attr: {
  61. is: "el-select",
  62. dictName: "documents_status",
  63. clearable: true,
  64. },
  65. },
  66. {
  67. item: {
  68. key: "code",
  69. title: "单据编码",
  70. },
  71. attr: {
  72. clearable: true,
  73. is: "el-input",
  74. },
  75. },
  76. // {
  77. // item:{
  78. // key: "puPersonnelIdName",
  79. // title: "采购员",
  80. // },
  81. // attr: {
  82. // clearable:true,
  83. // is: "el-popover-select-v2",
  84. // referName: "CONTACTS_PARAM",
  85. // valueKey: "name",
  86. // dataMapping: {
  87. // puPersonnelId: "code",
  88. // },
  89. // },
  90. // },
  91. ].map(({ item, attr }) => ({
  92. attr,
  93. item: { ...item, hidden: true, span: item.span || 6 },
  94. }));
  95. return { TableColumns, SearchColumns };
  96. }