|
|
|
@ -83,7 +83,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round @click="handleQueryJudgment" style="margin-bottom: 10px">判分点</el-button> |
|
|
|
|
<el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button> |
|
|
|
|
<div class="draggable" style="padding: 20px"> |
|
|
|
|
<div class="draggable"> |
|
|
|
|
<el-table |
|
|
|
|
ref="projectJudgementTable" |
|
|
|
|
:data="projectJudgmentData" |
|
|
|
@ -96,7 +96,7 @@ |
|
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="sort" label="序号" width="80" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.row.sort}} |
|
|
|
|
{{ scope.row.sort }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="判分指标" align="center"></el-table-column> |
|
|
|
@ -183,7 +183,8 @@ import Setting from "@/setting"; |
|
|
|
|
import util from "@/libs/util"; |
|
|
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
|
import quill from "@/components/quill"; |
|
|
|
|
import Sortable from 'sortablejs'; |
|
|
|
|
import Sortable from "sortablejs"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
quill |
|
|
|
@ -223,7 +224,7 @@ export default { |
|
|
|
|
|
|
|
|
|
searchTimer: null, |
|
|
|
|
isToPoint: false, // 判断是否是跳转到判分点系统 |
|
|
|
|
visibleLoading:false,// 加载弹框 |
|
|
|
|
visibleLoading: false// 加载弹框 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -243,7 +244,7 @@ export default { |
|
|
|
|
// util.warningMsg(res.message); |
|
|
|
|
util.errorMsg("分配的数值已超过100"); |
|
|
|
|
} |
|
|
|
|
console.log('chuli') |
|
|
|
|
console.log("chuli"); |
|
|
|
|
return score; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -263,7 +264,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.getSystemData(); |
|
|
|
|
console.log(this.projectManage.systemId, "this.projectManage.systemId", this.lastSystemId); |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
if (this.$route.query.projectId) { |
|
|
|
@ -276,7 +276,7 @@ export default { |
|
|
|
|
this.projectManage = projectManage; |
|
|
|
|
this.projectJudgmentData = projectJudgmentData; |
|
|
|
|
} |
|
|
|
|
this.rowDrop() |
|
|
|
|
this.rowDrop(); |
|
|
|
|
}, |
|
|
|
|
beforeDestroy() { |
|
|
|
|
if (!this.isToPoint) { |
|
|
|
@ -310,9 +310,9 @@ export default { |
|
|
|
|
let { projectManage, projectJudgmentVos } = res; |
|
|
|
|
this.projectManage = projectManage; |
|
|
|
|
this.projectJudgmentData = projectJudgmentVos; |
|
|
|
|
this.projectJudgmentData.forEach((e,i)=>{ |
|
|
|
|
e.sort = i+1 |
|
|
|
|
}) |
|
|
|
|
this.projectJudgmentData.forEach((e, i) => { |
|
|
|
|
e.sort = i + 1; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
util.warningMsg(res.message); |
|
|
|
|
} |
|
|
|
@ -344,7 +344,7 @@ export default { |
|
|
|
|
this.setSystemId(this.projectManage.systemId); |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.projectManage.systemId = this.lastSystemId; |
|
|
|
|
console.log(this.lastSystemId, "this.lastSystemId"); |
|
|
|
|
// console.log(this.lastSystemId, "this.lastSystemId"); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -401,7 +401,7 @@ export default { |
|
|
|
|
projectId: this.projectId ? this.projectId : "", |
|
|
|
|
judgmentId: i.judgmentId, |
|
|
|
|
score: i.score, |
|
|
|
|
sort:i.sort |
|
|
|
|
sort: i.sort |
|
|
|
|
}; |
|
|
|
|
return obj; |
|
|
|
|
}); |
|
|
|
@ -462,7 +462,7 @@ export default { |
|
|
|
|
item.score = res.data[index]; |
|
|
|
|
return item; |
|
|
|
|
}); |
|
|
|
|
this.updateProjectJudgment() |
|
|
|
|
this.updateProjectJudgment(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -477,16 +477,16 @@ export default { |
|
|
|
|
// let y = index + 2; |
|
|
|
|
// this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1])); |
|
|
|
|
// }, |
|
|
|
|
scoreChange(row, index,val) { // 暂时解决,输入分数,页面没有更新 |
|
|
|
|
scoreChange(row, index, val) { // 暂时解决,输入分数,页面没有更新 |
|
|
|
|
this.projectJudgmentData.splice(index, 1, row); |
|
|
|
|
}, |
|
|
|
|
delJudgePoint(index) { // 删除判分点 |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
if(this.projectId){ |
|
|
|
|
this.deleteProjectJudgment([this.projectJudgmentData[index].id]) |
|
|
|
|
}else{ |
|
|
|
|
if (this.projectId) { |
|
|
|
|
this.deleteProjectJudgment([this.projectJudgmentData[index].id]); |
|
|
|
|
} else { |
|
|
|
|
this.projectJudgmentData.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
@ -501,10 +501,10 @@ export default { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
// this.projectJudgmentData.splice(index, 1); |
|
|
|
|
if(this.projectId){// 编辑项目的时候 |
|
|
|
|
let param = this.selectedProjectJudgment.map(e=>e.id) |
|
|
|
|
this.deleteProjectJudgment(param)// 调删除接口 |
|
|
|
|
}else{ |
|
|
|
|
if (this.projectId) {// 编辑项目的时候 |
|
|
|
|
let param = this.selectedProjectJudgment.map(e => e.id); |
|
|
|
|
this.deleteProjectJudgment(param);// 调删除接口 |
|
|
|
|
} else { |
|
|
|
|
let list = this.projectJudgmentData; |
|
|
|
|
let result = []; |
|
|
|
|
list.map(i => { |
|
|
|
@ -543,7 +543,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getProcessClassData(params) { // 获取流程类判分点列表数据 |
|
|
|
|
this.visibleLoading = true |
|
|
|
|
this.visibleLoading = true; |
|
|
|
|
this.$post(`${this.api.getLcJudgmentPoint}`, params).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
let list = res.message.records; |
|
|
|
@ -552,7 +552,7 @@ export default { |
|
|
|
|
i.judgmentId = i.lcId; |
|
|
|
|
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
|
}); |
|
|
|
|
this.visibleLoading = false |
|
|
|
|
this.visibleLoading = false; |
|
|
|
|
this.judgementData = result; |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
@ -560,7 +560,7 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getProgrammingClassData(params) { // 获取编程类判分点列表数据 |
|
|
|
|
this.visibleLoading = true |
|
|
|
|
this.visibleLoading = true; |
|
|
|
|
this.$post(this.api.getBcJudgmentPoint, params).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
let list = res.message.records; |
|
|
|
@ -569,12 +569,11 @@ export default { |
|
|
|
|
i.judgmentId = i.bcId; |
|
|
|
|
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
|
}); |
|
|
|
|
this.visibleLoading = false |
|
|
|
|
this.visibleLoading = false; |
|
|
|
|
this.judgementData = result; |
|
|
|
|
console.log(res,'res') |
|
|
|
|
console.log(this.projectJudgmentData,'projectJudgmentData') |
|
|
|
|
// console.log(res, "res"); |
|
|
|
|
// console.log(this.projectJudgmentData, "projectJudgmentData"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
@ -584,20 +583,20 @@ export default { |
|
|
|
|
}, |
|
|
|
|
addJudgment() { // 确认选择判分点 |
|
|
|
|
if (this.selectedJudgment.length) { |
|
|
|
|
console.log(this.selectedJudgment,'queren') |
|
|
|
|
// console.log(this.selectedJudgment, "queren"); |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
if(this.projectId){ // 编辑的时候,新增调接口 |
|
|
|
|
this.addProjectJudgment() |
|
|
|
|
}else{ |
|
|
|
|
if (this.projectId) { // 编辑的时候,新增调接口 |
|
|
|
|
this.addProjectJudgment(); |
|
|
|
|
} else { |
|
|
|
|
// 新增时,假添加 |
|
|
|
|
let tempArr = this.selectedJudgment.map(i => { |
|
|
|
|
i.score = 0; |
|
|
|
|
return i; |
|
|
|
|
}); |
|
|
|
|
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr); |
|
|
|
|
this.projectJudgmentData.map((e,i)=>{ |
|
|
|
|
e.sort = i+1 |
|
|
|
|
}) |
|
|
|
|
this.projectJudgmentData.map((e, i) => { |
|
|
|
|
e.sort = i + 1; |
|
|
|
|
}); |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.projectJudgementTable.clearSelection(); |
|
|
|
|
}); |
|
|
|
@ -655,45 +654,45 @@ export default { |
|
|
|
|
// 行拖拽 |
|
|
|
|
rowDrop() { |
|
|
|
|
// 此时找到的元素是要拖拽元素的父容器 |
|
|
|
|
const tbody = document.querySelector('.draggable .el-table__body-wrapper tbody'); |
|
|
|
|
const tbody = document.querySelector(".draggable .el-table__body-wrapper tbody"); |
|
|
|
|
const _this = this; |
|
|
|
|
Sortable.create(tbody, { |
|
|
|
|
// 指定父元素下可被拖拽的子元素 |
|
|
|
|
draggable: ".draggable .el-table__row", |
|
|
|
|
onEnd({newIndex, oldIndex}) { |
|
|
|
|
let newItem = _this.projectJudgmentData[newIndex] |
|
|
|
|
_this.projectJudgmentData[newIndex] = _this.projectJudgmentData[oldIndex] |
|
|
|
|
_this.projectJudgmentData[oldIndex] = newItem |
|
|
|
|
onEnd({ newIndex, oldIndex }) { |
|
|
|
|
let newItem = _this.projectJudgmentData[newIndex]; |
|
|
|
|
_this.projectJudgmentData[newIndex] = _this.projectJudgmentData[oldIndex]; |
|
|
|
|
_this.projectJudgmentData[oldIndex] = newItem; |
|
|
|
|
// 循环,重新赋值排序赋值 |
|
|
|
|
_this.projectJudgmentData.forEach((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.forEach((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)); // 不更新的解决方案 |
|
|
|
|
}); |
|
|
|
|
// 调修改接口,更新列表 |
|
|
|
|
if(_this.projectId){// 如果是编辑项目,则调编辑接口 |
|
|
|
|
_this.updateProjectJudgment() |
|
|
|
|
if (_this.projectId) {// 如果是编辑项目,则调编辑接口 |
|
|
|
|
_this.updateProjectJudgment(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 添加判分点中间表 |
|
|
|
|
addProjectJudgment(){ |
|
|
|
|
let param = this.selectedJudgment.map((e,i)=>{ |
|
|
|
|
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 => { |
|
|
|
|
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() |
|
|
|
|
// console.log("添加成功", res); |
|
|
|
|
if (this.projectId) { // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain(); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
@ -701,53 +700,48 @@ export default { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 修改判分点中间表 |
|
|
|
|
updateProjectJudgment(){ |
|
|
|
|
updateProjectJudgment() { |
|
|
|
|
// 直接传data回去 |
|
|
|
|
let param = this.projectJudgmentData.map((e,i)=>{ |
|
|
|
|
let param = this.projectJudgmentData.map((e, i) => { |
|
|
|
|
let obj = { |
|
|
|
|
judgmentId:e.judgmentId, |
|
|
|
|
projectId:this.projectId||'', |
|
|
|
|
score:e.score, |
|
|
|
|
sort:i+1, |
|
|
|
|
id:e.id |
|
|
|
|
} |
|
|
|
|
return obj |
|
|
|
|
}) |
|
|
|
|
judgmentId: e.judgmentId, |
|
|
|
|
projectId: this.projectId || "", |
|
|
|
|
score: e.score, |
|
|
|
|
sort: i + 1, |
|
|
|
|
id: e.id |
|
|
|
|
}; |
|
|
|
|
return obj; |
|
|
|
|
}); |
|
|
|
|
this.$post(this.api.updateProjectJudgment, param).then(res => { |
|
|
|
|
|
|
|
|
|
// 重新调接口 |
|
|
|
|
if(this.projectId){ // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain() |
|
|
|
|
if (this.projectId) { // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain(); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 批量删除判分点中间表 |
|
|
|
|
deleteProjectJudgment(values){ |
|
|
|
|
if(values&&values.length>0){ |
|
|
|
|
this.$post(this.api.deleteProjectJudgment+"?projectJudgmentIds="+`${values}`).then(res => { |
|
|
|
|
|
|
|
|
|
deleteProjectJudgment(values) { |
|
|
|
|
if (values && values.length > 0) { |
|
|
|
|
this.$post(this.api.deleteProjectJudgment + "?projectJudgmentIds=" + `${values}`).then(res => { |
|
|
|
|
// 重新调接口 |
|
|
|
|
if(this.projectId){ // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain() |
|
|
|
|
if (this.projectId) { // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain(); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}).catch(err => {}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 重新调接口,专门赋值列表 |
|
|
|
|
listAgain(){ |
|
|
|
|
listAgain() { |
|
|
|
|
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => { |
|
|
|
|
let { projectManage, projectJudgmentVos } = res; |
|
|
|
|
this.projectJudgmentData = projectJudgmentVos; |
|
|
|
|
this.projectJudgmentData.map((e,i)=>{ |
|
|
|
|
e.sort = i+1 |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
this.projectJudgmentData.map((e, i) => { |
|
|
|
|
e.sort = i + 1; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|