index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  1. <template>
  2. <div>
  3. <basic-container v-if="isShow">
  4. <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
  5. :before-open="beforeOpen" v-model="form" ref="crud" id="out-table" :header-cell-class-name="headerClassName"
  6. @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @search-change="searchChange"
  7. @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
  8. @size-change="sizeChange" @refresh-change="refreshChange" :search.sync="query"
  9. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 320)"
  10. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 320)" @on-load="onLoad">
  11. <template slot="menuLeft">
  12. <el-button type="success" size="small" icon="el-icon-plus" plain @click="newbillFun">新建发票申请
  13. </el-button>
  14. <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">一键删除
  15. </el-button>
  16. </template>
  17. <tempalte slot="feeCnNameSearch">
  18. <dic-select v-model="query.feeCnName" placeholder="费用名称" key="id" label="cnName" res="records"
  19. url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"></dic-select>
  20. </tempalte>
  21. <template slot="menu" slot-scope="{row}">
  22. <el-button type="text" size="small" @click="editFun(row)">编辑
  23. </el-button>
  24. <!--:disabled="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1?saberUserInfo.user_id != row.createUser:false"-->
  25. <el-button type="text" size="small"
  26. :disabled="row.status == 3
  27. || (saberUserInfo.role_name.indexOf('admin') == -1 ? saberUserInfo.role_name.indexOf('允许修改他人业务') == -1 ? saberUserInfo.user_id != row.createUser : false : false)"
  28. @click="rowDel(row)">删除
  29. </el-button>
  30. </template>
  31. <template slot-scope="scope" slot="stlMode">
  32. <span>{{ scope.row.stlMode ? '月结' : '票结' }}</span>
  33. </template>
  34. <template slot-scope="{ row }" slot="billNo">
  35. <span class="pointerClick" @click="editFun(row)">{{ row.billNo }}
  36. </span>
  37. </template>
  38. <template slot-scope="{ row }" slot="invoiceDate">
  39. {{ row.invoiceDate ? row.invoiceDate.slice(0, 10) : '' }}
  40. </template>
  41. </avue-crud>
  42. </basic-container>
  43. <fininvoicesDetails ref="fininvoicesDetails" :editSave="editSave" v-if="!isShow" @goBack="goBack"
  44. @toAddEdit="toAddEdit" :key="datekey">
  45. </fininvoicesDetails>
  46. </div>
  47. </template>
  48. <script>
  49. import {
  50. fininvoicesList,
  51. fininvoicesDetail,
  52. fininvoicesRemove, fininvoicesSubmit
  53. } from "@/api/iosBasicData/fininvoices";
  54. import fininvoicesDetails from "@/views/iosBasicData/fininvoicesApplyfor/fininvoicesDetails.vue";
  55. import { mapGetters } from "vuex";
  56. import dicSelect from "@/components/dicSelect/main";
  57. export default {
  58. components: { fininvoicesDetails, dicSelect },
  59. data() {
  60. return {
  61. datekey: Date.now(),
  62. // 详情页面和列表切换
  63. isShow: true,
  64. editSave: false, // 编辑还是保存
  65. form: {},
  66. query: {},
  67. loading: true,
  68. page: {
  69. pageSize: 10,
  70. currentPage: 1,
  71. total: 0
  72. },
  73. selectionList: [],
  74. option: {},
  75. optionBack: {
  76. height: 'auto',
  77. calcHeight: 30,
  78. tip: false,
  79. searchShow: true,
  80. searchMenuSpan: 12,
  81. border: true,
  82. index: true,
  83. viewBtn: true,
  84. selection: true,
  85. dialogClickModal: false,
  86. menuWidth: 100,
  87. column: [
  88. {
  89. label: "单据编号",
  90. prop: "billNo",
  91. search: true,
  92. rules: [{
  93. required: true,
  94. message: "请输入单据编号",
  95. trigger: "blur"
  96. }],
  97. overHidden: true,
  98. },
  99. {
  100. label: "客户名称",
  101. prop: "corpCnName",
  102. width: "120",
  103. search: true,
  104. searchOrder: 1,
  105. overHidden: true,
  106. },
  107. {
  108. label: "费用名称",
  109. prop: "feeCnName",
  110. width: "140",
  111. search: true,
  112. overHidden: true,
  113. },
  114. {
  115. label: "发票抬头",
  116. prop: "invCorpCnName",
  117. width: "160",
  118. search: true,
  119. overHidden: true,
  120. },
  121. {
  122. label: "合计本位币(CNY)",
  123. prop: "amountLoc",
  124. width: "120",
  125. overHidden: true,
  126. },
  127. {
  128. label: "单据日期",
  129. prop: "billDate",
  130. rules: [{
  131. required: true,
  132. message: "请输入单据日期",
  133. trigger: "blur"
  134. }],
  135. overHidden: true,
  136. },
  137. {
  138. label: "发票号码",
  139. prop: "invoiceNo",
  140. search: true,
  141. rules: [{
  142. required: true,
  143. message: "请输入发票号码",
  144. trigger: "blur"
  145. }],
  146. overHidden: true,
  147. },
  148. {
  149. label: "单据日期",
  150. prop: "invoiceDate",
  151. overHidden: true,
  152. },
  153. // {
  154. // label: "单据开始日期",
  155. // prop: "invoiceDateStart",
  156. // search: true,
  157. // overHidden: true,
  158. // hide: true,
  159. // searchLabelWidth: "100",
  160. // type: "date",
  161. // format: "yyyy-MM-dd",
  162. // valueFormat: "yyyy-MM-dd HH:mm:ss",
  163. // },
  164. // {
  165. // label: "单据结束日期",
  166. // prop: "invoiceDateEnd",
  167. // search: true,
  168. // overHidden: true,
  169. // hide: true,
  170. // searchLabelWidth: "100",
  171. // type: "date",
  172. // format: "yyyy-MM-dd",
  173. // valueFormat: "yyyy-MM-dd HH:mm:ss",
  174. // },
  175. {
  176. label: "开票日期",
  177. prop: "date",
  178. search: true,
  179. overHidden: true,
  180. hide: true,
  181. // searchLabelWidth: "100",
  182. type: "date",
  183. searchProp: "dateList",
  184. unlinkPanels: true,
  185. searchRange: true,
  186. format: "yyyy-MM-dd",
  187. valueFormat: "yyyy-MM-dd HH:mm:ss",
  188. searchDefaultTime: ["00:00:00", "23:59:59"],
  189. },
  190. {
  191. label: "原发票号码",
  192. prop: "origInvoiceNo",
  193. width: "120",
  194. overHidden: true,
  195. },
  196. {
  197. label: "税务发票号码",
  198. prop: "taxInvoiceNo",
  199. width: "150",
  200. overHidden: true,
  201. },
  202. {
  203. label: "全电发票",
  204. prop: "invType",
  205. overHidden: true,
  206. },
  207. {
  208. label: "发票类型",
  209. search: true,
  210. prop: "taxType",
  211. width: "160",
  212. overHidden: true,
  213. },
  214. {
  215. label: "JOB NO",
  216. prop: "businessNo",
  217. width: "120",
  218. search: true,
  219. searchOrder: 3,
  220. overHidden: true
  221. },
  222. {
  223. label: "ACCT NO",
  224. prop: "accountNo",
  225. width: "100",
  226. search: true,
  227. searchOrder: 5,
  228. overHidden: true
  229. },
  230. {
  231. label: "MB/L NO",
  232. prop: "mblno",
  233. search: true,
  234. searchOrder: 2,
  235. overHidden: true
  236. },
  237. {
  238. label: "HB/L NO",
  239. prop: "hblno",
  240. search: true,
  241. searchOrder: 4,
  242. overHidden: true
  243. },
  244. {
  245. label: "对账单号",
  246. prop: "checkNo",
  247. search: true,
  248. width: "100",
  249. searchOrder: 6,
  250. overHidden: true
  251. },
  252. {
  253. label: "船名",
  254. prop: "vesselCnName",
  255. search: true,
  256. searchOrder: 7,
  257. overHidden: true
  258. },
  259. {
  260. label: "航次",
  261. prop: "voyageNo",
  262. search: true,
  263. searchOrder: 8,
  264. overHidden: true
  265. },
  266. {
  267. label: "税率 %",
  268. prop: "taxRate",
  269. rules: [{
  270. required: true,
  271. message: "请输入税率 %",
  272. trigger: "blur"
  273. }],
  274. overHidden: true,
  275. },
  276. {
  277. label: "结算方式",
  278. prop: "stlMode",
  279. overHidden: true,
  280. },
  281. {
  282. label: "发票币种",
  283. prop: "invCurCode",
  284. rules: [{
  285. required: true,
  286. message: "请输入发票币种",
  287. trigger: "blur"
  288. }],
  289. overHidden: true,
  290. },
  291. {
  292. label: "客户英文名称",
  293. prop: "corpEnName",
  294. width: "120",
  295. overHidden: true,
  296. },
  297. {
  298. label: "开票单位英文名称",
  299. prop: "invCorpEnName",
  300. width: "150",
  301. overHidden: true,
  302. },
  303. {
  304. label: "开票单位税号",
  305. prop: "invCorpTaxNo",
  306. width: "140",
  307. overHidden: true,
  308. },
  309. {
  310. label: "开票单位CNY开户银行",
  311. prop: "invCorpAccountBankCny",
  312. width: "160",
  313. overHidden: true,
  314. },
  315. {
  316. label: "开票单位CNY银行账号",
  317. prop: "invCorpAccountNoCny",
  318. width: "160",
  319. overHidden: true,
  320. },
  321. {
  322. label: "开票单位USD开户银行",
  323. prop: "invCorpAccountBankUsd",
  324. width: "160",
  325. overHidden: true,
  326. },
  327. {
  328. label: "开票单位USD银行账号",
  329. prop: "invCorpAccountNoUsd",
  330. width: "160",
  331. overHidden: true,
  332. },
  333. // {
  334. // label: "船名/航次",
  335. // prop: "vesselVoyno",
  336. // width: "100",
  337. // overHidden: true,
  338. // },
  339. {
  340. label: "开船日",
  341. prop: "etd",
  342. overHidden: true,
  343. },
  344. {
  345. label: "装货港",
  346. prop: "pol",
  347. overHidden: true,
  348. },
  349. {
  350. label: "卸货港",
  351. prop: "pod",
  352. overHidden: true,
  353. },
  354. {
  355. label: "目的地",
  356. prop: "destination",
  357. overHidden: true,
  358. },
  359. {
  360. label: "箱型/箱量",
  361. prop: "containers",
  362. width: "100",
  363. overHidden: true,
  364. },
  365. {
  366. label: "币种",
  367. prop: "curCode",
  368. overHidden: true,
  369. },
  370. {
  371. label: "原汇率",
  372. prop: "exrate",
  373. overHidden: true,
  374. },
  375. {
  376. label: "是否转换为人民币",
  377. prop: "isExchangeToCny",
  378. width: "140",
  379. dicData: [{
  380. label: '否',
  381. value: 0
  382. }, {
  383. label: '是',
  384. value: 1
  385. }],
  386. overHidden: true,
  387. },
  388. {
  389. label: "业务类型",
  390. prop: "businessTypes",
  391. overHidden: true,
  392. },
  393. {
  394. label: "业务单据编号",
  395. prop: "businessNo",
  396. width: "120",
  397. overHidden: true,
  398. },
  399. {
  400. label: "对账单编号",
  401. prop: "checkNo",
  402. width: "120",
  403. overHidden: true,
  404. },
  405. {
  406. label: "订舱",
  407. prop: "bookingNo",
  408. overHidden: true,
  409. },
  410. {
  411. label: "中文船名",
  412. prop: "vesselCnName",
  413. overHidden: true,
  414. },
  415. {
  416. label: "英文船名",
  417. prop: "vesselEnName",
  418. overHidden: true,
  419. },
  420. {
  421. label: "航次",
  422. prop: "voyageNo",
  423. overHidden: true,
  424. },
  425. {
  426. label: "财务开始日期",
  427. prop: "accountDateFrom",
  428. width: "100",
  429. overHidden: true,
  430. },
  431. {
  432. label: "财务结束日期",
  433. prop: "accountDateTo",
  434. width: "100",
  435. overHidden: true,
  436. },
  437. {
  438. label: "申请人",
  439. prop: "applicantName",
  440. overHidden: true,
  441. },
  442. {
  443. label: "审核人",
  444. prop: "approverName",
  445. overHidden: true,
  446. },
  447. {
  448. label: "是否代理发票",
  449. prop: "isAgent",
  450. width: "120",
  451. dicData: [{
  452. label: '否',
  453. value: 0
  454. }, {
  455. label: '是',
  456. value: 1
  457. }],
  458. overHidden: true,
  459. },
  460. {
  461. label: "是否DK",
  462. prop: "isDk",
  463. dicData: [{
  464. label: '否',
  465. value: 0
  466. }, {
  467. label: '是',
  468. value: 1
  469. }],
  470. overHidden: true,
  471. },
  472. {
  473. label: "是否RP",
  474. prop: "isRp",
  475. dicData: [{
  476. label: '否',
  477. value: 0
  478. }, {
  479. label: '是',
  480. value: 1
  481. }],
  482. overHidden: true,
  483. },
  484. {
  485. label: "RP名称",
  486. prop: "rpName",
  487. overHidden: true,
  488. },
  489. {
  490. label: "导出日期",
  491. prop: "exportDate",
  492. width: "100",
  493. overHidden: true,
  494. },
  495. {
  496. label: "导出人",
  497. prop: "exportName",
  498. overHidden: true,
  499. },
  500. {
  501. label: "是否导出船名航次",
  502. prop: "isExportVslvoy",
  503. width: "140",
  504. dicData: [{
  505. label: '否',
  506. value: 0
  507. }, {
  508. label: '是',
  509. value: 1
  510. }],
  511. overHidden: true,
  512. },
  513. {
  514. label: "是否导出主单号",
  515. prop: "isExportMblno",
  516. width: "140",
  517. dicData: [{
  518. label: '否',
  519. value: 0
  520. }, {
  521. label: '是',
  522. value: 1
  523. }],
  524. overHidden: true,
  525. },
  526. {
  527. label: "是否导出分单号",
  528. prop: "isExportHblno",
  529. width: "140",
  530. dicData: [{
  531. label: '否',
  532. value: 0
  533. }, {
  534. label: '是',
  535. value: 1
  536. }],
  537. overHidden: true,
  538. },
  539. {
  540. label: "发票本位币(CNY)",
  541. prop: "amountCny",
  542. width: "140",
  543. overHidden: true,
  544. },
  545. {
  546. label: "发票USD",
  547. prop: "amountUsd",
  548. width: "100",
  549. overHidden: true,
  550. },
  551. {
  552. label: "税额(CNY)",
  553. prop: "amountTax",
  554. width: "100",
  555. overHidden: true,
  556. },
  557. {
  558. label: "全电发票备注",
  559. prop: "elecRemarks",
  560. width: "120",
  561. overHidden: true,
  562. },
  563. {
  564. label: "银行进账单出票人名称",
  565. prop: "bankReceiptCorpName",
  566. width: "160",
  567. overHidden: true,
  568. },
  569. {
  570. label: "银行进账单出票银行",
  571. prop: "bankReceiptBankName",
  572. width: "160",
  573. overHidden: true,
  574. },
  575. {
  576. label: "银行进账单出票银行账号",
  577. prop: "bankReceiptAccountNo",
  578. width: "160",
  579. overHidden: true,
  580. },
  581. {
  582. label: "银行进账单票据种类",
  583. prop: "bankReceiptBillType",
  584. width: "160",
  585. overHidden: true,
  586. },
  587. {
  588. label: "银行进账单票据张数",
  589. prop: "bankReceiptBillCount",
  590. width: "160",
  591. overHidden: true,
  592. },
  593. {
  594. label: "银行进账单是否已进账(收款)",
  595. prop: "bankReceiptIsIncome",
  596. width: "180",
  597. overHidden: true,
  598. },
  599. {
  600. label: "备注",
  601. prop: "remarks",
  602. rules: [{
  603. required: true,
  604. message: "请输入备注",
  605. trigger: "blur"
  606. }],
  607. overHidden: true,
  608. },
  609. ]
  610. },
  611. data: [],
  612. saberUserInfo: {}, // 当前登录人个人信息
  613. };
  614. },
  615. watch: {
  616. },
  617. computed: {
  618. ...mapGetters(["permission"]),
  619. permissionList() {
  620. return {
  621. addBtn: this.vaildData(this.permission.fininvoices_add, false),
  622. viewBtn: this.vaildData(this.permission.fininvoices_view, false),
  623. delBtn: this.vaildData(this.permission.fininvoices_delete, false),
  624. editBtn: this.vaildData(this.permission.fininvoices_edit, false)
  625. };
  626. },
  627. ids() {
  628. let ids = [];
  629. this.selectionList.forEach(ele => {
  630. ids.push(ele.id);
  631. });
  632. return ids.join(",");
  633. }
  634. },
  635. async created() {
  636. // 获取当前登录人个人信息
  637. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  638. this.option = await this.getColumnData(this.getColumnName(320), this.optionBack);
  639. },
  640. activated() {
  641. if (this.$route.query.mblno) {
  642. setTimeout(() => {
  643. this.newbillFun()
  644. }, 200);
  645. }
  646. },
  647. methods: {
  648. // 新建发票
  649. newbillFun() {
  650. this.isShow = false;
  651. this.editSave = false
  652. this.$store.commit("IN_FINAPP_DETAIL");
  653. },
  654. toAddEdit() {
  655. this.datekey = Date.now()
  656. this.isShow = false
  657. this.editSave = false
  658. },
  659. // 编辑
  660. editFun(row) {
  661. this.isShow = false
  662. this.editSave = true
  663. this.$nextTick(() => {
  664. this.$refs.fininvoicesDetails.fininvoicesDetailfun(row.id)
  665. })
  666. this.$store.commit("IN_FINAPP_DETAIL");
  667. },
  668. // 详情的返回列表
  669. goBack() {
  670. // 初始化数据
  671. // this.detailData = this.$options.data().detailData;
  672. if (JSON.stringify(this.$route.query) != "{}") {
  673. this.$router.$avueRouter.closeTag();
  674. this.$router.push({
  675. path: "/iosBasicData/fininvoices/index"
  676. });
  677. }
  678. this.isShow = true;
  679. this.onLoad(this.page, this.search);
  680. this.$store.commit("OUT_FINAPP_DETAIL");
  681. },
  682. rowSave(row, done, loading) {
  683. fininvoicesSubmit(row).then(() => {
  684. this.onLoad(this.page);
  685. this.$message({
  686. type: "success",
  687. message: "操作成功!"
  688. });
  689. done();
  690. }, error => {
  691. loading();
  692. window.console.log(error);
  693. });
  694. },
  695. rowUpdate(row, index, done, loading) {
  696. fininvoicesSubmit(row).then(() => {
  697. this.onLoad(this.page);
  698. this.$message({
  699. type: "success",
  700. message: "操作成功!"
  701. });
  702. done();
  703. }, error => {
  704. loading();
  705. console.log(error);
  706. });
  707. },
  708. rowDel(row) {
  709. this.$confirm("确定将选择数据删除?", {
  710. confirmButtonText: "确定",
  711. cancelButtonText: "取消",
  712. type: "warning"
  713. })
  714. .then(() => {
  715. return fininvoicesRemove(row.id);
  716. })
  717. .then(() => {
  718. this.onLoad(this.page);
  719. this.$message({
  720. type: "success",
  721. message: "操作成功!"
  722. });
  723. });
  724. },
  725. // 批量删除
  726. handleDelete() {
  727. if (this.selectionList.length === 0) {
  728. this.$message.warning("请选择至少一条数据");
  729. return;
  730. }
  731. // 判断是否可以编辑别人业务 true 就没有权限
  732. if (this.ModifyOthersfun()) return;
  733. // 已经提交请核的提示不让删除
  734. let sumArr = []
  735. const h = this.$createElement
  736. for (let item of this.selectionList) {
  737. if (item.status == 3) {
  738. sumArr.push(h('p', `序号${item.$index + 1}的数据已经确认提交请勿删除`))
  739. }
  740. }
  741. if (sumArr.length != 0) {
  742. this.$confirm('提示', {
  743. message: h('div', sumArr),
  744. confirmButtonText: "确定",
  745. cancelButtonText: "取消",
  746. type: "warning"
  747. })
  748. return;
  749. }
  750. this.$confirm("确定将选择数据删除?", {
  751. confirmButtonText: "确定",
  752. cancelButtonText: "取消",
  753. type: "warning"
  754. })
  755. .then(() => {
  756. return fininvoicesRemove(this.ids);
  757. })
  758. .then(() => {
  759. this.onLoad(this.page);
  760. this.$message({
  761. type: "success",
  762. message: "操作成功!"
  763. });
  764. this.$refs.crud.toggleSelection();
  765. });
  766. },
  767. // 判断是否可以编辑别人业务
  768. ModifyOthersfun() {
  769. let sumArr = []
  770. const h = this.$createElement
  771. // 判断是否有权限
  772. if (this.saberUserInfo.role_name.indexOf('允许修改他人业务') != -1) return false
  773. // 当前登录人和选择的创建人对比是不是一个人
  774. for (let item of this.selectionList) {
  775. if (this.saberUserInfo.user_id != item.createUser) {
  776. sumArr.push(h('p', `你没有"允许修改他人业务"权限,请重新选择数据`))
  777. }
  778. }
  779. if (sumArr.length != 0) {
  780. this.$confirm('提示', {
  781. message: h('div', sumArr),
  782. confirmButtonText: "确定",
  783. cancelButtonText: "取消",
  784. type: "warning"
  785. }).catch(err => { })
  786. return true
  787. }
  788. },
  789. beforeOpen(done, type) {
  790. if (["edit", "view"].includes(type)) {
  791. fininvoicesDetail(this.form.id).then(res => {
  792. this.form = res.data.data;
  793. });
  794. }
  795. done();
  796. },
  797. searchReset() {
  798. this.query = {};
  799. this.onLoad(this.page);
  800. },
  801. searchChange(params, done) {
  802. this.query = params;
  803. this.page.currentPage = 1;
  804. this.onLoad(this.page, params);
  805. done();
  806. },
  807. selectionChange(list) {
  808. this.selectionList = list;
  809. },
  810. selectionClear() {
  811. this.selectionList = [];
  812. this.$refs.crud.toggleSelection();
  813. },
  814. currentChange(currentPage) {
  815. this.page.currentPage = currentPage;
  816. },
  817. sizeChange(pageSize) {
  818. this.page.pageSize = pageSize;
  819. },
  820. refreshChange() {
  821. this.onLoad(this.page, this.query);
  822. },
  823. onLoad(page, params = {}) {
  824. this.loading = true;
  825. if (!this.query.dateList) {
  826. this.query.invoiceDateStart = null
  827. this.query.invoiceDateEnd = null
  828. } else {
  829. this.query.invoiceDateStart = this.query.dateList[0]
  830. this.query.invoiceDateEnd = this.query.dateList[1]
  831. }
  832. fininvoicesList(page.currentPage, page.pageSize,
  833. { ...Object.assign(params, this.query), type: "申请", billNoFormat: 'FPSQ', businessTypeCode: 'FPSQ' }).then(res => {
  834. const data = res.data.data;
  835. this.page.total = data.total;
  836. this.data = data.records;
  837. this.loading = false;
  838. this.selectionClear();
  839. });
  840. },
  841. //自定义列保存
  842. async saveColumnTwo(ref, option, optionBack, code) {
  843. /**
  844. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  845. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  846. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  847. */
  848. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  849. if (inSave) {
  850. this.$message.success("保存成功");
  851. //关闭窗口
  852. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  853. }
  854. },
  855. //自定义列重置
  856. async resetColumnTwo(ref, option, optionBack, code) {
  857. this[option] = this[optionBack];
  858. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  859. if (inSave) {
  860. this.$message.success("重置成功");
  861. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  862. }
  863. },
  864. // 更改表格颜色
  865. headerClassName(tab) {
  866. //颜色间隔
  867. let back = ""
  868. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  869. if (tab.columnIndex % 2 === 0) {
  870. back = "back-one"
  871. } else if (tab.columnIndex % 2 === 1) {
  872. back = "back-two"
  873. }
  874. }
  875. return back;
  876. },
  877. }
  878. };
  879. </script>
  880. <style scoped>
  881. ::v-deep#out-table .back-one {
  882. background: #ecf5ff !important;
  883. text-align: center;
  884. }
  885. ::v-deep#out-table .back-two {
  886. background: #ecf5ff !important;
  887. text-align: center;
  888. }
  889. .pointerClick {
  890. cursor: pointer;
  891. color: #1e9fff;
  892. }
  893. </style>