|
|
@@ -1,14 +1,35 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<message-list :messages="messages">
|
|
|
- <button class="btn btn-default btn-auth" slot="action">认证通过</button>
|
|
|
- <button class="btn btn-default" slot="action">不通过</button>
|
|
|
+ <button class="btn btn-default btn-auth" slot="action" @click="passAuth">认证通过</button>
|
|
|
+ <button class="btn btn-default" slot="action" @click="failAuth">不通过</button>
|
|
|
</message-list>
|
|
|
+
|
|
|
+ <!-- 更换管理员对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ title="未通过原因"
|
|
|
+ :visible.sync="isShowReasonDialog"
|
|
|
+ width="450px"
|
|
|
+ :show-close="true"
|
|
|
+ :append-to-body="true">
|
|
|
+ <!-- 对话框内容 -->
|
|
|
+ <!-- 用户信息展示 -->
|
|
|
+ <div class="input-fail-pass-reason">
|
|
|
+ <textarea class="form-control" rows="4" placeholder="请输入未通过原因" v-model="reason"></textarea>
|
|
|
+ </div>
|
|
|
+ <!-- 对话框尾部 -->
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFailReason">确 定</el-button>
|
|
|
+ <el-button @click="isShowReasonDialog = false">取 消</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import axios from '@/assets/js/axios'
|
|
|
import MessageList from './common/MessageList'
|
|
|
+ import * as types from '@/store/mutation-types'
|
|
|
|
|
|
export default {
|
|
|
name: 'enterprise-auth',
|
|
|
@@ -17,11 +38,61 @@
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ isShowReasonDialog: false,
|
|
|
+ reason: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
messages () {
|
|
|
return this.$store.getters.enAuthInfo
|
|
|
+ },
|
|
|
+ enterprise () {
|
|
|
+ return this.$store.state.enterprises.savedEnterprise
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ showErrorMessage (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ },
|
|
|
+ passAuth () {
|
|
|
+ const success = userSpace => {
|
|
|
+ this.$store.commit(types.CHOOSE_ENTERPRISE, userSpace)
|
|
|
+
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ }
|
|
|
+
|
|
|
+ this.saveAuthInfo(true, null, success, this.showErrorMessage)
|
|
|
+ },
|
|
|
+ failAuth () {
|
|
|
+ this.reason = ''
|
|
|
+
|
|
|
+ this.isShowReasonDialog = true
|
|
|
+ },
|
|
|
+ submitFailReason () {
|
|
|
+ if (!this.reason) {
|
|
|
+ this.$message.error('不通过原因不能为空')
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+
|
|
|
+ const success = userSpace => {
|
|
|
+ this.$store.commit(types.CHOOSE_ENTERPRISE, userSpace)
|
|
|
+
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ this.isShowReasonDialog = false
|
|
|
+ }
|
|
|
+
|
|
|
+ this.saveAuthInfo(false, this.reason, success, this.showErrorMessage)
|
|
|
+ },
|
|
|
+ saveAuthInfo (isPass, reason, success, error) {
|
|
|
+ const spaceUU = this.enterprise.spaceUU
|
|
|
+ const params = { isPass }
|
|
|
+ if (!isPass) {
|
|
|
+ params.reason = reason
|
|
|
+ }
|
|
|
+
|
|
|
+ return axios.put(`/api/user/space/${spaceUU}/authEnterpriseInfo`, {}, { params })
|
|
|
+ .then(success)
|
|
|
+ .catch(error)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -41,4 +112,60 @@
|
|
|
content: 'ABV';
|
|
|
color: black;
|
|
|
}
|
|
|
+ .el-dialog {
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+ .el-dialog__header {
|
|
|
+ padding: 14px 20px;
|
|
|
+ height: 44px;
|
|
|
+ line-height: 16px;
|
|
|
+ border: 1px none #D2D2D2;
|
|
|
+ border-bottom-style: solid;
|
|
|
+ }
|
|
|
+ .el-dialog__header .el-dialog__title {
|
|
|
+ color: #000000;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: normal;
|
|
|
+ font-family: "SimHei", sans-serif;
|
|
|
+ }
|
|
|
+ .el-dialog__body {
|
|
|
+ padding: 22px 0 22px 40px;
|
|
|
+ }
|
|
|
+ .input-fail-pass-reason {
|
|
|
+ margin: 0 30px 30px -10px;
|
|
|
+ width: 400px;
|
|
|
+ }
|
|
|
+ .input-fail-pass-reason textarea {
|
|
|
+ width: 400px;
|
|
|
+ resize: none;
|
|
|
+ }
|
|
|
+ .el-select .el-input__inner {
|
|
|
+ border-radius: 0;
|
|
|
+ width: 128px;
|
|
|
+ height: 32px;
|
|
|
+ }
|
|
|
+ .search-group .el-input__inner {
|
|
|
+ width: 186px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 0;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ .el-dialog__footer {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .el-dialog__footer .el-button {
|
|
|
+ width: 180px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 15px;
|
|
|
+ line-height: 14px;
|
|
|
+ padding: 8px 0;
|
|
|
+
|
|
|
+ background: none;
|
|
|
+
|
|
|
+ color: #656565;
|
|
|
+ }
|
|
|
+ .el-dialog__footer .el-button--primary {
|
|
|
+ background-color: #4E8EFC;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
</style>
|