columns.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. export default function useColumns() {
  2. const TableColumns = [
  3. { item: { key: "createName", title: "创建人", width: 100, }, attr: {} },
  4. { item: { key: "createTime", title: "创建时间", width: 150, }, attr: {} },
  5. { item: { key: "billCode", title: "单据编码", width: 150, }, attr: {} },
  6. {
  7. item: { key: "proposerName", title: "申请人", width: 100, },
  8. attr: {},
  9. },
  10. {
  11. item: { key: "status", title: "单据状态", width: 80, },
  12. attr: {
  13. is: "el-dict-tag",
  14. dictName: "documents_status", // 字典名
  15. }
  16. },
  17. { item: { key: "oneClassify", title: "物料一级分类", width: 150, }, attr: {} },
  18. { item: { key: "materialType", title: "物料基本分类", width: 150, }, attr: {} },
  19. {
  20. item: { key: "code", title: "物料编码" },
  21. attr: {
  22. }
  23. },
  24. { item: { key: "name", title: "物料名称" }, attr: {} },
  25. { item: { key: "specification", title: "规格", width: 150, }, attr: {} },
  26. { item: { key: "model", title: "型号", width: 150, }, attr: {}, },
  27. { item: { key: "manufacturerName", title: "生产厂家/代理人", width: 150, }, attr: {} },
  28. { item: { key: "registrationNo", title: "注册证号", width: 150, }, attr: {} },
  29. { item: { key: "registrant", title: "注册人", width: 150, }, attr: {} },
  30. { item: { key: "updateTime", title: "最后修改时间", width: 150, }, attr: {} },
  31. { item: { key: "reviewedName", title: "最后审批人", width: 150, }, attr: {} },
  32. { item: { key: "auditTime", title: "最后审批时间", width: 150, }, attr: {} },
  33. {
  34. item: { key: "approveUser", title: "当前审批人", },
  35. attr: {
  36. },
  37. },
  38. // { item: { key: "orgName", title: "审批语" ,width:150,}, attr: {} },
  39. // { item: { key: "orgName", title: "所属组织" ,width:150,}, attr: {} },
  40. // { item: { key: "createTime", title: "申请时间",width:150, }, attr: {} },
  41. // {
  42. // item: { key: "updateName", title: "最后修改人" ,width:150, },
  43. // attr: { },
  44. // },
  45. ].map(({ item, attr }) => ({
  46. attr,
  47. item: {
  48. ...item,
  49. sortabled: true,
  50. fixedabled: true,
  51. filterabled: true,
  52. hiddenabled: true,
  53. },
  54. }));
  55. const SearchColumns = [
  56. {
  57. item: { key: "billCode", title: "单据编码" },
  58. attr: {
  59. is: "el-input",
  60. clearable: true,
  61. },
  62. },
  63. {
  64. item: { key: "status", title: "单据状态" },
  65. attr: {
  66. is: "el-select",
  67. dictName: "documents_status",
  68. clearable: true,
  69. },
  70. },
  71. {
  72. item: { key: "name", title: "物料名称" },
  73. attr: {
  74. is: "el-popover-select-v2",
  75. referName: "MATERIAL_PARAM",
  76. valueKey: "name",
  77. clearable: true,
  78. },
  79. },
  80. {
  81. item: { key: "code", title: "物料编码" },
  82. attr: {
  83. is: "el-popover-select-v2",
  84. referName: "MATERIAL_PARAM",
  85. valueKey: "code",
  86. clearable: true,
  87. },
  88. },
  89. {
  90. item: { key: "materialCodes", title: "物料编码" },
  91. attr: {
  92. clearable: true,
  93. is: "el-input",
  94. placeholder: '多物料编码使用 , 隔开',
  95. },
  96. },
  97. {
  98. item: { key: "specification", title: "规格" },
  99. attr: {
  100. clearable: true,
  101. is: "el-input",
  102. },
  103. },
  104. {
  105. item: { key: "model", title: "型号" },
  106. attr: {
  107. clearable: true,
  108. is: "el-input",
  109. },
  110. },
  111. {
  112. item: { key: "classifySearchList", title: "品类" },
  113. attr: {
  114. is: "el-popover-multiple-tree-select",
  115. referName: "MATERIALCLASSIFY_PARAM",
  116. valueKey: "id",
  117. clearable: true,
  118. },
  119. },
  120. {
  121. item: { key: "proposerName", title: "申请人" },
  122. attr: {
  123. is: "el-popover-select-v2",
  124. referName: "CONTACTS_PARAM",
  125. valueKey: "name",
  126. dataMapping: {
  127. proposerId: "code",
  128. },
  129. clearable: true,
  130. },
  131. },
  132. // {
  133. // item: { key: "createName", title: "创建人" ,width:150, },
  134. // attr: {
  135. // is: "el-popover-select-v2",
  136. // referName: "CONTACTS_PARAM",
  137. // valueKey: "name",
  138. // dataMapping: {
  139. // create: "code",
  140. // },
  141. // clearable: true,
  142. // }
  143. // },
  144. // {
  145. // item: { key: "createTimeString", title: "申请时间" },
  146. // attr: {
  147. // is: "el-date-picker",
  148. // valueFormat: "yyyy-MM-dd" ,
  149. // clearable: true,
  150. // },
  151. // },
  152. {
  153. item: { key: "reviewedName", title: "最后审批人" },
  154. attr: {
  155. is: "el-popover-select-v2",
  156. referName: "CONTACTS_PARAM",
  157. valueKey: "name",
  158. dataMapping: {
  159. reviewedBy: "code",
  160. },
  161. clearable: true,
  162. },
  163. },
  164. // {
  165. // item: { key: "auditTimeString", title: "审批时间" },
  166. // attr: {
  167. // is: "el-date-picker",
  168. // valueFormat: "yyyy-MM-dd" ,
  169. // clearable: true,
  170. // },
  171. // },
  172. {
  173. item: { key: "manufacturerName", title: "生产厂家/代理人" },
  174. attr: {
  175. clearable: true,
  176. is: "el-popover-select-v2",
  177. valueKey: "name",
  178. referName: "MANUFACTURER_PARAM",
  179. dataMapping: {
  180. manufacturerId: "id",
  181. },
  182. },
  183. },
  184. {
  185. item: { key: "registrationNo", title: "注册证号" },
  186. attr: {
  187. clearable: true,
  188. is: "el-input",
  189. },
  190. },
  191. {
  192. item: {
  193. key: "createTimeString",
  194. title: "申请时间",
  195. span: 12,
  196. },
  197. attr: {
  198. clearable: true,
  199. // is: "el-date-wrapper",
  200. is: "el-date-picker",
  201. type: "daterange",
  202. rangeSeparator: "-",
  203. startPlaceholder: "开始日期",
  204. endPlaceholder: "结束日期",
  205. valueFormat: "yyyy-MM-dd",
  206. },
  207. },
  208. {
  209. item: {
  210. key: "auditTimeString",
  211. title: "审批时间",
  212. span: 12,
  213. },
  214. attr: {
  215. clearable: true,
  216. is: "el-date-picker",
  217. type: "daterange",
  218. rangeSeparator: "-",
  219. startPlaceholder: "开始日期",
  220. endPlaceholder: "结束日期",
  221. valueFormat: "yyyy-MM-dd",
  222. },
  223. },
  224. ].map(({ item, attr }) => ({
  225. attr,
  226. item: { ...item, hidden: true, span: item.span || 6 },
  227. }));
  228. return { TableColumns, SearchColumns }
  229. }