Files
dvcp_v2_webapp/project/xiushan/apps/financing/AppFinancingNeeds/needsDetail.vue

145 lines
4.7 KiB
Vue
Raw Normal View History

2022-02-23 09:24:55 +08:00
<template>
<section class="needsDetail">
<ai-detail>
2022-04-07 19:47:59 +08:00
<ai-title slot="title" title="融资详情" isShowBottomBorder isShowBack @onBackClick="back()">
2022-02-23 09:24:55 +08:00
<template #rightBtn>
2022-02-25 10:07:29 +08:00
<el-button v-if="isFinanceUser" type="primary" @click="handleGrab">抢单</el-button>
<el-button v-else type="danger" @click="handleCancel">取消发布</el-button>
2022-02-23 09:24:55 +08:00
</template>
</ai-title>
<template #content>
<el-form size="small" label-width="160px">
<ai-card title="融资需求">
<template #content>
2022-03-23 10:26:54 +08:00
<el-form-item label="融资方式">{{ dict.getLabel("financingDemandApplyType", detail.applyType) }}
</el-form-item>
2022-02-23 09:24:55 +08:00
<el-row type="flex" class="flexWrap">
2022-03-01 14:40:00 +08:00
<el-form-item label="意向金额(万)">{{ detail.loanAmount }}</el-form-item>
2022-02-25 10:07:29 +08:00
<el-form-item label="期望使用期限">{{
dict.getLabel('productRepaymentTimeline', detail.hopeLifespan)
}}
</el-form-item>
<el-form-item label="资金用途">{{
dict.getLabel('financialFundPurpose', detail.fundPurpose)
}}
</el-form-item>
2022-03-23 10:26:54 +08:00
<el-form-item label="企业主体" v-if="detail.applyType==1">
2022-03-02 15:45:38 +08:00
<el-row type="flex">
{{ detail.enterpriseName }}
2022-07-06 12:08:28 +08:00
<ai-dialog-btn text="企业详情" :dialog-title="detail.enterpriseName||'企业详情'">
<enterprise-dialog v-if="detail.enterpriseId" :enterprise-id="detail.enterpriseId" :instance="instance" :dict="dict"/>
</ai-dialog-btn>
2022-03-02 15:45:38 +08:00
</el-row>
</el-form-item>
2022-03-23 10:26:54 +08:00
<el-form-item v-else/>
2022-04-28 09:03:18 +08:00
<el-form-item label="联系人">
<el-row type="flex">
<div v-text="detail.name"/>
2022-07-06 12:08:28 +08:00
<ai-dialog-btn text="个人详情" :dialog-title="detail.name||'个人详情'">
<person-credit-report :personId="detail.idNumber" :instance="instance" :dict="dict"/>
</ai-dialog-btn>
2022-04-28 09:03:18 +08:00
</el-row>
</el-form-item>
2022-02-25 10:07:29 +08:00
<el-form-item label="所在地区">{{ detail.areaName }}</el-form-item>
2022-02-23 09:24:55 +08:00
<el-form-item label="联系方式">{{ detail.phone }}</el-form-item>
<el-form-item label="身份证号">{{ detail.idNumber }}</el-form-item>
2022-02-25 10:07:29 +08:00
<el-form-item label="发布时间">{{ detail.createTime }}</el-form-item>
2022-02-23 09:24:55 +08:00
</el-row>
2022-02-25 10:07:29 +08:00
<el-form-item label="备注">{{ detail.remark }}</el-form-item>
2022-02-23 09:24:55 +08:00
</template>
</ai-card>
</el-form>
</template>
</ai-detail>
</section>
</template>
<script>
2022-02-25 10:07:29 +08:00
import {mapState} from "vuex";
2022-04-08 20:47:13 +08:00
import EnterpriseDialog from "../../../components/enterpriseDialog";
2022-04-28 09:03:18 +08:00
import PersonCreditReport from "../../../components/personCreditReport";
2022-02-25 10:07:29 +08:00
2022-02-23 09:24:55 +08:00
export default {
name: "needsDetail",
2022-07-13 15:17:35 +08:00
components: {PersonCreditReport, EnterpriseDialog},
2022-02-23 09:24:55 +08:00
props: {
instance: Function,
dict: Object,
2022-04-07 19:47:59 +08:00
permissions: Function,
2022-02-23 09:24:55 +08:00
},
2022-02-25 10:07:29 +08:00
computed: {
...mapState(['user']),
isFinanceUser() {
2022-02-25 11:46:21 +08:00
return !!this.user.financeUser?.id
2022-02-25 10:07:29 +08:00
}
},
2022-02-23 09:24:55 +08:00
data() {
return {
detail: {},
2022-04-07 18:35:43 +08:00
info: {},
2022-02-23 09:24:55 +08:00
}
},
methods: {
getDetail() {
2022-04-11 10:57:21 +08:00
let {id} = this.$route.query
2022-02-25 10:07:29 +08:00
this.instance.post("/appfinancingdemand/queryDetailById", null, {
2022-02-23 09:24:55 +08:00
params: {id}
}).then(res => {
if (res?.data) {
this.detail = res.data
}
})
},
handleGrab() {
2022-02-25 10:07:29 +08:00
this.instance.post("/appfinancingdemand/obtain", null, {
params: {id: this.detail.id}
}).then(res => {
if (res.code == 0) {
this.$message.success("抢单成功!")
2022-02-25 14:02:38 +08:00
this.$router.push({name: "27338cb83e77461dbd44356a6760df86"})
2022-02-25 10:07:29 +08:00
}
})
2022-02-23 09:24:55 +08:00
},
handleCancel() {
2022-02-23 09:56:01 +08:00
this.$confirm("是否要取消本次融资需求发布?").then(() => {
2022-03-01 15:46:40 +08:00
this.instance.post("/appfinancingdemand/cancelObtain", null, {
2022-02-25 10:07:29 +08:00
params: {id: this.detail.id}
}).then(res => {
if (res.code == 0) {
this.$message.success("需求取消成功")
2022-03-02 09:31:09 +08:00
this.back()
2022-02-25 10:07:29 +08:00
}
})
2022-02-23 09:56:01 +08:00
}).catch(() => 0)
2022-03-02 09:31:09 +08:00
},
back() {
2022-04-11 10:57:21 +08:00
this.$router.push({})
2022-02-23 09:24:55 +08:00
}
},
created() {
2022-04-08 20:33:58 +08:00
this.dict.load("productRepaymentTimeline", "financialFundPurpose", "financingDemandApplyType", "enterpriseType", "dishonestPersonSituation", "administrativeSanctionType").then(() => {
2022-04-08 17:06:50 +08:00
this.getDetail()
})
2022-02-23 09:24:55 +08:00
}
}
</script>
<style lang="scss" scoped>
.needsDetail {
height: 100%;
.flexWrap {
flex-wrap: wrap;
.el-form-item {
width: 50%;
2022-04-07 18:35:43 +08:00
2022-04-08 20:33:58 +08:00
.el-link {
margin-left: 16px;
2022-04-07 18:35:43 +08:00
}
}
}
2022-04-08 20:33:58 +08:00
2022-02-23 09:24:55 +08:00
}
</style>