columns.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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: {
  89. key: "buyerList",
  90. title: "采购员",
  91. },
  92. attr: {
  93. clearable: true,
  94. is: "el-popover-multiple-select-v2",
  95. referName: "CONTACTS_PARAM",
  96. valueKey: "code",
  97. },
  98. },
  99. {
  100. item: { key: "materialCodeList", title: "物料编码" },
  101. attr: {
  102. clearable: true,
  103. is: "el-popover-multiple-select-v2",
  104. valueKey: "code",
  105. referName: "MATERIAL_PARAM",
  106. },
  107. },
  108. {
  109. item: { key: "materialCodes", title: "物料编码" },
  110. attr: {
  111. clearable: true,
  112. is: "el-input",
  113. placeholder: '多物料编码使用 , 隔开',
  114. },
  115. },
  116. {
  117. item: { width: 100, key: "manufacturer", title: "生产厂家" },
  118. attr: {
  119. is: "el-popover-select-v2",
  120. clearable: true,
  121. referName: "MANUFACTURER_PARAM",
  122. valueKey: "id",
  123. dataMapping: {
  124. manufacturer: "id",
  125. manufacturerName: "name",
  126. },
  127. },
  128. },
  129. // {
  130. // item: { key: "currencyName", title: "币种" },
  131. // attr: {
  132. // is: "el-popover-select-v2",
  133. // referName: "CURRENCY_PARAM",
  134. // valueKey: "name",
  135. // dataMapping: { currency: "id", currencyName: "name" },
  136. // },
  137. // },
  138. // {
  139. // item: { key: "puDeptName", title: "采购部门" },
  140. // attr: {
  141. // is: "el-popover-select-v2",
  142. // referName: "DEPT_PARAM",
  143. // valueKey: "name",
  144. // dataMapping: { puDept: "id", puDeptName: "name" },
  145. // },
  146. // },
  147. {
  148. item: { key: "isEffective", title: "是否推价" },
  149. attr: {
  150. is: "el-select",
  151. dictName: "is_effective",
  152. clearable: true,
  153. },
  154. },
  155. {
  156. item: { key: "status", title: "状态" },
  157. attr: {
  158. is: "el-select",
  159. dictName: "sys_status",
  160. clearable: true,
  161. },
  162. },
  163. {
  164. item: { key: "explainStr", title: "内审备注" },
  165. attr: {
  166. clearable: true,
  167. is: "el-input",
  168. },
  169. },
  170. {
  171. item: { width: 100, key: "billDates", title: "单据日期", span: 8 },
  172. attr: {
  173. clearable: true,
  174. is: "el-date-picker",
  175. type: "datetimerange",
  176. rangeSeparator: "至",
  177. startPlaceholder: "开始日期",
  178. endPlaceholder: "结束日期",
  179. valueFormat: "yyyy-MM-dd hh:mm:ss",
  180. },
  181. },
  182. ];
  183. return { TableColumns, SearchColumns };
  184. }