index.vue 24 KB

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