Jelajahi Sumber

个人认证添加、修改

sunjh 6 tahun lalu
induk
melakukan
87aa03f494

+ 8 - 1
src/components/Square.vue

@@ -2,7 +2,14 @@
   <div class="square-container">
     <div class="title">全部任务</div>
 
-    <div class="square-list-container" v-loading="loading">
+    <div class="square-list-container" v-loading="loading" type="flex" align="middle">
+      <el-row v-if="list != null && list.length != 0" type="flex" align="middle" justify="center"  style="font-size: 14px;">
+        <el-col :span="6">任务封面</el-col>
+        <el-col :span="5">任务名称</el-col>
+        <el-col :span="5">任务类型</el-col>
+        <el-col :span="4">任务预算</el-col>
+        <el-col :span="4">操作</el-col>
+      </el-row>
       <task-item v-if="list!=null&&list.length>0" v-for="(item,index) in list" :key="index" :task="item"/>
       <!--<div v-if="loading" class="loading">-->
       <!--<span></span>-->

+ 47 - 39
src/components/authen/IndividualAuthentication.vue

@@ -4,8 +4,8 @@
       <div class="title">个人信息认证</div>
       <el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
         <el-form-item label="姓名" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.name"></el-input>
-          <span v-if="!isModifyMode">{{authentication.name}}</span>
+          <el-input v-if="isModifyMode" v-model="authentication.realName"></el-input>
+          <span v-if="!isModifyMode">{{authentication.realName}}</span>
         </el-form-item>
         <el-form-item prop="file" label="手持身份证照片">
           <el-upload
@@ -15,19 +15,19 @@
             :show-file-list="false"
             :http-request="uploadFile"
             :before-upload="beforeFileUpload">
-            <img v-if="authentication.photoUrl" :src="authentication.photoUrl" class="avatar">
+            <img v-if="authentication.IDCardPhoto" :src="authentication.IDCardPhoto" class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
           <span v-if="!isModifyMode">
           <el-image
             style="width: 100px;"
-            :src="authentication.photoUrl"
+            :src="authentication.IDCardPhoto"
             fit="scale-down"></el-image>
         </span>
         </el-form-item>
         <el-form-item label="身份证号" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.idNumber"></el-input>
-          <span v-if="!isModifyMode">{{authentication.idNumber}}</span>
+          <el-input v-if="isModifyMode" v-model="authentication.IDCard"></el-input>
+          <span v-if="!isModifyMode">{{authentication.IDCard}}</span>
         </el-form-item>
 
         <el-form-item label="银行卡账户" prop="name">
