Files
dvcp_v2_webapp/project/xumu/AppAuthManage/authAdd.vue
aixianling b1c0beb8f6 feat(AppAuthManage): 新增认证审核功能
- 添加认证审核列表和详细页面组件
- 实现认证材料上传和审核功能
- 优化页面布局和样式
- 增加审核状态和备注说明功能
2024-12-24 16:04:18 +08:00

86 lines
2.4 KiB
Vue

<script>
export default {
name: "authAdd",
props: {
instance: Function,
permissions: Function,
dict: Object
},
data() {
return {
detail: {},
}
},
computed: {
isAuditing: v => v.detail.auditStatus == 1
},
methods: {
back(params = {}) {
this.$router.push(params)
},
getDetail() {
const {id} = this.$route.query
this.instance.post("/api/user/auth/page", null, {params: {id}}).then(res => {
if (res?.data?.records) {
const detail = res.data.records[0] || {}
let {picture = "{}"} = detail
picture = JSON.parse(picture)
this.detail = {...detail, ...picture}
}
})
},
getNeedCerts(type) {
return this.$parent.certificates.filter(e => !e.permit || e.permit.includes(type))
},
handleAudit(auditStatus) {
const auditLabels = {
2: "同意通过", 3: "驳回"
}
this.$confirm(`是否要${auditLabels[auditStatus]}认证?`).then(() => {
this.instance.post("/api/user/audit", null, {params:{
id: this.detail.id, auditStatus
}}).then(res => {
if (res?.code == 0) {
this.$confirm("是否要返回列表?","提交成功").then(() => this.back())
}
})
})
}
},
created() {
this.dict.load("auditStatus")
this.getDetail()
}
}
</script>
<template>
<ai-page title="认证材料" class="authAdd" showBack content-string="detail">
<el-form size="small" label-position="top" :model="detail" ref="detail">
<ai-card title="认证材料">
<div class="grid">
<el-form-item v-for="(op,i) in getNeedCerts(detail.type)" :key="i" v-bind="op" :rules="{required:true,message:`请上传${op.label}`,trigger:'change'}">
<el-image :src="detail[op.prop]" :preview-src-list="[detail[op.prop]]"/>
</el-form-item>
</div>
</ai-card>
<ai-card title="备注说明">
<div v-text="detail.remark"/>
</ai-card>
</el-form>
<div slot="footer">
<template v-if="isAuditing">
<el-button type="primary" @click="handleAudit(2)">同意</el-button>
<el-button type="danger" @click="handleAudit(3)">拒绝</el-button>
</template>
<el-button @click="back">关闭</el-button>
</div>
</ai-page>
</template>
<style scoped lang="scss">
.authAdd {
}
</style>