index.vue 20 KB

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