Browse Source

修改项目和任务相关信息

郭超 4 years ago
parent
commit
a58b73c0ef

BIN
dist.zip


+ 57 - 146
src/components/project/Project.vue

@@ -50,9 +50,11 @@
             <!--            <el-form-item v-if="!isModifyMode" size="small" label="状态" prop="status">-->
             <!--              <span v-if="!isModifyMode">{{project.statusVO?project.statusVO.text:''}}</span>-->
             <!--            </el-form-item>-->
-            <el-form-item size="small" label="区域管理员" prop="institution" v-if="project.institution">
-              <span v-if="!isModifyMode">{{project.institution}}</span>
+            <el-form-item size="small" label="区域管理员" prop="regionManagerName"
+                          v-if="!isModifyMode && project.regionManagerName">
+              <span>{{project.regionManagerName}}</span>
             </el-form-item>
+
             <el-form-item label="需求描述">
               <el-input style="width: 400px" autosize v-if="isModifyMode" type="textarea"
                         v-model="project.desc"></el-input>
@@ -67,7 +69,7 @@
             <el-form-item label="领域类型" prop="field">
               <el-radio-group v-if="isModifyMode" v-model="project.field">
                 <span v-for="(item,index) in fields" :key="index">
-              <el-radio :label="item.name" style="margin: 3px">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
+              <el-radio :label="item.name">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
             </span>
               </el-radio-group>
               <span
@@ -80,7 +82,7 @@
             <el-form-item label="应用类型" prop="platform">
               <el-radio-group v-if="isModifyMode" v-model="project.platform">
                 <span v-for="(item,index) in platforms" :key="index">
-              <el-radio :label="item.name" style="margin: 3px">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
+              <el-radio :label="item.name">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
             </span>
               </el-radio-group>
               <span
@@ -89,6 +91,7 @@
               >
               {{project.platform}}</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">
@@ -111,13 +114,23 @@
               </div>
               <el-tabs :tab-position="tabPosition" v-model="project.resource" style="max-height: 200px;"
                        v-if="isModifyMode">
+
+                <!--                <el-tab-pane :label="resourceType[0]" :name="0">-->
+                <!--                  <el-radio-group v-model="project.institution">-->
+                <!--                    <span v-for="(item,index) in institutionArray" :key="index">-->
+                <!--                      <el-radio :label="item.id" name="type" style="margin: 3px">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>-->
+                <!--                    </span>-->
+                <!--                  </el-radio-group>-->
+                <!--                </el-tab-pane>-->
+
                 <el-tab-pane :label="resourceType[0]" :name="0">
                   <el-radio-group v-model="project.institution">
-                    <el-radio :label="item" name="type" v-for="(item,index) in institutionArray" :key="index">
+                    <el-radio v-for="(item,index) in institutionArray" :label="item.id" name="type" :key="index">
                       {{item.name}}
                     </el-radio>
                   </el-radio-group>
                 </el-tab-pane>
+
                 <el-tab-pane :label="resourceType[1]" :name="1">
                   <provincecity
                     ref="addFormProvince"
@@ -151,7 +164,7 @@
                   <em>点击上传</em>
                 </div>
               </el-upload>
-              <span >
+              <span>
             <a :href="project.requireDocUrl" v-if="project.requireDocUrl!=null && project.requireDocUrl!=''"><el-link
               :underline="false" type="primary"><i
               class="el-icon-document"></i>下载文档</el-link></a>
@@ -179,12 +192,12 @@
                   <em>点击上传</em>
                 </div>
               </el-upload>
-              <span v-if="!isModifyMode">
-            <a v-if="project.fileUrl!=null && project.fileUrl!=''" :href="project.fileUrl"><el-link :underline="false"
-                                                                                                    type="primary"><i
-              class="el-icon-document"></i>下载文件</el-link></a>
-            <i v-if="project.fileUrl==null || project.fileUrl==''" class="el-icon-document">暂无文件</i>
-          </span>
+              <span>
+                <a v-if="project.fileUrl!=null && project.fileUrl!=''" :href="project.fileUrl"><el-link :underline="false"
+                                                                                                        type="primary"><i
+                  class="el-icon-document"></i>下载文件</el-link></a>
+                <i v-if="project.fileUrl==null || project.fileUrl==''" class="el-icon-document">暂无文件</i>
+              </span>
             </el-form-item>
             <el-form-item label="委托单位" prop="entrustUnit" v-if="project.entrustUnit">
               <el-input style="width: 400px" autosize v-if="isModifyMode" type="textarea"
