index.vue 26 KB

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