index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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-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. 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?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. this.form.pageSize=20
  272. API.recordMonthData(this.form).then((res) => {
  273. this.list = [
  274. ...this.list,
  275. ...res.data.data
  276. ];
  277. this.recordsTotal = res.data.recordsTotal
  278. uni.hideLoading()
  279. }).catch(error => {
  280. uni.showToast({
  281. title: error
  282. })
  283. })
  284. },
  285. getStation(bl) {
  286. API.stationList().then((res) => {
  287. this.stationList = res.data.stationList
  288. this.stationListSon=res.data.deviceList
  289. }).catch(error => {
  290. uni.showToast({
  291. title: error
  292. })
  293. })
  294. },
  295. myLoadmore() {
  296. this.pageIndex += 1;
  297. this.getList()
  298. },
  299. // 点击actionSheet回调
  300. actionSheetCallback(index) {
  301. this.value = this.actionSheetList[index].text;
  302. }
  303. }
  304. }
  305. </script>
  306. <style>
  307. page{
  308. background-color: #F7F7F7;
  309. }
  310. </style>
  311. <style lang="scss" scoped>
  312. .popup-screen{
  313. padding: 20px;
  314. position: relative;
  315. .screen{
  316. padding-bottom: 30px;
  317. }
  318. .screen-item{
  319. margin-bottom: 20px;
  320. .screen-head{
  321. margin-bottom: 8px;
  322. font-size: 16px;
  323. }
  324. .screen-main{
  325. // display: -webkit-box;
  326. display: flex;
  327. flex-wrap: wrap;
  328. }
  329. .screen-entry{
  330. width: 29%;
  331. padding:6px 0;
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. background-color: #F2F5FA ;
  336. text-align: center;
  337. margin-bottom: 10px;
  338. border-radius: 3px;
  339. margin-right: 6px;
  340. }
  341. .screen-entry.active{
  342. background-color: #185AC6;
  343. color:#fff;
  344. }
  345. }
  346. .screen-foot{
  347. position: fixed;
  348. left: 0;
  349. right: 0;
  350. bottom: 0;
  351. display: flex;
  352. height:50px;
  353. border-top: 1px solid #ededed;
  354. .screen-btn-l{
  355. background-color: #fff;
  356. flex: 0.2;
  357. text-align: center;
  358. line-height: 50px;
  359. }
  360. .screen-btn-r{
  361. flex: 0.8;
  362. text-align: center;
  363. line-height: 50px;
  364. background-color: #185AC6;
  365. color:#fff;
  366. }
  367. }
  368. }
  369. .navbar{
  370. display: flex;
  371. justify-content: space-between;
  372. flex: 1;
  373. padding: 0 15px;
  374. }
  375. .navbar-tit{
  376. font-size: 20px;
  377. }
  378. .navbar-screen{
  379. display: flex;
  380. align-items: center;
  381. span{
  382. margin-right: 2px;
  383. color:#999;
  384. }
  385. }
  386. .detailed-time{
  387. display: flex;
  388. justify-content: space-between;
  389. align-items: center;
  390. padding: 10px 20px;
  391. p{
  392. color:#666;
  393. }
  394. }
  395. .detailed-item{
  396. background-color: #fff;
  397. display: flex;
  398. justify-content: space-between;
  399. padding: 10px 20px;
  400. border-bottom: 1px solid #ededed;
  401. .detailed-item-name{
  402. h4{
  403. font-weight: normal;
  404. }
  405. p{
  406. font-size: 12px;
  407. margin-top: 4px;
  408. color:#A2A9B5;
  409. }
  410. }
  411. .detailed-item-num{
  412. display: flex;
  413. align-items: center;
  414. h2{
  415. margin-right: 4px;
  416. }
  417. }
  418. }
  419. </style>