Immediatecollection.vue 8.5 KB

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