guochao 6 years ago
parent
commit
c72ef3803e

+ 16 - 3
package-lock.json

@@ -559,7 +559,7 @@
       "dependencies": {
         "debug": {
           "version": "3.1.0",
-          "resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz",
+          "resolved": "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz",
           "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
           "requires": {
             "ms": "2.0.0"
@@ -567,7 +567,7 @@
         },
         "follow-redirects": {
           "version": "1.5.10",
-          "resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
+          "resolved": "http://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
           "integrity": "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=",
           "requires": {
             "debug": "=3.1.0"
@@ -575,7 +575,7 @@
         },
         "is-buffer": {
           "version": "2.0.3",
-          "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.3.tgz",
+          "resolved": "http://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.3.tgz",
           "integrity": "sha1-Ts8/z3ScvR5HJonhCaxmJhol5yU="
         }
       }
@@ -3247,6 +3247,14 @@
         "safer-buffer": "^2.1.0"
       }
     },
+    "echarts": {
+      "version": "4.2.1",
+      "resolved": "https://registry.npm.taobao.org/echarts/download/echarts-4.2.1.tgz",
+      "integrity": "sha1-mo6jsDNU+G+CTZdiXDNM8Wll7wM=",
+      "requires": {
+        "zrender": "4.0.7"
+      }
+    },
     "ee-first": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -12141,6 +12149,11 @@
           "dev": true
         }
       }
