index.vue 26 KB

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