sunjh 6 年之前
父節點
當前提交
a6e33f7156
共有 4 個文件被更改,包括 61 次插入29 次删除
  1. 21 7
      src/components/authen/Authentication.vue
  2. 25 14
      src/components/cheat/AgencyAdd.vue
  3. 11 4
      src/components/cheat/ProjectAdd.vue
  4. 4 4
      src/js/api.js

+ 21 - 7
src/components/authen/Authentication.vue

@@ -3,10 +3,15 @@
     <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>
           <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
         </el-form-item>
+        <el-form-item label="机构电话" prop="name">
+          <el-input v-if="isModifyMode" v-model="authentication.mobile"></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>
           <!--<span v-if="!isModifyMode">{{authentication.bankAccount}}</span>-->
@@ -70,6 +75,7 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
+
 export default {
   name: 'Authentication',
   data () {
@@ -77,6 +83,7 @@ export default {
       userId: 0,
       isModifyMode: true,
       authentication: {
+        mobile: '',
         name: '',
         bankAccount: '',
         address: '',
@@ -114,17 +121,21 @@ export default {
       this.isModifyMode = true
     },
     submitInfo () {
-      this.isModifyMode = false
+      //this.isModifyMode = false
       const newAuthentication = {
-        name: this.authentication.name,
+        mobile: this.authentication.mobile,
+        evaluationAgencyName: this.authentication.name,
         bankAccount: this.authentication.bankAccount,
         address: this.authentication.address,
-        ability: this.authentication.ability,
-        resource: this.authentication.resource,
-        photo: this.authentication.photoUrl,
+        abilities: this.authentication.ability,
+        resources: this.authentication.resource,
+        agencyPhoto: this.authentication.photoUrl,
       }
-      Http.post(Apis.USER.AGENCY_AUTHENTICATION, newAuthentication).then((res) => {
+      Http.post(Apis.USER.AGENCY_AUTHENTICATION.replace('{userId}', 3), newAuthentication).then((res) => {
         console.log(res)
+        notify('success', '测评机构成功')
+      }).catch(error => {
+        notify('error', error.data.msg)
       })
     },
     cancelModify () {
@@ -141,7 +152,7 @@ export default {
       )
     },
     beforeRemove (file, fileList) {
-      return this.$confirm(`确定移除 ${file.name}?`)
+      //return this.$confirm(`确定移除 ${file.name}?`)
     },
     beforeFileUpload () {
     },
@@ -156,6 +167,9 @@ export default {
         console.log('上传成功')
         this.authentication.photoUrl = res.data
         console.log(res.data)
+        notify('success', '上传成功')
+      }).catch(error => {
+        notify('error', error.data.msg)
       })
     }
   },

+ 25 - 14
src/components/cheat/AgencyAdd.vue

@@ -7,6 +7,10 @@
           <el-input v-if="isModifyMode" v-model="agency.name"></el-input>
           <!--<span v-if="!isModifyMode">{{agency.name}}</span>-->
         </el-form-item>
+        <el-form-item label="机构电话" prop="name">
+          <el-input v-if="isModifyMode" v-model="agency.mobile"></el-input>
+          <!--<span v-if="!isModifyMode">{{agency.name}}</span>-->
+        </el-form-item>
         <el-form-item label="银行卡账户" prop="name">
           <el-input v-if="isModifyMode" v-model="agency.bankAccount"></el-input>
           <!--<span v-if="!isModifyMode">{{agency.bankAccount}}</span>-->
@@ -46,15 +50,15 @@
             <div class="el-upload__tip" slot="tip">请上传报告文件</div>
           </el-upload>
           <!--<div v-if="!isModifyMode">-->
-            <!--<span v-if="agency.photo==null">暂无文件</span>-->
-            <!--<a :href="agency.photo" v-if="agency.photo!=null"><i class="fa fa-file-text-o"></i>-->
-              <!--{{agency.photo}}</a>-->
+          <!--<span v-if="agency.photo==null">暂无文件</span>-->
+          <!--<a :href="agency.photo" v-if="agency.photo!=null"><i class="fa fa-file-text-o"></i>-->
+          <!--{{agency.photo}}</a>-->
           <!--</div>-->
         </el-form-item>
 
         <!--<el-form-item v-if="!isModifyMode">-->
-          <!--<div class="btn btn-medium btn-info" @click="modifyInfo()">修改</div>-->
-          <!--<div class="btn btn-medium" @click="cancelModify()">返回</div>-->
+        <!--<div class="btn btn-medium btn-info" @click="modifyInfo()">修改</div>-->
+        <!--<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>
@@ -69,6 +73,7 @@
 import Http from '@/js/http'
 import Apis from '@/js/api'
 import {notify} from '@/constants/index'
+
 export default {
   name: 'AgencyAdd',
   data () {
@@ -76,6 +81,7 @@ export default {
       userId: 0,
       isModifyMode: true,
       agency: {
+        mobile: '',
         name: '',
         bankAccount: '',
         address: '',
@@ -113,19 +119,20 @@ export default {
       this.isModifyMode = true
     },
     submitInfo () {
-      this.isModifyMode = false
+      //this.isModifyMode = false
       const newAgency = {
-        name: this.agency.name,
+        mobile: this.agency.mobile,
+        evaluationAgencyName: this.agency.name,
         bankAccount: this.agency.bankAccount,
         address: this.agency.address,
-        ability: this.agency.ability,
-        resource: this.agency.resource,
-        photo: this.agency.photoUrl,
+        abilities: this.agency.ability,
+        resources: this.agency.resource,
+        agencyPhoto: this.agency.photoUrl,
       }
       Http.post(Apis.USER.ADD_AGENCY, newAgency).then((res) => {
-        notify('success','测评机构添加成功')
-      }).catch(error=>{
-        notify('error',error.data.msg)
+        notify('success', '测评机构添加成功')
+      }).catch(error => {
+        notify('error', error.data.msg)
       })
     },
     cancelModify () {
@@ -154,9 +161,13 @@ export default {
       }
       formData.append('file', param.file)
       Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', 3), formData, config).then((res) => {
-        console.log('上传成功')
         this.agency.photoUrl = res.data
         console.log(res.data)
+        notify('success', '上传成功')
+        sessionStorage.setItem('file','qweqewqweqweqweqew')
+        sessionStorage.getItem('file')
+      }).catch(error => {
+        notify('error', error.data.msg)
       })
     }
   },

+ 11 - 4
src/components/cheat/ProjectAdd.vue

@@ -264,15 +264,16 @@ export default {
       this.isModifyMode = true
     },
     submitInfo () {
-      this.isModifyMode = false
+      //this.isModifyMode = false
       const newProject = {
+        userId: 3,
         name: this.project.name,
         description: this.project.description,
         contactName: this.project.contactName,
         contactPhone: this.project.contactPhone,
         platform: this.project.platform,
-        type: this.price.type,
-        requireDoc: this.project.requireDocUrl,
+        type: this.project.type,
+        doc: this.project.requireDocUrl,
         file: this.project.fileUrl,
         price: this.project.price,
         datetime: this.project.datetime
@@ -291,7 +292,7 @@ export default {
         headers: {'Content-Type': 'multipart/form-data'},
       }
       formData.append('file', this.excelFile)
-      Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, formData,config).then((res) => {
+      Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, formData, config).then((res) => {
         console.log(res)
         notify('success', '项目添加成功')
       }).catch(error => {
@@ -331,6 +332,9 @@ export default {
         console.log('上传成功')
         this.project.requireDocUrl = res.data
         console.log(res.data)
+        notify('success', '上传成功')
+      }).catch(error => {
+        notify('error', error.data.msg)
       })
     },
     uploadApkFile (param) {
@@ -344,6 +348,9 @@ export default {
         console.log('上传成功')
         this.project.fileUrl = res.data
         console.log(res)
+        notify('success', '上传成功')
+      }).catch(error => {
+        notify('error', error.data.msg)
       })
     }
   },

+ 4 - 4
src/js/api.js

@@ -4,8 +4,8 @@ export default {
     CREATE_PROJECT: '/api/project/',
     UPDATE_PROJECT: '/api/project/{projectId}/',
     DELETE_PROJECT: '/api/project/{projectId}/',
-    ADD_PROJECT: '',
-    ADD_PROJECT_BY_EXCEL: '/api/project/projectImportByExcel/',
+    ADD_PROJECT: '/api/greenChannel/project/',
+    ADD_PROJECT_BY_EXCEL: '/api/greenChannel/projects',
   },
   TASK: {
     GET_TASK: '/api/project/{projectId}/task/{taskId}/',
@@ -37,8 +37,8 @@ export default {
     SUBMIT_PROJECT_REQUEST: '',
     END_TASK: '',
     END_PROJECT: '',
-    AGENCY_AUTHENTICATION: '',
-    ADD_AGENCY: ''
+    AGENCY_AUTHENTICATION: '/api/user/{userId}/agency/',
+    ADD_AGENCY: '/api/greenChannel/agency/'
   },
   PAGE: {
     HOME_PAGE: '/api/common/index/',