columns.js 16 KB

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