proxyList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <view>
  3. <u-navbar title="代缴费记录" title-color="#101010"></u-navbar>
  4. <u-picker-select title="日期选择" :maskCloseAble="true" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
  5. mode="time" :params="params" @confirm="selector2confirm" @cancel="selector2cancel"
  6. @reset="selector2reset">
  7. </u-picker-select>
  8. <view>
  9. <view class="head-head" >
  10. <u-search placeholder="搜索租户" :show-action="false" v-model="keyword"></u-search>
  11. </view>
  12. <view class="u-subsection" style="margin: 8rpx 0;border-bottom: 1px solid rgba(232,232,232,1);">
  13. <u-subsection :list="list" bgColor="#fff" activeColor="#1684FC" buttonColor="#1684FC"
  14. :current="homePageManageType" @change="sectionChange"
  15. font-size="32"></u-subsection>
  16. <view style="margin-top: 18rpx; text-align: end;" v-if="homePageManageType==5&&tabsFrom.show2Text">
  17. 指定时间:{{tabsFrom.show2Text}}
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 统计 -->
  22. <view class="statistics">
  23. <view class="statistics-total">
  24. <view class="total-title">
  25. 合计代缴费收入
  26. </view>
  27. <view class="total-number">
  28. {{monthQuery}}元
  29. </view>
  30. </view>
  31. <view class="statistics-group">
  32. <view v-for="(item,i) in proxyListQuery" :key="i"
  33. @click="gotoUrl('/pages/proxy/proxyInfo?id='+item.id+'&name='+item.name+'&type='+homePageManageType)"
  34. class="statistics-item">
  35. <view class="content">
  36. <!-- 收入 -->
  37. <view class="income">
  38. <view class="income-title">
  39. {{item.name}}
  40. </view>
  41. <view class="income-number">
  42. {{item.remark}}
  43. </view>
  44. </view>
  45. <!-- 电量 -->
  46. <view class="electric-quantity">
  47. {{item.proxyFee}}
  48. </view>
  49. </view>
  50. <view class="icon">
  51. <u-icon name="arrow-right" color="#acacac" size="24"></u-icon>
  52. </view>
  53. </view>
  54. <u-divider :isnone="proxyListQuery.length==0" nonetext="没有找到相关内容"
  55. border-color="#CFD2D5">已经到底了</u-divider>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import * as API from '@/apis/pagejs/proxy.js'
  62. import {
  63. parseUnixTime
  64. } from '@/apis/utils'
  65. export default {
  66. data() {
  67. return {
  68. title:"",
  69. value: '2',
  70. clickType: -1,
  71. homePageManageType:2,
  72. queryDate:"",
  73. tenantName:"",
  74. tabsFrom: {
  75. show1: false,
  76. show1Index: 0,
  77. show2Index: '',
  78. show2: false,
  79. show1Text: "全部类型",
  80. show2Text: "",
  81. },
  82. keyword:"",
  83. proxyList:[],
  84. list: [{
  85. name: '上月',
  86. value: "2"
  87. },
  88. {
  89. name: '当月',
  90. value: "1"
  91. },
  92. {
  93. name: '今日',
  94. value: "4"
  95. }, {
  96. name: '当年',
  97. value: "3"
  98. }, {
  99. name: '合计',
  100. value: "0"
  101. },
  102. {
  103. name: '指定时间',
  104. value: "10"
  105. }
  106. ],
  107. sp:0,
  108. companyId:"",
  109. endYear: '',
  110. params: {
  111. year: true,
  112. month: true,
  113. day: false,
  114. hour: false,
  115. minute: false,
  116. second: false
  117. },
  118. }
  119. },
  120. onLoad(op) {
  121. this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  122. this.companyId=op.companyId
  123. if(op.type!=5){
  124. this.homePageManageType=op.type
  125. }
  126. this.queryParent=(op.sp==1?1:0)
  127. this.endYear = new Date().getFullYear();
  128. this.getList()
  129. },
  130. computed:{
  131. monthQuery(){
  132. var list=0
  133. this.proxyList.forEach(item=>{
  134. list+=item.proxyFee
  135. })
  136. return list.toFixed(2)
  137. },
  138. proxyListQuery(){
  139. var list=[]
  140. this.proxyList.forEach(item=>{
  141. if( this.keyword==''||(item.name&&item.name.indexOf(this.keyword)!=-1)){
  142. list.push(item)
  143. }
  144. })
  145. return list
  146. }
  147. },
  148. methods: {
  149. getList(){
  150. uni.showLoading({
  151. title: "加载中",
  152. mask: true,
  153. })
  154. var type=this.list[this.homePageManageType].value
  155. API.proxyPaymentList({
  156. queryDate:this.queryDate,
  157. queryParent:this.queryParent,
  158. companyId:this.companyId,
  159. type:type
  160. }).then((response) => {
  161. uni.hideLoading();
  162. this.proxyList=response.data.tenantInfoList
  163. }).catch(error => {
  164. uni.showToast({
  165. title: error,
  166. icon: "none"
  167. })
  168. })
  169. },
  170. selector2confirm(e) {
  171. this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
  172. this.tabsFrom.show2Index = e.year + "-" + e.month
  173. if (e.day) {
  174. this.tabsFrom.show2Text += e.day + "日"
  175. this.tabsFrom.show2Index += '-' + e.day
  176. this.queryDateMethod(this.tabsFrom.show2Index, true)
  177. } else {
  178. this.queryDateMethod(this.tabsFrom.show2Index, false)
  179. }
  180. },
  181. selector2reset(e) {
  182. //console.log(e)
  183. this.tabsFrom.show2Text = '全部时间'
  184. this.tabsFrom.show2Index = '';
  185. if (e.day) {
  186. this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  187. this.getList();
  188. } else {
  189. this.homePageManageType = this.clickType;
  190. if (this.homePageManageType != 5) {
  191. this.list[5].name = '指定时间';
  192. }
  193. this.getList();
  194. }
  195. },
  196. selector2cancel() {
  197. if(this.clickType != -1) {
  198. }
  199. this.homePageManageType = this.clickType;
  200. },
  201. queryDateMethod(queryTime, day) {
  202. this.homePageManageType = "5";
  203. if (day) {
  204. this.queryDate = queryTime;
  205. this.list[5].value = '9';
  206. } else {
  207. this.queryDate = queryTime + "-01";
  208. this.list[5].value = '10';
  209. }
  210. //this.list[5].name = queryTime;
  211. this.getList();
  212. },
  213. sectionChange(index) {
  214. this.clickType = this.homePageManageType ;
  215. this.homePageManageType = index;
  216. if (index == 5) {
  217. this.tabsFrom.show2 = true;
  218. //this.params.day = false;
  219. } else {
  220. this.list[5].name = '指定时间'
  221. this.getList();
  222. }
  223. },
  224. }
  225. }
  226. </script>
  227. <style>
  228. page {
  229. background-color: #fff;
  230. }
  231. </style>
  232. <style lang="scss" scoped >
  233. /deep/.u-item-bg{
  234. height: 2px !important;
  235. }
  236. /deep/.u-item-5{
  237. .u-item-text{
  238. font-size: 26rpx !important;
  239. }
  240. }
  241. // 统计
  242. .statistics {
  243. .statistics-total {
  244. display: flex;
  245. align-items: center;
  246. justify-content: space-between;
  247. padding: 36rpx 32rpx;
  248. //background-color: rgba(22, 119, 255, 1);
  249. background: linear-gradient(88.25deg, rgba(31,85,255,1) 0.65%,rgba(39,171,255,1) 99.34%);
  250. color: rgba(255, 255, 255, 1);
  251. font-size: 40rpx;
  252. font-weight: bold;
  253. }
  254. .statistics-group {
  255. .statistics-item {
  256. padding: 24rpx 32rpx;
  257. display: flex;
  258. align-items: center;
  259. justify-content: space-between;
  260. border-bottom: 1px solid rgba(245, 245, 245, 1);
  261. .content {
  262. flex: 0.99;
  263. display: flex;
  264. align-items: center;
  265. justify-content: space-between;
  266. .income {
  267. .income-title {
  268. font-weight: bold;
  269. font-size: 32rpx;
  270. color: rgba(51, 51, 51, 1);
  271. }
  272. .income-number {
  273. font-size: 28rpx;
  274. color: rgba(119,119,119,1);
  275. }
  276. }
  277. // 电量
  278. .electric-quantity {
  279. font-size: 40rpx;
  280. color: rgb(16,16,16);
  281. width: 200rpx;
  282. text-align: end;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. .head-head{
  289. // box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
  290. background: #fff;
  291. padding:24rpx;
  292. }
  293. </style>