index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146
  1. <template>
  2. <basic-container>
  3. <avue-crud
  4. :option="option"
  5. :table-loading="loading"
  6. :data="data"
  7. :page.sync="page"
  8. :search.sync="query"
  9. v-model="form"
  10. ref="crud"
  11. id="out-table"
  12. :header-cell-class-name="headerClassName"
  13. @search-change="searchChange"
  14. @search-reset="searchReset"
  15. @current-change="currentChange"
  16. @size-change="sizeChange"
  17. @refresh-change="refreshChange"
  18. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 336)"
  19. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 336)"
  20. @on-load="onLoad"
  21. >
  22. <template slot="menuLeft">
  23. <el-button type="success" size="small" plain @click="exportfun">导出</el-button>
  24. <el-button size="small" @click="$refs.print.openDialog(query)">预 览 </el-button>
  25. <el-button size="small" @click="$refs.report.openDialog(query)">报表设计 </el-button>
  26. </template>
  27. <template slot="header">
  28. <el-table v-loading="itemLoading" :data="commodityData" border size="small" @header-click="cellClick" style="width: 100%">
  29. <el-table-column
  30. v-for="(item, index) in commodityLabel"
  31. :key="index"
  32. :prop="item.prop"
  33. show-overflow-tooltip
  34. :label="item.label"
  35. :min-width="item.minWidth"
  36. />
  37. </el-table>
  38. </template>
  39. <template slot-scope="{ disabled, size }" slot="businessTypeSearch">
  40. <avue-input-tree
  41. :check-strictly="true"
  42. :tags="true"
  43. multiple
  44. v-model="query.businessType"
  45. placeholder="请选择业务类型"
  46. :dic="billTypeData"
  47. :style="{ width: '100%' }"
  48. >
  49. </avue-input-tree>
  50. </template>
  51. <template slot="carrierCnNameSearch">
  52. <search-query
  53. :datalist="carrierData"
  54. :selectValue="query.carrierId"
  55. :filterable="true"
  56. :remote="true"
  57. :clearable="true"
  58. :buttonIf="false"
  59. :forParameter="{ key: 'id', label: 'cnName', value: 'id' }"
  60. @remoteMethod="carrierBcorpsListfun"
  61. @corpFocus="carrierBcorpsListfun"
  62. @corpChange="corpChange($event, 'carrierId')"
  63. >
  64. </search-query>
  65. </template>
  66. <template slot-scope="{ disabled, size }" slot="clientSearch">
  67. <search-query
  68. :datalist="clientData"
  69. :selectValue="query.client"
  70. :filterable="true"
  71. :remote="true"
  72. :clearable="true"
  73. :buttonIf="false"
  74. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  75. @remoteMethod="clientListfun"
  76. @corpFocus="clientListfun"
  77. @corpChange="corpChange($event, 'client')"
  78. >
  79. </search-query>
  80. </template>
  81. <template slot-scope="{ disabled, size }" slot="corpNameSearch">
  82. <search-query
  83. :datalist="corpIdData"
  84. :selectValue="query.corpId"
  85. :filterable="true"
  86. :remote="true"
  87. :clearable="true"
  88. :buttonIf="false"
  89. :forParameter="{ key: 'id', label: 'cnName', value: 'id' }"
  90. @remoteMethod="getBcorpsListfun"
  91. @corpFocus="getBcorpsListfun"
  92. @corpChange="corpChange($event, 'corpId')"
  93. >
  94. </search-query>
  95. </template>
  96. <template slot="vesselCnNameSearch">
  97. <search-query
  98. :datalist="vesselData"
  99. :selectValue="query.vesselId"
  100. :filterable="true"
  101. :clearable="true"
  102. :remote="true"
  103. :buttonIf="false"
  104. placeholder="请选择船名"
  105. :forParameter="{ key: 'id', label: 'cnName', value: 'id' }"
  106. @remoteMethod="vesselBvesselsListfun"
  107. @corpFocus="vesselBvesselsListfun"
  108. @corpChange="corpChange($event, 'vesselId')"
  109. >
  110. </search-query>
  111. </template>
  112. <template slot-scope="{ disabled, size }" slot="srcTypeSearch">
  113. <search-query
  114. :datalist="srcTypeData"
  115. :selectValue="query.srcType"
  116. :clearable="true"
  117. :buttonIf="false"
  118. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  119. @corpFocus="srcTypeWorkDictsfun"
  120. @corpChange="corpChange($event, 'srcType')"
  121. >
  122. </search-query>
  123. </template>
  124. <template slot-scope="{ disabled, size }" slot="salesmanSearch">
  125. <search-query
  126. :datalist="srcIdData"
  127. :selectValue="query.srcId"
  128. :filterable="true"
  129. :remote="true"
  130. :clearable="true"
  131. :buttonIf="false"
  132. :forParameter="srcforParameter"
  133. @remoteMethod="srcCorpFocus"
  134. @corpFocus="srcCorpFocus"
  135. @corpChange="corpChange($event, 'srcId')"
  136. >
  137. </search-query>
  138. </template>
  139. <template slot-scope="{ disabled, size }" slot="accDeptNameSearch">
  140. <tree-select
  141. v-model="query.accDeptName"
  142. filterable
  143. :data="accDeptData"
  144. :props="{ label: 'title', children: 'children' }"
  145. nodeKey="title"
  146. size="small"
  147. :multiple="false"
  148. @input="corpChange($event, 'accDeptName')"
  149. >
  150. </tree-select>
  151. </template>
  152. <template slot="lineCnNameSearch">
  153. <search-query
  154. :datalist="lineData"
  155. :selectValue="query.lineId"
  156. :filterable="true"
  157. :clearable="true"
  158. :remote="true"
  159. :buttonIf="false"
  160. :forParameter="{ key: 'id', label: 'cnName', value: 'id' }"
  161. placeholder="请选择航线"
  162. @remoteMethod="lineBlinesListfun"
  163. @corpFocus="lineBlinesListfun"
  164. @corpChange="corpChange($event, 'lineId')"
  165. >
  166. </search-query>
  167. </template>
  168. <template slot="costMergeSearch">
  169. <el-radio v-model="query.costMerge" :label="1" @input="radioSearchfun('costMerge')">单票费用合并</el-radio>
  170. <el-radio v-model="query.consistentCorpMerge" :label="1" @input="radioSearchfun('consistentCorpMerge')">相同业务客户合并</el-radio>
  171. <el-radio v-model="query.inconsistentCorpMerge" :label="1" @input="radioSearchfun('inconsistentCorpMerge')">不同业务客户合并</el-radio>
  172. <el-checkbox v-model="query.examine" :true-label="1" :false-label="0">只显示整票审核业务</el-checkbox>
  173. <el-checkbox v-model="query.mergeAmendFee" :true-label="1" :false-label="0">合并amend费用</el-checkbox>
  174. <el-checkbox v-model="query.examineDate" :true-label="1" :false-label="0">按审核日期</el-checkbox>
  175. </template>
  176. </avue-crud>
  177. <business-reports ref="print" businessValue="决策分析" reportCode="业务利润" groupCode="统计" :type="true"></business-reports>
  178. <reports businessValue="决策分析" reportCode="业务利润" groupCode="统计" ref="report"></reports>
  179. </basic-container>
  180. </template>
  181. <script>
  182. import { defaultDate3 } from "@/util/date";
  183. import { financeStatisticsFinanceProfit, financeStatisticsFinanceProfitSum } from "@/api/iosBasicData/paymentSummary";
  184. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  185. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  186. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  187. import { getWorkDicts } from "@/api/system/dictbiz";
  188. import { getDeptLazyTree, getDeptTree } from "@/api/system/dept";
  189. import { getList as userGetList } from "@/api/system/user";
  190. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  191. import { blinesList } from "@/api/iosBasicData/blines";
  192. import { getToken } from "@/util/auth";
  193. import businessReports from "@/components/boxManagement/businessReportsJc.vue";
  194. import reports from "@/components/boxManagement/reportsJc.vue";
  195. export default {
  196. components: { TreeSelect, SearchQuery, businessReports, reports },
  197. data() {
  198. return {
  199. firstLoad: false,
  200. form: {},
  201. loading: false,
  202. itemLoading: false,
  203. page: {
  204. pageSize: 20,
  205. currentPage: 1,
  206. total: 0,
  207. pageSizes: [10, 20, 30, 40, 50, 100, 500, 1000]
  208. },
  209. query: {
  210. businessType: "SE,SI",
  211. costMerge: 1,
  212. statisticsDateStart: defaultDate3()[0],
  213. statisticsDateEnd: defaultDate3()[1]
  214. },
  215. option: {},
  216. optionBack: {
  217. height: 500,
  218. calcHeight: 30,
  219. tip: false,
  220. searchShow: true,
  221. searchMenuSpan: 24,
  222. border: true,
  223. index: false,
  224. selection: true,
  225. dialogClickModal: false,
  226. menu: false,
  227. addBtn: false,
  228. viewBtn: false,
  229. delBtn: false,
  230. editBtn: false,
  231. searchIcon: true,
  232. searchIndex: 3,
  233. emptyBtnText: "清空所有条件",
  234. showSummary: true,
  235. summaryText: "合计",
  236. sumColumnList: [
  237. {
  238. name: "amountDrUsd",
  239. type: "sum",
  240. decimals: 2
  241. },
  242. {
  243. name: "realAmountDrUsd",
  244. type: "sum",
  245. decimals: 2
  246. },
  247. {
  248. name: "amountDr",
  249. type: "sum",
  250. decimals: 2
  251. },
  252. {
  253. name: "realAmountDr",
  254. type: "sum",
  255. decimals: 2
  256. },
  257. {
  258. name: "amountDrLoc",
  259. type: "sum",
  260. decimals: 2
  261. },
  262. {
  263. name: "realAmountDrLoc",
  264. type: "sum",
  265. decimals: 2
  266. },
  267. {
  268. name: "amountCrUsd",
  269. type: "sum",
  270. decimals: 2
  271. },
  272. {
  273. name: "realAmountCrUsd",
  274. type: "sum",
  275. decimals: 2
  276. },
  277. {
  278. name: "amountCr",
  279. type: "sum",
  280. decimals: 2
  281. },
  282. {
  283. name: "realAmountCr",
  284. type: "sum",
  285. decimals: 2
  286. },
  287. {
  288. name: "amountCrLoc",
  289. type: "sum",
  290. decimals: 2
  291. },
  292. {
  293. name: "realAmountCrLoc",
  294. type: "sum",
  295. decimals: 2
  296. },
  297. {
  298. name: "amountProfitLoc",
  299. type: "sum",
  300. decimals: 2
  301. },
  302. {
  303. name: "realAmountProfitLoc",
  304. type: "sum",
  305. decimals: 2
  306. },
  307. {
  308. name: "amountDrOther",
  309. type: "sum",
  310. decimals: 2
  311. },
  312. {
  313. name: "realAmountDrOther",
  314. type: "sum",
  315. decimals: 2
  316. },
  317. {
  318. name: "amountCrOther",
  319. type: "sum",
  320. decimals: 2
  321. },
  322. {
  323. name: "realAmountCrOther",
  324. type: "sum",
  325. decimals: 2
  326. },
  327. {
  328. name: "amountProfitOther",
  329. type: "sum",
  330. decimals: 2
  331. }
  332. ],
  333. column: [
  334. {
  335. label: "所属公司",
  336. prop: "branchId",
  337. width: "120",
  338. overHidden: true,
  339. // hide: true,
  340. // showColumn: false,
  341. type: "select",
  342. filterable: true,
  343. dicUrl: "/api/blade-system/dept/lazy-list",
  344. props: {
  345. label: "deptName",
  346. value: "id"
  347. },
  348. search: false,
  349. searchOrder: 1
  350. },
  351. // {
  352. // label: "所属公司",
  353. // prop: "branchName",
  354. // width: "120",
  355. // overHidden: true,
  356. // },
  357. {
  358. label: "单据类型",
  359. prop: "businessType",
  360. overHidden: true,
  361. search: true,
  362. searchslot: true,
  363. searchOrder: 1.1,
  364. type: "select",
  365. dicData: [],
  366. props: {
  367. label: "dictValue",
  368. value: "dictKey"
  369. }
  370. },
  371. {
  372. label: "业务类型",
  373. prop: "billType",
  374. overHidden: true,
  375. search: false,
  376. hide: true,
  377. // searchslot: true,
  378. searchOrder: 1.2,
  379. type: "select",
  380. multiple: true,
  381. dataType: "string",
  382. dicData: [
  383. {
  384. label: "直单",
  385. value: "DD"
  386. },
  387. {
  388. label: "主单",
  389. value: "MM"
  390. },
  391. {
  392. label: "分单",
  393. value: "MH"
  394. }
  395. ]
  396. },
  397. {
  398. label: "箱属",
  399. prop: "boxBelongsTo",
  400. overHidden: true,
  401. search: true,
  402. type: "select",
  403. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxBelongsTo",
  404. props: {
  405. label: "dictValue",
  406. value: "dictValue"
  407. },
  408. searchOrder: 1.4
  409. },
  410. {
  411. label: "业务编号",
  412. prop: "billNo",
  413. overHidden: true,
  414. search: true,
  415. searchOrder: 11
  416. },
  417. {
  418. label: "H B/L",
  419. prop: "hblNo",
  420. search: true,
  421. overHidden: true,
  422. searchOrder: 13
  423. },
  424. {
  425. label: "M B/L",
  426. prop: "mblNo",
  427. search: true,
  428. overHidden: true,
  429. searchOrder: 12
  430. },
  431. {
  432. label: "往来单位",
  433. prop: "corpName",
  434. overHidden: true,
  435. search: true,
  436. searchslot: true,
  437. searchOrder: 4
  438. },
  439. {
  440. label: "统计开始",
  441. prop: "statisticsDateStart",
  442. overHidden: true,
  443. search: true,
  444. hide: true,
  445. searchOrder: 7,
  446. type: "date",
  447. format: "yyyy-MM-dd",
  448. valueFormat: "yyyy-MM-dd"
  449. },
  450. {
  451. label: "统计结束",
  452. prop: "statisticsDateEnd",
  453. overHidden: true,
  454. search: true,
  455. hide: true,
  456. searchOrder: 8,
  457. type: "date",
  458. format: "yyyy-MM-dd",
  459. valueFormat: "yyyy-MM-dd"
  460. },
  461. {
  462. label: "业务员",
  463. prop: "salesman",
  464. overHidden: true,
  465. search: true,
  466. searchslot: true,
  467. searchOrder: 10
  468. },
  469. {
  470. label: "起运港",
  471. prop: "pol",
  472. overHidden: true
  473. },
  474. {
  475. label: "目的港",
  476. prop: "pod",
  477. overHidden: true
  478. },
  479. {
  480. label: "船名",
  481. prop: "vesselCnName",
  482. overHidden: true,
  483. search: true,
  484. searchslot: true,
  485. searchOrder: 5
  486. },
  487. {
  488. label: "航次",
  489. prop: "voyageNo",
  490. overHidden: true,
  491. search: true,
  492. searchslot: true,
  493. searchOrder: 6
  494. },
  495. // {
  496. // label: "核算部门",
  497. // prop: "accDeptName",
  498. // overHidden: true,
  499. // search: true,
  500. // searchslot: true,
  501. // searchOrder: 12
  502. // },
  503. {
  504. label: "航线",
  505. prop: "lineCnName",
  506. overHidden: true,
  507. search: true,
  508. searchslot: true,
  509. searchOrder: 14
  510. },
  511. {
  512. label: "船公司",
  513. prop: "carrierCnName",
  514. overHidden: true,
  515. search: true,
  516. searchslot: true,
  517. searchOrder: 2
  518. },
  519. {
  520. label: "操作员",
  521. prop: "operatorName",
  522. overHidden: true
  523. },
  524. {
  525. label: "应收美元",
  526. prop: "amountDrUsd",
  527. overHidden: true
  528. },
  529. {
  530. label: "实收美元",
  531. prop: "realAmountDrUsd",
  532. overHidden: true
  533. },
  534. {
  535. label: "应收人民币",
  536. prop: "amountDr",
  537. overHidden: true,
  538. minWidth: 90
  539. },
  540. {
  541. label: "实收人民币",
  542. prop: "realAmountDr",
  543. overHidden: true,
  544. minWidth: 90
  545. },
  546. {
  547. label: "应收其他",
  548. prop: "amountDrOther",
  549. overHidden: true
  550. },
  551. {
  552. label: "实收其他",
  553. prop: "realAmountDrOther",
  554. overHidden: true
  555. },
  556. {
  557. label: "合计应收",
  558. prop: "amountDrLoc",
  559. overHidden: true
  560. },
  561. {
  562. label: "实际合计应收",
  563. prop: "realAmountDrLoc",
  564. overHidden: true,
  565. minWidth: 100
  566. },
  567. {
  568. label: "应付美元",
  569. prop: "amountCrUsd",
  570. overHidden: true
  571. },
  572. {
  573. label: "实付美元",
  574. prop: "realAmountCrUsd",
  575. overHidden: true
  576. },
  577. {
  578. label: "应付人民币",
  579. prop: "amountCr",
  580. overHidden: true,
  581. minWidth: 90
  582. },
  583. {
  584. label: "实付人民币",
  585. prop: "realAmountCr",
  586. overHidden: true,
  587. minWidth: 90
  588. },
  589. {
  590. label: "应付其他",
  591. prop: "amountCrOther",
  592. overHidden: true
  593. },
  594. {
  595. label: "实付其他",
  596. prop: "realAmountCrOther",
  597. overHidden: true
  598. },
  599. {
  600. label: "合计应付",
  601. prop: "amountCrLoc",
  602. overHidden: true
  603. },
  604. {
  605. label: "实际合计应付",
  606. prop: "realAmountCrLoc",
  607. overHidden: true,
  608. minWidth: 100
  609. },
  610. {
  611. label: "人民币利润",
  612. prop: "amountProfit",
  613. overHidden: true,
  614. minWidth: 90
  615. },
  616. {
  617. label: "美元利润",
  618. prop: "amountProfitUsd",
  619. overHidden: true
  620. },
  621. {
  622. label: "其他利润",
  623. prop: "amountProfitOther",
  624. overHidden: true
  625. },
  626. {
  627. label: "应收海运费",
  628. prop: "oceanFreightDr",
  629. overHidden: true,
  630. minWidth: 90
  631. },
  632. {
  633. label: "应付海运费",
  634. prop: "oceanFreightCr",
  635. overHidden: true,
  636. minWidth: 90
  637. },
  638. {
  639. label: "海运费利润",
  640. prop: "oceanFreightProfit",
  641. overHidden: true,
  642. minWidth: 90
  643. },
  644. {
  645. label: "单票利润",
  646. prop: "amountProfitLoc",
  647. overHidden: true
  648. },
  649. {
  650. label: "实际单票利润",
  651. prop: "realAmountProfitLoc",
  652. overHidden: true,
  653. minWidth: 100
  654. },
  655. // {
  656. // label: "委托人",
  657. // prop: "client",
  658. // overHidden: true,
  659. // hide: true,
  660. // search: true,
  661. // searchslot: true,
  662. // searchOrder: 3
  663. // },
  664. {
  665. label: "业务来源",
  666. prop: "srcType",
  667. overHidden: true,
  668. hide: true,
  669. search: true,
  670. searchslot: true,
  671. searchOrder: 9
  672. },
  673. {
  674. label: "",
  675. prop: "costMerge",
  676. hide: true,
  677. search: true,
  678. searchslot: true,
  679. searchLabelWidth: "0",
  680. searchOrder: 15,
  681. searchSpan: 18
  682. }
  683. ]
  684. },
  685. data: [],
  686. // 业务类型数据
  687. billTypeData: [],
  688. // 船公司数据
  689. carrierData: [],
  690. // 委托人数据
  691. clientData: [],
  692. // 结算等单位
  693. corpIdData: [],
  694. // 船名
  695. vesselData: [],
  696. srcTypeData: [], // 业务来源
  697. srcIdData: [], // 业务员
  698. srcforParameter: { key: "id", label: "cnName", value: "id" },
  699. accDeptData: [], // 部门数据
  700. lineData: [], // 航线数据
  701. commodityData: [], // 合计数据
  702. // 合计的配置项
  703. commodityLabel: [
  704. {
  705. id: 4,
  706. label: "应收人民币",
  707. prop: "amountDr",
  708. minWidth: 90
  709. },
  710. {
  711. id: 5,
  712. label: "应收美元",
  713. prop: "amountDrUsd"
  714. },
  715. {
  716. id: 5,
  717. label: "应收其他",
  718. prop: "amountDrOther"
  719. },
  720. {
  721. id: 6,
  722. label: "合计应收",
  723. prop: "amountDrLoc"
  724. },
  725. {
  726. id: 10,
  727. label: "实收人民币",
  728. prop: "realAmountDr",
  729. minWidth: 90
  730. },
  731. {
  732. id: 11,
  733. label: "实收美元",
  734. prop: "realAmountDrUsd"
  735. },
  736. {
  737. id: 10,
  738. label: "实收其他",
  739. prop: "realAmountDrOther"
  740. },
  741. {
  742. id: 12,
  743. label: "实收合计",
  744. prop: "realAmountDrLoc"
  745. },
  746. {
  747. id: 1,
  748. label: "应付人民币",
  749. prop: "amountCr",
  750. minWidth: 90
  751. },
  752. {
  753. id: 2,
  754. label: "应付美元",
  755. prop: "amountCrUsd"
  756. },
  757. {
  758. id: 2,
  759. label: "应付其他",
  760. prop: "amountCrOther"
  761. },
  762. {
  763. id: 3,
  764. label: "合计应付",
  765. prop: "amountCrLoc"
  766. },
  767. {
  768. id: 7,
  769. label: "实付人民币",
  770. prop: "realAmountCr",
  771. minWidth: 90
  772. },
  773. {
  774. id: 8,
  775. label: "实付美元",
  776. prop: "realAmountCrUsd"
  777. },
  778. {
  779. id: 8,
  780. label: "实付其他",
  781. prop: "realAmountCrOther"
  782. },
  783. {
  784. id: 9,
  785. label: "实付合计",
  786. prop: "realAmountCrLoc"
  787. },
  788. {
  789. id: 10,
  790. label: "人民币利润",
  791. prop: "amountProfit",
  792. minWidth: 90
  793. },
  794. {
  795. id: 11,
  796. label: "美元利润",
  797. prop: "amountProfitUsd"
  798. },
  799. {
  800. id: 10,
  801. label: "其他利润",
  802. prop: "amountProfitOther"
  803. },
  804. {
  805. id: 12,
  806. label: "应收海运费",
  807. prop: "oceanFreightDr",
  808. minWidth: 90
  809. },
  810. {
  811. id: 13,
  812. label: "应付海运费",
  813. prop: "oceanFreightCr",
  814. minWidth: 90
  815. },
  816. {
  817. id: 14,
  818. label: "海运费利润",
  819. prop: "oceanFreightProfit",
  820. minWidth: 90
  821. },
  822. {
  823. id: 15,
  824. label: "单票利润",
  825. prop: "amountProfitLoc"
  826. },
  827. {
  828. id: 16,
  829. label: "实际单票利润",
  830. prop: "realAmountProfitLoc",
  831. minWidth: 100
  832. }
  833. ],
  834. saberUserInfo: {}
  835. };
  836. },
  837. async created() {
  838. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
  839. this.option = await this.getColumnData(this.getColumnName(336), this.optionBack);
  840. if (this.saberUserInfo.role_name.indexOf("admin") != -1 || this.saberUserInfo.role_name.indexOf("总部") != -1) {
  841. this.option.searchMenuSpan = 24;
  842. this.option.column.forEach(item => {
  843. if (item.prop == "branchId") {
  844. item.search = true;
  845. }
  846. });
  847. this.option.column.forEach(item => {
  848. if (item.prop == "billType") {
  849. item.search = true;
  850. item.hide = false;
  851. }
  852. });
  853. }
  854. this.query = {
  855. businessType: "SE,SI",
  856. costMerge: 1,
  857. statisticsDateStart: defaultDate3()[0],
  858. statisticsDateEnd: defaultDate3()[1]
  859. };
  860. this.getWorkDictsfun();
  861. this.getLazylistfun(); // 获取部门数据
  862. },
  863. activated() {
  864. this.$refs.crud.doLayout();
  865. },
  866. methods: {
  867. // 导出
  868. exportfun() {
  869. const routeData = this.$router.resolve({
  870. path: "/api/blade-los/financeStatistics/financeProfitExport", //跳转目标窗口的地址
  871. query: {
  872. ...this.query
  873. }
  874. });
  875. window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
  876. },
  877. // 获取字典数据
  878. getWorkDictsfun() {
  879. // 获取业务类型
  880. getWorkDicts("profit_business_type_los").then(res => {
  881. this.findObject(this.option.column, "businessType").dicData = res.data.data;
  882. this.billTypeData = res.data.data.map(item => {
  883. return { label: item.dictValue, value: item.dictKey };
  884. });
  885. });
  886. },
  887. // 单选
  888. radioSearchfun(name) {
  889. if (name == "costMerge") {
  890. this.$set(this.query, "consistentCorpMerge", null);
  891. this.$set(this.query, "inconsistentCorpMerge", null);
  892. } else if (name == "consistentCorpMerge") {
  893. this.$set(this.query, "inconsistentCorpMerge", null);
  894. this.$set(this.query, "costMerge", null);
  895. } else if (name == "inconsistentCorpMerge") {
  896. this.$set(this.query, "costMerge", null);
  897. this.$set(this.query, "consistentCorpMerge", null);
  898. }
  899. this.page.currentPage = 1;
  900. this.onLoad(this.page, this.query);
  901. },
  902. // 业务员下拉
  903. srcCorpFocus(value, name) {
  904. if (this.query.srcType == "SALES") {
  905. // 业务员
  906. this.srcforParameter = { key: "id", label: "name", value: "id" };
  907. this.salesUserGetListfun(value);
  908. } else if (this.form.srcType == "AGENT") {
  909. // 代理
  910. this.srcforParameter = { key: "id", label: "cnName", value: "id" };
  911. this.agentBcorpsListfun(value);
  912. } else if (this.form.srcType == "OWN") {
  913. // 公司
  914. this.srcforParameter = { key: "id", label: "title", value: "id" };
  915. this.ownDeptLazyTreefun();
  916. } else {
  917. }
  918. },
  919. // 下拉
  920. corpChange(value, name) {
  921. if (name == "srcType") {
  922. if (value == "OWN") {
  923. // 公司
  924. this.srcforParameter = { key: "id", label: "title", value: "id" };
  925. this.ownDeptLazyTreefun();
  926. } else if (value == "AGENT") {
  927. // 代理
  928. this.srcforParameter = { key: "id", label: "cnName", value: "id" };
  929. this.agentBcorpsListfun();
  930. } else if (value == "SALES") {
  931. // 业务员
  932. this.srcforParameter = { key: "id", label: "name", value: "id" };
  933. this.salesUserGetListfun();
  934. }
  935. this.$set(this.query, name, value);
  936. } else if (name == "accDeptName") {
  937. for (let item of this.accDeptData) {
  938. if (item.title == value) {
  939. this.$set(this.query, "accDeptName", item.title);
  940. this.$set(this.query, "accDeptId", item.id);
  941. }
  942. }
  943. } else {
  944. this.$set(this.query, name, value);
  945. }
  946. },
  947. // 接口
  948. // 船公司
  949. carrierBcorpsListfun(cnName) {
  950. let corpTypeName = "船公司";
  951. getBcorpslistByType(1, 10, { cnName, corpTypeName, status: 0 }).then(res => {
  952. this.carrierData = res.data.data.records;
  953. });
  954. },
  955. // 委托人
  956. clientListfun(cnName) {
  957. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  958. this.clientData = res.data.data.records;
  959. });
  960. },
  961. // 结算单位
  962. getBcorpsListfun(cnName) {
  963. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  964. this.corpIdData = res.data.data.records;
  965. });
  966. },
  967. // 船名
  968. vesselBvesselsListfun(cnName) {
  969. getBvesselsList(1, 10, { cnName, status: 0 }).then(res => {
  970. this.vesselData = res.data.data.records;
  971. });
  972. },
  973. // 获取业务来源数据
  974. srcTypeWorkDictsfun() {
  975. getWorkDicts("src_type_los").then(res => {
  976. this.srcTypeData = res.data.data;
  977. });
  978. },
  979. // 获取公司名称 用户管理左侧
  980. ownDeptLazyTreefun() {
  981. getDeptLazyTree(0).then(res => {
  982. this.srcIdData = res.data.data;
  983. });
  984. },
  985. // 获取业务来源代理数据
  986. agentBcorpsListfun(cnName) {
  987. let corpTypeName = "国内直接客户,国内同行及代理,国外直接客户,国外同行及代理";
  988. getBcorpslistByType(1, 10, { cnName, status: 0, corpTypeName }).then(res => {
  989. this.srcIdData = res.data.data.records;
  990. });
  991. },
  992. // 获取业务来源业务员数据
  993. salesUserGetListfun(account) {
  994. userGetList(1, 10, { account }).then(res => {
  995. this.srcIdData = res.data.data.records;
  996. });
  997. },
  998. // 获取核算部门数据
  999. getLazylistfun() {
  1000. getDeptTree().then(res => {
  1001. this.accDeptData = res.data.data;
  1002. });
  1003. },
  1004. // 航线数据
  1005. lineBlinesListfun(cnName) {
  1006. blinesList(1, 10, { cnName, status: 0 }).then(res => {
  1007. this.lineData = res.data.data.records;
  1008. });
  1009. },
  1010. // 清空搜索回调方法
  1011. searchReset() {
  1012. this.query = {
  1013. businessType: "SE,SI",
  1014. costMerge: 1,
  1015. statisticsDateStart: null,
  1016. statisticsDateEnd: null,
  1017. mergeAmendFee: 0,
  1018. examine: 0,
  1019. examineDate: 0
  1020. };
  1021. this.onLoad(this.page);
  1022. },
  1023. // 搜索
  1024. searchChange(params, done) {
  1025. this.firstLoad = true;
  1026. this.query = params;
  1027. this.page.currentPage = 1;
  1028. this.onLoad(this.page, params);
  1029. done();
  1030. },
  1031. currentChange(currentPage) {
  1032. this.page.currentPage = currentPage;
  1033. },
  1034. sizeChange(pageSize) {
  1035. this.page.pageSize = pageSize;
  1036. },
  1037. refreshChange() {
  1038. this.onLoad(this.page, this.query);
  1039. },
  1040. onLoad(page, params = {}) {
  1041. if (this.firstLoad) {
  1042. this.loading = true;
  1043. this.itemLoading = true;
  1044. if (Array.isArray(this.query.businessType)) {
  1045. this.query.businessType = this.query.businessType.join(",");
  1046. }
  1047. financeStatisticsFinanceProfit(page.currentPage, page.pageSize, Object.assign(params, this.query))
  1048. .then(res => {
  1049. const data = res.data.data;
  1050. this.page.total = data.total;
  1051. this.data = data.records;
  1052. this.$nextTick(() => {
  1053. this.$refs.crud.doLayout();
  1054. this.$refs.crud.dicInit();
  1055. });
  1056. financeStatisticsFinanceProfitSum(Object.assign(params, this.query))
  1057. .then(re => {
  1058. this.commodityData = [re.data.data];
  1059. })
  1060. .finally(() => {
  1061. this.itemLoading = false;
  1062. });
  1063. this.selectionClear();
  1064. })
  1065. .catch(() => {
  1066. this.itemLoading = false;
  1067. })
  1068. .finally(() => {
  1069. this.loading = false;
  1070. });
  1071. }
  1072. },
  1073. selectionClear() {
  1074. this.$refs.crud.toggleSelection();
  1075. },
  1076. //自定义列保存
  1077. async saveColumnTwo(ref, option, optionBack, code) {
  1078. /**
  1079. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1080. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1081. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1082. */
  1083. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1084. if (inSave) {
  1085. this.$message.success("保存成功");
  1086. //关闭窗口
  1087. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1088. }
  1089. },
  1090. //自定义列重置
  1091. async resetColumnTwo(ref, option, optionBack, code) {
  1092. this[option] = this[optionBack];
  1093. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1094. if (this.saberUserInfo.role_name.indexOf("admin") != -1 || this.saberUserInfo.role_name.indexOf("总部") != -1) {
  1095. this.option.searchMenuSpan = 24;
  1096. this.option.column.forEach(item => {
  1097. if (item.prop == "branchId") {
  1098. item.search = true;
  1099. }
  1100. });
  1101. }
  1102. if (inSave) {
  1103. this.$message.success("重置成功");
  1104. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1105. this.query = {
  1106. businessType: "SE,SI",
  1107. costMerge: 1,
  1108. statisticsDateStart: defaultDate3()[0],
  1109. statisticsDateEnd: defaultDate3()[1]
  1110. };
  1111. }
  1112. },
  1113. // 更改表格颜色
  1114. headerClassName(tab) {
  1115. //颜色间隔
  1116. let back = "";
  1117. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1118. if (tab.columnIndex % 2 === 0) {
  1119. back = "back-one";
  1120. } else if (tab.columnIndex % 2 === 1) {
  1121. back = "back-two";
  1122. }
  1123. }
  1124. return back;
  1125. }
  1126. }
  1127. };
  1128. </script>
  1129. <style scoped>
  1130. ::v-deep#out-table .back-one {
  1131. background: #ecf5ff !important;
  1132. text-align: center;
  1133. }
  1134. ::v-deep#out-table .back-two {
  1135. background: #ecf5ff !important;
  1136. text-align: center;
  1137. }
  1138. /deep/ .el-col-md-8 {
  1139. width: 24.33333%;
  1140. }
  1141. </style>