companybill.vue 9.5 KB

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