|
|
@ -1,353 +1,409 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<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="projectPermissions"> |
|
|
|
<label>时间</label> |
|
|
|
<label>时间</label> |
|
|
|
<el-radio-group v-model="month" @change="initData"> |
|
|
|
<el-radio-group v-model="month" |
|
|
|
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio> |
|
|
|
@change="initData"> |
|
|
|
</el-radio-group> |
|
|
|
<el-radio v-for="(item,index) in dateList" |
|
|
|
<el-date-picker |
|
|
|
:key="index" |
|
|
|
v-model="date" |
|
|
|
:label="item.id" |
|
|
|
@blur='pickerInput' |
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
align="right" |
|
|
|
</el-radio-group> |
|
|
|
unlink-panels |
|
|
|
<el-date-picker v-model="date" |
|
|
|
type="daterange" |
|
|
|
@blur='pickerInput' |
|
|
|
start-placeholder="开始日期" |
|
|
|
align="right" |
|
|
|
end-placeholder="结束日期" |
|
|
|
unlink-panels |
|
|
|
format="yyyy-MM-dd" |
|
|
|
type="daterange" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
start-placeholder="开始日期" |
|
|
|
clearable |
|
|
|
end-placeholder="结束日期" |
|
|
|
style="width: 300px"> |
|
|
|
format="yyyy-MM-dd" |
|
|
|
</el-date-picker> |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
</li> |
|
|
|
clearable |
|
|
|
<li> |
|
|
|
style="width: 300px"> |
|
|
|
<label>实验项目分类</label> |
|
|
|
</el-date-picker> |
|
|
|
<el-radio-group v-model="projectPermissions" @change="perChange"> |
|
|
|
</li> |
|
|
|
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{ item.name }}</el-radio> |
|
|
|
<li> |
|
|
|
</el-radio-group> |
|
|
|
<label>实验项目分类</label> |
|
|
|
</li> |
|
|
|
<el-radio-group v-model="projectPermissions" |
|
|
|
<li v-show="projectPermissions === 1"> |
|
|
|
@change="perChange"> |
|
|
|
<label>班级</label> |
|
|
|
<el-radio v-for="(item,index) in projectType" |
|
|
|
<el-select v-model="classId" @change="classChange"> |
|
|
|
:key="index" |
|
|
|
<el-option |
|
|
|
:label="item.id" |
|
|
|
v-for="item in classList" |
|
|
|
border>{{ item.name }}</el-radio> |
|
|
|
:key="item.id" |
|
|
|
</el-radio-group> |
|
|
|
:label="item.className" |
|
|
|
</li> |
|
|
|
:value="item.id"> |
|
|
|
<li v-show="projectPermissions === 1"> |
|
|
|
</el-option> |
|
|
|
<label>班级</label> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="classId" |
|
|
|
</li> |
|
|
|
@change="classChange"> |
|
|
|
<li> |
|
|
|
<el-option v-for="item in classList" |
|
|
|
<label>课程</label> |
|
|
|
:key="item.id" |
|
|
|
<el-select v-model="curriculumId" @change="curriculumChange"> |
|
|
|
:label="item.className" |
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
:value="item.id"> |
|
|
|
<el-option |
|
|
|
</el-option> |
|
|
|
v-for="item in curriculumList" |
|
|
|
</el-select> |
|
|
|
:key="item.cid" |
|
|
|
</li> |
|
|
|
:label="item.curriculumName" |
|
|
|
<li> |
|
|
|
:value="item.cid"> |
|
|
|
<label>课程</label> |
|
|
|
</el-option> |
|
|
|
<el-select v-model="curriculumId" |
|
|
|
</el-select> |
|
|
|
@change="curriculumChange"> |
|
|
|
</li> |
|
|
|
<el-option label="不限" |
|
|
|
<li> |
|
|
|
value=""></el-option> |
|
|
|
<el-input placeholder="请输入考核或项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
|
|
|
<el-option v-for="item in curriculumList" |
|
|
|
</li> |
|
|
|
:key="item.cid" |
|
|
|
</ul> |
|
|
|
:label="item.curriculumName" |
|
|
|
</div> |
|
|
|
:value="item.cid"> |
|
|
|
<div class="tool mul"> |
|
|
|
</el-option> |
|
|
|
<ul class="filter"></ul> |
|
|
|
</el-select> |
|
|
|
<div style="margin-bottom: 24px"> |
|
|
|
</li> |
|
|
|
<el-button v-auth type="primary" @click="delAllData">批量删除</el-button> |
|
|
|
<li> |
|
|
|
</div> |
|
|
|
<el-input placeholder="请输入考核或项目名称" |
|
|
|
</div> |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
|
|
|
v-model="keyword" |
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column> |
|
|
|
clearable></el-input> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
</li> |
|
|
|
<template slot-scope="scope"> |
|
|
|
</ul> |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<template v-if="projectPermissions == 1"> |
|
|
|
|
|
|
|
<el-table-column prop="className" label="班级" align="center" width="140"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="experimentalName" label="考核名称" align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<span class="mul-ellipsis2">{{ scope.row.experimentalName }}</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="projectPermissions" label="分类" align="center" width="100"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ projectPermissions ? '考核' : '练习' }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="experimentalNumber" label="成绩报告数量" align="center" :width="projectPermissions ? 120 : 230"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center" :width="projectPermissions ? 160 : 230"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" :width="projectPermissions ? 150 : 230"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button v-auth="'练习成绩管理'" type="text" @click="entry(scope.row)">成绩管理</el-button> |
|
|
|
|
|
|
|
<el-button v-auth type="text" v-if="scope.row.canDel" @click="handleDelete(scope.row)" >删除</el-button> |
|
|
|
|
|
|
|
<el-button v-auth type="text" v-else style='color:#999' >删除</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="tool mul"> |
|
|
|
|
|
|
|
<ul class="filter"></ul> |
|
|
|
|
|
|
|
<div style="margin-bottom: 24px"> |
|
|
|
|
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="delAllData">批量删除</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table :data="listData" |
|
|
|
|
|
|
|
class="table" |
|
|
|
|
|
|
|
ref="table" |
|
|
|
|
|
|
|
stripe |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
|
|
|
row-key="id"> |
|
|
|
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
|
|
|
width="55" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
:reserve-selection="true" |
|
|
|
|
|
|
|
:selectable="disabledSelection"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
width="60" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<template v-if="projectPermissions == 1"> |
|
|
|
|
|
|
|
<el-table-column prop="className" |
|
|
|
|
|
|
|
label="班级" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="140"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="experimentalName" |
|
|
|
|
|
|
|
label="考核名称" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<span class="mul-ellipsis2">{{ scope.row.experimentalName }}</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<el-table-column prop="projectName" |
|
|
|
|
|
|
|
label="项目名称" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="projectPermissions" |
|
|
|
|
|
|
|
label="分类" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="100"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ projectPermissions ? '考核' : '练习' }} |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="experimentalNumber" |
|
|
|
|
|
|
|
label="成绩报告数量" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
:width="projectPermissions ? 120 : 230"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="createTime" |
|
|
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
:width="projectPermissions ? 160 : 230"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
:width="projectPermissions ? 150 : 230"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button v-auth="'练习成绩管理'" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="entry(scope.row)">成绩管理</el-button> |
|
|
|
|
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
v-if="scope.row.canDel" |
|
|
|
|
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
<el-button v-auth |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
style='color:#999'>删除</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:total="total" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
|
|
:current-page="page"></el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { Loading } from "element-ui"; |
|
|
|
import { Loading } from "element-ui"; |
|
|
|
import util from "@/libs/util"; |
|
|
|
import util from "@/libs/util"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "achievement", |
|
|
|
name: "achievement", |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
classId: this.$route.query.class ? +this.$route.query.class : '', |
|
|
|
classId: this.$route.query.class ? +this.$route.query.class : '', |
|
|
|
classList: [], |
|
|
|
classList: [], |
|
|
|
curriculumId: this.$route.query.curriculum ? +this.$route.query.curriculum : '', |
|
|
|
curriculumId: this.$route.query.curriculum ? +this.$route.query.curriculum : '', |
|
|
|
curriculumList: [], |
|
|
|
curriculumList: [], |
|
|
|
projectPermissions: this.$route.query.per ? +this.$route.query.per : 0, |
|
|
|
projectPermissions: this.$route.query.per ? +this.$route.query.per : 0, |
|
|
|
keyword: "", |
|
|
|
keyword: "", |
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
|
startingtime: "", |
|
|
|
startingtime: "", |
|
|
|
endTime: "", |
|
|
|
endTime: "", |
|
|
|
month: "", |
|
|
|
month: "", |
|
|
|
listData: [], |
|
|
|
listData: [], |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
dateList: [ |
|
|
|
dateList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: "", |
|
|
|
id: "", |
|
|
|
name: "不限" |
|
|
|
name: "不限" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
id: 1, |
|
|
|
id: 1, |
|
|
|
name: "近一个月" |
|
|
|
name: "近一个月" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
id: 6, |
|
|
|
id: 6, |
|
|
|
name: "近六个月" |
|
|
|
name: "近六个月" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
projectType: [ |
|
|
|
projectType: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
id: 0, |
|
|
|
id: 0, |
|
|
|
name: "练习" |
|
|
|
name: "练习" |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
id: 1, |
|
|
|
id: 1, |
|
|
|
name: "考核" |
|
|
|
name: "考核" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
date: "", |
|
|
|
date: "", |
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
loadIns: null |
|
|
|
loadIns: null |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
month: function (val) { |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
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))]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.date = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
date: function (val) { |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
this.startingtime = val[0]; |
|
|
|
|
|
|
|
this.endTime = val[1]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.startingtime = ""; |
|
|
|
|
|
|
|
this.endTime = ""; |
|
|
|
|
|
|
|
this.month = ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
keyword: function (val) { |
|
|
|
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
mounted () { |
|
|
|
|
|
|
|
this.getschoolCourse(); |
|
|
|
|
|
|
|
this.getClassData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
pickerInput () { |
|
|
|
|
|
|
|
this.month = '6' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getschoolCourse () { // 获取课程下拉框数据 |
|
|
|
|
|
|
|
this.$get(this.api.schoolCourseByAchievement).then(res => { |
|
|
|
|
|
|
|
this.curriculumList = res.data; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getClassData () { // 获取班级下拉框数据 |
|
|
|
|
|
|
|
this.$post(this.api.myClass).then(res => { |
|
|
|
|
|
|
|
this.classList = res.list; |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData () { |
|
|
|
|
|
|
|
this.loadIns = Loading.service({ |
|
|
|
|
|
|
|
background: "rgba(255,255,255,.6)" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
const per = this.projectPermissions |
|
|
|
|
|
|
|
const curriculumId = this.curriculumId |
|
|
|
|
|
|
|
const curr = this.curriculumList.find(e => e.cid == curriculumId) |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
classId: this.classId, |
|
|
|
|
|
|
|
permissions: per, |
|
|
|
|
|
|
|
curriculumId, |
|
|
|
|
|
|
|
keyWord: this.keyword, |
|
|
|
|
|
|
|
startTime: this.startingtime, |
|
|
|
|
|
|
|
endTime: this.endTime, |
|
|
|
|
|
|
|
month: this.month, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
|
|
|
systemId: curr ? curr.systemId : '' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.$post(this.api.getAchievementInfo, data).then(res => { |
|
|
|
|
|
|
|
let list = [] |
|
|
|
|
|
|
|
if (per == 0) { |
|
|
|
|
|
|
|
list = res.page |
|
|
|
|
|
|
|
this.total = res.total |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
list = res.page.records |
|
|
|
|
|
|
|
this.total = res.page.total |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log(33, per) |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
// isAdmin表示这个项目是不是内置的项目,如果为1 表示内置的项目,删除的前提条件就是这个项目删除了isdel=1以及courseDel=1 同时课程管理也移除了这个项目才能删除, 所以要系统内置的项目要满足这三个条件(1.为内置 2.中台删除了、3、课程里面也移除了)才能删除。是isAdmin为0就说明不是内置项目,为当前用户自己创建的项目,所以条件就是isDel为1直接删 |
|
|
|
|
|
|
|
e.canDel = per ? |
|
|
|
|
|
|
|
e.isDel : |
|
|
|
|
|
|
|
(e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.listData = list |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.loadIns.close() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
this.loadIns.close() |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
// 项目分类回调 |
|
|
|
month: function(val) { |
|
|
|
perChange (val) { |
|
|
|
if (val) { |
|
|
|
this.$router.push({ |
|
|
|
let unit = 24 * 60 * 60 * 1000; |
|
|
|
path: 'list', |
|
|
|
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))]; |
|
|
|
query: { |
|
|
|
} else { |
|
|
|
...this.$route.query, |
|
|
|
this.date = []; |
|
|
|
per: val |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
date: function(val) { |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
this.startingtime = val[0]; |
|
|
|
|
|
|
|
this.endTime = val[1]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.startingtime = ""; |
|
|
|
|
|
|
|
this.endTime = ""; |
|
|
|
|
|
|
|
this.month = ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
keyword: function(val) { |
|
|
|
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 班级回调 |
|
|
|
this.getschoolCourse(); |
|
|
|
classChange (val) { |
|
|
|
this.getClassData(); |
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
class: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 课程回调 |
|
|
|
|
|
|
|
curriculumChange (val) { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
curriculum: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initData () { |
|
|
|
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
disabledSelection (row, index) { // 禁用勾选 |
|
|
|
|
|
|
|
if (row.canDel) return true |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 进入实验记录 |
|
|
|
|
|
|
|
entry (row) { |
|
|
|
|
|
|
|
this.$router.push(`teach?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleDelete (row) { // 删除 |
|
|
|
pickerInput(){ |
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
this.month = '6' |
|
|
|
type: "warning" |
|
|
|
}, |
|
|
|
}).then(() => { |
|
|
|
getschoolCourse() { // 获取课程下拉框数据 |
|
|
|
let url = ""; |
|
|
|
this.$get(this.api.schoolCourseByAchievement).then(res => { |
|
|
|
if (this.projectPermissions === 0) { |
|
|
|
this.curriculumList = res.data; |
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`; |
|
|
|
this.getData(); |
|
|
|
} else { |
|
|
|
}).catch(err => { |
|
|
|
url = `${this.api.deleteReportById}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`; |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
this.$get(url).then(res => { |
|
|
|
getClassData() { // 获取班级下拉框数据 |
|
|
|
util.successMsg("删除成功"); |
|
|
|
this.$post(this.api.myClass).then(res => { |
|
|
|
this.getData(); |
|
|
|
this.classList = res.list; |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}).catch(() => { |
|
|
|
}, |
|
|
|
}); |
|
|
|
getData() { |
|
|
|
}, |
|
|
|
this.loadIns = Loading.service({ |
|
|
|
delAllData () { // 批量删除 |
|
|
|
background: "rgba(255,255,255,.6)" |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
}); |
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
const per = this.projectPermissions |
|
|
|
type: "warning" |
|
|
|
const curriculumId = this.curriculumId |
|
|
|
}).then(() => { |
|
|
|
const curr = this.curriculumList.find(e => e.cid == curriculumId) |
|
|
|
let url = ""; |
|
|
|
let data = { |
|
|
|
let ids = []; |
|
|
|
classId: this.classId, |
|
|
|
ids = this.multipleSelection.map(item => item.assessmentId); |
|
|
|
permissions: per, |
|
|
|
let projectIds = []; |
|
|
|
curriculumId, |
|
|
|
projectIds = this.multipleSelection.map(item => item.projectId); |
|
|
|
keyWord: this.keyword, |
|
|
|
if (this.projectPermissions === 0) { |
|
|
|
startTime: this.startingtime, |
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}` |
|
|
|
endTime: this.endTime, |
|
|
|
} else { |
|
|
|
month: this.month, |
|
|
|
url = `${this.api.deleteReportById}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}` |
|
|
|
pageNum: this.page, |
|
|
|
} |
|
|
|
pageSize: this.pageSize, |
|
|
|
this.$get(url).then(res => { |
|
|
|
systemId: curr ? curr.systemId : '' |
|
|
|
this.multipleSelection = []; |
|
|
|
}; |
|
|
|
|
|
|
|
this.$post(this.api.getAchievementInfo, data).then(res => { |
|
|
|
|
|
|
|
let list = [] |
|
|
|
|
|
|
|
if(per == 0){ |
|
|
|
|
|
|
|
list = res.page |
|
|
|
|
|
|
|
this.total = res.total |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
list = res.page.records |
|
|
|
|
|
|
|
this.total = res.page.total |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log(33, per) |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
// isAdmin表示这个项目是不是内置的项目,如果为1 表示内置的项目,删除的前提条件就是这个项目删除了isdel=1以及courseDel=1 同时课程管理也移除了这个项目才能删除, 所以要系统内置的项目要满足这三个条件(1.为内置 2.中台删除了、3、课程里面也移除了)才能删除。是isAdmin为0就说明不是内置项目,为当前用户自己创建的项目,所以条件就是isDel为1直接删 |
|
|
|
|
|
|
|
e.canDel = per ? |
|
|
|
|
|
|
|
e.isDel : |
|
|
|
|
|
|
|
(e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.listData = list |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.loadIns.close() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
this.loadIns.close() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 项目分类回调 |
|
|
|
|
|
|
|
perChange(val) { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
per: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 班级回调 |
|
|
|
|
|
|
|
classChange(val) { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
class: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 课程回调 |
|
|
|
|
|
|
|
curriculumChange(val) { |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
curriculum: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initData() { |
|
|
|
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.page = 1; |
|
|
|
util.successMsg("删除成功"); |
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
disabledSelection(row, index) { // 禁用勾选 |
|
|
|
|
|
|
|
if (row.canDel) return true |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 进入实验记录 |
|
|
|
|
|
|
|
entry(row) { |
|
|
|
|
|
|
|
this.$router.push(`teach?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}`) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleDelete(row) { // 删除 |
|
|
|
|
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
|
|
|
|
type: "warning" |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
let url = ""; |
|
|
|
|
|
|
|
if (this.projectPermissions === 0) { |
|
|
|
|
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
url = `${this.api.deleteReportById}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$get(url).then(res => { |
|
|
|
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
delAllData() { // 批量删除 |
|
|
|
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
|
|
|
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
|
|
|
|
|
|
|
type: "warning" |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
let url = ""; |
|
|
|
|
|
|
|
let ids = []; |
|
|
|
|
|
|
|
ids = this.multipleSelection.map(item => item.assessmentId); |
|
|
|
|
|
|
|
let projectIds = []; |
|
|
|
|
|
|
|
projectIds = this.multipleSelection.map(item => item.projectId); |
|
|
|
|
|
|
|
if (this.projectPermissions === 0) { |
|
|
|
|
|
|
|
url = `${this.api.deleteReportById}?ids=&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}` |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
url = `${this.api.deleteReportById}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$get(url).then(res => { |
|
|
|
|
|
|
|
this.multipleSelection = []; |
|
|
|
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if(this.multipleSelection.length === this.listData.length && this.pageNum>1) { |
|
|
|
|
|
|
|
this.handleCurrentChange(this.pageNum - 1) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
util.errorMsg("请先选择数据 !"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleSelectionChange(val) { // 多选 |
|
|
|
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCurrentChange(val) { // 切换页码 |
|
|
|
|
|
|
|
this.page = val |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
page: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (this.multipleSelection.length === this.listData.length && this.pageNum > 1) { |
|
|
|
|
|
|
|
this.handleCurrentChange(this.pageNum - 1) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
util.errorMsg("请先选择数据 !"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleSelectionChange (val) { // 多选 |
|
|
|
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCurrentChange (val) { // 切换页码 |
|
|
|
|
|
|
|
this.page = val |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: 'list', |
|
|
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
...this.$route.query, |
|
|
|
|
|
|
|
page: val |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|