index.vue 32 KB

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