index.vue 25 KB

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