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