columns.js 4.3 KB

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