@@ -59,7 +59,7 @@ import {
   defaultValue,
   getAllAgencyResourceTypes,
   getAllServiceTypes,
-  getCurrentAuthenInfo,
+  getCurrentIndividualAuthenInfo,
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
   storageGet,
@@ -75,10 +75,9 @@ export default {
       loading: false,
       isModifyMode: false,
       authentication: {
-        photo: [],
-        photoUrl: defaultValue.image,
-        name: '',
-        idNumber: '',
+        IDCardPhoto: defaultValue.image,
+        realName: '',
+        IDCard: '',
         bankAccount: '',
         address: '',
       },
@@ -109,9 +108,9 @@ export default {
     })
   },
   watch: {
-    authentication (val) {
-      this.authentication = val
-    },
+    // authentication (val) {
+    //   this.authentication = val
+    // },
     deep: true
   },
   methods: {
@@ -123,19 +122,20 @@ export default {
     //加载数据
     getAuthInfo () {
       this.showLoading()
-      getCurrentAuthenInfo().then((res) => {
-        this.authentication.photo = []
-        this.authentication.photoUrl = res.IDCardPhoto == null ? defaultValue.image : res.IDCardPhoto
-        this.authentication.name = res.realName == null ? '暂未填写' : res.realName
-        this.authentication.idNumber = res.IDCard == null ? '暂未填写' : res.IDCard
-        this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
-        this.authentication.address = res.address == null ? '暂未填写' : res.address
-        this.hideLoading()
-        console.log(this.authentication)
-      }).catch((error) => {
-        this.hideLoading()
-        notify('error', '加载认证信息失败:' + error.data)
-      })
+      getCurrentIndividualAuthenInfo(this.user.userVO.id, this.getAuthInfoSuccess, this.getAuthInfoFail)
+    },
+    getAuthInfoSuccess (res) {
+      this.hideLoading()
+      this.authentication.IDCardPhoto = res.idcardPhoto == null ? defaultValue.image : res.idcardPhoto
+      this.authentication.realName = res.realName == null ? '暂未填写' : res.realName
+      this.authentication.IDCard = res.idcard == null ? '暂未填写' : res.idcard
+      this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
+      this.authentication.address = res.address == null ? '暂未填写' : res.address
+      console.log(this.authentication)
+    },
+    getAuthInfoFail (error) {
+      this.hideLoading()
+      notify('error', '加载认证信息失败:' + error.data)
     },
     //表单进入可编辑状态,可修改表单
     modifyInfo () {
@@ -146,21 +146,29 @@ export default {
       //this.isModifyMode = false
       this.showLoading()
       const newAuthentication = {
-        realName: this.authentication.name,
+        userId: this.user.userVO.id,
+        realName: this.authentication.realName,
         bankAccount: this.authentication.bankAccount,
         address: this.authentication.address,
-        IDCardPhoto: this.authentication.photoUrl,
-        IDCard: this.authentication.idNumber,
+        IDCardPhoto: this.authentication.IDCardPhoto,
+        IDCard: this.authentication.IDCard,
       }
-      updateIndividualAuthInfo(this.user.userVO.id, newAuthentication).then((res) => {
-        //console.log(res)
-        this.hideLoading()
-        this.cancelModify()
-        notify('success', '认证信息修改成功')
-      }).catch(error => {
-        this.hideLoading()
-        notify('error', error.data.msg)
-      })
+      //console.log(newAuthentication)
+      updateIndividualAuthInfo(this.user.userVO.id, newAuthentication, this.updateAuthInfoSuccess, this.updateAuthInfoFail)
+    },
+    updateAuthInfoSuccess (res) {
+      this.hideLoading()
+      this.authentication.IDCardPhoto = res.idcardPhoto == null ? defaultValue.image : res.idcardPhoto
+      this.authentication.realName = res.realName == null ? '暂未填写' : res.realName
+      this.authentication.IDCard = res.idcard == null ? '暂未填写' : res.idcard
+      this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
+      this.authentication.address = res.address == null ? '暂未填写' : res.address
+      this.cancelModify()
+      notify('success', '认证信息修改成功')
+    },
+    updateAuthInfoFail (error) {
+      this.hideLoading()
+      notify('error', error.data)
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {

+ 30 - 19
src/components/authen/IndividualAuthenticationCreate.vue

@@ -1,10 +1,10 @@
 <template>
-  <div class="create-container">
+  <div class="create-container" v-loading="loading">
     <div class="create-body">
       <div class="title">个人信息认证</div>
       <el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
-        <el-form-item label="姓名" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.name"></el-input>
+        <el-form-item label="姓名" prop="realName">
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.realName"></el-input>
           <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
         </el-form-item>
         <el-form-item prop="file" label="手持身份证照片">
@@ -14,7 +14,7 @@
             :show-file-list="false"
             :http-request="uploadFile"
             :before-upload="beforeFileUpload">
-            <img v-if="authentication.photoUrl" :src="authentication.photoUrl" class="avatar">
+            <img v-if="authentication.IDCardPhoto" :src="authentication.IDCardPhoto" class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
           <!--<div v-if="!isModifyMode">-->
@@ -24,16 +24,16 @@
           <!--</div>-->
         </el-form-item>
         <el-form-item label="身份证号" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.idNumber"></el-input>
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.IDCard"></el-input>
           <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
         </el-form-item>
 
         <el-form-item label="银行卡账户" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
           <!--<span v-if="!isModifyMode">{{authentication.bankAccount}}</span>-->
         </el-form-item>
         <el-form-item label="地址" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.address"></el-input>
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.address"></el-input>
           <!--<span v-if="!isModifyMode">{{authentication.address}}</span>-->
         </el-form-item>
 
@@ -69,11 +69,11 @@ export default {
       userId: 0,
       user: {},
       isModifyMode: true,
+      loading: false,
       authentication: {
-        photo: [],
-        photoUrl: '',
-        name: '',
-        idNumber: '',
+        IDCardPhoto: '',
+        realName: '',
+        IDCard: '',
         bankAccount: '',
         address: '',
       },
@@ -118,20 +118,22 @@ export default {
     //提交认证信息
     submitInfo () {
       //this.isModifyMode = false
+      this.showLoading()
       const newAuthentication = {
-        mobile: this.authentication.mobile,
-        evaluationAgencyName: this.authentication.name,
+        userId: this.user.userVO.id,
+        realName: this.authentication.realName,
+        IDCard: this.authentication.IDCard,
+        IDCardPhoto: this.authentication.IDCardPhoto,
         bankAccount: this.authentication.bankAccount,
-        address: this.authentication.address,
-        abilities: this.authentication.ability,
-        resources: this.authentication.resource,
-        agencyPhoto: this.authentication.photoUrl,
+        address: this.authentication.address
       }
       Http.post(Apis.USER.SUBMIT_INDIVIDUAL_AUTHENTICATION_INFO.replace('{userId}', this.user.userVO.id), newAuthentication).then((res) => {
+        this.hideLoading()
         console.log(res)
         notify('success', '认证信息上传成功')
       }).catch(error => {
-        notify('error', error.data.msg)
+        this.hideLoading()
+        notify('error', error.data)
       })
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
@@ -159,6 +161,7 @@ export default {
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
+      this.showLoading()
       const formData = new FormData()
       let config = {
         //添加请求头
@@ -166,17 +169,25 @@ export default {
       }
       formData.append('file', param.file)
       Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
+        this.hideLoading()
         console.log('上传成功')
-        this.authentication.photoUrl = res.data
+        this.authentication.IDCardPhoto = res.data
         console.log(res.data)
         notify('success', '上传成功')
       }).catch(error => {
+        this.hideLoading()
         notify('error', error.data.msg)
       })
     },
     //
     setUserInfo () {
       this.user = storageGet('user')
+    },
+    showLoading () {
+      this.loading = true
+    },
+    hideLoading () {
+      this.loading = false
     }
   },
   created: function () {

+ 2 - 1
src/components/commons/Header.vue

@@ -97,7 +97,7 @@
               class="el-icon-arrow-down el-icon--right"></i>
             </span>
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item>
+              <el-dropdown-item v-if="rolesPermissions.isSystemAdministrator">
                 <router-link :to="{ name: 'AuthenticationManage'}">
                   <el-link icon="el-icon-view" :underline="false">
                     审核认证信息
@@ -390,6 +390,7 @@ export default {
           console.log(res)
           storageSave('user', res)
           this.user = res
+          this.rolesPermissions = getRolesPermissions(res.roleList)
           storageSave('rolesPermissions', getRolesPermissions(res.roleList))
           console.log('用户信息加载成功')
           this.isLogin = true

+ 16 - 2
src/components/project/Project.vue

@@ -200,8 +200,16 @@
       <div class="title h2">任务列表</div>
       <div class="task-list">
         <el-table :showHeader="true" :stripe="true" :data="task" style="width: 100%">
-          <el-table-column prop="title" label="任务名称" title="任务名称"></el-table-column>
-          <el-table-column prop="datetime" sortable label="任务截止时间"></el-table-column>
+          <el-table-column prop="title" label="任务名称" title="任务名称">
+            <template slot-scope="scope">
+              <span>{{ scope.row.title }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="datetime" sortable label="任务截止时间">
+            <template slot-scope="scope">
+              <span>{{reformDate(new Date(scope.row.datetime))}}</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="resource" label="任务可见性">
             <template slot-scope="scope">
               <div v-if="scope.row.resource=='1'">{{scope.row.location.provinceCode}}/{{scope.row.location.cityCode}}
@@ -215,8 +223,14 @@
               <div class="badge">{{scope.row.serviceType}}</div>
             </template>
           </el-table-column>
+          <el-table-column align="center" label="状态">
 
+            <template slot-scope="scope">
+              <el-tag :type="scope.row.statusVO.style">{{scope.row.statusVO.text}}</el-tag>
+            </template>
+          </el-table-column>
           <el-table-column align="right" label="操作">
+
             <template slot-scope="scope">
               <div
                 class="btn btn-small btn-info"

+ 3 - 2
src/js/api.js

@@ -46,12 +46,13 @@ export default {
     GET_USER_IDENTITY: '',
     GET_AUTH_URLS: '',
     LOGOUT: '/api/common/logout',
-    SUBMIT_INDIVIDUAL_AUTHENTICATION_INFO: '/api/user/{userId}/individual/',
+    SUBMIT_INDIVIDUAL_AUTHENTICATION_INFO: '/api/user/{userId}/personalAuth/',
     SUBMIT_ENTERPRISE_AUTHENTICATION_INFO: '/api/user/{userId}/enterprise/',
     SUBMIT_AGENCY_AUTHENTICATION_INFO: '/api/user/{userId}/agency/',
-    UPDATE_INDIVIDUAL_AUTHENTICATION_INFO: '/api/user/{userId}/individual/',
+    UPDATE_INDIVIDUAL_AUTHENTICATION_INFO: '/api/user/{userId}/personalAuth',
     UPDATE_ENTERPRISE_AUTHENTICATION_INFO: '/api/user/{userId}/enterprise/',
     UPDATE_AGENCY_AUTHENTICATION_INFO: '/api/user/{userId}/agency/',
+    GET_INDIVIDUAL_AUTHENTICATION_INFO: '/api/user/{userId}/personalAuth',
   },
   PAGE: {
     HOME_PAGE: '/api/common/index/',

+ 2 - 0
src/js/index.js

@@ -3,6 +3,7 @@ import {
   getAllAuthentications,
   getAuthUrls,
   getCurrentAuthenInfo,
+  getCurrentIndividualAuthenInfo,
   getCurrentUser,
   getRolesPermissions,
   logout,
@@ -91,6 +92,7 @@ export {
   uploadEnterpriseAuthenticationInfo,
   //TODO 尚未使用 代码未实现 上传个人认证信息
   uploadIndividualAuthenticationInfo,
+  getCurrentIndividualAuthenInfo
 }
 export {
   /*******************************************************************************/

+ 13 - 2
src/js/userService.js

@@ -102,6 +102,13 @@ export const getAllAuthentications = () => {
     authenticationDetail: {}
   }]
 }
+export const getCurrentIndividualAuthenInfo = (userId, getCurrentIndividualAuthenInfoSuccess, getCurrentIndividualAuthenInfoFail) => {
+  Http.get(Apis.USER.GET_INDIVIDUAL_AUTHENTICATION_INFO.replace('{userId}', userId)).then((res) => {
+    getCurrentIndividualAuthenInfoSuccess(res)
+  }).catch((error) => {
+    getCurrentIndividualAuthenInfoFail(error)
+  })
+}
 
 export const getCurrentAuthenInfo = () => {
   const individualData = {
@@ -180,12 +187,16 @@ export const deleteAuthInfo = () => {
   //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
 }
 //
-export const updateIndividualAuthInfo = (userId, authInfo) => {
+export const updateIndividualAuthInfo = (userId, authInfo, updateIndividualAuthInfoSuccess, updateIndividualAuthInfoFail) => {
   // const data = {}
   // return new Promise((resolve) => {
   //   resolve(data)
   // })
-  return Http.put(Apis.USER.UPDATE_INDIVIDUAL_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
+  Http.put(Apis.USER.UPDATE_INDIVIDUAL_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo).then((res) => {
+    updateIndividualAuthInfoSuccess(res)
+  }).catch((error) => {
+    updateIndividualAuthInfoFail(error)
+  })
 }
 export const updateAgencyAuthInfo = (userId, authInfo) => {
   // const data = {}