feat(AppAuthManage): 新增认证审核功能
- 添加认证审核列表和详细页面组件 - 实现认证材料上传和审核功能 - 优化页面布局和样式 - 增加审核状态和备注说明功能
This commit is contained in:
		| @@ -1,41 +1,55 @@ | ||||
| <script> | ||||
| import AiUploader from "dui/packages/basic/AiUploader.vue"; | ||||
|  | ||||
| const certificates = [ | ||||
|   {label: "身份证(正面)", prop: "frontCard"}, | ||||
|   {label: "身份证(反面)", prop: "reverseCard"}, | ||||
|   {label: "营业执照", prop: "businessPic", permit: ["breed"]}, | ||||
|   {label: "畜禽经营许可证", prop: "breedPic", permit: ["breed"]}, | ||||
|   {label: "动物防疫条件许可证", prop: "prevention", permit: ["breed"]}, | ||||
|   {label: "组织机构证明", prop: "orgPic", permit: ["bank", "insurance"]}, | ||||
| ] | ||||
| export default { | ||||
|   name: "authAdd", | ||||
|   components: {AiUploader}, | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     permissions: Function | ||||
|     permissions: Function, | ||||
|     dict: Object | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       certificates, | ||||
|       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) { | ||||
|           this.detail = res.data|| {} | ||||
|         if (res?.data?.records) { | ||||
|           const detail = res.data.records[0] || {} | ||||
|           let {picture = "{}"} = detail | ||||
|           picture = JSON.parse(picture) | ||||
|           this.detail = {...detail, ...picture} | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     getNeedCerts(type) { | ||||
|       return certificates.filter(e => !e.permit || e.permit.includes(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() | ||||
|   } | ||||
| } | ||||
| @@ -43,16 +57,25 @@ export default { | ||||
|  | ||||
| <template> | ||||
|   <ai-page title="认证材料" class="authAdd" showBack content-string="detail"> | ||||
|     <el-form size="small"> | ||||
|     <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 v-model="detail[op.prop]" :preview-src-list="[detail[op.prop]]"/> | ||||
|             <el-image :src="detail[op.prop]" :preview-src-list="[detail[op.prop]]"/> | ||||
|           </el-form-item> | ||||
|         </div> | ||||
|       </ai-card> | ||||
|       <ai-card title="审核意见"></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> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user