columns.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. export default function useColumns() {
  2. const TableColumns = [
  3. {
  4. item: { key: "code", title: "需求单号", width: 150 },
  5. attr: {}
  6. },
  7. {
  8. item: { key: "demandDate", title: "需求日期", width: 150 },
  9. attr: {}
  10. },
  11. {
  12. item: { key: "createTime", title: "制单日期", width: 150 },
  13. attr: {}
  14. },
  15. {
  16. item: { key: "planType", title: "需求计划", width: 150 },
  17. attr: { is: "el-dict-tag", dictName: "sys_plan_type" }
  18. },
  19. {
  20. item: { key: "approverFinishTime", title: "审批结束日期", width: 150 },
  21. attr: {}
  22. },
  23. {
  24. item: { key: "status", title: "单据状态", width: 150 },
  25. attr: { is: "el-dict-tag", dictName: "sys_status" }
  26. },
  27. {
  28. item: { key: "billType", title: "业务类型", width: 150 },
  29. attr: { is: "el-dict-tag", dictName: "sys_business" }
  30. },
  31. {
  32. item: { key: "demandPersonalName", title: "需求人员", width: 150 },
  33. attr: {}
  34. },
  35. {
  36. item: { key: "customerName", title: "需求客户", width: 150 },
  37. attr: {}
  38. },
  39. {
  40. item: { key: "demandDeptName", title: "需求部门", width: 150 },
  41. attr: {}
  42. },
  43. {
  44. item: { key: "source", title: "单据来源", width: 150 },
  45. attr: { is: "el-dict-tag", dictName: "sys_bill_source" }
  46. },
  47. {
  48. item: { key: "approveUser", title: "当前审批人", width: 150 },
  49. attr: {}
  50. },
  51. {
  52. item: { key: "remark", title: "备注", width: 150 },
  53. attr: {}
  54. },
  55. ].map(({ item, attr }) => ({
  56. attr,
  57. item: {
  58. ...item,
  59. width: item.width || 160,
  60. sortabled: true,
  61. fixedabled: true,
  62. filterabled: true,
  63. hiddenabled: true,
  64. },
  65. }));
  66. const SearchColumns = [
  67. {
  68. item: { key: "code", title: "需求单号" },
  69. attr: {
  70. is: "el-input",
  71. clearable: true,
  72. },
  73. },
  74. {
  75. item: { key: "customerName", title: "需求客户" },
  76. attr: {
  77. is: "el-popover-select-v2",
  78. referName: "CUSTOMER_PARAM",
  79. valueKey: "name",
  80. dataMapping: {
  81. customer: "id",
  82. customerName: "name"
  83. },
  84. },
  85. },
  86. {
  87. item: { key: "isCustomerSpecified", title: "是否客户指定" },
  88. attr: {
  89. is: "el-select",
  90. dictName: "sys_yes_no",
  91. clearable: true,
  92. },
  93. },
  94. {
  95. item: { key: "demandPersonalName", title: "需求人员" },
  96. attr: {
  97. is: "el-popover-select-v2",
  98. referName: "CONTACTS_PARAM",
  99. valueKey: "name",
  100. dataMapping: {
  101. demandPersonal: "code",
  102. demandPersonalName: "name"
  103. },
  104. },
  105. },
  106. {
  107. item: { key: "source", title: "单据来源" },
  108. attr: {
  109. is: "el-select",
  110. dictName: "sys_bill_source",
  111. clearable: true,
  112. },
  113. },
  114. {
  115. item: { key: "billType", title: "业务类型" },
  116. attr: {
  117. is: "el-select",
  118. dictName: "sys_business",
  119. clearable: true,
  120. },
  121. },
  122. {
  123. item: { key: "demandDeptName", title: "需求部门" },
  124. attr: {
  125. is: "el-popover-select-v2",
  126. referName: "DEPT_PARAM",
  127. valueKey: "name",
  128. dataMapping: {
  129. demandDept: "id",
  130. demandDeptName: "name"
  131. },
  132. },
  133. },
  134. {
  135. item: { width: 100, key: "demandDate", title: "需求日期", },
  136. attr: {
  137. clearable: true,
  138. is: "el-date-picker",
  139. type: "date",
  140. valueFormat: "yyyy-MM-dd",
  141. },
  142. },
  143. {
  144. item: { key: "materialCode", title: "物料编码" },
  145. attr: {
  146. is: "el-input",
  147. clearable: true,
  148. },
  149. },
  150. {
  151. item: { key: "status", title: "单据状态" },
  152. attr: {
  153. is: "el-select",
  154. dictName: "sys_status",
  155. clearable: true,
  156. },
  157. },
  158. {
  159. item: { key: "planType", title: "需求计划" },
  160. attr: {
  161. is: "el-select",
  162. dictName: "sys_plan_type",
  163. clearable: true,
  164. },
  165. },
  166. {
  167. item: { width: 100, key: "createTimeString", title: "制单日期", },
  168. attr: {
  169. clearable: true,
  170. is: "el-date-picker",
  171. type: "date",
  172. valueFormat: "yyyy-MM-dd",
  173. },
  174. },
  175. {
  176. item: { key: "additionalSupplierName", title: "补单供应商" },
  177. attr: {
  178. is: "el-popover-select-v2",
  179. referName: "SUPPLIER_PARAM",
  180. valueKey: "name",
  181. dataMapping: {
  182. additionalSupplier: "id",
  183. additionalSupplierName: "name"
  184. },
  185. },
  186. },
  187. ];
  188. return { TableColumns, SearchColumns }
  189. }