+    },
+    "zrender": {
+      "version": "4.0.7",
+      "resolved": "https://registry.npm.taobao.org/zrender/download/zrender-4.0.7.tgz",
+      "integrity": "sha1-Fa6WCCL17+1BCZXTflEH/j3hDm0="
     }
   }
 }

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
   },
   "dependencies": {
     "axios": "latest",
+    "echarts": "^4.2.1",
     "element-ui": "^2.11.0",
     "font-awesome": "^4.7.0",
     "mockjs": "^1.0.1-beta3",

+ 11 - 0
src/components/Home.vue

@@ -97,6 +97,7 @@ export default {
     },
     //加载数据
     loadData: function () {
+      this.showLoading()
       console.log('loadData')
       Http.get(Apis.PAGE.HOME_PAGE).then((res) => {
         console.log(res)
@@ -104,12 +105,22 @@ export default {
         this.institutionRank = res.agencyRank
         this.personRank = res.userRank
         this.imgList = res.imgList
+        this.hideLoading()
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '主页加载失败:' + error.data)
       })
     },
     setUserInfo () {
       this.user = storageGet('user')
       this.rolesPermissions = storageGet('rolesPermissions')
     },
+    showLoading () {
+      this.loading = true
+    },
+    hideLoading () {
+      this.loading = false
+    }
   },
   created: function () {
     //notify('info', 'info')

+ 135 - 52
src/components/Mine.vue

@@ -1,56 +1,58 @@
 <template>
   <div class="mine-container">
-    <div class="mine-top-wrapper">
-      <el-row :gutter="0" style="height:100%">
-        <el-col :span="16">
-          <div class="advertise-imgs">
-            <img
-              src="http://sinastorage.com/storage.miaosha.sina.com.cn/products/201903/e496d11b3d74cf660c286fbd5ab8d0bb.png"
-            >
-          </div>
-        </el-col>
-        <el-col :span="8">
-          <div class="user-banner">
-            <p class="head">
-              <a href="javascript:;" class="login-link">
-                <img :src="user == null || user.userVO.photoUrl == null?defaultValue.image:user.userVO.photoUrl" class="user-img">
-                <span class="vertify hide"></span>
-              </a>
-            </p>
-            <div class="username_box">
-              <div class="username_icon username_"></div>
-              <span class="username">{{user == null?'...':user.userVO.name}}</span>
-            </div>
-            <!--<p class="name">-->
-            <!--<a href="javascript:;" class="login-btn btn btn-medium btn-info">登录</a>-->
-            <!--<a-->
-            <!--href="https://login.sina.com.cn/signup/signup?entry=tech"-->
-            <!--class="register-btn btn btn-medium btn-info"-->
-            <!--target="_blank"-->
-            <!--&gt;注册</a>-->
-            <!--</p>-->
-            <!--<p class="scores">-->
-            <!--<a href="/rule/merit" target="_blank">-->
-            <!--积分-->
-            <!--<em class="num1">{{user.score}}</em>-->
-            <!--</a>-->
-            <!--<span class="line">|</span>-->
-            <!--<a href="/rule/merit" target="_blank">-->
-            <!--威望-->
-            <!--<em class="num2">{{user.prestige}}</em>-->
-            <!--</a>-->
-            <!--</p>-->
-            <p>
-              <router-link :to="{ name: 'AuthenticationIndex'}">
-                <div class="btn btn-medium">实名认证</div>
-              </router-link>
-            </p>
-          </div>
-        </el-col>
-      </el-row>
-    </div>
-    <div class="mine-body">
-      <el-tabs tabPosition="top" type="card">
+    <div id="myChart" style="width: 100%;height: 400px"></div>
+    <!--<div class="mine-top-wrapper">-->
+    <!--<el-row :gutter="0" style="height:100%">-->
+    <!--<el-col :span="16">-->
+    <!--<div class="advertise-imgs">-->
+    <!--<img-->
+    <!--src="http://sinastorage.com/storage.miaosha.sina.com.cn/products/201903/e496d11b3d74cf660c286fbd5ab8d0bb.png"-->
+    <!--&gt;-->
+    <!--</div>-->
+    <!--</el-col>-->
+    <!--<el-col :span="8">-->
+    <!--<div class="user-banner">-->
+    <!--<p class="head">-->
+    <!--<a href="javascript:;" class="login-link">-->
+    <!--<img :src="user == null || user.userVO.photoUrl == null?defaultValue.image:user.userVO.photoUrl"-->
+    <!--class="user-img">-->
+    <!--<span class="vertify hide"></span>-->
+    <!--</a>-->
+    <!--</p>-->
+    <!--<div class="username_box">-->
+    <!--<div class="username_icon username_"></div>-->
+    <!--<span class="username">{{user == null?'...':user.userVO.name}}</span>-->
+    <!--</div>-->
+    <!--&lt;!&ndash;<p class="name">&ndash;&gt;-->
+    <!--&lt;!&ndash;<a href="javascript:;" class="login-btn btn btn-medium btn-info">登录</a>&ndash;&gt;-->
+    <!--&lt;!&ndash;<a&ndash;&gt;-->
+    <!--&lt;!&ndash;href="https://login.sina.com.cn/signup/signup?entry=tech"&ndash;&gt;-->
+    <!--&lt;!&ndash;class="register-btn btn btn-medium btn-info"&ndash;&gt;-->
+    <!--&lt;!&ndash;target="_blank"&ndash;&gt;-->
+    <!--&lt;!&ndash;&gt;注册</a>&ndash;&gt;-->
+    <!--&lt;!&ndash;</p>&ndash;&gt;-->
+    <!--&lt;!&ndash;<p class="scores">&ndash;&gt;-->
+    <!--&lt;!&ndash;<a href="/rule/merit" target="_blank">&ndash;&gt;-->
+    <!--&lt;!&ndash;积分&ndash;&gt;-->
+    <!--&lt;!&ndash;<em class="num1">{{user.score}}</em>&ndash;&gt;-->
+    <!--&lt;!&ndash;</a>&ndash;&gt;-->
+    <!--&lt;!&ndash;<span class="line">|</span>&ndash;&gt;-->
+    <!--&lt;!&ndash;<a href="/rule/merit" target="_blank">&ndash;&gt;-->
+    <!--&lt;!&ndash;威望&ndash;&gt;-->
+    <!--&lt;!&ndash;<em class="num2">{{user.prestige}}</em>&ndash;&gt;-->
+    <!--&lt;!&ndash;</a>&ndash;&gt;-->
+    <!--&lt;!&ndash;</p>&ndash;&gt;-->
+    <!--<p>-->
+    <!--<router-link :to="{ name: 'AuthenticationIndex'}">-->
+    <!--<div class="btn btn-medium">实名认证</div>-->
+    <!--</router-link>-->
+    <!--</p>-->
+    <!--</div>-->
+    <!--</el-col>-->
+    <!--</el-row>-->
+    <!--</div>-->
+    <div class="mine-body" style="text-align: center;">
+      <el-tabs  tabPosition="top" v-loading="loading" style="width: 90%;margin-left: 5%">
         <el-tab-pane v-if="rolesPermissions.isAgency" label="未完成任务">
           <span v-if="unFinishedTaskList == null || unFinishedTaskList.length == 0"> 暂无任务 </span>
           <task-item v-if="unFinishedTaskList != null || unFinishedTaskList.length > 0"
@@ -91,6 +93,7 @@ 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 echarts from 'echarts'
 
 export default {
   name: 'Mine',
@@ -140,6 +143,7 @@ export default {
       this.setUserInfo()
       this.setRolesPermissions()
       this.loadData()
+      this.setEcharts()
       // storageGet('user').then((res)=>{
       //   this.user = res;
       //   this.setRolesPermissions()
@@ -148,6 +152,7 @@ export default {
 
     },
     loadData () {
+      this.showLoading()
       Http.get(Apis.PAGE.MY_CROWD_TEST_PAGE.replace('{userId}', this.user.userVO.id)).then((res) => {
         if (res.unfinishedTasks != null && res.unfinishedTasks.length > 0) {
           this.unFinishedTaskList = res.unfinishedTasks
@@ -164,9 +169,13 @@ export default {
         if (res.acceptableProjects != null && res.acceptableProjects.length > 0) {
           this.acceptableProjects = res.acceptableProjects
         }
+        this.hideLoading()
         // if (res.userVO != null && res.userVO.length > 0) {
         //   this.user = res.userVO
         // }
+      }).catch((error)=>{
+        this.hideLoading()
+        notify('error','加载失败:'+error.data)
       })
     },
     setUserInfo () {
@@ -174,8 +183,82 @@ export default {
     },
     setRolesPermissions () {
       this.rolesPermissions = storageGet('rolesPermissions')
+    },
+    setEcharts () {
+      // 基于准备好的dom,初始化echarts实例
+      let myChart = echarts.init(document.getElementById('myChart'))
+      // 绘制图表
+      var option = {
+        title: {
+          text: ''
+        },
+        tooltip: {
+          trigger: 'axis'
+        },
+        legend: {
+          data:['接收项目数量','完成项目数量','接收任务数量','完成任务数量','发布项目数量']
+        },
+        grid: {
+          left: '5%',
+          right: '10%',
+          bottom: '3%',
+          top:'10%',
+          containLabel: true
+        },
+        toolbox: {
+          feature: {
+            saveAsImage: {}
+          }
+        },
+        xAxis: {
+          type: 'category',
+          boundaryGap: false,
+          data: ['2019年5月','2019年6月','2019年7月','2019年8月','2019年9月','2019年10月','2019年11月']
+        },
+        yAxis: {
+          type: 'value'
+        },
+        series: [
+          {
+            name:'接收项目数量',
+            type:'line',
+            stack: '总量',
+            data:[120, 132, 101, 134, 90, 230, 210]
+          },
+          {
+            name:'完成项目数量',
+            type:'line',
+            stack: '总量',
+            data:[220, 182, 191, 234, 290, 330, 310]
+          },
+          {
+            name:'接收任务数量',
+            type:'line',
+            stack: '总量',
+            data:[150, 232, 201, 154, 190, 330, 410]
+          },
+          {
+            name:'完成任务数量',
+            type:'line',
+            stack: '总量',
+            data:[320, 332, 301, 334, 390, 330, 320]
+          },
+          {
+            name:'发布项目数量',
+            type:'line',
+            stack: '总量',
+            data:[820, 932, 901, 934, 1290, 1330, 1320]
+          }
+        ]
+      };
+      myChart.setOption(option)
+    },
+    showLoading(){
+      this.loading = true
+    },
+    hideLoading(){
+      this.loading = false
     }
-
   },
   created: function () {
 

+ 78 - 64
src/components/Square.vue

@@ -2,87 +2,88 @@
   <div class="square-container">
     <div class="title">全部任务</div>
 
-    <div class="square-list-container">
-      <task-item v-for="(item,index) in list" :key="index" :task="item" />
-      <div v-if="loading" class="loading">
-        <span></span>
-        <span></span>
-        <span></span>
-        <span></span>
-        <span></span>
-        <span></span>
-        <span></span>
-      </div>
-      <div v-if="nomore" class="nomore">没有更多</div>
+    <div class="square-list-container" v-loading="loading">
+      <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>-->
+      <!--<span></span>-->
+      <!--<span></span>-->
+      <!--<span></span>-->
+      <!--<span></span>-->
+      <!--<span></span>-->
+      <!--<span></span>-->
+      <!--</div>-->
+      <div v-if="list==null || list.length === 0" class="nomore">暂无任务</div>
     </div>
   </div>
 </template>
 
 <script>
-import TaskItem from "@/components/commons/TaskItem";
-import Http from '@/js/http.js';
-import Apis from '@/js/api.js';
+import TaskItem from '@/components/commons/TaskItem'
+import Http from '@/js/http.js'
+import Apis from '@/js/api.js'
 import {notify} from '@/constants/index'
+
 export default {
-  name: "Square",
-  components: { TaskItem },
-  data() {
+  name: 'Square',
+  components: {TaskItem},
+  data () {
     return {
       loading: true,
-      nomore:false,
+      nomore: false,
       list: [],
-    };
+    }
   },
-  mounted() {
-    window.addEventListener("scroll", this.throttle(this.setpage, 1000), false);
+  mounted () {
+    window.addEventListener('scroll', this.throttle(this.setpage, 1000), false)
   },
-  created() {
+  created () {
     this.loadData()
   },
   methods: {
-    throttle(func, wait, options) {
-      let context, args, result;
-      let timeout = null;
-      let previous = 0;
-      if (!options) options = {};
-      let later = function() {
-        previous = options.leading === false ? 0 : Number(new Date());
-        timeout = null;
-        result = func.apply(context, args);
-        if (!timeout) context = args = null;
-      };
+    throttle (func, wait, options) {
+      let context, args, result
+      let timeout = null
+      let previous = 0
+      if (!options) options = {}
+      let later = function () {
+        previous = options.leading === false ? 0 : Number(new Date())
+        timeout = null
+        result = func.apply(context, args)
+        if (!timeout) context = args = null
+      }
       return (..._args) => {
-        let now = Number(new Date());
-        if (!previous && options.leading === false) previous = now;
-        let remaining = wait - (now - previous);
-        context = this;
-        args = _args;
+        let now = Number(new Date())
+        if (!previous && options.leading === false) previous = now
+        let remaining = wait - (now - previous)
+        context = this
+        args = _args
         if (remaining <= 0 || remaining > wait) {
-          clearTimeout(timeout);
-          timeout = null;
-          previous = now;
-          result = func.apply(context, args);
-          if (!timeout) context = args = null;
+          clearTimeout(timeout)
+          timeout = null
+          previous = now
+          result = func.apply(context, args)
+          if (!timeout) context = args = null
         } else if (!timeout && options.trailing !== false) {
-          timeout = setTimeout(later, remaining);
+          timeout = setTimeout(later, remaining)
         }
-        return result;
-      };
+        return result
+      }
     },
-    setpage() {
-      if (this.nomore && !this.loading) return; //到达底部不再执行
+    setpage () {
+      if (this.nomore && !this.loading) return //到达底部不再执行
       var scrollTop =
-        document.documentElement.scrollTop || document.body.scrollTop;
+        document.documentElement.scrollTop || document.body.scrollTop
       //变量windowHeight是可视区的高度
       var windowHeight =
-        document.documentElement.clientHeight || document.body.clientHeight;
+        document.documentElement.clientHeight || document.body.clientHeight
       //变量scrollHeight是滚动条的总高度
       var scrollHeight =
-        document.documentElement.scrollHeight || document.body.scrollHeight;
-    //   console.log(scrollTop, windowHeight, scrollHeight);
+        document.documentElement.scrollHeight || document.body.scrollHeight
+      //   console.log(scrollTop, windowHeight, scrollHeight);
       //滚动条到底部的条件
       if (scrollTop + windowHeight + 5 >= scrollHeight) {
-        console.log("加载更多数据");
+        console.log('加载更多数据')
         // this.loading=true;
         //获取数据请求 请求结束后
         //成功设置 this.list =[...this.list,...this.list1];  this.loading=false;
@@ -91,27 +92,40 @@ export default {
         // console.log(this.list);},5000)
 
       }
-      else{this.loading=false;}
-      window.clearTimeout();
+      else {
+        this.loading = false
+      }
+      window.clearTimeout()
     },
-    loadData() {
-      console.log("loadData")
+    loadData () {
+      console.log('loadData')
+      this.showLoading()
       Http.get(Apis.PAGE.SQUARE_PAGE).then((res) => {
         this.list = res.crowdTaskVOList
+        this.hideLoading()
+      }).catch((error) => {
+        notify('error', '任务加载失败' + error.data)
       })
+    },
+    showLoading () {
+      this.loading = true
+    },
+    hideLoading () {
+      this.loading = false
     }
   }
-};
+}
 </script>
 
 <style lang="less" scoped>
-.square-container {
-  padding: 40px 80px;
-}
-.nomore{
+  .square-container {
+    padding: 40px 80px;
+  }
+
+  .nomore {
     text-align: center;
     font-size: 1.4rem;
     color: #8a8a8a;
     padding: 5px;
-}
+  }
 </style>

+ 28 - 10
src/components/authen/AgencyAuthentication.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="create-container">
-    <div class="create-body">
+    <div class="create-body" v-loading="loading">
       <div class="title">测评机构认证</div>
       <el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
         <el-form-item prop="file" label="机构logo">
@@ -23,10 +23,10 @@
           <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.mobile"></el-input>-->
+        <!--&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>
           <!--<span v-if="!isModifyMode">{{authentication.bankAccount}}</span>-->
@@ -90,6 +90,7 @@ export default {
     return {
       userId: 0,
       user: {},
+      loading: false,
       isModifyMode: true,
       resourceTypes: [],
       serviceTypes: [],
@@ -98,7 +99,7 @@ export default {
         name: '',
         bankAccount: '',
         address: '',
-        ability: '',
+        ability: [],
         resource: [],
         photo: [],
         photoUrl: '',
@@ -146,20 +147,23 @@ export default {
     //提交认证信息
     submitInfo () {
       //this.isModifyMode = false
+      this.showLoading()
       const newAuthentication = {
         mobile: this.authentication.mobile,
         evaluationAgencyName: this.authentication.name,
         bankAccount: this.authentication.bankAccount,
         address: this.authentication.address,
-        abilities: this.authentication.ability,
-        resources: this.authentication.resource,
+        evaluationAgencyAbilityList: this.authentication.ability,
+        evaluationAgencyResourceList: this.authentication.resource,
         agencyPhoto: this.authentication.photoUrl,
       }
+      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.msg)
+        notify('error', error.data)
       })
     },
     //取消修改表单,表单进入不可编辑状态,不再使用
@@ -204,7 +208,11 @@ export default {
     },
     //设置服务类型
     setServiceTypes () {
-      this.serviceTypes = getAllServiceTypes()
+      getAllServiceTypes().then((res) => {
+        this.serviceTypes = res
+      }).catch((error) => {
+        notify('error', '机构能力加载失败')
+      })
     },
     //设置机构资源类型
     setResourceTypes () {
@@ -253,6 +261,16 @@ export default {
     //
     setUserInfo () {
       this.user = storageGet('user')
+    },
+    //
+    showLoading () {
+      this.loading = true
+    },
+    hideLoading () {
+      this.loading = false
+    },
+    submitSuccess () {
+
     }
   },
   created: function () {

+ 83 - 18
src/components/commons/Header.vue

@@ -1,23 +1,47 @@
 <template>
-  <nav class="navbar" v-loading.fullscreen.lock="fullScreenLoading" >
-    <div class="container">
-      <div class="navbar-translate">
-        <a class="navbar-brand">众测</a>
-        <button
-          type="button"
-          data-toggle="collapse"
-          aria-expanded="false"
-          aria-label="Toggle navigation"
-          @click="openNavBarFunc"
-          v-bind:class="['navbar-toggler',{ 'open-fixed': openNavBar}]"
-        >
-          <span class="navbar-toggler-icon"></span>
-          <span class="navbar-toggler-icon"></span>
-          <span class="navbar-toggler-icon"></span>
-        </button>
+  <nav class="navbar" v-loading.fullscreen.lock="fullScreenLoading">
+    <div class="container" style="min-width: 1100px">
+      <!--<div class="navbar-translate" style="text-align: center;vertical-align: middle;">-->
+      <!--<span>-->
+      <!--<a href="javascript:;">-->
+      <!--<img :src="defaultValue.image" style="height: 50px;object-fit: contain;" >-->
+      <!--</a>-->
+      <!--</span>-->
+      <!--<span  style="margin-bottom: 20px"><a style="font-size: 25px">众测</a></span>-->
+      <!--<button-->
+      <!--type="button"-->
+      <!--data-toggle="collapse"-->
+      <!--aria-expanded="false"-->
+      <!--aria-label="Toggle navigation"-->
+      <!--@click="openNavBarFunc"-->
+      <!--v-bind:class="['navbar-toggler',{ 'open-fixed': openNavBar}]"-->
+      <!--&gt;-->
+      <!--<span class="navbar-toggler-icon"></span>-->
+      <!--<span class="navbar-toggler-icon"></span>-->
+      <!--<span class="navbar-toggler-icon"></span>-->
+      <!--</button>-->
+      <!--</div>-->
+      <div style="margin-left: -100px">
+        <ul class="navbar-nav ml-auto">
+          <li class="dropdown nav-item">
+            <router-link to="/home">
+              <a data-toggle="dropdown">
+                <img style="height: 50px;padding-top: 10px" :src="defaultValue.image">
+              </a>
+            </router-link>
+          </li>
+          <li class="dropdown nav-item">
+            <router-link to="/home">
+              <a class="dropdown-toggle nav-link" data-toggle="dropdown">
+                <span style="font-size: 20px">群智众测平台</span>
+              </a>
+            </router-link>
+          </li>
+        </ul>
       </div>
-      <div class="collapse navbar-collapse" v-bind:style="{right:openNavBar?'230px':'0'}">
+      <div style="margin-left: 0; flex: auto">
         <ul class="navbar-nav ml-auto">
+
           <li class="dropdown nav-item">
             <router-link to="/home">
               <a class="dropdown-toggle nav-link" data-toggle="dropdown">
@@ -34,6 +58,11 @@
               </a>
             </router-link>
           </li>
+
+        </ul>
+      </div>
+      <div style="margin-left: -100px">
+        <ul class="navbar-nav ml-auto">
           <li class="dropdown nav-item">
             <router-link v-if="isLogin" to="/mine">
               <a class="dropdown-toggle nav-link" data-toggle="dropdown">
@@ -55,6 +84,38 @@
               </a>
             </div>
           </li>
+          <li class="dropdown nav-item" style="margin-left: 50px">
+            <router-link v-if="isLogin" to="/mine">
+              <a data-toggle="dropdown">
+                <img class="user-img" :src="defaultValue.image">
+              </a>
+            </router-link>
+          </li>
+          <li class="dropdown nav-item">
+            <router-link v-if="isLogin" to="/mine">
+              <a class="dropdown-toggle nav-link" data-toggle="dropdown">
+                <span>{{user.userVO.name}}</span>
+              </a>
+            </router-link>
+          </li>
+          <li class="dropdown nav-item">
+            <router-link v-if="isLogin" to="/mine">
+              <div style="margin-top: 5px;margin-right: 20px">
+                <el-tooltip class="item" effect="dark" content="认证成功" placement="bottom">
+                  <el-link type="info" disabled icon="el-icon-warning-outline">已认证</el-link>
+                </el-tooltip>
+              </div>
+            </router-link>
+          </li>
+          <li class="dropdown nav-item">
+            <router-link v-if="isLogin" to="/mine">
+              <div style="margin-top: 5px;margin-right: 20px">
+                <el-tooltip class="item" effect="dark" content="点击进行认证" placement="bottom">
+                  <el-link type="danger" icon="el-icon-warning-outline">未实名认证</el-link>
+                </el-tooltip>
+              </div>
+            </router-link>
+          </li>
           <li>
             <a v-if="isLogin" class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" @click="userLogout()">
               <span>登出</span>
@@ -68,16 +129,18 @@
 </template>
 
 <script>
-import {getCurrentUser, getRolesPermissions, logout, storageGet, storageSave} from '@/js/index'
+import {defaultValue, getCurrentUser, getRolesPermissions, logout, storageGet, storageSave} from '@/js/index'
 import {notify} from '@/constants/index'
 
 export default {
   name: 'header-container',
   data () {
     return {
+      user: {},
       fullScreenLoading: true,
       //loading: true,
       openNavBar: false,
+      defaultValue: defaultValue,
       userIdentity: '',
       isLogin: false,
       rolesPermissions: {}
@@ -132,6 +195,7 @@ export default {
         getCurrentUser().then((res) => {
           console.log(res)
           storageSave('user', res)
+          this.user = res
           storageSave('rolesPermissions', getRolesPermissions(res.roleList))
           console.log('用户信息加载成功')
           this.isLogin = true
@@ -146,6 +210,7 @@ export default {
           // }
         })
       } else {
+        this.user = storageGet('user')
         this.fullScreenLoading = false
         this.isLogin = true
       }

+ 25 - 25
src/components/project/Project.vue

@@ -49,6 +49,24 @@
         <!--</el-row>-->
         <!--</div>-->
         <!--</el-form-item>-->
+
+        <el-form-item label="预算" prop="budget">
+          <el-input v-if="isModifyMode" type="number" v-model="project.budget">
+            ¥
+            <template slot="append"></template>
+          </el-input>
+          <span v-if="!isModifyMode">{{project.budget}}¥</span>
+        </el-form-item>
+        <el-form-item label="需求描述">
+          <el-input v-if="isModifyMode" type="textarea" v-model="project.desc"></el-input>
+          <span v-if="!isModifyMode">{{project.desc}}</span>
+        </el-form-item>
+        <!--<el-form-item label="价格" prop="price">-->
+        <!--<el-input v-if="isModifyMode" type="number" v-model="project.price">-->
+        <!--<template slot="append">¥</template>-->
+        <!--</el-input>-->
+        <!--<span v-if="!isModifyMode">{{project.price}}¥</span>-->
+        <!--</el-form-item>-->
         <el-form-item label="平台" prop="platform">
           <el-checkbox-group v-if="isModifyMode" v-model="project.platform">
             <span v-for="(item,index) in platforms" :key="index">
@@ -61,17 +79,6 @@
             v-for="item in project.platform"
           >{{item}}</span>
         </el-form-item>
-        <el-form-item label="需求描述">
-          <el-input v-if="isModifyMode" type="textarea" v-model="project.desc"></el-input>
-          <span v-if="!isModifyMode">{{project.desc}}</span>
-        </el-form-item>
-        <el-form-item label="价格" prop="price">
-          <el-input v-if="isModifyMode" type="number" v-model="project.price">
-            <template slot="append">¥</template>
-          </el-input>
-          <span v-if="!isModifyMode">{{project.price}}¥</span>
-        </el-form-item>
-
         <el-form-item label="服务类型" prop="type">
           <el-checkbox-group v-if="isModifyMode" v-model="project.type">
             <span v-for="(item,index) in serviceType" :key="index">
@@ -85,13 +92,7 @@
         <!--<span v-if="!isModifyMode">{{project.usage}}</span>-->
         <!--</el-form-item>-->
 
-        <el-form-item label="预算" prop="budget">
-          <el-input v-if="isModifyMode" type="number" v-model="project.budget">
-            ¥
-            <template slot="append"></template>
-          </el-input>
-          <span v-if="!isModifyMode">{{project.budget}}¥</span>
-        </el-form-item>
+
         <el-form-item label="项目可见性" prop="resource">
           <div v-if="!isModifyMode">
             <div v-if="project.resource=='1'">{{updateLocation(project.location)}}</div>
@@ -138,7 +139,6 @@
               将文件拖到此处,或
               <em>点击上传</em>
             </div>
-            <div class="el-upload__tip" slot="tip">请上传需求文档</div>
           </el-upload>
           <span v-if="!isModifyMode"><a :href="project.requireDocUrl">{{project.requireDocUrl.split('/')[project.requireDocUrl.split('/').length-1]}}</a></span>
         </el-form-item>
@@ -161,7 +161,6 @@
               将文件拖到此处,或
               <em>点击上传</em>
             </div>
-            <div class="el-upload__tip" slot="tip">只能上传Android或IOS安装包文件</div>
           </el-upload>
           <span v-if="!isModifyMode"><a :href="project.fileUrl">{{project.fileUrl.split('/')[project.fileUrl.split('/').length-1]}}</a></span>
         </el-form-item>
@@ -183,10 +182,11 @@
           <div class="btn btn-medium" @click="cancelMode('project')">取消</div>
         </el-form-item>
         <el-form-item v-if="!isModifyMode">
+          <div class="btn btn-medium btn-info" @click="submitProjectRequest()">结束项目</div>
           <div class="btn btn-medium btn-info" @click="submitProjectRequest()">发布项目</div>
           <div class="btn btn-medium btn-info" @click="submitProjectRequest()">提交项目</div>
           <div class="btn btn-medium btn-info" @click="applyProject()">接受项目</div>
-          <div class="btn btn-medium btn-info" @click="modifyForm()">修改</div>
+          <div class="btn btn-medium btn-info" @click="modifyForm()">修改项目</div>
           <!--<div class="btn btn-medium btn-info" @click="analyseDemand()">分析需求</div>-->
           <div class="btn btn-medium btn-info" @click="createTask()">新建任务</div>
           <div class="btn btn-medium btn-info" @click="createReport()">上传报告</div>
@@ -300,6 +300,7 @@ export default {
         price: '',
         datetime: '',
         usage: '',
+        status: ''
       },
       task: [],
       reportList: [],
@@ -445,8 +446,6 @@ export default {
         datetime: this.project.datetime,
         usage: this.project.usage,
       }
-      console.log('aa')
-      console.log(newProject)
       Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
         console.log('bb')
         console.log(res)
@@ -510,7 +509,7 @@ export default {
     //进入修改项目页面
     modifyForm () {
       this.isModifyMode = true
-
+      console.log(this.project.doc)
       //this.setInstitutions()
       //获得update 信息
       //this.loadData()
@@ -617,7 +616,8 @@ export default {
         this.project.usage = res.projectDetails.usage
         this.project.fileUrl = res.projectDetails.file
         this.project.requireDocUrl = res.projectDetails.doc
-
+        this.project.userId = res.projectDetails.userId
+        this.project.status = res.projectDetails.status
         this.task = res.taskList
         this.reportList = res.reportList
         this.hideLoading()

+ 17 - 17
src/components/project/ProjectCreate.vue

@@ -12,6 +12,20 @@
         <el-form-item label="手机号" prop="contactPhone">
           <el-input v-model="project.contactPhone" placeholder="请输入联系人电话"></el-input>
         </el-form-item>
+        <el-form-item label="预算" prop="budget">
+          <el-input type="number" v-model="project.budget">
+            <template slot="append">¥</template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="需求描述" prop="desc">
+          <el-input type="textarea" style="width: 400px" v-model="project.desc"></el-input>
+        </el-form-item>
+
+        <!--<el-form-item label="价格" prop="price">-->
+        <!--<el-input type="number" v-model="project.price">-->
+        <!--<template slot="append">¥</template>-->
+        <!--</el-input>-->
+        <!--</el-form-item>-->
         <el-form-item label="平台" prop="platform">
           <el-checkbox-group v-model="project.platform">
             <span v-for="(item,index) in platforms" :key="index">
@@ -19,14 +33,6 @@
             </span>
           </el-checkbox-group>
         </el-form-item>
-        <el-form-item label="需求描述" prop="desc">
-          <el-input type="textarea" style="width: 400px" v-model="project.desc"></el-input>
-        </el-form-item>
-        <el-form-item label="价格" prop="price">
-          <el-input type="number" v-model="project.price">
-            <template slot="append">¥</template>
-          </el-input>
-        </el-form-item>
         <el-form-item label="服务类型" prop="type">
           <el-checkbox-group v-model="project.type">
             <span v-for="(item,index) in serviceType" :key="index">
@@ -34,11 +40,7 @@
             </span>
           </el-checkbox-group>
         </el-form-item>
-        <el-form-item label="预算" prop="budget">
-          <el-input type="number" v-model="project.budget">
-            <template slot="append">¥</template>
-          </el-input>
-        </el-form-item>
+
         <el-form-item label="项目可见性" prop="resource">
           <el-tabs
             :tab-position="tabPosition"
@@ -80,7 +82,6 @@
               将文件拖到此处,或
               <em>点击上传</em>
             </div>
-            <div class="el-upload__tip" slot="tip">请上传需求文档</div>
           </el-upload>
         </el-form-item>
         <el-form-item label="安装包" prop="file">
@@ -100,7 +101,6 @@
               将文件拖到此处,或
               <em>点击上传</em>
             </div>
-            <div class="el-upload__tip" slot="tip">只能上传Android或IOS安装包文件</div>
           </el-upload>
         </el-form-item>
         <el-form-item label="项目截止时间" prop="datetime">
@@ -483,10 +483,10 @@ export default {
         }
       })
     },
-    showLoading(){
+    showLoading () {
       this.loading = true
     },
-    hideLoading(){
+    hideLoading () {
       this.loading = false
     }
   }

+ 39 - 18
src/components/report/Report.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="create-container">
-    <div class="create-body">
+    <div class="create-body" v-loading="loading">
       <el-form :model="report" :rules="rules" ref="report" label-width="12%" class="demo-report">
         <el-form-item label="报告名称" prop="name">
           <el-input v-if="isModifyMode" v-model="report.name"></el-input>
@@ -95,6 +95,7 @@ export default {
   data () {
     return {
       user: {},
+      loading: false,
       reportId: 0,
       projectId: '',
       taskId: '',
@@ -149,6 +150,7 @@ export default {
       this.isModifyMode = true
     },
     submitForm (formName) {
+      this.showLoading()
       const newReport = {
         name: this.report.name,
         scope: this.taskId == null ? 0 : 1,
@@ -163,17 +165,21 @@ export default {
       if (this.taskId == null) {
         Http.put(Apis.REPORT.UPDATE_PROJECT_REPORT.replace('{projectId}', this.projectId).replace('{reportId}', this.reportId), newReport).then((res) => {
           console.log(res)
-          notify('success','修改成功')
+          notify('success', '修改成功')
+          this.hideLoading()
           this.isModifyMode = false
-        }).catch((error)=>{
-          notify('error',error.data)
+        }).catch((error) => {
+          this.hideLoading()
+          notify('error', error.data)
         })
       } else {
         Http.put(Apis.REPORT.UPDATE_TASK_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId), newReport).then((res) => {
           console.log(res)
+          this.hideLoading()
           this.isModifyMode = false
-        }).catch((error)=>{
-          notify('error',error.data)
+        }).catch((error) => {
+          this.hideLoading()
+          notify('error', error.data)
         })
       }
       // this.$refs[formName].validate(valid => {
@@ -239,14 +245,9 @@ export default {
       //pro1564487183259
       //pro1564487183259_task1564487274060
       //pro1564487183259pro1564487183259_task1564487274060_rep1564488510500
-      console.log('***')
-      console.log(this.projectId)
-      console.log(this.taskId)
-      console.log(this.reportId)
-      console.log('***')
+      this.showLoading()
       if (this.taskId == null) {
         Http.get(Apis.REPORT.GET_PROJECT_REPORT.replace('{projectId}', this.projectId).replace('{reportId}', this.reportId)).then((res) => {
-          console.log(res)
           this.report.name = res.crowdReportVO.name
           this.report.crowdTestTaskId = res.crowdReportVO.crowdTestTaskId
           this.report.scope = res.crowdReportVO.scope
@@ -256,6 +257,11 @@ export default {
           this.report.fileUrl = res.crowdReportVO.file
           this.report.conclusion = res.crowdReportVO.conclusion
           this.report.target = res.crowdReportVO.target
+          this.hideLoading()
+          //notify('success', '修改成功')
+        }).catch((error) => {
+          this.hideLoading()
+          notify('error', '打开报告失败:' + error.data)
         })
       } else {
         Http.get(Apis.REPORT.GET_TASK_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId)).then((res) => {
@@ -269,10 +275,15 @@ export default {
           this.report.fileUrl = res.crowdReportVO.file
           this.report.conclusion = res.crowdReportVO.conclusion
           this.report.target = res.crowdReportVO.target
+          this.hideLoading()
+        }).catch((error) => {
+          this.hideLoading()
+          notify('error', '打开报告失败:' + error.data)
         })
       }
     },
     uploadReportFile (param) {
+      this.showLoading()
       const formData = new FormData()
       let config = {
         //添加请求头
@@ -283,25 +294,35 @@ export default {
         console.log('上传成功')
         this.report.fileUrl = res.data
         console.log(res)
+        this.hideLoading()
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '文件上传失败:' + error.data)
       })
     },
     setReportType () {
-      getAllReportTypes().then((res)=>{
+      getAllReportTypes().then((res) => {
         this.reportType = res
-      }).catch((error)=>{
-        notify('error','加载报告类型失败')
+      }).catch((error) => {
+        notify('error', '加载报告类型失败')
       })
     },
     setUserInfo () {
       this.user = storageGet('user')
     },
-    updateReportSuccess(){
+    updateReportSuccess () {
 
+    },
+    showLoading () {
+      this.loading = true
+    },
+    hideLoading () {
+      this.loading = false
     }
   },
-  watch:{
+  watch: {
     reportType (val) {
-      this.reportType =val
+      this.reportType = val
     }
   }
 }

+ 21 - 10
src/components/report/ReportList.vue

@@ -18,7 +18,7 @@
       <el-table-column prop="file" sortable label="报告文件">
         <template slot-scope="scope">
           <span v-if="scope.row.content==null || scope.row.content==''">暂无文件</span>
-          <a :href="scope.row.content" v-if="scope.row.content!=null" target="_blank"><i
+          <a :href="scope.row.file" v-if="scope.row.content!=null" target="_blank"><i
             class="fa fa-file-text-o"></i> {{scope.row.content}}</a>
         </template>
       </el-table-column>
@@ -43,21 +43,32 @@ export default {
   data () {
     return {
       editIndex: -1,
-      reportList: this.reports,
+      reportList: this.reports == null ? [] : this.reports,
       pid: this.projectId,
       tid: this.taskId,
     }
   },
   methods: {
     handleEdit (index, row) {
-      this.$router.push({
-        name: 'Report',
-        params: {
-          reportId: row.code,
-          projectId: this.pid,
-          taskId: this.tid
-        }
-      })
+      if (this.tid == null) {
+        this.$router.push({
+          name: 'ProjectReport',
+          params: {
+            reportId: row.code,
+            projectId: this.pid
+          }
+        })
+      } else {
+        this.$router.push({
+          name: 'Report',
+          params: {
+            reportId: row.code,
+            projectId: this.pid,
+            taskId: this.tid
+          }
+        })
+      }
+
       // this.editIndex = index;
     },
     handleDelete (index, row) {

+ 57 - 29
src/components/task/Task.vue

@@ -16,14 +16,14 @@
           <el-input type="number" v-if="isModifyMode" v-model="task.quotePrice">
             <template slot="append">¥</template>
           </el-input>
-          <span v-if="!isModifyMode">{{task.quotePrice}}</span>
-        </el-form-item>
-        <el-form-item type="number" label="任务定价" prop="fixedPrice">
-          <el-input v-if="isModifyMode" v-model="task.fixedPrice">
-            <template slot="append">¥</template>
-          </el-input>
-          <span v-if="!isModifyMode">{{task.fixedPrice}}</span>
+          <span v-if="!isModifyMode">{{task.quotePrice}}¥</span>
         </el-form-item>
+        <!--<el-form-item type="number" label="任务定价" prop="fixedPrice">-->
+        <!--<el-input v-if="isModifyMode" v-model="task.fixedPrice">-->
+        <!--<template slot="append">¥</template>-->
+        <!--</el-input>-->
+        <!--<span v-if="!isModifyMode">{{task.fixedPrice}}</span>-->
+        <!--</el-form-item>-->
         <el-form-item label="业务类型" prop="serviceType">
           <el-radio-group v-if="isModifyMode" v-model="task.serviceType">
             <span v-for="(item,index) in serviceType" :key="index">
@@ -34,7 +34,7 @@
         </el-form-item>
         <el-form-item label="任务可见性" prop="resource">
           <div v-if="!isModifyMode">
-            <div v-if="task.resource=='1'">{{updateLocation(task.location)}}</div>
+            <!--<div v-if="task.resource=='1'">{{updateLocation(task.location)}}</div>-->
             <div v-if="task.resource=='0'">{{task.institution}}</div>
             <div v-if="task.resource=='2'">{{resourceType[task.resource]}}</div>
           </div>
@@ -55,14 +55,14 @@
                 </el-radio>
               </el-radio-group>
             </el-tab-pane>
-            <el-tab-pane :label="resourceType[1]" name="1">
-              <provincecity
-                ref="addFormProvince"
-                @selectChange="locationChange"
-                :provinceCode="task.location.provinceCode"
-                :cityCode="task.location.cityCode"
-              ></provincecity>
-            </el-tab-pane>
+            <!--<el-tab-pane :label="resourceType[1]" name="1">-->
+            <!--<provincecity-->
+            <!--ref="addFormProvince"-->
+            <!--@selectChange="locationChange"-->
+            <!--:provinceCode="task.location == null ||task.location.provinceCode==null?'3200':task.location.provinceCode"-->
+            <!--:cityCode="task.location == null ||task.location.cityCode==null?'3201':task.location.cityCode"-->
+            <!--&gt;</provincecity>-->
+            <!--</el-tab-pane>-->
             <el-tab-pane :label="resourceType[2]" name="2"></el-tab-pane>
           </el-tabs>
         </el-form-item>
@@ -85,7 +85,6 @@
               将文件拖到此处,或
               <em>点击上传</em>
             </div>
-            <div class="el-upload__tip" slot="tip">请上传需求文档</div>
           </el-upload>
           <span v-if="!isModifyMode">
               <span v-if="task.requireDocUrl == null">
@@ -114,10 +113,15 @@
           <div class="btn btn-medium" @click="cancelMode('task')">取消</div>
         </el-form-item>
         <el-form-item v-if="!isModifyMode">
-          <div class="btn btn-medium btn-info" @click="submitTaskRequest()">提交任务</div>
-          <div class="btn btn-medium btn-info" @click="applyTask()">接收任务</div>
-          <div class="btn btn-medium btn-info" @click="modifyForm()">修改</div>
-          <div class="btn btn-medium btn-info" @click="createReport()">上传报告</div>
+          <div class="btn btn-medium btn-info"
+               v-if="taskOperationControl.confirmFinish"
+               @click="submitTaskRequest()">确认结束
+          </div>
+          <div class="btn btn-medium btn-info" v-if="taskOperationControl.finish" @click="submitTaskRequest()">结束任务
+          </div>
+          <div class="btn btn-medium btn-info" v-if="taskOperationControl.receive" @click="applyTask()">接收任务</div>
+          <div class="btn btn-medium btn-info" v-if="taskOperationControl.update" @click="modifyForm()">修改任务</div>
+          <div class="btn btn-medium btn-info" v-if="taskOperationControl.uploadReport" @click="createReport()">上传报告</div>
           <div class="btn btn-medium" @click="toProject()">前往项目</div>
         </el-form-item>
       </el-form>
@@ -132,7 +136,6 @@
 <script>
 import ResourceType from '@/constants/enum/resource-type.js'
 import provincecity from '@/components/commons/ProvinceCity'
-import provinceCityJSON from '@/constants/provinceCity.json'
 import ReportList from '@/components/report/ReportList'
 import Http from '@/js/http.js'
 import Apis from '@/js/api.js'
@@ -154,7 +157,8 @@ export default {
   data () {
     return {
       user: {},
-      loading:false,
+      rolesPermissions: {},
+      loading: false,
       isModifyMode: false,
       institutionArray: [],
       tabPosition: 'top',
@@ -162,10 +166,19 @@ export default {
       serviceType: [],
       taskId: '',
       projectId: '',
+      taskOperationControl: {
+        confirmFinish: false,
+        finish: false,
+        receive: false,
+        update: false,
+        uploadReport: false
+      },
       task: {
+        agencyId: '',
+        status: '',
         name: '',
         desc: '',
-        type: '',
+        serviceType: '',
         resource: '',
         location: {},
         institution: {},
@@ -228,6 +241,9 @@ export default {
     institutionArray (val) {
       this.institutionArray = val
     },
+    serviceType (val) {
+      this.serviceType = val
+    },
     // 'task.institution' () {
     //   if (this.task.institution) {
     //     //this.$refs.addFormProvince.resetProviceCity()
@@ -265,7 +281,7 @@ export default {
     },
     updateLocation (location) {
       console.log(location)
-      const loactionName = getProvinceNameByProvinceCode(location.provinceCode,location.cityCode)
+      const loactionName = getProvinceNameByProvinceCode(location.provinceCode, location.cityCode)
       // var provinceName = ''
       // var cityName = ''
       // for (var item of provinceCityJSON.provinces) {
@@ -288,7 +304,7 @@ export default {
         desc: this.task.description,
         type: this.task.serviceType,
         resource: this.task.resource,
-        location: getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode),
+        location: this.task.location == null ? {} : getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode),
         institution: this.task.institution.id,
         datetime: this.task.datetime,
         quotePrice: this.task.quotePrice,
@@ -296,6 +312,7 @@ export default {
         requirementFile: this.task.requireDocUrl
       }
       //修改TASK
+      console.log(newTask)
       Http.put(Apis.TASK.UPDATE_TASK.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId), newTask).then((res) => {
         this.isModifyMode = false
         console.log(res)
@@ -305,7 +322,10 @@ export default {
         this.task.description = res.crowdTaskVO.description
         this.task.serviceType = res.crowdTaskVO.serviceType
         this.task.resource = res.crowdTaskVO.resource
-        this.task.location = getProvinceCodeByProvinceName(res.crowdTaskVO.location.provinceCode, res.crowdTaskVO.location.cityCode)
+        this.task.location = res.crowdTaskVO.location == null ? {
+          provinceCode: 3200,
+          cityCode: 3201
+        } : getProvinceCodeByProvinceName(res.crowdTaskVO.location.provinceCode, res.crowdTaskVO.location.cityCode)
         this.task.institution = res.crowdTaskVO.institution
         this.task.datetime = new Date(res.crowdTaskVO.datetime)
         this.task.quotePrice = res.crowdTaskVO.quotePrice
@@ -315,6 +335,10 @@ export default {
 
         this.reportList = res.crowdReportVOList
         this.hideLoading()
+        notify('success', '修改成功')
+      }).catch((error) => {
+        notify('error', '修改失败:' + error.data)
+        this.hideLoading()
       })
       // this.$refs[formName].validate(valid => {
       //   if (valid) {
@@ -405,6 +429,9 @@ export default {
         this.task.fixedPrice = res.crowdTaskVO.fixedPrice
         this.task.doc = []
         this.task.requireDocUrl = res.crowdTaskVO.requirementFile
+        this.task.agencyId = res.crowdTaskVO.agencyId
+        this.task.status = res.crowdTaskVO.status
+        this.taskOperationControl = res.taskOperationControl
 
         this.reportList = res.crowdReportVOList
         this.hideLoading()
@@ -479,11 +506,12 @@ export default {
     },
     setUserInfo () {
       this.user = storageGet('user')
+      this.rolesPermissions = storageGet('rolesPermissions')
     },
-    showLoading(){
+    showLoading () {
       this.loading = true
     },
-    hideLoading(){
+    hideLoading () {
       this.loading = false
     }
   },

+ 14 - 15
src/components/task/TaskCreate.vue

@@ -14,11 +14,11 @@
             <template slot="append">¥</template>
           </el-input>
         </el-form-item>
-        <el-form-item type="number" label="任务定价" prop="fixedPrice">
-          <el-input v-model="task.fixedPrice">
-            <template slot="append">¥</template>
-          </el-input>
-        </el-form-item>
+        <!--<el-form-item type="number" label="任务定价" prop="fixedPrice">-->
+        <!--<el-input v-model="task.fixedPrice">-->
+        <!--<template slot="append">¥</template>-->
+        <!--</el-input>-->
+        <!--</el-form-item>-->
         <el-form-item label="业务类型" prop="type">
           <el-radio-group v-model="task.type">
             <span v-for="(item,index) in serviceType" :key="index">
@@ -39,14 +39,14 @@
                 </el-radio>
               </el-radio-group>
             </el-tab-pane>
-            <el-tab-pane :label="resourceType[1]" name="1">
-              <provincecity
-                ref="addFormProvince"
-                @selectChange="locationChange"
-                :provinceCode="task.location.provinceCode"
-                :cityCode="task.location.cityCode"
-              ></provincecity>
-            </el-tab-pane>
+            <!--<el-tab-pane :label="resourceType[1]" name="1">-->
+            <!--<provincecity-->
+            <!--ref="addFormProvince"-->
+            <!--@selectChange="locationChange"-->
+            <!--:provinceCode="task.location.provinceCode"-->
+            <!--:cityCode="task.location.cityCode"-->
+            <!--&gt;</provincecity>-->
+            <!--</el-tab-pane>-->
             <el-tab-pane :label="resourceType[2]" name="2"></el-tab-pane>
           </el-tabs>
         </el-form-item>
@@ -170,8 +170,7 @@ export default {
           {required: true, message: '请选择业务类型', trigger: 'change'}
         ],
         desc: [{required: true, message: '请填写任务描述', trigger: 'blur'}],
-        quotePrice: [{required: true, message: '请填写任务报价', trigger: 'blur'}],
-        fixedPrice: [{required: true, message: '请填写任务定价', trigger: 'blur'}]
+        quotePrice: [{required: true, message: '请填写任务报价', trigger: 'blur'}]
       }
     }
   },

+ 2 - 0
src/main.js

@@ -50,6 +50,7 @@ import {
   Tag,
   TimePicker,
   TimeSelect,
+  Tooltip,
   Upload,
 } from 'element-ui'
 
@@ -152,6 +153,7 @@ Vue.use(Avatar)
 Vue.use(Pagination)
 Vue.use(Link)
 Vue.use(Loading)
+Vue.use(Tooltip)
 
 Vue.prototype.$msgbox = MessageBox
 Vue.prototype.$alert = MessageBox.alert

+ 10 - 1
src/router/index.js

@@ -111,7 +111,7 @@ export default new Router({
       },
     },
     {
-      path: '/report/:reportId',
+      path: '/project/:projectId/task/:taskId/report/:reportId',
       name: 'Report',
       component: resolve => require(['@/components/report/Report.vue'], resolve),
       meta: {
@@ -120,6 +120,15 @@ export default new Router({
       },
     },
     {
+      path: '/project/:projectId/report/:reportId',
+      name: 'ProjectReport',
+      component: resolve => require(['@/components/report/Report.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      },
+    },
+    {
       path: '/greenChannel/addProject',
       name: 'ProjectAdd',
       component: resolve => require(['@/components/cheat/ProjectAdd.vue'], resolve),