columns.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. { item: { key: "priceCode", title: "价格编码", width: 150 }, attr: {} },
  5. {
  6. item: { key: "status", title: "状态", width: 100 },
  7. attr: { is: "el-dict-tag", dictName: "sys_status", width: 100 },
  8. },
  9. { item: { key: "supplierName", title: "供应商", width: 150 }, attr: {} },
  10. { item: { key: "currencyName", title: "币种", width: 100 }, attr: {} },
  11. {
  12. item: { key: "explainStr", title: "价格合理性说明", width: 100 },
  13. attr: {},
  14. },
  15. { item: { key: "buyerName", title: "采购员", width: 100 }, attr: {} },
  16. { item: { key: "puDeptName", title: "采购部门", width: 100 }, attr: {} },
  17. {
  18. item: { key: "file", title: "附件", filter: false, width: 100 },
  19. attr: { is: "el-file-preview" },
  20. },
  21. { item: { key: "createByName", title: "创建人", width: 100 }, attr: {} },
  22. {
  23. item: { key: "isEffective", title: "是否已推价格", width: 100 },
  24. attr: { is: "el-dict-tag", dictName: "is_effective"},
  25. },
  26. {
  27. item: { key: "approveTime", title: "单据申请日期", width: 100 },
  28. attr: {},
  29. },
  30. {
  31. item: { key: "sourceType", title: "来源单据类型", width: 100 },
  32. attr: { is: "el-dict-tag", dictName: "price_source" },
  33. },
  34. // 加个字典获取收回模板id
  35. {
  36. item: { key: "", title: "", width: 0 },
  37. attr: { dictName: "oa_templete_id" },
  38. },
  39. ].map(({ item, attr }) => ({
  40. attr,
  41. item: {
  42. ...item,
  43. sortabled: true,
  44. fixedabled: true,
  45. filterabled: true,
  46. hiddenabled: true,
  47. },
  48. }));
  49. const SearchColumns = [
  50. {
  51. item: {
  52. key: "priceCode",
  53. title: "价格编码",
  54. },
  55. attr: {
  56. clearable: true,
  57. is: "el-input",
  58. },
  59. },
  60. {
  61. item: { key: "supplierName", title: "供应商" },
  62. attr: {
  63. is: "el-popover-select-v2",
  64. referName: "SUPPLIER_PARAM",
  65. valueKey: "name",
  66. dataMapping: { supplier: "id", supplierName: "name" },
  67. },
  68. },
  69. {
  70. item: { key: "puOrgName", title: "采购组织" },
  71. attr: {
  72. is: "el-popover-select-v2",
  73. referName: "ORG_PARAM",
  74. valueKey: "name",
  75. dataMapping: { puOrg: "id", puOrgName: "name" },
  76. },
  77. },
  78. {
  79. item: { key: "buyerName", title: "采购员" },
  80. attr: {
  81. is: "el-popover-select-v2",
  82. referName: "CONTACTS_PARAM",
  83. valueKey: "name",
  84. dataMapping: { buyer: "code", buyerName: "name" },
  85. },
  86. },
  87. {
  88. item: { key: "materialCodeList", title: "物料编码" },
  89. attr: {
  90. clearable: true,
  91. is: "el-popover-multiple-select-v2",
  92. valueKey: "code",
  93. referName: "MATERIAL_PARAM",
  94. },
  95. },
  96. {
  97. item: { key: "materialCodes", title: "物料编码" },
  98. attr: {
  99. clearable: true,
  100. is: "el-input",
  101. placeholder: '多物料编码使用 , 隔开',
  102. },
  103. },
  104. {
  105. item: { width: 100, key: "manufacturer", title: "生产厂家" },
  106. attr: {
  107. is: "el-popover-select-v2",
  108. clearable: true,
  109. referName: "MANUFACTURER_PARAM",
  110. valueKey: "id",
  111. dataMapping: {
  112. manufacturer: "id",
  113. manufacturerName: "name",
  114. },
  115. },
  116. },
  117. // {
  118. // item: { key: "currencyName", title: "币种" },
  119. // attr: {
  120. // is: "el-popover-select-v2",
  121. // referName: "CURRENCY_PARAM",
  122. // valueKey: "name",
  123. // dataMapping: { currency: "id", currencyName: "name" },
  124. // },
  125. // },
  126. // {
  127. // item: { key: "puDeptName", title: "采购部门" },
  128. // attr: {
  129. // is: "el-popover-select-v2",
  130. // referName: "DEPT_PARAM",
  131. // valueKey: "name",
  132. // dataMapping: { puDept: "id", puDeptName: "name" },
  133. // },
  134. // },
  135. {
  136. item: { key: "isEffective", title: "是否推价" },
  137. attr: {
  138. is: "el-select",
  139. dictName: "is_effective",
  140. clearable: true,
  141. },
  142. },
  143. {
  144. item: { key: "status", title: "状态" },
  145. attr: {
  146. is: "el-select",
  147. dictName: "sys_status",
  148. clearable: true,
  149. },
  150. },
  151. {
  152. item: { key: "explainStr", title: "内审备注" },
  153. attr: {
  154. clearable: true,
  155. is: "el-input",
  156. },
  157. },
  158. {
  159. item: { width: 100, key: "billDates", title: "单据日期", span: 8 },
  160. attr: {
  161. clearable: true,
  162. is: "el-date-picker",
  163. type: "datetimerange",
  164. rangeSeparator: "至",
  165. startPlaceholder: "开始日期",
  166. endPlaceholder: "结束日期",
  167. valueFormat: "yyyy-MM-dd hh:mm:ss",
  168. },
  169. },
  170. ];
  171. return { TableColumns, SearchColumns };
  172. }