Immediatecollection.vue 9.9 KB

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