columns.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. { item: { key: "priceCode", title: "价格编码" , width:150 }, attr: {} },
  5. {
  6. item: { key: "status", title: "状态" , width:100},
  7. attr: { is: "el-dict-tag", dictName: "sys_status", width:100 },
  8. },
  9. { item: { key: "supplierName", title: "供应商" , width:150}, attr: {} },
  10. { item: { key: "currencyName", title: "币种" , width:100}, attr: {} },
  11. {
  12. item: { key: "explainStr", title: "价格合理性说明" , width:100},
  13. attr: {},
  14. },
  15. { item: { key: "buyerName", title: "采购员", width:100 }, attr: {} },
  16. { item: { key: "puDeptName", title: "采购部门" , width:100}, attr: {} },
  17. {
  18. item: { key: "file", title: "附件", filter: false, width:100 },
  19. attr: { is: "el-file-preview" },
  20. },
  21. { item: { key: "createByName", title: "创建人", width:100 }, attr: {} },
  22. {
  23. item: { key: "isEffective", title: "是否已推价格" , width:100},
  24. attr: { is: "el-dict-tag", dictName: "is_effective" , width:100},
  25. },
  26. {
  27. item: { key: "effectiveDate", title: "生效日期" , width:100},
  28. attr: {},
  29. },
  30. { item: { key: "source", title: "来源单据号", width:100 }, attr: {} },
  31. {
  32. item: { key: "sourceType", title: "来源单据类型" , width:100},
  33. attr: {},
  34. },
  35. ].map(({ item, attr }) => ({
  36. attr,
  37. item: {
  38. ...item,
  39. sortabled: true,
  40. fixedabled: true,
  41. filterabled: true,
  42. hiddenabled: true,
  43. },
  44. }));
  45. const SearchColumns = [
  46. {
  47. item: { key: "supplierName", title: "供应商" },
  48. attr: {
  49. is: "el-popover-select-v2",
  50. referName: "SUPPLIER_PARAM",
  51. valueKey: "name",
  52. dataMapping: { supplier: "id", supplierName: "name" },
  53. },
  54. },
  55. {
  56. item: { key: "puOrgName", title: "采购组织" },
  57. attr: {
  58. is: "el-popover-select-v2",
  59. referName: "ORG_PARAM",
  60. valueKey: "name",
  61. dataMapping: { puOrg: "id", puOrgName: "name" },
  62. },
  63. },
  64. {
  65. item: { key: "buyerName", title: "采购员" },
  66. attr: {
  67. is: "el-popover-select-v2",
  68. referName: "CONTACTS_PARAM",
  69. valueKey: "name",
  70. dataMapping: { buyer: "code", buyerName: "name" },
  71. },
  72. },
  73. {
  74. item: { key: "currencyName", title: "币种" },
  75. attr: {
  76. is: "el-popover-select-v2",
  77. referName: "CURRENCY_PARAM",
  78. valueKey: "name",
  79. dataMapping: { currency: "id", currencyName: "name" },
  80. },
  81. },
  82. {
  83. item: { key: "puDeptName", title: "采购部门" },
  84. attr: {
  85. is: "el-popover-select-v2",
  86. referName: "DEPT_PARAM",
  87. valueKey: "name",
  88. dataMapping: { puDept: "id", puDeptName: "name" },
  89. },
  90. },
  91. {
  92. item: { key: "isEffective", title: "是否推价" },
  93. attr: {
  94. is: "el-select",
  95. dictName: "is_effective",
  96. clearable: true,
  97. },
  98. },
  99. {
  100. item: { key: "status", title: "状态" },
  101. attr: {
  102. is: "el-select",
  103. dictName: "sys_status",
  104. clearable: true,
  105. },
  106. },
  107. ];
  108. return { TableColumns, SearchColumns };
  109. }