guochao il y a 6 ans
Parent
commit
fa882fd3e4

+ 103 - 2
src/components/Home.vue

@@ -13,6 +13,87 @@
       </el-carousel>
     </div>
     <div class="home-body-wrap">
+      <div class="title h2">系统统计信息</div>
+      <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <!--<el-col :span="4">{{project.id}}</el-col>-->
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="home-body-wrap">
       <div class="home-block">
         <div class="title">
           热门任务
@@ -51,7 +132,7 @@ import PersonRank from '@/components/PersonRank'
 import Http from '@/js/http.js'
 import Apis from '@/js/api.js'
 import {notify} from '@/constants/index'
-import {defaultValue, getRolesPermissions, storageGet} from '@/js/index'
+import {defaultValue, getIndexStatisticsInfo, getRolesPermissions, storageGet} from '@/js/index'
 
 export default {
   name: 'Home',
@@ -65,7 +146,14 @@ export default {
       institutionRank: [],
       personRank: [],
       imgList: [],
-      rolesPermissions: {}
+      rolesPermissions: {},
+      statisticsData: {
+        userNum: 100,
+        agencyNum: 200,
+        deviceNum: 345,
+        projectNum: 23,
+        taskNum: 123
+      }
     }
   },
   mounted () {
@@ -120,6 +208,19 @@ export default {
     },
     hideLoading () {
       this.loading = false
+    },
+    getStatisticsData () {
+      getIndexStatisticsInfo().then((res) => {
+        this.statisticsData = res
+      }).catch((error) => {
+        notify('error', '统计数据加载失败')
+      })
+    },
+    getStatisticsDataSuccess () {
+
+    },
+    getStatisticsDataFail () {
+
     }
   },
   created: function () {

+ 42 - 6
src/components/Mine.vue

@@ -52,8 +52,11 @@
     <!--</el-row>-->
     <!--</div>-->
     <div class="mine-body" style="text-align: center;">
-      <el-tabs v-loading="loading" style="width: 90%;margin-left: 5%">
-        <el-tab-pane label="未完成任务">
+      <el-tabs @tab-click="handleTabClick" v-loading="loading" style="width: 90%;margin-left: 5%">
+        <el-tab-pane name="unFinishedTask">
+          <span slot="label">
+            <el-badge class="item" style="margin-top: 10px;margin-bottom: 10px">未完成任务</el-badge>
+          </span>
           <el-row v-if="unFinishedTaskList != null && unFinishedTaskList.length != 0" type="flex" align="middle"
                   justify="center" style="font-size: 14px;">
             <el-col :span="6">任务封面</el-col>
@@ -66,7 +69,10 @@
           <task-item v-if="unFinishedTaskList != null || unFinishedTaskList.length > 0"
                      v-for="(item,index1) in unFinishedTaskList" :key="index1" :task="item"/>
         </el-tab-pane>
-        <el-tab-pane label="已完成任务">
+        <el-tab-pane name="finishedTask">
+          <span slot="label">
+            <el-badge class="item" style="margin-top: 10px;margin-bottom: 10px">已完成任务</el-badge>
+          </span>
           <el-row v-if="finishedTaskList != null && finishedTaskList.length != 0" type="flex" align="middle"
                   justify="center" style="font-size: 14px;">
 
@@ -81,7 +87,15 @@
                      v-for="(item,index2) in finishedTaskList" :key="index2" :task="item"/>
         </el-tab-pane>
 
-        <el-tab-pane label="我的项目">
+
+        <el-tab-pane name="myProject">
+
+          <span slot="label">
+            <el-badge v-if="myProjectNoticeCount>0" :value="myProjectNoticeCount" class="item"
+                      style="height:auto;margin-top: 10px;margin-bottom: 10px">我的项目</el-badge>
+            <el-badge v-if="myProjectNoticeCount==0" class="item"
+                      style="margin-top: 10px;margin-bottom: 10px">我的项目</el-badge>
+          </span>
           <span v-if="myProjects == null || myProjects.length == 0"> 暂无项目 </span>
           <el-row v-if="myProjects != null && myProjects.length != 0" type="flex" align="middle" justify="center"
                   style="font-size: 14px;">
@@ -94,7 +108,12 @@
           <project-item v-if="myProjects != null || myProjects.length > 0"
                         v-for="(item,index3) in myProjects" :key="index3" :projectItem="item"/>
         </el-tab-pane>
-        <el-tab-pane label="处理中项目">
+        <el-tab-pane name="handlingProject">
+          <span slot="label">
+            <el-badge v-if="processProjectNoticeCount>0" :value="processProjectNoticeCount" class="item"
+                      style="margin-top: 10px;margin-bottom: 10px">处理中项目</el-badge>
+            <el-badge v-if="processProjectNoticeCount==0" class="item" style="margin-top: 10px;margin-bottom: 10px">处理中项目</el-badge>
+          </span>
           <el-row v-if="handlingProjects != null && handlingProjects.length != 0" type="flex" align="middle"
                   justify="center" style="font-size: 14px;">
             <el-col :span="6">项目图片</el-col>
@@ -107,7 +126,10 @@
           <project-item v-if="handlingProjects != null || handlingProjects.length > 0"
                         v-for="(item,index4) in handlingProjects" :key="index4" :projectItem="item"/>
         </el-tab-pane>
-        <el-tab-pane label="可接收项目">
+        <el-tab-pane name="acceptableProject">
+          <span slot="label">
+            <el-badge class="item" style="margin-top: 10px;margin-bottom: 10px">可接收项目</el-badge>
+          </span>
           <el-row v-if="acceptableProjects != null && acceptableProjects.length != 0" type="flex" align="middle"
                   justify="center" style="font-size: 14px;">
             <el-col :span="6">项目图片</el-col>
@@ -156,6 +178,8 @@ export default {
       handlingProjects: [],
       acceptableProjects: [],
       defaultValue: defaultValue,
+      myProjectNoticeCount: 0,
+      processProjectNoticeCount: 0,
       rolesPermissions: {
         isRegionManager: false,
         isIndividualUser: false,
@@ -195,6 +219,8 @@ export default {
       this.showLoading()
       Http.get(Apis.PAGE.MY_CROWD_TEST_PAGE.replace('{userId}', this.user.userVO.id)).then((res) => {
         this.hideLoading()
+        this.processProjectNoticeCount = res.processProjectNoticeCount
+        this.myProjectNoticeCount = res.myProjectNoticeCount
         if (res.unfinishedTasks != null && res.unfinishedTasks.length > 0) {
           this.unFinishedTaskList = res.unfinishedTasks
         }
@@ -302,6 +328,16 @@ export default {
     },
     hideLoading () {
       this.loading = false
+    },
+    handleTabClick (event) {
+      if (event.name == 'myProject') {
+        //this.myProjectNoticeCount = 0
+      }
+      if (event.name == 'handlingProject') {
+        //this.processProjectNoticeCount = 0
+      }
+      console.log('123')
+      console.log(event)
     }
   },
   created: function () {

+ 1 - 1
src/components/PersonRank.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-table :data="tableData" showHeader="true" border style="width: 100%">
+    <el-table :data="tableData" :showHeader="true" border style="width: 100%">
       <el-table-column type="index" width="50" label="排名"></el-table-column>
       <el-table-column prop="logo" width="70" label="头像">
         <template slot-scope="scope">

+ 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>-->

+ 56 - 49
src/components/authen/AgencyAuthentication.vue

@@ -11,19 +11,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.agencyPhoto" :src="authentication.agencyPhoto" 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.agencyPhoto"
             fit="scale-down"></el-image>
         </span>
         </el-form-item>
         <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.evaluationAgencyName"></el-input>
+          <span v-if="!isModifyMode">{{authentication.evaluationAgencyName}}</span>
         </el-form-item>
         <!--<el-form-item label="机构电话" prop="name">-->
         <!--<el-input v-if="isModifyMode" v-model="authentication.mobile"></el-input>-->
@@ -38,15 +38,17 @@
           <span v-if="!isModifyMode">{{authentication.address}}</span>
         </el-form-item>
         <el-form-item label="测评机构能力" prop="name">
-          <el-checkbox-group v-if="isModifyMode" v-model="authentication.ability">
+          <el-checkbox-group v-if="isModifyMode" v-model="authentication.evaluationAgencyAbilityList">
             <span v-for="(item,index) in serviceTypes" :key="index">
               <el-checkbox :label="item" name="type">{{item}}&nbsp;&nbsp;&nbsp;&nbsp;</el-checkbox>
             </span>
           </el-checkbox-group>
-          <span v-if="!isModifyMode" v-for="(item,index) in authentication.ability" :key="index"><span class="badge">{{item}}</span></span>
+          <span v-if="!isModifyMode" v-for="(item,index) in authentication.evaluationAgencyAbilityList"
+                :key="index"><span class="badge">{{item}}</span></span>
         </el-form-item>
         <el-form-item label="测评机构资源" prop="name">
-          <span v-if="isModifyMode" v-for="item in authentication.resource" :key="item.id" style="width: 2000px">
+          <span v-if="isModifyMode" v-for="item in authentication.evaluationAgencyResourceList" :key="item.id"
+                style="width: 2000px">
             资源类型:&nbsp;<el-select v-model="item.type" placeholder="请选择" style="width: 15%;margin-bottom: 10px"
                                   :value="item.type">
               <el-option
@@ -66,7 +68,7 @@
           <el-button v-if="isModifyMode" type="primary" icon="el-icon-circle-plus" plain size="small"
                      @click="addAgencyResource">添加资源
           </el-button>
-          <span v-if="!isModifyMode" v-for="item in authentication.resource" :key="item.id">
+          <span v-if="!isModifyMode" v-for="item in authentication.evaluationAgencyResourceList" :key="item.id">
             资源类型:{{item.type}};&nbsp;&nbsp;资源名称:{{item.name}};&nbsp;&nbsp;资源总量:{{item.totalNum}};&nbsp;&nbsp;可用资源:{{item.availableNum}}<br/>
           </span>
         </el-form-item>
@@ -91,6 +93,7 @@ import {
   defaultValue,
   getAllAgencyResourceTypes,
   getAllServiceTypes,
+  getCurrentAgencyAuthInfo,
   getCurrentAuthenInfo,
   storageGet,
   updateAgencyAuthInfo
@@ -108,13 +111,13 @@ export default {
       serviceTypes: [],
       authentication: {
         mobile: '',
-        name: '',
+        evaluationAgencyName: '',
         bankAccount: '',
         address: '',
-        ability: [],
-        resource: [],
+        evaluationAgencyAbilityList: [],
+        evaluationAgencyResourceList: [],
         photo: [],
-        photoUrl: defaultValue.image,
+        agencyPhoto: defaultValue.image,
       },
       rules: {
         // name: [
@@ -153,20 +156,22 @@ export default {
     //加载数据
     getAuthInfo () {
       this.showLoading()
-      getCurrentAuthenInfo().then((res) => {
-        this.authentication.photo = []
-        this.authentication.photoUrl = res.agencyPhoto == null ? defaultValue.image : res.agencyPhoto
-        this.authentication.name = res.evaluationAgencyName == null ? '暂未填写' : res.evaluationAgencyName
-        this.authentication.ability = res.evaluationAgencyAbilityList == null ? [] : res.evaluationAgencyAbilityList
-        this.authentication.resource = res.evaluationAgencyResourceList == null ? [] : res.evaluationAgencyResourceList
-        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)
-      })
+      getCurrentAgencyAuthInfo(this.user.userVO.id, this.getAuthInfoSuccess, this.getAuthInfoFail)
+    },
+    getAuthInfoSuccess (res) {
+      this.hideLoading()
+      this.authentication.agencyPhoto = res.agencyPhoto == null ? defaultValue.image : res.agencyPhoto
+      this.authentication.evaluationAgencyName = res.evaluationAgencyName == null ? '暂未填写' : res.evaluationAgencyName
+      this.authentication.evaluationAgencyAbilityList = res.evaluationAgencyAbilityList == null ? [] : res.evaluationAgencyAbilityList
+      this.authentication.evaluationAgencyResourceList = res.evaluationAgencyResourceList == null ? [] : res.evaluationAgencyResourceList
+      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 () {
@@ -177,24 +182,26 @@ export default {
       //this.isModifyMode = false
       this.showLoading()
       const newAuthentication = {
-        mobile: this.authentication.mobile,
-        evaluationAgencyName: this.authentication.name,
+        userId: this.user.userVO.id,
+        evaluationAgencyName: this.authentication.evaluationAgencyName,
         bankAccount: this.authentication.bankAccount,
         address: this.authentication.address,
-        evaluationAgencyAbilityList: this.authentication.ability,
-        evaluationAgencyResourceList: this.authentication.resource,
-        agencyPhoto: this.authentication.photoUrl,
+        evaluationAgencyAbilityList: this.authentication.evaluationAgencyAbilityList,
+        evaluationAgencyResourceList: this.authentication.evaluationAgencyResourceList,
+        agencyPhoto: this.authentication.agencyPhoto,
       }
       //console.log(newAuthentication)
-      updateAgencyAuthInfo(this.user.userVO.id, newAuthentication).then((res) => {
-        console.log(res)
-        this.hideLoading()
-        this.cancelModify()
-        notify('success', '认证信息修改成功')
-      }).catch(error => {
-        this.hideLoading()
-        notify('error', error.data)
-      })
+      updateAgencyAuthInfo(this.user.userVO.id, newAuthentication, this.updateAuthInfoSuccess, this.updateAuthInfoFail)
+    },
+    updateAuthInfoSuccess (res) {
+      console.log(res)
+      this.hideLoading()
+      this.cancelModify()
+      notify('success', '认证信息修改成功')
+    },
+    updateAuthInfoFail (error) {
+      this.hideLoading()
+      notify('error', error.data)
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {
@@ -229,7 +236,7 @@ export default {
       formData.append('file', param.file)
       Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
         console.log('上传成功')
-        this.authentication.photoUrl = res.data
+        this.authentication.agencyPhoto = res.data
         console.log(res.data)
         notify('success', '上传成功')
       }).catch(error => {
@@ -251,28 +258,28 @@ export default {
     //添加一项测评机构资源
     addAgencyResource () {
       const tmpResource = {
-        id: this.authentication.resource.length,
+        id: this.authentication.evaluationAgencyResourceList.length,
         type: this.resourceTypes[0],
         name: '',
         totalNum: 0,
         availableNum: 0,
       }
-      this.authentication.resource.push(tmpResource)
+      this.authentication.evaluationAgencyResourceList.push(tmpResource)
     },
     //删除一项测评机构资源
     removeAgencyResource (id) {
-      this.authentication.resource.splice(id, 1)
-      for (var i = 0; i < this.authentication.resource.length; i++) {
-        this.authentication.resource[i].id = i
+      this.authentication.evaluationAgencyResourceList.splice(id, 1)
+      for (var i = 0; i < this.authentication.evaluationAgencyResourceList.length; i++) {
+        this.authentication.evaluationAgencyResourceList[i].id = i
       }
     },
     //检测测评机构资源填写是否有效
     checkAgencyResourceVaild () {
-      if (this.authentication.resource.length === 0) {
+      if (this.authentication.evaluationAgencyResourceList.length === 0) {
         return true
       }
-      for (var i = 0; i < this.authentication.resource.length; i++) {
-        const item = this.authentication.resource[i]
+      for (var i = 0; i < this.authentication.evaluationAgencyResourceList.length; i++) {
+        const item = this.authentication.evaluationAgencyResourceList[i]
         if (item.type === '') {
           notify('error', '资源类型不能为空')
           return false

+ 45 - 38
src/components/authen/AgencyAuthenticationCreate.vue

@@ -10,7 +10,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.agencyPhoto" :src="authentication.agencyPhoto" class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
           <!--<div v-if="!isModifyMode">-->
@@ -20,7 +20,7 @@
           <!--</div>-->
         </el-form-item>
         <el-form-item label="机构名称" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.name"></el-input>
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.evaluationAgencyName"></el-input>
           <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
         </el-form-item>
         <!--<el-form-item label="机构电话" prop="name">-->
@@ -28,15 +28,15 @@
         <!--&lt;!&ndash;<span v-if="!isModifyMode">{{authentication.name}}</span>&ndash;&gt;-->
         <!--</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>
         <el-form-item label="测评机构能力" prop="name">
-          <el-checkbox-group v-if="isModifyMode" v-model="authentication.ability">
+          <el-checkbox-group v-if="isModifyMode" v-model="authentication.evaluationAgencyAbilityList">
             <span v-for="(item,index) in serviceTypes" :key="index">
               <el-checkbox :label="item" name="type">{{item}}&nbsp;&nbsp;&nbsp;&nbsp;</el-checkbox>
             </span>
@@ -44,8 +44,9 @@
           <!--<span v-if="!isModifyMode">{{authentication.ability}}</span>-->
         </el-form-item>
         <el-form-item label="测评机构资源" prop="name">
-          <span v-for="item in authentication.resource" :key="item.id">
-            资源类型:&nbsp;<el-select v-model="item.type" placeholder="请选择" style="width: 150px;margin-bottom: 10px"
+          <span v-for="item in authentication.evaluationAgencyResourceList" :key="item.id">
+            资源类型:&nbsp;<el-select size="small" v-model="item.type" placeholder="请选择"
+                                  style="width: 150px;margin-bottom: 10px"
                                   :value="item.type">
               <el-option
                 v-for="item in resourceTypes"
@@ -54,10 +55,12 @@
                 :value="item">
               </el-option>
             </el-select>
-            资源名称:&nbsp;<el-input v-model="item.name" style="width: 150px"></el-input>
-            总量:&nbsp;<el-input-number :min="0" v-model="item.totalNum"></el-input-number>
-            可用数量:&nbsp;<el-input-number :min="0" :max="item.totalNum" v-model="item.availableNum"></el-input-number>
-            <el-button type="danger" icon="el-icon-delete" @click="removeAgencyResource(item.id)"></el-button>
+            资源名称:&nbsp;<el-input size="small" v-model="item.name" style="width: 150px"></el-input>
+            总量:&nbsp;<el-input-number size="small" :min="0" v-model="item.totalNum"></el-input-number>
+            可用数量:&nbsp;<el-input-number size="small" :min="0" :max="item.totalNum"
+                                        v-model="item.availableNum"></el-input-number>
+            <el-button size="small" type="danger" icon="el-icon-delete"
+                       @click="removeAgencyResource(item.id)"></el-button>
             <br/>
           </span>
           <el-button type="primary" icon="el-icon-circle-plus" plain size="small" @click="addAgencyResource">添加资源
@@ -70,7 +73,8 @@
         <!--<div class="btn btn-medium" @click="cancelModify()">返回</div>-->
         <!--</el-form-item>-->
         <el-form-item v-if="isModifyMode">
-          <div class="btn btn-primary btn-info" @click="submitInfo()">提交</div>
+          <el-button type="primary" size="small" @click="submitInfo()">提交</el-button>
+          <!--<div  class="btn btn-primary btn-info" @click="submitInfo()">提交</div>-->
           <!--<div class="btn btn-primary" @click="cancelModify()">取消</div>-->
         </el-form-item>
       </el-form>
@@ -82,7 +86,7 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
-import {getAllAgencyResourceTypes, getAllServiceTypes, storageGet} from '@/js/index'
+import {getAllAgencyResourceTypes, getAllServiceTypes, storageGet, uploadAgencyAuthenticationInfo} from '@/js/index'
 
 export default {
   name: 'AgencyAuthenticationCreate',
@@ -96,13 +100,13 @@ export default {
       serviceTypes: [],
       authentication: {
         mobile: '',
-        name: '',
+        evaluationAgencyName: '',
         bankAccount: '',
         address: '',
-        ability: [],
-        resource: [],
+        evaluationAgencyAbilityList: [],
+        evaluationAgencyResourceList: [],
         photo: [],
-        photoUrl: '',
+        agencyPhoto: '',
       },
       rules: {
         // name: [
@@ -149,22 +153,25 @@ export default {
       //this.isModifyMode = false
       this.showLoading()
       const newAuthentication = {
-        mobile: this.authentication.mobile,
-        evaluationAgencyName: this.authentication.name,
+        userId: this.user.userVO.id,
+        evaluationAgencyName: this.authentication.evaluationAgencyName,
         bankAccount: this.authentication.bankAccount,
         address: this.authentication.address,
-        evaluationAgencyAbilityList: this.authentication.ability,
-        evaluationAgencyResourceList: this.authentication.resource,
-        agencyPhoto: this.authentication.photoUrl,
+        evaluationAgencyAbilityList: this.authentication.evaluationAgencyAbilityList,
+        evaluationAgencyResourceList: this.authentication.evaluationAgencyResourceList,
+        agencyPhoto: this.authentication.agencyPhoto,
       }
       console.log(newAuthentication)
-      Http.post(Apis.USER.SUBMIT_AGENCY_AUTHENTICATION_INFO.replace('{userId}', this.user.userVO.id), newAuthentication).then((res) => {
-        console.log(res)
-        this.hideLoading()
-        notify('success', '认证信息上传成功')
-      }).catch(error => {
-        notify('error', error.data)
-      })
+      uploadAgencyAuthenticationInfo(this.user.userVO.id, newAuthentication, this.submitInfoSuccess, this.submitInfoFail)
+    },
+    submitInfoSuccess (res) {
+      console.log(res)
+      this.hideLoading()
+      notify('success', '认证信息上传成功')
+    },
+    submitInfoFail (error) {
+      this.hideLoading()
+      notify('error', error.data)
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {
@@ -199,7 +206,7 @@ export default {
       formData.append('file', param.file)
       Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
         console.log('上传成功')
-        this.authentication.photoUrl = res.data
+        this.authentication.agencyPhoto = res.data
         console.log(res.data)
         notify('success', '上传成功')
       }).catch(error => {
@@ -221,28 +228,28 @@ export default {
     //添加一项测评机构资源
     addAgencyResource () {
       const tmpResource = {
-        id: this.authentication.resource.length,
+        id: this.authentication.evaluationAgencyResourceList.length,
         type: this.resourceTypes[0],
         name: '',
         totalNum: 0,
         availableNum: 0,
       }
-      this.authentication.resource.push(tmpResource)
+      this.authentication.evaluationAgencyResourceList.push(tmpResource)
     },
     //删除一项测评机构资源
     removeAgencyResource (id) {
-      this.authentication.resource.splice(id, 1)
-      for (var i = 0; i < this.authentication.resource.length; i++) {
-        this.authentication.resource[i].id = i
+      this.authentication.evaluationAgencyResourceList.splice(id, 1)
+      for (var i = 0; i < this.authentication.evaluationAgencyResourceList.length; i++) {
+        this.authentication.evaluationAgencyResourceList[i].id = i
       }
     },
     //检测测评机构资源填写是否有效
     checkAgencyResourceVaild () {
-      if (this.authentication.resource.length === 0) {
+      if (this.authentication.evaluationAgencyResourceList.length === 0) {
         return true
       }
-      for (var i = 0; i < this.authentication.resource.length; i++) {
-        const item = this.authentication.resource[i]
+      for (var i = 0; i < this.authentication.evaluationAgencyResourceList.length; i++) {
+        const item = this.authentication.evaluationAgencyResourceList[i]
         if (item.type === '') {
           notify('error', '资源类型不能为空')
           return false

+ 50 - 40
src/components/authen/EnterpriseAuthentication.vue

@@ -15,13 +15,13 @@
             :show-file-list="false"
             :http-request="uploadFile"
             :before-upload="beforeFileUpload">
-            <img v-if="authentication.businessLicense" :src="authentication.businessLicense" class="avatar">
+            <img v-if="authentication.businessLicensePhoto" :src="authentication.businessLicensePhoto" 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.businessLicense"
+            :src="authentication.businessLicensePhoto"
             fit="scale-down"></el-image>
         </span>
           <!--<div v-if="!isModifyMode">-->
@@ -31,20 +31,20 @@
           <!--</div>-->
         </el-form-item>
         <el-form-item label="公司法人姓名" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.enterpriseBossName"></el-input>
-          <span v-if="!isModifyMode">{{authentication.enterpriseBossName}}</span>
+          <el-input v-if="isModifyMode" v-model="authentication.legalPersonName"></el-input>
+          <span v-if="!isModifyMode">{{authentication.legalPersonName}}</span>
         </el-form-item>
         <el-form-item label="对公账户" prop="name">
           <el-input 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.USCC"></el-input>
-          <span v-if="!isModifyMode">{{authentication.USCC}}</span>
+          <el-input v-if="isModifyMode" v-model="authentication.unifiedSocialCreditCode"></el-input>
+          <span v-if="!isModifyMode">{{authentication.unifiedSocialCreditCode}}</span>
         </el-form-item>
         <el-form-item label="公司地址" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.enterpriseAddress"></el-input>
-          <span v-if="!isModifyMode">{{authentication.enterpriseAddress}}</span>
+          <el-input v-if="isModifyMode" v-model="authentication.address"></el-input>
+          <span v-if="!isModifyMode">{{authentication.address}}</span>
         </el-form-item>
 
         <el-form-item v-if="!isModifyMode">
@@ -63,7 +63,7 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
-import {defaultValue, getCurrentAuthenInfo, storageGet, updateEnterpriseAuthInfo} from '@/js/index'
+import {defaultValue, getCurrentEnterpriseAuthInfo, storageGet, updateEnterpriseAuthInfo} from '@/js/index'
 
 export default {
   name: 'EnterpriseAuthentication',
@@ -75,11 +75,11 @@ export default {
       loading: false,
       authentication: {
         enterpriseName: '',
-        enterpriseBossName: '',
+        legalPersonName: '',
         bankAccount: '',
-        businessLicense: defaultValue.image,
-        USCC: '',
-        enterpriseAddress: ''
+        businessLicensePhoto: defaultValue.image,
+        unifiedSocialCreditCode: '',
+        address: ''
       },
       rules: {
         // name: [
@@ -116,20 +116,21 @@ export default {
     //加载数据
     getAuthInfo () {
       this.showLoading()
-      getCurrentAuthenInfo().then((res) => {
-        //this.authentication.photo = []
-        this.authentication.businessLicense = res.businessLicensePhoto == null ? defaultValue.image : res.businessLicensePhoto
-        this.authentication.enterpriseName = res.companyName == null ? '暂未填写' : res.companyName
-        this.authentication.enterpriseBossName = res.legalPersonName == null ? '暂未填写' : res.legalPersonName
-        this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
-        this.authentication.USCC = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
-        this.authentication.enterpriseAddress = res.address == null ? '暂未填写' : res.address
-        this.hideLoading()
-        console.log(this.authentication)
-      }).catch((error) => {
-        this.hideLoading()
-        notify('error', '加载认证信息失败:' + error.data)
-      })
+      getCurrentEnterpriseAuthInfo(this.user.userVO.id, this.getAuthInfoSuccess, this.getAuthInfoFail)
+    },
+    getAuthInfoSuccess (res) {
+      this.hideLoading()
+      this.authentication.enterpriseName = res.enterpriseName == null ? '暂未填写' : res.enterpriseName
+      this.authentication.legalPersonName = res.legalPersonName == null ? '暂未填写' : res.legalPersonName
+      this.authentication.businessLicensePhoto = res.businessLicensePhoto == null ? defaultValue.image : res.businessLicensePhoto
+      this.authentication.unifiedSocialCreditCode = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
+      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 () {
@@ -140,22 +141,31 @@ export default {
       //this.isModifyMode = false
       this.showLoading()
       const newAuthentication = {
-        mobile: this.authentication.mobile,
-        evaluationAgencyName: this.authentication.name,
+        userId: this.user.userVO.id,
+        enterpriseName: this.authentication.enterpriseName,
+        legalPersonName: this.authentication.legalPersonName,
+        businessLicensePhoto: this.authentication.businessLicensePhoto,
+        unifiedSocialCreditCode: this.authentication.unifiedSocialCreditCode,
         bankAccount: this.authentication.bankAccount,
         address: this.authentication.address,
-        abilities: this.authentication.ability,
-        resources: this.authentication.resource,
-        agencyPhoto: this.authentication.photoUrl,
       }
-      updateEnterpriseAuthInfo.then((res) => {
-        this.hideLoading()
-        console.log(res)
-        notify('success', '认证信息修改成功')
-      }).catch(error => {
-        this.hideLoading()
-        notify('error', error.data)
-      })
+      updateEnterpriseAuthInfo(this.user.userVO.id, newAuthentication, this.updateAuthInfoSuccess, this.updateAuthInfoFail)
+    },
+    updateAuthInfoSuccess (res) {
+      this.hideLoading()
+      this.cancelModify()
+      console.log(res)
+      this.authentication.enterpriseName = res.enterpriseName == null ? '暂未填写' : res.enterpriseName
+      this.authentication.legalPersonName = res.legalPersonName == null ? '暂未填写' : res.legalPersonName
+      this.authentication.businessLicensePhoto = res.businessLicensePhoto == null ? defaultValue.image : res.businessLicensePhoto
+      this.authentication.unifiedSocialCreditCode = res.unifiedSocialCreditCode == null ? '暂未填写' : res.unifiedSocialCreditCode
+      this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
+      this.authentication.address = res.address == null ? '暂未填写' : res.address
+      notify('success', '认证信息修改成功')
+    },
+    updateAuthInfoFail (error) {
+      this.hideLoading()
+      notify('error', error.data)
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {

+ 36 - 24
src/components/authen/EnterpriseAuthenticationCreate.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.enterpriseName"></el-input>
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.enterpriseName"></el-input>
           <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
         </el-form-item>
         <el-form-item label="公司营业执照" prop="file">
@@ -14,7 +14,7 @@
             :show-file-list="false"
             :http-request="uploadFile"
             :before-upload="beforeFileUpload">
-            <img v-if="authentication.businessLicense" :src="authentication.businessLicense" class="avatar">
+            <img v-if="authentication.businessLicensePhoto" :src="authentication.businessLicensePhoto" class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
           <!--<div v-if="!isModifyMode">-->
@@ -24,19 +24,19 @@
           <!--</div>-->
         </el-form-item>
         <el-form-item label="公司法人姓名" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.enterpriseBossName"></el-input>
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.legalPersonName"></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.name}}</span>-->
         </el-form-item>
         <el-form-item label="统一社会信用代码" prop="name">
-          <el-input v-if="isModifyMode" v-model="authentication.USCC"></el-input>
+          <el-input size="small" v-if="isModifyMode" v-model="authentication.unifiedSocialCreditCode"></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.enterpriseAddress"></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>
 
@@ -57,7 +57,7 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
-import {storageGet} from '@/js/index'
+import {storageGet, uploadEnterpriseAuthenticationInfo} from '@/js/index'
 
 export default {
   name: 'EnterpriseAuthenticationCreate',
@@ -66,13 +66,14 @@ export default {
       userId: 0,
       user: {},
       isModifyMode: true,
+      loading: false,
       authentication: {
         enterpriseName: '',
-        enterpriseBossName: '',
+        legalPersonName: '',
         bankAccount: '',
-        businessLicense: '',
-        USCC: '',
-        enterpriseAddress: ''
+        businessLicensePhoto: '',
+        unifiedSocialCreditCode: '',
+        address: ''
       },
       rules: {
         // name: [
@@ -115,21 +116,26 @@ export default {
     //提交认证信息
     submitInfo () {
       //this.isModifyMode = false
+      this.showLoading()
       const newAuthentication = {
-        mobile: this.authentication.mobile,
-        evaluationAgencyName: this.authentication.name,
+        userId: this.user.userVO.id,
+        enterpriseName: this.authentication.enterpriseName,
+        legalPersonName: this.authentication.legalPersonName,
+        businessLicensePhoto: this.authentication.businessLicensePhoto,
+        unifiedSocialCreditCode: this.authentication.unifiedSocialCreditCode,
         bankAccount: this.authentication.bankAccount,
         address: this.authentication.address,
-        abilities: this.authentication.ability,
-        resources: this.authentication.resource,
-        agencyPhoto: this.authentication.photoUrl,
       }
-      Http.post(Apis.USER.SUBMIT_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', this.user.userVO.id), newAuthentication).then((res) => {
-        console.log(res)
-        notify('success', '认证信息上传成功')
-      }).catch(error => {
-        notify('error', error.data.msg)
-      })
+      uploadEnterpriseAuthenticationInfo(this.user.userVO.id, newAuthentication, this.submitInfoSuccess, this.submitInfoFail)
+    },
+    submitInfoSuccess (res) {
+      this.hideLoading()
+      console.log(res)
+      notify('success', '认证信息上传成功')
+    },
+    submitInfoFail (error) {
+      this.hideLoading()
+      notify('error', error.data)
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {
@@ -164,7 +170,7 @@ export default {
       formData.append('file', param.file)
       Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
         console.log('上传成功')
-        this.authentication.photoUrl = res.data
+        this.authentication.businessLicensePhoto = res.data
         console.log(res.data)
         notify('success', '上传成功')
       }).catch(error => {
@@ -179,6 +185,12 @@ export default {
     test () {
 
     },
+    showLoading () {
+      this.loading = true
+    },
+    hideLoading () {
+      this.loading = false
+    }
   },
 }
 </script>

+ 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 () {

+ 38 - 24
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>
 
@@ -60,6 +60,7 @@ import {
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
   storageGet,
+  uploadIndividualAuthenticationInfo,
 } from '@/js/index'
 
 export default {
@@ -69,11 +70,11 @@ export default {
       userId: 0,
       user: {},
       isModifyMode: true,
+      loading: false,
       authentication: {
-        photo: [],
-        photoUrl: '',
-        name: '',
-        idNumber: '',
+        IDCardPhoto: '',
+        realName: '',
+        IDCard: '',
         bankAccount: '',
         address: '',
       },
@@ -118,21 +119,25 @@ 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) => {
-        console.log(res)
-        notify('success', '认证信息上传成功')
-      }).catch(error => {
-        notify('error', error.data.msg)
-      })
+      uploadIndividualAuthenticationInfo(this.user.userVO.id, newAuthentication, this.submitInfoSuccess, this.submitInfoFail)
+    },
+    submitInfoSuccess (res) {
+      this.hideLoading()
+      console.log(res)
+      notify('success', '认证信息上传成功')
+    },
+    submitInfoFail (error) {
+      this.hideLoading()
+      notify('error', error.data)
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
     cancelModify () {
@@ -159,6 +164,7 @@ export default {
     },
     //上传文件,此处为上传图片
     uploadFile (param) {
+      this.showLoading()
       const formData = new FormData()
       let config = {
         //添加请求头
@@ -166,17 +172,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 () {

+ 6 - 5
src/components/commons/Header.vue

@@ -97,31 +97,31 @@
               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">
                     审核认证信息
                   </el-link>
                 </router-link>
               </el-dropdown-item>
-              <el-dropdown-item>
+              <el-dropdown-item v-if="user.authStatus.text == '未实名认证'">
                 <router-link :to="{ name: 'AuthenticationIndex'}">
                   <el-link type="info" icon="el-icon-warning-outline" :underline="false">
                     未实名认证
                   </el-link>
                 </router-link>
               </el-dropdown-item>
-              <el-dropdown-item @click.native="handleClickAuthChecking()">
+              <el-dropdown-item v-if="user.authStatus.text == '认证审核中'" @click.native="handleClickAuthChecking()">
                 <el-link type="warning" icon="el-icon-loading" :underline="false">
                   认证审核中
                 </el-link>
               </el-dropdown-item>
-              <el-dropdown-item @click.native="handleClickAuthPass()">
+              <el-dropdown-item @click.native="handleClickAuthPass()" v-if="user.authStatus.text == '认证通过'">
                 <el-link type="primary" icon="el-icon-check" :underline="false">
                   已认证
                 </el-link>
               </el-dropdown-item>
-              <el-dropdown-item @click.native="handleClickAuthReject()">
+              <el-dropdown-item @click.native="handleClickAuthReject()" v-if="user.authStatus.text == '认证未通过'">
                 <el-link type="danger" icon="el-icon-close" :underline="false">
                   认证失败
                 </el-link>
@@ -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

+ 5 - 2
src/components/commons/ProjectItem.vue

@@ -33,8 +33,11 @@
       <el-col :span="2" type="flex" align="middle" justify="center">
         <div class="badge">¥{{project.budget}}</div>
       </el-col>
-      <el-col :span="4" type="flex" align="middle" justify="center"><span class="btn btn-small btn-info"
-                                                                          @click="goToProjectDetail(project.id)">查看详情</span>
+      <el-col :span="4" type="flex" align="middle" justify="center">
+        <el-badge v-if="project.needHandle" is-dot class="item">
+          <span class="btn btn-small btn-info" @click="goToProjectDetail(project.id)">查看详情</span>
+        </el-badge>
+        <span v-if="!project.needHandle" class="btn btn-small btn-info" @click="goToProjectDetail(project.id)">查看详情</span>
       </el-col>
     </el-row>
 

+ 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"

+ 7 - 4
src/js/api.js

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

+ 14 - 1
src/js/generalService.js

@@ -149,6 +149,19 @@ Date.prototype.Format = function (fmt) {
   return fmt
 }
 export const getFormalTimeFromDate = (date) => {
-  return date.Format("yyyy-MM-dd hh:mm:ss");
+  return date.Format('yyyy-MM-dd hh:mm:ss')
 }
 
+//
+export const getIndexStatisticsInfo = () => {
+  const data = {
+    userNum: 100,
+    agencyNum: 200,
+    deviceNum: 345,
+    projectNum: 23,
+    taskNum: 123
+  }
+  return new Promise((resolve) => {
+    resolve(data)
+  })
+}

+ 8 - 0
src/js/index.js

@@ -2,7 +2,10 @@ import {
   deleteAuthInfo,
   getAllAuthentications,
   getAuthUrls,
+  getCurrentAgencyAuthInfo,
   getCurrentAuthenInfo,
+  getCurrentEnterpriseAuthInfo,
+  getCurrentIndividualAuthenInfo,
   getCurrentUser,
   getRolesPermissions,
   logout,
@@ -54,6 +57,7 @@ import {
   getAllServiceTypes,
   getFormalTimeFromDate,
   getGreenChannelAddProjectExcelTemplateFile,
+  getIndexStatisticsInfo,
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
   getUserIdentity,
@@ -91,6 +95,9 @@ export {
   uploadEnterpriseAuthenticationInfo,
   //TODO 尚未使用 代码未实现 上传个人认证信息
   uploadIndividualAuthenticationInfo,
+  getCurrentIndividualAuthenInfo,
+  getCurrentEnterpriseAuthInfo,
+  getCurrentAgencyAuthInfo
 }
 export {
   /*******************************************************************************/
@@ -204,6 +211,7 @@ export {
   //保存数据到本地
   storageSave,
   getFormalTimeFromDate,
+  getIndexStatisticsInfo
 }
 
 export const defaultValue = {

+ 57 - 16
src/js/userService.js

@@ -79,18 +79,30 @@ export const getAuthUrls = () => {
 }
 
 //上传个人认证信息
-export const uploadIndividualAuthenticationInfo = () => {
-  Http.post(Apis)
+export const uploadIndividualAuthenticationInfo = (userId, userAuthInfo, uploadIndividualAuthenticationInfoSuccess, uploadIndividualAuthenticationInfoFail) => {
+  Http.post(Apis.USER.SUBMIT_INDIVIDUAL_AUTHENTICATION_INFO.replace('{userId}', userId), userAuthInfo).then((res) => {
+    uploadIndividualAuthenticationInfoSuccess(res)
+  }).catch(error => {
+    uploadIndividualAuthenticationInfoFail(error)
+  })
 }
 
 //上传企业认证信息
-export const uploadEnterpriseAuthenticationInfo = () => {
-
+export const uploadEnterpriseAuthenticationInfo = (userId, userAuthInfo, uploadEnterpriseAuthenticationInfoSuccess, uploadEnterpriseAuthenticationInfoFail) => {
+  Http.post(Apis.USER.SUBMIT_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', userId), userAuthInfo).then((res) => {
+    uploadEnterpriseAuthenticationInfoSuccess(res)
+  }).catch(error => {
+    uploadEnterpriseAuthenticationInfoFail(error)
+  })
 }
 
 //上传机构认证信息
-export const uploadAgencyAuthenticationInfo = () => {
-
+export const uploadAgencyAuthenticationInfo = (userId, userAuthInfo, uploadAgencyAuthenticationInfoSuccess, uploadAgencyAuthenticationInfoFail) => {
+  Http.post(Apis.USER.SUBMIT_AGENCY_AUTHENTICATION_INFO.replace('{userId}', userId), userAuthInfo).then((res) => {
+    uploadAgencyAuthenticationInfoSuccess(res)
+  }).catch(error => {
+    uploadAgencyAuthenticationInfoFail(error)
+  })
 }
 
 //获取所有认证消息
@@ -102,7 +114,28 @@ 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 getCurrentEnterpriseAuthInfo = (userId, getCurrentEnterpriseAuthInfoSuccess, getCurrentEnterpriseAuthInfoFail) => {
+  Http.get(Apis.USER.GET_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', userId)).then((res) => {
+    getCurrentEnterpriseAuthInfoSuccess(res)
+  }).catch((error) => {
+    getCurrentEnterpriseAuthInfoFail(error)
+  })
+}
+export const getCurrentAgencyAuthInfo = (userId, getCurrentEnterpriseAuthInfoSuccess, getCurrentEnterpriseAuthInfoFail) => {
+  Http.get(Apis.USER.GET_AGENCY_AUTHENTICATION_INFO.replace('{userId}', userId)).then((res) => {
+    getCurrentEnterpriseAuthInfoSuccess(res)
+  }).catch((error) => {
+    getCurrentEnterpriseAuthInfoFail(error)
+  })
+}
 export const getCurrentAuthenInfo = () => {
   const individualData = {
     type: '个人',//企业、机构、个人
@@ -180,24 +213,32 @@ 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 = {}
-  // return new Promise((resolve) => {
-  //   resolve(data)
-  // })
-  return Http.put(Apis.USER.UPDATE_AGENCY_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
+export const updateAgencyAuthInfo = (userId, authInfo,updateAgencyAuthInfoSuccess,updateAgencyAuthInfoFail) => {
+  Http.put(Apis.USER.UPDATE_AGENCY_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo).then((res) => {
+    updateAgencyAuthInfoSuccess(res)
+  }).catch((error) => {
+    updateAgencyAuthInfoFail(error)
+  })
 }
-export const updateEnterpriseAuthInfo = (userId, authInfo) => {
+export const updateEnterpriseAuthInfo = (userId, authInfo, updateEnterpriseAuthInfoSuccess, updateEnterpriseAuthInfoFail) => {
   // const data = {}
   // return new Promise((resolve) => {
   //   resolve(data)
   // })
-  return Http.put(Apis.USER.UPDATE_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
+  Http.put(Apis.USER.UPDATE_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo).then((res) => {
+    updateEnterpriseAuthInfoSuccess(res)
+  }).catch((error) => {
+    updateEnterpriseAuthInfoFail(error)
+  })
 }