Immediatecollection.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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. let getDictDataList=uni.getStorageSync('getDictDataList');
  143. for(let i=0;i<getDictDataList.length;i++){
  144. if(getDictDataList[i].dictType=='getDictDataList'){
  145. this.columnstypes=getDictDataList[i]
  146. }
  147. }
  148. // this.loadmore();
  149. },
  150. //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
  151. onReady() {
  152. // 微信小程序需要用此写法
  153. },
  154. //监听页面隐藏
  155. onHide() {},
  156. //监听窗口尺寸变化
  157. onResize() {},
  158. //监听页面卸载
  159. onUnload() {},
  160. //监听用户下拉动作,一般用于下拉刷新
  161. onPullDownRefresh() {},
  162. methods: {
  163. seedetail(e) {
  164. // console.log('222',e.tenantName)
  165. // console.log('111111111111111111',faltesdata)
  166. uni.navigateTo({
  167. url: `/pages/index/Immediatecollection/Chargedetails/Chargedetails?companyOrgId=${e.tenantName}`
  168. })
  169. },
  170. handleClick(e) {
  171. console.log('111111111111111111', e)
  172. this.$api.post('/expeditrecord/charge', {
  173. data: e
  174. })
  175. .then(res => {
  176. if (res.data.code == 0) {
  177. uni.showToast({
  178. title: '催费成功',
  179. icon: 'none',
  180. duration: 1500
  181. })
  182. } else {
  183. uni.showToast({
  184. title: res.data.msg,
  185. icon: 'none',
  186. duration: 1500
  187. })
  188. }
  189. })
  190. },
  191. scrolltolower() {
  192. if (this.pd) {
  193. this.getalldata();
  194. } else {
  195. return
  196. }
  197. },
  198. typechanges() {
  199. this.showtypes = true;
  200. },
  201. getalldata() {
  202. this.$api.get('/expeditrecord/apppage', this.dataForm)
  203. .then(res => {
  204. if (res.data.data.list.length != 0) {
  205. this.indexList.push(...res.data.data.list);
  206. this.dataForm.page = this.dataForm.page + 1;
  207. this.pd = true;
  208. } else {
  209. uni.showToast({
  210. title: '暂无更多数据了',
  211. icon: 'none',
  212. duration: 1500
  213. })
  214. this.pd = false;
  215. }
  216. })
  217. },
  218. canceltype() {
  219. this.showtype = false;
  220. },
  221. confirmtype(e) {
  222. // console.log('111111111111111111', e.value[0])
  223. this.showtype = false;
  224. this.mytype = e.value[0].label;
  225. this.dataForm.billType = e.value[0].id;
  226. this.dataForm.page = 1;
  227. this.getalldata();
  228. },
  229. confirmtypes(e) {
  230. // console.log('22222', e.value[0])
  231. this.showtypes = false;
  232. this.mytypes = e.value[0].dictLabel;
  233. this.dataForm.arrearDay = e.value[0].dictValue;
  234. this.dataForm.page = 1;
  235. this.getalldata();
  236. },
  237. canceltypes() {
  238. this.showtypes = false;
  239. },
  240. typechange() {
  241. this.showtype = true;
  242. },
  243. dateChange(e) {
  244. // console.log('3333',e)
  245. this.myday = e.target.value;
  246. this.dataForm.cycle = e.target.value;
  247. this.dataForm.page = 1;
  248. this.getalldata();
  249. },
  250. getDate(type) {
  251. const date = new Date();
  252. let year = date.getFullYear();
  253. let month = date.getMonth() + 1;
  254. if (type === 'start') {
  255. year = year - 60;
  256. } else if (type === 'end') {
  257. year = year + 2;
  258. }
  259. month = month > 9 ? month : '0' + month;
  260. // day = day > 9 ? day : '0' + day;
  261. return `${year}-${month}`;
  262. },
  263. }
  264. }
  265. </script>
  266. <style lang="scss">
  267. .Currentamount {
  268. padding-left: 30rpx;
  269. height: 50rpx;
  270. line-height: 50rpx;
  271. color: #BCB3A7;
  272. span {
  273. color: #FA5555;
  274. padding-left: 9rpx;
  275. }
  276. }
  277. .Callfee {
  278. width: 100rpx;
  279. height: 45rpx;
  280. text-align: center;
  281. line-height: 45rpx;
  282. color: #5C8FFF;
  283. border: 1px solid #5C8FFF;
  284. font-size: 22rpx;
  285. position: absolute;
  286. bottom: 10rpx;
  287. right: 10px;
  288. font-weight: bold;
  289. }
  290. .companylist {
  291. margin: 20rpx 30rpx;
  292. background: #fff;
  293. height: 340rpx;
  294. border-radius: 10px;
  295. position: relative;
  296. h3 {
  297. height: 70rpx;
  298. line-height: 70rpx;
  299. padding-left: 30rpx;
  300. }
  301. }
  302. .settled {
  303. background-color: #09C700;
  304. width: 100rpx;
  305. height: 40rpx;
  306. text-align: center;
  307. line-height: 40rpx;
  308. color: #fff;
  309. font-size: 14rpx;
  310. position: absolute;
  311. top: 0px;
  312. right: 0px;
  313. border-top-right-radius: 10rpx;
  314. border-bottom-left-radius: 10rpx;
  315. }
  316. .outstanding {
  317. background-color: #FA5555;
  318. width: 100rpx;
  319. height: 40rpx;
  320. text-align: center;
  321. line-height: 40rpx;
  322. color: #fff;
  323. font-size: 14rpx;
  324. position: absolute;
  325. top: 0px;
  326. right: 0px;
  327. border-top-right-radius: 10rpx;
  328. border-bottom-left-radius: 10rpx;
  329. }
  330. .billall {}
  331. .topbill {
  332. display: flex;
  333. justify-content: space-around;
  334. align-items: center;
  335. height: 100rpx;
  336. background-color: #e6e6e6;
  337. }
  338. .topbilledit {
  339. display: flex;
  340. justify-content: space-around;
  341. align-items: center;
  342. }
  343. .changetime1 {
  344. padding-right: 10rpx;
  345. }
  346. </style>