columns.js 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. { item: { width: 100, key: "puOrgName", title: "采购组织" }, attr: {} },
  5. { item: { width: 100, key: "code", title: "合同编码" }, attr: {} },
  6. {
  7. item: { width: 100, key: "status", title: "状态" },
  8. attr: { is: "el-dict-tag", dictName: "documents_status" },
  9. },
  10. {
  11. item: { width: 100, key: "lastPuMoney", title: "年度采购额" },
  12. attr: {
  13. formatter: (prop) => {
  14. const { lastPuMoney = 0 } = prop;
  15. return (lastPuMoney * 1);
  16. },
  17. },
  18. },
  19. { item: { width: 100, key: "buyerName", title: "采购员" }, attr: {} },
  20. { item: { width: 100, key: "supplierName", title: "供应商" }, attr: {} },
  21. {
  22. item: { width: 100, key: "contractType", title: "合同类型" },
  23. attr: {
  24. is: "el-dict-tag",
  25. dictName: "puarchase_contract_contract_type",
  26. },
  27. },
  28. {
  29. item: { width: 100, key: "puMoneyYear", title: "合同总金额" },
  30. attr: {
  31. formatter: (prop) => {
  32. const { puMoneyYear = 0 } = prop;
  33. return (puMoneyYear * 1);
  34. },
  35. },
  36. },
  37. { item: { width: 100, key: "puDeptName", title: "采购部门" }, attr: {} },
  38. {
  39. item: { width: 100, key: "supplierTier", title: "供应商层级" },
  40. attr: {
  41. is: "el-dict-tag",
  42. dictName: "puarchase_contract_supplier_tier",
  43. },
  44. },
  45. {
  46. item: { width: 100, key: "contractName", title: "合同名称" },
  47. attr: {},
  48. },
  49. {
  50. item: { width: 100, key: "grossRateAverage", title: "平均毛利率 (%)" },
  51. attr: {
  52. is: "el-computed-input-v2",
  53. formatter: (prop) => {
  54. const { grossRateAverage = 0 } = prop;
  55. return (grossRateAverage * 1).toFixed(2);
  56. },
  57. },
  58. },
  59. {
  60. item: { width: 100, key: "approveFlow", title: "审批流程" },
  61. attr: {
  62. is: "el-dict-tag",
  63. dictName: "puarchase_contract_approve_flow",
  64. },
  65. },
  66. {
  67. item: { width: 100, key: "consumableClass", title: "耗材类别" },
  68. attr: {
  69. is: "el-dict-tag",
  70. dictName: "puarchase_contract_consumable_class",
  71. },
  72. },
  73. {
  74. item: { width: 100, key: "effectiveDate", title: "合同生效日期" },
  75. attr: {},
  76. },
  77. {
  78. item: {
  79. width: 100,
  80. key: "brandGrossRate",
  81. title: "同类品牌及毛利率 (%)",
  82. },
  83. attr: {
  84. formatter: (prop) => {
  85. const { brandGrossRate = 2 } = prop;
  86. return (brandGrossRate * 1).toFixed(2);
  87. },
  88. },
  89. },
  90. {
  91. item: { width: 100, key: "contractFormat", title: "合同格式" },
  92. attr: {
  93. is: "el-dict-tag",
  94. dictName: "puarchase_contract_contract_format",
  95. },
  96. },
  97. {
  98. item: { width: 100, key: "productName", title: "产品类别&名称" },
  99. attr: {},
  100. },
  101. { item: { width: 100, key: "endDate", title: "合同终止日期" }, attr: {} },
  102. {
  103. item: { width: 100, key: "invoiceTax", title: "发票税率 (%)" },
  104. attr: {
  105. formatter: (prop) => {
  106. const { invoiceTax } = prop;
  107. return (invoiceTax * 1).toFixed(2);
  108. },
  109. },
  110. },
  111. {
  112. item: { width: 100, key: "emergencyDegree", title: "紧急程度" },
  113. attr: {
  114. is: "el-dict-tag",
  115. dictName: "puarchase_contract_emergency_degree",
  116. },
  117. },
  118. { item: { width: 100, key: "project", title: "项目医院" }, attr: {} },
  119. {
  120. item: { width: 100, key: "deliveryType", title: "交货方式" },
  121. attr: {
  122. is: "el-dict-tag",
  123. dictName: "puarchase_contract_delivery_type",
  124. },
  125. },
  126. { item: { width: 100, key: "source", title: "合同来源" }, attr: {} },
  127. {
  128. item: { width: 100, key: "contractPartycName", title: "合同丙方" },
  129. attr: {},
  130. },
  131. {
  132. item: { width: 100, key: "guaranteePeriodEnd", title: "质保期限" },
  133. attr: {},
  134. },
  135. {
  136. item: { width: 100, key: "freightMethods", title: "运费承担方式" },
  137. attr: {
  138. is: "el-dict-tag",
  139. dictName: "puarchase_contract_freight_methods",
  140. },
  141. },
  142. {
  143. item: { width: 100, key: "createTime", title: "合同创建时间" },
  144. attr: {},
  145. },
  146. {
  147. item: { width: 100, key: "isTarget", title: "是否有指标" },
  148. attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
  149. },
  150. {
  151. item: { width: 100, key: "contractTarget", title: "合同指标" },
  152. attr: {},
  153. },
  154. {
  155. item: { width: 100, key: "exemptionPostageCondtion", title: "包邮条件" },
  156. attr: {},
  157. },
  158. {
  159. item: { width: 100, key: "isRebate", title: "是否有返利" },
  160. attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
  161. },
  162. {
  163. item: { width: 100, key: "rebatePolicy", title: "返利政策" },
  164. attr: {},
  165. },
  166. {
  167. item: { width: 100, key: "externalContract", title: "外部合同号" },
  168. attr: {},
  169. },
  170. {
  171. item: { width: 100, key: "rollbackPolicy", title: "退换货政策" },
  172. attr: {},
  173. },
  174. { item: { width: 100, key: "enquiryCode", title: "询价单号" }, attr: {} },
  175. {
  176. item: { width: 100, key: "contractContent", title: "合同主要内容" },
  177. attr: {},
  178. },
  179. {
  180. item: { width: 100, key: "refusalReasons", title: "拒绝理由" },
  181. attr: {},
  182. },
  183. {
  184. item: { width: 100, key: "pigeonhole", title: "是否归档" },
  185. attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
  186. },
  187. {
  188. item: {
  189. width: 100,
  190. key: "pigeonholeFile",
  191. title: "归档附件",
  192. filterabled: false,
  193. },
  194. attr: { is: "el-file-preview" },
  195. },
  196. {
  197. item: {
  198. width: 100,
  199. key: "externalFile",
  200. title: "对外附件",
  201. filterabled: false,
  202. },
  203. attr: { is: "el-file-preview" },
  204. },
  205. {
  206. item: {
  207. width: 100,
  208. key: "puFile",
  209. title: "盖章合同附件",
  210. filterabled: false,
  211. },
  212. attr: { is: "el-file-preview" },
  213. },
  214. {
  215. item: {
  216. width: 100,
  217. key: "supplierFile",
  218. title: "供应商盖章合同附件",
  219. filterabled: false,
  220. },
  221. attr: { is: "el-file-preview" },
  222. },
  223. { item: { width: 100, key: "projectCode", title: "项目编号" }, attr: {} },
  224. { item: { width: 100, key: "projectName", title: "项目名称" }, attr: {} },
  225. { item: { width: 100, key: "area", title: "区域" }, attr: {} },
  226. {
  227. item: { width: 100, key: "consigneePhone", title: "收货人联系方式" },
  228. attr: {},
  229. },
  230. {
  231. item: { width: 100, key: "paymentAgreement", title: "付款协议" },
  232. attr: {},
  233. },
  234. {
  235. item: { width: 100, key: "taxPrice", title: "价税合计" },
  236. attr: {
  237. formatter: (prop) => {
  238. const { taxPrice = 0 } = prop;
  239. return (taxPrice * 1);
  240. },
  241. },
  242. },
  243. { item: { width: 100, key: "currencyName", title: "币种" }, attr: {} },
  244. {
  245. item: { width: 100, key: "guaranteePeriod", title: "质保期" },
  246. attr: {},
  247. },
  248. ].map(({ item, attr }) => ({
  249. attr,
  250. item: {
  251. sortabled: true,
  252. fixedabled: true,
  253. filterabled: true,
  254. hiddenabled: true,
  255. ...item,
  256. },
  257. }));
  258. const SearchColumns = [
  259. {
  260. item: {
  261. width: 100,
  262. key: "contractName",
  263. title: "合同名称",
  264. },
  265. attr: {
  266. is: "el-input",
  267. clearable: true,
  268. },
  269. },
  270. {
  271. item: { key: "buyerName", title: "采购员", width: 100 },
  272. attr: {
  273. is: "el-popover-select-v2",
  274. clearable: true,
  275. valueKey: "name",
  276. referName: "CONTACTS_PARAM",
  277. dataMapping: {
  278. buyer: "code",
  279. buyerName: "name",
  280. },
  281. },
  282. },
  283. {
  284. item: {
  285. key: "puOrgName",
  286. title: "采购组织",
  287. },
  288. attr: {
  289. is: "el-popover-select-v2",
  290. clearable: true,
  291. valueKey: "name",
  292. referName: "ORG_PARAM",
  293. dataMapping: {
  294. puOrg: "code",
  295. puOrgName: "name",
  296. },
  297. },
  298. },
  299. {
  300. item:{
  301. key: "materialName",
  302. title: "物料名称",
  303. },
  304. attr:{
  305. clearable:true,
  306. is: "el-popover-select-v2",
  307. valueKey: "name",
  308. referName: "MATERIAL_PARAM",
  309. // dataMapping: {
  310. // material: "code",
  311. // }
  312. },
  313. },
  314. {
  315. item: { width: 100, key: "contractType", title: "合同类型" },
  316. attr: {
  317. is: "el-select",
  318. dictName: "puarchase_contract_contract_type",
  319. clearable: true,
  320. },
  321. },
  322. {
  323. item: { width: 100, key: "approveFlow", title: "审批流程" },
  324. attr: {
  325. is: "el-select",
  326. dictName: "puarchase_contract_approve_flow",
  327. clearable: true,
  328. },
  329. },
  330. {
  331. item: { width: 100, key: "code", title: "合同编码" },
  332. attr: {
  333. is: "el-input",
  334. clearable: true,
  335. },
  336. },
  337. {
  338. item: {
  339. key: "supplierName",
  340. title: "供应商",
  341. },
  342. attr: {
  343. is: "el-popover-select-v2",
  344. clearable: true,
  345. valueKey: "name",
  346. referName: "SUPPLIER_PARAM",
  347. dataMapping: {
  348. supplier: "code",
  349. supplierName: "name",
  350. },
  351. },
  352. },
  353. {
  354. item:{
  355. key: "beginAndEndTimeList",
  356. title: "合同创建日期",
  357. span:12,
  358. },
  359. attr: {
  360. clearable:true,
  361. is: "el-date-wrapper",
  362. },
  363. },
  364. {
  365. item: { width: 100, key: "status", title: "状态" },
  366. attr: {
  367. is: "el-select",
  368. dictName: "documents_status",
  369. clearable: true,
  370. },
  371. },
  372. {
  373. item: {
  374. width: 100,
  375. key: "pigeonhole",
  376. title: "是否归档",
  377. },
  378. attr: {
  379. is: "el-select",
  380. dictName: "sys_yes_no",
  381. },
  382. },
  383. ].map(({ item, attr }) => ({
  384. attr,
  385. item: { ...item, hidden: true, span: item.span || 6 },
  386. }));
  387. return { TableColumns, SearchColumns };
  388. }