index.vue 30 KB

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