AuthenticationManage.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <template>
  2. <div class="create-container" v-loading="loading">
  3. <div class="create-body">
  4. <div class="title">审核认证信息</div>
  5. <el-table
  6. :data="handlingAuthList"
  7. :row-class-name="rowClassName"
  8. stripe
  9. style="width: 100%">
  10. <el-table-column prop="id" label="编号">
  11. <template slot-scope="scope">
  12. <span>{{scope.row.id}}</span>
  13. </template>
  14. </el-table-column>
  15. <el-table-column prop="userInfo" label="用户信息">
  16. <template slot-scope="scope">
  17. <span style="cursor: pointer">
  18. <el-link type="primary">{{scope.row.userName}}</el-link>
  19. </span>
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="type" label="认证类型">
  23. <template slot-scope="scope">
  24. <span>
  25. <el-tag v-if="scope.row.type=='personal'" type="success">个人</el-tag>
  26. <el-tag v-if="scope.row.type=='agency'">机构</el-tag>
  27. <el-tag v-if="scope.row.type=='enterprise'" type="warning">企业</el-tag>
  28. </span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column prop="detail" label="认证详情">
  32. <template slot-scope="scope">
  33. <el-link type="primary" @click="handleAuthDetail(scope.row.userId,scope.row.type)">认证详情</el-link>
  34. </template>
  35. </el-table-column>
  36. <el-table-column prop="status" label="认证状态">
  37. <template slot-scope="scope">
  38. <span>
  39. <el-tag :type="scope.row.authStatus.style">{{scope.row.authStatus.text}}</el-tag>
  40. </span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="date" label="申请时间" width="180">
  44. <template slot-scope="scope">
  45. <span>{{reformTime(new Date(scope.row.applytime))}}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="操作" width="180">
  49. <template slot-scope="scope">
  50. <el-button type="primary" size="mini" @click="handleAuthenticationPass(scope.row.userId,scope.row.type)">
  51. 通过
  52. </el-button>
  53. <el-button type="danger" size="mini" @click="handleAuthenticationReject(scope.row.userId,scope.row.type)">
  54. 驳回
  55. </el-button>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <el-dialog title="认证详情" :visible.sync="showDialog" center width="40%">
  60. <el-form :model="authInfoDetail" label-width="120px" label-position="right">
  61. <el-form-item label="类型:">
  62. <span>
  63. <el-tag v-if="authInfoDetail.type=='personal'" type="success">个人</el-tag>
  64. <el-tag v-if="authInfoDetail.type=='agency'">机构</el-tag>
  65. <el-tag v-if="authInfoDetail.type=='enterprise'" type="warning">企业</el-tag>
  66. </span>
  67. </el-form-item>
  68. <el-form-item label="姓名:" v-if="authInfoDetail.type == 'personal'">
  69. <span>{{authInfoDetail.realName}}</span>
  70. </el-form-item>
  71. <el-form-item label="身份证号:" v-if="authInfoDetail.type == 'personal'">
  72. <span>{{authInfoDetail.IDCard}}</span>
  73. </el-form-item>
  74. <el-form-item label="身份证照:" v-if="authInfoDetail.type == 'personal'">
  75. <span>
  76. <el-image
  77. style="width: 100px;"
  78. :src="authInfoDetail.IDCardPositivePhoto"
  79. fit="scale-down"></el-image>
  80. </span>
  81. </el-form-item>
  82. <!-- <el-form-item label="银行账号:">-->
  83. <!-- <span>{{authInfoDetail.bankAccount}}</span>-->
  84. <!-- </el-form-item>-->
  85. <el-form-item label="地址:">
  86. <span>{{authInfoDetail.address}}</span>
  87. </el-form-item>
  88. <el-form-item label="申请时间:">
  89. <span>{{reformTime(new Date(authInfoDetail.applyTime))}}</span>
  90. </el-form-item>
  91. <el-form-item label="企业名称:" v-if="authInfoDetail.type == 'enterprise'">
  92. <span>{{authInfoDetail.enterpriseName}}</span>
  93. </el-form-item>
  94. <el-form-item label="法人姓名:" v-if="authInfoDetail.type == 'enterprise'">
  95. <span>{{authInfoDetail.legalPersonName}}</span>
  96. </el-form-item>
  97. <el-form-item label="营业执照:" v-if="authInfoDetail.type == 'enterprise'">
  98. <span>
  99. <el-image
  100. style="width: 100px;"
  101. :src="authInfoDetail.businessLicensePhoto"
  102. fit="scale-down"></el-image>
  103. </span>
  104. </el-form-item>
  105. <el-form-item label="统一信用代码:" v-if="authInfoDetail.type == 'enterprise'">
  106. <span>{{authInfoDetail.unifiedSocialCreditCode}}</span>
  107. </el-form-item>
  108. <el-form-item label="机构名称:" v-if="authInfoDetail.type == 'agency'">
  109. <span>{{authInfoDetail.evaluationAgencyName}}</span>
  110. </el-form-item>
  111. <el-form-item label="机构能力:" v-if="authInfoDetail.type == 'agency'">
  112. <span v-for="item in authInfoDetail.evaluationAgencyAbilityList"> <el-tag>{{item}}</el-tag>
  113. </span>
  114. </el-form-item>
  115. <el-form-item label="机构资源:" v-if="authInfoDetail.type == 'agency'">
  116. <span v-for="item in authInfoDetail.evaluationAgencyResourceList"> <el-tag>{{item.type}} ( {{item.name}} ) :&nbsp; [总数:{{item.totalNum}} ,可用数量:{{item.availableNum}}]</el-tag>
  117. </span>
  118. </el-form-item>
  119. <el-form-item label="机构Logo:" v-if="authInfoDetail.type == 'agency'">
  120. <span>
  121. <el-image
  122. style="width: 100px;"
  123. :src="authInfoDetail.agencyPhoto"
  124. fit="scale-down"></el-image>
  125. </span>
  126. </el-form-item>
  127. </el-form>
  128. <div slot="footer" class="dialog-footer">
  129. <el-button type="info" size="mini" @click="hideAuthDialog()">返回</el-button>
  130. <el-button type="danger" size="mini"
  131. @click="handleAuthenticationReject(authInfoDetail.userId,authInfoDetail.type)">驳回
  132. </el-button>
  133. <el-button type="primary" size="mini"
  134. @click="handleAuthenticationPass(authInfoDetail.userId,authInfoDetail.type)">通过
  135. </el-button>
  136. </div>
  137. </el-dialog>
  138. <!--<el-pagination-->
  139. <!--:page-size="20"-->
  140. <!--hide-on-single-page-->
  141. <!--:pager-count="5"-->
  142. <!--:current-page.sync="currentPage"-->
  143. <!--layout="prev, pager, next"-->
  144. <!--@current-change="handleCurrentChange"-->
  145. <!--:total="100">-->
  146. <!--</el-pagination>-->
  147. </div>
  148. </div>
  149. </template>
  150. <script>
  151. import {
  152. checkPassAuth,
  153. checkRejectAuth,
  154. getAllHandledAuthInfo,
  155. getAllHandlingAuthInfo,
  156. getCurrentAgencyAuthInfo,
  157. getCurrentEnterpriseAuthInfo,
  158. getCurrentIndividualAuthenInfo,
  159. getFormalTimeFromDate
  160. } from '@/js/index'
  161. import {notify} from '@/constants/index'
  162. export default {
  163. name: 'AuthenticationManage',
  164. data () {
  165. return {
  166. currentPage: 1,
  167. loading: false,
  168. showDialog: false,
  169. authenticationStatusUntreated: '审核中',
  170. authenticationStatusPass: '审核通过',
  171. authenticationStatusReject: '审核未通过',
  172. handlingAuthList: [],
  173. handledAuthList: [],
  174. authInfoDetail: {
  175. userId: '',
  176. type: '',
  177. realName: '',
  178. IDCard: '',
  179. IDCardPositivePhoto: '',
  180. bankAccount: '',
  181. address: '',
  182. applyTime: '',
  183. enterpriseName: '',
  184. legalPersonName: '',
  185. businessLicensePhoto: '',
  186. unifiedSocialCreditCode: '',
  187. evaluationAgencyName: '',
  188. evaluationAgencyAbilityList: [],
  189. evaluationAgencyResourceList: [],
  190. agencyPhoto: '',
  191. updateTime: '',
  192. expireTime: ''
  193. }
  194. }
  195. },
  196. mounted () {
  197. this.$nextTick(() => {
  198. this.init()
  199. })
  200. },
  201. methods: {
  202. init () {
  203. this.getHandlingAuthList()
  204. this.getHandledAuthList()
  205. },
  206. //获取所有未认证信息
  207. getHandlingAuthList () {
  208. this.showLoading()
  209. getAllHandlingAuthInfo(this.getHandlingAuthListSuccess, this.getHandlingAuthListFail)
  210. },
  211. //获取所有已认证信息
  212. getHandlingAuthListSuccess (res) {
  213. this.handlingAuthList = res
  214. this.hideLoading()
  215. },
  216. getHandlingAuthListFail (error) {
  217. this.hideLoading()
  218. notify('error', '获取认证信息失败:' + error.data)
  219. },
  220. getHandledAuthList () {
  221. this.showLoading()
  222. getAllHandledAuthInfo(this.getHandledAuthListSuccess, this.getHandledAuthListFail)
  223. },
  224. getHandledAuthListSuccess (res) {
  225. this.handledAuthList = res
  226. this.hideLoading()
  227. },
  228. getHandledAuthListFail (error) {
  229. this.hideLoading()
  230. notify('error', '获取已认证信息失败:' + error.data)
  231. },
  232. handleCurrentChange (param) {
  233. console.log(param)
  234. },
  235. handleAuthenticationPass (userId, type) {
  236. this.showLoading()
  237. checkPassAuth(type, userId, this.handleAuthenticationPassSuccess, this.handleAuthenticationPassFail)
  238. this.showDialog = false
  239. // item.status = this.authenticationStatusPass
  240. // console.log('通过')
  241. },
  242. handleAuthenticationPassSuccess (res) {
  243. this.hideLoading()
  244. this.getHandlingAuthList()
  245. console.log(res)
  246. },
  247. handleAuthenticationPassFail (error) {
  248. this.hideLoading()
  249. console.log(error)
  250. notify('error', '通过失败:' + error.data)
  251. },
  252. handleAuthenticationReject (userId, type) {
  253. this.$prompt('请输入驳回本申请的原因', '提示', {
  254. confirmButtonText: '确定',
  255. cancelButtonText: '取消',
  256. }).then((event) => {
  257. const explain = event.value
  258. console.log(explain)
  259. this.showLoading()
  260. const data = {
  261. explain: event.value
  262. }
  263. checkRejectAuth(type, userId, data, this.handleAuthenticationRejectSuccess, this.handleAuthenticationRejectFail)
  264. }).catch(() => {
  265. })
  266. },
  267. handleAuthenticationRejectSuccess (res) {
  268. this.hideLoading()
  269. this.getHandlingAuthList()
  270. notify('success', '驳回成功')
  271. console.log(res)
  272. },
  273. handleAuthenticationRejectFail (error) {
  274. this.hideLoading()
  275. console.log(error)
  276. notify('error', '拒绝失败:' + error.data)
  277. },
  278. handleAuthDetail (userId, type) {
  279. this.authInfoDetail.userId = userId
  280. this.authInfoDetail.type = type
  281. this.getAuthInfo(userId, type)
  282. },
  283. showLoading () {
  284. this.loading = true
  285. },
  286. hideLoading () {
  287. this.loading = false
  288. },
  289. reformTime (date) {
  290. return getFormalTimeFromDate(date)
  291. },
  292. rowClassName ({row, rowIndex}) {
  293. //把每一行的索引放进row.id
  294. row.id = rowIndex + 1
  295. },
  296. showAuthDialog () {
  297. this.showDialog = true
  298. },
  299. hideAuthDialog () {
  300. this.showDialog = false
  301. },
  302. getAuthInfo (userId, type) {
  303. this.showLoading()
  304. if (type == 'personal') {
  305. getCurrentIndividualAuthenInfo(userId, this.getCurrentIndividualAuthenInfoSuccess, this.getCurrentIndividualAuthenInfoFail)
  306. } else if (type == 'enterprise') {
  307. getCurrentEnterpriseAuthInfo(userId, this.getCurrentEnterpriseAuthInfoSuccess, this.getCurrentEnterpriseAuthInfoFail)
  308. } else if (type == 'agency') {
  309. getCurrentAgencyAuthInfo(userId, this.getCurrentAgencyAuthInfoSuccess, this.getCurrentAgencyAuthInfoFail)
  310. }
  311. },
  312. getCurrentIndividualAuthenInfoSuccess (res) {
  313. this.hideLoading()
  314. console.log(res)
  315. this.authInfoDetail.realName = res.realName
  316. this.authInfoDetail.IDCard = res.idcard
  317. this.authInfoDetail.IDCardPositivePhoto = res.idCardPositivePhotoi
  318. this.authInfoDetail.bankAccount = res.bankAccount
  319. this.authInfoDetail.address = res.address
  320. this.authInfoDetail.applyTime = res.applyTime
  321. this.showAuthDialog()
  322. console.log(res)
  323. },
  324. getCurrentIndividualAuthenInfoFail (error) {
  325. this.hideLoading()
  326. notify('error', '获取个人认证信息出错:' + error.data)
  327. },
  328. getCurrentEnterpriseAuthInfoSuccess (res) {
  329. this.hideLoading()
  330. this.authInfoDetail.enterpriseName = res.enterpriseName
  331. this.authInfoDetail.legalPersonName = res.legalPersonName
  332. this.authInfoDetail.businessLicensePhoto = res.businessLicensePhoto
  333. this.authInfoDetail.bankAccount = res.bankAccount
  334. this.authInfoDetail.address = res.address
  335. this.authInfoDetail.applyTime = res.applyTime
  336. this.authInfoDetail.unifiedSocialCreditCode = res.unifiedSocialCreditCode
  337. this.showAuthDialog()
  338. },
  339. getCurrentEnterpriseAuthInfoFail (error) {
  340. this.hideLoading()
  341. notify('error', '获取企业认证信息出错:' + error.data)
  342. },
  343. getCurrentAgencyAuthInfoSuccess (res) {
  344. this.hideLoading()
  345. this.authInfoDetail.bankAccount = res.bankAccount
  346. this.authInfoDetail.address = res.address
  347. this.authInfoDetail.applyTime = res.applyTime
  348. this.authInfoDetail.evaluationAgencyName = res.evaluationAgencyName
  349. this.authInfoDetail.evaluationAgencyAbilityList = res.evaluationAgencyAbilityList
  350. this.authInfoDetail.evaluationAgencyResourceList = res.evaluationAgencyResourceList
  351. this.authInfoDetail.agencyPhoto = res.agencyPhoto
  352. this.authInfoDetail.updateTime = res.updateTime
  353. this.showAuthDialog()
  354. },
  355. getCurrentAgencyAuthInfoFail (error) {
  356. this.hideLoading()
  357. notify('error', '获取机构认证信息出错:' + error.data)
  358. }
  359. }
  360. }
  361. </script>
  362. <style scoped>
  363. </style>