소스 검색

重构task代码

sunjh 6 년 전
부모
커밋
9be81a405c
2개의 변경된 파일309개의 추가작업 그리고 213개의 파일을 삭제
  1. 256 205
      src/components/task/Task.vue
  2. 53 8
      src/js/index.js

+ 256 - 205
src/components/task/Task.vue

@@ -91,7 +91,8 @@
                 暂无文件
               </span>
               <span v-if="task.requireDocUrl != null">
-                <a :href="task.requireDocUrl"><el-link :underline="false" type="primary"><i class="el-icon-document"></i>下载文档</el-link></a>
+                <a :href="task.requireDocUrl"><el-link :underline="false" type="primary"><i
+                  class="el-icon-document"></i>下载文档</el-link></a>
               </span>
             </span>
         </el-form-item>
@@ -108,21 +109,22 @@
           <span v-if="!isModifyMode">{{task.datetime}}</span>
         </el-form-item>
         <el-form-item v-if="isModifyMode">
-          <div class="btn btn-small btn-info" @click="submitForm('task')">确认修改</div>
-          <div class="btn btn-small" @click="resetForm('task')">重置</div>
-          <div class="btn btn-small" @click="cancelMode('task')">取消</div>
+          <div class="btn btn-small btn-info" @click="updateTask()">确认修改</div>
+          <div class="btn btn-small" @click="resetForm()">重置</div>
+          <div class="btn btn-small" @click="cancelMode()">取消</div>
         </el-form-item>
         <el-form-item v-if="!isModifyMode">
           <div class="btn btn-small btn-info"
                v-if="taskOperationControl.confirmFinish"
                @click="submitTaskRequest()">确认结束
           </div>
-          <div class="btn btn-small btn-info" v-if="taskOperationControl.finish" @click="submitTaskRequest()">结束任务
+          <div class="btn btn-small btn-info" v-if="taskOperationControl.finish" @click="endTask()">结束任务
           </div>
-          <div class="btn btn-small btn-info" v-if="taskOperationControl.receive" @click="applyTask()">接收任务</div>
-          <div class="btn btn-small btn-danger" v-if="taskOperationControl.receive" @click="applyTask()">拒绝任务</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.receive" @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="createReport()">上传报告</div>
+          <div class="btn btn-small btn-info" v-if="taskOperationControl.uploadReport" @click="toCreateReport()">上传报告
+          </div>
           <div class="btn btn-small" @click="toProject()">前往项目</div>
         </el-form-item>
       </el-form>
