index.vue 30 KB

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