|
|
@ -115,8 +115,8 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="score" label="分数" align="center"> |
|
|
|
<el-table-column prop="score" label="分数" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!--type="number"--> |
|
|
|
<!--type="number" @blur="updateProjectJudgment"--> |
|
|
|
<el-input :disabled="isDetail" v-model.trim="scope.row.score" @blur="updateProjectJudgment" @input="scoreChange(scope.row, scope.$index,$event)"></el-input> |
|
|
|
<el-input :disabled="isDetail" v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index,$event)"></el-input> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -398,6 +398,19 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
this.setSystemId(this.projectManage.systemId); |
|
|
|
this.setSystemId(this.projectManage.systemId); |
|
|
|
this.projectManage.state = state; |
|
|
|
this.projectManage.state = state; |
|
|
|
|
|
|
|
let { systemId } = this.projectManage; |
|
|
|
|
|
|
|
if (this.projectId) { |
|
|
|
|
|
|
|
if (systemId == 2 || systemId == 3) { |
|
|
|
|
|
|
|
console.log("系统id:", systemId); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 更新 |
|
|
|
|
|
|
|
this.updateProjectJudgment(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (systemId == 2 || systemId == 3) { |
|
|
|
|
|
|
|
console.log("系统id:", systemId); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 添加 |
|
|
|
let tempArr = this.projectJudgmentData.map(i => { |
|
|
|
let tempArr = this.projectJudgmentData.map(i => { |
|
|
|
let obj = { |
|
|
|
let obj = { |
|
|
|
projectId: this.projectId ? this.projectId : "", |
|
|
|
projectId: this.projectId ? this.projectId : "", |
|
|
@ -412,20 +425,6 @@ export default { |
|
|
|
projectManage: this.projectManage, |
|
|
|
projectManage: this.projectManage, |
|
|
|
projectJudgmentList: tempArr |
|
|
|
projectJudgmentList: tempArr |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
let { systemId } = this.projectManage; |
|
|
|
|
|
|
|
if (this.projectId) { |
|
|
|
|
|
|
|
if (systemId == 2 || systemId == 3) { |
|
|
|
|
|
|
|
console.log("系统id:", systemId); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 更新 |
|
|
|
|
|
|
|
this.updateProject(params); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (systemId == 2 || systemId == 3) { |
|
|
|
|
|
|
|
console.log("系统id:", systemId); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 添加 |
|
|
|
|
|
|
|
this.addProject(params); |
|
|
|
this.addProject(params); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -464,7 +463,7 @@ export default { |
|
|
|
item.score = res.data[index]; |
|
|
|
item.score = res.data[index]; |
|
|
|
return item; |
|
|
|
return item; |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.updateProjectJudgment(); |
|
|
|
// this.updateProjectJudgment(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -486,11 +485,7 @@ export default { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
if (this.projectId) { |
|
|
|
|
|
|
|
this.deleteProjectJudgment([this.projectJudgmentData[index].id]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.projectJudgmentData.splice(index, 1); |
|
|
|
this.projectJudgmentData.splice(index, 1); |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -502,18 +497,12 @@ export default { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
// this.projectJudgmentData.splice(index, 1); |
|
|
|
|
|
|
|
if (this.projectId) {// 编辑项目的时候 |
|
|
|
|
|
|
|
let param = this.selectedProjectJudgment.map(e => e.id); |
|
|
|
|
|
|
|
this.deleteProjectJudgment(param);// 调删除接口 |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
let list = this.projectJudgmentData; |
|
|
|
let list = this.projectJudgmentData; |
|
|
|
let result = []; |
|
|
|
let result = []; |
|
|
|
list.map(i => { |
|
|
|
list.map(i => { |
|
|
|
this.selectedProjectJudgment.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
this.selectedProjectJudgment.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.projectJudgmentData = result; |
|
|
|
this.projectJudgmentData = result; |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -587,10 +576,6 @@ export default { |
|
|
|
if (this.selectedJudgment.length) { |
|
|
|
if (this.selectedJudgment.length) { |
|
|
|
// console.log(this.selectedJudgment, "queren"); |
|
|
|
// console.log(this.selectedJudgment, "queren"); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.dialogVisible = false; |
|
|
|
if (this.projectId) { // 编辑的时候,新增调接口 |
|
|
|
|
|
|
|
this.addProjectJudgment(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 新增时,假添加 |
|
|
|
|
|
|
|
let tempArr = this.selectedJudgment.map(i => { |
|
|
|
let tempArr = this.selectedJudgment.map(i => { |
|
|
|
i.score = 0; |
|
|
|
i.score = 0; |
|
|
|
return i; |
|
|
|
return i; |
|
|
@ -602,7 +587,6 @@ export default { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.projectJudgementTable.clearSelection(); |
|
|
|
this.$refs.projectJudgementTable.clearSelection(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
util.warningMsg("请选择判分点"); |
|
|
|
util.warningMsg("请选择判分点"); |
|
|
|
} |
|
|
|
} |
|
|
@ -662,48 +646,22 @@ export default { |
|
|
|
// 指定父元素下可被拖拽的子元素 |
|
|
|
// 指定父元素下可被拖拽的子元素 |
|
|
|
draggable: ".draggable .el-table__row", |
|
|
|
draggable: ".draggable .el-table__row", |
|
|
|
onEnd({ newIndex, oldIndex }) { |
|
|
|
onEnd({ newIndex, oldIndex }) { |
|
|
|
let newItem = _this.projectJudgmentData[newIndex]; |
|
|
|
_this.projectJudgmentData.splice(newIndex, 0, _this.projectJudgmentData.splice(oldIndex, 1)[0]); |
|
|
|
_this.projectJudgmentData[newIndex] = _this.projectJudgmentData[oldIndex]; |
|
|
|
let newArray = _this.projectJudgmentData.slice(0); |
|
|
|
_this.projectJudgmentData[oldIndex] = newItem; |
|
|
|
_this.projectJudgmentData = []; |
|
|
|
// 循环,重新赋值排序赋值 |
|
|
|
_this.$nextTick(function () { |
|
|
|
_this.projectJudgmentData.forEach((e, i) => { |
|
|
|
newArray.forEach((e, i) => { |
|
|
|
_this.$set(e, "sort", i + 1);// 不更新 |
|
|
|
_this.$set(e, "sort", i + 1);// 不更新 |
|
|
|
_this.$set(e, "name", e.name + "?"); |
|
|
|
_this.$set(e, "name", e.name + "?"); |
|
|
|
_this.$set(e, "name", e.name.slice(0, e.name.length - 1)); // 不更新的解决方案 |
|
|
|
_this.$set(e, "name", e.name.slice(0, e.name.length - 1)); // 不更新的解决方案 |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 调修改接口,更新列表 |
|
|
|
_this.projectJudgmentData = newArray; |
|
|
|
if (_this.projectId) {// 如果是编辑项目,则调编辑接口 |
|
|
|
|
|
|
|
_this.updateProjectJudgment(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 添加判分点中间表 |
|
|
|
|
|
|
|
addProjectJudgment() { |
|
|
|
|
|
|
|
let param = this.selectedJudgment.map((e, i) => { |
|
|
|
|
|
|
|
let obj = { |
|
|
|
|
|
|
|
judgmentId: e.judgmentId, |
|
|
|
|
|
|
|
projectId: this.projectId || "", |
|
|
|
|
|
|
|
score: 0, |
|
|
|
|
|
|
|
sort: i + 1 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
return obj; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// console.log(param, "param", this.projectId); |
|
|
|
|
|
|
|
this.$post(this.api.addProjectJudgment, param).then(res => { |
|
|
|
|
|
|
|
// 重新调接口 |
|
|
|
|
|
|
|
// console.log("添加成功", res); |
|
|
|
|
|
|
|
if (this.projectId) { // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
|
|
|
this.listAgain(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
console.log(err); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 修改判分点中间表 |
|
|
|
// 修改判分点中间表 |
|
|
|
updateProjectJudgment() { |
|
|
|
async updateProjectJudgment() { |
|
|
|
// 直接传data回去 |
|
|
|
|
|
|
|
let param = this.projectJudgmentData.map((e, i) => { |
|
|
|
let param = this.projectJudgmentData.map((e, i) => { |
|
|
|
let obj = { |
|
|
|
let obj = { |
|
|
|
judgmentId: e.judgmentId, |
|
|
|
judgmentId: e.judgmentId, |
|
|
@ -714,46 +672,25 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
return obj; |
|
|
|
return obj; |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.$post(this.api.updateProjectJudgment, param).then(res => { |
|
|
|
await this.$post(this.api.updateProjectJudgment, param).then(res => { |
|
|
|
// 重新调接口 |
|
|
|
let tempArr = this.projectJudgmentData.map(i => { |
|
|
|
if (this.projectId) { // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
let obj = { |
|
|
|
this.listAgain(); |
|
|
|
projectId: this.projectId ? this.projectId : "", |
|
|
|
} |
|
|
|
judgmentId: i.judgmentId, |
|
|
|
}).catch(err => { |
|
|
|
score: i.score, |
|
|
|
console.log(err); |
|
|
|
sort: i.sort |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
return obj; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
let params = { |
|
|
|
// 批量删除判分点中间表 |
|
|
|
projectManage: this.projectManage, |
|
|
|
deleteProjectJudgment(values) { |
|
|
|
projectJudgmentList: tempArr |
|
|
|
if (values && values.length > 0) { |
|
|
|
}; |
|
|
|
this.$post(this.api.deleteProjectJudgment + "?projectJudgmentIds=" + `${values}`).then(res => { |
|
|
|
this.updateProject(params); |
|
|
|
// 重新调接口 |
|
|
|
|
|
|
|
if (this.projectId) { // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
|
|
|
this.listAgain(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 重新调接口,专门赋值列表 |
|
|
|
|
|
|
|
listAgain() { |
|
|
|
|
|
|
|
this.listLoading = true |
|
|
|
|
|
|
|
let scrollTop = this.$refs.main.scrollTop |
|
|
|
|
|
|
|
this.projectJudgmentData = [] |
|
|
|
|
|
|
|
this.$refs.main.scrollTop = scrollTop |
|
|
|
|
|
|
|
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => { |
|
|
|
|
|
|
|
let { projectManage, projectJudgmentVos } = res; |
|
|
|
|
|
|
|
projectJudgmentVos.map((e,i)=>{ |
|
|
|
|
|
|
|
this.$set(e,'sort',i+1)// 不更新 |
|
|
|
|
|
|
|
this.$set(e,'name',e.name+"?") |
|
|
|
|
|
|
|
this.$set(e,'name',e.name.slice(0,e.name.length-1)) // 不更新的解决方案 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.projectJudgmentData = projectJudgmentVos; |
|
|
|
|
|
|
|
this.listLoading = false |
|
|
|
|
|
|
|
}).catch(()=>{ |
|
|
|
|
|
|
|
this.listLoading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|