@@ -142,11 +144,17 @@ import Http from '@/js/http.js'
 import Apis from '@/js/api.js'
 import {notify} from '@/constants/index'
 import {
+  endTaskRequest,
+  ensureEndTask,
   getAllAgencies,
   getAllServiceTypes,
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
-  storageGet
+  getTask,
+  receiveTaskRequest,
+  rejectTask,
+  storageGet,
+  updateTask
 } from '@/js/index'
 
 export default {
@@ -276,211 +284,146 @@ export default {
       this.projectId = this.$route.params.projectId
       this.setUserInfo()
       this.setServiceType()
-      console.log(this.serviceType)
-      this.loadData(this.projectId, this.taskId)
+      //this.loadData(this.projectId, this.taskId)
+      this.getTaskDetail()
       this.setInstitutions()
     },
-    updateLocation (location) {
-      console.log(location)
-      const loactionName = getProvinceNameByProvinceCode(location.provinceCode, location.cityCode)
-      // var provinceName = ''
-      // var cityName = ''
-      // for (var item of provinceCityJSON.provinces) {
-      //   if (item.code === location.provinceCode) {
-      //     provinceName = item.name
-      //     for (var city of item.cities) {
-      //       if (city.code === location.cityCode) {
-      //         cityName = city.name
-      //         break
-      //       }
-      //     }
-      //   }
-      // }
-      return loactionName.provinceCode + ' / ' + loactionName.cityCode
-    },
-    submitForm (formName) {
-      this.showLoading()
-      const newTask = {
-        name: this.task.title,
-        desc: this.task.description,
-        type: this.task.serviceType,
-        resource: this.task.resource,
-        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,
-        fixedPrice: this.task.fixedPrice,
-        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)
-        this.taskId = res.crowdTaskVO.id
-        this.projectId = res.crowdTaskVO.projectId
-        this.task.title = res.crowdTaskVO.title
-        this.task.description = res.crowdTaskVO.description
-        this.task.serviceType = res.crowdTaskVO.serviceType
-        this.task.resource = res.crowdTaskVO.resource
-        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
-        this.task.fixedPrice = res.crowdTaskVO.fixedPrice
-        this.task.doc = []
-        this.task.requireDocUrl = res.crowdTaskVO.requirementFile
 
-        this.reportList = res.crowdReportVOList
-        this.hideLoading()
-        notify('success', '修改成功')
-      }).catch((error) => {
-        notify('error', '修改失败:' + error.data)
-        this.hideLoading()
+    //跳转至项目详情页面
+    toProject () {
+      this.$router.push({
+        name: 'Project',
+        params: {projectId: this.projectId}
       })
-      // this.$refs[formName].validate(valid => {
-      //   if (valid) {
-      //     this.isModifyMode = false
-      //
-      //   } else {
-      //     console.log('error submit!!')
-      //     return false
-      //   }
-      // })
-    },
-    cancelMode (formName) {
-      this.isModifyMode = false
     },
+    //切换至可编辑页面
     modifyForm () {
       this.isModifyMode = true
     },
-    resetForm (formName) {
-      this.$refs.addFormProvince.resetProviceCity()
-      this.$refs[formName].resetFields()
+    //切换至不可编辑页面
+    cancelMode () {
+      this.isModifyMode = false
+    },
+    //重置表单
+    resetForm () {
       this.task.name = ''
       this.task.desc = ''
       this.task.quotePrice = ''
       this.task.fixedPrice = ''
       this.task.type = ''
-      this.task.resource = '2'; //如果是广场不用管Location和institution ,定向看institution,区域看location
-      (this.task.location = {provinceCode: '', cityCode: ''}),
-        (this.task.institution = '')
+      this.task.resource = '2' //如果是广场不用管Location和institution ,定向看institution,区域看location
+      this.task.location = {provinceCode: '', cityCode: ''}
+      this.task.institution = ''
       this.task.datetime = ''
     },
-    locationChange (provinceId, cityId) {
-      if (provinceId || cityId) {
-        this.task.location = {provinceCode: provinceId, cityCode: cityId}
-      }
+    //显示页面加载画面
+    showLoading () {
+      this.loading = true
     },
-    toProject () {
-      this.$router.push({
-        name: 'Project',
-        params: {projectId: this.projectId}
-      })
+    //隐藏页面加载画面
+    hideLoading () {
+      this.loading = false
     },
-    applyTask () {
-      const data = {
-        userId: this.user.userVO.id,
-        projectId: this.projectId,
-        taskId: this.taskId
-      }
-      Http.put(Apis.USER.ACCEPT_TASK.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{userId}', this.user.userVO.id), data).then((res) => {
-        console.log(res)
-        this.taskOperationControl = res.taskOperationControl;
-        this.task.status = res.crowdTaskVO.status;
-        this.institution = res.crowdTaskVO.institution;
-      })
+    //加载用户信息
+    setUserInfo () {
+      this.user = storageGet('user')
+      this.rolesPermissions = storageGet('rolesPermissions')
     },
-    submitTaskRequest () {
-      const data = {
-        userId: this.user.userVO.id,
-        projectId: this.projectId,
-        taskId: this.taskId
-      }
-      Http.post(Apis.USER.SUBMIT_TASK_REQUEST, data).then((res) => {
-        console.log(res)
+    //加载任务的服务类型
+    setServiceType () {
+      getAllServiceTypes().then((res) => {
+        this.serviceType = res
+      }).catch((error) => {
+        notify('error', '加载任务类型失败')
       })
     },
-    createReport () {
-      this.$router.push({
-        name: 'ReportCreate',
-        params: {
-          scope: 1,
-          dependencyCode: this.taskId,
-          projectId: this.projectId,
-          taskId: this.taskId,
-        }
+    //加载所有的测评机构
+    setInstitutions () {
+      getAllAgencies().then((res) => {
+        this.institutionArray = res
+      }).catch((error) => {
+        notify('error', '获取机构列表失败')
       })
     },
-    loadData (projectId, taskId) {
+    //获取任务详情
+    getTaskDetail () {
       this.showLoading()
-      //replace('{taskId}', this.taskId)
-      Http.get(Apis.TASK.GET_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId)).then((res) => {
-        console.log(res.crowdTaskVO)
-        this.taskId = res.crowdTaskVO.id
-        this.projectId = res.crowdTaskVO.projectId
-        this.task.title = res.crowdTaskVO.title
-        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.institution = res.crowdTaskVO.institution
-        this.task.datetime = new Date(res.crowdTaskVO.datetime)
-        this.task.quotePrice = res.crowdTaskVO.quotePrice
-        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()
-      })
+      getTask(this.projectId, this.taskId, this.getTaskDetailSuccess, this.getTaskDetailFail)
     },
-    handleRemove (file, fileList) {
-      console.log(file, fileList)
-    },
-    handleExceed (files, fileList) {
-      this.$message.warning(
-        `当前限制选择 1 个文件,本次选择了 ${
-          files.length
-          } 个文件,共选择了 ${files.length + fileList.length} 个文件`
-      )
+    //获取任务详情成功时回调函数
+    getTaskDetailSuccess (res) {
+      this.hideLoading()
+      //console.log(res.crowdTaskVO)
+      this.taskId = res.crowdTaskVO.id
+      this.projectId = res.crowdTaskVO.projectId
+      this.task.title = res.crowdTaskVO.title
+      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.institution = res.crowdTaskVO.institution
+      this.task.datetime = new Date(res.crowdTaskVO.datetime)
+      this.task.quotePrice = res.crowdTaskVO.quotePrice
+      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
     },
-    beforeRemove (file, fileList) {
-      //return this.$confirm(`确定移除 ${file.name}?`)
+    //获取任务详情失败时回调函数
+    getTaskDetailFail (error) {
+      this.hideLoading()
+      notify('error', '获取任务详情失败:' + error.data)
     },
-    beforeFileUpload (file) {
-      console.log(file)
-      const isPDF = file.type === 'application/pdf'
-      const isDOC = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
-      const isEXCEL = file.type === 'application/vnd.ms-excel'
-      const isXLS = file.type === 'application/x-xls'
-      const isTXT = file.type === 'text/plain'
-      const isXLSX = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
-      //console.log(file)
-      if (!(isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX)) {
-        this.$message.error('上传文件只能是 PDF 、 DOC 、DOCX 、XLS、TXT、XLSX 格式!')
+    //更新任务信息
+    updateTask () {
+      this.showLoading()
+      const newTask = {
+        name: this.task.title,
+        desc: this.task.description,
+        type: this.task.serviceType,
+        resource: this.task.resource,
+        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,
+        fixedPrice: this.task.fixedPrice,
+        requirementFile: this.task.requireDocUrl
       }
-      return isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX
+      //console.log(newTask)
+      updateTask(this.projectId, this.taskId, newTask, this.updateTaskSuccess, this.updateTaskFail)
     },
-    uploadProjectCreateExcelFile (param) {
-      const formData = new FormData()
-      let config = {
-        //添加请求头
-        headers: {'Content-Type': 'multipart/form-data'},
-      }
-      formData.append('file', param.file)
-      Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, formData, config).then((res) => {
-        console.log('上传成功')
-        this.project.excelFileUrl = res.data
-        console.log(res.data)
-      })
+    //更新任务信息成功时回调函数
+    updateTaskSuccess (res) {
+      this.cancelMode()
+      this.taskId = res.crowdTaskVO.id
+      this.projectId = res.crowdTaskVO.projectId
+      this.task.title = res.crowdTaskVO.title
+      this.task.description = res.crowdTaskVO.description
+      this.task.serviceType = res.crowdTaskVO.serviceType
+      this.task.resource = res.crowdTaskVO.resource
+      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
+      this.task.fixedPrice = res.crowdTaskVO.fixedPrice
+      this.task.doc = []
+      this.task.requireDocUrl = res.crowdTaskVO.requirementFile
+      this.reportList = res.crowdReportVOList
+      this.hideLoading()
+      notify('success', '修改成功')
     },
+    //更新任务信息失败时回调函数
+    updateTaskFail (error) {
+      notify('error', '修改失败:' + error.data)
+      this.hideLoading()
+    },
+    //上传任务需求文档
     uploadRequireDoc (param) {
       const formData = new FormData()
       let config = {
@@ -494,35 +437,143 @@ export default {
         console.log(res.data)
       })
     },
-    setServiceType () {
-      getAllServiceTypes().then((res) => {
-        this.serviceType = res
-      }).catch((error) => {
-        notify('error', '加载任务类型失败')
-      })
+    //上传任务需求文档成功时回调函数
+
+    //上传任务需求文档失败时回调函数
+
+    //文档上传前响应函数
+
+    //移除文档前的响应函数
+    beforeRemove (file, fileList) {
+      //return this.$confirm(`确定移除 ${file.name}?`)
     },
-    setInstitutions () {
-      getAllAgencies().then((res) => {
-        this.institutionArray = res
-      }).catch((error) => {
-        notify('error', '获取机构列表失败')
-      })
+    //移除文档时的响应函数
+    handleRemove (file, fileList) {
+      console.log(file, fileList)
     },
-    setUserInfo () {
-      this.user = storageGet('user')
-      this.rolesPermissions = storageGet('rolesPermissions')
+    //需求文档添加进来时的响应函数
+    handleExceed (files, fileList) {
+      this.$message.warning(
+        `当前限制选择 1 个文件,本次选择了 ${
+          files.length
+          } 个文件,共选择了 ${files.length + fileList.length} 个文件`
+      )
     },
-    showLoading () {
-      this.loading = true
+    //接收任务
+    receiveTask () {
+      this.showLoading()
+      receiveTaskRequest(this.projectId, this.taskId, this.user.userVO.id, this.receiveTaskSuccess, this.receiveTaskFail)
+    },
+    //接收任务成功时的回调函数
+    receiveTaskSuccess (res) {
+      this.hideLoading()
+      console.log(res)
+      this.taskOperationControl = res.taskOperationControl
+      this.task.status = res.crowdTaskVO.status
+      this.institution = res.crowdTaskVO.institution
+    },
+    //接收任务失败时的回调函数
+    receiveTaskFail (error) {
+      this.hideLoading()
+      notify('error', '接收任务失败:' + error.data)
+    },
+    //拒绝任务
+    rejectTask () {
+      rejectTask(this.rejectTaskSuccess, this.rejectTaskFail)
+    },
+    //拒绝任务成功时的回调函数
+    rejectTaskSuccess (res) {
+      this.hideLoading()
+    },
+    //拒绝任务失败时的回调函数
+    rejectTaskFail (error) {
+      this.hideLoading()
+      notify('error', '拒绝任务失败:' + error.data)
+    },
+    //提交结束任务申请
+    submitTaskRequest () {
+      endTaskRequest(this.submitTaskRequestSuccess, this.submitTaskRequestFail)
+    },
+    //提交结束任务申请成功时的回调函数
+    submitTaskRequestSuccess (res) {
+      this.hideLoading()
+      console.log(res)
+      this.taskOperationControl = res.taskOperationControl
+      this.task.status = res.crowdTaskVO.status
+      this.institution = res.crowdTaskVO.institution
+    },
+    //提交结束任务申请失败时的回调函数
+    submitTaskRequestFail (error) {
+      this.hideLoading()
+      notify('error', '提交任务失败:' + error.data)
+    },
+    //结束任务
+    endTask () {
+      ensureEndTask(this.endTaskSuccess, this.endTaskFail)
+    },
+    //结束任务成功时的回调函数
+    endTaskSuccess (res) {
+      this.hideLoading()
+    },
+    //结束任务失败时的回调函数
+    endTaskFail (error) {
+      this.hideLoading()
+      notify('error', '结束任务失败:' + error.data)
+    },
+    //跳转到创建项目报告页面
+    toCreateReport () {
+      this.$router.push({
+        name: 'ReportCreate',
+        params: {
+          scope: 1,
+          dependencyCode: this.taskId,
+          projectId: this.projectId,
+          taskId: this.taskId,
+        }
+      })
     },
-    hideLoading () {
-      this.loading = false
-    }
   },
   // created () {
   //   this.loadData()
   // }
 }
+//垃圾站
+//
+// updateLocation (location) {
+//   console.log(location)
+//   const loactionName = getProvinceNameByProvinceCode(location.provinceCode, location.cityCode)
+//   // var provinceName = ''
+//   // var cityName = ''
+//   // for (var item of provinceCityJSON.provinces) {
+//   //   if (item.code === location.provinceCode) {
+//   //     provinceName = item.name
+//   //     for (var city of item.cities) {
+//   //       if (city.code === location.cityCode) {
+//   //         cityName = city.name
+//   //         break
+//   //       }
+//   //     }
+//   //   }
+//   // }
+//   return loactionName.provinceCode + ' / ' + loactionName.cityCode
+// },
+//
+// locationChange (provinceId, cityId) {
+//   if (provinceId || cityId) {
+//     this.task.location = {provinceCode: provinceId, cityCode: cityId}
+//   }
+// },
+// submitForm (formName) {
+// this.$refs[formName].validate(valid => {
+//   if (valid) {
+//     this.isModifyMode = false
+//
+//   } else {
+//     console.log('error submit!!')
+//     return false
+//   }
+// })
+// },
 </script>
 
 <style lang="less" scoped>

+ 53 - 8
src/js/index.js

@@ -164,13 +164,21 @@ export const createTask = (projectId, task) => {
 }
 
 //修改任务
-export const updateTask = (projectId, taskId, task) => {
-  return Http.put(Apis.TASK.UPDATE_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), task)
+export const updateTask = (projectId, taskId, task, updateTaskSuccess, updateTaskFail) => {
+  Http.put(Apis.TASK.UPDATE_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), task).then((res) => {
+    updateTaskSuccess(res)
+  }).catch((error) => {
+    updateTaskFail(error)
+  })
 }
 
 //查看任务
-export const getTask = (projectId, taskId) => {
-  return Http.get(Apis.TASK.GET_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId))
+export const getTask = (projectId, taskId, getTaskSuccess, getTaskFail) => {
+  Http.get(Apis.TASK.GET_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId)).then((res) => {
+    getTaskSuccess(res)
+  }).catch((error) => {
+    getTaskFail(error)
+  })
 }
 
 //删除任务
@@ -179,18 +187,55 @@ export const udeleteTask = () => {
 }
 
 //测评机构申请任务
-export const receiveTaskRequest = () => {
+export const receiveTaskRequest = (projectId, taskId, userId, receiveTaskRequestSuccess, receiveTaskRequestFail) => {
+  Http.put(Apis.USER.ACCEPT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId).replace('{userId}', userId)).then((res) => {
+    receiveTaskRequestSuccess(res)
+  }).catch((error) => {
+    receiveTaskRequestFail(error)
+  })
 
 }
 
 //测评机构提出结束任务申请
-export const endTaskRequest = () => {
+export const endTaskRequest = (endTaskRequestSuccess, endTaskRequestFail) => {
+  const data = {
+    userId: this.user.userVO.id,
+    projectId: this.projectId,
+    taskId: this.taskId
+  }
+  Http.post(Apis.USER.SUBMIT_TASK_REQUEST, data).then((res) => {
+    endTaskRequestSuccess(res)
+  }).catch((error) => {
+    endTaskRequestFail(error)
+  })
+}
 
+export const rejectTask = (rejectTaskSuccess, rejectTaskFail) => {
+  const data = {
+    userId: this.user.userVO.id,
+    projectId: this.projectId,
+    taskId: this.taskId
+  }
+  Http.post(Apis.USER.SUBMIT_TASK_REQUEST, data).then((res) => {
+    rejectTaskSuccess(res)
+  }).catch((error) => {
+    rejectTaskFail(error)
+  })
 }
 
-//区域管理员确认结束任务
-export const ensureEndTask = () => {
 
+//区域管理员确认结束任务
+export const ensureEndTask = (endTaskSuccess, endTaskFail) => {
+  const data = {
+    userId: this.user.userVO.id,
+    projectId: this.projectId,
+    taskId: this.taskId
+  }
+  Http.post(Apis.USER.SUBMIT_TASK_REQUEST, data).then((res) => {
+    endTaskSuccess(res)
+  }).catch((error) => {
+    endTaskFail(error)
+  })
 }
 
 //创建项目报告