|
@@ -0,0 +1,287 @@
|
|
|
+<template>
|
|
|
+ <div class="enterprise-modify">
|
|
|
+ <router-view />
|
|
|
+ <template v-if="!$route.query.type">
|
|
|
+ <div class="search">
|
|
|
+ <div class="left"></div>
|
|
|
+ <div class="right" style="width: auto;">
|
|
|
+ <div>
|
|
|
+ <el-input
|
|
|
+ v-model="search.companyName"
|
|
|
+ placeholder="请输入企业名称"
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-input
|
|
|
+ v-model="search.capitalName"
|
|
|
+ placeholder="请输入资方名称"
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-select
|
|
|
+ v-model="search.creditStatus"
|
|
|
+ placeholder="请选择授信状态"
|
|
|
+ clearable
|
|
|
+ style="width: 140px !important;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in constant.enterpriseCreditStatus"
|
|
|
+ :key="item.code"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-select
|
|
|
+ v-model="search.isMultiStore"
|
|
|
+ placeholder="请选择是否支持多店铺"
|
|
|
+ clearable
|
|
|
+ style="width: 200px !important;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in constant.whetherList"
|
|
|
+ :key="item.code"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="search.authDateRange"
|
|
|
+ type="daterange"
|
|
|
+ clearable
|
|
|
+ range-separator="至"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ start-placeholder="授信开始日期"
|
|
|
+ end-placeholder="授信到期日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <div class="leftBtn">
|
|
|
+ <el-button type="primary" @click="fetchData('search')">查询</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <cy-comm-table
|
|
|
+ ref="commTable"
|
|
|
+ v-loading="loading"
|
|
|
+ :columns="columns"
|
|
|
+ :table-options="tableOptions"
|
|
|
+ :data="tableData"
|
|
|
+ :count="total"
|
|
|
+ parent-component=""
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+import { getAuthCreditList, refreshCreditStatus } from '@/api/creditManagement/index'
|
|
|
+import { formatMoney } from '@/utils'
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ total: 0,
|
|
|
+ page: 1,
|
|
|
+ size: 10,
|
|
|
+ tableData: [],
|
|
|
+ search: {
|
|
|
+ companyName: '',
|
|
|
+ capitalName: '',
|
|
|
+ creditStatus: '',
|
|
|
+ isMultiStore: '',
|
|
|
+ authDateRange: ''
|
|
|
+ },
|
|
|
+ tableOptions: {
|
|
|
+ sortTable: true,
|
|
|
+ maxHeight: 'calc(100vh - 395px)',
|
|
|
+ height: 'calc(100vh - 395px)'
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ label: '序号',
|
|
|
+ index: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '业务编号',
|
|
|
+ prop: 'businessNumber',
|
|
|
+ width: 140,
|
|
|
+ showTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '企业名称',
|
|
|
+ prop: 'companyName',
|
|
|
+ width: 140,
|
|
|
+ showTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '统一社会信用代码',
|
|
|
+ prop: 'socialCreditCode',
|
|
|
+ width: 140,
|
|
|
+ showTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '资方名称',
|
|
|
+ prop: 'capitalName',
|
|
|
+ showTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '授信编号',
|
|
|
+ prop: 'creditNo',
|
|
|
+ showTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是否支持多店铺',
|
|
|
+ showTooltip: true,
|
|
|
+ render: (h, row) => {
|
|
|
+ return <div>{ row.isMultiStore !== null ? row.isMultiStore === 0 ? '否' : '是' : '' }</div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '授信金额',
|
|
|
+ prop: 'taskName',
|
|
|
+ showTooltip: true,
|
|
|
+ render: (h, row) => {
|
|
|
+ return <div>{ formatMoney(row.creditAmount) }</div>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '授信生效日期',
|
|
|
+ prop: 'creditStartDate',
|
|
|
+ showTooltip: true,
|
|
|
+ width: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '授信到期日期',
|
|
|
+ prop: 'creditEndDate',
|
|
|
+ showTooltip: true,
|
|
|
+ width: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '授信状态',
|
|
|
+ prop: 'creditStatus',
|
|
|
+ showTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作',
|
|
|
+ show: true,
|
|
|
+ render: (h, row) => {
|
|
|
+ const btnList = [
|
|
|
+ {
|
|
|
+ msg: '授信详情',
|
|
|
+ icon: 'iconfont icon-Magnifier',
|
|
|
+ power: 'creditView',
|
|
|
+ rowPower: [],
|
|
|
+ category: 'see'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ msg: '刷新授信状态',
|
|
|
+ icon: 'iconfont icon-shuaxin',
|
|
|
+ power: 'RefreshCreditStatus',
|
|
|
+ rowPower: [],
|
|
|
+ category: 'refresh'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ const options = btnList.map(item => {
|
|
|
+ return (
|
|
|
+ this.tablePower({ item, row }) && <el-tooltip class='item' effect='dark' content={item.msg} placement='top' >
|
|
|
+ <span class='table-icon-box' v-power={item.power}>
|
|
|
+ <i class={item.icon} onClick={() => { this.handlerOperate(item.category, row, item.msg) }}></i>
|
|
|
+ </span>
|
|
|
+ </el-tooltip>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ return <div>{ options }</div>
|
|
|
+ },
|
|
|
+ width: 160
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['constant']),
|
|
|
+ formatMoney() {
|
|
|
+ return (money) => {
|
|
|
+ return formatMoney(money)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tablePower() {
|
|
|
+ return ({ item, row }) => {
|
|
|
+ const { category } = item
|
|
|
+ if (category === 'refresh') {
|
|
|
+ if (row.creditStatus === '授信中') {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.$store.dispatch('getConstant', ['enterpriseCreditStatus'])
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async fetchData(type) {
|
|
|
+ const params = {
|
|
|
+ page: this.page,
|
|
|
+ rows: this.size,
|
|
|
+ ...this.search
|
|
|
+ }
|
|
|
+
|
|
|
+ if (params.authDateRange && params.authDateRange.length) {
|
|
|
+ params.startDate = params.authDateRange[0]
|
|
|
+ params.endDate = params.authDateRange[1]
|
|
|
+ }
|
|
|
+
|
|
|
+ delete params.authDateRange
|
|
|
+
|
|
|
+ if (type === 'search') {
|
|
|
+ this.page = 1
|
|
|
+ this.size = 10
|
|
|
+ }
|
|
|
+
|
|
|
+ this.loading = true
|
|
|
+ const res = await getAuthCreditList(params)
|
|
|
+
|
|
|
+ this.loading = false
|
|
|
+ console.log('getAuthCreditList-----', res)
|
|
|
+ if (res.success) {
|
|
|
+ this.tableData = res.rows || []
|
|
|
+ this.total = res.records
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handlerOperate(type, row, msg) {
|
|
|
+ if (type === 'see') {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'CreditManagementView',
|
|
|
+ query: {
|
|
|
+ type: 'see',
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (type === 'refresh') {
|
|
|
+ this.refreshStatus(row.id)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async refreshStatus(id) {
|
|
|
+ const res = await refreshCreditStatus({ id })
|
|
|
+
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.$router.go(0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="sass" scoped></style>
|