index.vue 23 KB

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