Browse Source

费用报表wt

Shannon_mu 3 years ago
parent
commit
d09e88cbf1

+ 4 - 4
operationSupport/src/views/payService/billingRules/stepPage/newAdd.vue

@@ -11,8 +11,8 @@
                 <el-option label="水费" :value="2"></el-option>
                 <el-option label="电费" :value="3"></el-option>
                 <el-option label="车位费" :value="4"></el-option>
-                <el-option label="卫生费" :value="5"></el-option>
-                <el-option label="其他" :value="6"></el-option>
+                <el-option label="卫生费" :value="6"></el-option>
+                <el-option label="其他费用" :value="7"></el-option>
             </el-select>
         </el-form-item>
         <el-form-item label="费用名称" prop="chargeName">
@@ -79,8 +79,8 @@
         <!-- 生成规则除水电费 -->
         <el-form-item label="生成规则" v-if="formData.chargeType !== 2 && formData.chargeType !== 3">
             <el-select v-model="formData.generationRules">
-                <el-option label="当月生成上月" :value="1"></el-option>
-                <el-option label="当月生成当月" :value="2"></el-option>
+                <el-option label="预生成账单" :value="1"></el-option>
+                <el-option label="后生成账单" :value="2"></el-option>
             </el-select>
         </el-form-item>
 

+ 30 - 28
operationSupport/src/views/payService/propertyFee/index.vue

@@ -14,13 +14,7 @@
                     v-trim
                     v-model.trim="mixins_query.chargeName"
                 ></el-input>
-                <el-button
-                    class="search-btn"
-                    type="primary"
-                    @click="mixins_search()"
-                    icon="el-icon-search"
-                    >搜索</el-button
-                >
+                <el-button class="search-btn" type="primary" @click="mixins_search()" icon="el-icon-search">搜索</el-button>
                 <div class="search-icon">
                     <el-tooltip
                         v-show="chargeStatus == 1 && chiData.type === 'room'"
@@ -48,6 +42,10 @@
                 @page-change="pageChange"
                 @selection-change="selectionChange"
             >
+                <template slot-scope="scope" slot="payBeginTime">
+                    {{ typeTimeTransition(scope.row.payBeginTime, scope.row.payEndTime) }}
+                </template>
+
                 <template slot-scope="scope" slot="opt">
                     <div class="opt">
                         <el-tooltip v-show="chargeStatus == 1" class="item" effect="light" placement="bottom" content="收款">
