AuthenticationManage.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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.IDCardPhoto"
  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>{{authInfoDetail.evaluationAgencyAbilityList}}</span>
  113. </el-form-item>
  114. <el-form-item label="机构资源:" v-if="authInfoDetail.type == 'agency'">
  115. <span>{{authInfoDetail.evaluationAgencyResourceList}}</span>
  116. </el-form-item>
  117. <el-form-item label="机构Logo:" v-if="authInfoDetail.type == 'agency'">
  118. <span>
  119. <el-image
  120. style="width: 100px;"
  121. :src="authInfoDetail.agencyPhoto"
  122. fit="scale-down"></el-image>
  123. </span>
  124. </el-form-item>
  125. </el-form>
  126. <div slot="footer" class="dialog-footer">
  127. <el-button type="info" size="mini" @click="hideAuthDialog()">返回</el-button>
  128. <el-button type="danger" size="mini"
  129. @click="handleAuthenticationReject(authInfoDetail.userId,authInfoDetail.type)">驳回
  130. </el-button>
  131. <el-button type="primary" size="mini"
  132. @click="handleAuthenticationPass(authInfoDetail.userId,authInfoDetail.type)">通过
  133. </el-button>
  134. </div>
  135. </el-dialog>
  136. <!--<el-pagination-->
  137. <!--:page-size="20"-->
  138. <!--hide-on-single-page-->
  139. <!--:pager-count="5"-->
  140. <!--:current-page.sync="currentPage"-->
  141. <!--layout="prev, pager, next"-->
  142. <!--@current-change="handleCurrentChange"-->
  143. <!--:total="100">-->
  144. <!--</el-pagination>-->
  145. </div>
  146. </div>
  147. </template>
  148. <script>
  149. import {
  150. checkPassAuth,
  151. checkRejectAuth,
  152. getAllHandledAuthInfo,
  153. getAllHandlingAuthInfo,
  154. getCurrentAgencyAuthInfo,
  155. getCurrentEnterpriseAuthInfo,
  156. getCurrentIndividualAuthenInfo,
  157. getFormalTimeFromDate
  158. } from '@/js/index'
  159. import {notify} from '@/constants/index'
  160. export default {
  161. name: 'AuthenticationManage',
  162. data () {
  163. return {
  164. currentPage: 1,
  165. loading: false,
  166. showDialog: false,
  167. authenticationStatusUntreated: '审核中',
  168. authenticationStatusPass: '审核通过',
  169. authenticationStatusReject: '审核未通过',
  170. handlingAuthList: [],
  171. handledAuthList: [],
  172. authInfoDetail: {
  173. userId: '',
  174. type: '',
  175. realName: '',
  176. IDCard: '',
  177. IDCardPhoto: '',
  178. bankAccount: '',
  179. address: '',
  180. applyTime: '',
  181. enterpriseName: '',
  182. legalPersonName: '',
  183. businessLicensePhoto: '',
  184. unifiedSocialCreditCode: '',
  185. evaluationAgencyName: '',
  186. evaluationAgencyAbilityList: [],
  187. evaluationAgencyResourceList: [],
  188. agencyPhoto: '',
  189. updateTime: '',
  190. expireTime: ''
  191. }
  192. }
  193. },
  194. mounted () {
  195. this.$nextTick(() => {
  196. this.init()
  197. })
  198. },
  199. methods: {
  200. init () {
  201. this.getHandlingAuthList()
  202. this.getHandledAuthList()
  203. },
  204. //获取所有未认证信息
  205. getHandlingAuthList () {
  206. this.showLoading()
  207. getAllHandlingAuthInfo(this.getHandlingAuthListSuccess, this.getHandlingAuthListFail)
  208. },
  209. //获取所有已认证信息
  210. getHandlingAuthListSuccess (res) {
  211. this.handlingAuthList = res
  212. this.hideLoading()
  213. },
  214. getHandlingAuthListFail (error) {
  215. this.hideLoading()
  216. notify('error', '获取认证信息失败:' + error.data)
  217. },
  218. getHandledAuthList () {
  219. this.showLoading()
  220. getAllHandledAuthInfo(this.getHandledAuthListSuccess, this.getHandledAuthListFail)
  221. },
  222. getHandledAuthListSuccess (res) {
  223. this.handledAuthList = res
  224. this.hideLoading()
  225. },
  226. getHandledAuthListFail (error) {
  227. this.hideLoading()
  228. notify('error', '获取已认证信息失败:' + error.data)
  229. },
  230. handleCurrentChange (param) {
  231. console.log(param)
  232. },
  233. handleAuthenticationPass (userId, type) {
  234. this.showLoading()
  235. checkPassAuth(type, userId, this.handleAuthenticationPassSuccess, this.handleAuthenticationPassFail)
  236. // item.status = this.authenticationStatusPass
  237. // console.log('通过')
  238. },
  239. handleAuthenticationPassSuccess (res) {
  240. this.hideLoading()
  241. this.getHandlingAuthList()
  242. console.log(res)
  243. },
  244. handleAuthenticationPassFail (error) {
  245. this.hideLoading()
  246. console.log(error)
  247. notify('error', '通过失败:' + error.data)
  248. },
  249. handleAuthenticationReject (userId, type) {
  250. this.$prompt('请输入驳回本申请的原因', '提示', {
  251. confirmButtonText: '确定',
  252. cancelButtonText: '取消',
  253. }).then((event) => {
  254. const explain = event.value
  255. console.log(explain)
  256. this.showLoading()
  257. const data = {
  258. explain: event.value
  259. }
  260. checkRejectAuth(type, userId, data, this.handleAuthenticationRejectSuccess, this.handleAuthenticationRejectFail)
  261. }).catch(() => {
  262. })
  263. },
  264. handleAuthenticationRejectSuccess (res) {
  265. this.hideLoading()
  266. this.getHandlingAuthList()
  267. notify('success', '驳回成功')
  268. console.log(res)
  269. },
  270. handleAuthenticationRejectFail (error) {
  271. this.hideLoading()
  272. console.log(error)
  273. notify('error', '拒绝失败:' + error.data)
  274. },
  275. handleAuthDetail (userId, type) {
  276. this.authInfoDetail.userId = userId
  277. this.authInfoDetail.type = type
  278. this.getAuthInfo(userId, type)
  279. },
  280. showLoading () {
  281. this.loading = true
  282. },
  283. hideLoading () {
  284. this.loading = false
  285. },
  286. reformTime (date) {
  287. return getFormalTimeFromDate(date)
  288. },
  289. rowClassName ({row, rowIndex}) {
  290. //把每一行的索引放进row.id
  291. row.id = rowIndex + 1
  292. },
  293. showAuthDialog () {
  294. this.showDialog = true
  295. },
  296. hideAuthDialog () {
  297. this.showDialog = false
  298. },
  299. getAuthInfo (userId, type) {
  300. this.showLoading()
  301. if (type == 'personal') {
  302. getCurrentIndividualAuthenInfo(userId, this.getCurrentIndividualAuthenInfoSuccess, this.getCurrentIndividualAuthenInfoFail)
  303. } else if (type == 'enterprise') {
  304. getCurrentEnterpriseAuthInfo(userId, this.getCurrentEnterpriseAuthInfoSuccess, this.getCurrentEnterpriseAuthInfoFail)
  305. } else if (type == 'agency') {
  306. getCurrentAgencyAuthInfo(userId, this.getCurrentAgencyAuthInfoSuccess, this.getCurrentAgencyAuthInfoFail)
  307. }
  308. },
  309. getCurrentIndividualAuthenInfoSuccess (res) {
  310. this.hideLoading()
  311. console.log(res)
  312. this.authInfoDetail.realName = res.realName
  313. this.authInfoDetail.IDCard = res.idcard
  314. this.authInfoDetail.IDCardPhoto = res.idcardPhoto
  315. this.authInfoDetail.bankAccount = res.bankAccount
  316. this.authInfoDetail.address = res.address
  317. this.authInfoDetail.applyTime = res.applyTime
  318. this.showAuthDialog()
  319. console.log(res)
  320. },
  321. getCurrentIndividualAuthenInfoFail (error) {
  322. this.hideLoading()
  323. notify('error', '获取个人认证信息出错:' + error.data)
  324. },
  325. getCurrentEnterpriseAuthInfoSuccess () {
  326. this.hideLoading()
  327. this.authInfoDetail.enterpriseName = res.enterpriseName
  328. this.authInfoDetail.legalPersonName = res.legalPersonName
  329. this.authInfoDetail.businessLicensePhoto = res.businessLicensePhoto
  330. },
  331. getCurrentEnterpriseAuthInfoFail () {
  332. this.hideLoading()
  333. notify('error', '获取企业认证信息出错:' + error.data)
  334. },
  335. getCurrentAgencyAuthInfoSuccess () {
  336. this.hideLoading()
  337. this.authInfoDetail.evaluationAgencyName = res.evaluationAgencyName
  338. this.authInfoDetail.evaluationAgencyAbilityList = res.evaluationAgencyAbilityList
  339. this.authInfoDetail.evaluationAgencyResourceList = res.evaluationAgencyResourceList
  340. this.authInfoDetail.agencyPhoto = res.agencyPhoto
  341. this.authInfoDetail.updateTime = res.updateTime
  342. },
  343. getCurrentAgencyAuthInfoFail () {
  344. this.hideLoading()
  345. notify('error', '获取机构认证信息出错:' + error.data)
  346. }
  347. }
  348. }
  349. </script>
  350. <style scoped>
  351. </style>