提交 57146561 authored 作者: 宋雄's avatar 宋雄

完善缴费统计

上级 f4023a9b
...@@ -627,3 +627,20 @@ export const payOrderApi = (params = {}, config = {})=> { ...@@ -627,3 +627,20 @@ export const payOrderApi = (params = {}, config = {})=> {
.catch(err=> { reject(err) }) .catch(err=> { reject(err) })
}) })
} }
// 历史缴费统计
export const communityPaymentStatisticsApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> {
http.get('/property-community/wechat/communityPayment/statistics',
{
data: {
...params,
residentPhone: uni.getStorageSync('user_phone'),
platformCode: uni.getStorageSync('platform_code')
},
...config
})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
const serverConfig = { const serverConfig = {
baseURL: "https://life.cloud.hjxbc.cn", baseURL: "https://life.cloud.hjxbc.cn",
imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/", imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/",
// baseURL: "http://192.168.0.106:9999", // baseURL: "http://192.168.0.103:9999",
// baseURL: "http://192.168.0.119:9999", // baseURL: "http://192.168.0.119:9999",
// baseURL: "http://220.203.25.212:9999", /* 根域名 */ // baseURL: "http://220.203.25.212:9999", /* 根域名 */
// baseURL: "http://114.67.111.37:8001" /* 根域名 */ // baseURL: "http://114.67.111.37:8001" /* 根域名 */
......
...@@ -90,9 +90,16 @@ ...@@ -90,9 +90,16 @@
}, },
toRecord(type) { toRecord(type) {
if(type == 1){ if(type == 1){
let obj = freeType.find(item=>item.code === chargeTypeCode)
if(obj) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/payCostStatistical/index', url: '/pages/payCostStatistical/index?code=' + chargeTypeCode + '&name=' + obj.name
}); });
} else {
uni.navigateTo({
url: '/pages/payCostStatistical/index?code=' + chargeTypeCode
});
}
}else if(type == 2){ }else if(type == 2){
uni.navigateTo({ uni.navigateTo({
url: '/pages/payCostRecord/index?code=' + chargeTypeCode url: '/pages/payCostRecord/index?code=' + chargeTypeCode
......
...@@ -4,28 +4,30 @@ ...@@ -4,28 +4,30 @@
<view class="property"> <view class="property">
<view class="user"> <view class="user">
<view class="name">{{userName}} {{userPhone}}</view> <view class="name">{{userName}} {{userPhone}}</view>
<view class="house-box">
<view class="add">{{platformName}}</view> <view class="add">{{platformName}}</view>
<picker @change="onHouseChange" range-key="label" :range="houseList">
<view class="uni-input">{{houseList[houseIndex].label}}</view>
</picker>
</view>
</view> </view>
<view class="screening"> <view class="screening">
<!-- <view class="title"> --> <picker @change="onYearChange" :range="yearList">
<!-- <view class="picker on"> -->
<picker @change="bindPickerChange" :value="year" :range="yearList">
<view class="uni-input">{{yearList[index]}}<image src="../../static/images/icon_up.png" class="icon"></image></view> <view class="uni-input">{{yearList[index]}}<image src="../../static/images/icon_up.png" class="icon"></image></view>
</picker> </picker>
<!-- </view> -->
<!-- </view> -->
<view class="content"> <view class="content">
<view class="text"> <view class="text">
<view class="name">合计金额(元)</view>120 <view class="name">合计金额(元)</view>{{costTotalAmount}}
</view> </view>
<view class="text"> <view class="text">
<view class="name">缴费单位</view>汉江之星物业公司 <view class="name">缴费单位</view>{{propertyName}}
</view> </view>
</view> </view>
<view class="bottom">2023年度物业费累计:220元</view> <view class="bottom" v-if="index === 0">近三年{{costName}}累计:{{costTotalAmount}}</view>
<view class="bottom" v-else>{{yearList[index]}}{{costName}}累计:{{costYearAmount}}</view>
</view> </view>
<view class="statistical"> <view class="statistical">
<qiun-data-charts type="line" :chartData="chartData" :opts="opts" background="none" /> <qiun-data-charts type="line" :chartData="chartData" :opts="opts" background="#fff" />
</view> </view>
</view> </view>
</view> </view>
...@@ -33,6 +35,11 @@ ...@@ -33,6 +35,11 @@
</template> </template>
<script> <script>
import {
getHouseListApi,
communityPaymentStatisticsApi
} from '@/config/api.js'
import {Moment} from '@/utils/moment.js'
let chargeTypeCode = '' let chargeTypeCode = ''
export default { export default {
data() { data() {
...@@ -40,22 +47,24 @@ ...@@ -40,22 +47,24 @@
userName: '', userName: '',
userPhone: '', userPhone: '',
platformName: '', platformName: '',
year: '', costName: '',
costTotalAmount: 0,
costYearAmount: 0,
houseList: [],
houseIndex: 0,
propertyName: '',
index: 0, index: 0,
yearList: ['全部', '2023年', '2022年', '2021年'], yearList: [],
month: '',
chartData: { chartData: {
categories: ["2023年", "2022年", "2021年"], categories: ['2021年', '2022年', '2023年'],
series: [{ series: [{
"name": "费用统计", "name": "费用统计",
"data": [2000, 2050, 1000] "data": [13, 34, 1200]
}] }]
}, },
opts: { opts: {
color: ["#6A59F2", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", color: ["#6A59F2", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
"#ea7ccc" padding: [15, 10, 0, 10],
],
padding: [15, 10, 0, 15],
enableScroll: false, enableScroll: false,
legend: {}, legend: {},
xAxis: { xAxis: {
...@@ -72,23 +81,82 @@ ...@@ -72,23 +81,82 @@
activeType: "hollow" activeType: "hollow"
} }
}, },
update: true
} }
} }
}, },
methods: { methods: {
bindPickerChange: function(e) { async getHouseList() {
this.index = e.detail.value let {result} = await getHouseListApi({
pageNo: 1,
pageSize: 20,
auditStatus: "auditPass"
})
if(result.total > 0) {
this.propertyName = result.records[0].propertyName
this.houseList = result.records.map(item=> {
return {
label: item.buildingName + item.unitName + item.roomName,
value: item.roomId
}
})
this.getStatistical()
}
},
async getStatistical() {
let roomId = this.houseList[this.houseIndex].value
let year = this.index === 0 ? '0' : this.yearList[this.index].replace('年', '')
let {result} = await communityPaymentStatisticsApi({
roomId,
chargeTypeCode,
year
})
let yearList = []
let yearData = []
result.forEach(item=> {
if(this.index === 0) {
yearList.push(`${item.YEAR}`)
} else {
yearList.push(`${item.MONTH}`)
}
yearData.push(item.totalAmount)
})
this.costYearAmount = yearData.reduce((pra, cur)=> {
return pra + cur
}, 0)
if(this.index === 0) {
this.costTotalAmount = this.costYearAmount
}
this.chartData.categories = yearList
this.chartData.series = [
{
name: `${this.costName}统计`,
data: yearData
}
]
}, },
bindPickerChange1: function(e) { onHouseChange(e) {
this.index1 = e.detail.value this.houseIndex = Number(e.detail.value)
this.index = 0
this.getStatistical()
}, },
async onYearChange(e) {
this.index = Number(e.detail.value)
this.getStatistical()
}
}, },
onLoad(option) { onLoad(option) {
this.userName = uni.getStorageSync('user_name') this.userName = uni.getStorageSync('user_name')
this.userPhone = uni.getStorageSync('user_phone') this.userPhone = uni.getStorageSync('user_phone')
this.platformName = uni.getStorageSync('platform_name') this.platformName = uni.getStorageSync('platform_name')
this.costName = option.name || '费用'
chargeTypeCode = option.code chargeTypeCode = option.code
// this.getList()
let nowYear = new Moment().format('YYYY')
let lastYear = (Number(nowYear) - 1).toString() + '年'
let beforeear = (Number(nowYear) - 2).toString() + '年'
this.yearList = ['全部', beforeear, lastYear, nowYear + '年']
this.getHouseList()
} }
} }
</script> </script>
...@@ -118,10 +186,48 @@ ...@@ -118,10 +186,48 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.house-box {
display: flex;
align-items: center;
.add { .add {
font-size: 28rpx; font-size: 28rpx;
color: #D5DCFF; color: #D5DCFF;
} }
.uni-input {
color: #D5DCFF;
margin-left: 30rpx;
position: relative;
&::after {
position: absolute;
content: " ";
width: 0;
height: 0;
top: 50%;
right: -15px;
border-top: 6px solid #D5DCFF;
border-right: 6px solid transparent;
border-left: 6px solid transparent;
transform-origin: center;
transform: translateY(-50%);
}
}
}
}
.uni-input {
font-size: 28rpx;
color: #373737;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.icon {
width: 20rpx;
height: 12rpx;
margin-left: 15rpx;
} }
.screening { .screening {
...@@ -149,19 +255,9 @@ ...@@ -149,19 +255,9 @@
// } // }
// } // }
} }
.uni-input { .uni-input {
font-size: 28rpx;
color: #373737; color: #373737;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.icon {
width: 20rpx;
height: 12rpx;
margin-left: 15rpx;
} }
.content { .content {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论