index.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  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. mergeAmendFee: 1,
  115. statisticsDateStart: defaultDate3()[0],
  116. statisticsDateEnd: defaultDate3()[1],
  117. },
  118. option: {},
  119. optionBack: {
  120. height: 'auto',
  121. calcHeight: 30,
  122. tip: false,
  123. searchShow: true,
  124. searchMenuSpan: 24,
  125. border: true,
  126. index: false,
  127. selection: true,
  128. dialogClickModal: false,
  129. menu: false,
  130. addBtn: false,
  131. viewBtn: false,
  132. delBtn: false,
  133. editBtn: false,
  134. searchIcon: true,
  135. searchIndex: 3,
  136. emptyBtnText: '清空所有条件',
  137. showSummary: true,
  138. summaryText: "合计",
  139. sumColumnList: [
  140. {
  141. name: 'whetherExist',
  142. type: 'sum',
  143. },
  144. {
  145. name: 'amountDrUsd',
  146. type: 'sum',
  147. decimals: 2
  148. }, {
  149. name: 'realAmountDrUsd',
  150. type: 'sum',
  151. decimals: 2
  152. }, {
  153. name: 'amountDr',
  154. type: 'sum',
  155. decimals: 2
  156. }, {
  157. name: 'realAmountDr',
  158. type: 'sum',
  159. decimals: 2
  160. }, {
  161. name: 'amountDrLoc',
  162. type: 'sum',
  163. decimals: 2
  164. }, {
  165. name: 'realAmountDrLoc',
  166. type: 'sum',
  167. decimals: 2
  168. }, {
  169. name: 'amountCrUsd',
  170. type: 'sum',
  171. decimals: 2
  172. }, {
  173. name: 'realAmountCrUsd',
  174. type: 'sum',
  175. decimals: 2
  176. }, {
  177. name: 'amountCr',
  178. type: 'sum',
  179. decimals: 2
  180. }, {
  181. name: 'realAmountCr',
  182. type: 'sum',
  183. decimals: 2
  184. }, {
  185. name: 'amountCrLoc',
  186. type: 'sum',
  187. decimals: 2
  188. }, {
  189. name: 'realAmountCrLoc',
  190. type: 'sum',
  191. decimals: 2
  192. }, {
  193. name: 'amountProfit',
  194. type: 'sum',
  195. decimals: 2
  196. }, {
  197. name: 'amountProfitUsd',
  198. type: 'sum',
  199. decimals: 2
  200. }, {
  201. name: 'amountProfitLoc',
  202. type: 'sum',
  203. decimals: 2
  204. }, {
  205. name: 'realAmountProfitLoc',
  206. type: 'sum',
  207. decimals: 2
  208. }, {
  209. name: 'notReceivedDrUsd',
  210. type: 'sum',
  211. decimals: 2
  212. }, {
  213. name: 'notReceivedDr',
  214. type: 'sum',
  215. decimals: 2
  216. }, {
  217. name: 'notReceivedLoc',
  218. type: 'sum',
  219. decimals: 2
  220. }],
  221. column: [
  222. {
  223. label: "业务类型",
  224. prop: "billType",
  225. overHidden: true,
  226. search: true,
  227. searchslot: true,
  228. searchOrder: 1,
  229. type: 'select',
  230. dicData: [],
  231. props: {
  232. label: "dictValue",
  233. value: "dictKey"
  234. },
  235. },
  236. {
  237. label: "业务编号",
  238. prop: "billNo",
  239. overHidden: true,
  240. search: true,
  241. searchOrder: 11
  242. },
  243. {
  244. label: "H B/L",
  245. prop: "hblNo",
  246. overHidden: true,
  247. },
  248. {
  249. label: "M B/L",
  250. prop: "mblNo",
  251. search: true,
  252. overHidden: true,
  253. searchOrder: 12
  254. },
  255. {
  256. label: "日期",
  257. prop: "statisticsDate",
  258. width:100,
  259. overHidden: true,
  260. type: "date",
  261. format: "yyyy-MM-dd",
  262. valueFormat: "yyyy-MM-dd",
  263. },
  264. {
  265. label: "往来单位",
  266. prop: "corpName",
  267. overHidden: true,
  268. search: true,
  269. searchslot: true,
  270. searchOrder: 4
  271. },
  272. {
  273. label: "统计开始",
  274. prop: "statisticsDateStart",
  275. overHidden: true,
  276. search: true,
  277. hide: true,
  278. searchOrder: 7,
  279. type: "date",
  280. format: "yyyy-MM-dd",
  281. valueFormat: "yyyy-MM-dd",
  282. },
  283. {
  284. label: "统计结束",
  285. prop: "statisticsDateEnd",
  286. overHidden: true,
  287. search: true,
  288. hide: true,
  289. searchOrder: 8,
  290. type: "date",
  291. format: "yyyy-MM-dd",
  292. valueFormat: "yyyy-MM-dd",
  293. },
  294. {
  295. label: "业务员",
  296. prop: "salesman",
  297. overHidden: true,
  298. search: true,
  299. searchslot: true,
  300. searchOrder: 10
  301. },
  302. {
  303. label: "起运港",
  304. prop: "pol",
  305. overHidden: true,
  306. },
  307. {
  308. label: "目的港",
  309. prop: "pod",
  310. overHidden: true,
  311. },
  312. {
  313. label: "船名",
  314. prop: "vesselCnName",
  315. overHidden: true,
  316. search: true,
  317. searchslot: true,
  318. searchOrder: 5
  319. },
  320. {
  321. label: "航次",
  322. prop: "voyageNo",
  323. overHidden: true,
  324. search: true,
  325. searchslot: true,
  326. searchOrder: 6
  327. },
  328. {
  329. label: "核算部门",
  330. prop: "accDeptName",
  331. overHidden: true,
  332. search: true,
  333. searchslot: true,
  334. searchOrder: 12
  335. },
  336. {
  337. label: "航线",
  338. prop: "lineCnName",
  339. overHidden: true,
  340. search: true,
  341. searchslot: true,
  342. searchOrder: 13
  343. },
  344. {
  345. label: "船公司",
  346. prop: "carrierCnName",
  347. overHidden: true,
  348. search: true,
  349. searchslot: true,
  350. searchOrder: 2
  351. },
  352. {
  353. label: "操作员",
  354. prop: "operatorName",
  355. overHidden: true,
  356. },
  357. {
  358. label: "amend数量",
  359. prop: "whetherExist",
  360. width: 100,
  361. hide: true,
  362. showColumn: false,
  363. overHidden: true,
  364. },
  365. {
  366. label: "应收美元",
  367. prop: "amountDrUsd",
  368. overHidden: true,
  369. },
  370. {
  371. label: "实收美元",
  372. prop: "realAmountDrUsd",
  373. overHidden: true,
  374. },
  375. {
  376. label: "应收人民币",
  377. prop: "amountDr",
  378. width: 100,
  379. overHidden: true,
  380. },
  381. {
  382. label: "实收人民币",
  383. prop: "realAmountDr",
  384. width: 100,
  385. overHidden: true,
  386. },
  387. {
  388. label: "合计应收",
  389. prop: "amountDrLoc",
  390. overHidden: true,
  391. },
  392. {
  393. label: "实际合计应收",
  394. prop: "realAmountDrLoc",
  395. width: 110,
  396. overHidden: true,
  397. },
  398. {
  399. label: "未收美元",
  400. prop: "notReceivedDrUsd",
  401. overHidden: true,
  402. },
  403. {
  404. label: "未收人民币",
  405. prop: "notReceivedDr",
  406. width: 100,
  407. overHidden: true,
  408. },
  409. {
  410. label: "未收合计",
  411. prop: "notReceivedLoc",
  412. overHidden: true,
  413. },
  414. {
  415. label: "应付美元",
  416. prop: "amountCrUsd",
  417. overHidden: true,
  418. },
  419. {
  420. label: "实付美元",
  421. prop: "realAmountCrUsd",
  422. overHidden: true,
  423. },
  424. {
  425. label: "应付人民币",
  426. prop: "amountCr",
  427. width: 100,
  428. overHidden: true,
  429. },
  430. {
  431. label: "实付人民币",
  432. prop: "realAmountCr",
  433. width: 100,
  434. overHidden: true,
  435. },
  436. {
  437. label: "合计应付",
  438. prop: "amountCrLoc",
  439. overHidden: true,
  440. },
  441. {
  442. label: "实际合计应付",
  443. prop: "realAmountCrLoc",
  444. width: 110,
  445. overHidden: true,
  446. },
  447. {
  448. label: "人民币利润",
  449. prop: "amountProfit",
  450. width: 100,
  451. overHidden: true,
  452. },
  453. {
  454. label: "美元利润",
  455. prop: "amountProfitUsd",
  456. overHidden: true,
  457. },
  458. {
  459. label: "合计利润",
  460. prop: "amountProfitLoc",
  461. overHidden: true,
  462. },
  463. {
  464. label: "合计实际利润",
  465. prop: "realAmountProfitLoc",
  466. width: 110,
  467. overHidden: true,
  468. },
  469. // {
  470. // label: "委托人",
  471. // prop: "client",
  472. // overHidden: true,
  473. // hide: true,
  474. // search: true,
  475. // searchslot: true,
  476. // searchOrder: 3
  477. // },
  478. {
  479. label: "业务来源",
  480. prop: "srcType",
  481. overHidden: true,
  482. hide: true,
  483. search: true,
  484. searchslot: true,
  485. searchOrder: 9
  486. },
  487. {
  488. label: "",
  489. prop: "costMerge",
  490. hide: true,
  491. showColumn: false,
  492. search: true,
  493. searchslot: true,
  494. searchLabelWidth: '0',
  495. searchOrder: 14,
  496. searchSpan: 18,
  497. },
  498. ]
  499. },
  500. data: [],
  501. // 业务类型数据
  502. billTypeData: [],
  503. // 船公司数据
  504. carrierData: [],
  505. // 委托人数据
  506. clientData: [],
  507. // 结算等单位
  508. corpIdData: [],
  509. // 船名
  510. vesselData: [],
  511. srcTypeData: [], // 业务来源
  512. srcIdData: [], // 业务员
  513. srcforParameter: { key: 'id', label: 'cnName', value: 'id' },
  514. accDeptData: [], // 部门数据
  515. lineData: [], // 航线数据
  516. commodityData: [], // 合计数据
  517. // 合计的配置项
  518. commodityLabel: [
  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: 10,
  536. label: '实收人民币',
  537. prop: 'realAmountDr'
  538. },
  539. {
  540. id: 11,
  541. label: '实收美元',
  542. prop: 'realAmountDrUsd'
  543. },
  544. {
  545. id: 12,
  546. label: '实收合计',
  547. prop: 'realAmountDrLoc'
  548. },
  549. {
  550. id: 1,
  551. label: '应付人民币',
  552. prop: 'amountCr'
  553. },
  554. {
  555. id: 2,
  556. label: '应付美元',
  557. prop: 'amountCrUsd'
  558. },
  559. {
  560. id: 3,
  561. label: '合计应付',
  562. prop: 'amountCrLoc'
  563. },
  564. {
  565. id: 7,
  566. label: '实付人民币',
  567. prop: 'realAmountCr'
  568. },
  569. {
  570. id: 8,
  571. label: '实付美元',
  572. prop: 'realAmountCrUsd'
  573. },
  574. {
  575. id: 9,
  576. label: '实付合计',
  577. prop: 'realAmountCrLoc'
  578. },
  579. {
  580. id: 10,
  581. label: "人民币利润",
  582. prop: "amountProfit",
  583. },
  584. {
  585. id: 11,
  586. label: "美元利润",
  587. prop: "amountProfitUsd",
  588. },
  589. {
  590. id: 13,
  591. label: '合计利润',
  592. prop: 'amountProfitLoc'
  593. },
  594. {
  595. id: 14,
  596. label: '合计实际利润',
  597. prop: 'realAmountProfitLoc'
  598. },
  599. ],
  600. }
  601. },
  602. async created() {
  603. this.option = await this.getColumnData(this.getColumnName(336), this.optionBack);
  604. this.findObject(this.option.column, "whetherExist").hide = false;
  605. this.findObject(this.option.column, "whetherExist").showColumn = true;
  606. this.query = {
  607. billType: 'SE,SI',
  608. costMerge: 1,
  609. mergeAmendFee: 1,
  610. statisticsDateStart: defaultDate3()[0],
  611. statisticsDateEnd: defaultDate3()[1],
  612. }
  613. this.getWorkDictsfun()
  614. this.getLazylistfun() // 获取部门数据
  615. },
  616. methods: {
  617. // 导出
  618. exportfun() {
  619. const routeData = this.$router.resolve({
  620. path: '/api/blade-los/financeStatistics/financeProfitExport',//跳转目标窗口的地址
  621. query: {
  622. ...this.query
  623. }
  624. })
  625. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  626. },
  627. // 获取字典数据
  628. getWorkDictsfun() {
  629. // 获取业务类型
  630. getWorkDicts('profit_business_type_los').then(res => {
  631. this.findObject(this.option.column, "billType").dicData = res.data.data
  632. this.billTypeData = res.data.data.map(item => {
  633. return { label: item.dictValue, value: item.dictKey }
  634. })
  635. })
  636. },
  637. // 单选
  638. radioSearchfun(name) {
  639. if (name == 'costMerge') {
  640. this.$set(this.query, 'consistentCorpMerge', null)
  641. this.$set(this.query, 'inconsistentCorpMerge', null)
  642. } else if (name == 'consistentCorpMerge') {
  643. this.$set(this.query, 'inconsistentCorpMerge', null)
  644. this.$set(this.query, 'costMerge', null)
  645. } else if (name == 'inconsistentCorpMerge') {
  646. this.$set(this.query, 'costMerge', null)
  647. this.$set(this.query, 'consistentCorpMerge', null)
  648. }
  649. this.page.currentPage = 1;
  650. this.onLoad(this.page, this.query);
  651. },
  652. // 业务员下拉
  653. srcCorpFocus(value, name) {
  654. if (this.query.srcType == 'SALES') {
  655. // 业务员
  656. this.srcforParameter = { key: 'id', label: 'name', value: 'id' }
  657. this.salesUserGetListfun(value, '业务员')
  658. } else if (this.query.srcType == 'AGENT') {
  659. // 代理
  660. this.srcforParameter = { key: 'id', label: 'cnName', value: 'id' }
  661. this.agentBcorpsListfun(value)
  662. } else if (this.query.srcType == 'OWN') {
  663. // 公司
  664. this.srcforParameter = { key: 'id', label: 'title', value: 'id' }
  665. this.ownDeptLazyTreefun()
  666. } else { }
  667. },
  668. // 下拉
  669. corpChange(value, name) {
  670. if (name == 'srcType') {
  671. if (value == 'OWN') {
  672. // 公司
  673. this.srcforParameter = { key: 'id', label: 'title', value: 'id' }
  674. this.ownDeptLazyTreefun()
  675. } else if (value == 'AGENT') {
  676. // 代理
  677. this.srcforParameter = { key: 'id', label: 'cnName', value: 'id' }
  678. this.agentBcorpsListfun()
  679. } else if (value == 'SALES') {
  680. // 业务员
  681. this.srcforParameter = { key: 'id', label: 'name', value: 'id' }
  682. this.salesUserGetListfun('', '业务员')
  683. } else { }
  684. this.$set(this.query, name, value)
  685. } else if (name == 'accDeptName') {
  686. for (let item of this.accDeptData) {
  687. if (item.title == value) {
  688. this.$set(this.query, 'accDeptName', item.title)
  689. this.$set(this.query, 'accDeptId', item.id)
  690. }
  691. }
  692. } else {
  693. this.$set(this.query, name, value)
  694. }
  695. },
  696. // 接口
  697. // 船公司
  698. carrierBcorpsListfun(cnName) {
  699. let corpTypeName = '船公司'
  700. getBcorpslistByType(1, 10, { cnName, corpTypeName, status: 0 }).then(res => {
  701. this.carrierData = res.data.data.records
  702. })
  703. },
  704. // 委托人
  705. clientListfun(cnName) {
  706. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  707. this.clientData = res.data.data.records
  708. })
  709. },
  710. // 结算单位
  711. getBcorpsListfun(cnName) {
  712. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  713. this.corpIdData = res.data.data.records
  714. })
  715. },
  716. // 船名
  717. vesselBvesselsListfun(cnName) {
  718. getBvesselsList(1, 10, { cnName, status: 0 }).then(res => {
  719. this.vesselData = res.data.data.records
  720. })
  721. },
  722. // 获取业务来源数据
  723. srcTypeWorkDictsfun() {
  724. getWorkDicts('src_type_los').then(res => {
  725. this.srcTypeData = res.data.data
  726. })
  727. },
  728. // 获取公司名称 用户管理左侧
  729. ownDeptLazyTreefun() {
  730. getDeptLazyTree(0).then(res => {
  731. this.srcIdData = res.data.data
  732. })
  733. },
  734. // 获取业务来源代理数据
  735. agentBcorpsListfun(cnName) {
  736. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  737. getBcorpslistByType(1, 10, { cnName, status: 0, corpTypeName }).then(res => {
  738. this.srcIdData = res.data.data.records
  739. })
  740. },
  741. // 获取业务来源业务员数据
  742. salesUserGetListfun(account, role) {
  743. console.info('account-----', account)
  744. userGetList(1, 10, { account: account, roleId: role }).then(res => {
  745. this.srcIdData = res.data.data.records
  746. })
  747. },
  748. // 获取核算部门数据
  749. getLazylistfun() {
  750. getDeptTree().then(res => {
  751. this.accDeptData = res.data.data
  752. })
  753. },
  754. // 航线数据
  755. lineBlinesListfun(cnName) {
  756. blinesList(1, 10, { cnName, status: 0 }).then(res => {
  757. this.lineData = res.data.data.records
  758. })
  759. },
  760. // 清空搜索回调方法
  761. searchReset() {
  762. this.query = {
  763. billType: 'SE,SI',
  764. costMerge: 1,
  765. statisticsDateStart: null,
  766. statisticsDateEnd: null,
  767. mergeAmendFee: 1,
  768. examine: 0,
  769. examineDate: 0
  770. };
  771. this.onLoad(this.page);
  772. },
  773. // 搜索
  774. searchChange(params, done) {
  775. console.log(params)
  776. this.query = params;
  777. this.page.currentPage = 1;
  778. this.onLoad(this.page, params);
  779. done();
  780. },
  781. currentChange(currentPage) {
  782. this.page.currentPage = currentPage;
  783. },
  784. sizeChange(pageSize) {
  785. this.page.pageSize = pageSize;
  786. },
  787. refreshChange() {
  788. this.onLoad(this.page, this.query);
  789. },
  790. onLoad(page, params = {}) {
  791. this.loading = true;
  792. if (Array.isArray(this.query.billType)) {
  793. this.query.billType = this.query.billType.join(',')
  794. }
  795. financeStatisticsFinanceProfit(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  796. const data = res.data.data;
  797. this.page.total = data.total;
  798. this.data = data.records;
  799. this.loading = false;
  800. financeStatisticsFinanceProfitSum(Object.assign(params, this.query)).then(re => {
  801. this.commodityData = [re.data.data]
  802. })
  803. this.selectionClear();
  804. });
  805. },
  806. selectionClear() {
  807. this.$refs.crud.toggleSelection();
  808. },
  809. //自定义列保存
  810. async saveColumnTwo(ref, option, optionBack, code) {
  811. /**
  812. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  813. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  814. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  815. */
  816. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  817. if (inSave) {
  818. this.$message.success("保存成功");
  819. //关闭窗口
  820. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  821. }
  822. },
  823. //自定义列重置
  824. async resetColumnTwo(ref, option, optionBack, code) {
  825. this[option] = this[optionBack];
  826. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  827. if (inSave) {
  828. this.$message.success("重置成功");
  829. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  830. this.query = {
  831. billType: 'SE,SI',
  832. costMerge: 1,
  833. statisticsDateStart: defaultDate3()[0],
  834. statisticsDateEnd: defaultDate3()[1],
  835. }
  836. }
  837. },
  838. // 更改表格颜色
  839. headerClassName(tab) {
  840. //颜色间隔
  841. let back = ""
  842. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  843. if (tab.columnIndex % 2 === 0) {
  844. back = "back-one"
  845. } else if (tab.columnIndex % 2 === 1) {
  846. back = "back-two"
  847. }
  848. }
  849. return back;
  850. },
  851. },
  852. watch: {
  853. "query.mergeAmendFee": {
  854. handler(newVla, oldVal) {
  855. console.log(newVla, oldVal)
  856. if (newVla == 1) {
  857. this.findObject(this.option.column, "whetherExist").hide = false;
  858. this.findObject(this.option.column, "whetherExist").showColumn = true;
  859. } else {
  860. this.findObject(this.option.column, "whetherExist").hide = true;
  861. this.findObject(this.option.column, "whetherExist").showColumn = false;
  862. }
  863. },
  864. deep: false, // 深度监听
  865. immediate: false // 第一次改变就执行
  866. },
  867. },
  868. }
  869. </script>
  870. <style scoped>
  871. ::v-deep#out-table .back-one {
  872. background: #ecf5ff !important;
  873. text-align: center;
  874. }
  875. ::v-deep#out-table .back-two {
  876. background: #ecf5ff !important;
  877. text-align: center;
  878. }
  879. /deep/ .el-col-md-8 {
  880. width: 24.33333%;
  881. }
  882. </style>