123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414 |
- <template>
- <view class="billall">
- <view class="topbill">
- <view class="topbilledit">
- <view class="changetime1">
- <picker mode="date" :value="myday" fields="month" @change="dateChange">
- <view class="selestDate">{{myday}}</view>
- </picker>
- </view>
- <view class="changetime2">
- <u-icon name="arrow-down-fill" color="#999" size="20"></u-icon>
- </view>
- </view>
- <view class="topbilledit" @click="typechange">
- <view class="changetime1">
- {{mytype}}
- </view>
- <view class="changetime2">
- <u-icon name="arrow-down-fill" color="#999" size="20"></u-icon>
- </view>
- </view>
- <view class="topbilledit" @click="typechanges">
- <view class="changetime1">
- {{mytypes}}
- </view>
- <view class="changetime2">
- <u-icon name="arrow-down-fill" color="#999" size="20"></u-icon>
- </view>
- </view>
- </view>
- <view class="u-listdata">
- <view style="padding:16rpx 0 16rpx 32rpx">
- 共有 <span style="color: red">{{totalnumber}}</span>条记录
- </view>
- <u-list @scrolltolower="scrolltolower" :pagingEnabled='true'>
- <u-list-item v-for="(item, index) in indexList" :key="index">
- <view class="companylist">
- <view class="outstanding" :style="{
- 'background-color': item.isExpedit == 1 ? '#09C700' : '#FA5555',
- }">
- {{ item.isExpedit == 1 ? "已催费" : "未催费" }}
- </view>
- <!-- <view class="outstanding" :style="{
- 'background-color': item.isSettled == 1 ? '#09C700' : '#FA5555',
- }">
- {{ item.isSettled == 1 ? "已结清" : "未结清" }}
- </view> -->
- <h3>{{item.tenantName}}</h3>
- <view class="Currentamount">
- 欠费金额: <span>¥{{item.amount}}</span>
- </view>
- <!-- <view class="Currentamount">
- 计费周期: {{item.costCycle}}
- </view> -->
- <view class="Currentamount">
- 欠费天数:¥{{item.arrearDay}}
- </view>
- <view class="Currentamount">
- 欠费类型: {{item.billType}}
- </view>
- <view class="Currentamount">
- 联系电话: {{item.phone}}
- </view>
- <view class="Callfee">
- <span @click.stop="seedetail(item)" class="one">催费记录</span>
- <span v-if="item.isSettled == 0" @click.stop="handleClick(item.id)">催费</span>
- </view>
- </view>
- </u-list-item>
- </u-list>
- </view>
- <u-picker :itemHeight="80" :show="showtype" :columns="columnstype" keyName="label" @confirm="confirmtype"
- @cancel='canceltype'>
- </u-picker>
- <u-picker :itemHeight="80" :show="showtypes" :columns="columnstypes" keyName="dictLabel" @confirm="confirmtypes"
- @cancel='canceltypes'>
- </u-picker>
- <u-notify ref="uNotify" message=""></u-notify>
- </view>
- </template>
- <script>
- // import {
- // isEmpty,
- // getDictDataList
- // } from "@/utils/index";
- export default {
- components: {},
- data() {
- const currentDate = this.getDate({
- format: 'yyyy-mm'
- })
- return {
- totalnumber: 0,
- setyesno: true,
- indexList: [],
- dataList: [],
- dataForm: {
- arrearDay: "", //欠费天数
- billType: "", //账单类型
- cycle: currentDate, //欠费周期
- isExpedit: "", //是否催费0否1是
- order: "",
- orderField: "",
- tenantName: "", //租客名称
- page: 1,
- limit: 10,
- },
- showtypes: false,
- showtype: false,
- showdct: false,
- mytitle: '',
- alldata: [],
- loading: false,
- columns: [],
- pd: true,
- columnData: [],
- myday: '',
- mytype: '欠费类型',
- mytypes: "欠费天数",
- showPicker: false,
- PayTypedata: [],
- myday: currentDate,
- columnstype: [
- [{
- label: '全部',
- id: ''
- }, {
- label: '水费',
- id: 'Water'
- },
- {
- label: '电费',
- id: 'Elec'
- },
- {
- label: '物业费',
- id: 'PropertyFee'
- }
- ]
- ],
- columnstypes: [],
- }
- },
- //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
- onLoad() {
- let getDictDataList = uni.getStorageSync('getDictDataList');
- for (let i = 0; i < getDictDataList.length; i++) {
- if (getDictDataList[i].dictType == "ArrearageDay") {
- this.columnstypes = [getDictDataList[i].dataList]
- }
- if (getDictDataList[i].dictType == 'PayType') {
- this.PayTypedata = getDictDataList[i].dataList;
- }
- }
- this.getalldata();
- // this.loadmore();
- },
- //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
- onReady() {
- // 微信小程序需要用此写法
- },
- //监听页面隐藏
- onHide() {},
- //监听窗口尺寸变化
- onResize() {},
- //监听页面卸载
- onUnload() {},
- //监听用户下拉动作,一般用于下拉刷新
- onPullDownRefresh() {},
- methods: {
- seedetail(e) {
- // console.log('222',e.tenantName)
- // console.log('111111111111111111',faltesdata)
- uni.navigateTo({
- url: `/pages/index/Immediatecollection/Chargedetails/Chargedetails?companyOrgId=${e.tenantName}`
- })
- },
- handleClick(e) {
- let Temporarydata = [e];
- let stringdata = JSON.stringify(Temporarydata);
- let finallydata = stringdata.replace(/"/g, '');
- this.$api.post('/expeditrecord/charge', finallydata)
- .then(res => {
- if (res.data.code == 0) {
- // uni.showToast({
- // title: '催费成功',
- // icon: 'none',
- // duration: 1500
- // })
- this.$refs.uNotify.success('催费成功')
- } else {
- // uni.showToast({
- // title: res.data.msg,
- // icon: 'none',
- // duration: 1500
- // })
- this.$refs.uNotify.error(res.data.msg)
- }
- let that = this;
- setTimeout(function() {
- that.dataForm.page = 1;
- that.indexList = [];
- that.getalldata();
- }, 1000);
- })
- },
- scrolltolower() {
- if (this.pd) {
- this.getalldata();
- } else {
- return
- }
- },
- typechanges() {
- this.showtypes = true;
- },
- getalldata() {
- this.$api.get('/expeditrecord/apppage', this.dataForm)
- .then(res => {
- this.totalnumber = res.data.data.total;
- if (res.data.data.list.length != 0) {
- function transform(a, b) {
- loop: for (let i = 0; i < a.length; i++) {
- for (let j = 0; j < b.length; j++) {
- if (a[i].billType == b[j].dictValue) {
- a[i].billType = b[j].dictLabel;
- continue loop;
- }
- }
- a[i].billType = a[i].billType;
- }
- return a;
- }
- res.data.data.list = transform(res.data.data.list, this.PayTypedata)
- this.indexList.push(...res.data.data.list);
- this.dataForm.page = this.dataForm.page + 1;
- this.pd = true;
- } else {
- uni.showToast({
- title: '暂无更多数据了',
- icon: 'none',
- duration: 1500
- })
- this.pd = false;
- }
- })
- },
- canceltype() {
- this.showtype = false;
- },
- confirmtype(e) {
- this.showtype = false;
- this.mytype = e.value[0].label;
- this.dataForm.billType = e.value[0].id;
- this.dataForm.page = 1;
- this.indexList = [];
- this.getalldata();
- },
- confirmtypes(e) {
- console.log('22222', e.value[0])
- if (e.value[0].dictValue == 'all') {
- this.showtypes = false;
- this.mytypes = e.value[0].dictLabel;
- this.dataForm.arrearDay = '';
- this.dataForm.page = 1;
- this.indexList = [];
- this.getalldata();
- } else {
- this.showtypes = false;
- this.mytypes = e.value[0].dictLabel;
- this.dataForm.arrearDay = e.value[0].dictValue;
- this.dataForm.page = 1;
- this.indexList = [];
- this.getalldata();
- }
- },
- canceltypes() {
- this.showtypes = false;
- },
- typechange() {
- this.showtype = true;
- },
- dateChange(e) {
- this.myday = e.target.value;
- this.dataForm.cycle = e.target.value;
- this.dataForm.page = 1;
- this.indexList = [];
- this.getalldata();
- },
- getDate(type) {
- const date = new Date();
- let year = date.getFullYear();
- let month = date.getMonth();
- if (type === 'start') {
- year = year - 60;
- } else if (type === 'end') {
- year = year + 2;
- }
- month = month > 9 ? month : '0' + month;
- // day = day > 9 ? day : '0' + day;
- return `${year}-${month}`;
- },
- }
- }
- </script>
- <style lang="scss">
- .companylist {
- margin: 24rpx 32rpx 0;
- background: #fff;
- padding: 24rpx 32rpx 0;
- border-radius: 8rpx;
- position: relative;
-
- h3 {
- margin-bottom: 24rpx;
- }
-
- .Currentamount {
- line-height: 40rpx;
- margin-bottom: 6rpx;
- color: #999;
- span {
- color: #FA5555;
- padding-left: 9rpx;
- }
- }
- .outstanding{
- position: absolute;
- width:96rpx;
- height: 48rpx;
- border-radius: 0 8rpx 0 20rpx;
- right:0;
- line-height: 48rpx;
- text-align: center;
- top:0;
- z-index: 1;
- font-size: 22rpx;
- background-color:#30D3A2 ;
- color: #fff;
- &.PropertyFee{
- background-color:#30D3A2 ;
- }
- }
-
- }
- .Callfee{
- width: 100%;
- border-top: 1px solid #eee;
- padding: 20rpx 0;
- margin-top: 24rpx;
- display: flex;
- justify-content: flex-end;
- span{
- padding: 12rpx 16rpx;
- border: 1px solid #2E69EB;
- border-radius: 8rpx;
- font-size: 24rpx;
- color: #2E69EB;
- &.one{
- border-color: #999;
- color: #999;
- margin-right:20rpx;
- }
- }
- }
- .topbill {
- display: flex;
- justify-content:center;
- align-items: center;
- height: 100rpx;
- background-color: #fff;
-
- .topbilledit {
- display: flex;
- justify-content: space-around;
- align-items: center;
- width: 110px;
- flex: 1;
- padding: 0 40rpx;
- .changetime1 {
- padding-right: 10rpx;
- }
- }
- }
- </style>
|