companybill.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <template>
  2. <view class="">
  3. <view class="topname">
  4. <view class="topname1" @click="goback">
  5. <u-icon name="arrow-left" color="#000000" size="36"></u-icon>
  6. </view>
  7. <view class="topname2">
  8. {{ this.fatherparameter.name}}
  9. </view>
  10. </view>
  11. <view class="subsection">
  12. <u-subsection :list="list" :current="current" @change="sectionChange"></u-subsection>
  13. </view>
  14. <!-- 列表 -->
  15. <!-- 账单明细 -->
  16. <view class="" v-show="cdshow==true">
  17. <!-- 日期选择器 -->
  18. <view class="topbilledit">
  19. <view class="changetime1">
  20. <picker mode="date" :value="dataForm.costCycle" fields="month" @change="dateChange">
  21. <view class="selestDate">{{dataForm.costCycle}}</view>
  22. </picker>
  23. </view>
  24. <view class="changetime2">
  25. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  26. </view>
  27. </view>
  28. <view class="nodata" v-if="nodata==true" >
  29. 暂无数据
  30. </view>
  31. <view class="yesdata" v-if="nodata==false">
  32. <view class="onerecord">
  33. 共有 <span>1</span>条记录
  34. </view>
  35. <view class="records">
  36. <view class="records1">
  37. 待支付
  38. </view>
  39. <view class="Currentamount">
  40. 物业费: <span>¥{{amount}}</span>
  41. </view>
  42. <view class="Currentamount">
  43. 管理费:¥ {{glf}}
  44. </view>
  45. <view class="Currentamount">
  46. 中央空调使用费:¥ {{ktf}}
  47. </view>
  48. <view class="Currentamount">
  49. 电梯费:¥ {{dtf}}
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 缴费记录 -->
  55. <view class="" v-show="cdshow==false">
  56. <view class="topbilledit" @click="typechange">
  57. <view class="changetime1">
  58. {{expensedata}}
  59. </view>
  60. <view class="changetime2">
  61. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  62. </view>
  63. </view>
  64. <!-- 列表 -->
  65. <view class="u-listdata">
  66. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  67. <u-list-item v-for="(item, index) in indexList" :key="index">
  68. <view class="companylist" @click="seedetail(item)">
  69. <view class="settled" v-if="item.status==1">
  70. 预存
  71. </view>
  72. <h3>{{item.tenantInfo.name}}</h3>
  73. <view class="Currentamount">
  74. 扣缴金额: <span>¥{{item.amount}}</span>
  75. </view>
  76. <view class="Currentamount">
  77. 账户余额: {{item.surplus}}
  78. </view>
  79. <view class="Currentamount">
  80. 租户电话:¥{{item.tenantInfo.tel}}
  81. </view>
  82. <view class="Currentamount">
  83. 操作人: {{item.creator}}
  84. </view>
  85. <view class="Currentamount">
  86. 扣缴时间: {{item.createDate}}
  87. </view>
  88. </view>
  89. </u-list-item>
  90. </u-list>
  91. </view>
  92. </view>
  93. <u-picker :show="showtype" :columns="columnstype" keyName="dictLabel" @confirm="confirmtype" @cancel='canceltype'>
  94. </u-picker>
  95. </view>
  96. </template>
  97. <script>
  98. import {
  99. isEmpty,
  100. getDictDataList
  101. } from "@/utils/index";
  102. export default {
  103. data() {
  104. return {
  105. showtype: false,
  106. cdshow: true,
  107. fatherparameter: {},
  108. expensedata:'全部',
  109. list: ['账单明细', '缴费记录', ],
  110. current: 0,
  111. dataForm: {
  112. tenantId: "",
  113. costCycle: "",
  114. type: "",
  115. page: 1,
  116. limit: 10,
  117. },
  118. indexList: [],
  119. payStatusList: [],
  120. amount:'',
  121. dtf:'',
  122. ktf:'',
  123. glf:'',
  124. nodata:true,
  125. pd:true,
  126. columnstype: [],
  127. jfpost: {
  128. tenantId: "",
  129. costCycle: "",
  130. type: "",
  131. page: 1,
  132. limit: 10,
  133. },
  134. }
  135. },
  136. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  137. onLoad: function(options) { //option为object类型,会序列化上个页面传递的参数
  138. // console.log(options); //打印出上个页面传递的参数。
  139. this.fatherparameter = JSON.parse(decodeURIComponent(options.para));
  140. // console.log('userInfo', this.fatherparameter);
  141. this.dataForm.tenantId = this.fatherparameter.id;
  142. this.dataForm.costCycle = this.fatherparameter.cycle;
  143. this.dataForm.page = 1;
  144. this.jfpost.tenantId = this.fatherparameter.id;
  145. this.jfpost.costCycle = this.fatherparameter.cycle;
  146. this.jfpost.page = 1;
  147. this.getalldata();
  148. this.getPayStatusList();
  149. this.getPayTypeList();
  150. },
  151. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  152. onReady() {},
  153. //监听页面隐藏
  154. onHide() {},
  155. //监听窗口尺寸变化
  156. onResize() {},
  157. //监听页面卸载
  158. onUnload() {},
  159. //监听用户下拉动作,一般用于下拉刷新
  160. onPullDownRefresh() {},
  161. methods: {
  162. getPayTypeList() {
  163. this.columnstype=[getDictDataList("PayType")]
  164. },
  165. getPayStatusList() {
  166. this.payStatusList = getDictDataList("PayStatus");
  167. // console.log('0000', this.payStatusList)
  168. },
  169. goback() {
  170. uni.navigateBack({
  171. delta: 1
  172. });
  173. },
  174. canceltype() {
  175. this.showtype = false;
  176. },
  177. confirmtype(e) {
  178. console.log('111111111111111111', e.value[0])
  179. this.showtype = false;
  180. this.expensedata = e.value[0].dictLabel;
  181. if( e.value[0].dictLabel=='全部'){
  182. this.jfpost.type= '';
  183. } else{
  184. this.jfpost.type= e.value[0].dictValue;
  185. }
  186. this.indexList=[];
  187. this.jfpost.page = 1;
  188. this.getjfdata();
  189. },
  190. typechange() {
  191. this.showtype = true;
  192. },
  193. sectionChange(index) {
  194. this.current = index;
  195. if (index == 0) {
  196. this.cdshow = true;
  197. this.dataForm.page = 1;
  198. this.getalldata();
  199. } else {
  200. this.cdshow = false;
  201. this.jfpost.page = 1;
  202. this.indexList=[];
  203. this.getjfdata();
  204. }
  205. },
  206. scrolltolower() {
  207. if(this.pd){
  208. this.getjfdata();
  209. }else{
  210. return
  211. }
  212. },
  213. getjfdata(){
  214. this.$api.get('/payrecord/page', this.jfpost)
  215. .then(res => {
  216. // console.log('111111111111111111',res.data.data.list)
  217. if (res.data.data.list.length != 0) {
  218. this.indexList.push(...res.data.data.list);
  219. this.jfpost.page = this.jfpost.page + 1;
  220. this.pd=true;
  221. } else {
  222. uni.showToast({
  223. title:'暂无更多数据了',
  224. icon: 'none',
  225. duration: 1500
  226. })
  227. this.pd=false;
  228. }
  229. })
  230. },
  231. dateChange(e) {
  232. this.myday = e.target.value;
  233. this.dataForm.costCycle = e.target.value;
  234. this.jfpost.costCycle = e.target.value;
  235. this.dataForm.page = 1;
  236. this.getalldata();
  237. },
  238. getalldata() {
  239. this.$api.post('/billinfo/billDetail', this.dataForm)
  240. .then(res => {
  241. //console.log('111111111111111111', res.data)
  242. // this.indexList = [];
  243. // this.indexList = res.data.data;
  244. // console.log('222222', this.indexList)
  245. if(res.data.data.length==0){
  246. // console.log('111111111111111111',)
  247. this.nodata=true;
  248. }else{
  249. this.amount=res.data.data[0].amount;
  250. this.glf=res.data.data[0].billLists[0].amount;
  251. this.ktf=res.data.data[0].billLists[1].amount;
  252. this.dtf=res.data.data[0].billLists[2].amount;
  253. this.nodata=false;
  254. }
  255. })
  256. },
  257. }
  258. }
  259. </script>
  260. <style lang="scss">
  261. .nodata{
  262. text-align: center;
  263. padding-top: 400rpx;
  264. }
  265. .yesdata{
  266. }
  267. .companylist {
  268. margin: 20rpx 30rpx;
  269. background: #fff;
  270. height: 280rpx;
  271. border-radius: 10px;
  272. position: relative;
  273. h3 {
  274. height: 70rpx;
  275. line-height: 70rpx;
  276. padding-left: 30rpx;
  277. }
  278. }
  279. .settled {
  280. background-color: #09C700;
  281. width: 100rpx;
  282. height: 40rpx;
  283. text-align: center;
  284. line-height: 40rpx;
  285. color: #fff;
  286. font-size: 14rpx;
  287. position: absolute;
  288. top: 0px;
  289. right: 0px;
  290. border-top-right-radius: 10rpx;
  291. border-bottom-left-radius: 10rpx;
  292. }
  293. .Currentamount {
  294. padding-left: 30rpx;
  295. height: 40rpx;
  296. line-height: 40rpx;
  297. color: #BCB3A7;
  298. span {
  299. color: #FA5555;
  300. padding-left: 9rpx;
  301. }
  302. }
  303. .records1{
  304. background-color: #FA5555;
  305. width: 100rpx;
  306. height: 40rpx;
  307. text-align: center;
  308. line-height: 40rpx;
  309. color: #fff;
  310. font-size: 14rpx;
  311. position: absolute;
  312. top: 0px;
  313. right: 0px;
  314. border-top-right-radius: 10rpx;
  315. border-bottom-left-radius: 10rpx;
  316. }
  317. .records{
  318. display: flex;
  319. flex-direction: column;
  320. // justify-content: center;
  321. position: relative;
  322. width: 690rpx;
  323. height: 210rpx;
  324. background: #fff;
  325. margin: 0 auto;
  326. border-radius: 9rpx;
  327. }
  328. .onerecord{
  329. width: 750rpx;
  330. height: 90rpx;
  331. line-height: 90rpx;
  332. padding-left: 30rpx;
  333. color: #999;
  334. span{
  335. color: red;
  336. }
  337. }
  338. .topbilledit {
  339. display: flex;
  340. justify-content: center;
  341. align-items: center;
  342. background: #fff;
  343. height: 60rpx;
  344. }
  345. .changetime2 {
  346. padding-left: 10rpx;
  347. }
  348. .subsection {
  349. padding: 30rpx;
  350. background: #fff;
  351. margin-top: 30rpx;
  352. }
  353. .topname {
  354. height: 44px;
  355. width: 750rpx;
  356. display: flex;
  357. align-items: center;
  358. }
  359. .topname1 {
  360. width: 50rpx;
  361. padding-left: 10rpx;
  362. }
  363. .topname2 {
  364. width: 700rpx;
  365. text-align: center;
  366. font-weight: bold;
  367. }
  368. </style>