Browse Source

收款账号

Shannon_mu 3 years ago
parent
commit
c1727e9851

+ 5 - 5
operationSupport/src/router/index.js

@@ -90,11 +90,11 @@ const zRoute = [
         component: () => import(/* webpackChunkName: "404" */ '@views/payService/chargeSetting/index.vue'),
         meta: { title: '收费设置' }
     },
-    // {
-    //     path: '/collection/index',
-    //     component: () => import(/* webpackChunkName: "404" */ '@views/payService/collection/index.vue'),
-    //     meta: { title: '收款账号' }
-    // },
+    {
+        path: '/collection/index',
+        component: () => import(/* webpackChunkName: "404" */ '@views/payService/collection/index.vue'),
+        meta: { title: '收款账号' }
+    },
     {
         path: '/electricManagement/index',
         component: () => import(/* webpackChunkName: "404" */ '@views/payService/electricManagement/index.vue'),

+ 6 - 1
operationSupport/src/views/payService/chargeSetting/index.vue

@@ -189,18 +189,23 @@ export default {
                     this.chiData.value = newValue.value;
                     this.chiData.address = newValue.name;
                 } else if (newValue.type === 'building') {
+                    this.mixins_query.communityId = newValue.communityId;
                     this.mixins_query.buildingId = newValue.buildingId;
                     this.chiData.type = 2;
                     this.chiData.value = newValue.buildingId;
                     this.chiData.address = newValue.name;
                 } else if (newValue.type === 'unit') {
+                    this.mixins_query.communityId = newValue.communityId;
                     this.mixins_query.buildingId = newValue.buildingId;
                     this.mixins_query.unitName = newValue.unitId;
                     this.chiData.type = 3;
                     this.chiData.value = newValue.buildingId + ':' + newValue.name;
                     this.chiData.address = newValue.name;
                 } else if (newValue.type === 'room') {
-                    this.mixins_query.roomNumber = newValue.roomId;
+                    this.mixins_query.communityId = newValue.communityId;
+                    this.mixins_query.buildingId = newValue.buildingId;
+                    this.mixins_query.unitName = newValue.unitId;
+                    this.mixins_query.houseId = newValue.roomId;
                     this.chiData.type = 4;
                     this.chiData.value = newValue.buildingId + ':' + newValue.name;
                     this.chiData.address = newValue.name;

+ 183 - 2
operationSupport/src/views/payService/collection/index.vue

@@ -1,5 +1,186 @@
 <template>
-    <div>收款账号</div>
+    <div class="main">
+        <div class="search">
+            <dmp-newsearch :normal="normal" :query="mixins_query" @search="queryList">
+                <template slot="companyOrgId">
+                    <select-tree
+                        class="new-select-tree"
+                        selectTreeTitle="请选择公司"
+                        placeholder="请选择公司"
+                        :options="companyArray"
+                        :props="defaultProps"
+                        v-model="mixins_query.companyOrgId"
+                    />
+                </template>
+                <div class="search-icon opt" slot="right-opt">
+                    <el-tooltip class="item" effect="light" placement="bottom" content="新增">
+                        <i class="iconfont" @click="addOrEdit('add')">&#xe641;</i>
+                    </el-tooltip>
+                </div>
+            </dmp-newsearch>
+        </div>
+        <div class="roles-wrap">
+            <zz-table
+                :cols="cols"
+                :settings="{ showIndex: true, stripe: true }"
+                :loading="mixins_onQuery"
+                :data="mixins_list"
+                :pageset="mixins_pageset"
+                @page-change="pageChange"
+            >
+                <template slot-scope="scope" slot="opt">
+                    <div class="opt">
+                        <el-tooltip effect="light" placement="bottom" content="编辑">
+                            <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope.row)"></i>
+                        </el-tooltip>
+                        <el-tooltip effect="light" placement="bottom" content="删除">
+                            <i class="zoniot_font zoniot-icon-shanchu redText" @click="deluserbyidFn(scope.row.id)"></i>
+                        </el-tooltip>
+                    </div>
+                </template>
+            </zz-table>
+        </div>
+    </div>
 </template>
+
 <script>
-</script>
+import list from '@utils/list.js';
+export default {
+    mixins: [list],
+    data() {
+        return {
+            cols: [
+                {
+                    label: '公司名称',
+                    prop: 'companyName'
+                },
+                {
+                    label: '类型',
+                    prop: 'payeeType',
+                    format(val) {
+                        if (val == '1') {
+                            return '微信';
+                        } else if (val == '2') {
+                            return '支付宝';
+                        }
+                    }
+                },
+                {
+                    label: '商户号',
+                    prop: 'merchantNumber'
+                },
+                {
+                    label: '支付密钥',
+                    prop: 'paymentSecretKey'
+                },
+                {
+                    label: '应用ID',
+                    prop: 'appId'
+                },
+                {
+                    label: '应用密钥',
+                    prop: 'appSecretKey'
+                },
+                {
+                    label: '操作',
+                    prop: 'id',
+                    slot: 'opt'
+                }
+            ],
+            defaultProps: {
+                value: 'id', // 唯一标识
+                label: 'orgName', // 标签显示
+                children: 'orgs' // 子级
+            },
+            normal: [
+                {
+                    prop: 'companyOrgId',
+                    slot: 'companyOrgId'
+                }
+            ],
+            productOptions: [],
+            mixins_post: 'post'
+        };
+    },
+    computed: {
+        companyArray() {
+            return this.$store.getters['getCompanyArray'];
+        }
+    },
+    created() {
+        if (this.$store.getters['getCompanyArray'].length === 0) {
+            this.getCompany('company');
+        }
+        if (this.$store.getters['getDepartmentArray'].length === 0) {
+            this.getCompany('department');
+        }
+        this.mixins_dataUrl = '/sc-charge/payee/account/page';
+        this.mixins_query = {};
+        this.mixins_search();
+    },
+    mounted() {
+        this.getProductOptions();
+    },
+    methods: {
+        queryList(type = 'search') {
+            this.mixins_search(type);
+        },
+        getCompany(type) {
+            this.$http.postForm('/sc-user-center/org/getOrgTree', { orgType: type }).then(({ status, data, msg }) => {
+                if (status === 0 && data) {
+                    if (type == 'company') {
+                        this.$store.commit('setCompanyArray', data);
+                    } else if (type == 'department') {
+                        this.$store.commit('setDepartmentArray', data);
+                    }
+                }
+            });
+        },
+        deluserbyidFn(id) {
+            this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
+                .then(() => {
+                    this.$http.postForm('/sc-charge/scChargeStrategy/delete', { id: id }).then(({ status, data, msg }) => {
+                        if (0 === status) {
+                            this.$message({
+                                type: 'success',
+                                message: '删除成功!'
+                            });
+                            this.mixins_search();
+                        } else {
+                            this.$message.error(msg);
+                        }
+                    });
+                })
+                .catch(() => {});
+        },
+        addOrEdit(todo, data = {}) {
+            new Promise((resolve) => {
+                let title = '添加收款账号';
+                if (todo == 'add') {
+                } else {
+                    title = '修改收款账号';
+                }
+                this.$store.dispatch('addPopup', {
+                    url: '/payService/collection/stepPage/add.vue',
+                    width: '524px',
+                    height: '600px',
+                    props: {
+                        data,
+                        todo,
+                        companyArray: this.companyArray,
+                        callback: resolve
+                    },
+                    title: title
+                });
+            }).then(() => {
+                this.mixins_search();
+            });
+        },
+        getProductOptions() {
+            this.$http.postForm('/sc-community/devicetype/selectList', { name: '' }).then((data) => {
+                this.productOptions = data;
+            });
+        }
+    }
+};
+</script>

+ 205 - 0
operationSupport/src/views/payService/collection/stepPage/add.vue

@@ -0,0 +1,205 @@
+<template>
+    <zz-form :cols="formCols" :data="formData" :rules="formRules" labelWidth="90" ref="form">
+        <template slot="companyOrgId">
+            <select-tree
+                class="new-select-tree"
+                selectTreeTitle="请选择公司"
+                placeholder="请选择公司"
+                :options="params.companyArray"
+                :props="defaultProps"
+                v-model="formData.companyOrgId"
+            />
+        </template>
+        <template slot="payeeType">
+            <el-select class="width65" v-model="formData.payeeType" clearable>
+                <el-option label="微信" :value="1"></el-option>
+                <el-option label="支付宝" :value="2"></el-option>
+            </el-select>
+        </template>
+        <template slot="authFile">
+            <el-input v-model="formData.authFile" disabled placeholder="请上传授权文件">
+                <i slot="suffix" class="zoniot_font zoniot-icon-shangchuan1" @click="QueryClick"></i>
+            </el-input>
+            <el-upload
+                style="display: none"
+                :headers="token"
+                ref="uploaduserlogo"
+                limit="1"
+                action="/sc-charge/payee/account/uploadFile"
+                :on-success="uploadsuccess"
+                :before-upload="beforeAvatarUpload"
+                :auto-upload="true"
+                name="file"
+            >
+            </el-upload>
+        </template>
+    </zz-form>
+</template>
+<script >
+export default {
+    props: ['params'],
+    data() {
+        return {
+            formData: {
+                companyOrgId: '',
+                payeeType: '',
+                merchantNumber: '',
+                paymentSecretKey: '',
+                appId: '',
+                appSecretKey: '',
+                officialAccountsId: '',
+                messageId: '',
+                authFile: ''
+            },
+            formRules: {
+                companyOrgId: [this.$valid.selectRequired('公司')],
+                payeeType: [this.$valid.selectRequired('充值方式')],
+                merchantNumber: [this.$valid.inputRequired('商户号')],
+                paymentSecretKey: [this.$valid.inputRequired('支付密钥')],
+                appId: [this.$valid.inputRequired('应用ID')],
+                appSecretKey: [this.$valid.inputRequired('应用密钥')],
+                authFile: [this.$valid.inputRequired('授权文件')]
+            },
+            formCols: [
+                [
+                    {
+                        label: '公司',
+                        prop: 'companyOrgId',
+                        slot: 'companyOrgId'
+                    },
+                    {
+                        label: '类型',
+                        prop: 'payeeType',
+                        slot: 'payeeType'
+                    },
+                    {
+                        label: '商户号',
+                        prop: 'merchantNumber',
+                        input: true
+                    },
+                    {
+                        label: '支付密钥',
+                        prop: 'paymentSecretKey',
+                        input: true
+                    },
+                    {
+                        label: '应用ID',
+                        prop: 'appId',
+                        input: true
+                    },
+                    {
+                        label: '应用密钥',
+                        prop: 'appSecretKey',
+                        input: true
+                    },
+                    {
+                        label: '公众号ID',
+                        prop: 'officialAccountsId',
+                        input: true
+                    },
+                    {
+                        label: '消息模板ID',
+                        prop: 'messageId',
+                        input: true
+                    },
+                    {
+                        label: '授权文件',
+                        prop: 'authFile',
+                        slot: 'authFile'
+                    }
+                ]
+            ],
+            token: {
+                [localStorage.getItem('SC_token') && 'Authorization']: 'Bearer ' + localStorage.getItem('SC_token')
+            },
+            defaultProps: {
+                value: 'id', // 唯一标识
+                label: 'orgName', // 标签显示
+                children: 'orgs' // 子级
+            }
+        };
+    },
+
+    methods: {
+        QueryClick() {
+            this.$refs['uploaduserlogo'].$refs['upload-inner'].handleClick();
+        },
+        submit() {
+            new Promise((resolve) => {
+                this.$refs.form.validate(resolve);
+            }).then(() => {
+                var loading = this.$loading();
+                let url = '/sc-charge/payee/account/add';
+                if (this.params.todo == 'edit') {
+                    url = '/sc-charge/payee/account/update';
+                }
+                this.$http
+                    .post(url, this.formData)
+                    .then(({ status, msg }) => {
+                        if (status == 0) {
+                            this.$message.success(msg);
+                            this.params.callback();
+                            this.$emit('close');
+                        } else {
+                            this.$message.error(msg);
+                        }
+                        loading.close();
+                    })
+                    .catch(() => {
+                        loading.close();
+                    });
+            });
+        },
+        uploadsuccess(response, file, fileList) {
+            this.$refs.uploaduserlogo.clearFiles();
+            if (0 === response.status) {
+                this.formData.authFile = response.data;
+            }
+        },
+        beforeAvatarUpload(file) {
+            // const isJPG = file.type === 'image/jpeg';
+            // const isLt2M = file.size / 1024 / 1024 < 2;
+            // if (!isLt2M) {
+            //     this.$message.error('上传头像图片大小不能超过 2MB!');
+            // }
+            // return isJPG && isLt2M;
+        }
+    },
+    created() {
+        if (this.params.todo == 'edit') {
+            this.formData = JSON.parse(JSON.stringify(this.params.data));
+        }
+    }
+};
+</script>
+<style lang="scss" scoped>
+@import '@assets/css/public-style.scss';
+.contentScorll {
+    border-radius: 2px;
+    border: 1px solid #e0e1e3;
+}
+.all {
+    background: #f8fcff;
+    padding: 0 15px;
+    display: flex;
+    justify-content: space-between;
+}
+.item-list {
+    padding: 0 15px;
+    height: 200px;
+    overflow: auto;
+    &::-webkit-scrollbar {
+        display: none;
+    }
+    /deep/ .el-checkbox-group .el-checkbox {
+        display: flex;
+        .el-checkbox__label,
+        .el-checkbox__input {
+            line-height: 30px;
+        }
+    }
+}
+.title {
+    font-size: 12px;
+}
+</style>

+ 8 - 3
operationSupport/src/views/payService/propertyFee/index.vue

@@ -241,21 +241,26 @@ export default {
                 this.chiData.type = newValue.type;
                 if (newValue.type === 'community') {
                     this.mixins_query.communityId = newValue.value;
-
                     this.chiData.value = newValue.value;
                     this.chiData.address = newValue.name;
                 } else if (newValue.type === 'building') {
+                    this.mixins_query.communityId = newValue.communityId;
                     this.mixins_query.buildingId = newValue.buildingId;
 
                     this.chiData.value = newValue.buildingId;
                     this.chiData.address = newValue.name;
                 } else if (newValue.type === 'unit') {
+                    this.mixins_query.communityId = newValue.communityId;
                     this.mixins_query.buildingId = newValue.buildingId;
                     this.mixins_query.unitName = newValue.unitId;
 
-                    (this.chiData.value = newValue.unitId), (this.chiData.address = newValue.name);
+                    this.chiData.value = newValue.unitId;
+                    this.chiData.address = newValue.name;
                 } else if (newValue.type === 'room') {
-                    this.mixins_query.roomNumber = newValue.roomId;
+                    this.mixins_query.communityId = newValue.communityId;
+                    this.mixins_query.buildingId = newValue.buildingId;
+                    this.mixins_query.unitName = newValue.unitId;
+                    this.mixins_query.houseId = newValue.roomId;
 
                     this.chiData.value = newValue.roomId;
                     this.chiData.address = newValue.name;