index.vue 21 KB

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