@@ -68,7 +66,7 @@ import list from '@/utils/list.js';
 
 export default {
     mixins: [list],
-    name:"propertyFee",
+    name: 'propertyFee',
     data() {
         return {
             currentId: '',
@@ -90,8 +88,10 @@ export default {
                     prop: 'chargeName'
                 },
                 {
-                    label: '账期',
-                    prop: 'paymentDays'
+                    label: '计费日期',
+                    prop: 'payBeginTime',
+                    slot: 'payBeginTime',
+                    width: '150'
                 },
                 {
                     label: '费用金额(元)',
@@ -131,25 +131,13 @@ export default {
                 },
                 {
                     label: '费用名称',
-                    prop:'chargeName',
-                    // prop: 'chargeType',
-                    // format(val) {
-                    //     if (val == '1') {
-                    //         return '物业费';
-                    //     } else if (val == '2') {
-                    //         return '水费';
-                    //     } else if (val == '3') {
-                    //         return '电费';
-                    //     } else if (val == '4') {
-                    //         return '车位费';
-                    //     } else if (val == '5') {
-                    //         return '二次供水费';
-                    //     }
-                    // }
+                    prop: 'chargeName'
                 },
                 {
-                    label: '账期',
-                    prop: 'paymentDays'
+                    label: '计费日期',
+                    prop: 'payBeginTime',
+                    slot: 'payBeginTime',
+                    width: '150'
                 },
                 {
                     label: '费用金额(元)',
@@ -274,6 +262,20 @@ export default {
         },
         exportExcel() {
             this.__exportExcel('/sc-charge/charge/report/export/excel', this.mixins_query);
+        },
+        typeTimeTransition(start, end) {
+            let text = '';
+            if (!!end) {
+                let f = new Date(start).getMonth(),
+                    l = new Date(end).getMonth();
+                if (f == l) {
+                    text = `${this.$moment(new Date(start)).format('YYYY年M月')}`;
+                } else {
+                    text = `${this.$moment(new Date(start)).format('YYYY年M月')}-${this.$moment(new Date(end)).format('YYYY年M月')}`;
+                }
+            }
+
+            return text;
         }
     },
     watch: {
@@ -318,7 +320,7 @@ export default {
     created() {
         this.mixins_dataUrl = '/sc-charge/charge/bill/page'; // 分页查询接口
         this.mixins_query = {
-            chargeStatus: this.chargeStatus,
+            chargeStatus: this.chargeStatus
             // chargeType: 1
         };
     }

+ 25 - 4
operationSupport/src/views/payService/propertyFee/stepPage/bulk.vue

@@ -2,7 +2,11 @@
     <div>
         <div class="formContent-item_title marginNone">{{ chiData.address }}</div>
         <div class="formContent-item_title noneBef">{{ assets }}</div>
-        <zz-table :settings="{ showIndex: true, stripe: true, hidePagination: true }" :cols="cols" :data="tabList"> </zz-table>
+        <zz-table :settings="{ showIndex: true, stripe: true, hidePagination: true }" :cols="cols" :data="tabList">
+            <template slot-scope="scope" slot="payBeginTime">
+                {{ typeTimeTransition(scope.row.payBeginTime, scope.row.payEndTime) }}
+            </template>
+        </zz-table>
         <el-form ref="form" :model="formData" :rules="formRules" label-width="110px">
             <div class="inline">
                 <el-form-item label="支付方式:" prop="payType">
@@ -50,8 +54,10 @@ export default {
                     }
                 },
                 {
-                    label: '账期',
-                    prop: 'paymentDays'
+                    label: '计费日期',
+                    prop: 'payBeginTime',
+                    slot: 'payBeginTime',
+                    width: '150'
                 },
                 {
                     label: '费用金额(元)',
@@ -91,7 +97,8 @@ export default {
             arr.forEach((item) => {
                 v += Number(item[val]);
             });
-            return v;
+            return Math.floor(v * 100) / 100;
+            // v.toFixed(2)
         },
         submit() {
             this.$refs.form.validate((valid) => {
@@ -153,6 +160,20 @@ export default {
                 .catch(() => {
                     loading.close();
                 });
+        },
+        typeTimeTransition(start, end) {
+           let text = '';
+            if (!!end) {
+                let f = start.slice(5, 7),
+                    l = end.slice(5, 7);
+                if (Number(f) == Number(l)) {
+                    text = start;
+                } else {
+                    text = `${start.slice(0, 8)}-${end.slice(0, 8)}`;
+                }
+            }
+
+            return text;
         }
     },
     created() {

+ 42 - 6
operationSupport/src/views/payService/propertyFee/stepPage/single.vue

@@ -4,10 +4,10 @@
         <el-form ref="form" :model="formData" :rules="formRules" label-width="110px">
             <template v-for="(item, index) in formLook">
                 <el-col :span="12" :key="index">
-                    <el-form-item :label="item.label">
+                    <el-form-item :label="labelType(item.label, item.prop)">
                         <template v-if="item.slot">
                             <template v-if="item.slot === 'chargeMode'">
-                                {{ thisItem[item.prop] === 1 ? '固定收费' : '价格*面积收费' }}
+                                {{ !!chargeModeValue[thisItem[item.prop]] ? chargeModeValue[thisItem[item.prop]] : '--' }}
                             </template>
                             <template v-if="item.slot === 'chargeStatus'">
                                 <span class="redText">未缴费</span>
@@ -17,7 +17,7 @@
                             {{ thisItem[item.prop] || '--' }}
                         </template>
                         <template v-if="item.slot === 'payEndTime'">
-                            <div style="white-space: nowrap">{{ thisItem.payBeginTime }} - {{ thisItem.payEndTime }}</div>
+                            <div style="white-space: nowrap">{{ typeTimeTransition(thisItem.payBeginTime, thisItem.payEndTime) }}</div>
                         </template>
                     </el-form-item>
                 </el-col>
@@ -50,13 +50,18 @@ export default {
     props: ['params'],
     data() {
         return {
+            chargeModeValue: {
+                1: '固定收费',
+                2: '价格*面积收费',
+                4: '单价*用量'
+            },
             formLook: [
                 {
                     label: '费用名称:',
                     prop: 'chargeName'
                 },
                 {
-                    label: '计费标准:',
+                    label: '计费方式:',
                     prop: 'chargeMode',
                     slot: 'chargeMode'
                 },
@@ -65,7 +70,7 @@ export default {
                     prop: 'assetsArea'
                 },
                 {
-                    label: '价(元):',
+                    label: '价(元/月):',
                     prop: 'chargePrice'
                 },
                 {
@@ -94,7 +99,7 @@ export default {
                     prop: 'phone'
                 },
                 {
-                    label: '账单费日期:',
+                    label: '账单费日期:',
                     prop: 'payEndTime',
                     slot: 'payEndTime'
                 }
@@ -161,6 +166,37 @@ export default {
                     }
                 })
                 .catch(() => {});
+        },
+        typeTimeTransition(start, end) {
+            let text = '';
+            if (!!end) {
+                let f = start.slice(5, 7),
+                    l = end.slice(5, 7);
+                if (Number(f) == Number(l)) {
+                    text = start;
+                } else {
+                    text = `${start.slice(0, 8)}-${end.slice(0, 8)}`;
+                }
+            }
+
+            return text;
+        },
+        labelType(lab, val) {
+            let type = this.thisItem['chargeType'];
+            if (val == 'assetsArea') {
+                if (type == 2) {
+                    lab = '用量(吨)';
+                } else if (type == 3) {
+                    lab = '用量(度)';
+                }
+            } else if (val == 'chargePrice') {
+                if (type == 2) {
+                    lab = '价格(元/吨)';
+                } else if (type == 3) {
+                    lab = '价格(元/度)';
+                }
+            }
+            return lab;
         }
     },
     created() {

+ 2 - 2
operationSupport/src/views/payService/propertyFee/stepPage/temporary.vue

@@ -18,7 +18,7 @@
             </el-date-picker>
         </el-form-item>
         <el-form-item label="用量" v-if="formData.chargeType == 2 || formData.chargeType == 3">
-            <el-input v-model="formData.amount"></el-input>
+            <el-input v-model="formData.quantity"></el-input>
         </el-form-item>
     </el-form>
 </template>
@@ -34,7 +34,7 @@ export default {
                 chargeType: '',
                 chargeStartTime: '2021-09',
                 chargeEndTime: '2021-09',
-                amount:'',
+                quantity:'',
             },
             times: [],
             selectData: [],

+ 101 - 79
operationSupport/src/views/payService/statisticalReport/chargeStatistics.vue

@@ -1,8 +1,8 @@
 <template>
     <div class="main">
         <div class="search">
-            <el-input class="search-input" v-model="mixins_query.name" placeholder="输入业主/房间号"></el-input>
-            <el-select v-model="mixins_query.communityId" placeholder="选择社区" clearable>
+            <el-input class="search-input" v-model="mixins_query.likeValue" placeholder="输入业主/房间号" clearable></el-input>
+            <el-select v-model="mixins_query.communityId" placeholder="选择社区" @change="communityChange">
                 <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
             </el-select>
             <el-date-picker
@@ -13,6 +13,7 @@
                 start-placeholder="选择开始日期"
                 end-placeholder="选择结束日期"
                 @change="effectiveDateToggle"
+                :clearable="false"
             ></el-date-picker>
 
             <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
@@ -23,13 +24,13 @@
             </div>
         </div>
         <div class="table-top">
-            <div class="table-top_block">
-                <div>海逸一号收费统计</div>
-                <div>2021年1月-2021年3月</div>
+            <div class="table-top_block title">
+                <div>{{ thisObjCommunit['communityName'] }}收费统计</div>
+                <div>{{ timeFiterType() }}</div>
             </div>
             <div class="table-top_block blockColor" v-for="item in blockArr" :key="item">
+                <div class="number">{{ item.val }}</div>
                 <div>{{ item.label }}</div>
-                <div>{{ item.val }}</div>
             </div>
         </div>
         <zz-table
@@ -40,6 +41,9 @@
             :pageset="mixins_pageset"
             @page-change="pageChange"
         >
+            <template slot-scope="scope" :slot="'type' + index" v-for="(item, index) in blockArr">
+                <div :key="index" class="111">{{ scope.row['details'][index].amount }}</div>
+            </template>
         </zz-table>
     </div>
 </template>
@@ -49,6 +53,7 @@ import list from '@utils/list.js';
 export default {
     mixins: [list],
     data() {
+        let _this = this;
         return {
             cols: [
                 {
@@ -57,97 +62,74 @@ export default {
                 },
                 {
                     label: '房间',
-                    prop: 'assets'
+                    prop: 'houseDetail'
                 },
                 {
                     label: '业主',
-                    prop: 'createDate'
+                    prop: 'residentName'
                 },
                 {
                     label: '物业费标准(元/月)',
-                    prop: 'paymentMethod',
-                    format(val) {
-                        if (val == '1') {
-                            return '微信';
-                        } else if (val == '2') {
-                            return '支付宝';
-                        } else if (val == '3') {
-                            return '现金';
-                        } else if (val == '4') {
-                            return '预存';
-                        } else if (val == '5') {
-                            return '其他';
-                        }
-                    }
+                    prop: 'chargingStandard'
                 },
                 {
                     label: '月数',
-                    prop: 'userName'
-                },
-                {
-                    label: '物业费(元)',
-                    prop: 'phone'
-                },
-                {
-                    label: '水费(元)',
-                    prop: 'amount'
-                },
-                {
-                    label: '电费(元)',
-                    prop: 'remark'
-                },
-                {
-                    label: '车位管理费(元)',
-                    prop: 'remark'
-                },
-                {
-                    label: '卫生费(元)',
-                    prop: 'remark'
-                },
-                {
-                    label: '电梯维修费(元)',
-                    prop: 'remark'
-                },
-                {
-                    label: '外墙砖维修费(元)',
-                    prop: 'remark'
-                },
-                {
-                    label: '摩托租赁费(元)',
-                    prop: 'remark'
+                    prop: 'months'
                 },
                 {
                     label: '合计',
-                    prop: 'remark'
+                    prop: 'totalAmount'
                 }
             ],
             mixins_post: 'post',
             times: [],
             communityArr: [],
-            blockArr: [
-                { label: '总收费', val: '11111' },
-                { label: '物业费', val: '11111' },
-                { label: '水费', val: '11111' },
-                { label: '电费', val: '11111' },
-                { label: '车位管理费', val: '11111' },
-                { label: '卫生费', val: '11111' },
-                { label: '其他费用', val: '11111' }
-            ]
+            blockArr: [],
+            thisObjCommunit: {}
         };
     },
     created() {
-        this.mixins_dataUrl = '/sc-charge/payment/record/page';
-        this.mixins_query = {
-            accountType: 2,
-            paymentType: 1
-        };
-        this.mixins_search();
-        this.getorgTree();
+        let thisDay = this.$moment(new Date()).format('YYYY-MM');
+        this.times = [thisDay, thisDay];
+        new Promise((resolve) => {
+            this.getorgTree(resolve);
+        }).then(() => {
+            this.initSearchData(thisDay);
+            this.mixins_dataUrl = '/sc-charge/charge/report/page';
+            this.mixins_search();
+        });
     },
     mounted() {},
+    watch: {
+        mixins_list(val) {
+            if (!!val) {
+                if (val.length) {
+                    let arr = [{ label: '总收费', val: val[0].totalAmount }];
+                    val[0].details.map((item, index) => {
+                        arr.push({ label: item.chargeName, val: item.amount });
+                        this.cols.splice(4 + index, 0, {
+                            label: item.chargeName,
+                            prop: 'type' + index,
+                            slot: 'type' + index
+                        });
+                    });
+                    this.blockArr = arr;
+                } else {
+                    this.blockArr = [];
+                }
+            }
+        }
+    },
     methods: {
+        initSearchData(time) {
+            this.mixins_query = {
+                communityId: this.thisObjCommunit.id,
+                startTime: time,
+                endTime: time
+            };
+        },
         exportExcel() {
-            this.__exportExcel('/sc-charge/payment/record/export/excel', this.mixins_query);
+            this.__exportExcel('/sc-charge/charge/report/export/excel', this.mixins_query);
         },
         effectiveDateToggle(va) {
             let arr = va;
@@ -156,16 +138,42 @@ export default {
             }
             this.mixins_query.startTime = arr[0];
             this.mixins_query.endTime = arr[1];
+            this.mixins_search();
         },
-        getorgTree() {
+        getorgTree(resolve) {
             this.$http
                 .get('/sc-community/assets/community/list')
                 .then((data) => {
                     this.communityArr = data.data;
+                    this.thisObjCommunit = this.communityArr[0];
                     this.$store.commit('setAreaSelect', data.data);
+                    resolve && resolve();
                 })
 
                 .catch(function () {});
+        },
+        communityChange(e) {
+            this.communityArr.find((item) => {
+                if (item.id == e) {
+                    this.thisObjCommunit = item;
+                    this.mixins_search();
+                }
+            });
+        },
+        timeFiterType() {
+            let arr = this.times;
+            let text = '';
+            if (!arr) {
+                arr = ['', ''];
+            }
+            let f = new Date(arr[0]).getMonth(),
+                l = new Date(arr[1]).getMonth();
+            if (f == l) {
+                text = `${this.$moment(new Date(arr[0])).format('YYYY年M月')}`;
+            } else {
+                text = `${this.$moment(new Date(arr[0])).format('YYYY年M月')}-${this.$moment(new Date(arr[1])).format('YYYY年M月')}`;
+            }
+            return text;
         }
     }
 };
@@ -179,15 +187,29 @@ export default {
     padding: 10px 0;
     .table-top_block {
         height: 60px;
-        line-height: 30px;
+        line-height: 20px;
         text-align: center;
-
         margin-left: 20px;
+        &.title {
+            font-size: 16px;
+            font-weight: 600;
+            color: #0eaeff;
+            line-height: 27px;
+            border-right: 1px solid #eee;
+            padding-right: 60px;
+        }
         &.blockColor {
             width: 150px;
-            background: $mainTextColor;
-            color: white;
-            border-radius: 5px;
+            text-align: left;
+            border-right: 1px solid #eee;
+            &:last-child {
+                border: none;
+            }
+            .number {
+                font-size: 24px;
+                font-weight: 600;
+                line-height: 33px;
+            }
         }
     }
 }

+ 82 - 29
operationSupport/src/views/payService/statisticalReport/propertyFeeStatistics.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="main">
         <div class="search">
-            <el-select v-model="mixins_query.communityId" placeholder="选择社区" clearable>
+            <el-select v-model="mixins_query.communityId" placeholder="选择社区"  @change="communityChange">
                 <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
             </el-select>
             <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
@@ -11,15 +11,23 @@
                 </el-tooltip>
             </div>
         </div>
+        <div class="table-top">
+            {{ `${new Date().getFullYear()}年${thisObjCommunit['communityName']}缴纳物业管理费情况表` }}
+        </div>
         <zz-table
             :cols="cols"
-            :settings="{ showIndex: false, stripe: true, summaryCol: summaryColData }"
+            :settings="{ showIndex: false, stripe: true, summaryCol: summaryColData, hideFoot: true }"
             :loading="mixins_onQuery"
             :summaryData="{}"
             :data="mixins_list"
-            :pageset="mixins_pageset"
-            @page-change="pageChange"
         >
+            <template slot-scope="scope" slot="quarter">
+                <span v-if="scope.row.quarter === 1">缴第一季度(1-3月) </span>
+                <span v-if="scope.row.quarter === 2">缴第二季度(4-6月)</span>
+                <span v-if="scope.row.quarter === 3">缴第三季度(7-9月) </span>
+                <span v-if="scope.row.quarter === 4">缴第四季度(10-12月) </span>
+                <span v-if="scope.row.quarter === 5">缴纳{{ new Date().getFullYear() }}年之前欠费</span>
+            </template>
         </zz-table>
     </div>
 </template>
@@ -33,90 +41,135 @@ export default {
             cols: [
                 {
                     label: '缴费情况',
-                    prop: 'communityName'
+                    prop: 'quarter',
+                    slot: 'quarter'
                 },
                 {
                     label: '01月',
-                    prop: 'amount'
+                    prop: 'january'
                 },
                 {
                     label: '02月',
-                    prop: 'amount'
+                    prop: 'february'
                 },
                 {
                     label: '03月',
-                    prop: 'amount'
+                    prop: 'march'
                 },
                 {
                     label: '04月',
-                    prop: 'amount'
+                    prop: 'april'
                 },
                 {
                     label: '05月',
-                    prop: 'amount'
+                    prop: 'may'
                 },
                 {
                     label: '06月',
-                    prop: 'amount'
+                    prop: 'june'
                 },
                 {
                     label: '07月',
-                    prop: 'amount'
+                    prop: 'july'
                 },
                 {
                     label: '08月',
-                    prop: 'amount'
+                    prop: 'august'
                 },
                 {
                     label: '09月',
-                    prop: 'amount'
+                    prop: 'september'
                 },
                 {
                     label: '10月',
-                    prop: 'amount'
+                    prop: 'october'
                 },
                 {
                     label: '11月',
-                    prop: 'amount'
+                    prop: 'november'
                 },
                 {
                     label: '12月',
-                    prop: 'amount'
+                    prop: 'december'
                 },
                 {
                     label: '合计',
                     prop: 'total'
                 }
             ],
-            mixins_post: 'post',
+            mixins_post: 'get',
             summaryColData: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
-            communityArr: []
+            communityArr: [],
+            thisObjCommunit: {}
         };
     },
     created() {
-        this.mixins_dataUrl = '/sc-charge/payment/record/page';
-        this.mixins_query = {
-            accountType: 1,
-            paymentType: 1
-        };
-        this.mixins_search();
-        this.getorgTree();
+        new Promise((resolve) => {
+            this.getorgTree(resolve);
+        }).then(() => {
+            this.mixins_dataUrl = '/sc-charge/charge/report/months/list';
+            this.mixins_query = {
+                chargeType: 1,
+                year: new Date().getFullYear(),
+                communityId: this.thisObjCommunit.id
+            };
+            this.mixins_search();
+        });
     },
     mounted() {},
     methods: {
         exportExcel() {
-            this.__exportExcel('/sc-charge/payment/record/export/excel', this.mixins_query);
+            this.__exportExcel('/sc-charge/charge/report/months/export/excel', this.mixins_query);
         },
-        getorgTree() {
+        getorgTree(resolve) {
             this.$http
                 .get('/sc-community/assets/community/list')
                 .then((data) => {
                     this.communityArr = data.data;
+                    this.thisObjCommunit = this.communityArr[0];
                     this.$store.commit('setAreaSelect', data.data);
+                    resolve && resolve();
                 })
 
                 .catch(function () {});
+        },
+        communityChange(e) {
+            this.communityArr.find((item) => {
+                if (item.id == e) {
+                    this.thisObjCommunit = item;
+                    this.mixins_search();
+                }
+            });
+        },
+        getList() {
+            if (!this.mixins_dataUrl) {
+                this.mixins_onQuery = false;
+                return;
+            }
+            let data = Object.assign({}, this.mixins_pageset, this.mixins_query);
+            this.mixins_onQuery = true;
+
+            this.$http[this.mixins_post](this.mixins_dataUrl, data)
+                .then(({ status, data, msg }) => {
+                    this.mixins_onQuery = false;
+                    if (0 === status) {
+                        this.mixins_list = data;
+                    } else {
+                        this.$message.error(msg);
+                    }
+                })
+                .catch((err) => {
+                    this.mixins_onQuery = false;
+                });
         }
     }
 };
-</script>
+</script>
+<style lang="scss" scoped>
+.table-top {
+    height: 60px;
+    line-height: 60px;
+    background: white;
+    text-align: center;
+}
+</style>