Immediatecollection.vue 9.4 KB

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