Immediatecollection.vue 9.8 KB

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