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

114 lines
3.3 KiB
Vue
Raw Normal View History

2022-02-23 09:24:55 +08:00
<template>
<section class="needsDetail">
<ai-detail>
<ai-title slot="title" title="融资详情" isShowBottomBorder isShowBack @onBackClick="$router.push({query:{}})">
<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>
<el-row type="flex" class="flexWrap">
2022-02-25 10:07:29 +08:00
<el-form-item label="意向金额">{{ detail.loanAmount }}</el-form-item>
<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-02-23 09:24:55 +08:00
<el-form-item label="企业主体">{{ detail.enterpriseName }}</el-form-item>
2022-03-01 14:39:29 +08:00
<el-form-item label="联系人">{{ detail.name }}</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-02-23 09:24:55 +08:00
export default {
name: "needsDetail",
props: {
instance: Function,
dict: Object,
permissions: Function
},
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: {},
}
},
methods: {
getDetail() {
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-02-25 10:07:29 +08:00
this.instance.post("/appfinancingdemand/userCancel", null, {
params: {id: this.detail.id}
}).then(res => {
if (res.code == 0) {
this.$message.success("需求取消成功")
this.getDetail()
}
})
2022-02-23 09:56:01 +08:00
}).catch(() => 0)
2022-02-23 09:24:55 +08:00
}
},
created() {
this.getDetail()
}
}
</script>
<style lang="scss" scoped>
.needsDetail {
height: 100%;
.flexWrap {
flex-wrap: wrap;
.el-form-item {
width: 50%;
}
}
}
</style>