companybill.vue 9.0 KB

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