2024-12-18 18:03:35 +08:00
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
{label: "序号", type: "index"},
|
|
|
|
|
{label: "账号", prop: "userName"},
|
|
|
|
|
{label: "姓名", prop: "name"},
|
|
|
|
|
{label: "角色", prop: "roleName"},
|
|
|
|
|
{label: "所属端", prop: "type", dict: "roleType", width: 120, align: 'center'},
|
|
|
|
|
{label: "状态", prop: "authStatus", dict: "authStatus", width: 120, align: 'center'},
|
|
|
|
|
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 120, align: 'center'},
|
|
|
|
|
]
|
|
|
|
|
const certificates = [
|
|
|
|
|
{label: "身份证(正面)", prop: "frontCard"},
|
|
|
|
|
{label: "身份证(反面)", prop: "reverseCard"},
|
2024-12-19 18:04:12 +08:00
|
|
|
{label: "营业执照", prop: "businessPic", permit: ["breed"]},
|
|
|
|
|
{label: "畜禽经营许可证", prop: "breedPic", permit: ["breed"]},
|
|
|
|
|
{label: "动物防疫条件许可证", prop: "prevention", permit: ["breed"]},
|
|
|
|
|
{label: "组织机构证明", prop: "orgPic", permit: ["bank", "insurance"]},
|
2024-12-18 18:03:35 +08:00
|
|
|
]
|
|
|
|
|
export default {
|
|
|
|
|
name: "authList",
|
|
|
|
|
props: {
|
|
|
|
|
instance: Function,
|
|
|
|
|
dict: Object,
|
|
|
|
|
permissions: Function
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
columns,
|
|
|
|
|
tableData: [],
|
|
|
|
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
|
|
|
|
search: {name: ""},
|
|
|
|
|
dialog: false,
|
|
|
|
|
form: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getTableData() {
|
2024-12-20 16:54:24 +08:00
|
|
|
this.instance.post("/api/user/auth/page", null, {
|
2024-12-18 18:03:35 +08:00
|
|
|
params: {...this.page, ...this.search}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res?.data) {
|
2024-12-19 18:04:12 +08:00
|
|
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.authStatus}` + e.auditStatus}))
|
2024-12-18 18:03:35 +08:00
|
|
|
this.page.total = res.data.total
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getNeedCerts(type) {
|
|
|
|
|
return certificates.filter(e => !e.permit || e.permit.includes(type))
|
2024-12-19 18:04:12 +08:00
|
|
|
},
|
|
|
|
|
handleConfirm() {
|
|
|
|
|
this.$refs.form.validate().then(() => {
|
2024-12-20 16:54:24 +08:00
|
|
|
this.instance.post("/api/user/auth/update", this.form).then(res => {
|
2024-12-19 18:04:12 +08:00
|
|
|
if (res?.code == '0' && res?.data != 1) {
|
|
|
|
|
this.dialog = false
|
|
|
|
|
this.$message.success("提交成功!")
|
|
|
|
|
this.getTableData()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
2024-12-18 18:03:35 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.dict.load("roleType", "authStatus", "auditStatus")
|
|
|
|
|
this.getTableData()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<ai-page class="authList" title="认证审核">
|
|
|
|
|
<ai-search-bar>
|
|
|
|
|
<template #left>
|
|
|
|
|
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">添加</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #right>
|
|
|
|
|
<el-input size="small" placeholder="搜索账号" v-model="search.name" clearable
|
|
|
|
|
@change="page.pageNum=1, getTableData()" @getList="getTableData"/>
|
|
|
|
|
</template>
|
|
|
|
|
</ai-search-bar>
|
|
|
|
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
|
|
|
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
|
|
|
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
|
|
|
|
<template slot-scope="{row}">
|
|
|
|
|
<div class="table-options">
|
2024-12-19 18:04:12 +08:00
|
|
|
<el-button type="text" v-if="'12'.includes(row.permit)"
|
|
|
|
|
@click="$router.push({query:{id:row.id},hash:'#add'})">查看
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button class="deleteBtn" type="text" v-if="'11'.includes(row.permit)"
|
|
|
|
|
@click="$router.push({query:{id:row.id},hash:'#add'})">审核
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="text" v-if="'00|13'.includes(row.permit)"
|
|
|
|
|
@click="dialog=true,form=row">认证材料
|
|
|
|
|
</el-button>
|
2024-12-18 18:03:35 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</ai-table>
|
2024-12-19 18:04:12 +08:00
|
|
|
<ai-dialog v-model="dialog" title="认证材料" width="60%" @close="form=[]" @confirm="handleConfirm">
|
2024-12-18 18:03:35 +08:00
|
|
|
<el-form class="grid c-3" :model="form" ref="form" label-width="160px">
|
|
|
|
|
<el-form-item v-for="(op,i) in getNeedCerts(form.type)" :key="i" v-bind="op" :rules="{required:true,message:`请上传${op.label}`,trigger:'change'}">
|
|
|
|
|
<ai-uploader v-model="form[op.prop]" valueIsUrl :limit="1"/>
|
|
|
|
|
</el-form-item>
|
2024-12-19 18:04:12 +08:00
|
|
|
<el-form-item class="row" label="备注说明" prop="remark">
|
|
|
|
|
<el-input type="textarea" :rows="2" v-model="form.remark" placeholder="备注说明具体情况"/>
|
2024-12-18 18:03:35 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</ai-dialog>
|
|
|
|
|
</ai-page>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.authList {
|
|
|
|
|
height: 100%;
|
2024-12-19 18:04:12 +08:00
|
|
|
|
|
|
|
|
.deleteBtn {
|
|
|
|
|
color: $errorColor;
|
|
|
|
|
}
|
2024-12-18 18:03:35 +08:00
|
|
|
}
|
|
|
|
|
</style>
|