index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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: 24,
  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. column:[
  144. {
  145. label: "结算单位",
  146. prop: "corpName",
  147. overHidden:true,
  148. },
  149. {
  150. label: "业务编号",
  151. prop: "billNo",
  152. overHidden:true,
  153. },
  154. {
  155. label: "船名",
  156. prop: "vesselName",
  157. overHidden:true,
  158. },
  159. {
  160. label: "航次",
  161. prop: "voyageNo",
  162. overHidden:true,
  163. },
  164. {
  165. label: "开船日期",
  166. prop: "etd",
  167. overHidden:true,
  168. },
  169. {
  170. label: "提单号",
  171. prop: "mblNo",
  172. overHidden:true,
  173. },
  174. {
  175. label: "起运港",
  176. prop: "pod",
  177. overHidden:true,
  178. },
  179. {
  180. label: "目的港",
  181. prop: "pol",
  182. overHidden:true,
  183. },
  184. {
  185. label: "汇率",
  186. prop: "rate",
  187. overHidden:true,
  188. },
  189. {
  190. label: "箱型箱量",
  191. prop: "quantityCntrDescr",
  192. overHidden:true,
  193. },
  194. {
  195. label: "美元",
  196. prop: "amountUsdNot",
  197. overHidden:true,
  198. },
  199. {
  200. label: "人民币",
  201. prop: "amountNot",
  202. overHidden:true,
  203. },
  204. {
  205. label: "开票USD",
  206. prop: "amountInvoicingUsd",
  207. overHidden:true,
  208. },
  209. {
  210. label: "开票CNY",
  211. prop: "amountInvoicing",
  212. overHidden:true,
  213. },
  214. {
  215. label: "未开USD",
  216. prop: "amountInvoicingUsdNot",
  217. overHidden:true,
  218. },
  219. {
  220. label: "未开CNY",
  221. prop: "amountInvoicingNot",
  222. overHidden:true,
  223. },
  224. {
  225. label: "业务员",
  226. prop: "srcCnName",
  227. overHidden:true,
  228. },
  229. {
  230. label: "操作员",
  231. prop: "operatorName",
  232. overHidden:true,
  233. },
  234. {
  235. label: "业务类型",
  236. prop: "businessType",
  237. hide:true,
  238. search:true,
  239. searchslot:true,
  240. },
  241. {
  242. label: "委托人",
  243. prop: "clientId",
  244. hide:true,
  245. search:true,
  246. searchslot:true,
  247. },
  248. {
  249. label: "结算单位",
  250. prop: "corpId",
  251. hide:true,
  252. search:true,
  253. searchslot:true,
  254. },
  255. {
  256. label: "业务员",
  257. prop: "srcId",
  258. hide:true,
  259. search:true,
  260. searchslot:true,
  261. },
  262. {
  263. label: "ETD",
  264. prop: "etdStart",
  265. search:true,
  266. overHidden:true,
  267. hide:true,
  268. type: "date",
  269. format: "yyyy-MM-dd",
  270. valueFormat: "yyyy-MM-dd",
  271. },
  272. {
  273. label: "ETA",
  274. prop: "etdEnd",
  275. search:true,
  276. overHidden:true,
  277. hide:true,
  278. type: "date",
  279. format: "yyyy-MM-dd",
  280. valueFormat: "yyyy-MM-dd",
  281. },
  282. {
  283. label: "",
  284. prop: "dc",
  285. hide:true,
  286. search:true,
  287. searchslot:true,
  288. searchSpan:4,
  289. searchLabelWidth:'0'
  290. },
  291. {
  292. label: "",
  293. prop: "isBusinessDate",
  294. hide:true,
  295. search:true,
  296. searchslot:true,
  297. searchLabelWidth:'0'
  298. },
  299. {
  300. label: "",
  301. prop: "isToExamineDate",
  302. hide:true,
  303. searchLabelWidth:'0',
  304. },
  305. ]
  306. },
  307. data:[],
  308. // 查询方式
  309. typeData:[
  310. {
  311. label:'结算单位',
  312. value:'1'
  313. },{
  314. label:'委托人',
  315. value:'2'
  316. },{
  317. label:'业务来源',
  318. value:'3'
  319. }
  320. ],
  321. // 业务类型
  322. businessTypeData:[],
  323. clientIdData:[], // 委托人
  324. corpIdData:[], // 结算单位
  325. srcIdData:[], // 业务员
  326. commodityData:[], // 合计数据
  327. // 合计的配置项
  328. commodityLabel:[
  329. {
  330. id:1,
  331. label: "美元",
  332. prop: "amountUsdNot",
  333. },
  334. {
  335. id:2,
  336. label: "人民币",
  337. prop: "amountNot",
  338. },
  339. {
  340. id:3,
  341. label: "开票USD",
  342. prop: "amountInvoicingUsd",
  343. },
  344. {
  345. id:4,
  346. label: "开票CNY",
  347. prop: "amountInvoicing",
  348. },
  349. {
  350. id:5,
  351. label: "未开USD",
  352. prop: "amountInvoicingUsdNot",
  353. },
  354. {
  355. id:6,
  356. label: "未开CNY",
  357. prop: "amountInvoicingNot",
  358. },
  359. ],
  360. }
  361. },
  362. async created() {
  363. this.option = await this.getColumnData(this.getColumnName(334), this.optionBack);
  364. },
  365. methods:{
  366. // 导出
  367. exportfun(){
  368. const routeData = this.$router.resolve({
  369. path: '/api/blade-los/financeStatistics/feeSummaryDetailExportNot',//跳转目标窗口的地址
  370. query: {
  371. ...this.query
  372. }
  373. })
  374. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  375. },
  376. // 下拉监听
  377. corpChange(value,name){
  378. if (name == 'corpName') {
  379. for (let item of this.corpIdData) {
  380. if (item.cnName == value) {
  381. this.$set(this.query,'corpId',item.corpId)
  382. this.$set(this.query,'corpName',item.corpName)
  383. }
  384. }
  385. } else if (name == 'clientName') {
  386. for (let item of this.clientIdData) {
  387. if (item.cnName == value) {
  388. this.$set(this.query,'clientId',item.corpId)
  389. this.$set(this.query,'clientName',item.corpName)
  390. }
  391. }
  392. }else if (name == 'srcName') {
  393. for (let item of this.srcIdData) {
  394. if (item.name == value) {
  395. // 业务员
  396. this.$set(this.query,'srcId',item.id)
  397. this.$set(this.query,'srcName',item.name)
  398. }
  399. }
  400. }
  401. this.$set(this.query,name,value)
  402. },
  403. // 业务员下拉
  404. srcCorpFocus(value,name){
  405. this.salesUserGetListfun(value)
  406. },
  407. // 多选切换
  408. dateChange(name) {
  409. if (name == 'isBusinessDate') {
  410. this.$set(this.query,'isToExamineDate',0)
  411. this.$set(this.query,'isBusinessDate',1)
  412. }
  413. if (name == 'isToExamineDate') {
  414. this.$set(this.query,'isBusinessDate',0)
  415. this.$set(this.query,'isToExamineDate',1)
  416. }
  417. this.page.currentPage = 1;
  418. this.onLoad(this.page, this.query);
  419. },
  420. // 收付单选
  421. dcInput(){
  422. let dcName = ''
  423. if (this.query.dc == 'D') {
  424. dcName = '收'
  425. }else {
  426. dcName = '付'
  427. }
  428. this.findObject(this.option.column, "amountUsd").label = `应${dcName}美金`
  429. this.findObject(this.option.column, "amount").label = `应${dcName}人民币`
  430. this.findObject(this.option.column, "amountUsdAlready").label = `已${dcName}款美金`
  431. this.findObject(this.option.column, "amountAlready").label = `已${dcName}款人民币`
  432. this.findObject(this.option.column, "amountUsdNot").label = `未${dcName}款美金`
  433. this.findObject(this.option.column, "amountNot").label = `未${dcName}款人民币`
  434. this.page.currentPage = 1;
  435. this.onLoad(this.page, this.query);
  436. },
  437. // 接口获取数据
  438. // 结算单位
  439. getBcorpsListfun(cnName){
  440. getBcorpsList(1,10,{cnName,status: 0}).then(res=>{
  441. this.corpIdData = res.data.data.records
  442. })
  443. },
  444. // 业务类型
  445. businessTypeFocus(){
  446. getWorkDicts('profit_business_type_los').then(res=>{
  447. this.businessTypeData = res.data.data
  448. })
  449. },
  450. // 委托人
  451. clientIdListfun(cnName){
  452. getBcorpsList(1,10,{cnName,status: 0}).then(res=>{
  453. this.clientIdData = res.data.data.records
  454. })
  455. },
  456. // 获取业务来源数据
  457. srcTypeWorkDictsfun(){
  458. getWorkDicts('src_type_los').then(res=>{
  459. this.srcTypeData = res.data.data
  460. })
  461. },
  462. // 获取公司名称 用户管理左侧
  463. ownDeptLazyTreefun(){
  464. getDeptLazyTree(0).then(res=>{
  465. this.srcIdData = res.data.data
  466. })
  467. },
  468. // 获取业务来源代理数据
  469. agentBcorpsListfun(cnName){
  470. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  471. getBcorpslistByType(1,10,{cnName,status: 0,corpTypeName}).then(res=>{
  472. this.srcIdData = res.data.data.records
  473. })
  474. },
  475. // 获取业务来源业务员数据
  476. salesUserGetListfun(account){
  477. userGetList(1,10,{account}).then(res=>{
  478. this.srcIdData = res.data.data.records
  479. })
  480. },
  481. // 清空搜索回调方法
  482. searchReset() {
  483. this.query = {
  484. dc:'D',
  485. isBusinessDate:1,
  486. isToExamineDate:0,
  487. etdStart:defaultDate3()[0],
  488. etdEnd:defaultDate3()[1],
  489. };
  490. this.onLoad(this.page);
  491. },
  492. // 搜索
  493. searchChange(params, done) {
  494. this.query = params;
  495. this.page.currentPage = 1;
  496. this.onLoad(this.page, params);
  497. done();
  498. },
  499. currentChange(currentPage){
  500. this.page.currentPage = currentPage;
  501. },
  502. sizeChange(pageSize){
  503. this.page.pageSize = pageSize;
  504. },
  505. refreshChange() {
  506. this.onLoad(this.page, this.query);
  507. },
  508. onLoad(page, params = {}) {
  509. this.loading = true;
  510. financeStatisticsFeeSummaryDetailNot(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  511. const data = res.data.data;
  512. this.page.total = data.total;
  513. this.data = data.records;
  514. this.loading = false;
  515. financeStatisticsFeeSummaryDetailNotSum(Object.assign(params, this.query)).then(re=>{
  516. this.commodityData = [re.data.data]
  517. })
  518. this.selectionClear();
  519. });
  520. },
  521. selectionClear() {
  522. this.$refs.crud.toggleSelection();
  523. },
  524. //自定义列保存
  525. async saveColumnTwo(ref, option, optionBack, code) {
  526. /**
  527. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  528. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  529. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  530. */
  531. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  532. if (inSave) {
  533. this.$message.success("保存成功");
  534. //关闭窗口
  535. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  536. }
  537. },
  538. //自定义列重置
  539. async resetColumnTwo(ref, option, optionBack, code) {
  540. this[option] = this[optionBack];
  541. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  542. if (inSave) {
  543. this.$message.success("重置成功");
  544. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  545. }
  546. },
  547. // 更改表格颜色
  548. headerClassName(tab){
  549. //颜色间隔
  550. let back = ""
  551. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  552. if (tab.columnIndex % 2 === 0) {
  553. back = "back-one"
  554. } else if (tab.columnIndex % 2 === 1) {
  555. back = "back-two"
  556. }
  557. }
  558. return back;
  559. },
  560. }
  561. }
  562. </script>
  563. <style scoped>
  564. ::v-deep#out-table .back-one {
  565. background: #ecf5ff !important;
  566. text-align: center;
  567. }
  568. ::v-deep#out-table .back-two {
  569. background: #ecf5ff !important;
  570. text-align: center;
  571. }
  572. </style>