Immediatecollection.vue 8.1 KB

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