columns.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. {
  5. item: { width: 100, key: "puOrgName", title: "采购组织" },
  6. attr: {},
  7. },
  8. { item: { width: 150, key: "materialName", title: "物料" }, attr: {} },
  9. { item: { width: 150, key: "materialCode", title: "物料编码" }, attr: {} },
  10. {
  11. item: { width: 100, key: "materialClassifyName", title: "物料一级分类" },
  12. attr: {},
  13. },
  14. {
  15. item: { width: 100, key: "manufacturerName", title: "生产厂家名称" },
  16. attr: {},
  17. },
  18. { item: { width: 100, key: "model", title: "物料型号" }, attr: {} },
  19. { item: { width: 100, key: "specification", title: "物料规格" }, attr: {} },
  20. {
  21. item: { width: 100, key: "supplierName", title: "供应商名称" },
  22. attr: {},
  23. },
  24. { item: { width: 100, key: "customerName", title: "客户" }, attr: {} },
  25. {
  26. item: { width: 100, key: "taxPrice", title: "主含税单价" },
  27. attr: {
  28. formatter: (prop) => {
  29. const { taxPrice = 0 } = prop;
  30. return taxPrice * 1;
  31. },
  32. },
  33. },
  34. { item: { width: 100, key: "unitName", title: "主单位" }, attr: {} },
  35. {
  36. item: { width: 100, key: "effectiveDate", title: "价格生效日期" },
  37. attr: {},
  38. },
  39. { item: { width: 100, key: "endDate", title: "价格失效日期" }, attr: {} },
  40. { item: { width: 100, key: "buyerName", title: "采购员" }, attr: {} },
  41. { item: { width: 100, key: "applyCode", title: "来源单据" }, attr: {} },
  42. {
  43. item: { width: 100, key: "convertRate", title: "换算率" },
  44. attr: {},
  45. },
  46. {
  47. item: { width: 100, key: "status", title: "有效状态" },
  48. attr: { is: "el-dict-tag", dictName: "is_effective" },
  49. },
  50. {
  51. item: { width: 100, key: "enableStatus", title: "启用状态" },
  52. attr: { is: "el-dict-tag", dictName: "is_effective" },
  53. },
  54. {
  55. item: { width: 100, key: "materialStatus", title: "物料启用状态" },
  56. attr: { is: "el-dict-tag", dictName: "is_effective" },
  57. },
  58. {
  59. item: { width: 100, key: "isDistribution", title: "配送价" },
  60. attr: { is: "el-dict-tag", dictName: "is_effective" },
  61. },
  62. {
  63. item: { width: 100, key: "priceType", title: "价格类型" },
  64. attr: { is: "el-dict-tag", dictName: "sys_price_type" },
  65. },
  66. { item: { width: 100, key: "expiryEarly", title: "效期预警" }, attr: {} },
  67. { item: { width: 100, key: "priority", title: "含税/无税优先" }, attr: {} },
  68. { item: { width: 100, key: "createByName", title: "创建人" }, attr: {} },
  69. { item: { width: 100, key: "createTime", title: "创建时间" }, attr: {} },
  70. {
  71. item: { width: 100, key: "updateByName", title: "更新人名称" },
  72. attr: {},
  73. },
  74. {
  75. item: { width: 100, key: "updateTime", title: "更新时间" },
  76. attr: {},
  77. },
  78. ].map(({ item, attr }) => ({
  79. attr,
  80. item: {
  81. ...item,
  82. sortabled: true,
  83. fixedabled: true,
  84. filterabled: true,
  85. hiddenabled: true,
  86. },
  87. }));
  88. const SearchColumns = [
  89. {
  90. item: { width: 100, key: "puOrgName", title: "采购组织" },
  91. attr: {
  92. is: "el-popover-select-v2",
  93. referName: "ORG_PARAM",
  94. valueKey: "name",
  95. dataMapping: {
  96. puOrg: "id",
  97. puOrgName: "name",
  98. },
  99. },
  100. },
  101. {
  102. item: { width: 100, key: "manufacturerName", title: "生产厂家" },
  103. attr: {
  104. is: "el-popover-select-v2",
  105. referName: "MANUFACTURER_PARAM",
  106. valueKey: "name",
  107. dataMapping: {
  108. manufacturer: "id",
  109. manufacturerName: "name",
  110. },
  111. },
  112. },
  113. {
  114. item: { width: 100, key: "supplierName", title: "供应商" },
  115. attr: {
  116. is: "el-popover-select-v2",
  117. referName: "SUPPLIER_PARAM",
  118. valueKey: "name",
  119. dataMapping: {
  120. supplier: "id",
  121. supplierName: "name",
  122. },
  123. },
  124. },
  125. {
  126. item: { width: 100, key: "applyCode", title: "来源单据" },
  127. attr: { is: "el-input" },
  128. },
  129. {
  130. item: { width: 100, key: "materialCodeList", title: "物料编码" },
  131. attr: {
  132. is: "el-popover-multiple-select-v2",
  133. referName: "MATERIAL_PARAM",
  134. valueKey: "code",
  135. },
  136. },
  137. {
  138. item: { width: 100, key: "status", title: "有效状态" },
  139. attr: { is: "el-select", dictName: "is_effective" },
  140. },
  141. {
  142. item: { width: 100, key: "enableStatus", title: "启用状态", span: 4 },
  143. attr: { is: "el-select", dictName: "is_effective" },
  144. },
  145. {
  146. item: { width: 100, key: "createTime", title: "价格日期", span: 8 },
  147. attr: {
  148. is: "el-date-picker",
  149. type: "datetimerange",
  150. rangeSeparator: "至",
  151. startPlaceholder: "开始日期",
  152. endPlaceholder: "结束日期",
  153. valueFormat: "yyyy-MM-dd hh:mm:ss",
  154. },
  155. },
  156. {
  157. item: { width: 100, key: "invalid", title: "价格失效日期", span: 8 },
  158. attr: {
  159. is: "el-date-picker",
  160. type: "datetimerange",
  161. rangeSeparator: "至",
  162. startPlaceholder: "开始日期",
  163. endPlaceholder: "结束日期",
  164. valueFormat: "yyyy-MM-dd hh:mm:ss",
  165. },
  166. },
  167. ];
  168. return { TableColumns, SearchColumns };
  169. }