columns.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. {
  5. item: { width:100,key: "puOrgName", title: "采购组织", require: true ,},
  6. attr: {
  7. is: "el-popover-select-v2",
  8. valuewidth:100,key: "name",
  9. referName: "ORG_PARAM",
  10. dataMapping: {
  11. puOrg: "code",
  12. puOrgName: "name",
  13. },
  14. },
  15. },
  16. { item: { width:100,key: "code", title: "合同编码" }, attr: { is: "el-input" } },
  17. {
  18. item: { width:100,key: "status", title: "状态" },
  19. attr: {
  20. is: "el-select",
  21. dictName: "documents_status",
  22. disabled: true,
  23. value: "0",
  24. },
  25. },
  26. {
  27. item: { width:100,key: "lastPuMoney", title: "上年度采购额" },
  28. attr: {
  29. is: "el-input-number",
  30. precision: CONFIG.precision,
  31. },
  32. },
  33. {
  34. item: { width:100,key: "buyerName", title: "采购员", require: true ,},
  35. attr: {
  36. is: "el-popover-select-v2",
  37. valuewidth:100,key: "name",
  38. referName: "CONTACTS_PARAM",
  39. dataMapping: {
  40. buyer: "code",
  41. buyerName: "name",
  42. puDept: "deptId",
  43. puDeptName: "deptName",
  44. },
  45. },
  46. },
  47. {
  48. item: { width:100,key: "supplierName", title: "供应商", require: true, },
  49. attr: {
  50. is: "el-popover-select-v2",
  51. valuewidth:100,key: "name",
  52. referName: "SUPPLIER_PARAM",
  53. dataMapping: {
  54. supplier: "code",
  55. supplierName: "name",
  56. },
  57. },
  58. },
  59. {
  60. item: { width:100,key: "contractType", title: "合同类型", require: true ,},
  61. attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
  62. },
  63. {
  64. item: { width:100,key: "puMoneyYear", title: "本年度采购额" },
  65. attr: {
  66. is: "el-input-number",
  67. precision: CONFIG.precision,
  68. },
  69. },
  70. {
  71. item: { width:100,key: "puDeptName", title: "采购部门", require: true, },
  72. attr: {
  73. is: "el-popover-select-v2",
  74. valuewidth:100,key: "name",
  75. referName: "DEPT_PARAM",
  76. dataMapping: {
  77. puDept: "code",
  78. puDeptName: "name",
  79. },
  80. },
  81. },
  82. {
  83. item: { width:100,key: "supplierTier", title: "供应商层级", require: true ,},
  84. attr: { is: "el-select", dictName: "puarchase_contract_supplier_tier" },
  85. },
  86. {
  87. item: { width:100,key: "contractName", title: "合同名称", require: true, },
  88. attr: { is: "el-input" },
  89. },
  90. {
  91. item: { width:100,key: "grossRateAverage", title: "平均毛利率 (%)", require: true ,},
  92. attr: {
  93. is: "el-input-number",
  94. precision: 2,
  95. },
  96. },
  97. {
  98. item: { width:100,key: "approveFlow", title: "审批流程", require: true, },
  99. attr: { is: "el-select", dictName: "puarchase_contract_approve_flow" },
  100. },
  101. {
  102. item: { width:100,key: "consumableClass", title: "耗材类别", require: true, },
  103. attr: {
  104. is: "el-select",
  105. dictName: "puarchase_contract_consumable_class",
  106. },
  107. },
  108. {
  109. item: { width:100,key: "effectiveDate", title: "合同生效日期", require: true ,},
  110. attr: {
  111. is: "el-date-picker",
  112. valueFormat: "yyyy-MM-dd",
  113. },
  114. },
  115. {
  116. item: {
  117. width:100,key: "brandGrossRate",
  118. title: "同类品牌及毛利率 (%)",
  119. require: true,
  120. },
  121. attr: {
  122. is: "el-input-number",
  123. precision: 2,
  124. },
  125. },
  126. {
  127. item: { width:100,key: "contractFormat", title: "合同格式", require: true, },
  128. attr: {
  129. is: "el-select",
  130. dictName: "puarchase_contract_contract_format",
  131. },
  132. },
  133. {
  134. item: { width:100,key: "productName", title: "产品类别&名称", require: true, },
  135. attr: { is: "el-input" },
  136. },
  137. {
  138. item: { width:100,key: "endDate", title: "合同终止日期", require: true ,},
  139. attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
  140. },
  141. {
  142. item: { width:100,key: "invoiceTax", title: "发票税率 (%)", require: true,},
  143. attr: {
  144. is: "el-popover-select-v2",
  145. valuewidth:100,key: "ntaxrate",
  146. referName: "TAX_RATE_PARAM",
  147. dataMapping: {
  148. invoiceTax: "ntaxrate",
  149. },
  150. },
  151. },
  152. {
  153. item: { width:100,key: "emergencyDegree", title: "紧急程度", require: true ,},
  154. attr: {
  155. is: "el-select",
  156. dictName: "puarchase_contract_emergency_degree",
  157. },
  158. },
  159. {
  160. item: { width:100,key: "project", title: "项目医院", require: true ,},
  161. attr: { is: "el-input" },
  162. },
  163. {
  164. item: { width:100,key: "deliveryType", title: "交货方式", require: true, },
  165. attr: { is: "el-select", dictName: "puarchase_contract_delivery_type" },
  166. },
  167. {
  168. item: { width:100,key: "source", title: "合同来源" },
  169. attr: { is: "el-input", value: "自制", disabled: true, },
  170. },
  171. {
  172. item: { width:100,key: "contractPartycName", title: "合同丙方" },
  173. attr: {
  174. is: "el-popover-select-v2",
  175. valuewidth:100,key: "name",
  176. referName: "SUPPLIER_PARAM",
  177. dataMapping: {
  178. contractPartyc: "code",
  179. contractPartycName: "name",
  180. },
  181. },
  182. },
  183. {
  184. item: { width:100,key: "guaranteePeriodEnd", title: "质保期限", require: true ,},
  185. attr: { is: "el-input-number", precision: 2 },
  186. },
  187. {
  188. item: { width:100,key: "freightMethods", title: "运费承担方式" },
  189. attr: {
  190. is: "el-select",
  191. dictName: "puarchase_contract_freight_methods",
  192. },
  193. },
  194. {
  195. item: { width:100,key: "signDate", title: "合同签订日期" },
  196. attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
  197. },
  198. {
  199. item: { width:100,key: "isTarget", title: "是否有指标", require: true ,},
  200. attr: { is: "el-select", dictName: "sys_yes_no" },
  201. },
  202. {
  203. item: { width:100,key: "contractTarget", title: "合同指标", require: true, },
  204. attr: { is: "el-input", placeholder: '当【是否有指标】="有"时,必填' },
  205. },
  206. {
  207. item: { width:100,key: "exemptionPostageCondtion", title: "包邮条件", span: 12 },
  208. attr: {
  209. is: "el-input",
  210. placeholder:
  211. "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
  212. },
  213. },
  214. {
  215. item: { width:100,key: "isRebate", title: "是否有返利", require: true, },
  216. attr: { is: "el-select", dictName: "sys_yes_no" },
  217. },
  218. {
  219. item: { width:100,key: "rebatePolicy", title: "返利政策", span: 18 },
  220. attr: {
  221. is: "el-input",
  222. placeholder: '当【是否有返利】="有"时,必填',
  223. },
  224. },
  225. {
  226. item: { width:100,key: "externalContract", title: "外部合同号" },
  227. attr: { is: "el-input" },
  228. },
  229. {
  230. item: { width:100,key: "rollbackPolicy", title: "退换货政策", require: true ,},
  231. attr: { is: "el-input" },
  232. },
  233. {
  234. item: { width:100,key: "enquiryCode", title: "询价单号" },
  235. attr: { is: "el-input" },
  236. },
  237. {
  238. item: {
  239. width:100,key: "contractContent",
  240. title: "合同主要内容",
  241. require: true,
  242. span: 24,
  243. },
  244. attr: { is: "el-input", type: "textarea" },
  245. },
  246. {
  247. item: { width:100,key: "refusalReasons", title: "拒绝理由", span: 24 },
  248. attr: { is: "el-input" },
  249. },
  250. // {
  251. // item: { width:100,key: "pigeonhole", title: "是否归档" },
  252. // attr: { is: "el-select", dictName: "sys_yes_no", disabled: true },
  253. // },
  254. // {
  255. // item: { width:100,key: "pigeonholeFile", title: "归档附件", span: 24 },
  256. // attr: { is: "el-file-upload", fileType: ["pdf"], disabled: true },
  257. // },
  258. {
  259. item: { width:100,key: "externalFile", title: "对外附件", span: 24 },
  260. attr: { is: "el-file-upload", fileType: ["pdf"] },
  261. },
  262. {
  263. item: { width:100,key: "puFile", title: "采购商盖章合同附件", span: 24 },
  264. attr: { is: "el-file-upload", fileType: ["pdf"] },
  265. },
  266. {
  267. item: { width:100,key: "supplierFile", title: "供应商盖章合同附件", span: 24 },
  268. attr: { is: "el-file-upload", fileType: ["pdf"] },
  269. },
  270. {
  271. item: { width:100,key: "projectCode", title: "项目编号" },
  272. attr: { is: "el-input" },
  273. },
  274. {
  275. item: { width:100,key: "projectName", title: "项目名称" },
  276. attr: { is: "el-input" },
  277. },
  278. { item: { width:100,key: "area", title: "区域" }, attr: { is: "el-input" } },
  279. {
  280. item: { width:100,key: "consigneePhone", title: "收货人联系方式" },
  281. attr: { is: "el-input" },
  282. },
  283. {
  284. item: { width:100,key: "paymentAgreement", title: "付款协议", require: true, },
  285. attr: {
  286. is: "el-popover-select-v2",
  287. valuewidth:100,key: "name",
  288. referName: "PAYAGREEMENT_PARAM",
  289. dataMapping: {
  290. paymentAgreement: "code",
  291. paymentAgreementName: "name",
  292. },
  293. },
  294. },
  295. {
  296. item: { width:100,key: "taxPrice", title: "价税合计" },
  297. attr: {
  298. is: "el-input-number",
  299. precision: CONFIG.precision,
  300. },
  301. },
  302. {
  303. item: { width:100,key: "currencyName", title: "币种", require: true, },
  304. attr: {
  305. is: "el-popover-select-v2",
  306. valuewidth:100,key: "name",
  307. referName: "CURRENCY_PARAM",
  308. dataMapping: {
  309. currency: "code",
  310. currencyName: "name",
  311. },
  312. },
  313. },
  314. {
  315. item: { width:100,key: "guaranteePeriod", title: "质保期" },
  316. attr: {
  317. is: "el-input-number",
  318. precision: CONFIG.precision,
  319. },
  320. },
  321. ].map(({ item, attr }) => ({
  322. attr,
  323. item: { ...item, hidden: true, span: item.span || 6 },
  324. }));
  325. const TabColumns = [
  326. {
  327. item: { title: "物料基本信息", width:100,key: "contractItemList" },
  328. attr: { value: [] },
  329. TableColumns: [
  330. {
  331. item: {
  332. title: "物料名称",
  333. width:100,key: "materialName",
  334. require: true ,
  335. },
  336. attr: {
  337. is: "el-popover-select-v2",
  338. valuewidth:100,key: "name",
  339. referName: "MATERIAL_PARAM",
  340. dataMapping: {
  341. material: "code",
  342. materialName: "name",
  343. puUnit: "unitIdName",
  344. registration: "registrationNo",
  345. specification: "specification",
  346. manufacturer: "manufacturerIdName",
  347. },
  348. },
  349. },
  350. {
  351. item: {
  352. title: "物料编码",
  353. width:100,key: "material",
  354. require: true ,
  355. },
  356. attr: {},
  357. },
  358. {
  359. item: {
  360. title: "规格",
  361. width:100,key: "specification",
  362. },
  363. attr: {},
  364. },
  365. {
  366. item: {
  367. title: "生产厂家",
  368. width:100,key: "manufacturer",
  369. },
  370. attr: {
  371. is: "el-input",
  372. },
  373. },
  374. {
  375. item: { title: "采购单位", width:100,key: "puUnit" },
  376. attr: {
  377. is: "el-popover-select-v2",
  378. valuewidth:100,key: "name",
  379. referName: "UNIT_PARAM",
  380. dataMapping: {
  381. puUnit: "name",
  382. },
  383. },
  384. },
  385. {
  386. item: { title: "税率%", width:100,key: "tax" ,require: true, },
  387. attr: {
  388. is: "el-popover-select-v2",
  389. valuewidth:100,key: "ntaxrate",
  390. referName: "TAX_RATE_PARAM",
  391. dataMapping: {
  392. tax: "ntaxrate",
  393. },
  394. },
  395. },
  396. {
  397. item: { title: "采购数量", width:100,key: "qty" },
  398. attr: {
  399. is: "el-input-number",
  400. },
  401. },
  402. {
  403. item: { title: "含税单价", width:100,key: "taxPrice" ,require: true, },
  404. attr: {
  405. is: "el-input-number",
  406. precision: CONFIG.precision,
  407. },
  408. },
  409. {
  410. item: { title: "含税金额合计", width:100,key: "taxMoney" },
  411. attr: {
  412. formatter: (prop) => {
  413. const { qty = 0, taxPrice = 0 } = prop;
  414. prop.taxMoney = (qty * taxPrice * 1);
  415. return prop.taxMoney;
  416. },
  417. },
  418. },
  419. {
  420. item: { title: "无税单价", width:100,key: "taxFreePrice" ,require: true, },
  421. attr: {
  422. formatter: (prop) => {
  423. const { tax = 0, taxPrice = 0 } = prop;
  424. prop.taxFreePrice = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
  425. CONFIG.precision
  426. );
  427. return prop.taxFreePrice;
  428. },
  429. },
  430. },
  431. {
  432. item: { title: "无税金额合计", width:100,key: "taxFreeMoney" },
  433. attr: {
  434. formatter: (prop) => {
  435. const { qty = 0, tax = 0, taxPrice = 0 } = prop;
  436. prop.taxFreeMoney = (
  437. qty *
  438. (taxPrice / (tax / 100 + 1)) *
  439. 1
  440. );
  441. return prop.taxFreeMoney;
  442. },
  443. },
  444. },
  445. {
  446. item: { title: "注册证号及备案凭证号", width:100,key: "registration" },
  447. attr: {
  448. is: "el-input",
  449. },
  450. },
  451. {
  452. item: { title: "收货客户", width:100,key: "customerName" },
  453. attr: {
  454. is: "el-popover-select-v2",
  455. valuewidth:100,key: "name",
  456. referName: "CUSTOMER_PARAM",
  457. dataMapping: {
  458. customer: "code",
  459. customerName: "name",
  460. },
  461. },
  462. },
  463. ],
  464. },
  465. {
  466. item: { title: "合同条款", width:100,key: "contractClauseList" },
  467. attr: {
  468. value: [],
  469. },
  470. TableColumns: [
  471. {
  472. item: { title: "条款编码", width:100,key: "code", width: "auto" },
  473. attr: { is: "el-input" },
  474. },
  475. {
  476. item: { title: "条款名称", width:100,key: "name", width: "auto" },
  477. attr: { is: "el-input" },
  478. },
  479. {
  480. item: { title: "条款内容", width:100,key: "content", width: "auto" },
  481. attr: { is: "el-input" },
  482. },
  483. {
  484. item: { title: "变量序号", width:100,key: "variableRowno", width: "auto" },
  485. attr: { is: "el-input" },
  486. },
  487. {
  488. item: { title: "变量内容", width:100,key: "variableContent", width: "auto" },
  489. attr: { is: "el-input" },
  490. },
  491. ],
  492. },
  493. {
  494. item: { title: "合同费用", width:100,key: "contractExpenseList" },
  495. attr: {
  496. value: [],
  497. },
  498. TableColumns: [
  499. {
  500. item: { title: "费用编码", width:100,key: "code", width: "auto" },
  501. attr: { is: "el-input" },
  502. },
  503. {
  504. item: { title: "费用名称", width:100,key: "name", width: "auto" },
  505. attr: { is: "el-input" },
  506. },
  507. {
  508. item: { title: "费用金额", width:100,key: "money", width: "auto" },
  509. attr: { is: "el-input-number", precision: CONFIG.precision },
  510. },
  511. ],
  512. },
  513. {
  514. item: { title: "付款协议信息", width:100,key: "contractAgreementList" },
  515. attr: {
  516. value: [],
  517. },
  518. TableColumns: [
  519. {
  520. item: { title: "付款阶段", width:100,key: "satge" },
  521. attr: { is: "el-input-number" },
  522. },
  523. {
  524. item: {
  525. title: "付款起点",
  526. width:100,key: "origin",
  527. require: true
  528. },
  529. attr: {
  530. is: "el-select",
  531. dictName: "puarchase_contract_origin",
  532. },
  533. },
  534. {
  535. item: { title: "账期天数", width:100,key: "paymetDays" ,require: true, },
  536. attr: {
  537. is: "el-input-number",
  538. precision: 2,
  539. },
  540. },
  541. {
  542. item: { title: "付款比例%", width:100,key: "ratio",require: true, },
  543. attr: {
  544. is: "el-input-number",
  545. precision: CONFIG.precision,
  546. },
  547. },
  548. {
  549. item: { title: "付款金额", width:100,key: "money" },
  550. attr: {
  551. is: "el-input-number",
  552. precision: CONFIG.precision,
  553. },
  554. },
  555. {
  556. item: {
  557. title: "是否预付款",
  558. width:100,key: "isAdvance",
  559. },
  560. attr: {
  561. is: "el-select",
  562. dictName: "sys_yes_no",
  563. },
  564. },
  565. {
  566. item: {
  567. title: "是否质保金",
  568. width:100,key: "isQuality",
  569. },
  570. attr: {
  571. is: "el-select",
  572. dictName: "sys_yes_no",
  573. },
  574. },
  575. {
  576. item: {
  577. title: "结算方式",
  578. width:100,key: "paymentMeans",
  579. require:true,
  580. },
  581. attr: {
  582. is: "el-popover-select-v2",
  583. valuewidth:100,key: "name",
  584. referName: "BALATYPE_PARAM",
  585. dataMapping: {
  586. paymentMeans: "name",
  587. },
  588. },
  589. },
  590. {
  591. item: {
  592. title: "需进度确认",
  593. width:100,key: "schedule",
  594. },
  595. attr: {
  596. is: "el-select",
  597. dictName: "sys_yes_no",
  598. },
  599. },
  600. ],
  601. },
  602. {
  603. item: { title: "合同执行组织范围", width:100,key: "contractApplyOrgList" },
  604. attr: { value: [] },
  605. TableColumns: [
  606. {
  607. item: {
  608. title: "组织名称",
  609. width:100,key: "orgName",
  610. width: "auto",
  611. },
  612. attr: {
  613. is: "el-popover-select-v2",
  614. valuewidth:100,key: "name",
  615. referName: "ORG_PARAM",
  616. dataMapping: {
  617. org: "code",
  618. orgName: "name",
  619. },
  620. },
  621. },
  622. { item: { title: "组织编码", width:100,key: "org", width: "auto" }, attr: {} },
  623. ],
  624. },
  625. ].map(({item,attr,TableColumns}) =>({
  626. attr,
  627. item,
  628. TableColumns:TableColumns.map(({item, attr}) =>({
  629. attr,
  630. item: { ...item, hidden: true, span: item.span || 6 },
  631. }))
  632. }))
  633. ;
  634. return { TableColumns, TabColumns };
  635. }