index.vue 20 KB

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