index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <template>
  2. <view>
  3. <u-navbar :is-back="false">
  4. <view class="navbar">
  5. <view class="navbar-tit" >分润记录</view>
  6. <view class="navbar-screen" @click="popupShow = true"><span>筛选</span><u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon></view>
  7. </view>
  8. </u-navbar>
  9. <u-popup v-model="popupShow" mode="top" height="80%">
  10. <view class="popup-screen">
  11. <view class="screen">
  12. <view class="screen-item">
  13. <view class="screen-head">查询日期</view>
  14. <view class="screen-main2">
  15. <u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
  16. <u-input :value="queryDate?queryDate:'选择时间筛选'" :type="type" :border="border" @click="showdate = true" />
  17. <!--
  18. <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
  19. --></view>
  20. </view>
  21. <view class="screen-item">
  22. <view class="screen-head">充电桩类型</view>
  23. <view class="screen-main">
  24. <view
  25. :class="{
  26. active:selecttype==''
  27. }" @click="selecttype=''"
  28. class="screen-entry ">全部</view>
  29. <view
  30. :class="{
  31. active:selecttype=='0'
  32. }" @click="selecttype='0'"
  33. class="screen-entry type1">自行车充电</view>
  34. <view
  35. :class="{
  36. active:selecttype=='2'
  37. }" @click="selecttype='2'"
  38. class="screen-entry type3">交流慢充</view>
  39. <view
  40. :class="{
  41. active:selecttype=='1'
  42. }" @click="selecttype='1'"
  43. class="screen-entry type2">直流快充</view>
  44. </view>
  45. </view>
  46. <view class="screen-item">
  47. <view class="screen-head">站点</view>
  48. <view class="screen-main">
  49. <view class="screen-entry "
  50. :class="{
  51. active:selectstationId==''
  52. }"
  53. @click="selectstationId=''"
  54. >全部</view>
  55. <view
  56. v-for="(item,i) in stationList" :key="i"
  57. :class="{
  58. active:selectstationId==item.id
  59. }"
  60. @click="selectstationId=item.id,selectdeviceNo=''"
  61. class="screen-entry" >{{item.name}}</view>
  62. </view>
  63. </view>
  64. <view
  65. class="screen-item">
  66. <view class="screen-head">桩号</view>
  67. <view class="screen-main">
  68. <view class="screen-entry "
  69. :class="{
  70. active:selectdeviceNo==''
  71. }"
  72. @click="selectdeviceNo=''"
  73. >全部</view>
  74. <view
  75. v-for="(item,i) in stationListSon" :key="i"
  76. v-show="selectstationId?(selectstationId==item.stationId):true"
  77. :class="{
  78. active:selectdeviceNo==item.deviceNo
  79. }"
  80. @click="selectdeviceNo=item.deviceNo"
  81. class="screen-entry" >{{item.name}}</view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="screen-foot">
  86. <view class="screen-btn-l"
  87. @click="resetBtn" >重置</view>
  88. <view class="screen-btn-r" @click="okbtn" >确定</view>
  89. </view>
  90. </view>
  91. </u-popup>
  92. <view class="detailed">
  93. <view style="text-align: center;margin-top: 100px" v-if="!list.length">
  94. <img src="@/assets/img/blankpage.png">
  95. <view>查询为空</view>
  96. </view>
  97. <view class="detailed-list" v-for="(item ,index) in list"
  98. @click="gotoUrl('pagesFinance/share/details?id='+item.id)"
  99. :key="index">
  100. <view class="detailed-time" v-if="item.show">
  101. <p>{{item.showtime}}</p>
  102. <p>共收{{showMap.get(item.showtime).num}}笔,{{showMap.get(item.showtime).amount}}元</p>
  103. </view>
  104. <view class="detailed-item">
  105. <view class="detailed-item-name" style="
  106. width: 70%;
  107. ">
  108. <h2 class="showName">{{item.stationName}}/{{item.deviceName}}</h2>
  109. <p>{{item.flowNo?item.flowNo:'无充电单号'}}</p>
  110. </view>
  111. <view class="detailed-item-name" style="
  112. min-width: 60px;
  113. width: 30%;
  114. ">
  115. <h2 style=" text-align: end;">{{item.shareProfitAmount}}元</h2>
  116. <p style=" text-align: end;" >{{item.createTime?item.createTime.slice(10):''}}</p>
  117. </view>
  118. </view>
  119. <view class="product_tip" v-if="item.status=='1'">
  120. <view class="product_tip_bg"></view>
  121. <p>已提现</p>
  122. </view>
  123. </view>
  124. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f4f0f0">已经到底了</u-divider>
  125. </view>
  126. <Tabbar ref="tabbarMain" :current="2"></Tabbar>
  127. </view>
  128. </template>
  129. <script>
  130. import Tabbar from '@/components/TabbarFinance.vue'
  131. import * as API from '@/apis/finance.js'
  132. import {
  133. currentTimeStamp,
  134. parseUnixTime
  135. } from '@/utils'
  136. export default {
  137. data() {
  138. return {
  139. showdate: false,
  140. startTime: "",
  141. queryDate:"",
  142. endTime: "",
  143. selecttype:"",
  144. selectstationId:"",
  145. selectdeviceNo:"",
  146. title:"",
  147. year:"",
  148. startyear:"",
  149. endyear:"",
  150. params: {
  151. year: true,
  152. month: false,
  153. day: false,
  154. hour: false,
  155. minute: false,
  156. second: false,
  157. // timestamp: true,
  158. },
  159. form:{
  160. },
  161. pageIndex: 1,
  162. recordsTotal: 0,
  163. list: [],
  164. popupShow: false,
  165. tabbarList: [{
  166. iconPath: "bar-chart-box-fill",
  167. selectedIconPath: "bar-chart-box-fill",
  168. text: '统计',
  169. count: 0,
  170. isDot: true,
  171. customIcon: true,
  172. },
  173. {
  174. iconPath: "article-fill",
  175. selectedIconPath: "article-fill",
  176. text: '明细',
  177. midButton: true,
  178. customIcon: true,
  179. },
  180. {
  181. iconPath: "account-pin-box-fill",
  182. selectedIconPath: "account-pin-box-fill",
  183. text: '我的',
  184. count: 0,
  185. isDot: false,
  186. customIcon: true,
  187. },
  188. ],
  189. showMap:null,
  190. current: 0,
  191. value: '',
  192. type: 'select',
  193. show: false,
  194. border: true,
  195. stationList:[],
  196. stationListSon:[],
  197. actionSheetList: [
  198. {
  199. text: '男'
  200. },
  201. {
  202. text: '女'
  203. },
  204. {
  205. text: '保密'
  206. }
  207. ],
  208. }
  209. },
  210. components: {
  211. Tabbar
  212. },
  213. onShow(){
  214. if(this.$refs.tabbarMain){
  215. this.$refs.tabbarMain.setcount(2);
  216. }
  217. },
  218. onReachBottom() {
  219. if (this.list.length < this.recordsTotal) {
  220. this.myLoadmore();
  221. }
  222. },
  223. onLoad() {
  224. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  225. this.startyear=new Date().getFullYear()
  226. console.log(this.startyear)
  227. this.endyear=this.startyear-3
  228. console.log(this.endyear)
  229. },
  230. onReady() {
  231. this.getList()
  232. this.getStation()
  233. },
  234. methods: {
  235. showDateMoth(date){
  236. var back=date;
  237. if(date){
  238. var k= date.slice(5,6)
  239. console.log(k)
  240. if(k=='0'){
  241. back= date.slice(6,7)
  242. }else{
  243. back= date.slice(5,7)
  244. }
  245. }
  246. return back;
  247. },
  248. changedate(e) {
  249. console.log(e)
  250. this.queryDate=e.result
  251. },
  252. resetBtn(){
  253. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  254. this.year=""
  255. this.startTime=""
  256. this.endTime=""
  257. this.selecttype=""
  258. this.selectstationId=""
  259. this.selectdeviceNo=""
  260. this.pageIndex = 1;
  261. this.form = {
  262. queryDate:"",
  263. pageIndex: this.pageIndex,
  264. type:this.selecttype,
  265. stationId:this.selectstationId,
  266. deviceNo:this.selectdeviceNo,
  267. };
  268. this.popupShow=false;
  269. this.list = [];
  270. this.getList()
  271. },
  272. okbtn(){
  273. this.popupShow=false;
  274. this.pageIndex = 1;
  275. this.form = {
  276. queryDate:this.queryDate,
  277. pageIndex: this.pageIndex,
  278. type:this.selecttype,
  279. stationId:this.selectstationId,
  280. deviceNo:this.selectdeviceNo,
  281. };
  282. this.list = [];
  283. this.getList()
  284. },
  285. getList() {
  286. uni.showLoading({
  287. title: "加载中",
  288. mask: true,
  289. })
  290. this.form.pageIndex=this.pageIndex
  291. this.form.pageSize=20
  292. API.recordData(this.form).then((res) => {
  293. this.list = [
  294. ...this.list,
  295. ...res.data.data
  296. ];
  297. var showMap=new Map()
  298. this.list.forEach(item=>{
  299. var ktime=item.createTime.split(" ")[0]
  300. if(showMap.has(ktime)){
  301. item.show=false;
  302. }else{
  303. var Amount=item.todaySPAmount
  304. var num=item.todaySPNum
  305. showMap.set(ktime,{
  306. amount:Amount,
  307. num:num
  308. })
  309. item.show=true;
  310. item.showtime=ktime;
  311. }
  312. })
  313. this.showMap=showMap;
  314. this.recordsTotal = res.data.recordsTotal
  315. uni.hideLoading()
  316. }).catch(error => {
  317. uni.showToast({
  318. title: error
  319. })
  320. })
  321. },
  322. getStation(bl) {
  323. API.stationList().then((res) => {
  324. this.stationList = res.data.stationList
  325. this.stationListSon=res.data.deviceList
  326. }).catch(error => {
  327. uni.showToast({
  328. title: error
  329. })
  330. })
  331. },
  332. myLoadmore() {
  333. this.pageIndex += 1;
  334. this.getList()
  335. },
  336. // 点击actionSheet回调
  337. actionSheetCallback(index) {
  338. this.value = this.actionSheetList[index].text;
  339. }
  340. }
  341. }
  342. </script>
  343. <style>
  344. page{
  345. background-color: #F7F7F7;
  346. }
  347. </style>
  348. <style lang="scss" scoped>
  349. .product_tip{
  350. position: relative;
  351. top: -75px;
  352. right: 0;
  353. text-align: right;
  354. p{
  355. font-size: 24rpx;
  356. color: #ffffff;
  357. transform: rotate(45deg);
  358. position: absolute;
  359. top: 10rpx;
  360. right: 0rpx;
  361. }
  362. .product_tip_bg{
  363. width: 0;
  364. height: 0;
  365. border-bottom: 52rpx solid #53b56d;
  366. border-right: 52rpx solid transparent;
  367. border-left: 52rpx solid transparent;
  368. transform: rotate(45deg);
  369. position: absolute;
  370. top: -7rpx;
  371. right: -29rpx;
  372. }
  373. }
  374. .popup-screen{
  375. padding: 20px;
  376. position: relative;
  377. .screen{
  378. padding-bottom: 30px;
  379. }
  380. .screen-item{
  381. margin-bottom: 20px;
  382. .screen-head{
  383. margin-bottom: 8px;
  384. font-size: 16px;
  385. }
  386. .screen-main{
  387. // display: -webkit-box;
  388. display: flex;
  389. flex-wrap: wrap;
  390. }
  391. .screen-entry{
  392. width: 29%;
  393. padding:6px 0;
  394. display: flex;
  395. align-items: center;
  396. justify-content: center;
  397. background-color: #F2F5FA ;
  398. text-align: center;
  399. margin-bottom: 10px;
  400. border-radius: 3px;
  401. margin-right: 6px;
  402. }
  403. .screen-entry.active{
  404. background-color: #185AC6;
  405. color:#fff;
  406. }
  407. }
  408. .screen-foot{
  409. position: fixed;
  410. left: 0;
  411. right: 0;
  412. bottom: 0;
  413. display: flex;
  414. height:50px;
  415. border-top: 1px solid #ededed;
  416. .screen-btn-l{
  417. background-color: #fff;
  418. flex: 0.2;
  419. text-align: center;
  420. line-height: 50px;
  421. }
  422. .screen-btn-r{
  423. flex: 0.8;
  424. text-align: center;
  425. line-height: 50px;
  426. background-color: #185AC6;
  427. color:#fff;
  428. }
  429. }
  430. }
  431. .navbar{
  432. display: flex;
  433. justify-content: space-between;
  434. flex: 1;
  435. padding: 0 15px;
  436. }
  437. .navbar-tit{
  438. font-size: 20px;
  439. }
  440. .navbar-screen{
  441. display: flex;
  442. align-items: center;
  443. span{
  444. margin-right: 2px;
  445. color:#999;
  446. }
  447. }
  448. .detailed-time{
  449. display: flex;
  450. justify-content: space-between;
  451. align-items: center;
  452. padding: 10px 20px;
  453. font-size: 16px;
  454. p{
  455. color:#666;
  456. }
  457. }
  458. .detailed-item{
  459. background-color: #fff;
  460. display: flex;
  461. justify-content: space-between;
  462. padding: 10px 20px;
  463. border-bottom: 1px solid #ededed;
  464. .detailed-item-name{
  465. h4{
  466. font-weight: normal;
  467. }
  468. p{
  469. font-size: 15px;
  470. margin-top: 4px;
  471. color:#A2A9B5;
  472. }
  473. }
  474. .detailed-item-num{
  475. display: flex;
  476. align-items: center;
  477. h2{
  478. margin-right: 4px;
  479. }
  480. }
  481. }
  482. .showName{
  483. font-weight: unset;
  484. overflow: hidden;
  485. text-overflow: ellipsis;
  486. white-space: nowrap;
  487. }
  488. </style>