index.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. <template>
  2. <basic-container>
  3. <avue-crud
  4. :option="option"
  5. :table-loading="loading"
  6. :data="data"
  7. :page.sync="page"
  8. :permission="permissionList"
  9. :before-open="beforeOpen"
  10. v-model="form"
  11. ref="crud"
  12. id="out-table"
  13. :header-cell-class-name="headerClassName"
  14. @row-update="rowUpdate"
  15. @row-save="rowSave"
  16. @row-del="rowDel"
  17. @search-change="searchChange"
  18. @search-reset="searchReset"
  19. @selection-change="selectionChange"
  20. @current-change="currentChange"
  21. @size-change="sizeChange"
  22. @refresh-change="refreshChange"
  23. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 313)"
  24. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 313)"
  25. @on-load="onLoad"
  26. >
  27. <template slot="menuLeft">
  28. <!--<el-button type="danger"-->
  29. <!-- size="small"-->
  30. <!-- icon="el-icon-delete"-->
  31. <!-- plain-->
  32. <!-- v-if="permission.finaccbills_delete"-->
  33. <!-- @click="handleDelete">删 除-->
  34. <!--</el-button>-->
  35. <!-- <el-button type="primary"-->
  36. <!-- size="small"-->
  37. <!-- plain-->
  38. <!-- @click="handleDelete">结 算-->
  39. <!-- </el-button>-->
  40. <!-- <el-button type="success"-->
  41. <!-- size="small"-->
  42. <!-- plain-->
  43. <!-- @click="handleDelete">发 票-->
  44. <!-- </el-button>-->
  45. <!-- <el-button type="info"-->
  46. <!-- size="small"-->
  47. <!-- plain-->
  48. <!-- @click="handleDelete">凭 证-->
  49. <!-- </el-button>-->
  50. <!-- <el-button type="warning"-->
  51. <!-- size="small"-->
  52. <!-- plain-->
  53. <!-- @click="handleDelete">付费申请-->
  54. <!-- </el-button>-->
  55. </template>
  56. <template slot="reconciliationAmount" slot-scope="{ row }">
  57. <el-popover trigger="click">
  58. <avue-crud :data="rlaData" :option="rlaOption"></avue-crud>
  59. <span style="color: #409EFF;cursor: pointer" slot="reference" @click="viewRLA(row)">{{ row.reconciliationAmount }}</span>
  60. </el-popover>
  61. </template>
  62. <template slot="reconciliationAmountUsd" slot-scope="{ row }">
  63. <el-popover trigger="click">
  64. <avue-crud :data="rlaData" :option="rlaOption"></avue-crud>
  65. <span style="color: #409EFF;cursor: pointer" slot="reference" @click="viewRLA(row)">{{ row.reconciliationAmountUsd }}</span>
  66. </el-popover>
  67. </template>
  68. <template slot="billNo" slot-scope="scope" @click="billNoDetails(scope.row)">
  69. <span style="color: #1e9fff;cursor: pointer">{{ scope.row.billNo }}</span>
  70. </template>
  71. </avue-crud>
  72. </basic-container>
  73. </template>
  74. <script>
  75. import { getList, getDetail, add, update, remove } from "@/api/iosBasicData/finaccbills";
  76. import { mapGetters } from "vuex";
  77. import { BcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  78. import { getWorkDicts } from "@/api/system/dictbiz";
  79. import { getListAll } from "@/api/iosBasicData/finstlbills";
  80. export default {
  81. data() {
  82. return {
  83. rlaData: [],
  84. rlaOption: {
  85. header: false,
  86. menu: false,
  87. align: "center",
  88. column: [
  89. {
  90. label: "来源单号",
  91. prop: "srcNo",
  92. width: "200",
  93. overHidden: true
  94. },
  95. {
  96. label: "来源类型",
  97. prop: "srcType",
  98. width: "80",
  99. overHidden: true
  100. },
  101. {
  102. label: "签收金额",
  103. prop: "signedAmount",
  104. width: "100",
  105. overHidden: true
  106. },
  107. {
  108. label: "签收人",
  109. prop: "consigneeName",
  110. width: "100",
  111. overHidden: true
  112. },
  113. {
  114. label: "签收时间",
  115. prop: "signingTime",
  116. width: "120",
  117. overHidden: true
  118. }
  119. ]
  120. },
  121. form: {},
  122. query: {},
  123. loading: true,
  124. page: {
  125. pageSize: 10,
  126. currentPage: 1,
  127. total: 0
  128. },
  129. selectionList: [],
  130. option: {},
  131. optionBack: {
  132. height: "auto",
  133. calcHeight: 30,
  134. tip: false,
  135. searchShow: true,
  136. searchMenuSpan: 6,
  137. border: true,
  138. index: true,
  139. viewBtn: true,
  140. selection: true,
  141. dialogClickModal: false,
  142. menu: false,
  143. searchIcon: true,
  144. searchIndex: 3,
  145. searchLabelWidth: "100",
  146. column: [
  147. {
  148. label: "账单编号",
  149. prop: "billNo",
  150. search: true,
  151. width: 180,
  152. overHidden: true,
  153. rules: [
  154. {
  155. required: true,
  156. message: "请输入账单编号",
  157. trigger: "blur"
  158. }
  159. ]
  160. },
  161. {
  162. label: "账单日期",
  163. prop: "billDate",
  164. type: "date",
  165. width: 100,
  166. valueFormat: "yyyy-MM-dd",
  167. format: "yyyy-MM-dd",
  168. overHidden: true,
  169. rules: [
  170. {
  171. required: true,
  172. message: "请输入账单日期",
  173. trigger: "blur"
  174. }
  175. ]
  176. },
  177. {
  178. label: "账单属性",
  179. prop: "accountDc",
  180. type: "select",
  181. search: true,
  182. dicData: [
  183. {
  184. label: "应收",
  185. value: "D"
  186. },
  187. {
  188. label: "应付",
  189. value: "C"
  190. }
  191. ],
  192. overHidden: true,
  193. rules: [
  194. {
  195. required: true,
  196. message: "请输入账单属性",
  197. trigger: "blur"
  198. }
  199. ]
  200. },
  201. {
  202. label: "财务日期",
  203. prop: "accountDate",
  204. type: "date",
  205. width: "100",
  206. valueFormat: "yyyy-MM-dd",
  207. format: "yyyy-MM-dd",
  208. overHidden: true,
  209. rules: [
  210. {
  211. required: true,
  212. message: "请输入财务日期",
  213. trigger: "blur"
  214. }
  215. ]
  216. },
  217. {
  218. label: "财务日期",
  219. prop: "accountDateList",
  220. search: true,
  221. hide: true,
  222. width: 100,
  223. type: "daterange",
  224. format: "yyyy-MM-dd",
  225. valueFormat: "yyyy-MM-dd",
  226. searchRange: true,
  227. overHidden: true,
  228. rules: [
  229. {
  230. required: true,
  231. message: "请输入财务日期",
  232. trigger: "blur"
  233. }
  234. ]
  235. },
  236. {
  237. label: "业务类型",
  238. prop: "businessType",
  239. type: "select",
  240. dicData: [],
  241. props: {
  242. label: "dictValue",
  243. value: "dictKey"
  244. },
  245. overHidden: true,
  246. rules: [
  247. {
  248. required: true,
  249. message: "请输入业务类型",
  250. trigger: "blur"
  251. }
  252. ]
  253. },
  254. {
  255. label: "业务单据编号",
  256. prop: "businessBillNo",
  257. search: true,
  258. width: 180,
  259. overHidden: true,
  260. rules: [
  261. {
  262. required: true,
  263. message: "请输入业务单据编号",
  264. trigger: "blur"
  265. }
  266. ]
  267. },
  268. {
  269. label: "业务单据日期",
  270. prop: "businessDate",
  271. type: "date",
  272. width: 180,
  273. valueFormat: "yyyy-MM-dd",
  274. format: "yyyy-MM-dd",
  275. overHidden: true,
  276. rules: [
  277. {
  278. required: true,
  279. message: "请输入业务单据日期",
  280. trigger: "blur"
  281. }
  282. ]
  283. },
  284. {
  285. label: "业务单据日期",
  286. prop: "businessDateList",
  287. search: true,
  288. hide: true,
  289. width: 100,
  290. overHidden: true,
  291. type: "daterange",
  292. format: "yyyy-MM-dd",
  293. valueFormat: "yyyy-MM-dd",
  294. searchRange: true,
  295. rules: [
  296. {
  297. required: true,
  298. message: "请输入业务单据日期",
  299. trigger: "blur"
  300. }
  301. ]
  302. },
  303. {
  304. label: "付款方式",
  305. prop: "paymode",
  306. type: "select",
  307. overHidden: true,
  308. dicData: [
  309. {
  310. label: "预付",
  311. value: "PP"
  312. },
  313. {
  314. label: "到付",
  315. value: "CC"
  316. },
  317. {
  318. label: "FPA",
  319. value: "FPA"
  320. },
  321. {
  322. label: "Other",
  323. value: "Other"
  324. }
  325. ],
  326. rules: [
  327. {
  328. required: true,
  329. message: "请输入付款方式 PP=预付, CC=到付, FPA, Other",
  330. trigger: "blur"
  331. }
  332. ]
  333. },
  334. {
  335. label: "结算单位",
  336. prop: "corpCnName",
  337. search: true,
  338. width: 180,
  339. overHidden: true,
  340. type: "select",
  341. filterable: true,
  342. remote: true,
  343. dicUrl: "/api/blade-los/bcorps/listByType?cnName={{key}}",
  344. dicData: [],
  345. props: {
  346. label: "cnName",
  347. value: "cnName",
  348. res: "data.records"
  349. }
  350. // dicFormatter: (res => {
  351. // return res.data.records
  352. // }),
  353. },
  354. {
  355. label: "客户中文名称",
  356. prop: "billCorpCnName",
  357. search: true,
  358. width: 180,
  359. overHidden: true,
  360. type: "select",
  361. filterable: true,
  362. remote: true,
  363. dicData: [],
  364. dicUrl: "/api/blade-los/bcorps/listByType?cnName={{key}}",
  365. props: {
  366. label: "cnName",
  367. value: "cnName",
  368. res: "data.records"
  369. }
  370. // dicFormatter: (res => {
  371. // return res.data.records
  372. // }),
  373. },
  374. {
  375. label: "MB/L NO",
  376. prop: "mblno",
  377. search: true,
  378. width: 180,
  379. overHidden: true,
  380. rules: [
  381. {
  382. required: true,
  383. message: "请输入MB/L NO",
  384. trigger: "blur"
  385. }
  386. ]
  387. },
  388. {
  389. label: "HB/L NO",
  390. prop: "hblno",
  391. width: 180,
  392. search: true,
  393. overHidden: true,
  394. rules: [
  395. {
  396. required: true,
  397. message: "请输入HB/L NO",
  398. trigger: "blur"
  399. }
  400. ]
  401. },
  402. {
  403. label: "Reference NO",
  404. prop: "refno",
  405. search: true,
  406. width: 180,
  407. overHidden: true,
  408. rules: [
  409. {
  410. required: true,
  411. message: "请输入Reference NO",
  412. trigger: "blur"
  413. }
  414. ]
  415. },
  416. {
  417. label: "所属岗位",
  418. prop: "teamName",
  419. search: true,
  420. overHidden: true,
  421. type: "select",
  422. filterable: true,
  423. remote: true,
  424. dicUrl: "/api/blade-system/post/list?current=1&size=10&postName={{key}}",
  425. props: {
  426. label: "postName",
  427. value: "postName",
  428. res: "data.records"
  429. }
  430. },
  431. {
  432. label: "签收CNY",
  433. prop: "reconciliationAmount",
  434. width: 100,
  435. overHidden: true
  436. },
  437. {
  438. label: "签收USD",
  439. prop: "reconciliationAmountUsd",
  440. width: 110,
  441. overHidden: true
  442. },
  443. {
  444. label: "已申请结算金额",
  445. prop: "appliedAmountStl",
  446. width: 110,
  447. overHidden: true
  448. },
  449. {
  450. label: "已申请发票结算金额",
  451. prop: "appliedInvoiceAmountStl",
  452. width: 130,
  453. overHidden: true
  454. },
  455. {
  456. label: "已申请结算金额USD",
  457. prop: "appliedAmountStlUsd",
  458. width: 130,
  459. overHidden: true
  460. },
  461. {
  462. label: "已申请发票结算金额USD",
  463. prop: "appliedInvoiceAmountStlUsd",
  464. width: 160,
  465. overHidden: true
  466. },
  467. {
  468. label: "CNY应收",
  469. prop: "amountDr",
  470. overHidden: true,
  471. rules: [
  472. {
  473. required: true,
  474. message: "请输入本位币应收(CNY)",
  475. trigger: "blur"
  476. }
  477. ]
  478. },
  479. {
  480. label: "CNY应付",
  481. prop: "amountCr",
  482. overHidden: true,
  483. rules: [
  484. {
  485. required: true,
  486. message: "请输入本位币应付(CNY)",
  487. trigger: "blur"
  488. }
  489. ]
  490. },
  491. {
  492. label: "综合USD应收",
  493. prop: "amountDrUsd",
  494. width: 120,
  495. overHidden: true,
  496. rules: [
  497. {
  498. required: true,
  499. message: "请输入综合 USD 应收(USD) - 非 USD 外币转换为 USD",
  500. trigger: "blur"
  501. }
  502. ]
  503. },
  504. {
  505. label: "综合USD应付",
  506. prop: "amountCrUsd",
  507. width: 120,
  508. overHidden: true,
  509. rules: [
  510. {
  511. required: true,
  512. message: "请输入综合 USD 应付(USD) - 非 USD 外币转换为 USD",
  513. trigger: "blur"
  514. }
  515. ]
  516. },
  517. {
  518. label: "合计CNY应收",
  519. prop: "amountDrLoc",
  520. width: 120,
  521. overHidden: true,
  522. rules: [
  523. {
  524. required: true,
  525. message: "请输入合计本位币应收(CNY )",
  526. trigger: "blur"
  527. }
  528. ]
  529. },
  530. {
  531. label: "合计CNY应付",
  532. prop: "amountCrLoc",
  533. width: 120,
  534. overHidden: true,
  535. rules: [
  536. {
  537. required: true,
  538. message: "请输入合计本位币应付(CNY)",
  539. trigger: "blur"
  540. }
  541. ]
  542. },
  543. {
  544. label: "结算单据编号",
  545. prop: "stlBillNo",
  546. width: 180,
  547. overHidden: true,
  548. rules: [
  549. {
  550. required: true,
  551. message: "请输入结算单据编号",
  552. trigger: "blur"
  553. }
  554. ]
  555. },
  556. {
  557. label: "结算日期",
  558. prop: "stlDate",
  559. type: "date",
  560. width: 100,
  561. valueFormat: "yyyy-MM-dd",
  562. format: "yyyy-MM-dd",
  563. overHidden: true,
  564. rules: [
  565. {
  566. required: true,
  567. message: "请输入结算日期",
  568. trigger: "blur"
  569. }
  570. ]
  571. },
  572. {
  573. label: "已结算CNY应收",
  574. prop: "stlAmountDr",
  575. width: 120,
  576. overHidden: true,
  577. rules: [
  578. {
  579. required: true,
  580. message: "请输入已结算本位币应收(CNY)",
  581. trigger: "blur"
  582. }
  583. ]
  584. },
  585. {
  586. label: "已结算CNY应付",
  587. prop: "stlAmountCr",
  588. width: 120,
  589. overHidden: true,
  590. rules: [
  591. {
  592. required: true,
  593. message: "请输入已结算本位币应付(CNY)",
  594. trigger: "blur"
  595. }
  596. ]
  597. },
  598. // {
  599. // label: "已结算综合USD应收",
  600. // prop: "stlAmountDrUsd",
  601. // width:"140",
  602. // overHidden:true,
  603. // rules: [{
  604. // required: true,
  605. // message: "请输入已结算综合 USD 应收(USD) - 非 USD 外币转换为 USD",
  606. // trigger: "blur"
  607. // }]
  608. // },
  609. // {
  610. // label: "已结算综合USD应付",
  611. // prop: "stlAmountCrUsd",
  612. // width:"140",
  613. // overHidden:true,
  614. // rules: [{
  615. // required: true,
  616. // message: "请输入已结算综合 USD 应付(USD) - 非 USD 外币转换为 USD",
  617. // trigger: "blur"
  618. // }]
  619. // },
  620. {
  621. label: "已结算合计CNY应收",
  622. prop: "stlAmountDrLoc",
  623. width: 140,
  624. overHidden: true,
  625. rules: [
  626. {
  627. required: true,
  628. message: "请输入已结算合计本位币应收(CNY)",
  629. trigger: "blur"
  630. }
  631. ]
  632. },
  633. {
  634. label: "已结算合计CNY应付",
  635. prop: "stlAmountCrLoc",
  636. width: 140,
  637. overHidden: true,
  638. rules: [
  639. {
  640. required: true,
  641. message: "请输入已结算合计本位币应付(CNY)",
  642. trigger: "blur"
  643. }
  644. ]
  645. },
  646. {
  647. label: "发票号",
  648. prop: "invoiceNo",
  649. overHidden: true,
  650. rules: [
  651. {
  652. required: true,
  653. message: "请输入发票号",
  654. trigger: "blur"
  655. }
  656. ]
  657. },
  658. {
  659. label: "发票日期",
  660. prop: "invoiceDate",
  661. type: "date",
  662. width: 100,
  663. valueFormat: "yyyy-MM-dd",
  664. format: "yyyy-MM-dd",
  665. overHidden: true,
  666. rules: [
  667. {
  668. required: true,
  669. message: "请输入发票日期",
  670. trigger: "blur"
  671. }
  672. ]
  673. },
  674. {
  675. label: "开票CNY",
  676. prop: "uninvoicedAmount",
  677. overHidden: true
  678. },
  679. {
  680. label: "开票USD",
  681. prop: "uninvoicedAmountUsd",
  682. overHidden: true
  683. },
  684. {
  685. label: "付费申请金额CNY",
  686. prop: "appliedAmount",
  687. overHidden: true,
  688. width: 120
  689. },
  690. {
  691. label: "付费申请金额USD",
  692. prop: "appliedAmountUsd",
  693. overHidden: true,
  694. width: 120
  695. },
  696. {
  697. label: "申请发票金额CNY",
  698. prop: "appliedInvoiceAmount",
  699. overHidden: true,
  700. width: 120
  701. },
  702. {
  703. label: "申请发票金额USD",
  704. prop: "appliedInvoiceAmountUsd",
  705. overHidden: true,
  706. width: 120
  707. },
  708. // {
  709. // label: "签收CNY",
  710. // prop: "reconciliationAmount",
  711. // width: 100,
  712. // overHidden: true
  713. // },
  714. // {
  715. // label: "签收USD",
  716. // prop: "reconciliationAmountUsd",
  717. // width: 100,
  718. // overHidden: true
  719. // },
  720. {
  721. label: "凭证号",
  722. prop: "voucherNo",
  723. width: 180,
  724. overHidden: true,
  725. rules: [
  726. {
  727. required: true,
  728. message: "请输入凭证号",
  729. trigger: "blur"
  730. }
  731. ]
  732. },
  733. {
  734. label: "凭证日期",
  735. prop: "voucherDate",
  736. type: "date",
  737. width: 100,
  738. valueFormat: "yyyy-MM-dd",
  739. format: "yyyy-MM-dd",
  740. overHidden: true,
  741. rules: [
  742. {
  743. required: true,
  744. message: "请输入凭证日期",
  745. trigger: "blur"
  746. }
  747. ]
  748. },
  749. {
  750. label: "是否对账",
  751. prop: "isChecked",
  752. type: "select",
  753. dicData: [
  754. {
  755. label: "未对账",
  756. value: 0
  757. },
  758. {
  759. label: "部分对账",
  760. value: 1
  761. },
  762. {
  763. label: "已对账",
  764. value: 2
  765. }
  766. ],
  767. overHidden: true,
  768. rules: [
  769. {
  770. required: true,
  771. message: "请输入是否对账",
  772. trigger: "blur"
  773. }
  774. ]
  775. },
  776. {
  777. label: "是否销账",
  778. prop: "isCleared",
  779. type: "select",
  780. dicData: [
  781. {
  782. label: "未销账",
  783. value: 0
  784. },
  785. {
  786. label: "部分销账",
  787. value: 3
  788. },
  789. {
  790. label: "销账",
  791. value: 9
  792. }
  793. ],
  794. overHidden: true,
  795. rules: [
  796. {
  797. required: true,
  798. message: "请输入是否销账",
  799. trigger: "blur"
  800. }
  801. ]
  802. },
  803. {
  804. label: "是否发票",
  805. prop: "invoiceStatus",
  806. type: "select",
  807. dicData: [],
  808. props: {
  809. label: "dictValue",
  810. value: "dictKey"
  811. },
  812. overHidden: true
  813. },
  814. {
  815. label: "账单状态",
  816. prop: "billStatus",
  817. type: "select",
  818. dicData: [
  819. {
  820. label: "未完成",
  821. value: 0
  822. },
  823. {
  824. label: "已完成",
  825. value: 1
  826. }
  827. ],
  828. overHidden: true,
  829. rules: [
  830. {
  831. required: true,
  832. message: "请输入账单状态",
  833. trigger: "blur"
  834. }
  835. ]
  836. },
  837. {
  838. label: "备注",
  839. prop: "remarks",
  840. width: 180,
  841. overHidden: true,
  842. rules: [
  843. {
  844. required: true,
  845. message: "请输入备注",
  846. trigger: "blur"
  847. }
  848. ]
  849. }
  850. ]
  851. },
  852. data: []
  853. };
  854. },
  855. computed: {
  856. ...mapGetters(["permission"]),
  857. permissionList() {
  858. return {
  859. addBtn: this.vaildData(this.permission.finaccbills_add, false),
  860. viewBtn: this.vaildData(this.permission.finaccbills_view, false),
  861. delBtn: this.vaildData(this.permission.finaccbills_delete, false),
  862. editBtn: this.vaildData(this.permission.finaccbills_edit, false)
  863. };
  864. },
  865. ids() {
  866. let ids = [];
  867. this.selectionList.forEach(ele => {
  868. ids.push(ele.id);
  869. });
  870. return ids.join(",");
  871. }
  872. },
  873. async created() {
  874. this.option = await this.getColumnData(this.getColumnName(313), this.optionBack);
  875. this.getBcorpslistByTypefun();
  876. this.getWorkDictsfun();
  877. },
  878. methods: {
  879. viewRLA(row) {
  880. this.rlaData = [];
  881. getListAll({ billId: row.id }).then(res => {
  882. this.rlaData = res.data.data;
  883. });
  884. },
  885. // 获取字典数据
  886. getWorkDictsfun() {
  887. // 获取业务类型
  888. getWorkDicts("business_type_los").then(res => {
  889. this.findObject(this.option.column, "businessType").dicData = res.data.data;
  890. });
  891. // 获取发票状态
  892. getWorkDicts("reconciliation_invoice_los").then(res => {
  893. this.findObject(this.option.column, "invoiceStatus").dicData = res.data.data;
  894. });
  895. },
  896. getBcorpslistByTypefun() {
  897. getBcorpslistByType(1, 10).then(res => {
  898. this.findObject(this.option.column, "corpCnName").dicData = res.data.data.records;
  899. this.findObject(this.option.column, "billCorpCnName").dicData = res.data.data.records;
  900. });
  901. },
  902. rowSave(row, done, loading) {
  903. add(row).then(
  904. () => {
  905. this.onLoad(this.page);
  906. this.$message({
  907. type: "success",
  908. message: "操作成功!"
  909. });
  910. done();
  911. },
  912. error => {
  913. loading();
  914. window.console.log(error);
  915. }
  916. );
  917. },
  918. rowUpdate(row, index, done, loading) {
  919. update(row).then(
  920. () => {
  921. this.onLoad(this.page);
  922. this.$message({
  923. type: "success",
  924. message: "操作成功!"
  925. });
  926. done();
  927. },
  928. error => {
  929. loading();
  930. console.log(error);
  931. }
  932. );
  933. },
  934. rowDel(row) {
  935. this.$confirm("确定将选择数据删除?", {
  936. confirmButtonText: "确定",
  937. cancelButtonText: "取消",
  938. type: "warning"
  939. })
  940. .then(() => {
  941. return remove(row.id);
  942. })
  943. .then(() => {
  944. this.onLoad(this.page);
  945. this.$message({
  946. type: "success",
  947. message: "操作成功!"
  948. });
  949. });
  950. },
  951. // 详情数据
  952. billNoDetails() {},
  953. // 批量删除 这个表不能批量删除
  954. handleDelete() {
  955. if (this.selectionList.length === 0) {
  956. this.$message.warning("请选择至少一条数据");
  957. return;
  958. }
  959. this.$confirm("确定将选择数据删除?", {
  960. confirmButtonText: "确定",
  961. cancelButtonText: "取消",
  962. type: "warning"
  963. })
  964. .then(() => {
  965. return remove(this.ids);
  966. })
  967. .then(() => {
  968. this.onLoad(this.page);
  969. this.$message({
  970. type: "success",
  971. message: "操作成功!"
  972. });
  973. this.$refs.crud.toggleSelection();
  974. });
  975. },
  976. beforeOpen(done, type) {
  977. if (["edit", "view"].includes(type)) {
  978. getDetail(this.form.id).then(res => {
  979. this.form = res.data.data;
  980. });
  981. }
  982. done();
  983. },
  984. searchReset() {
  985. this.query = {};
  986. this.onLoad(this.page);
  987. },
  988. // 搜索点击回调
  989. searchChange(params, done) {
  990. this.query = params;
  991. this.page.currentPage = 1;
  992. this.onLoad(this.page, params);
  993. done();
  994. },
  995. selectionChange(list) {
  996. this.selectionList = list;
  997. },
  998. selectionClear() {
  999. this.selectionList = [];
  1000. this.$refs.crud.toggleSelection();
  1001. },
  1002. currentChange(currentPage) {
  1003. this.page.currentPage = currentPage;
  1004. },
  1005. sizeChange(pageSize) {
  1006. this.page.pageSize = pageSize;
  1007. },
  1008. refreshChange() {
  1009. this.onLoad(this.page, this.query);
  1010. },
  1011. onLoad(page, params = {}) {
  1012. this.loading = true;
  1013. getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  1014. const data = res.data.data;
  1015. this.page.total = data.total;
  1016. this.data = data.records.map(item => {
  1017. item.invoiceStatus = item.invoiceStatus + "";
  1018. return item;
  1019. });
  1020. this.$nextTick(() => {
  1021. this.$refs.crud.doLayout();
  1022. this.$refs.crud.dicInit();
  1023. this.$refs.crud.refreshTable();
  1024. });
  1025. this.loading = false;
  1026. this.selectionClear();
  1027. });
  1028. },
  1029. //自定义列保存
  1030. async saveColumnTwo(ref, option, optionBack, code) {
  1031. /**
  1032. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1033. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1034. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1035. */
  1036. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1037. if (inSave) {
  1038. this.$message.success("保存成功");
  1039. //关闭窗口
  1040. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1041. }
  1042. },
  1043. //自定义列重置
  1044. async resetColumnTwo(ref, option, optionBack, code) {
  1045. this[option] = this[optionBack];
  1046. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1047. if (inSave) {
  1048. this.$message.success("重置成功");
  1049. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1050. }
  1051. },
  1052. // 更改表格颜色
  1053. headerClassName(tab) {
  1054. //颜色间隔
  1055. let back = "";
  1056. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1057. if (tab.columnIndex % 2 === 0) {
  1058. back = "back-one";
  1059. } else if (tab.columnIndex % 2 === 1) {
  1060. back = "back-two";
  1061. }
  1062. }
  1063. return back;
  1064. }
  1065. }
  1066. };
  1067. </script>
  1068. <style scoped>
  1069. ::v-deep#out-table .back-one {
  1070. background: #ecf5ff !important;
  1071. text-align: center;
  1072. }
  1073. ::v-deep#out-table .back-two {
  1074. background: #ecf5ff !important;
  1075. text-align: center;
  1076. }
  1077. /deep/ .el-col-md-8 {
  1078. width: 24.33333%;
  1079. }
  1080. ::v-deep.el-form-item {
  1081. margin-bottom: 0;
  1082. }
  1083. </style>