columns.js 16 KB

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