Arrearsrecord.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="billall">
  3. <view class="topbill">
  4. <view class="topbilledit">
  5. <view class="changetime1">
  6. <picker mode="date" :value="myday" fields="month" @change="dateChange">
  7. <view class="selestDate">{{myday}}</view>
  8. </picker>
  9. </view>
  10. <view class="changetime2">
  11. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  12. </view>
  13. </view>
  14. <view class="topbilledit" @click="typechange">
  15. <view class="changetime1">
  16. {{mytype}}
  17. </view>
  18. <view class="changetime2">
  19. <u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="u-listdata">
  24. <view style="padding:10rpx 0 0 30rpx">
  25. 共有 <span style="color: red">{{totalnumber}}</span>条记录
  26. </view>
  27. <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
  28. <u-list-item v-for="(item, index) in indexList" :key="index">
  29. <view class="companylist">
  30. <view class="settled" v-if="item.isSettled==1">
  31. 已结清
  32. </view>
  33. <view class="outstanding" v-if="item.isSettled==0">
  34. 未结清
  35. </view>
  36. <h3>{{item.tenantName}}</h3>
  37. <view class="Currentamount">
  38. 欠费金额: <span>¥{{item.amount}}</span>
  39. </view>
  40. <view class="Currentamount">
  41. 欠费天数: {{item.arrearDay}}
  42. </view>
  43. <view class="Currentamount">
  44. 账单类型:{{item.billType}}
  45. </view>
  46. <view class="Currentamount">
  47. 联系电话: {{item.phone}}
  48. </view>
  49. <view class="Callfee" v-if="item.isExpedit==1" @click.stop="handleClick(item.id)">
  50. 催费
  51. </view>
  52. </view>
  53. </u-list-item>
  54. </u-list>
  55. </view>
  56. <u-picker :show="showtype" :columns="columnstype" keyName="dictLabel" @confirm="confirmtype" @cancel='canceltype'>
  57. </u-picker>
  58. <u-notify ref="uNotify" :show="showdct" message="服务器请求失败"></u-notify>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. components: {
  64. },
  65. data() {
  66. const currentDate = this.getDate({
  67. format: 'yyyy-mm'
  68. })
  69. return {
  70. totalnumber: 0,
  71. setyesno: true,
  72. indexList: [],
  73. dataList: [],
  74. dataForm: {
  75. arrearDay: "",//欠费天数
  76. billType: "",//账单类型
  77. cycle: currentDate,//欠费周期
  78. isExpedit: "",//是否催费0否1是
  79. order: "",
  80. orderField: "",
  81. tenantName: "",//租客名称
  82. page: 1,
  83. limit: 10,
  84. },
  85. showtype: false,
  86. showdct: false,
  87. mytitle: '',
  88. alldata: [],
  89. showfloor: false,
  90. loading: false,
  91. columns: [],
  92. pd: true,
  93. columnData: [],
  94. columnstypes:[],
  95. myday: '',
  96. mytype: '全部',
  97. showPicker: false,
  98. myday: currentDate,
  99. columnstype: [ ],
  100. }
  101. },
  102. //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
  103. onLoad() {
  104. let getDictDataList=uni.getStorageSync('getDictDataList');
  105. for(let i=0;i<getDictDataList.length;i++){
  106. if(getDictDataList[i].dictType=='PayType'){
  107. this.columnstypes=getDictDataList[i].dataList;
  108. this.columnstype=[getDictDataList[i].dataList];
  109. }
  110. }
  111. this.getalldata();
  112. },
  113. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  114. onReady() {
  115. // 微信小程序需要用此写法
  116. },
  117. //监听页面隐藏
  118. onHide() {},
  119. //监听窗口尺寸变化
  120. onResize() {},
  121. //监听页面卸载
  122. onUnload() {},
  123. //监听用户下拉动作,一般用于下拉刷新
  124. onPullDownRefresh() {},
  125. methods: {
  126. handleClick(e) {
  127. let Temporarydata=[e];
  128. let stringdata = JSON.stringify(Temporarydata);
  129. let finallydata = stringdata.replace (/"/g,'');
  130. this.$api.post('/expeditrecord/charge',finallydata)
  131. .then(res => {
  132. if (res.data.code == 0) {
  133. uni.showToast({
  134. title: '催费成功',
  135. icon: 'none',
  136. duration: 1500
  137. })
  138. } else {
  139. uni.showToast({
  140. title: res.data.msg,
  141. icon: 'none',
  142. duration: 1500
  143. })
  144. }
  145. this.dataForm.page=1;
  146. this.indexList=[];
  147. this.getalldata();
  148. })
  149. },
  150. scrolltolower() {
  151. if (this.pd) {
  152. this.getalldata();
  153. } else {
  154. return
  155. }
  156. },
  157. getalldata() {
  158. this.$api.get('/expeditrecord/apppage', this.dataForm)
  159. .then(res => {
  160. this.totalnumber = res.data.data.total;
  161. if (res.data.data.list.length != 0) {
  162. function transform(a, b) {
  163. loop: for (let i = 0; i < a.length; i++) {
  164. for (let j = 0; j < b.length; j++) {
  165. if (a[i].billType == b[j].dictValue) {
  166. a[i].billType = b[j].dictLabel;
  167. continue loop;
  168. }
  169. }
  170. a[i].billType = a[i].billType;
  171. }
  172. return a;
  173. }
  174. res.data.data.list=transform(res.data.data.list, this.columnstypes)
  175. this.indexList.push(...res.data.data.list);
  176. this.dataForm.page = this.dataForm.page + 1;
  177. this.pd = true;
  178. } else {
  179. uni.showToast({
  180. title: '暂无更多数据了',
  181. icon: 'none',
  182. duration: 1500
  183. })
  184. this.pd = false;
  185. }
  186. })
  187. },
  188. canceltype() {
  189. this.showtype = false;
  190. },
  191. confirmtype(e) {
  192. if( e.value[0].dictLabel=="全部"){
  193. this.showtype = false;
  194. this.mytype = e.value[0].dictLabel;
  195. this.dataForm.billType ='';
  196. this.indexList = [];
  197. this.dataForm.page = 1;
  198. this.getalldata();
  199. }else{
  200. this.showtype = false;
  201. this.mytype = e.value[0].dictLabel;
  202. this.dataForm.billType = e.value[0].dictValue;
  203. this.indexList = [];
  204. this.dataForm.page = 1;
  205. this.getalldata();
  206. }
  207. },
  208. typechange() {
  209. this.showtype = true;
  210. },
  211. dateChange(e) {
  212. this.myday = e.target.value;
  213. this.dataForm.cycle = e.target.value;
  214. this.dataForm.page = 1;
  215. this.indexList = [];
  216. this.getalldata();
  217. },
  218. getDate(type) {
  219. const date = new Date();
  220. let year = date.getFullYear();
  221. let month = date.getMonth() + 1;
  222. if (type === 'start') {
  223. year = year - 60;
  224. } else if (type === 'end') {
  225. year = year + 2;
  226. }
  227. month = month > 9 ? month : '0' + month;
  228. // day = day > 9 ? day : '0' + day;
  229. return `${year}-${month}`;
  230. },
  231. }
  232. }
  233. </script>
  234. <style lang="scss">
  235. .Currentamount {
  236. padding-left: 30rpx;
  237. height: 50rpx;
  238. line-height: 50rpx;
  239. color: #BCB3A7;
  240. span {
  241. color: #FA5555;
  242. padding-left: 9rpx;
  243. }
  244. }
  245. .Callfee {
  246. width: 100rpx;
  247. height: 45rpx;
  248. text-align: center;
  249. line-height: 45rpx;
  250. color: #5C8FFF;
  251. border: 1px solid #5C8FFF;
  252. font-size: 22rpx;
  253. position: absolute;
  254. bottom: 10rpx;
  255. right: 10px;
  256. font-weight: bold;
  257. }
  258. .companylist {
  259. margin: 20rpx 30rpx;
  260. background: #fff;
  261. height: 280rpx;
  262. border-radius: 10px;
  263. position: relative;
  264. h3 {
  265. height: 70rpx;
  266. line-height: 70rpx;
  267. padding-left: 30rpx;
  268. }
  269. }
  270. .settled {
  271. background-color: #09C700;
  272. width: 100rpx;
  273. height: 40rpx;
  274. text-align: center;
  275. line-height: 40rpx;
  276. color: #fff;
  277. font-size: 14rpx;
  278. position: absolute;
  279. top: 0px;
  280. right: 0px;
  281. border-top-right-radius: 10rpx;
  282. border-bottom-left-radius: 10rpx;
  283. }
  284. .outstanding {
  285. background-color: #FA5555;
  286. width: 100rpx;
  287. height: 40rpx;
  288. text-align: center;
  289. line-height: 40rpx;
  290. color: #fff;
  291. font-size: 14rpx;
  292. position: absolute;
  293. top: 0px;
  294. right: 0px;
  295. border-top-right-radius: 10rpx;
  296. border-bottom-left-radius: 10rpx;
  297. }
  298. .billall {}
  299. .topbill {
  300. display: flex;
  301. justify-content: space-around;
  302. align-items: center;
  303. height: 100rpx;
  304. background-color: #e6e6e6;
  305. }
  306. .topbilledit {
  307. display: flex;
  308. justify-content: space-around;
  309. align-items: center;
  310. }
  311. .changetime1 {
  312. padding-right: 10rpx;
  313. }
  314. </style>