|
@@ -1,44 +1,59 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<div class="filter-container">
|
|
|
- <span>机构名称:</span>
|
|
|
- <el-input v-model="listQuery.authParty" placeholder="机构名称" style="width: 280px;" class="filter-item" @keyup.enter.native="handleFilter" />
|
|
|
- <span>审核状态:</span>
|
|
|
- <el-select
|
|
|
- v-model="listQuery.auditStatus"
|
|
|
- placeholder="审核状态"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @change="getList"
|
|
|
- >
|
|
|
- <el-option label="全部" value="" />
|
|
|
- <el-option label="待审核" :value="2" />
|
|
|
- <el-option label="审核通过" :value="1" />
|
|
|
- <el-option label="审核未通过" :value="0" />
|
|
|
- </el-select>
|
|
|
- <span>上线状态:</span>
|
|
|
- <el-select
|
|
|
- v-model="listQuery.status"
|
|
|
- placeholder="上线状态"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- class="filter-item"
|
|
|
- @change="getList"
|
|
|
- >
|
|
|
- <el-option label="全部" value="" />
|
|
|
- <el-option label="已上线" :value="1" />
|
|
|
- <el-option label="待上线" :value="2" />
|
|
|
- <el-option label="未上线" :value="0" />
|
|
|
- </el-select>
|
|
|
-
|
|
|
- <permission-button icon="el-icon-search" type="primary" @click="getList">查询</permission-button>
|
|
|
- <permission-button icon="el-icon-edit" type="primary" @click="$_navigationTo('club-add?type=edit')">添加</permission-button>
|
|
|
- <permission-button icon="el-icon-upload" type="primary" @click="improtDialogVisible = true">导入</permission-button>
|
|
|
- <permission-button icon="el-icon-document" type="primary" @click="handleExportExcel">导出</permission-button>
|
|
|
- <permission-button icon="el-icon-document-copy" type="primary" @click="downLoadExportExcel">获取导入模板</permission-button>
|
|
|
- <permission-button type="primary" icon="el-icon-download" @click="handleExport(1)">一键下载授权牌</permission-button>
|
|
|
- <permission-button type="primary" icon="el-icon-download" @click="handleExport(2)">一键下载二维码</permission-button>
|
|
|
+ <div class="filter-control">
|
|
|
+ <span>机构名称:</span>
|
|
|
+ <el-input v-model="listQuery.authParty" placeholder="机构名称" @keyup.enter.native="handleFilter" />
|
|
|
+ </div>
|
|
|
+ <div class="filter-control">
|
|
|
+ <span>审核状态:</span>
|
|
|
+ <el-select v-model="listQuery.auditStatus" placeholder="审核状态" clearable @change="getList">
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ <el-option label="待审核" :value="2" />
|
|
|
+ <el-option label="审核通过" :value="1" />
|
|
|
+ <el-option label="审核未通过" :value="0" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="filter-control">
|
|
|
+ <span>上线状态:</span>
|
|
|
+ <el-select v-model="listQuery.status" placeholder="上线状态" clearable @change="getList">
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ <el-option label="已上线" :value="1" />
|
|
|
+ <el-option label="待上线" :value="2" />
|
|
|
+ <el-option label="未上线" :value="0" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="filter-control">
|
|
|
+ <permission-button icon="el-icon-search" type="primary" @click="getList">查询</permission-button>
|
|
|
+ <permission-button
|
|
|
+ icon="el-icon-edit"
|
|
|
+ type="primary"
|
|
|
+ @click="$_navigationTo('club-add?type=edit')"
|
|
|
+ >添加</permission-button>
|
|
|
+ <permission-button
|
|
|
+ icon="el-icon-upload"
|
|
|
+ type="primary"
|
|
|
+ @click="improtDialogVisible = true"
|
|
|
+ >导入</permission-button>
|
|
|
+ <permission-button icon="el-icon-document" type="primary" @click="handleExportExcel">导出</permission-button>
|
|
|
+ </div>
|
|
|
+ <div class="filter-control">
|
|
|
+ <permission-button
|
|
|
+ icon="el-icon-document-copy"
|
|
|
+ type="primary"
|
|
|
+ @click="downLoadExportExcel"
|
|
|
+ >获取导入模板</permission-button>
|
|
|
+ <permission-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-download"
|
|
|
+ @click="handleExport(1)"
|
|
|
+ >一键下载授权牌</permission-button>
|
|
|
+ <permission-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-download"
|
|
|
+ @click="handleExport(2)"
|
|
|
+ >一键下载二维码</permission-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- 表格区域 -->
|
|
|
<el-table
|
|
@@ -62,13 +77,7 @@
|
|
|
<!-- 未通过原因展示 -->
|
|
|
<template v-if="row.auditStatus === 0">
|
|
|
<!-- <span class="status danger">审核未通过 </span> -->
|
|
|
- <el-popover
|
|
|
- placement="top-start"
|
|
|
- title="审核说明"
|
|
|
- width="400"
|
|
|
- trigger="hover"
|
|
|
- :content="row.invalidReason"
|
|
|
- >
|
|
|
+ <el-popover placement="top-start" title="审核说明" width="400" trigger="hover" :content="row.invalidReason">
|
|
|
<el-tag slot="reference" size="small" type="danger" class="reason">
|
|
|
<span>审核未通过</span>
|
|
|
<span class="el-icon-question status danger " />
|
|
@@ -80,7 +89,7 @@
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="上线状态" width="260px" align="center">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
<!-- 只有审核通过了才能操作上下线 auditStatus :审核状态 -->
|
|
|
<template v-if="row.auditStatus === 1">
|
|
|
<template v-if="row.status === 0">
|
|
@@ -100,14 +109,14 @@
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="创建时间" class-name="status-col" width="200px">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
<span>{{ row.createTime | formatTime }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<!-- <el-table-column label="创建人" class-name="status-col" width="160px" prop="createBy" /> -->
|
|
|
<el-table-column label="操作" align="center" width="400px" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
<permission-button type="primary" size="mini" @click="$_navigationTo(`club-edit?type=edit&id=${row.authId}`)">
|
|
|
编辑
|
|
|
</permission-button>
|
|
@@ -125,15 +134,16 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 页码 -->
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="listQuery.pageNum"
|
|
|
+ :limit.sync="listQuery.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
|
|
|
<!-- 对话框区域 -->
|
|
|
- <el-dialog
|
|
|
- :title="dialogTitle"
|
|
|
- :visible.sync="showAddAuthDialog"
|
|
|
- width="30%"
|
|
|
- @close="dialogClosed"
|
|
|
- >
|
|
|
+ <el-dialog :title="dialogTitle" :visible.sync="showAddAuthDialog" width="30%" @close="dialogClosed">
|
|
|
<el-form ref="addAuthForm" :rules="addAuthFormRules" :model="addAuthFormData" label-width="100px">
|
|
|
<el-form-item label="授权机构:" prop="authParty">
|
|
|
<el-input v-model="addAuthFormData.authParty" placeholder="请输入授权机构名称" />
|
|
@@ -152,12 +162,7 @@
|
|
|
</el-dialog>
|
|
|
<!-- 导入对话框 -->
|
|
|
<!-- dialog Start -->
|
|
|
- <el-dialog
|
|
|
- title="导入"
|
|
|
- :visible.sync="improtDialogVisible"
|
|
|
- width="30%"
|
|
|
- @close="improtDialogClose"
|
|
|
- >
|
|
|
+ <el-dialog title="导入" :visible.sync="improtDialogVisible" width="30%" @close="improtDialogClose">
|
|
|
<el-form ref="dialogForm" :model="improtDialogFormData" label-width="86px" :rules="improtDialogFormRules">
|
|
|
<el-form-item label="文件路径:" prop="fileUrl">
|
|
|
<file-upload ref="fileUpload" :file-list="uploadFileList" @change="fileUploadChange" />
|
|
@@ -166,7 +171,12 @@
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<permission-button @click="improtDialogVisible = false">取 消</permission-button>
|
|
|
- <permission-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</permission-button>
|
|
|
+ <permission-button
|
|
|
+ type="primary"
|
|
|
+ :disabled="!saveBtnClickable"
|
|
|
+ :loading="requestLoading"
|
|
|
+ @click="submitUpload"
|
|
|
+ >确 定</permission-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- dialog END -->
|
|
@@ -219,9 +229,7 @@ export default {
|
|
|
status: 2 // 授权状态 0下线,1上线 2待审核
|
|
|
},
|
|
|
addAuthFormRules: {
|
|
|
- authParty: [
|
|
|
- { required: true, message: '请输入授权机构名称', trigger: 'blur' }
|
|
|
- ]
|
|
|
+ authParty: [{ required: true, message: '请输入授权机构名称', trigger: 'blur' }]
|
|
|
},
|
|
|
disabled: false,
|
|
|
// 审核未通过
|
|
@@ -238,7 +246,8 @@ export default {
|
|
|
fileUrl: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '请选择文件', trigger: 'change'
|
|
|
+ message: '请选择文件',
|
|
|
+ trigger: 'change'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -300,7 +309,9 @@ export default {
|
|
|
|
|
|
// 下载模板
|
|
|
downLoadExportExcel() {
|
|
|
- downLoadWithATag(`${process.env.VUE_APP_BASE_API}/download/file?ossName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx&fileName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`)
|
|
|
+ downLoadWithATag(
|
|
|
+ `${process.env.VUE_APP_BASE_API}/download/file?ossName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx&fileName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`
|
|
|
+ )
|
|
|
},
|
|
|
|
|
|
// 导出为Excel
|
|
@@ -333,7 +344,9 @@ export default {
|
|
|
this.improtDialogVisible = false
|
|
|
this.getList()
|
|
|
})
|
|
|
- .catch(err => { console.log(err) })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
.finally(() => {
|
|
|
this.requestLoading = false
|
|
|
})
|
|
@@ -370,22 +383,25 @@ export default {
|
|
|
// 获取授权列表
|
|
|
getList() {
|
|
|
this.listLoading = true
|
|
|
- fecthAuthList(this.listQuery).then(response => {
|
|
|
- if (response.code !== 0) {
|
|
|
+ fecthAuthList(this.listQuery)
|
|
|
+ .then(response => {
|
|
|
+ if (response.code !== 0) {
|
|
|
+ return this.$message.error('授权列表信息获取失败')
|
|
|
+ }
|
|
|
+ const { list, total } = response.data
|
|
|
+ // this.formatList(list)
|
|
|
+ this.list = list
|
|
|
+ this.total = total
|
|
|
+ // 获取审核未通过的列表
|
|
|
+ // this.checkAuditFailedList(list)
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
return this.$message.error('授权列表信息获取失败')
|
|
|
- }
|
|
|
- const { list, total } = response.data
|
|
|
- // this.formatList(list)
|
|
|
- this.list = list
|
|
|
- this.total = total
|
|
|
- // 获取审核未通过的列表
|
|
|
- // this.checkAuditFailedList(list)
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- return this.$message.error('授权列表信息获取失败')
|
|
|
- }).finally(() => {
|
|
|
- this.listLoading = false
|
|
|
- })
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
// 获取审核未通过条数
|
|
|
// Audit failed 审核未通过
|
|
@@ -424,26 +440,33 @@ export default {
|
|
|
// authUserId先判断是否为代理操作,是就从代理数据中获取,否则直接获取当前登录用户的信息
|
|
|
this.addAuthFormData.authUserId = this.authUserId
|
|
|
this.addAuthFormData.createBy = this.addAuthFormData.authUserId
|
|
|
- saveBrandAuth(this.addAuthFormData).then(res => {
|
|
|
- if (res.code !== 0) {
|
|
|
- return
|
|
|
- }
|
|
|
- this.getList()
|
|
|
- const h = this.$createElement
|
|
|
- this.$notify.success({
|
|
|
- title: `${this.noticeTitle}授权机构`,
|
|
|
- message: h('i', { style: 'color: #333' }, `已${this.noticeTitle}授权机构:"${this.addAuthFormData.authParty}"`),
|
|
|
- duration: 3000
|
|
|
+ saveBrandAuth(this.addAuthFormData)
|
|
|
+ .then(res => {
|
|
|
+ if (res.code !== 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ const h = this.$createElement
|
|
|
+ this.$notify.success({
|
|
|
+ title: `${this.noticeTitle}授权机构`,
|
|
|
+ message: h(
|
|
|
+ 'i',
|
|
|
+ { style: 'color: #333' },
|
|
|
+ `已${this.noticeTitle}授权机构:"${this.addAuthFormData.authParty}"`
|
|
|
+ ),
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ this.$refs.addAuthForm.resetFields()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ this.$message.danger('操作失败')
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.showAddAuthDialog = false
|
|
|
+ this.listLoading = false
|
|
|
+ this.disabled = false
|
|
|
})
|
|
|
- this.$refs.addAuthForm.resetFields()
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- this.$message.danger('操作失败')
|
|
|
- }).finally(() => {
|
|
|
- this.showAddAuthDialog = false
|
|
|
- this.listLoading = false
|
|
|
- this.disabled = false
|
|
|
- })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -459,20 +482,23 @@ export default {
|
|
|
if (text !== 'confirm') return
|
|
|
// 要执行的操作
|
|
|
this.listLoading = true
|
|
|
- removeAuth({ authId: item.authId }).then(res => {
|
|
|
- if (res.code !== 0) return
|
|
|
- const h = this.$createElement
|
|
|
- this.$notify.success({
|
|
|
- title: '移除授权机构',
|
|
|
- message: h('i', { style: 'color: #333' }, `移除授权机构:"${item.authParty}"`),
|
|
|
- duration: 3000
|
|
|
+ removeAuth({ authId: item.authId })
|
|
|
+ .then(res => {
|
|
|
+ if (res.code !== 0) return
|
|
|
+ const h = this.$createElement
|
|
|
+ this.$notify.success({
|
|
|
+ title: '移除授权机构',
|
|
|
+ message: h('i', { style: 'color: #333' }, `移除授权机构:"${item.authParty}"`),
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.listLoading = false
|
|
|
+ this.getList()
|
|
|
})
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- }).finally(() => {
|
|
|
- this.listLoading = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
},
|
|
|
// 格式化列表数据
|
|
|
formatList(list = []) {
|
|
@@ -487,19 +513,22 @@ export default {
|
|
|
authId: item.authId,
|
|
|
status: item.status === 1 ? 0 : 1
|
|
|
}
|
|
|
- changeAuthStatus(params).then(res => {
|
|
|
- // this.$message.success(res.data)
|
|
|
- this.$message({
|
|
|
- message: res.data,
|
|
|
- duration: 500,
|
|
|
- type: 'success'
|
|
|
+ changeAuthStatus(params)
|
|
|
+ .then(res => {
|
|
|
+ // this.$message.success(res.data)
|
|
|
+ this.$message({
|
|
|
+ message: res.data,
|
|
|
+ duration: 500,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.listLoading = false
|
|
|
})
|
|
|
- this.getList()
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- }).finally(() => {
|
|
|
- this.listLoading = false
|
|
|
- })
|
|
|
},
|
|
|
// 过滤列表
|
|
|
handleFilter() {
|
|
@@ -542,21 +571,5 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.filter-container{
|
|
|
- span{
|
|
|
- display: inline-block;
|
|
|
- margin-bottom: 10px;
|
|
|
- vertical-align: middle;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
- .el-button{
|
|
|
- display: inline-block;
|
|
|
- margin-bottom: 10px;
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
- .el-input,.el-select{
|
|
|
- margin-right: 10px;
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
</style>
|