columns.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import CONFIG from "@/config";
  2. export const TableColumns = [
  3. {
  4. item: { key: "puOrgName", title: "采购组织" },
  5. attr: {},
  6. },
  7. { item: { key: "materialName", title: "物料" }, attr: {} },
  8. { item: { key: "materialCode", title: "物料编码" }, attr: {} },
  9. { item: { key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
  10. { item: { key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
  11. { item: { key: "model", title: "物料型号" }, attr: {} },
  12. { item: { key: "specification", title: "物料规格" }, attr: {} },
  13. {
  14. item: { key: "supplierName", title: "供应商名称" },
  15. attr: {},
  16. },
  17. { item: { key: "customerName", title: "客户" }, attr: {} },
  18. {
  19. item: { key: "taxPrice", title: "主含税单价" },
  20. attr: {
  21. is: "el-computed-input-v2",
  22. formatter: (prop) => {
  23. return (prop * 1).toFixed(CONFIG.precision);
  24. },
  25. },
  26. },
  27. { item: { key: "unitName", title: "主单位" }, attr: {} },
  28. { item: { key: "effectiveDate", title: "价格生效日期" }, attr: {} },
  29. { item: { key: "endDate", title: "价格失效日期" }, attr: {} },
  30. { item: { key: "buyerName", title: "采购员" }, attr: {} },
  31. { item: { key: "source", title: "来源单据" }, attr: {} },
  32. {
  33. item: { key: "convertRate", title: "换算率" },
  34. attr: {
  35. is: "el-computed-input-v2",
  36. formatter: (prop) => {
  37. return (prop * 1).toFixed(CONFIG.precision);
  38. },
  39. },
  40. },
  41. {
  42. item: { key: "status", title: "有效状态" },
  43. attr: { is: "el-dict-tag", dictName: "is_effective" },
  44. },
  45. {
  46. item: { key: "enableStatus", title: "启用状态" },
  47. attr: { is: "el-dict-tag", dictName: "is_effective" },
  48. },
  49. {
  50. item: { key: "materialStatus", title: "物料启用状态" },
  51. attr: { is: "el-dict-tag", dictName: "is_effective" },
  52. },
  53. {
  54. item: { key: "isDistribution", title: "配送价" },
  55. attr: { is: "el-dict-tag", dictName: "is_effective" },
  56. },
  57. {
  58. item: { key: "priceType", title: "价格类型" },
  59. attr: { is: "el-dict-tag", dictName: "sys_price_type" },
  60. },
  61. { item: { key: "demandCode", title: "采购需求单号" }, attr: {} },
  62. { item: { key: "expiryEarly", title: "效期预警" }, attr: {} },
  63. { item: { key: "priority", title: "含税/无税优先" }, attr: {} },
  64. { item: { key: "createByName", title: "创建人" }, attr: {} },
  65. { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
  66. ].map(({ item, attr }) => ({
  67. attr,
  68. item: { ...item, hidden: true, fixed: false },
  69. }));
  70. export const SearchColumns = [
  71. {
  72. item: { key: "puOrgName", title: "采购组织" },
  73. attr: {
  74. is: "el-popover-select-v2",
  75. referName: "ORG_PARAM",
  76. valueKey: "name",
  77. dataMapping: {
  78. puOrg: "id",
  79. puOrgName: "name",
  80. },
  81. },
  82. },
  83. {
  84. item: { key: "manufacturer", title: "生产厂家" },
  85. attr: { is: "el-input" },
  86. },
  87. {
  88. item: { key: "supplierName", title: "供应商" },
  89. attr: {
  90. is: "el-popover-select-v2",
  91. referName: "SUPPLIER_PARAM",
  92. valueKey: "name",
  93. dataMapping: {
  94. supplier: "id",
  95. supplierName: "name",
  96. },
  97. },
  98. },
  99. {
  100. item: { key: "source", title: "来源单据" },
  101. attr: { is: "el-input" },
  102. },
  103. {
  104. item: { key: "materialCode", title: "物料编码" },
  105. attr: {
  106. is: "el-popover-select-v2",
  107. referName: "MATERIAL_PARAM",
  108. dataMapping: {
  109. material: "id",
  110. materialCode: "code",
  111. },
  112. },
  113. },
  114. {
  115. item: { key: "status", title: "有效状态" },
  116. attr: { is: "el-select", dictName: "is_effective" },
  117. },
  118. {
  119. item: { key: "enableStatus", title: "启用状态" },
  120. attr: { is: "el-select", dictName: "is_effective" },
  121. },
  122. ].map(({ item, attr }) => ({
  123. attr,
  124. item: { ...item, hidden: true, span: item.span || 6 },
  125. }));
  126. export default { TableColumns, SearchColumns };