@@ -260,7 +273,7 @@
             <template slot-scope="scope">
               <div v-if="scope.row.resource=='1'">{{scope.row.location.provinceCode}}/{{scope.row.location.cityCode}}
               </div>
-              <div v-if="scope.row.resource=='0'">{{scope.row.institution}}</div>
+              <div v-if="scope.row.resource=='0'">{{scope.row.agencyName}}</div>
               <div v-if="scope.row.resource=='2'">{{resourceType[scope.row.resource]}}</div>
             </template>
           </el-table-column>
@@ -376,6 +389,8 @@
           resource: '',
           location: '',
           institution: {},
+          regionManagerId: 0,
+          regionManagerName: '',
           contactName: '',
           contactPhone: '',
           doc: [],
@@ -506,24 +521,6 @@
       institutionArray(val) {
         this.institutionArray = val
       },
-      // 'project.institution' () {
-      //   if (this.project.institution) {
-      //     //this.$refs.addFormProvince.resetProviceCity()
-      //     this.project.location = {provinceCode: '', cityCode: ''}
-      //   }
-      // },
-      // 'project.location' () {
-      //   if (this.project.location.provinceCode || this.project.location.cityCode) {
-      //     this.project.institution = ''
-      //   }
-      // },
-      // 'project.resource' () {
-      //   if (this.project.resource == '2') {
-      //     //this.$refs.addFormProvince.resetProviceCity()
-      //     this.project.institution = ''
-      //     this.project.location = {provinceCode: '', cityCode: ''}
-      //   }
-      // },
       deep: true
     },
     methods: {
@@ -547,9 +544,6 @@
       },
       init() {
         this.projectId = this.$route.params.projectId
-        this.setServiceType()
-        this.setFields()
-        this.setPlatformType()
         // this.setInstitutions()
         this.setUserInfo()
         this.loadData()
@@ -620,7 +614,7 @@
               desc: this.project.desc,
               resource: this.project.resource,
               location: getProvinceNameByProvinceCode(this.project.location.provinceCode, this.project.location.cityCode),
-              institution: this.project.institution == null ? null : this.project.institution.id,
+              institution: this.project.institution == null ? null : this.project.institution,
               contactName: this.project.contactName,
               contactPhone: this.project.contactPhone,
               doc: this.project.requireDocUrl,
@@ -630,32 +624,13 @@
               datetime: this.project.datetime,
               usage: this.project.usage,
             }
-            console.log(newProject);
+            // console.log(newProject);
             Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
-              console.log(res)
-              this.projectId = res.projectDetails.id
-              this.project.name = res.projectDetails.name
-              this.project.contactName = res.projectDetails.contactName
-              this.project.contactPhone = res.projectDetails.contactPhone
-              this.project.type = res.projectDetails.type
-              this.project.platform = res.projectDetails.platform
-              this.project.valuationStandard = res.projectDetails.valuationStandard
-              this.project.entrustUnit = res.projectDetails.entrustUnit
-              this.project.field = res.projectDetails.field
-              this.project.desc = res.projectDetails.desc
-              this.project.doc = []
-              this.project.file = []
+              // console.log(res)
               this.project.resource = res.projectDetails.resource
               this.project.location = getProvinceCodeByProvinceName(res.projectDetails.location.provinceCode, res.projectDetails.location.cityCode)
-              this.project.institution = res.projectDetails.institution
               this.project.datetime = new Date(res.projectDetails.datetime)
-              this.project.price = res.projectDetails.price
-              this.project.budget = res.projectDetails.budget
-              this.project.usage = res.projectDetails.usage
-              this.project.fileUrl = res.projectDetails.file
-              this.project.requireDocUrl = res.projectDetails.doc
-              this.task = res.taskList
-              this.reportList = res.reportList
+              this.changeValue(res);
               this.isModifyMode = false
               this.hideLoading()
               notify('success', '项目修改成功')
@@ -670,6 +645,15 @@
           }
         })
       },
+      changeValue(res) {
+        this.project = res.projectDetails
+        this.projectId = res.projectDetails.id
+        this.project.fileUrl = res.projectDetails.file
+        this.project.requireDocUrl = res.projectDetails.doc
+        this.task = res.taskList
+        this.reportList = res.reportList
+        this.projectOperationControl = res.projectOperationControl
+      },
       //重置表单
       resetForm(formName) {
         this.$refs[formName].resetFields()
@@ -694,11 +678,14 @@
       //进入修改项目页面
       modifyForm() {
         this.isModifyMode = true
+        this.setServiceType()
+        this.setFields()
+        this.setPlatformType()
         // this.project.type = []
         // this.project.platform = ''
         // this.project.field = ''
         // console.log(this.project.doc)
-        //this.setInstitutions()
+        this.setInstitutions()
         //获得update 信息
         //this.loadData()
       },
@@ -710,7 +697,6 @@
           type: 'success'
         }).then(() => {
           this.showLoading()
-          console.log('接收项目')
           receiveProjectRequest(this.projectId, this.user.userVO.id, this.receiveProjectSuccess, this.receiveProjectFail)
         }).catch(() => {
         })
