index.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  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: 18,
  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: "corpSource",
  297. // hide: true,
  298. search: true,
  299. type: "select",
  300. dicUrl: "/api/blade-system/dict-biz/dictionary?code=corp_Source",
  301. props: {
  302. label: "dictValue",
  303. value: "dictValue"
  304. },
  305. overHidden: true,
  306. },
  307. {
  308. label: "业务员",
  309. prop: "salesman",
  310. overHidden: true,
  311. search: true,
  312. searchslot: true,
  313. searchOrder: 10
  314. },
  315. {
  316. label: "起运港",
  317. prop: "pol",
  318. overHidden: true,
  319. },
  320. {
  321. label: "目的港",
  322. prop: "pod",
  323. overHidden: true,
  324. },
  325. {
  326. label: "船名",
  327. prop: "vesselCnName",
  328. overHidden: true,
  329. search: true,
  330. searchslot: true,
  331. searchOrder: 5
  332. },
  333. {
  334. label: "航次",
  335. prop: "voyageNo",
  336. overHidden: true,
  337. search: true,
  338. searchslot: true,
  339. searchOrder: 6
  340. },
  341. {
  342. label: "核算部门",
  343. prop: "accDeptName",
  344. overHidden: true,
  345. search: true,
  346. searchslot: true,
  347. searchOrder: 12
  348. },
  349. {
  350. label: "航线",
  351. prop: "lineCnName",
  352. overHidden: true,
  353. search: true,
  354. searchslot: true,
  355. searchOrder: 13
  356. },
  357. {
  358. label: "船公司",
  359. prop: "carrierCnName",
  360. overHidden: true,
  361. search: true,
  362. searchslot: true,
  363. searchOrder: 2
  364. },
  365. {
  366. label: "操作员",
  367. prop: "operatorName",
  368. overHidden: true,
  369. },
  370. {
  371. label: "amend数量",
  372. prop: "whetherExist",
  373. width: 100,
  374. hide: true,
  375. showColumn: false,
  376. overHidden: true,
  377. },
  378. {
  379. label: "应收美元",
  380. prop: "amountDrUsd",
  381. overHidden: true,
  382. },
  383. {
  384. label: "实收美元",
  385. prop: "realAmountDrUsd",
  386. overHidden: true,
  387. },
  388. {
  389. label: "应收人民币",
  390. prop: "amountDr",
  391. width: 100,
  392. overHidden: true,
  393. },
  394. {
  395. label: "实收人民币",
  396. prop: "realAmountDr",
  397. width: 100,
  398. overHidden: true,
  399. },
  400. {
  401. label: "合计应收",
  402. prop: "amountDrLoc",
  403. overHidden: true,
  404. },
  405. {
  406. label: "实际合计应收",
  407. prop: "realAmountDrLoc",
  408. width: 110,
  409. overHidden: true,
  410. },
  411. {
  412. label: "未收美元",
  413. prop: "notReceivedDrUsd",
  414. overHidden: true,
  415. },
  416. {
  417. label: "未收人民币",
  418. prop: "notReceivedDr",
  419. width: 100,
  420. overHidden: true,
  421. },
  422. {
  423. label: "未收合计",
  424. prop: "notReceivedLoc",
  425. overHidden: true,
  426. },
  427. {
  428. label: "应付美元",
  429. prop: "amountCrUsd",
  430. overHidden: true,
  431. },
  432. {
  433. label: "实付美元",
  434. prop: "realAmountCrUsd",
  435. overHidden: true,
  436. },
  437. {
  438. label: "应付人民币",
  439. prop: "amountCr",
  440. width: 100,
  441. overHidden: true,
  442. },
  443. {
  444. label: "实付人民币",
  445. prop: "realAmountCr",
  446. width: 100,
  447. overHidden: true,
  448. },
  449. {
  450. label: "合计应付",
  451. prop: "amountCrLoc",
  452. overHidden: true,
  453. },
  454. {
  455. label: "实际合计应付",
  456. prop: "realAmountCrLoc",
  457. width: 110,
  458. overHidden: true,
  459. },
  460. {
  461. label: "人民币利润",
  462. prop: "amountProfit",
  463. width: 100,
  464. overHidden: true,
  465. },
  466. {
  467. label: "美元利润",
  468. prop: "amountProfitUsd",
  469. overHidden: true,
  470. },
  471. {
  472. label: "合计利润",
  473. prop: "amountProfitLoc",
  474. overHidden: true,
  475. },
  476. {
  477. label: "合计实际利润",
  478. prop: "realAmountProfitLoc",
  479. width: 110,
  480. overHidden: true,
  481. },
  482. // {
  483. // label: "委托人",
  484. // prop: "client",
  485. // overHidden: true,
  486. // hide: true,
  487. // search: true,
  488. // searchslot: true,
  489. // searchOrder: 3
  490. // },
  491. {
  492. label: "业务来源",
  493. prop: "srcType",
  494. overHidden: true,
  495. hide: true,
  496. search: true,
  497. searchslot: true,
  498. searchOrder: 9
  499. },
  500. {
  501. label: "",
  502. prop: "costMerge",
  503. hide: true,
  504. showColumn: false,
  505. search: true,
  506. searchslot: true,
  507. searchLabelWidth: '0',
  508. searchOrder: 14,
  509. searchSpan: 18,
  510. },
  511. ]
  512. },
  513. data: [],
  514. // 业务类型数据
  515. billTypeData: [],
  516. // 船公司数据
  517. carrierData: [],
  518. // 委托人数据
  519. clientData: [],
  520. // 结算等单位
  521. corpIdData: [],
  522. // 船名
  523. vesselData: [],
  524. srcTypeData: [], // 业务来源
  525. srcIdData: [], // 业务员
  526. srcforParameter: { key: 'id', label: 'cnName', value: 'id' },
  527. accDeptData: [], // 部门数据
  528. lineData: [], // 航线数据
  529. commodityData: [], // 合计数据
  530. // 合计的配置项
  531. commodityLabel: [
  532. {
  533. id: 4,
  534. label: '应收人民币',
  535. prop: 'amountDr'
  536. },
  537. {
  538. id: 5,
  539. label: '应收美元',
  540. prop: 'amountDrUsd'
  541. },
  542. {
  543. id: 6,
  544. label: '合计应收',
  545. prop: 'amountDrLoc'
  546. },
  547. {
  548. id: 10,
  549. label: '实收人民币',
  550. prop: 'realAmountDr'
  551. },
  552. {
  553. id: 11,
  554. label: '实收美元',
  555. prop: 'realAmountDrUsd'
  556. },
  557. {
  558. id: 12,
  559. label: '实收合计',
  560. prop: 'realAmountDrLoc'
  561. },
  562. {
  563. id: 1,
  564. label: '应付人民币',
  565. prop: 'amountCr'
  566. },
  567. {
  568. id: 2,
  569. label: '应付美元',
  570. prop: 'amountCrUsd'
  571. },
  572. {
  573. id: 3,
  574. label: '合计应付',
  575. prop: 'amountCrLoc'
  576. },
  577. {
  578. id: 7,
  579. label: '实付人民币',
  580. prop: 'realAmountCr'
  581. },
  582. {
  583. id: 8,
  584. label: '实付美元',
  585. prop: 'realAmountCrUsd'
  586. },
  587. {
  588. id: 9,
  589. label: '实付合计',
  590. prop: 'realAmountCrLoc'
  591. },
  592. {
  593. id: 10,
  594. label: "人民币利润",
  595. prop: "amountProfit",
  596. },
  597. {
  598. id: 11,
  599. label: "美元利润",
  600. prop: "amountProfitUsd",
  601. },
  602. {
  603. id: 13,
  604. label: '合计利润',
  605. prop: 'amountProfitLoc'
  606. },
  607. {
  608. id: 14,
  609. label: '合计实际利润',
  610. prop: 'realAmountProfitLoc'
  611. },
  612. ],
  613. }
  614. },
  615. async created() {
  616. this.option = await this.getColumnData(this.getColumnName(336), this.optionBack);
  617. this.findObject(this.option.column, "whetherExist").hide = false;
  618. this.findObject(this.option.column, "whetherExist").showColumn = true;
  619. this.query = {
  620. billType: 'SE,SI',
  621. costMerge: 1,
  622. mergeAmendFee: 1,
  623. statisticsDateStart: defaultDate3()[0],
  624. statisticsDateEnd: defaultDate3()[1],
  625. }
  626. this.getWorkDictsfun()
  627. this.getLazylistfun() // 获取部门数据
  628. },
  629. methods: {
  630. // 导出
  631. exportfun() {
  632. const routeData = this.$router.resolve({
  633. path: '/api/blade-los/financeStatistics/financeProfitExport',//跳转目标窗口的地址
  634. query: {
  635. ...this.query
  636. }
  637. })
  638. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  639. },
  640. // 获取字典数据
  641. getWorkDictsfun() {
  642. // 获取业务类型
  643. getWorkDicts('profit_business_type_los').then(res => {
  644. this.findObject(this.option.column, "billType").dicData = res.data.data
  645. this.billTypeData = res.data.data.map(item => {
  646. return { label: item.dictValue, value: item.dictKey }
  647. })
  648. })
  649. },
  650. // 单选
  651. radioSearchfun(name) {
  652. if (name == 'costMerge') {
  653. this.$set(this.query, 'consistentCorpMerge', null)
  654. this.$set(this.query, 'inconsistentCorpMerge', null)
  655. } else if (name == 'consistentCorpMerge') {
  656. this.$set(this.query, 'inconsistentCorpMerge', null)
  657. this.$set(this.query, 'costMerge', null)
  658. } else if (name == 'inconsistentCorpMerge') {
  659. this.$set(this.query, 'costMerge', null)
  660. this.$set(this.query, 'consistentCorpMerge', null)
  661. }
  662. this.page.currentPage = 1;
  663. this.onLoad(this.page, this.query);
  664. },
  665. // 业务员下拉
  666. srcCorpFocus(value, name) {
  667. if (this.query.srcType == 'SALES') {
  668. // 业务员
  669. this.srcforParameter = { key: 'id', label: 'name', value: 'id' }
  670. this.salesUserGetListfun(value, '业务员')
  671. } else if (this.query.srcType == 'AGENT') {
  672. // 代理
  673. this.srcforParameter = { key: 'id', label: 'cnName', value: 'id' }
  674. this.agentBcorpsListfun(value)
  675. } else if (this.query.srcType == 'OWN') {
  676. // 公司
  677. this.srcforParameter = { key: 'id', label: 'title', value: 'id' }
  678. this.ownDeptLazyTreefun()
  679. } else { }
  680. },
  681. // 下拉
  682. corpChange(value, name) {
  683. if (name == 'srcType') {
  684. if (value == 'OWN') {
  685. // 公司
  686. this.srcforParameter = { key: 'id', label: 'title', value: 'id' }
  687. this.ownDeptLazyTreefun()
  688. } else if (value == 'AGENT') {
  689. // 代理
  690. this.srcforParameter = { key: 'id', label: 'cnName', value: 'id' }
  691. this.agentBcorpsListfun()
  692. } else if (value == 'SALES') {
  693. // 业务员
  694. this.srcforParameter = { key: 'id', label: 'name', value: 'id' }
  695. this.salesUserGetListfun('', '业务员')
  696. } else { }
  697. this.$set(this.query, name, value)
  698. } else if (name == 'accDeptName') {
  699. for (let item of this.accDeptData) {
  700. if (item.title == value) {
  701. this.$set(this.query, 'accDeptName', item.title)
  702. this.$set(this.query, 'accDeptId', item.id)
  703. }
  704. }
  705. } else {
  706. this.$set(this.query, name, value)
  707. }
  708. },
  709. // 接口
  710. // 船公司
  711. carrierBcorpsListfun(cnName) {
  712. let corpTypeName = '船公司'
  713. getBcorpslistByType(1, 10, { cnName, corpTypeName, status: 0 }).then(res => {
  714. this.carrierData = res.data.data.records
  715. })
  716. },
  717. // 委托人
  718. clientListfun(cnName) {
  719. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  720. this.clientData = res.data.data.records
  721. })
  722. },
  723. // 结算单位
  724. getBcorpsListfun(cnName) {
  725. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  726. this.corpIdData = res.data.data.records
  727. })
  728. },
  729. // 船名
  730. vesselBvesselsListfun(cnName) {
  731. getBvesselsList(1, 10, { cnName, status: 0 }).then(res => {
  732. this.vesselData = res.data.data.records
  733. })
  734. },
  735. // 获取业务来源数据
  736. srcTypeWorkDictsfun() {
  737. getWorkDicts('src_type_los').then(res => {
  738. this.srcTypeData = res.data.data
  739. })
  740. },
  741. // 获取公司名称 用户管理左侧
  742. ownDeptLazyTreefun() {
  743. getDeptLazyTree(0).then(res => {
  744. this.srcIdData = res.data.data
  745. })
  746. },
  747. // 获取业务来源代理数据
  748. agentBcorpsListfun(cnName) {
  749. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  750. getBcorpslistByType(1, 10, { cnName, status: 0, corpTypeName }).then(res => {
  751. this.srcIdData = res.data.data.records
  752. })
  753. },
  754. // 获取业务来源业务员数据
  755. salesUserGetListfun(account, role) {
  756. console.info('account-----', account)
  757. userGetList(1, 10, { account: account, roleId: role }).then(res => {
  758. this.srcIdData = res.data.data.records
  759. })
  760. },
  761. // 获取核算部门数据
  762. getLazylistfun() {
  763. getDeptTree().then(res => {
  764. this.accDeptData = res.data.data
  765. })
  766. },
  767. // 航线数据
  768. lineBlinesListfun(cnName) {
  769. blinesList(1, 10, { cnName, status: 0 }).then(res => {
  770. this.lineData = res.data.data.records
  771. })
  772. },
  773. // 清空搜索回调方法
  774. searchReset() {
  775. this.query = {
  776. billType: 'SE,SI',
  777. costMerge: 1,
  778. statisticsDateStart: null,
  779. statisticsDateEnd: null,
  780. mergeAmendFee: 1,
  781. examine: 0,
  782. examineDate: 0
  783. };
  784. this.onLoad(this.page);
  785. },
  786. // 搜索
  787. searchChange(params, done) {
  788. console.log(params)
  789. this.query = params;
  790. this.page.currentPage = 1;
  791. this.onLoad(this.page, params);
  792. done();
  793. },
  794. currentChange(currentPage) {
  795. this.page.currentPage = currentPage;
  796. },
  797. sizeChange(pageSize) {
  798. this.page.pageSize = pageSize;
  799. },
  800. refreshChange() {
  801. this.onLoad(this.page, this.query);
  802. },
  803. onLoad(page, params = {}) {
  804. this.loading = true;
  805. if (Array.isArray(this.query.billType)) {
  806. this.query.billType = this.query.billType.join(',')
  807. }
  808. financeStatisticsFinanceProfit(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  809. const data = res.data.data;
  810. this.page.total = data.total;
  811. this.data = data.records;
  812. this.loading = false;
  813. financeStatisticsFinanceProfitSum(Object.assign(params, this.query)).then(re => {
  814. this.commodityData = [re.data.data]
  815. })
  816. this.$nextTick(() => {
  817. this.$refs.crud.doLayout();
  818. this.$refs.crud.dicInit();
  819. });
  820. this.selectionClear();
  821. });
  822. },
  823. selectionClear() {
  824. this.$refs.crud.toggleSelection();
  825. },
  826. //自定义列保存
  827. async saveColumnTwo(ref, option, optionBack, code) {
  828. /**
  829. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  830. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  831. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  832. */
  833. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  834. if (inSave) {
  835. this.$message.success("保存成功");
  836. //关闭窗口
  837. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  838. }
  839. },
  840. //自定义列重置
  841. async resetColumnTwo(ref, option, optionBack, code) {
  842. this[option] = this[optionBack];
  843. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  844. if (inSave) {
  845. this.$message.success("重置成功");
  846. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  847. this.query = {
  848. billType: 'SE,SI',
  849. costMerge: 1,
  850. statisticsDateStart: defaultDate3()[0],
  851. statisticsDateEnd: defaultDate3()[1],
  852. }
  853. }
  854. },
  855. // 更改表格颜色
  856. headerClassName(tab) {
  857. //颜色间隔
  858. let back = ""
  859. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  860. if (tab.columnIndex % 2 === 0) {
  861. back = "back-one"
  862. } else if (tab.columnIndex % 2 === 1) {
  863. back = "back-two"
  864. }
  865. }
  866. return back;
  867. },
  868. },
  869. watch: {
  870. "query.mergeAmendFee": {
  871. handler(newVla, oldVal) {
  872. console.log(newVla, oldVal)
  873. if (newVla == 1) {
  874. this.findObject(this.option.column, "whetherExist").hide = false;
  875. this.findObject(this.option.column, "whetherExist").showColumn = true;
  876. } else {
  877. this.findObject(this.option.column, "whetherExist").hide = true;
  878. this.findObject(this.option.column, "whetherExist").showColumn = false;
  879. }
  880. },
  881. deep: false, // 深度监听
  882. immediate: false // 第一次改变就执行
  883. },
  884. },
  885. }
  886. </script>
  887. <style scoped>
  888. ::v-deep#out-table .back-one {
  889. background: #ecf5ff !important;
  890. text-align: center;
  891. }
  892. ::v-deep#out-table .back-two {
  893. background: #ecf5ff !important;
  894. text-align: center;
  895. }
  896. /deep/ .el-col-md-8 {
  897. width: 24.33333%;
  898. }
  899. </style>