index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :table-loading="loading"
  5. :data="data"
  6. :page.sync="page"
  7. :search.sync="query"
  8. v-model="form"
  9. ref="crud"
  10. id="out-table"
  11. :header-cell-class-name="headerClassName"
  12. @search-change="searchChange"
  13. @search-reset="searchReset"
  14. @current-change="currentChange"
  15. @size-change="sizeChange"
  16. @refresh-change="refreshChange"
  17. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 336)"
  18. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 336)"
  19. @on-load="onLoad" >
  20. <template slot="header">
  21. <el-table
  22. :data="commodityData"
  23. border
  24. size="small"
  25. @header-click="cellClick"
  26. style="width: 100%">
  27. <el-table-column
  28. v-for="(item,index) in commodityLabel" :key="index"
  29. :prop="item.prop"
  30. show-overflow-tooltip
  31. :label="item.label" />
  32. </el-table>
  33. </template>
  34. <template slot-scope="{disabled,size}" slot="billTypeSearch">
  35. <avue-input-tree :check-strictly="true"
  36. :tags="true"
  37. multiple v-model="query.billType"
  38. placeholder="请选择业务类型"
  39. :dic="billTypeData" :style="{ width: '100%' }">
  40. </avue-input-tree>
  41. </template>
  42. <template slot="carrierCnNameSearch">
  43. <search-query :datalist="carrierData"
  44. :selectValue="query.carrierId"
  45. :filterable="true"
  46. :remote="true"
  47. :clearable="true"
  48. :buttonIf="false"
  49. :forParameter="{key:'id',label:'cnName',value:'id'}"
  50. @remoteMethod="carrierBcorpsListfun"
  51. @corpFocus="carrierBcorpsListfun"
  52. @corpChange="corpChange($event,'carrierId')">
  53. </search-query>
  54. </template>
  55. <template slot-scope="{disabled,size}" slot="clientSearch">
  56. <search-query :datalist="clientData"
  57. :selectValue="query.client"
  58. :filterable="true"
  59. :remote="true"
  60. :clearable="true"
  61. :buttonIf="false"
  62. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  63. @remoteMethod="clientListfun"
  64. @corpFocus="clientListfun"
  65. @corpChange="corpChange($event,'client')">
  66. </search-query>
  67. </template>
  68. <template slot-scope="{disabled,size}" slot="corpNameSearch">
  69. <search-query :datalist="corpIdData"
  70. :selectValue="query.corpId"
  71. :filterable="true"
  72. :remote="true"
  73. :clearable="true"
  74. :buttonIf="false"
  75. :forParameter="{key:'id',label:'cnName',value:'id'}"
  76. @remoteMethod="getBcorpsListfun"
  77. @corpFocus="getBcorpsListfun"
  78. @corpChange="corpChange($event,'corpId')">
  79. </search-query>
  80. </template>
  81. <template slot="vesselCnNameSearch">
  82. <search-query :datalist="vesselData"
  83. :selectValue="query.vesselId"
  84. :filterable="true"
  85. :clearable="true"
  86. :remote="true"
  87. :buttonIf="false"
  88. placeholder="请选择船名"
  89. :forParameter="{key:'id',label:'cnName',value:'id'}"
  90. @remoteMethod="vesselBvesselsListfun"
  91. @corpFocus="vesselBvesselsListfun"
  92. @corpChange="corpChange($event,'vesselId')">
  93. </search-query>
  94. </template>
  95. <template slot-scope="{disabled,size}" slot="srcTypeSearch">
  96. <search-query :datalist="srcTypeData"
  97. :selectValue="query.srcType"
  98. :clearable="true"
  99. :buttonIf="false"
  100. :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"
  101. @corpFocus="srcTypeWorkDictsfun"
  102. @corpChange="corpChange($event,'srcType')">
  103. </search-query>
  104. </template>
  105. <template slot-scope="{disabled,size}" slot="salesmanSearch">
  106. <search-query :datalist="srcIdData"
  107. :selectValue="query.srcId"
  108. :filterable="true"
  109. :remote="true"
  110. :clearable="true"
  111. :buttonIf="false"
  112. :forParameter="srcforParameter"
  113. @remoteMethod="srcCorpFocus"
  114. @corpFocus="srcCorpFocus"
  115. @corpChange="corpChange($event,'srcId')">
  116. </search-query>
  117. </template>
  118. <template slot-scope="{disabled,size}" slot="accDeptNameSearch">
  119. <tree-select v-model="query.accDeptName"
  120. filterable
  121. :data="accDeptData"
  122. :props="{label: 'title', children:'children'}"
  123. nodeKey="title"
  124. size="small"
  125. :multiple="false"
  126. @input="corpChange($event,'accDeptName')">
  127. </tree-select>
  128. </template>
  129. <template slot="lineCnNameSearch">
  130. <search-query :datalist="lineData"
  131. :selectValue="query.lineId"
  132. :filterable="true"
  133. :clearable="true"
  134. :remote="true"
  135. :buttonIf="false"
  136. :forParameter="{key:'id',label:'cnName',value:'id'}"
  137. placeholder="请选择航线"
  138. @remoteMethod="lineBlinesListfun"
  139. @corpFocus="lineBlinesListfun"
  140. @corpChange="corpChange($event,'lineId')">
  141. </search-query>
  142. </template>
  143. <template slot="costMergeSearch">
  144. <el-radio v-model="query.costMerge" :label="1" @input="radioSearchfun('costMerge')" >单票费用合并</el-radio>
  145. <el-radio v-model="query.consistentCorpMerge" :label="1" @input="radioSearchfun('consistentCorpMerge')" >相同业务客户合并</el-radio>
  146. <el-radio v-model="query.inconsistentCorpMerge" :label="1" @input="radioSearchfun('inconsistentCorpMerge')" >不同业务客户合并</el-radio>
  147. <el-checkbox v-model="query.examine" :true-label="1" :false-label="0" >只显示整票审核业务</el-checkbox>
  148. <el-checkbox v-model="query.mergeAmendFee" :true-label="1" :false-label="0" >合并amend费用</el-checkbox>
  149. <el-checkbox v-model="query.examineDate" :true-label="1" :false-label="0" >按审核日期</el-checkbox>
  150. </template>
  151. </avue-crud>
  152. </basic-container>
  153. </template>
  154. <script>
  155. import {defaultDate3} from "@/util/date";
  156. import {financeStatisticsFinanceProfit, financeStatisticsFinanceProfitSum} from "@/api/iosBasicData/paymentSummary";
  157. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  158. import {getBcorpsList, getBcorpslistByType} from "@/api/iosBasicData/bcorps";
  159. import {getBvesselsList} from "@/api/iosBasicData/bvessels";
  160. import {getWorkDicts} from "@/api/system/dictbiz";
  161. import {getDeptLazyTree, getDeptTree} from "@/api/system/dept";
  162. import {getList as userGetList} from '@/api/system/user'
  163. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  164. import {blinesList} from "@/api/iosBasicData/blines";
  165. export default {
  166. components: {TreeSelect, SearchQuery},
  167. data(){
  168. return {
  169. form: {},
  170. loading: true,
  171. page: {
  172. pageSize: 10,
  173. currentPage: 1,
  174. total: 0
  175. },
  176. query: {
  177. billType:'SE,SI',
  178. costMerge:1,
  179. statisticsDateStart:defaultDate3()[0],
  180. statisticsDateEnd:defaultDate3()[1],
  181. },
  182. option:{},
  183. optionBack:{
  184. height:'auto',
  185. calcHeight: 30,
  186. tip: false,
  187. searchShow: true,
  188. searchMenuSpan: 4,
  189. border: true,
  190. index: false,
  191. selection: true,
  192. dialogClickModal: false,
  193. menu:false,
  194. addBtn:false,
  195. viewBtn:false,
  196. delBtn:false,
  197. editBtn:false,
  198. searchIcon:true,
  199. searchIndex:3,
  200. showSummary: true,
  201. summaryText: "合计",
  202. sumColumnList: [
  203. {
  204. name: 'amountDrUsd',
  205. type: 'sum',
  206. decimals: 2
  207. },{
  208. name: 'realAmountDrUsd',
  209. type: 'sum',
  210. decimals: 2
  211. },{
  212. name: 'amountDr',
  213. type: 'sum',
  214. decimals: 2
  215. },{
  216. name: 'realAmountDr',
  217. type: 'sum',
  218. decimals: 2
  219. },{
  220. name: 'amountDrLoc',
  221. type: 'sum',
  222. decimals: 2
  223. },{
  224. name: 'realAmountDrLoc',
  225. type: 'sum',
  226. decimals: 2
  227. },{
  228. name: 'amountCrUsd',
  229. type: 'sum',
  230. decimals: 2
  231. },{
  232. name: 'realAmountCrUsd',
  233. type: 'sum',
  234. decimals: 2
  235. },{
  236. name: 'amountCr',
  237. type: 'sum',
  238. decimals: 2
  239. },{
  240. name: 'realAmountCr',
  241. type: 'sum',
  242. decimals: 2
  243. },{
  244. name: 'amountCrLoc',
  245. type: 'sum',
  246. decimals: 2
  247. },{
  248. name: 'realAmountCrLoc',
  249. type: 'sum',
  250. decimals: 2
  251. },{
  252. name: 'amountProfitLoc',
  253. type: 'sum',
  254. decimals: 2
  255. },{
  256. name: 'realAmountProfitLoc',
  257. type: 'sum',
  258. decimals: 2
  259. }],
  260. column:[
  261. {
  262. label: "业务类型",
  263. prop: "billType",
  264. overHidden:true,
  265. search:true,
  266. searchslot:true,
  267. searchOrder:1,
  268. type: 'select',
  269. dicData:[],
  270. props: {
  271. label: "dictValue",
  272. value: "dictKey"
  273. },
  274. },
  275. {
  276. label: "业务编号",
  277. prop: "billNo",
  278. overHidden:true,
  279. search:true,
  280. searchOrder:11
  281. },
  282. {
  283. label: "H B/L",
  284. prop: "hblNo",
  285. overHidden:true,
  286. },
  287. {
  288. label: "M B/L",
  289. prop: "mblNo",
  290. overHidden:true,
  291. },
  292. {
  293. label: "往来单位",
  294. prop: "corpName",
  295. overHidden:true,
  296. search:true,
  297. searchslot:true,
  298. searchOrder:4
  299. },
  300. {
  301. label: "统计开始",
  302. prop: "statisticsDateStart",
  303. overHidden:true,
  304. search:true,
  305. hide: true,
  306. searchOrder:7,
  307. type: "date",
  308. format: "yyyy-MM-dd",
  309. valueFormat: "yyyy-MM-dd",
  310. },
  311. {
  312. label: "统计结束",
  313. prop: "statisticsDateEnd",
  314. overHidden:true,
  315. search:true,
  316. hide: true,
  317. searchOrder:8,
  318. type: "date",
  319. format: "yyyy-MM-dd",
  320. valueFormat: "yyyy-MM-dd",
  321. },
  322. {
  323. label: "业务员",
  324. prop: "salesman",
  325. overHidden:true,
  326. search:true,
  327. searchslot:true,
  328. searchOrder:10
  329. },
  330. {
  331. label: "起运港",
  332. prop: "pod",
  333. overHidden:true,
  334. },
  335. {
  336. label: "目的港",
  337. prop: "pol",
  338. overHidden:true,
  339. },
  340. {
  341. label: "船名",
  342. prop: "vesselCnName",
  343. overHidden:true,
  344. search:true,
  345. searchslot:true,
  346. searchOrder:5
  347. },
  348. {
  349. label: "航次",
  350. prop: "voyageNo",
  351. overHidden:true,
  352. search:true,
  353. searchslot:true,
  354. searchOrder:6
  355. },
  356. {
  357. label: "核算部门",
  358. prop: "accDeptName",
  359. overHidden:true,
  360. search:true,
  361. searchslot:true,
  362. searchOrder:12
  363. },
  364. {
  365. label: "航线",
  366. prop: "lineCnName",
  367. overHidden:true,
  368. search:true,
  369. searchslot:true,
  370. searchOrder:13
  371. },
  372. {
  373. label: "船公司",
  374. prop: "carrierCnName",
  375. overHidden:true,
  376. search:true,
  377. searchslot:true,
  378. searchOrder:2
  379. },
  380. {
  381. label: "操作员",
  382. prop: "operatorName",
  383. overHidden:true,
  384. },
  385. {
  386. label: "应收美元",
  387. prop: "amountDrUsd",
  388. overHidden:true,
  389. },
  390. {
  391. label: "实收美元",
  392. prop: "realAmountDrUsd",
  393. overHidden:true,
  394. },
  395. {
  396. label: "应收人民币",
  397. prop: "amountDr",
  398. overHidden:true,
  399. },
  400. {
  401. label: "实收美元",
  402. prop: "realAmountDr",
  403. overHidden:true,
  404. },
  405. {
  406. label: "合计应收",
  407. prop: "amountDrLoc",
  408. overHidden:true,
  409. },
  410. {
  411. label: "实际合计应收",
  412. prop: "realAmountDrLoc",
  413. overHidden:true,
  414. },
  415. {
  416. label: "应付美元",
  417. prop: "amountCrUsd",
  418. overHidden:true,
  419. },
  420. {
  421. label: "实付美元",
  422. prop: "realAmountCrUsd",
  423. overHidden:true,
  424. },
  425. {
  426. label: "应付人民币",
  427. prop: "amountCr",
  428. overHidden:true,
  429. },
  430. {
  431. label: "实付人民币",
  432. prop: "realAmountCr",
  433. overHidden:true,
  434. },
  435. {
  436. label: "合计应付",
  437. prop: "amountCrLoc",
  438. overHidden:true,
  439. },
  440. {
  441. label: "实际合计应付",
  442. prop: "realAmountCrLoc",
  443. overHidden:true,
  444. },
  445. {
  446. label: "单票利润",
  447. prop: "amountProfitLoc",
  448. overHidden:true,
  449. },
  450. {
  451. label: "实际单票利润",
  452. prop: "realAmountProfitLoc",
  453. overHidden:true,
  454. },
  455. {
  456. label: "委托人",
  457. prop: "client",
  458. overHidden:true,
  459. hide:true,
  460. search:true,
  461. searchslot:true,
  462. searchOrder:3
  463. },
  464. {
  465. label: "业务来源",
  466. prop: "srcType",
  467. overHidden:true,
  468. hide: true,
  469. search:true,
  470. searchslot:true,
  471. searchOrder:9
  472. },
  473. {
  474. label: "",
  475. prop: "costMerge",
  476. hide:true,
  477. search:true,
  478. searchslot:true,
  479. searchLabelWidth:'0',
  480. searchOrder:14,
  481. searchSpan:14,
  482. },
  483. ]
  484. },
  485. data:[],
  486. // 业务类型数据
  487. billTypeData:[],
  488. // 船公司数据
  489. carrierData:[],
  490. // 委托人数据
  491. clientData:[],
  492. // 结算等单位
  493. corpIdData:[],
  494. // 船名
  495. vesselData:[],
  496. srcTypeData:[], // 业务来源
  497. srcIdData:[], // 业务员
  498. srcforParameter:{key:'id', label:'cnName', value:'id'},
  499. accDeptData:[], // 部门数据
  500. lineData:[], // 航线数据
  501. commodityData:[], // 合计数据
  502. // 合计的配置项
  503. commodityLabel:[
  504. {
  505. id:1,
  506. label:'应付人民币',
  507. prop:'amountCr'
  508. },
  509. {
  510. id:2,
  511. label:'应付美元',
  512. prop:'amountCrUsd'
  513. },
  514. {
  515. id:3,
  516. label:'合计应付',
  517. prop:'amountCrLoc'
  518. },
  519. {
  520. id:4,
  521. label:'应收人民币',
  522. prop:'amountDr'
  523. },
  524. {
  525. id:5,
  526. label:'应收美元',
  527. prop:'amountDrUsd'
  528. },
  529. {
  530. id:6,
  531. label:'合计应收',
  532. prop:'amountDrLoc'
  533. },
  534. {
  535. id:7,
  536. label:'实付人民币',
  537. prop:'realAmountCr'
  538. },
  539. {
  540. id:8,
  541. label:'实付美元',
  542. prop:'realAmountCrUsd'
  543. },
  544. {
  545. id:9,
  546. label:'实付合计',
  547. prop:'realAmountCrLoc'
  548. },
  549. {
  550. id:7,
  551. label:'实付人民币',
  552. prop:'realAmountDr'
  553. },
  554. {
  555. id:8,
  556. label:'实付美元',
  557. prop:'realAmountDrUsd'
  558. },
  559. {
  560. id:9,
  561. label:'实付合计',
  562. prop:'realAmountCrLoc'
  563. },
  564. {
  565. id:9,
  566. label:'实际单票利润',
  567. prop:'realAmountProfitLoc'
  568. },
  569. ],
  570. }
  571. },
  572. async created() {
  573. this.option = await this.getColumnData(this.getColumnName(336), this.optionBack);
  574. this.getWorkDictsfun()
  575. this.getLazylistfun() // 获取部门数据
  576. },
  577. methods:{
  578. // 获取字典数据
  579. getWorkDictsfun(){
  580. // 获取业务类型
  581. getWorkDicts('profit_business_type_los').then(res=>{
  582. this.findObject(this.option.column, "billType").dicData = res.data.data
  583. this.billTypeData = res.data.data.map(item=>{
  584. return {label:item.dictValue, value:item.dictKey}
  585. })
  586. })
  587. },
  588. // 单选
  589. radioSearchfun(name){
  590. if (name == 'costMerge') {
  591. this.$set(this.query,'consistentCorpMerge',null)
  592. this.$set(this.query,'inconsistentCorpMerge',null)
  593. }else if (name == 'consistentCorpMerge') {
  594. this.$set(this.query,'inconsistentCorpMerge',null)
  595. this.$set(this.query,'costMerge',null)
  596. }else if (name == 'inconsistentCorpMerge') {
  597. this.$set(this.query,'costMerge',null)
  598. this.$set(this.query,'consistentCorpMerge',null)
  599. }
  600. },
  601. // 业务员下拉
  602. srcCorpFocus(value,name){
  603. if (this.query.srcType == 'SALES') {
  604. // 业务员
  605. this.srcforParameter = { key:'id', label:'name', value:'id'}
  606. this.salesUserGetListfun(value)
  607. }else if (this.form.srcType == 'AGENT') {
  608. // 代理
  609. this.srcforParameter = { key:'id', label:'cnName', value:'id'}
  610. this.agentBcorpsListfun(value)
  611. }else if (this.form.srcType == 'OWN') {
  612. // 公司
  613. this.srcforParameter = { key:'id', label:'title', value:'id'}
  614. this.ownDeptLazyTreefun()
  615. }else {}
  616. },
  617. // 下拉
  618. corpChange(value,name){
  619. if (name == 'srcType') {
  620. if (value == 'OWN') {
  621. // 公司
  622. this.srcforParameter = { key:'id', label:'title', value:'id'}
  623. this.ownDeptLazyTreefun()
  624. }else if (value == 'AGENT') {
  625. // 代理
  626. this.srcforParameter = { key:'id', label:'cnName', value:'id'}
  627. this.agentBcorpsListfun()
  628. }else if (value == 'SALES') {
  629. // 业务员
  630. this.srcforParameter = { key:'id', label:'name', value:'id'}
  631. this.salesUserGetListfun()
  632. }else {}
  633. this.$set(this.query,name,value)
  634. }else if (name == 'accDeptName') {
  635. for(let item of this.accDeptData) {
  636. if (item.title == value){
  637. this.$set(this.query,'accDeptName',item.title)
  638. this.$set(this.query,'accDeptId',item.id)
  639. }
  640. }
  641. }else {
  642. this.$set(this.query,name,value)
  643. }
  644. },
  645. // 接口
  646. // 船公司
  647. carrierBcorpsListfun(cnName){
  648. let corpTypeName = '船公司'
  649. getBcorpslistByType(1,10,{cnName,corpTypeName,status: 0}).then(res=>{
  650. this.carrierData = res.data.data.records
  651. })
  652. },
  653. // 委托人
  654. clientListfun(cnName){
  655. getBcorpsList(1,10,{cnName,status: 0}).then(res=>{
  656. this.clientData = res.data.data.records
  657. })
  658. },
  659. // 结算单位
  660. getBcorpsListfun(cnName){
  661. getBcorpsList(1,10,{cnName,status: 0}).then(res=>{
  662. this.corpIdData = res.data.data.records
  663. })
  664. },
  665. // 船名
  666. vesselBvesselsListfun(cnName){
  667. getBvesselsList(1,10,{cnName,status: 0}).then(res=>{
  668. this.vesselData = res.data.data.records
  669. })
  670. },
  671. // 获取业务来源数据
  672. srcTypeWorkDictsfun(){
  673. getWorkDicts('src_type_los').then(res=>{
  674. this.srcTypeData = res.data.data
  675. })
  676. },
  677. // 获取公司名称 用户管理左侧
  678. ownDeptLazyTreefun(){
  679. getDeptLazyTree(0).then(res=>{
  680. this.srcIdData = res.data.data
  681. })
  682. },
  683. // 获取业务来源代理数据
  684. agentBcorpsListfun(cnName){
  685. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  686. getBcorpslistByType(1,10,{cnName,status: 0,corpTypeName}).then(res=>{
  687. this.srcIdData = res.data.data.records
  688. })
  689. },
  690. // 获取业务来源业务员数据
  691. salesUserGetListfun(account){
  692. userGetList(1,10,{account}).then(res=>{
  693. this.srcIdData = res.data.data.records
  694. })
  695. },
  696. // 获取核算部门数据
  697. getLazylistfun(){
  698. getDeptTree().then(res=>{
  699. this.accDeptData = res.data.data
  700. })
  701. },
  702. // 航线数据
  703. lineBlinesListfun(cnName){
  704. blinesList(1,10,{cnName,status: 0}).then(res=>{
  705. this.lineData = res.data.data.records
  706. })
  707. },
  708. // 清空搜索回调方法
  709. searchReset() {
  710. this.query = {};
  711. this.onLoad(this.page);
  712. },
  713. // 搜索
  714. searchChange(params, done) {
  715. this.query = params;
  716. this.page.currentPage = 1;
  717. this.onLoad(this.page, params);
  718. done();
  719. },
  720. currentChange(currentPage){
  721. this.page.currentPage = currentPage;
  722. },
  723. sizeChange(pageSize){
  724. this.page.pageSize = pageSize;
  725. },
  726. refreshChange() {
  727. this.onLoad(this.page, this.query);
  728. },
  729. onLoad(page, params = {}) {
  730. this.loading = true;
  731. financeStatisticsFinanceProfit(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  732. const data = res.data.data;
  733. this.page.total = data.total;
  734. this.data = data.records;
  735. this.loading = false;
  736. financeStatisticsFinanceProfitSum(Object.assign(params, this.query)).then(re=>{
  737. this.commodityData = [re.data.data]
  738. })
  739. this.selectionClear();
  740. });
  741. },
  742. selectionClear() {
  743. this.$refs.crud.toggleSelection();
  744. },
  745. //自定义列保存
  746. async saveColumnTwo(ref, option, optionBack, code) {
  747. /**
  748. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  749. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  750. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  751. */
  752. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  753. if (inSave) {
  754. this.$message.success("保存成功");
  755. //关闭窗口
  756. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  757. }
  758. },
  759. //自定义列重置
  760. async resetColumnTwo(ref, option, optionBack, code) {
  761. this[option] = this[optionBack];
  762. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  763. if (inSave) {
  764. this.$message.success("重置成功");
  765. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  766. }
  767. },
  768. // 更改表格颜色
  769. headerClassName(tab){
  770. //颜色间隔
  771. let back = ""
  772. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  773. if (tab.columnIndex % 2 === 0) {
  774. back = "back-one"
  775. } else if (tab.columnIndex % 2 === 1) {
  776. back = "back-two"
  777. }
  778. }
  779. return back;
  780. },
  781. }
  782. }
  783. </script>
  784. <style scoped>
  785. ::v-deep#out-table .back-one {
  786. background: #ecf5ff !important;
  787. text-align: center;
  788. }
  789. ::v-deep#out-table .back-two {
  790. background: #ecf5ff !important;
  791. text-align: center;
  792. }
  793. /deep/ .el-col-md-8 {
  794. width: 24.33333%;
  795. }
  796. </style>