@@ -718,9 +704,7 @@
       receiveProjectSuccess(res) {
         this.hideLoading()
         notify('success', '项目接收成功!')
-        this.projectOperationControl = res.projectOperationControl
-        this.project = res.projectDetails
-        // this.project.institution = res.projectDetails.institution
+        this.changeValue(res);
       },
       receiveProjectFail(error) {
         this.hideLoading()
@@ -742,12 +726,19 @@
       rejectProjectSuccess(res) {
         this.hideLoading()
         notify('success', '拒绝项目成功')
+        this.changeValue(res);
       },
       rejectProjectFail(error) {
         this.hideLoading()
         notify('error', '拒绝项目失败:' + error.data)
       },
       //提交项目
+      submitProjectRequestSuccess(res) {
+        this.hideLoading()
+        notify('success', '项目提交成功!')
+        this.loadData()
+        this.changeValue(res);
+      },
       submitProjectRequest() {
         this.$confirm('确认提交项目?', '提示', {
           confirmButtonText: '确认提交',
@@ -759,14 +750,6 @@
         }).catch(() => {
         })
       },
-      submitProjectRequestSuccess(res) {
-        this.hideLoading()
-        notify('success', '项目提交成功!')
-        this.loadData()
-        this.projectOperationControl = res.projectOperationControl
-        this.project.status = res.projectDetails.status
-        this.project.institution = res.projectDetails.institution
-      },
       submitProjectRequestFail(error) {
         this.hideLoading()
         notify('error', '提交项目失败:' + error.data)
@@ -788,9 +771,7 @@
         this.hideLoading()
         notify('success', '项目提交成功!')
         this.loadData()
-        this.projectOperationControl = res.projectOperationControl
-        this.project.status = res.projectDetails.status
-        this.project.institution = res.projectDetails.institution
+        this.changeValue(res);
       },
       endProjectFail(error) {
         this.hideLoading()
@@ -867,32 +848,15 @@
       handleReject(index, id) {
         console.log('拒绝')
       },
-      loadData() {//PROJ--2019073114009
+      loadData() {
         this.showLoading()
         Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', this.projectId)).then((res) => {
-          console.log(res)
-          console.log(typeof res.projectDetails.field)
-          this.projectId = res.projectDetails.id
-          this.project.name = res.projectDetails.name
-          this.project.contactName = res.projectDetails.contactName
-          this.project.contactPhone = res.projectDetails.contactPhone
-          this.project.type = res.projectDetails.type
-          this.project.platform = res.projectDetails.platform
-          this.project.valuationStandard = res.projectDetails.valuationStandard
-          this.project.entrustUnit = res.projectDetails.entrustUnit
-          this.project.field = res.projectDetails.field
-          console.log(res.projectDetails.field)
-          console.log(this.project.field)
           this.project.desc = res.projectDetails.desc
           this.project.doc = []
           this.project.file = []
           this.project.resource = res.projectDetails.resource
           this.project.location = getProvinceCodeByProvinceName(res.projectDetails.location.provinceCode, res.projectDetails.location.cityCode)
-          this.project.institution = res.projectDetails.institution
           this.project.datetime = new Date(res.projectDetails.datetime)
-          this.project.price = res.projectDetails.price
-          this.project.budget = res.projectDetails.budget
-          this.project.usage = res.projectDetails.usage
           this.project.fileUrl = res.projectDetails.file
           this.project.requireDocUrl = res.projectDetails.doc
           this.project.userId = res.projectDetails.userId
@@ -900,9 +864,8 @@
           this.project.statusVO = res.projectDetails.statusVO
           this.task = res.taskList
           this.reportList = res.reportList
-          this.projectOperationControl = res.projectOperationControl
           this.progress = res.progress
-          console.log(this.project)
+          this.changeValue(res);
           this.hideLoading()
           this.handleShowTaskListOrNot()
           for (var i = 0; i < this.progress.length; i++) {
@@ -936,7 +899,7 @@
         this.$message.warning(
           `当前限制选择 1 个文件,本次选择了 ${
             files.length
-            } 个文件,共选择了 ${files.length + fileList.length} 个文件`
+          } 个文件,共选择了 ${files.length + fileList.length} 个文件`
         )
       },
       beforeRemove(file, fileList) {
@@ -1061,55 +1024,3 @@
     width: 400px;
   }
 </style>
-
-
-<!--<div class="create-body" v-if="!isModifyMode">-->
-<!--<div class="title h2">分析需求</div>-->
-<!--<div class="task-list">-->
-<!--<el-table :data="analyseDemandList" style="width: 100%" max-height="400">-->
-<!--<el-table-column prop="institution" label="承接单位" title="承接单位"></el-table-column>-->
-<!--<el-table-column prop="feasibilityReport" sortable label="可行性分析报告">-->
-<!--<template slot-scope="scope">-->
-<!--<span v-if="!scope.row.feasibilityReport.url">暂无文件</span>-->
-<!--<a-->
-<!--:href="scope.row.feasibilityReport.url"-->
-<!--v-if="scope.row.feasibilityReport.url"-->
-<!--target="_blank"-->
-<!--&gt;-->
-<!--<i class="fa fa-file-text-o"></i>-->
-<!--{{scope.row.feasibilityReport.name}}-->
-<!--</a>-->
-<!--</template>-->
-<!--</el-table-column>-->
-<!--<el-table-column prop="priceAuditReport" sortable label="可行性分析报告">-->
-<!--<template slot-scope="scope">-->
-<!--<span v-if="!scope.row.priceAuditReport.url">暂无文件</span>-->
-<!--<a-->
-<!--:href="scope.row.priceAuditReport.url"-->
-<!--v-if="scope.row.priceAuditReport.url"-->
-<!--target="_blank"-->
-<!--&gt;-->
-<!--<i class="fa fa-file-text-o"></i>-->
-<!--{{scope.row.priceAuditReport.name}}-->
-<!--</a>-->
-<!--</template>-->
-<!--</el-table-column>-->
-
-<!--<el-table-column align="right" label="操作">-->
-<!--<template slot-scope="scope">-->
-<!--<div-->
-<!--class="btn btn-small btn-info"-->
-<!--@click="handleAccept(scope.$index, scope.row.id)"-->
-<!--&gt;接受-->
-<!--</div>-->
-<!--<div-->
-<!--class="btn btn-small btn-danger"-->
-<!--@click="handleReject(scope.$index, scope.row.id)"-->
-<!--&gt;拒绝-->
-<!--</div>-->
-<!--</template>-->
-<!--</el-table-column>-->
-<!--</el-table>-->
-<!--</div>-->
-<!--</div>-->
-

+ 1 - 1
src/components/report/ProjectReport.vue

@@ -48,7 +48,7 @@
             <div class="el-upload__tip" slot="tip">请上传报告文件</div>
           </el-upload>
           <div v-if="!isModifyMode">
-            <span v-if="report.fileUrl==null">暂无文件</span>
+            <span v-if="report.fileUrl==null"><i class="el-icon-document"></i>暂无文件</span>
             <a :href="report.fileUrl" v-if="report.fileUrl!=null">
               <el-link :underline="false" type="primary"><i class="el-icon-document"></i>下载文档</el-link>
             </a>

+ 3 - 3
src/components/report/ReportList.vue

@@ -12,9 +12,9 @@
       </el-table-column>
       <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.file" v-if="scope.row.content!=null" target="_blank"><i
-            class="fa fa-file-text-o"></i> {{scope.row.content}}</a>
+          <span v-if="scope.row.file==null || scope.row.file==''"><i class="el-icon-document"></i>暂无文件</span>
+          <a :href="scope.row.file" v-else target="_blank"><el-link :underline="false" type="primary"><i
+            class="el-icon-document"></i>下载文档</el-link></a>
         </template>
       </el-table-column>
       <el-table-column align="right" label="操作">

+ 1 - 1
src/components/report/TaskReport.vue

@@ -46,7 +46,7 @@
             <div class="el-upload__tip" slot="tip">请上传报告文件</div>
           </el-upload>
           <div v-if="!isModifyMode">
-            <span v-if="report.fileUrl==null">暂无文件</span>
+            <span v-if="report.fileUrl==null"><i class="el-icon-document"></i>暂无文件</span>
             <a :href="report.fileUrl" v-if="report.fileUrl!=null">
               <el-link :underline="false" type="primary"><i class="el-icon-document"></i>下载文档</el-link>
             </a>

+ 79 - 75
src/components/task/Task.vue

@@ -35,10 +35,10 @@
             <el-form-item label="测试类型" prop="serviceType">
               <el-radio-group v-if="isModifyMode" v-model="task.serviceType" @change="handleTestTypeChange">
                 <span v-for="(item,index) in serviceType" :key="index">
-                  <el-radio :label="item.code" name="serviceType">{{ item.name }}</el-radio>
+                  <el-radio :label="item.name" name="serviceType">{{ item.name }}</el-radio>
                 </span>
               </el-radio-group>
-              <span class="badge" v-if="!isModifyMode">{{ serviceName }}</span>
+              <span class="badge" v-if="!isModifyMode">{{ task.serviceType }}</span>
             </el-form-item>
 
             <el-form-item label="服务序列号" prop="endPoint" style="width: 700px;"
@@ -62,12 +62,8 @@
               >
                 <el-tab-pane :label="resourceType[0]" name="0">
                   <el-radio-group v-model="task.institution" @change="handleTestTypeChange">
-                    <el-radio
-                      :label="item"
-                      name="type"
-                      v-for="(item,index) in institutionArray"
-                      :key="index"
-                    >{{ item.name }}
+                    <el-radio v-for="(item,index) in institutionArray" :label="item.userId" name="type" :key="index">
+                      {{item.name}}
                     </el-radio>
                   </el-radio-group>
                 </el-tab-pane>
@@ -128,7 +124,7 @@
             </span>
             </el-form-item>
 
-            <el-form-item v-if="!isModifyMode && task.resource==0 && showBD" label="任务接收码" prop="agencyName" style="width: 700px;">
+            <el-form-item v-if="!isModifyMode && task.resource==0 && needAcceptedPWD && showBD" label="任务接收码" prop="agencyName" style="width: 700px;">
               <span>{{task.acceptedPassword}}</span>
             </el-form-item>
 
@@ -167,27 +163,6 @@
 
             <el-form-item v-if="!isModifyMode">
               <el-button size="mini" @click="toProject()">项目详情</el-button>
-              <el-popover
-                placement="top-start"
-                title="确认结束?"
-                width="200"
-                trigger="hover"
-                content="测评机构已提交结束申请,请确认是否结束该任务">
-                <el-button v-if="taskOperationControl.confirmFinish" type="success" size="mini" slot="reference"
-                           @click="endTask()">确认结束
-                </el-button>
-              </el-popover>
-
-              <el-popover
-                placement="top-start"
-                title="确认提交?"
-                width="200"
-                trigger="hover"
-                content="提交任务后不可更改,等待区域管理员验收">
-                <el-button v-if="taskOperationControl.finish" type="primary" size="mini" slot="reference"
-                           @click="submitTaskRequest()">提交任务
-                </el-button>
-              </el-popover>
 
               <el-popover
                 placement="top-start"
@@ -222,13 +197,7 @@
                          @click="recommendTask()">任务推荐
               </el-button>
 
-
-              <!--              <el-button v-if="taskOperationControl.exportTask && task.exportUrl != null && task.exportUrl != ''" type="primary" size="mini">-->
-              <!--                <a :href="task.exportUrl" style="color:white">导出任务</a>-->
-              <!--              </el-button>-->
-              <el-button v-if="taskOperationControl.exportTask" type="primary" size="mini" @click="toExportTask()">
-                导出任务
-              </el-button>
+              <el-button v-if="taskOperationControl.exportTask" type="primary" size="mini" @click="toExportTask()">导出任务</el-button>
 
               <el-button v-if="taskOperationControl.uploadReport" type="primary" size="mini" @click="toCreateReport()">
                 上传报告
@@ -245,17 +214,28 @@
               </el-button>
 
 
-              <!--<div class="btn btn-small btn-info"-->
-              <!--v-if="taskOperationControl.confirmFinish"-->
-              <!--@click="endTask()">确认结束-->
-              <!--</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="!taskOperationControl.finish" @click="submitTaskRequest()">提交任务-->
-              <!--</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="!taskOperationControl.receive" @click="receiveTask()">接收任务</div>-->
-              <!--<div class="btn btn-small btn-danger" v-if="!taskOperationControl.reject" @click="rejectTask()">拒绝任务</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="taskOperationControl.update" @click="modifyForm()">修改任务</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="!taskOperationControl.uploadReport" @click="toCreateReport()">上传报告-->
-              <!--</div>-->
+              <el-popover
+                placement="top-start"
+                title="确认提交?"
+                width="200"
+                trigger="hover"
+                content="提交任务后不可更改,等待区域管理员验收">
+                <el-button v-if="taskOperationControl.finish" type="primary" size="mini" slot="reference"
+                           @click="submitTaskRequest()">提交任务
+                </el-button>
+              </el-popover>
+
+              <el-popover
+                placement="top-start"
+                title="确认结束?"
+                width="200"
+                trigger="hover"
+                content="测评机构已提交结束申请,请确认是否结束该任务">
+                <el-button v-if="taskOperationControl.confirmFinish" type="success" size="mini" slot="reference"
+                           @click="endTask()">确认结束
+                </el-button>
+              </el-popover>
+
             </el-form-item>
           </el-form>
         </el-col>
@@ -332,7 +312,8 @@ import {
   storageGet,
   submitTaskRequest,
   updateTask,
-  getTaskWordCloud
+  getTaskWordCloud,
+  getTaskWordCloudByDescription
 } from '@/js/index'
 import {AxiosInstance as axios} from "axios";
 
@@ -350,13 +331,15 @@ export default {
       taskValidCode:'',
       featureTaskRecommend: CONFIG.feature_task_recommend,
       taskRecommendUrl: CONFIG.task_recommend_url,
+      needAcceptedPWD: CONFIG.feature_task_acceptedPWD,
       currType: {},
       user: {},
       serviceName: '',
       showBD: true,
       rolesPermissions: {},
       loading: false,
-      isModifyMode: false, institutionArray: [],
+      isModifyMode: false,
+      institutionArray: [],
       tabPosition: 'top',
       resourceType: ResourceType,
       serviceType: [],
@@ -387,7 +370,7 @@ export default {
         serviceType: '',
         resource: '',
         location: {},
-        institution: {},
+        institution: 0,
         datetime: '',
         quotePrice: '',
         fixedPrice: '',
@@ -455,7 +438,7 @@ export default {
           {required: true},
           {
             validator: (rule, value, callback) => {
-              if (value == 0 && this.task.institution.id == null) {
+              if (value == 0 && this.task.institution == 0) {
                 callback(new Error('定向发布至少要选择一个测评机构'))
               } else {
                 callback()
@@ -551,10 +534,12 @@ export default {
       }
     },
     init() {
+      console.log(CONFIG)
+
       this.taskId = this.$route.params.taskId
       this.projectId = this.$route.params.projectId
       this.setUserInfo()
-      this.setServiceType()
+      // this.setServiceType()
       //this.loadData(this.projectId, this.taskId)
       this.getTaskDetail()
       this.getWordCloud()
@@ -576,7 +561,9 @@ export default {
 
     //切换至可编辑页面
     modifyForm() {
-      // this.task.serviceType = ''
+      // this.task.serviceType = '
+      this.setServiceType()
+      this.setInstitutions();
       this.isModifyMode = true
     },
     //切换至不可编辑页面
@@ -592,7 +579,7 @@ export default {
       this.task.type = ''
       this.task.resource = '2' //如果是广场不用管Location和institution ,定向看institution,区域看location
       this.task.location = {provinceCode: '', cityCode: ''}
-      this.task.institution = ''
+      this.task.institution = 0
       this.task.datetime = ''
       this.task.participantCount = 1
       // this.task.endPointVO.caseId = ''
@@ -642,6 +629,14 @@ export default {
     getWordCloud() {
       getTaskWordCloud(this.projectId, this.taskId, this.getTaskCloudSuccess, this.getTaskCloudFail)
     },
+
+    //获取词云
+    getWordCloudByDescription() {
+      getTaskWordCloudByDescription(this.projectId, this.taskId, this.task.description, this.getTaskCloudSuccess, this.getTaskCloudFail)
+    },
+
+
+
     getTaskCloudSuccess(words) {
       this.wordCloud = words.data;
     },
@@ -653,6 +648,7 @@ export default {
     getTaskDetailSuccess(res) {
       this.hideLoading()
       // console.log(res)
+      this.task = res.crowdTaskVO
       this.taskId = res.crowdTaskVO.id
       this.projectId = res.crowdTaskVO.projectId
       this.task.code = res.crowdTaskVO.code
@@ -683,7 +679,7 @@ export default {
       this.crowdReportUrl = res.crowdTaskVO.writeReportUrl;
       this.handleFormatReport(this.acceptedUserList);
       this.handleTestTypeChange(res.crowdTaskVO.serviceType);
-      this.serviceName = this.getServiceByCode(res.crowdTaskVO.serviceType);
+      // this.serviceName = this.getServiceByCode(res.crowdTaskVO.serviceType);
       if (res.crowdTaskVO.endPointVO) {
         if (res.crowdTaskVO.endPointVO.token) {
           this.shortLink = res.crowdTaskVO.endPointVO.token;
@@ -692,6 +688,7 @@ export default {
           this.editShortLink = true
         }
       }
+      // this.wordCloud = res.wordCloudList;
       // console.log(res.crowdTaskVO.endPointVO.token)
       // console.log(this.editShortLink)
       // console.log(this.isModifyMode)
@@ -742,10 +739,10 @@ export default {
           const newTask = {
             name: this.task.title,
             desc: this.task.description,
-            type: this.task.serviceType,
+            type: this.serviceType.filter(type => type.name === this.task.serviceType)[0].code,
             resource: this.task.resource,
             location: this.task.location == null ? {} : getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode),
-            institution: this.task.institution ? this.task.institution.id : null,
+            institution: this.task.institution ? this.task.institution : null,
             datetime: this.task.datetime,
             quotePrice: this.task.quotePrice,
             fixedPrice: this.task.fixedPrice,
@@ -764,6 +761,8 @@ export default {
     //更新任务信息成功时回调函数
     updateTaskSuccess(res) {
       this.cancelMode()
+      this.task = res.crowdTaskVO
+      this.taskOperationControl = res.taskOperationControl
       this.taskId = res.crowdTaskVO.id
       this.projectId = res.crowdTaskVO.projectId
       this.task.projectId = res.crowdTaskVO.projectId
@@ -781,8 +780,8 @@ export default {
       this.task.fixedPrice = res.crowdTaskVO.fixedPrice
       // this.task.endPointVO = res.crowdTaskVO.endPointVO
       this.task.doc = []
-      this.task.requireDocUrl = res.crowdTaskVO.requirementFile,
-        this.task.participantCount = res.crowdTaskVO.participantCount
+      this.task.requireDocUrl = res.crowdTaskVO.requirementFile
+      this.task.participantCount = res.crowdTaskVO.participantCount
       this.task.endPoint = res.crowdTaskVO.endPointVO ? res.crowdTaskVO.endPointVO : {
         serverCode: '',
       }
@@ -792,8 +791,9 @@ export default {
       this.acceptedUserList = res.acceptedUserList
       this.handleTestTypeChange(res.crowdTaskVO.serviceType);
       this.serviceName = this.getServiceByCode(res.crowdTaskVO.serviceType)
-      this.getWordCloud()
+      this.getWordCloudByDescription()
       this.hideLoading()
+
       notify('success', '修改成功')
     },
     //更新任务信息失败时回调函数
@@ -862,12 +862,14 @@ export default {
     //接收任务成功时的回调函数
     receiveTaskSuccess(res) {
       this.hideLoading()
-      this.getTaskDetail();
+      // this.getTaskDetail();
       notify('success', '接收任务成功')
+      this.getTaskDetailSuccess(res);
       // console.log(res)
-      this.taskOperationControl = res.taskOperationControl
-      this.task.status = res.crowdTaskVO.status
-      this.task.institution = res.crowdTaskVO.institution
+      // this.taskOperationControl = res.taskOperationControl
+      // this.task.status = res.crowdTaskVO.status
+      // this.task.institution = res.crowdTaskVO.institution
+      // this.task = res.crowdTaskVO
     },
     //接收任务失败时的回调函数
     receiveTaskFail(error) {
@@ -935,12 +937,13 @@ export default {
     //提交结束任务申请成功时的回调函数
     submitTaskRequestSuccess(res) {
       this.hideLoading()
-      console.log(res)
-      this.taskOperationControl = res.taskOperationControl
-      this.task.status = res.crowdTaskVO.status
-      this.task.institution = res.crowdTaskVO.institution
+      // this.task = res.crowdTaskVO
+      // this.taskOperationControl = res.taskOperationControl
+      // this.task.status = res.crowdTaskVO.status
+      // this.task.institution = res.crowdTaskVO.institution
       notify('success', '提交任务成功,等待区域管理员审核')
-      this.getTaskDetail();
+      this.getTaskDetailSuccess(res);
+      // this.getTaskDetail();
     },
     //提交结束任务申请失败时的回调函数
     submitTaskRequestFail(error) {
@@ -963,12 +966,13 @@ export default {
     },
     //结束任务成功时的回调函数
     endTaskSuccess(res) {
-      this.hideLoading()
-      this.taskOperationControl = res.taskOperationControl
-      this.task.status = res.crowdTaskVO.status
-      this.task.institution = res.crowdTaskVO.institution
+      // this.taskOperationControl = res.taskOperationControl
+      // this.task.status = res.crowdTaskVO.status
+      // this.task.institution = res.crowdTaskVO.institution
       notify('success', '结束任务成功!')
-      this.getTaskDetail();
+      this.getTaskDetailSuccess(res);
+      this.hideLoading()
+      // this.getTaskDetail();
     },
     //结束任务失败时的回调函数
     endTaskFail(error) {

+ 2 - 3
src/components/task/TaskCreate.vue

@@ -96,7 +96,7 @@
           </el-upload>
           <span v-if="task.requireDocUrl != null && task.requireDocUrl != ''">
                 <a :href="task.requireDocUrl"><el-link :underline="false" type="primary"><i
-                  class="el-icon-document"></i>{{task.name}}的需求文档</el-link></a>
+                  class="el-icon-document"></i>下载文档</el-link></a>
               </span>
         </el-form-item>
         <el-form-item size="small" label="任务截止时间" prop="datetime">
@@ -284,7 +284,7 @@
         this.projectId = this.$route.params.projectId
         this.$route.params.code && this.initTask()
         this.setServiceType()
-        // this.setInstitutions()
+        this.setInstitutions()
         this.setUserInfo()
       },
       initTask(){
@@ -339,7 +339,6 @@
               endPoint: this.task.endPoint
             }
             Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), newTask).then((res) => {
-              console.log(res)
               this.hideLoading()
               this.createTaskSuccess(res.crowdTaskVO.id)
             }).catch((error) => {

+ 2 - 1
src/js/api.js

@@ -25,7 +25,8 @@ export default {
     END_TASK: '/api/project/{projectId}/task/{taskId}/status/finished',
     EXPORT_TASK: '/api/project/{projectId}/task/{taskId}/export',
     MORE_HOT_TASK: '/api/square/hotTasks/list',
-    GET_TASK_CLOUD:'/api/project/{projectId}/task/{taskId}/word'
+    GET_TASK_CLOUD:'/api/project/{projectId}/task/{taskId}/word',
+    GET_TASK_CLOUD_By_DESCRIPTION:'/api/project/{projectId}/task/{taskId}/word/{taskDescription}'
   },
   REPORT: {
     GET_TASK_REPORT: '/api/project/{projectId}/task/{taskId}/report/{reportId}/',

+ 4 - 2
src/js/index.js

@@ -41,7 +41,8 @@ import {
   rejectTask,
   submitTaskRequest,
   updateTask,
-  getTaskWordCloud
+  getTaskWordCloud,
+  getTaskWordCloudByDescription
 } from './taskService'
 import {
   createProjectReport,
@@ -158,7 +159,8 @@ export {
   submitTaskRequest,
   //区域管理员修改任务
   updateTask,
-  getTaskWordCloud
+  getTaskWordCloud,
+  getTaskWordCloudByDescription
 }
 export {
   /*******************************************************************************/

+ 0 - 3
src/js/projectService.js

@@ -26,11 +26,8 @@ export const deleteProject = (projectId, deleteProjectSuccess, deleteProjectFail
 
 //区域管理员提出接收项目申请
 export const receiveProjectRequest = (projectId, userId, receiveProjectSuccess, receiveProjectFail) => {
-  console.log('调用')
   Http.put(Apis.PROJECT.ACCEPT_PROJECT.replace('{projectId}', projectId).replace('{userId}', userId), {}).then((res) => {
-    console.log(res)
     receiveProjectSuccess(res)
-
   }).catch((error) => {
     console.log(error)
     receiveProjectFail(error)

+ 9 - 0
src/js/taskService.js

@@ -32,6 +32,15 @@ export const getTaskWordCloud = (projectId, taskId,getSuccess) => {
   })
 }
 
+//查看词云
+export const getTaskWordCloudByDescription = (projectId, taskId, taskDescription, getSuccess) => {
+  Http.get(Apis.TASK.GET_TASK_CLOUD_By_DESCRIPTION.replace('{projectId}', projectId).replace('{taskId}', taskId).replace('{taskDescription}', taskDescription), {}).then((res)=>{
+    getSuccess(res)
+  }).catch(err=>{
+    console.log(err)
+  })
+}
+
 //删除任务
 export const deleteTask = (projectId, taskId, deleteTaskSuccess, deleteTaskFail) => {
   Http.put(Apis.TASK.DELETE_TASK.replace('{projectId}', projectId).replace('taskId', taskId), {}).then((res) => {