columns.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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: "price_invalid" },
  49. },
  50. {
  51. item: { width: 100, key: "enableStatus", title: "启用状态" },
  52. attr: { is: "el-dict-tag", dictName: "price_enable" },
  53. },
  54. {
  55. item: { width: 100, key: "materialStatus", title: "物料启用状态" },
  56. attr: { is: "el-dict-tag", dictName: "material_enable" },
  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. clearable: true,
  94. referName: "ORG_PARAM",
  95. valueKey: "name",
  96. dataMapping: {
  97. puOrg: "id",
  98. puOrgName: "name",
  99. },
  100. },
  101. },
  102. {
  103. item: { width: 100, key: "manufacturerName", title: "生产厂家" },
  104. attr: {
  105. is: "el-popover-select-v2",
  106. clearable: true,
  107. referName: "MANUFACTURER_PARAM",
  108. valueKey: "name",
  109. dataMapping: {
  110. manufacturer: "id",
  111. manufacturerName: "name",
  112. },
  113. },
  114. },
  115. {
  116. item: { width: 100, key: "supplierName", title: "供应商" },
  117. attr: {
  118. is: "el-popover-select-v2",
  119. clearable: true,
  120. referName: "SUPPLIER_PARAM",
  121. valueKey: "name",
  122. dataMapping: {
  123. supplier: "id",
  124. supplierName: "name",
  125. },
  126. },
  127. },
  128. {
  129. item: { width: 100, key: "applyCode", title: "来源单据" },
  130. attr: { clearable: true, is: "el-input" },
  131. },
  132. {
  133. item: {key: "materialCodeList", title: "物料编码"},
  134. attr: {
  135. clearable: true,
  136. is: "el-popover-multiple-select-v2",
  137. valueKey: "code",
  138. referName: "MATERIAL_PARAM",
  139. },
  140. },
  141. {
  142. item: { key: "materialCodes", title: "物料编码"},
  143. attr: {
  144. clearable: true,
  145. is: "el-input",
  146. placeholder: '多物料编码使用 , 隔开',
  147. },
  148. },
  149. // {
  150. // item: { width: 100, key: "materialCodeList", title: "物料编码" },
  151. // attr: {
  152. // is: "el-popover-multiple-select-v2",
  153. // referName: "MATERIAL_PARAM",
  154. // valueKey: "code",
  155. // },
  156. // },
  157. {
  158. item: { key: "materialClassifyList", title: "物料一级分类"},
  159. attr: {
  160. clearable: true,
  161. is: "el-popover-multiple-tree-select",
  162. referName: "MATERIALCLASSIFY_PARAM",
  163. valueKey: "code",
  164. },
  165. },
  166. {
  167. item: { width: 100, key: "source", title: "价格来源" },
  168. attr: { clearable: true, is: "el-select", dictName: "price_source" },
  169. },
  170. {
  171. item: { width: 100, key: "status", title: "有效状态" },
  172. attr: { clearable: true, is: "el-select", dictName: "price_invalid" },
  173. },
  174. {
  175. item: { width: 100, key: "enableStatus", title: "启用状态", span: 4 },
  176. attr: { clearable: true, is: "el-select", dictName: "price_enable" },
  177. },
  178. {
  179. item: { width: 100, key: "createTime", title: "价格日期", span: 8 },
  180. attr: {
  181. clearable: true,
  182. is: "el-date-picker",
  183. type: "datetimerange",
  184. rangeSeparator: "至",
  185. startPlaceholder: "开始日期",
  186. endPlaceholder: "结束日期",
  187. valueFormat: "yyyy-MM-dd hh:mm:ss",
  188. },
  189. },
  190. {
  191. item: { width: 100, key: "invalid", title: "价格失效日期", span: 8 },
  192. attr: {
  193. clearable: true,
  194. is: "el-date-picker",
  195. type: "datetimerange",
  196. rangeSeparator: "至",
  197. startPlaceholder: "开始日期",
  198. endPlaceholder: "结束日期",
  199. valueFormat: "yyyy-MM-dd hh:mm:ss",
  200. },
  201. },
  202. ];
  203. return { TableColumns, SearchColumns };
  204. }