index.vue 25 KB

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