|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="create-container">
|
|
<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 :model="report" :rules="rules" ref="report" label-width="12%" class="demo-report">
|
|
|
<el-form-item label="报告名称" prop="name">
|
|
<el-form-item label="报告名称" prop="name">
|
|
|
<el-input v-if="isModifyMode" v-model="report.name"></el-input>
|
|
<el-input v-if="isModifyMode" v-model="report.name"></el-input>
|
|
@@ -95,6 +95,7 @@ export default {
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
user: {},
|
|
user: {},
|
|
|
|
|
+ loading: false,
|
|
|
reportId: 0,
|
|
reportId: 0,
|
|
|
projectId: '',
|
|
projectId: '',
|
|
|
taskId: '',
|
|
taskId: '',
|
|
@@ -163,17 +164,17 @@ export default {
|
|
|
if (this.taskId == null) {
|
|
if (this.taskId == null) {
|
|
|
Http.put(Apis.REPORT.UPDATE_PROJECT_REPORT.replace('{projectId}', this.projectId).replace('{reportId}', this.reportId), newReport).then((res) => {
|
|
Http.put(Apis.REPORT.UPDATE_PROJECT_REPORT.replace('{projectId}', this.projectId).replace('{reportId}', this.reportId), newReport).then((res) => {
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
- notify('success','修改成功')
|
|
|
|
|
|
|
+ notify('success', '修改成功')
|
|
|
this.isModifyMode = false
|
|
this.isModifyMode = false
|
|
|
- }).catch((error)=>{
|
|
|
|
|
- notify('error',error.data)
|
|
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ notify('error', error.data)
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
Http.put(Apis.REPORT.UPDATE_TASK_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId), newReport).then((res) => {
|
|
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)
|
|
console.log(res)
|
|
|
this.isModifyMode = false
|
|
this.isModifyMode = false
|
|
|
- }).catch((error)=>{
|
|
|
|
|
- notify('error',error.data)
|
|
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ notify('error', error.data)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
// this.$refs[formName].validate(valid => {
|
|
// this.$refs[formName].validate(valid => {
|
|
@@ -239,14 +240,10 @@ export default {
|
|
|
//pro1564487183259
|
|
//pro1564487183259
|
|
|
//pro1564487183259_task1564487274060
|
|
//pro1564487183259_task1564487274060
|
|
|
//pro1564487183259pro1564487183259_task1564487274060_rep1564488510500
|
|
//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) {
|
|
if (this.taskId == null) {
|
|
|
Http.get(Apis.REPORT.GET_PROJECT_REPORT.replace('{projectId}', this.projectId).replace('{reportId}', this.reportId)).then((res) => {
|
|
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.name = res.crowdReportVO.name
|
|
|
this.report.crowdTestTaskId = res.crowdReportVO.crowdTestTaskId
|
|
this.report.crowdTestTaskId = res.crowdReportVO.crowdTestTaskId
|
|
|
this.report.scope = res.crowdReportVO.scope
|
|
this.report.scope = res.crowdReportVO.scope
|
|
@@ -256,6 +253,10 @@ export default {
|
|
|
this.report.fileUrl = res.crowdReportVO.file
|
|
this.report.fileUrl = res.crowdReportVO.file
|
|
|
this.report.conclusion = res.crowdReportVO.conclusion
|
|
this.report.conclusion = res.crowdReportVO.conclusion
|
|
|
this.report.target = res.crowdReportVO.target
|
|
this.report.target = res.crowdReportVO.target
|
|
|
|
|
+ this.hideLoading()
|
|
|
|
|
+ notify('success', '修改成功')
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ notify('error', '修改失败:' + error.data)
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
Http.get(Apis.REPORT.GET_TASK_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId)).then((res) => {
|
|
Http.get(Apis.REPORT.GET_TASK_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId)).then((res) => {
|
|
@@ -269,6 +270,10 @@ export default {
|
|
|
this.report.fileUrl = res.crowdReportVO.file
|
|
this.report.fileUrl = res.crowdReportVO.file
|
|
|
this.report.conclusion = res.crowdReportVO.conclusion
|
|
this.report.conclusion = res.crowdReportVO.conclusion
|
|
|
this.report.target = res.crowdReportVO.target
|
|
this.report.target = res.crowdReportVO.target
|
|
|
|
|
+ this.hideLoading()
|
|
|
|
|
+ notify('success', '修改成功')
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ notify('error', '修改失败:' + error.data)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -286,22 +291,28 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
setReportType () {
|
|
setReportType () {
|
|
|
- getAllReportTypes().then((res)=>{
|
|
|
|
|
|
|
+ getAllReportTypes().then((res) => {
|
|
|
this.reportType = res
|
|
this.reportType = res
|
|
|
- }).catch((error)=>{
|
|
|
|
|
- notify('error','加载报告类型失败')
|
|
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ notify('error', '加载报告类型失败')
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
setUserInfo () {
|
|
setUserInfo () {
|
|
|
this.user = storageGet('user')
|
|
this.user = storageGet('user')
|
|
|
},
|
|
},
|
|
|
- updateReportSuccess(){
|
|
|
|
|
|
|
+ updateReportSuccess () {
|
|
|
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ showLoading () {
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ },
|
|
|
|
|
+ hideLoading () {
|
|
|
|
|
+ this.loading = false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- watch:{
|
|
|
|
|
|
|
+ watch: {
|
|
|
reportType (val) {
|
|
reportType (val) {
|
|
|
- this.reportType =val
|
|
|
|
|
|
|
+ this.reportType = val
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|