|
|
@ -4,10 +4,10 @@ |
|
|
|
<h6 class="p-title">筛选</h6> |
|
|
|
<h6 class="p-title">筛选</h6> |
|
|
|
<div class="tool mul"> |
|
|
|
<div class="tool mul"> |
|
|
|
<ul class="filter"> |
|
|
|
<ul class="filter"> |
|
|
|
<li v-if="projectPermissions"> |
|
|
|
<li v-if="form.permissions"> |
|
|
|
<label>时间</label> |
|
|
|
<label>时间</label> |
|
|
|
<el-radio-group v-model="month" |
|
|
|
<el-radio-group v-model="form.month" |
|
|
|
@change="initData"> |
|
|
|
@change="monthChange"> |
|
|
|
<el-radio v-for="(item,index) in dateList" |
|
|
|
<el-radio v-for="(item,index) in dateList" |
|
|
|
:key="index" |
|
|
|
:key="index" |
|
|
|
:label="item.id" |
|
|
|
:label="item.id" |
|
|
@ -28,7 +28,7 @@ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>实验项目分类</label> |
|
|
|
<label>实验项目分类</label> |
|
|
|
<el-radio-group v-model="projectPermissions" |
|
|
|
<el-radio-group v-model="form.permissions" |
|
|
|
@change="perChange"> |
|
|
|
@change="perChange"> |
|
|
|
<el-radio v-for="(item,index) in projectType" |
|
|
|
<el-radio v-for="(item,index) in projectType" |
|
|
|
:key="index" |
|
|
|
:key="index" |
|
|
@ -36,9 +36,9 @@ |
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li v-show="projectPermissions === 1"> |
|
|
|
<li v-show="form.permissions === 1"> |
|
|
|
<label>班级</label> |
|
|
|
<label>班级</label> |
|
|
|
<el-select v-model="classId" |
|
|
|
<el-select v-model="form.classId" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
@change="classChange"> |
|
|
|
@change="classChange"> |
|
|
|
<el-option v-for="item in classList" |
|
|
|
<el-option v-for="item in classList" |
|
|
@ -50,8 +50,8 @@ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>课程</label> |
|
|
|
<label>课程</label> |
|
|
|
<el-select v-model="mallId" |
|
|
|
<el-select v-model="form.mallId" |
|
|
|
@change="initData"> |
|
|
|
@change="mallIdChange"> |
|
|
|
<el-option v-for="(item, i) in curs" |
|
|
|
<el-option v-for="(item, i) in curs" |
|
|
|
:key="i" |
|
|
|
:key="i" |
|
|
|
:label="item.curriculumName" |
|
|
|
:label="item.curriculumName" |
|
|
@ -62,7 +62,7 @@ |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<el-input placeholder="请输入考核或项目名称" |
|
|
|
<el-input placeholder="请输入考核或项目名称" |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
v-model="keyword" |
|
|
|
v-model="form.keyWord" |
|
|
|
clearable></el-input> |
|
|
|
clearable></el-input> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
@ -95,7 +95,7 @@ |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<template v-if="projectPermissions == 1"> |
|
|
|
<template v-if="form.permissions == 1"> |
|
|
|
<el-table-column prop="className" |
|
|
|
<el-table-column prop="className" |
|
|
|
label="实验班级" |
|
|
|
label="实验班级" |
|
|
|
align="center" |
|
|
|
align="center" |
|
|
@ -118,21 +118,21 @@ |
|
|
|
align="center" |
|
|
|
align="center" |
|
|
|
width="100"> |
|
|
|
width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ projectPermissions ? '考核' : '练习' }} |
|
|
|
{{ form.permissions ? '考核' : '练习' }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="experimentalNumber" |
|
|
|
<el-table-column prop="experimentalNumber" |
|
|
|
label="成绩报告数量" |
|
|
|
label="成绩报告数量" |
|
|
|
align="center" |
|
|
|
align="center" |
|
|
|
:width="projectPermissions ? 120 : 230"></el-table-column> |
|
|
|
:width="form.permissions ? 120 : 230"></el-table-column> |
|
|
|
<el-table-column prop="createTime" |
|
|
|
<el-table-column prop="createTime" |
|
|
|
label="创建时间" |
|
|
|
label="创建时间" |
|
|
|
align="center" |
|
|
|
align="center" |
|
|
|
:width="projectPermissions ? 160 : 230"> |
|
|
|
:width="form.permissions ? 160 : 230"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" |
|
|
|
<el-table-column label="操作" |
|
|
|
align="center" |
|
|
|
align="center" |
|
|
|
:width="projectPermissions ? 150 : 230"> |
|
|
|
:width="form.permissions ? 150 : 230"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-auth="'练习成绩管理'" |
|
|
|
<el-button v-auth="'练习成绩管理'" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
@ -164,18 +164,20 @@ export default { |
|
|
|
name: "achievement", |
|
|
|
name: "achievement", |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
classId: this.$route.query.class ? +this.$route.query.class : '', |
|
|
|
form: { |
|
|
|
|
|
|
|
classId: this.$route.query.class ? +this.$route.query.class : '', |
|
|
|
|
|
|
|
mallId: +this.$route.query.mallId || '', |
|
|
|
|
|
|
|
permissions: this.$route.query.permissions ? +this.$route.query.permissions : 0, |
|
|
|
|
|
|
|
month: +this.$route.query.month || '', |
|
|
|
|
|
|
|
startTime: +this.$route.query.startTime || '', |
|
|
|
|
|
|
|
endTime: +this.$route.query.endTime || '', |
|
|
|
|
|
|
|
keyWord: this.$route.query.keyWord || '', |
|
|
|
|
|
|
|
}, |
|
|
|
classList: [], |
|
|
|
classList: [], |
|
|
|
mallId: this.$route.query.mallId ? +this.$route.query.mallId : '', |
|
|
|
|
|
|
|
curriculumList: [], |
|
|
|
curriculumList: [], |
|
|
|
projectPermissions: this.$route.query.per ? +this.$route.query.per : 0, |
|
|
|
|
|
|
|
mallIds: [], |
|
|
|
mallIds: [], |
|
|
|
curs: [], |
|
|
|
curs: [], |
|
|
|
keyword: this.$route.query.keyword || '', |
|
|
|
|
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
|
startingtime: "", |
|
|
|
|
|
|
|
endTime: "", |
|
|
|
|
|
|
|
month: "", |
|
|
|
|
|
|
|
listData: [], |
|
|
|
listData: [], |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
dateList: [ |
|
|
|
dateList: [ |
|
|
@ -200,14 +202,14 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
date: "", |
|
|
|
date: "", |
|
|
|
page: this.$route.query.page ? +this.$route.query.page : 1, |
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
month: function (val) { |
|
|
|
'form.month': function (val) { |
|
|
|
if (val) { |
|
|
|
if (val) { |
|
|
|
let unit = 24 * 60 * 60 * 1000; |
|
|
|
let unit = 24 * 60 * 60 * 1000; |
|
|
|
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))]; |
|
|
|
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))]; |
|
|
@ -217,24 +219,23 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
date: function (val) { |
|
|
|
date: function (val) { |
|
|
|
if (val) { |
|
|
|
if (val) { |
|
|
|
this.startingtime = val[0]; |
|
|
|
this.form.startTime = val[0]; |
|
|
|
this.endTime = val[1]; |
|
|
|
this.form.endTime = val[1]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.startingtime = ""; |
|
|
|
this.form.startTime = '' |
|
|
|
this.endTime = ""; |
|
|
|
this.form.endTime = '' |
|
|
|
this.month = ''; |
|
|
|
this.form.month = ''; |
|
|
|
} |
|
|
|
} |
|
|
|
this.initData(); |
|
|
|
this.initData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
keyword: function (val) { |
|
|
|
'form.keyWord': function (val) { |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.$router.push({ |
|
|
|
this.$router.push({ |
|
|
|
path: 'list', |
|
|
|
path: 'list', |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
...this.$route.query, |
|
|
|
...this.$route.query, |
|
|
|
keyword: val, |
|
|
|
keyWord: val, |
|
|
|
page: 1 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.initData(); |
|
|
|
this.initData(); |
|
|
@ -247,14 +248,14 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
pickerInput () { |
|
|
|
pickerInput () { |
|
|
|
this.month = '6' |
|
|
|
this.form.month = '6' |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取课程 |
|
|
|
// 获取课程 |
|
|
|
async getCourse () { |
|
|
|
async getCourse () { |
|
|
|
const { data } = await this.$get(this.api.getSchoolEffectiveCourse) |
|
|
|
const { data } = await this.$get(this.api.getSchoolEffectiveCourse) |
|
|
|
this.curs = data |
|
|
|
this.curs = data |
|
|
|
this.mallId = this.mallId || data[0].mallId |
|
|
|
this.form.mallId = this.form.mallId || data[0].mallId |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 课程选择回调 |
|
|
|
// 课程选择回调 |
|
|
@ -276,25 +277,18 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
getData () { |
|
|
|
getData () { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
const per = this.projectPermissions |
|
|
|
const { mallId, permissions } = this.form |
|
|
|
const { mallId } = this |
|
|
|
|
|
|
|
const cur = this.curs.find(e => e.mallId == mallId) || {} |
|
|
|
const cur = this.curs.find(e => e.mallId == mallId) || {} |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
classId: this.classId, |
|
|
|
...this.form, |
|
|
|
permissions: per, |
|
|
|
|
|
|
|
curriculumId: cur.cid, |
|
|
|
curriculumId: cur.cid, |
|
|
|
mallId, |
|
|
|
systemId: cur.systemId, |
|
|
|
keyWord: this.keyword, |
|
|
|
|
|
|
|
startTime: this.startingtime, |
|
|
|
|
|
|
|
endTime: this.endTime, |
|
|
|
|
|
|
|
month: this.month, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
pageNum: this.page, |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageSize: this.pageSize, |
|
|
|
systemId: cur.systemId |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
this.$post(this.api.getAchievementInfo, data).then(res => { |
|
|
|
this.$post(this.api.getAchievementInfo, data).then(res => { |
|
|
|
let list = [] |
|
|
|
let list = [] |
|
|
|
if (per == 0) { |
|
|
|
if (permissions == 0) { |
|
|
|
list = res.page |
|
|
|
list = res.page |
|
|
|
this.total = res.total |
|
|
|
this.total = res.total |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -303,7 +297,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
list.map(e => { |
|
|
|
list.map(e => { |
|
|
|
// isAdmin表示这个项目是不是内置的项目,如果为1 表示内置的项目,删除的前提条件就是这个项目删除了isdel=1以及courseDel=1 同时课程管理也移除了这个项目才能删除, 所以要系统内置的项目要满足这三个条件(1.为内置 2.中台删除了、3、课程里面也移除了)才能删除。是isAdmin为0就说明不是内置项目,为当前用户自己创建的项目,所以条件就是isDel为1直接删 |
|
|
|
// isAdmin表示这个项目是不是内置的项目,如果为1 表示内置的项目,删除的前提条件就是这个项目删除了isdel=1以及courseDel=1 同时课程管理也移除了这个项目才能删除, 所以要系统内置的项目要满足这三个条件(1.为内置 2.中台删除了、3、课程里面也移除了)才能删除。是isAdmin为0就说明不是内置项目,为当前用户自己创建的项目,所以条件就是isDel为1直接删 |
|
|
|
e.canDel = per ? |
|
|
|
e.canDel = permissions ? |
|
|
|
e.isDel : |
|
|
|
e.isDel : |
|
|
|
(e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1) |
|
|
|
(e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -315,16 +309,26 @@ export default { |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
monthChange () { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
month: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.initData() |
|
|
|
|
|
|
|
}, |
|
|
|
// 项目分类回调 |
|
|
|
// 项目分类回调 |
|
|
|
perChange (val) { |
|
|
|
perChange (val) { |
|
|
|
this.$router.push({ |
|
|
|
this.$router.push({ |
|
|
|
path: 'list', |
|
|
|
path: 'list', |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
...this.$route.query, |
|
|
|
...this.$route.query, |
|
|
|
per: val |
|
|
|
permissions: val |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getData() |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 班级回调 |
|
|
|
// 班级回调 |
|
|
|
classChange (val) { |
|
|
|
classChange (val) { |
|
|
@ -332,45 +336,45 @@ export default { |
|
|
|
path: 'list', |
|
|
|
path: 'list', |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
...this.$route.query, |
|
|
|
...this.$route.query, |
|
|
|
class: val |
|
|
|
classId: val |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getData() |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 课程回调 |
|
|
|
// 课程回调 |
|
|
|
curriculumChange (val) { |
|
|
|
mallIdChange (val) { |
|
|
|
this.$router.push({ |
|
|
|
this.$router.push({ |
|
|
|
path: 'list', |
|
|
|
path: 'list', |
|
|
|
query: { |
|
|
|
query: { |
|
|
|
...this.$route.query, |
|
|
|
...this.$route.query, |
|
|
|
curriculum: val |
|
|
|
mallId: val |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getData() |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData () { |
|
|
|
initData () { |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.page = 1; |
|
|
|
this.page = 1; |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
disabledSelection (row, index) { // 禁用勾选 |
|
|
|
disabledSelection (row) { // 禁用勾选 |
|
|
|
if (row.canDel) return true |
|
|
|
if (row.canDel) return true |
|
|
|
return false |
|
|
|
return false |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 进入实验记录 |
|
|
|
// 进入实验记录 |
|
|
|
entry (row) { |
|
|
|
entry (row) { |
|
|
|
this.$store.commit('achievement/setReferrer', location.href) |
|
|
|
this.$store.commit('achievement/setReferrer', this.$route.fullPath) |
|
|
|
this.$router.push(`project?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}&mallId=${this.mallId}&classId=${row.classId || ''}`) |
|
|
|
this.$router.push(`project?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}&mallId=${this.form.mallId}&classId=${row.classId || ''}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleDelete (row) { // 删除 |
|
|
|
handleDelete (row) { // 删除 |
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
let url = ""; |
|
|
|
let url = ""; |
|
|
|
if (this.projectPermissions === 0) { |
|
|
|
if (this.form.permissions === 0) { |
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`; |
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${row.projectId}&projectPermissions=${this.form.permissions}`; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
url = `${this.api.deleteReportById}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`; |
|
|
|
url = `${this.api.deleteReportById}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.form.permissions}`; |
|
|
|
} |
|
|
|
} |
|
|
|
this.$get(url).then(res => { |
|
|
|
this.$get(url).then(res => { |
|
|
|
util.successMsg("删除成功"); |
|
|
|
util.successMsg("删除成功"); |
|
|
@ -390,10 +394,10 @@ export default { |
|
|
|
ids = this.multipleSelection.map(item => item.assessmentId); |
|
|
|
ids = this.multipleSelection.map(item => item.assessmentId); |
|
|
|
let projectIds = []; |
|
|
|
let projectIds = []; |
|
|
|
projectIds = this.multipleSelection.map(item => item.projectId); |
|
|
|
projectIds = this.multipleSelection.map(item => item.projectId); |
|
|
|
if (this.projectPermissions === 0) { |
|
|
|
if (this.form.permissions === 0) { |
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}` |
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${projectIds.toString()}&projectPermissions=${this.form.permissions}` |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
url = `${this.api.deleteReportById}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}` |
|
|
|
url = `${this.api.deleteReportById}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.form.permissions}` |
|
|
|
} |
|
|
|
} |
|
|
|
this.$get(url).then(res => { |
|
|
|
this.$get(url).then(res => { |
|
|
|
this.multipleSelection = []; |
|
|
|
this.multipleSelection = []; |
|
|
|