|
@@ -106,7 +106,7 @@ import '@/styles/PublicStyle/index.scss' // 公共css
|
|
|
import searchTeam from '@/components/select/searchTeam' // 人员搜索
|
|
|
import normalArea from '@/components/input/normalArea' // 富文本
|
|
|
import 'tinymce/plugins/table'// 插入表格插件
|
|
|
-import { taskList as allTaskList } from '@/api/taskIndex'
|
|
|
+import { taskList } from '@/api/taskIndex'
|
|
|
import iconDisplay from '@/views/reportManagement/ReleaseReport/components/iconDisplay.vue'
|
|
|
import { settingAddReportModule, settingUpdateReportModule, settingGetReportModuleById, reportreleaseInitReportRelease, reportreleaseCreate, reportreleaseUpdate, reportreleaseGetReportById } from '@/api/reportTemplate' // 模版添删改查
|
|
|
import { getContainImgHTMLNode } from '@/utils/handleTinymce' // 富文本本图片转换
|
|
@@ -130,7 +130,8 @@ export default {
|
|
|
from: {}, // from-date
|
|
|
tasksOptions: [], // 关联任务
|
|
|
tasksDetailList: [], // 关联任务
|
|
|
- taskid_arr: [],
|
|
|
+ selectTask: false,
|
|
|
+ judge: false,
|
|
|
fromData: {},
|
|
|
modelID: '',
|
|
|
releaseType: false, // 新建模版还是新建准出报告
|
|
@@ -163,9 +164,11 @@ export default {
|
|
|
taskIds: {
|
|
|
handler(newV) {
|
|
|
if (newV) {
|
|
|
- this.taskId = newV
|
|
|
- this.judge = true
|
|
|
- this.reportreleaseInitReportRelease()
|
|
|
+ newV.map(item => {
|
|
|
+ this.judge = true
|
|
|
+ this.remoteMethod(item)
|
|
|
+ })
|
|
|
+ this.reportreleaseInitReportRelease(newV)
|
|
|
}
|
|
|
},
|
|
|
immediate: true
|
|
@@ -176,15 +179,19 @@ export default {
|
|
|
const res = await reportreleaseGetReportById(val)
|
|
|
if (res.code === 200) {
|
|
|
this.$nextTick(() => {
|
|
|
- this.taskId = res.data.taskIds
|
|
|
+ const taskId = res.data.taskIds
|
|
|
+ taskId.map(item => {
|
|
|
+ this.judge = true
|
|
|
+ this.remoteMethod(item)
|
|
|
+ })
|
|
|
})
|
|
|
this.setDefaultData(res.data)
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- async reportreleaseInitReportRelease() { // 获取表单数据
|
|
|
+ async reportreleaseInitReportRelease(newV) { // 获取表单数据
|
|
|
if (!this.releaseType) {
|
|
|
- const res = await reportreleaseInitReportRelease({ taskIds: this.taskId })
|
|
|
+ const res = await reportreleaseInitReportRelease({ taskIds: newV })
|
|
|
if (res.code === 200) {
|
|
|
this.setDefaultData(res.data)
|
|
|
}
|
|
@@ -232,11 +239,12 @@ export default {
|
|
|
},
|
|
|
|
|
|
async remoteMethod(query) { // 远程搜索任务
|
|
|
- const res = await allTaskList({ bizId: Number(localStorage.getItem('bizId')), name: query })
|
|
|
+ const res = await taskList({ bizId: Number(localStorage.getItem('bizId')), name: query })
|
|
|
if (res.code === 200) {
|
|
|
this.tasksOptions = res.data
|
|
|
if (this.judge) {
|
|
|
- this.tasksDetailList.push(res.data)
|
|
|
+ this.tasksDetailList.push(res.data[0])
|
|
|
+ this.taskId.push(res.data[0].id)
|
|
|
this.judge = false
|
|
|
}
|
|
|
}
|
|
@@ -249,10 +257,24 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
this.tasksDetailList.push(data)
|
|
|
- this.taskid_arr.push(data.id)
|
|
|
+ this.taskId.push(data.id)
|
|
|
this.tasksDetailList.length <= 0 ? this.selectTask = true : this.selectTask = false
|
|
|
},
|
|
|
|
|
|
+ delete_task(val) { // 删除关联的任务
|
|
|
+ this.tasksDetailList = this.tasksDetailList.filter(item => {
|
|
|
+ return item.id !== val.id
|
|
|
+ })
|
|
|
+ this.taskId = this.taskId.filter(item => {
|
|
|
+ return item !== val.id
|
|
|
+ })
|
|
|
+ this.tasksDetailList.length <= 0 ? this.selectTask = true : this.selectTask = false
|
|
|
+ },
|
|
|
+
|
|
|
+ colseSelect() { // 清空任务名称
|
|
|
+ this.$set(this.from, 'taskIds', null)
|
|
|
+ },
|
|
|
+
|
|
|
// 创建准出报告
|
|
|
reportreleaseCreate(val) {
|
|
|
this.$refs.fromCreateData.validate(async(valid) => {
|
|
@@ -294,7 +316,11 @@ export default {
|
|
|
data.testActualTimeEnd = this.from.testActualTimeStart[1] // 实际测试结束时间
|
|
|
}
|
|
|
data.testResult = 1 // 测试结果 状态 1通过 2未通过
|
|
|
- data.taskIds = this.taskId // 关联任务
|
|
|
+ if (this.taskId[0]) {
|
|
|
+ data.taskIds = this.taskId // 关联任务
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
data.bizId = this.from.bizId // 业务线
|
|
|
data.moduleId = this.from.moduleId // 模块id
|
|
|
data.content = this.fromData.content // 富文本
|
|
@@ -334,7 +360,11 @@ export default {
|
|
|
data.testActualTimeStart = this.from.testActualTimeStart[0] // 实际测试开始时间
|
|
|
data.testActualTimeEnd = this.from.testActualTimeStart[1] // 实际测试结束时间
|
|
|
}
|
|
|
- data.taskIds = this.taskId // 关联任务
|
|
|
+ if (this.taskId[0]) {
|
|
|
+ data.taskIds = this.taskId // 关联任务
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
data.bizId = localStorage.getItem('bizId') // 业务线
|
|
|
data.moduleId = this.fromData.id // 模块id
|
|
|
data.content = this.fromData.content // 富文本
|
|
@@ -402,7 +432,7 @@ export default {
|
|
|
margin: 20px 0;
|
|
|
}
|
|
|
|
|
|
-.report-container {
|
|
|
+ .report-container {
|
|
|
display: inline-block;
|
|
|
font-size:14px;
|
|
|
width: 100%;
|
|
@@ -412,14 +442,14 @@ export default {
|
|
|
color:#666666;
|
|
|
opacity:1;
|
|
|
>>> .el-form-item__label {
|
|
|
- color: #333;
|
|
|
-}
|
|
|
->>> .el-date-editor .el-range-separator {
|
|
|
- padding: 0 5px;
|
|
|
- line-height: 26px;
|
|
|
- width: auto;
|
|
|
- color: #303133;
|
|
|
-}
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ >>> .el-date-editor .el-range-separator {
|
|
|
+ padding: 0 5px;
|
|
|
+ line-height: 26px;
|
|
|
+ width: auto;
|
|
|
+ color: #303133;
|
|
|
+ }
|
|
|
.from-name {
|
|
|
width: 140px !important;
|
|
|
}
|
|
@@ -434,12 +464,25 @@ export default {
|
|
|
margin-left: 30px;
|
|
|
color:rgba(126,211,33,1);
|
|
|
}
|
|
|
-}
|
|
|
-.sodu {
|
|
|
- color:#C0C4CC;
|
|
|
- margin-left: 15px;
|
|
|
-}
|
|
|
-
|
|
|
+ }
|
|
|
+ .report-taskList{
|
|
|
+ font-size:14px;
|
|
|
+ font-family:MicrosoftYaHei;
|
|
|
+ line-height:17px;
|
|
|
+ color:rgba(102,102,102,1);
|
|
|
+ margin-top: 10px;
|
|
|
+ opacity:1;
|
|
|
+ }
|
|
|
+ .sodu {
|
|
|
+ color:#C0C4CC;
|
|
|
+ margin-left: 15px;
|
|
|
+ }
|
|
|
+ .taskError {
|
|
|
+ color: #F56C6C;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 1;
|
|
|
+ padding-top: 4px;
|
|
|
+ }
|
|
|
.from-margin {
|
|
|
margin-bottom:20px;
|
|
|
}
|