Sfoglia il codice sorgente

账户管理模块恢复

ZhangWenQiang 5 anni fa
parent
commit
ffd14a622a

+ 324 - 0
src/views/hwaccount/HwAccountManager.vue

@@ -0,0 +1,324 @@
+<template>
+    <a-card :bordered="false">
+      <!-- 查询区域 -->
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" :form="form" style="height: 100%;">
+          <a-row :gutter="24" type="flex" style="height: 100%;" justify="center" align="middle">
+            <a-col span="12">
+              <a-form-item label="我的服务商">
+                <a-select v-model="subcontractorKey" @change="chooseSubcontractor">
+                  <a-select-option value="">请选择服务商</a-select-option>
+                  <a-select-option v-for="(item,key) in Subcontractor" :key="key +'-sub'" :value="key">
+                    {{item.subcontractorName}}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-divider type="horizontal" style="margin-top: 0"/>
+          </a-row>
+
+        </a-form>
+        <div>
+          <div class="title">我的账户</div>
+          <a-row type="flex" class="account-manager-content">
+            <a-col span="12">
+              <a-row type="flex" align="middle">
+                <a-col span="24">
+                  <a-row type="flex" align="middle">
+                    <a-col span="13">
+                      <div style="color: #7F7F7F;font-size: 18px;">当前余额</div>
+                    </a-col>
+                    <a-col>
+                      <div v-show="information.isOn === 0">
+                        该服务商暂时停用,若有疑问请联系客服
+                      </div>
+                    </a-col>
+                  </a-row>
+                  <a-row type="flex" align="middle" style="margin-top: 15px;">
+                    <a-col span="13">
+                      <div style="color: #A30014;font-size: 28px;">¥ {{information.balance || '0.00'}}</div>
+                    </a-col>
+                    <a-col>
+                      <div v-show="information.id">
+                        <a type="link" @click="handleRecharge">我要充值</a>
+                      </div>
+                    </a-col>
+                  </a-row>
+                </a-col>
+              </a-row>
+            </a-col>
+            <a-col span="2">
+              <a-divider type="vertical" style="height: 100%;margin: 0 30px"/>
+            </a-col>
+            <a-col span="9">
+              <div style="color: #7F7F7F;font-size: 18px;">
+                服务费率
+              </div>
+              <div style="color: #555555;font-size: 28px;">
+                {{information.serviceFeeRate || '0'}}%
+              </div>
+            </a-col>
+          </a-row>
+        </div>
+      </div>
+      <!-- 查询区域-END -->
+
+      <!-- 操作按钮区域 -->
+      <div class="table-operator">
+
+      </div>
+
+      <!-- table区域-begin -->
+      <div>
+        <div style="color: #333;font-size: 24px">
+          <span>账户明细</span>
+          <span style="color: #7F7F7F;font-size: 14px;margin-left: 15px">仅展示最近半年的记录</span>
+          <a-button type="primary" icon="download" @click="handleExportXls('账户明细')" style="float: right;">导出</a-button>
+        </div>
+        <a-divider type="horizontal"/>
+        <a-table
+          ref="table"
+          size="middle"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="dataSource"
+          :pagination="ipagination"
+          :loading="loading"
+          @change="handleTableChange">
+          <span slot="type_dictText" slot-scope="text,record">
+            <span :class="record.type===1?'red':'green'">{{text}}</span>
+          </span>
+          <span slot="amount" slot-scope="text,record">
+            <span :class="record.type===1?'red':'green'">
+              <template v-if="record.isDrawback === 1">
+                {{text?text+'(已退款)':text===0?text+'(已退款)':'--'}}
+              </template>
+              <template v-else>
+                {{text?text:text===0?text:'--'}}
+              </template>
+            </span>
+          </span>
+          <span slot="serviceFee" slot-scope="text,record">
+            <span :class="record.type===1?'red':'green'">
+              <template v-if="record.isDrawback === 1">
+                {{text?text+'(已退款)':text===0?text+'(已退款)':'--'}}
+              </template>
+              <template v-else-if="record.type === 1">
+                --
+              </template>
+              <template v-else>
+                {{text?text:text===0?text:'--'}}
+              </template>
+            </span>
+          </span>
+        </a-table>
+      </div>
+      <HwPaymentRechargeModal ref="rechargeModal"></HwPaymentRechargeModal>
+    </a-card>
+</template>
+
+<script>
+
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import { Arithmetic } from '@/mixins/Arithmetic'
+  import HwPaymentRechargeModal from './modules/HwPaymentRechargeModal'
+  import { httpAction, getAction,downFile } from '@/api/manage'
+
+  export default {
+    name: 'HwAccountManager',
+    mixins: [JeecgListMixin, Arithmetic],
+    components: {
+      HwPaymentRechargeModal
+    },
+    data() {
+      return {
+        form: this.$form.createForm(this),
+        description: '账户信息表管理页面',
+        // 表头
+        columns: [
+          {
+            title: '时间',
+            align: 'left',
+            dataIndex: 'updateTime'
+          },
+          {
+            title: '收支方向',
+            align: 'left',
+            dataIndex: 'type_dictText',
+            scopedSlots: { customRender: 'type_dictText' }
+          },
+          {
+            title: '金额',
+            align: 'left',
+            dataIndex: 'amount',
+            scopedSlots: { customRender: 'amount' }
+          },
+          {
+            title: '服务费',
+            align: 'left',
+            dataIndex: 'serviceFee',
+            scopedSlots: { customRender: 'serviceFee' }
+          },
+          {
+            title: '备注',
+            align: 'left',
+            dataIndex: 'paymentCode',
+            customRender: (value,record) => {
+              return value ? value:'--'
+            }
+          }
+        ],
+        url: {
+          list: '/saasmanager/hwPlatformCompanyAccount/myAccount',
+          exportXlsUrl: '/saasmanager/hwPlatformCompanyAccountDetail/exportXlsManager',
+          detail: '/saasmanager/hwPlatformCompanyAccountDetail/managerList'
+        },
+        dictOptions: {},
+        Subcontractor: [],
+        dataSource: [],
+        information: {},
+        accountId: '',
+        subcontractorId: '',
+        subcontractorName: '',
+        subcontractorKey: '',
+        cpType:'',
+        companyId:'',
+      }
+    },
+    created() {
+
+    },
+    methods: {
+      loadData(){
+        this.loading = true
+        getAction(this.url.list, {}).then((res) => {
+          if (res.success) {
+            if (res.result && res.result.length === 1) {
+              this.subcontractorId = res.result[0].subcontractorId
+              this.subcontractorName = res.result[0].subcontractorName
+              this.information = res.result[0]
+              this.subcontractorKey = 0;
+              this.cpType = res.result[0].cpType;
+              this.companyId = res.result[0].companyId;
+              this.getDetails(1)
+            }
+            this.Subcontractor = res.result
+          }
+          if (res.code === 510) {
+            this.$message.warning(res.message)
+          }
+          this.loading = false
+        })
+      },
+      handleRecharge() {
+        this.$refs.rechargeModal.edit(this.information)
+        this.$refs.rechargeModal.title = '我要充值'
+        this.$refs.rechargeModal.disableSubmit = false
+      },
+      getDetails(arg) {
+        //加载数据 若传入参数1则加载第一页的内容
+        if (arg === 1) {
+          this.ipagination.current = 1
+        }
+        var params = this.getQueryParams()//查询条件
+        params.subcontractorId = this.subcontractorId
+        params.cpType = this.cpType;
+        params.companyId = this.companyId;
+        this.loading = true
+        getAction(this.url.detail, params).then((res) => {
+          if (res.success) {
+            this.dataSource = res.result.records
+            this.ipagination.total = res.result.total
+          }
+          if (res.code === 510) {
+            this.$message.warning(res.message)
+          }
+          this.loading = false
+        })
+      },
+      chooseSubcontractor(index) {
+        if (index || index === 0) {
+          this.information = this.Subcontractor[index]
+          this.subcontractorId = this.Subcontractor[index].subcontractorId
+          this.subcontractorName = this.Subcontractor[index].subcontractorName
+          this.subcontractorKey = index
+          this.cpType = this.Subcontractor[index].cpType;
+          this.companyId = this.Subcontractor[index].companyId;
+          this.getDetails(1)
+        } else {
+          this.information = {}
+          this.dataSource = [];
+          this.ipagination.current = 1;
+          this.ipagination.total = 0;
+          this.subcontractorKey = '';
+        }
+      },
+      handleTableChange(pagination, filters, sorter) {
+        //分页、排序、筛选变化时触发
+        //TODO 筛选
+        if (Object.keys(sorter).length > 0) {
+          this.isorter.column = sorter.field;
+          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        }
+        this.ipagination = pagination;
+        this.getDetails();
+      },
+      handleExportXls(fileName){
+        if(!fileName || typeof fileName != "string"){
+          fileName = "导出文件"
+        }
+        let param = this.getQueryParams();
+        if(this.selectedRowKeys && this.selectedRowKeys.length>0){
+          param['selections'] = this.selectedRowKeys.join(",")
+        }
+        param.subcontractorId = this.subcontractorId
+        param.cpType = this.cpType;
+        param.companyId = this.companyId;
+        console.log("导出参数",param)
+        downFile(this.url.exportXlsUrl,param).then((data)=>{
+          if (!data) {
+            this.$message.warning("文件下载失败")
+            return
+          }
+          if (typeof window.navigator.msSaveBlob !== 'undefined') {
+            window.navigator.msSaveBlob(new Blob([data]), fileName+'.xls')
+          }else{
+            let url = window.URL.createObjectURL(new Blob([data]))
+            let link = document.createElement('a')
+            link.style.display = 'none'
+            link.href = url
+            link.setAttribute('download', fileName+'.xls')
+            document.body.appendChild(link)
+            link.click()
+            document.body.removeChild(link); //下载完成移除元素
+            window.URL.revokeObjectURL(url); //释放掉blob对象
+          }
+        })
+      },
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+
+  .title {
+    font-size: 24px;
+    font-weight: 400;
+    margin-bottom: 15px
+  }
+
+  .account-manager-content {
+    border: 1px solid #ccc;
+    padding: 30px;
+    box-sizing: border-box
+  }
+
+  .red {
+    color: #D9001b;
+  }
+
+  .green {
+    color: #70b603;
+  }
+</style>

+ 239 - 0
src/views/hwaccount/modules/HwPaymentRechargeModal.vue

@@ -0,0 +1,239 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    :bodyStyle="bodyStyle"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    :maskClosable="false"
+    :footer="null"
+    cancelText="关闭">
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+        <a-row type="flex" align="middle" justify="space-between">
+          <a-col :span="12">
+            <a-form-item label=" " :colon="false" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <span style="font-weight: bold">请使用企业对公账户打款到以下账户:</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="12" v-for="(item,index) in subcontractor" :key="index">
+            <a-form-item label=" " :colon="false" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <div class="ant-alert ant-alert-info" style="padding: 8px 15px 8px 15px;">
+                <a-form-item label="公司名称" :colon="true" :labelCol="labelCol" :wrapperCol="wrapperCol"
+                             style="margin-bottom: 10px">
+                  {{subcontractorName}}
+                </a-form-item>
+                <a-form-item label="银行卡号" :labelCol="labelCol" :wrapperCol="wrapperCol" style="margin-bottom: 10px">
+                  {{item.bankAccount}}
+                </a-form-item>
+                <a-form-item label="开户银行" :labelCol="labelCol" :wrapperCol="wrapperCol" style="margin-bottom: 10px">
+                  {{item.bankName}}
+                </a-form-item>
+              </div>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </a-spin>
+    <a-spin :spinning="confirmLoading">
+      <a-row type="flex" align="middle" justify="space-between">
+        <a-col :span="12">
+          <a-form-item label=" " :colon="false" :labelCol="labelCol" :wrapperCol="wrapperCol" style="margin-bottom: 0">
+            <span style="font-weight: bold">立即打款:</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row type="flex" align="middle" justify="center">
+        <a-col :span="19">
+          <a-row type="flex" align="middle" justify="space-between">
+            <a-col :span="6" v-for="(item,index) in logo_list" :key="index" style="margin-top: 30px">
+              <a-row type="flex" align="middle">
+                <a-col>
+                  <a :href="item.link" target="_blank" style="text-decoration: none">
+                    <img class="logo-img"
+                         :src="item.logo_link"
+                         alt="">
+                    {{item.name}}
+                  </a>
+                </a-col>
+              </a-row>
+            </a-col>
+          </a-row>
+        </a-col>
+      </a-row>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+
+  import { getAction } from '@/api/manage'
+  import pick from 'lodash.pick'
+  import JDate from '@/components/jeecg/JDate'
+
+  export default {
+    name: 'HlgPaymentRechargeModal',
+    components: {
+      JDate
+    },
+    data() {
+      return {
+        form: this.$form.createForm(this),
+        title: '操作',
+        width: 1200,
+        bodyStyle: {
+          paddingTop: '20px',
+          paddingBottom: '30px',
+          maxHeight: (window.innerHeight * 0.62) + 'px',
+          'overflow-y': 'auto'
+        },
+        visible: false,
+        is_show: true,
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 }
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 }
+        },
+        subcontractor: [],
+        subcontractorName: '江苏开心工作科技有限公司',
+        confirmLoading: false,
+        url: {
+          detail: '/subcontratormanager/hwSubcontractor/getSubcontractorBankInformation'
+        },
+        logo_list: [
+          {
+            name: '招商银行',
+            link: 'http://www.cmbchina.com/',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/CMB.png'
+          },
+          {
+            name: '中国银行',
+            link: 'https://ebsnew.boc.cn/boccp/login.html?entryType=9',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/BOC.png'
+          },
+          {
+            name: '中国工商银行',
+            link: 'https://corporbank-simp.icbc.com.cn/icbc/normalbank/index.jsp',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/ICBC.png'
+          },
+          {
+            name: '中国农业银行',
+            link: 'http://www.abchina.com/cn/wydl/CCustomerLogin/',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/ABC.png'
+          },
+          {
+            name: '中国建设银行',
+            link: 'http://company1.ccb.com/cn/home/company_indexv3.html',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/CCB.png'
+          },
+          {
+            name: '中国邮政储蓄银行',
+            link: 'http://www.psbc.com/data/corpbank/index.html',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/PSBC.png'
+          },
+          {
+            name: '江苏银行',
+            link: 'https://cbank.jsbchina.cn/corporbank/',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/JSB.png'
+          },
+          {
+            name: '中信银行',
+            link: 'https://corp.bank.ecitic.com/cotb/login.html',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/CITICB.png'
+          },
+          {
+            name: '光大银行',
+            link: 'https://e.cebbank.com/cebent/prelogin.do?_locale=zh_CN',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/CEB.png'
+          },
+          {
+            name: '兴业银行',
+            link: 'https://corporatebank.cib.com.cn/firm/main/login.do',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/CIB.png'
+          },
+          {
+            name: '华夏银行',
+            link: 'https://dbank.hxb.com.cn/gluebanking/index.jsp',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/HX.png'
+          },
+          {
+            name: '南京银行',
+            link: 'https://ebank.njcb.com.cn/corporbank/login.jsp',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/NJCB.png'
+          },
+          {
+            name: '平安银行',
+            link: 'https://ebank.sdb.com.cn/corporbank/logon_basic.jsp',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/SDB.png'
+          },
+          {
+            name: '浦发银行',
+            link: 'https://ebank.spdb.com.cn/newent/gb/login/prof.jsp',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/SPDB.png'
+          },
+          {
+            name: '广发银行',
+            link: 'https://ebank.cgbchina.com.cn/corporbank/',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/CGB.png'
+          },
+          {
+            name: '宁波银行',
+            link: 'https://cb.nbcb.com.cn/',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/NBCB.png'
+          },
+          {
+            name: '恒丰银行',
+            link: 'https://co.hfbank.com.cn/',
+            logo_link: window._CONFIG['imgDomainOssURL'] + '/uploadfiles/hlgjob/hlgbank/HF.png'
+          }
+        ]
+      }
+    },
+    created() {
+    },
+    methods: {
+      add() {
+        this.edit({})
+      },
+      edit(record) {
+        this.form.resetFields()
+        this.model = Object.assign({}, record)
+        this.visible = true
+        this.getCompany(this.model)
+      },
+      close() {
+        this.$emit('close')
+        this.$destroyAll()
+        this.visible = false
+      },
+      handleOk() {
+        this.close()
+      },
+      handleCancel() {
+        this.close()
+      },
+      getCompany(record) {
+        getAction(this.url.detail, {}).then(data => {
+          this.subcontractor = data.result
+        })
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+
+  .logo-img {
+    width: 40px;
+    height: 40px;
+    margin-right: 8px;
+  }
+</style>