index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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">
  106. <h2>{{item.flowNo?item.flowNo:'无充电单号'}}</h2>
  107. <p>{{item.stationName}}/{{item.deviceName}}</p>
  108. </view>
  109. <view class="detailed-item-name" style="
  110. width: 80px;
  111. ">
  112. <h2 style=" text-align: end;">{{item.shareProfitAmount}}元</h2>
  113. <p style=" text-align: end;" >{{item.createTime?item.createTime.slice(10):''}}</p>
  114. </view>
  115. </view>
  116. <view class="product_tip" v-if="item.status=='1'">
  117. <view class="product_tip_bg"></view>
  118. <p>已提现</p>
  119. </view>
  120. </view>
  121. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f4f0f0">已经到底了</u-divider>
  122. </view>
  123. <Tabbar ref="tabbarMain" :current="2"></Tabbar>
  124. </view>
  125. </template>
  126. <script>
  127. import Tabbar from '@/components/TabbarFinance.vue'
  128. import * as API from '@/apis/finance.js'
  129. import {
  130. currentTimeStamp,
  131. parseUnixTime
  132. } from '@/utils'
  133. export default {
  134. data() {
  135. return {
  136. showdate: false,
  137. startTime: "",
  138. queryDate:"",
  139. endTime: "",
  140. selecttype:"",
  141. selectstationId:"",
  142. selectdeviceNo:"",
  143. title:"",
  144. year:"",
  145. startyear:"",
  146. endyear:"",
  147. params: {
  148. year: true,
  149. month: false,
  150. day: false,
  151. hour: false,
  152. minute: false,
  153. second: false,
  154. // timestamp: true,
  155. },
  156. form:{
  157. },
  158. pageIndex: 1,
  159. recordsTotal: 0,
  160. list: [],
  161. popupShow: false,
  162. tabbarList: [{
  163. iconPath: "bar-chart-box-fill",
  164. selectedIconPath: "bar-chart-box-fill",
  165. text: '统计',
  166. count: 0,
  167. isDot: true,
  168. customIcon: true,
  169. },
  170. {
  171. iconPath: "article-fill",
  172. selectedIconPath: "article-fill",
  173. text: '明细',
  174. midButton: true,
  175. customIcon: true,
  176. },
  177. {
  178. iconPath: "account-pin-box-fill",
  179. selectedIconPath: "account-pin-box-fill",
  180. text: '我的',
  181. count: 0,
  182. isDot: false,
  183. customIcon: true,
  184. },
  185. ],
  186. showMap:null,
  187. current: 0,
  188. value: '',
  189. type: 'select',
  190. show: false,
  191. border: true,
  192. stationList:[],
  193. stationListSon:[],
  194. actionSheetList: [
  195. {
  196. text: '男'
  197. },
  198. {
  199. text: '女'
  200. },
  201. {
  202. text: '保密'
  203. }
  204. ],
  205. }
  206. },
  207. components: {
  208. Tabbar
  209. },
  210. onShow(){
  211. if(this.$refs.tabbarMain){
  212. this.$refs.tabbarMain.setcount(2);
  213. }
  214. },
  215. onReachBottom() {
  216. if (this.list.length < this.recordsTotal) {
  217. this.myLoadmore();
  218. }
  219. },
  220. onLoad() {
  221. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  222. this.startyear=new Date().getFullYear()
  223. console.log(this.startyear)
  224. this.endyear=this.startyear-3
  225. console.log(this.endyear)
  226. },
  227. onReady() {
  228. this.getList()
  229. this.getStation()
  230. },
  231. methods: {
  232. showDateMoth(date){
  233. var back=date;
  234. if(date){
  235. var k= date.slice(5,6)
  236. console.log(k)
  237. if(k=='0'){
  238. back= date.slice(6,7)
  239. }else{
  240. back= date.slice(5,7)
  241. }
  242. }
  243. return back;
  244. },
  245. changedate(e) {
  246. console.log(e)
  247. this.queryDate=e.result
  248. },
  249. resetBtn(){
  250. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  251. this.year=""
  252. this.startTime=""
  253. this.endTime=""
  254. this.selecttype=""
  255. this.selectstationId=""
  256. this.selectdeviceNo=""
  257. this.pageIndex = 1;
  258. this.form = {
  259. queryDate:"",
  260. pageIndex: this.pageIndex,
  261. type:this.selecttype,
  262. stationId:this.selectstationId,
  263. deviceNo:this.selectdeviceNo,
  264. };
  265. this.popupShow=false;
  266. this.list = [];
  267. this.getList()
  268. },
  269. okbtn(){
  270. this.popupShow=false;
  271. this.pageIndex = 1;
  272. this.form = {
  273. queryDate:this.queryDate,
  274. pageIndex: this.pageIndex,
  275. type:this.selecttype,
  276. stationId:this.selectstationId,
  277. deviceNo:this.selectdeviceNo,
  278. };
  279. this.list = [];
  280. this.getList()
  281. },
  282. getList() {
  283. uni.showLoading({
  284. title: "加载中",
  285. mask: true,
  286. })
  287. this.form.pageIndex=this.pageIndex
  288. this.form.pageSize=20
  289. API.recordData(this.form).then((res) => {
  290. this.list = [
  291. ...this.list,
  292. ...res.data.data
  293. ];
  294. var showMap=new Map()
  295. this.list.forEach(item=>{
  296. var ktime=item.createTime.split(" ")[0]
  297. if(showMap.has(ktime)){
  298. item.show=false;
  299. }else{
  300. var Amount=item.todaySPAmount
  301. var num=item.todaySPNum
  302. showMap.set(ktime,{
  303. amount:Amount,
  304. num:num
  305. })
  306. item.show=true;
  307. item.showtime=ktime;
  308. }
  309. })
  310. this.showMap=showMap;
  311. this.recordsTotal = res.data.recordsTotal
  312. uni.hideLoading()
  313. }).catch(error => {
  314. uni.showToast({
  315. title: error
  316. })
  317. })
  318. },
  319. getStation(bl) {
  320. API.stationList().then((res) => {
  321. this.stationList = res.data.stationList
  322. this.stationListSon=res.data.deviceList
  323. }).catch(error => {
  324. uni.showToast({
  325. title: error
  326. })
  327. })
  328. },
  329. myLoadmore() {
  330. this.pageIndex += 1;
  331. this.getList()
  332. },
  333. // 点击actionSheet回调
  334. actionSheetCallback(index) {
  335. this.value = this.actionSheetList[index].text;
  336. }
  337. }
  338. }
  339. </script>
  340. <style>
  341. page{
  342. background-color: #F7F7F7;
  343. }
  344. </style>
  345. <style lang="scss" scoped>
  346. .product_tip{
  347. position: relative;
  348. top: -75px;
  349. right: 0;
  350. text-align: right;
  351. p{
  352. font-size: 24rpx;
  353. color: #ffffff;
  354. transform: rotate(45deg);
  355. position: absolute;
  356. top: 10rpx;
  357. right: 0rpx;
  358. }
  359. .product_tip_bg{
  360. width: 0;
  361. height: 0;
  362. border-bottom: 52rpx solid #53b56d;
  363. border-right: 52rpx solid transparent;
  364. border-left: 52rpx solid transparent;
  365. transform: rotate(45deg);
  366. position: absolute;
  367. top: -7rpx;
  368. right: -29rpx;
  369. }
  370. }
  371. .popup-screen{
  372. padding: 20px;
  373. position: relative;
  374. .screen{
  375. padding-bottom: 30px;
  376. }
  377. .screen-item{
  378. margin-bottom: 20px;
  379. .screen-head{
  380. margin-bottom: 8px;
  381. font-size: 16px;
  382. }
  383. .screen-main{
  384. // display: -webkit-box;
  385. display: flex;
  386. flex-wrap: wrap;
  387. }
  388. .screen-entry{
  389. width: 29%;
  390. padding:6px 0;
  391. display: flex;
  392. align-items: center;
  393. justify-content: center;
  394. background-color: #F2F5FA ;
  395. text-align: center;
  396. margin-bottom: 10px;
  397. border-radius: 3px;
  398. margin-right: 6px;
  399. }
  400. .screen-entry.active{
  401. background-color: #185AC6;
  402. color:#fff;
  403. }
  404. }
  405. .screen-foot{
  406. position: fixed;
  407. left: 0;
  408. right: 0;
  409. bottom: 0;
  410. display: flex;
  411. height:50px;
  412. border-top: 1px solid #ededed;
  413. .screen-btn-l{
  414. background-color: #fff;
  415. flex: 0.2;
  416. text-align: center;
  417. line-height: 50px;
  418. }
  419. .screen-btn-r{
  420. flex: 0.8;
  421. text-align: center;
  422. line-height: 50px;
  423. background-color: #185AC6;
  424. color:#fff;
  425. }
  426. }
  427. }
  428. .navbar{
  429. display: flex;
  430. justify-content: space-between;
  431. flex: 1;
  432. padding: 0 15px;
  433. }
  434. .navbar-tit{
  435. font-size: 20px;
  436. }
  437. .navbar-screen{
  438. display: flex;
  439. align-items: center;
  440. span{
  441. margin-right: 2px;
  442. color:#999;
  443. }
  444. }
  445. .detailed-time{
  446. display: flex;
  447. justify-content: space-between;
  448. align-items: center;
  449. padding: 10px 20px;
  450. font-size: 16px;
  451. p{
  452. color:#666;
  453. }
  454. }
  455. .detailed-item{
  456. background-color: #fff;
  457. display: flex;
  458. justify-content: space-between;
  459. padding: 10px 20px;
  460. border-bottom: 1px solid #ededed;
  461. .detailed-item-name{
  462. h4{
  463. font-weight: normal;
  464. }
  465. p{
  466. font-size: 15px;
  467. margin-top: 4px;
  468. color:#A2A9B5;
  469. }
  470. }
  471. .detailed-item-num{
  472. display: flex;
  473. align-items: center;
  474. h2{
  475. margin-right: 4px;
  476. }
  477. }
  478. }
  479. </style>