columns.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. {
  30. item:{ key: "approveUser", title: "当前审批人" ,},
  31. attr:{
  32. },
  33. },
  34. ].map(({ item, attr }) => ({
  35. attr,
  36. item: {
  37. ...item,
  38. sortabled: true,
  39. fixedabled: true,
  40. filterabled: true,
  41. hiddenabled: true,
  42. },
  43. }));
  44. const SearchColumns = [
  45. {
  46. item: { key: "materialCode", title: "物料编码" },
  47. attr: {
  48. is: "el-popover-select-v2",
  49. referName: "MATERIAL_PARAM",
  50. valueKey: "code",
  51. clearable:true,
  52. dataMapping: {
  53. materialName: "name",
  54. },
  55. },
  56. },
  57. {
  58. item:{
  59. key: "manufacturerIdName",
  60. title: "生产厂家/代理人",
  61. },
  62. attr:{
  63. clearable:true,
  64. is: "el-popover-select-v2",
  65. valueKey: "name",
  66. referName: "MANUFACTURER_PARAM",
  67. dataMapping: {
  68. manufacturerId: "id",
  69. },
  70. },
  71. },
  72. {
  73. item:{
  74. // key: "approverName",
  75. key: "createByName",
  76. title: "申请人",
  77. },
  78. attr: {
  79. clearable:true,
  80. is: "el-popover-select-v2",
  81. referName: "CONTACTS_PARAM",
  82. valueKey: "name",
  83. dataMapping: {
  84. // approver: "code",
  85. createBy: "code",
  86. },
  87. },
  88. },
  89. {
  90. item:{
  91. key: "applyTimeArray",
  92. title: "申请日期",
  93. // span:12,
  94. },
  95. attr: {
  96. clearable:true,
  97. is: "el-date-picker",
  98. type:"daterange",
  99. rangeSeparator:"-",
  100. startPlaceholder:"开始日期",
  101. endPlaceholder:"结束日期",
  102. valueFormat:"yyyy-MM-dd",
  103. },
  104. },
  105. {
  106. item: {
  107. key: "code",
  108. title: "单据编码",
  109. },
  110. attr: {
  111. clearable: true,
  112. is: "el-input",
  113. },
  114. },
  115. {
  116. item: { key: "status", title: "单据状态" },
  117. attr: {
  118. is: "el-select",
  119. dictName: "documents_status",
  120. clearable: true,
  121. },
  122. },
  123. {
  124. item: {
  125. key: "materialClassifyIds",
  126. title: "物料分类",
  127. },
  128. attr: {
  129. is: "el-popover-multiple-tree-select",
  130. // is: "el-popover-tree-select",
  131. referName: "MATERIALCLASSIFY_PARAM",
  132. valueKey: "id",
  133. clearable:true,
  134. },
  135. },
  136. {
  137. item:{
  138. key: "updateTimeArray",
  139. title: "修改日期",
  140. // span:12,
  141. },
  142. attr: {
  143. clearable:true,
  144. is: "el-date-picker",
  145. type:"daterange",
  146. rangeSeparator:"-",
  147. startPlaceholder:"开始日期",
  148. endPlaceholder:"结束日期",
  149. valueFormat:"yyyy-MM-dd",
  150. },
  151. },
  152. // {
  153. // item: { key: "materialName", title: "物料名称" },
  154. // attr: {
  155. // is: "el-popover-select-v2",
  156. // referName: "MATERIAL_PARAM",
  157. // valueKey: "name",
  158. // clearable:true,
  159. // dataMapping: {
  160. // materialCode: "code",
  161. // },
  162. // },
  163. // },
  164. ].map(({ item, attr }) => ({
  165. attr,
  166. item: { ...item, hidden: true, span: item.span || 6 },
  167. }));
  168. return { TableColumns, SearchColumns };
  169. }