index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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">
  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-picker v-model="showdate" mode="time" :start-year="endyear" :end-year="startyear" :params="params" @confirm="changedate"></u-picker >
  16. <u-input :value="year?year+'年':'选择年份筛选'" :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. v-show="selectstationId"
  66. class="screen-item">
  67. <view class="screen-head">桩号</view>
  68. <view class="screen-main">
  69. <view class="screen-entry "
  70. :class="{
  71. active:selectdeviceNo==''
  72. }"
  73. @click="selectdeviceNo=''"
  74. >全部</view>
  75. <view
  76. v-for="(item,i) in stationListSon" :key="i"
  77. v-show="selectstationId?(selectstationId==item.stationId):true"
  78. :class="{
  79. active:selectdeviceNo==item.deviceNo
  80. }"
  81. @click="selectdeviceNo=item.deviceNo"
  82. class="screen-entry" >{{item.name}}</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="screen-foot">
  87. <view class="screen-btn-l" @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?accountId='+item.merchantAccountId+'&deviceId='+item.deviceId+'&shareProfitDate='+item.shareProfitDate)"
  99. :key="index">
  100. <view class="detailed-item">
  101. <view class="detailed-item-name">
  102. <h2>{{showDateMoth(item.shareProfitDate)}}月分润收益</h2>
  103. <p>{{item.stationName}}/{{item.deviceName}}</p>
  104. </view>
  105. <view class="detailed-item-name" style="
  106. width: 80px;
  107. ">
  108. <h2 style=" text-align: end;">{{item.shareProfitAllAmount}}</h2>
  109. <p>{{item.createTime?item.createTime.slice(0,10):''}}</p>
  110. </view>
  111. </view>
  112. </view>
  113. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f4f0f0">已经到底了</u-divider>
  114. </view>
  115. <Tabbar :current="2"></Tabbar>
  116. </view>
  117. </template>
  118. <script>
  119. import Tabbar from '@/components/TabbarFinance.vue'
  120. import * as API from '@/apis/finance.js'
  121. // import {
  122. // beforeTimeStamp,
  123. // currentTimeStamp,
  124. // parseUnixTime
  125. // } from '@/utils'
  126. export default {
  127. data() {
  128. return {
  129. showdate: false,
  130. startTime: "",
  131. endTime: "",
  132. selecttype:"",
  133. selectstationId:"",
  134. selectdeviceNo:"",
  135. title:"",
  136. year:"",
  137. startyear:"",
  138. endyear:"",
  139. params: {
  140. year: true,
  141. month: false,
  142. day: false,
  143. hour: false,
  144. minute: false,
  145. second: false,
  146. // timestamp: true,
  147. },
  148. form:{
  149. },
  150. pageIndex: 1,
  151. recordsTotal: 0,
  152. list: [],
  153. popupShow: false,
  154. tabbarList: [{
  155. iconPath: "bar-chart-box-fill",
  156. selectedIconPath: "bar-chart-box-fill",
  157. text: '统计',
  158. count: 0,
  159. isDot: true,
  160. customIcon: true,
  161. },
  162. {
  163. iconPath: "article-fill",
  164. selectedIconPath: "article-fill",
  165. text: '明细',
  166. midButton: true,
  167. customIcon: true,
  168. },
  169. {
  170. iconPath: "account-pin-box-fill",
  171. selectedIconPath: "account-pin-box-fill",
  172. text: '我的',
  173. count: 0,
  174. isDot: false,
  175. customIcon: true,
  176. },
  177. ],
  178. showMap:null,
  179. current: 0,
  180. value: '',
  181. type: 'select',
  182. show: false,
  183. border: true,
  184. stationList:[],
  185. stationListSon:[],
  186. actionSheetList: [
  187. {
  188. text: '男'
  189. },
  190. {
  191. text: '女'
  192. },
  193. {
  194. text: '保密'
  195. }
  196. ],
  197. }
  198. },
  199. components: {
  200. Tabbar
  201. },
  202. onReachBottom() {
  203. if (this.list.length < this.recordsTotal) {
  204. this.myLoadmore();
  205. }
  206. },
  207. onLoad() {
  208. this.startyear=new Date().getFullYear()
  209. console.log(this.startyear)
  210. this.endyear=this.startyear-3
  211. console.log(this.endyear)
  212. },
  213. onReady() {
  214. this.getList()
  215. this.getStation()
  216. },
  217. methods: {
  218. showDateMoth(date){
  219. var back=date;
  220. if(date){
  221. var k= date.slice(5,6)
  222. console.log(k)
  223. if(k=='0'){
  224. back= date.slice(6,7)
  225. }else{
  226. back= date.slice(5,7)
  227. }
  228. }
  229. return back;
  230. },
  231. changedate(e) {
  232. console.log(e)
  233. this.year=e.year
  234. },
  235. resetBtn(){
  236. this.year=""
  237. this.selecttype=""
  238. this.selectstationId=""
  239. this.selectdeviceNo=""
  240. this.pageIndex = 1;
  241. this.form = {
  242. year:"",
  243. pageIndex: this.pageIndex,
  244. type:this.selecttype,
  245. stationId:this.selectstationId,
  246. deviceNo:this.selectdeviceNo,
  247. };
  248. this.popupShow=false;
  249. this.list = [];
  250. this.getList()
  251. },
  252. okbtn(){
  253. this.popupShow=false;
  254. this.pageIndex = 1;
  255. this.form = {
  256. year:this.year,
  257. pageIndex: this.pageIndex,
  258. type:this.selecttype,
  259. stationId:this.selectstationId,
  260. deviceNo:this.selectdeviceNo,
  261. };
  262. this.list = [];
  263. this.getList()
  264. },
  265. getList() {
  266. uni.showLoading({
  267. title: "加载中",
  268. mask: true,
  269. })
  270. this.form.pageIndex=this.pageIndex
  271. API.recordMonthData(this.form).then((res) => {
  272. this.list = [
  273. ...this.list,
  274. ...res.data.data
  275. ];
  276. this.recordsTotal = res.data.recordsTotal
  277. uni.hideLoading()
  278. }).catch(error => {
  279. uni.showToast({
  280. title: error
  281. })
  282. })
  283. },
  284. getStation(bl) {
  285. API.stationList().then((res) => {
  286. this.stationList = res.data.stationList
  287. this.stationListSon=res.data.deviceList
  288. }).catch(error => {
  289. uni.showToast({
  290. title: error
  291. })
  292. })
  293. },
  294. myLoadmore() {
  295. this.pageIndex += 1;
  296. this.getList()
  297. },
  298. // 点击actionSheet回调
  299. actionSheetCallback(index) {
  300. this.value = this.actionSheetList[index].text;
  301. }
  302. }
  303. }
  304. </script>
  305. <style>
  306. page{
  307. background-color: #F7F7F7;
  308. }
  309. </style>
  310. <style lang="scss" scoped>
  311. .popup-screen{
  312. padding: 20px;
  313. position: relative;
  314. .screen{
  315. padding-bottom: 30px;
  316. }
  317. .screen-item{
  318. margin-bottom: 20px;
  319. .screen-head{
  320. margin-bottom: 8px;
  321. font-size: 16px;
  322. }
  323. .screen-main{
  324. display: -webkit-box;
  325. //display: flex;
  326. flex-wrap: wrap;
  327. justify-content: space-between;
  328. }
  329. .screen-entry{
  330. width: 31%;
  331. padding:6px 0;
  332. background-color: #F2F5FA ;
  333. text-align: center;
  334. margin-bottom: 10px;
  335. border-radius: 3px;
  336. margin-right: 6px;
  337. }
  338. .screen-entry.active{
  339. background-color: #185AC6;
  340. color:#fff;
  341. }
  342. }
  343. .screen-foot{
  344. position: fixed;
  345. left: 0;
  346. right: 0;
  347. bottom: 0;
  348. display: flex;
  349. height:50px;
  350. border-top: 1px solid #ededed;
  351. .screen-btn-l{
  352. flex: 0.2;
  353. text-align: center;
  354. line-height: 50px;
  355. }
  356. .screen-btn-r{
  357. flex: 0.8;
  358. text-align: center;
  359. line-height: 50px;
  360. background-color: #185AC6;
  361. color:#fff;
  362. }
  363. }
  364. }
  365. .navbar{
  366. display: flex;
  367. justify-content: space-between;
  368. flex: 1;
  369. padding: 0 15px;
  370. }
  371. .navbar-tit{
  372. font-size: 20px;
  373. }
  374. .navbar-screen{
  375. display: flex;
  376. align-items: center;
  377. span{
  378. margin-right: 2px;
  379. color:#999;
  380. }
  381. }
  382. .detailed-time{
  383. display: flex;
  384. justify-content: space-between;
  385. align-items: center;
  386. padding: 10px 20px;
  387. p{
  388. color:#666;
  389. }
  390. }
  391. .detailed-item{
  392. background-color: #fff;
  393. display: flex;
  394. justify-content: space-between;
  395. padding: 10px 20px;
  396. border-bottom: 1px solid #ededed;
  397. .detailed-item-name{
  398. h4{
  399. font-weight: normal;
  400. }
  401. p{
  402. font-size: 12px;
  403. margin-top: 4px;
  404. color:#A2A9B5;
  405. }
  406. }
  407. .detailed-item-num{
  408. display: flex;
  409. align-items: center;
  410. h2{
  411. margin-right: 4px;
  412. }
  413. }
  414. }
  415. </style>