index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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', 334)"
  8. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 334)" @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="dcSearch">
  19. <el-radio v-model="query.dc" label="D" @input="dcInput">应收</el-radio>
  20. <el-radio v-model="query.dc" label="C" @input="dcInput">应付</el-radio>
  21. </template>
  22. <template slot-scope="{disabled,size}" slot="businessTypeSearch">
  23. <search-query :datalist="businessTypeData" :selectValue="query.businessType" :clearable="true"
  24. :buttonIf="false" :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  25. @corpFocus="businessTypeFocus" @corpChange="corpChange($event, 'businessType')">
  26. </search-query>
  27. </template>
  28. <template slot-scope="{disabled,size}" slot="clientIdSearch">
  29. <search-query :datalist="clientIdData" :selectValue="query.clientName" :filterable="true" :remote="true"
  30. :clearable="true" :buttonIf="false" :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  31. @remoteMethod="clientIdListfun" @corpFocus="clientIdListfun"
  32. @corpChange="corpChange($event, 'clientName')">
  33. </search-query>
  34. </template>
  35. <template slot-scope="{disabled,size}" slot="corpIdSearch">
  36. <search-query :datalist="corpIdData" :selectValue="query.corpName" :filterable="true" :remote="true"
  37. :clearable="true" :buttonIf="false" :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  38. @remoteMethod="getBcorpsListfun" @corpFocus="getBcorpsListfun"
  39. @corpChange="corpChange($event, 'corpName')">
  40. </search-query>
  41. </template>
  42. <template slot-scope="{disabled,size}" slot="srcIdSearch">
  43. <search-query :datalist="srcIdData" :selectValue="query.srcName" :filterable="true" :remote="true"
  44. :clearable="true" :buttonIf="false" :forParameter="{ key: 'id', label: 'name', value: 'name' }"
  45. @remoteMethod="srcCorpFocus" @corpFocus="srcCorpFocus" @corpChange="corpChange($event, 'srcName')">
  46. </search-query>
  47. </template>
  48. <template slot-scope="{disabled,size}" slot="isBusinessDateSearch">
  49. <el-checkbox v-model="query.isBusinessDate" :true-label="1" :false-label="0"
  50. @change="dateChange('isBusinessDate')">按业务日期</el-checkbox>
  51. <el-checkbox v-model="query.isToExamineDate" :true-label="1" :false-label="0"
  52. @change="dateChange('isToExamineDate')">按审核日期</el-checkbox>
  53. </template>
  54. </avue-crud>
  55. </basic-container>
  56. </template>
  57. <script>
  58. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  59. import { CurrentMonth, dateFormat, defaultDate3, defaultDate4 } from "@/util/date";
  60. import {
  61. financeStatisticsFeeSummaryDetailNot,
  62. financeStatisticsFeeSummaryDetailNotSum
  63. } from "@/api/iosBasicData/paymentSummary"
  64. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  65. import { getWorkDicts } from "@/api/system/dictbiz";
  66. import { getDeptLazyTree } from "@/api/system/dept";
  67. import { getList as userGetList } from '@/api/system/user'
  68. import { getToken } from "@/util/auth";
  69. export default {
  70. components: { SearchQuery },
  71. data() {
  72. return {
  73. form: {},
  74. loading: true,
  75. page: {
  76. pageSize: 10,
  77. currentPage: 1,
  78. total: 0
  79. },
  80. query: {
  81. dc: 'D',
  82. isBusinessDate: 1,
  83. isToExamineDate: 0,
  84. etdStart: defaultDate3()[0],
  85. etdEnd: defaultDate3()[1],
  86. },
  87. option: {},
  88. optionBack: {
  89. height: 'auto',
  90. calcHeight: 30,
  91. tip: false,
  92. searchShow: true,
  93. searchMenuSpan: 14,
  94. border: true,
  95. index: false,
  96. selection: true,
  97. dialogClickModal: false,
  98. menu: false,
  99. addBtn: false,
  100. viewBtn: false,
  101. delBtn: false,
  102. editBtn: false,
  103. searchIcon: true,
  104. searchIndex: 3,
  105. emptyBtnText: '清空所有条件',
  106. column: [
  107. {
  108. label: "业务类型",
  109. prop: "businessType",
  110. type: 'select',
  111. dicUrl: "/api/blade-system/dict-biz/dictionary?code=audit_status_los",
  112. props: {
  113. label: 'dictValue',
  114. value: 'dictKey',
  115. },
  116. overHidden: true,
  117. },
  118. {
  119. label: "结算单位",
  120. prop: "corpName",
  121. overHidden: true,
  122. },
  123. {
  124. label: "业务编号",
  125. prop: "billNo",
  126. search: true,
  127. overHidden: true,
  128. },
  129. {
  130. label: "提单号",
  131. prop: "mblNo",
  132. search: true,
  133. overHidden: true,
  134. },
  135. {
  136. label: "船名",
  137. prop: "vesselName",
  138. overHidden: true,
  139. },
  140. {
  141. label: "航次",
  142. prop: "voyageNo",
  143. overHidden: true,
  144. },
  145. {
  146. label: "开船日期",
  147. prop: "etd",
  148. overHidden: true,
  149. },
  150. {
  151. label: "提单号",
  152. prop: "mblNo",
  153. overHidden: true,
  154. },
  155. {
  156. label: "起运港",
  157. prop: "pol",
  158. overHidden: true,
  159. },
  160. {
  161. label: "目的港",
  162. prop: "pod",
  163. overHidden: true,
  164. },
  165. {
  166. label: "箱型箱量",
  167. prop: "quantityCntrDescr",
  168. overHidden: true,
  169. },
  170. {
  171. label: "美元",
  172. prop: "amountUsdNot",
  173. overHidden: true,
  174. },
  175. {
  176. label: "人民币",
  177. prop: "amountNot",
  178. overHidden: true,
  179. },
  180. {
  181. label: "开票USD",
  182. prop: "amountInvoicingUsd",
  183. overHidden: true,
  184. },
  185. {
  186. label: "开票CNY",
  187. prop: "amountInvoicing",
  188. overHidden: true,
  189. },
  190. {
  191. label: "未开USD",
  192. prop: "amountInvoicingUsdNot",
  193. overHidden: true,
  194. },
  195. {
  196. label: "未开CNY",
  197. prop: "amountInvoicingNot",
  198. overHidden: true,
  199. },
  200. {
  201. label: "业务员",
  202. prop: "srcCnName",
  203. overHidden: true,
  204. },
  205. {
  206. label: "操作员",
  207. prop: "operatorName",
  208. overHidden: true,
  209. },
  210. {
  211. label: "业务类型",
  212. prop: "businessType",
  213. hide: true,
  214. search: true,
  215. searchslot: true,
  216. },
  217. {
  218. label: "委托人",
  219. prop: "clientId",
  220. hide: true,
  221. search: true,
  222. searchslot: true,
  223. },
  224. {
  225. label: "结算单位",
  226. prop: "corpId",
  227. hide: true,
  228. search: true,
  229. searchslot: true,
  230. },
  231. {
  232. label: "业务员",
  233. prop: "srcId",
  234. hide: true,
  235. search: true,
  236. searchslot: true,
  237. },
  238. {
  239. label: "统计开始",
  240. prop: "etdStart",
  241. search: true,
  242. overHidden: true,
  243. hide: true,
  244. type: "date",
  245. format: "yyyy-MM-dd",
  246. valueFormat: "yyyy-MM-dd",
  247. },
  248. {
  249. label: "统计结束",
  250. prop: "etdEnd",
  251. search: true,
  252. overHidden: true,
  253. hide: true,
  254. type: "date",
  255. format: "yyyy-MM-dd",
  256. valueFormat: "yyyy-MM-dd",
  257. },
  258. {
  259. label: "",
  260. prop: "dc",
  261. hide: true,
  262. search: true,
  263. searchslot: true,
  264. searchSpan: 4,
  265. searchLabelWidth: '0'
  266. },
  267. {
  268. label: "",
  269. prop: "isBusinessDate",
  270. hide: true,
  271. search: true,
  272. searchslot: true,
  273. searchLabelWidth: '0'
  274. },
  275. {
  276. label: "",
  277. prop: "isToExamineDate",
  278. hide: true,
  279. searchLabelWidth: '0',
  280. },
  281. ]
  282. },
  283. data: [],
  284. // 查询方式
  285. typeData: [
  286. {
  287. label: '结算单位',
  288. value: '1'
  289. }, {
  290. label: '委托人',
  291. value: '2'
  292. }, {
  293. label: '业务来源',
  294. value: '3'
  295. }
  296. ],
  297. // 业务类型
  298. businessTypeData: [],
  299. clientIdData: [], // 委托人
  300. corpIdData: [], // 结算单位
  301. srcIdData: [], // 业务员
  302. commodityData: [], // 合计数据
  303. // 合计的配置项
  304. commodityLabel: [
  305. {
  306. id: 1,
  307. label: "美元",
  308. prop: "amountUsdNot",
  309. },
  310. {
  311. id: 2,
  312. label: "人民币",
  313. prop: "amountNot",
  314. },
  315. {
  316. id: 3,
  317. label: "开票USD",
  318. prop: "amountInvoicingUsd",
  319. },
  320. {
  321. id: 4,
  322. label: "开票CNY",
  323. prop: "amountInvoicing",
  324. },
  325. {
  326. id: 5,
  327. label: "未开USD",
  328. prop: "amountInvoicingUsdNot",
  329. },
  330. {
  331. id: 6,
  332. label: "未开CNY",
  333. prop: "amountInvoicingNot",
  334. },
  335. ],
  336. }
  337. },
  338. async created() {
  339. this.option = await this.getColumnData(this.getColumnName(334), this.optionBack);
  340. this.query = {
  341. dc: 'D',
  342. isBusinessDate: 1,
  343. isToExamineDate: 0,
  344. etdStart: defaultDate3()[0],
  345. etdEnd: defaultDate3()[1],
  346. }
  347. },
  348. methods: {
  349. // 导出
  350. exportfun() {
  351. const routeData = this.$router.resolve({
  352. path: '/api/blade-los/financeStatistics/feeSummaryDetailExportNot',//跳转目标窗口的地址
  353. query: {
  354. ...this.query
  355. }
  356. })
  357. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  358. },
  359. // 下拉监听
  360. corpChange(value, name) {
  361. if (name == 'corpName') {
  362. for (let item of this.corpIdData) {
  363. if (item.cnName == value) {
  364. this.$set(this.query, 'corpId', item.id)
  365. this.$set(this.query, 'corpName', item.cnName)
  366. }
  367. }
  368. } else if (name == 'clientName') {
  369. for (let item of this.clientIdData) {
  370. if (item.cnName == value) {
  371. this.$set(this.query, 'clientId', item.id)
  372. this.$set(this.query, 'clientName', item.cnName)
  373. }
  374. }
  375. } else if (name == 'srcName') {
  376. for (let item of this.srcIdData) {
  377. if (item.name == value) {
  378. // 业务员
  379. this.$set(this.query, 'srcId', item.id)
  380. this.$set(this.query, 'srcName', item.name)
  381. }
  382. }
  383. }
  384. this.$set(this.query, name, value)
  385. },
  386. // 业务员下拉
  387. srcCorpFocus(value, name) {
  388. this.salesUserGetListfun(value)
  389. },
  390. // 多选切换
  391. dateChange(name) {
  392. if (name == 'isBusinessDate') {
  393. this.$set(this.query, 'isToExamineDate', 0)
  394. this.$set(this.query, 'isBusinessDate', 1)
  395. }
  396. if (name == 'isToExamineDate') {
  397. this.$set(this.query, 'isBusinessDate', 0)
  398. this.$set(this.query, 'isToExamineDate', 1)
  399. }
  400. this.page.currentPage = 1;
  401. this.onLoad(this.page, this.query);
  402. },
  403. // 收付单选
  404. dcInput() {
  405. let dcName = ''
  406. if (this.query.dc == 'D') {
  407. dcName = '收'
  408. } else {
  409. dcName = '付'
  410. }
  411. this.findObject(this.option.column, "amountUsd").label = `应${dcName}美金`
  412. this.findObject(this.option.column, "amount").label = `应${dcName}人民币`
  413. this.findObject(this.option.column, "amountUsdAlready").label = `已${dcName}款美金`
  414. this.findObject(this.option.column, "amountAlready").label = `已${dcName}款人民币`
  415. this.findObject(this.option.column, "amountUsdNot").label = `未${dcName}款美金`
  416. this.findObject(this.option.column, "amountNot").label = `未${dcName}款人民币`
  417. this.page.currentPage = 1;
  418. this.onLoad(this.page, this.query);
  419. },
  420. // 接口获取数据
  421. // 结算单位
  422. getBcorpsListfun(cnName) {
  423. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  424. this.corpIdData = res.data.data.records
  425. })
  426. },
  427. // 业务类型
  428. businessTypeFocus() {
  429. getWorkDicts('profit_business_type_los').then(res => {
  430. this.businessTypeData = res.data.data
  431. })
  432. },
  433. // 委托人
  434. clientIdListfun(cnName) {
  435. getBcorpsList(1, 10, { cnName, status: 0 }).then(res => {
  436. this.clientIdData = res.data.data.records
  437. })
  438. },
  439. // 获取业务来源数据
  440. srcTypeWorkDictsfun() {
  441. getWorkDicts('src_type_los').then(res => {
  442. this.srcTypeData = res.data.data
  443. })
  444. },
  445. // 获取公司名称 用户管理左侧
  446. ownDeptLazyTreefun() {
  447. getDeptLazyTree(0).then(res => {
  448. this.srcIdData = res.data.data
  449. })
  450. },
  451. // 获取业务来源代理数据
  452. agentBcorpsListfun(cnName) {
  453. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  454. getBcorpslistByType(1, 10, { cnName, status: 0, corpTypeName }).then(res => {
  455. this.srcIdData = res.data.data.records
  456. })
  457. },
  458. // 获取业务来源业务员数据
  459. salesUserGetListfun(account) {
  460. userGetList(1, 10, { account }).then(res => {
  461. this.srcIdData = res.data.data.records
  462. })
  463. },
  464. // 清空搜索回调方法
  465. searchReset() {
  466. this.query = {
  467. dc: 'D',
  468. isBusinessDate: 1,
  469. isToExamineDate: 0,
  470. etdStart: null,
  471. etdEnd: null,
  472. };
  473. this.onLoad(this.page);
  474. },
  475. // 搜索
  476. searchChange(params, done) {
  477. this.page.currentPage = 1;
  478. this.onLoad(this.page, this.query);
  479. done();
  480. },
  481. currentChange(currentPage) {
  482. this.page.currentPage = currentPage;
  483. },
  484. sizeChange(pageSize) {
  485. this.page.pageSize = pageSize;
  486. },
  487. refreshChange() {
  488. this.onLoad(this.page, this.query);
  489. },
  490. onLoad(page, params = {}) {
  491. this.loading = true;
  492. financeStatisticsFeeSummaryDetailNot(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  493. const data = res.data.data;
  494. this.page.total = data.total;
  495. this.data = data.records;
  496. this.loading = false;
  497. financeStatisticsFeeSummaryDetailNotSum(Object.assign(params, this.query)).then(re => {
  498. this.commodityData = [re.data.data]
  499. })
  500. this.$nextTick(() => {
  501. this.$refs.crud.doLayout();
  502. this.$refs.crud.dicInit();
  503. });
  504. this.selectionClear();
  505. });
  506. },
  507. selectionClear() {
  508. this.$refs.crud.toggleSelection();
  509. },
  510. //自定义列保存
  511. async saveColumnTwo(ref, option, optionBack, code) {
  512. /**
  513. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  514. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  515. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  516. */
  517. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  518. if (inSave) {
  519. this.$message.success("保存成功");
  520. //关闭窗口
  521. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  522. }
  523. },
  524. //自定义列重置
  525. async resetColumnTwo(ref, option, optionBack, code) {
  526. this[option] = this[optionBack];
  527. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  528. if (inSave) {
  529. this.$message.success("重置成功");
  530. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  531. this.query = {
  532. dc: 'D',
  533. isBusinessDate: 1,
  534. isToExamineDate: 0,
  535. etdStart: defaultDate3()[0],
  536. etdEnd: defaultDate3()[1],
  537. }
  538. }
  539. },
  540. // 更改表格颜色
  541. headerClassName(tab) {
  542. //颜色间隔
  543. let back = ""
  544. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  545. if (tab.columnIndex % 2 === 0) {
  546. back = "back-one"
  547. } else if (tab.columnIndex % 2 === 1) {
  548. back = "back-two"
  549. }
  550. }
  551. return back;
  552. },
  553. }
  554. }
  555. </script>
  556. <style scoped>
  557. ::v-deep#out-table .back-one {
  558. background: #ecf5ff !important;
  559. text-align: center;
  560. }
  561. ::v-deep#out-table .back-two {
  562. background: #ecf5ff !important;
  563. text-align: center;
  564. }
  565. ::v-deep .el-col-md-8 {
  566. width: 24.33333%;
  567. }
  568. </style>