Commit 3d85ecf0 by lizhi

优化

parent 152d0fd0
...@@ -67,11 +67,11 @@ ...@@ -67,11 +67,11 @@
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column label="选课" align="center"> <el-table-column label="选课" align="center" width="100px">
<template slot-scope="scope">{{ scope.$index + 1 }}</template> <template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column> </el-table-column>
<el-table-column label="年份" align="center"> <el-table-column label="年份" align="center" width="100px">
<template slot-scope="scope">{{ scope.row.yearTime }}</template> <template slot-scope="scope">{{ scope.row.yearTime }}</template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="年级" align="center"> <!-- <el-table-column label="年级" align="center">
......
...@@ -8,18 +8,10 @@ ...@@ -8,18 +8,10 @@
> >
<el-form :model="editScoreList" ref="editScoreList"> <el-form :model="editScoreList" ref="editScoreList">
<div class="line"> <div class="line">
<el-form-item label="编辑学生课程分数" prop="gpa"> <el-form-item label="编辑学生课程分数" prop="gpa">
<el-input <el-input autosize v-model.number="editScoreList.gpa"> </el-input>
autosize
v-model.number="editScoreList.gpa"
>
</el-input>
<!-- {{editRecruitCourse.courseName}} --> <!-- {{editRecruitCourse.courseName}} -->
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -27,13 +19,10 @@ ...@@ -27,13 +19,10 @@
<el-button type="primary" @click="submitForm('editScoreList')" <el-button type="primary" @click="submitForm('editScoreList')"
>确 定</el-button >确 定</el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<div class="table-container"> <div class="table-container">
<el-table <el-table
ref="productTable" ref="productTable"
:data="list" :data="list"
...@@ -41,9 +30,7 @@ ...@@ -41,9 +30,7 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
v-loading="listLoading" v-loading="listLoading"
border border
> >
<el-table-column label="上课年份" align="center"> <el-table-column label="上课年份" align="center">
<template slot-scope="scope">{{ scope.row.yearTime }}</template> <template slot-scope="scope">{{ scope.row.yearTime }}</template>
</el-table-column> </el-table-column>
...@@ -57,14 +44,12 @@ ...@@ -57,14 +44,12 @@
<span v-if="scope.row.userCourseList[0].csoCourseCode"> <span v-if="scope.row.userCourseList[0].csoCourseCode">
{{ scope.row.userCourseList[0].csoCourseCode }}</span {{ scope.row.userCourseList[0].csoCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[0].auditCourseCode"> <span v-else-if="scope.row.userCourseList[0].auditCourseCode">
{{ scope.row.userCourseList[0].auditCourseCode }}</span {{ scope.row.userCourseList[0].auditCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[0].ownCourseCode"> <span v-else-if="scope.row.userCourseList[0].ownCourseCode">
{{ scope.row.userCourseList[0].ownCourseCode }}</span {{ scope.row.userCourseList[0].ownCourseCode }}</span
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="分数"> <el-table-column align="center" label="分数">
...@@ -74,10 +59,17 @@ ...@@ -74,10 +59,17 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="编辑分数"> <el-table-column align="center" label="编辑分数">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="updateScore(scope.row.userCourseList[0].gpa,scope.row.userCourseList[0].id)">编辑</el-button> <el-button
@click="
updateScore(
scope.row.userCourseList[0].gpa,
scope.row.userCourseList[0].id
)
"
>编辑</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="课程2" align="center"> <el-table-column label="课程2" align="center">
...@@ -86,14 +78,12 @@ ...@@ -86,14 +78,12 @@
<span v-if="scope.row.userCourseList[1].csoCourseCode"> <span v-if="scope.row.userCourseList[1].csoCourseCode">
{{ scope.row.userCourseList[1].csoCourseCode }}</span {{ scope.row.userCourseList[1].csoCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[1].auditCourseCode"> <span v-else-if="scope.row.userCourseList[1].auditCourseCode">
{{ scope.row.userCourseList[1].auditCourseCode }}</span {{ scope.row.userCourseList[1].auditCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[1].ownCourseCode"> <span v-else-if="scope.row.userCourseList[1].ownCourseCode">
{{ scope.row.userCourseList[1].ownCourseCode }}</span {{ scope.row.userCourseList[1].ownCourseCode }}</span
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="分数"> <el-table-column align="center" label="分数">
...@@ -103,7 +93,15 @@ ...@@ -103,7 +93,15 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="编辑分数"> <el-table-column align="center" label="编辑分数">
<template slot-scope="scope" v-if="scope.row.userCourseList[1]"> <template slot-scope="scope" v-if="scope.row.userCourseList[1]">
<el-button @click="updateScore(scope.row.userCourseList[1].gpa,scope.row.userCourseList[1].id)">编辑</el-button> <el-button
@click="
updateScore(
scope.row.userCourseList[1].gpa,
scope.row.userCourseList[1].id
)
"
>编辑</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
...@@ -114,13 +112,12 @@ ...@@ -114,13 +112,12 @@
<span v-if="scope.row.userCourseList[2].csoCourseCode"> <span v-if="scope.row.userCourseList[2].csoCourseCode">
{{ scope.row.userCourseList[2].csoCourseCode }}</span {{ scope.row.userCourseList[2].csoCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[2].auditCourseCode"> <span v-else-if="scope.row.userCourseList[2].auditCourseCode">
{{ scope.row.userCourseList[2].auditCourseCode }}</span {{ scope.row.userCourseList[2].auditCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[2].ownCourseCode"> <span v-else-if="scope.row.userCourseList[2].ownCourseCode">
{{ scope.row.userCourseList[2].ownCourseCode }}</span {{ scope.row.userCourseList[2].ownCourseCode }}</span
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="分数"> <el-table-column align="center" label="分数">
...@@ -130,7 +127,15 @@ ...@@ -130,7 +127,15 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="编辑分数"> <el-table-column align="center" label="编辑分数">
<template slot-scope="scope" v-if="scope.row.userCourseList[2]"> <template slot-scope="scope" v-if="scope.row.userCourseList[2]">
<el-button @click="updateScore(scope.row.userCourseList[2].gpa,scope.row.userCourseList[2].id)">编辑</el-button> <el-button
@click="
updateScore(
scope.row.userCourseList[2].gpa,
scope.row.userCourseList[2].id
)
"
>编辑</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
...@@ -141,10 +146,10 @@ ...@@ -141,10 +146,10 @@
<span v-if="scope.row.userCourseList[3].csoCourseCode"> <span v-if="scope.row.userCourseList[3].csoCourseCode">
{{ scope.row.userCourseList[3].csoCourseCode }}</span {{ scope.row.userCourseList[3].csoCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[3].auditCourseCode"> <span v-else-if="scope.row.userCourseList[3].auditCourseCode">
{{ scope.row.userCourseList[3].auditCourseCode }}</span {{ scope.row.userCourseList[3].auditCourseCode }}</span
> >
<span v-if="scope.row.userCourseList[3].ownCourseCode"> <span v-else-if="scope.row.userCourseList[3].ownCourseCode">
{{ scope.row.userCourseList[3].ownCourseCode }}</span {{ scope.row.userCourseList[3].ownCourseCode }}</span
> >
</template> </template>
...@@ -156,21 +161,24 @@ ...@@ -156,21 +161,24 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="编辑分数"> <el-table-column align="center" label="编辑分数">
<template slot-scope="scope" v-if="scope.row.userCourseList[3]"> <template slot-scope="scope" v-if="scope.row.userCourseList[3]">
<el-button @click="updateScore(scope.row.userCourseList[3].gpa,scope.row.userCourseList[3].id)">编辑</el-button> <el-button
@click="
updateScore(
scope.row.userCourseList[3].gpa,
scope.row.userCourseList[3].id
)
"
>编辑</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import { editScore, getHaveScoreStu } from "@/api/cso2";
editScore,
getHaveScoreStu
} from "@/api/cso2";
import { formatDate } from "@/utils/date"; import { formatDate } from "@/utils/date";
// const defaultListQuery = { // const defaultListQuery = {
// pageNum: 1, // pageNum: 1,
...@@ -193,9 +201,9 @@ export default { ...@@ -193,9 +201,9 @@ export default {
editNoticeVisible: false, editNoticeVisible: false,
pickerOptions: {}, pickerOptions: {},
haveGpaStu: [], haveGpaStu: [],
editScoreList:{ editScoreList: {
id:0, id: 0,
gpa:0 gpa: 0
} }
}; };
}, },
...@@ -210,18 +218,15 @@ export default { ...@@ -210,18 +218,15 @@ export default {
} }
}, },
watch:{ watch: {
stuName(newVal, oldVal) {
stuName(newVal,oldVal){
this.oneStu = newVal; this.oneStu = newVal;
// console.log(typeof(this.oneStu),this.oneStu,'this.oneStu'); // console.log(typeof(this.oneStu),this.oneStu,'this.oneStu');
// methods的函数在这里调用可以获取到newOrderData的值 // methods的函数在这里调用可以获取到newOrderData的值
this.getList() this.getList();
}, }
}, },
methods: { methods: {
getList() { getList() {
this.listLoading = true; this.listLoading = true;
...@@ -229,7 +234,7 @@ export default { ...@@ -229,7 +234,7 @@ export default {
getHaveScoreStu({ getHaveScoreStu({
pageNum: 1, pageNum: 1,
pageSize: 999, pageSize: 999,
customerName:this.oneStu customerName: this.oneStu
}).then(res => { }).then(res => {
this.listLoading = false; this.listLoading = false;
...@@ -242,7 +247,6 @@ export default { ...@@ -242,7 +247,6 @@ export default {
}); });
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
// 翻页 // 翻页
this.listQuery.pageNum = val; this.listQuery.pageNum = val;
...@@ -254,10 +258,10 @@ export default { ...@@ -254,10 +258,10 @@ export default {
}, },
//编辑分数 //编辑分数
updateScore(gpa,id){ updateScore(gpa, id) {
this.editNoticeVisible = true; this.editNoticeVisible = true;
this.editScoreList.gpa = gpa this.editScoreList.gpa = gpa;
this.editScoreList.id = id this.editScoreList.id = id;
}, },
cancel(formName) { cancel(formName) {
this.editNoticeVisible = false; this.editNoticeVisible = false;
...@@ -272,12 +276,10 @@ export default { ...@@ -272,12 +276,10 @@ export default {
let arr = []; let arr = [];
if (this.editScoreList.gpa) { if (this.editScoreList.gpa) {
let obj = {}; let obj = {};
obj.userCourseId = this.editScoreList.id; obj.userCourseId = this.editScoreList.id;
obj.gpa = this.editScoreList.gpa; obj.gpa = this.editScoreList.gpa;
arr.push(obj); arr.push(obj);
} }
if (arr.length == 0) { if (arr.length == 0) {
this.$message({ this.$message({
...@@ -285,8 +287,7 @@ export default { ...@@ -285,8 +287,7 @@ export default {
message: "请先打分再提交", message: "请先打分再提交",
duration: 1000 duration: 1000
}); });
} } else {
else{
this.$confirm("请认真核对课程名称和分数!", "提示", { this.$confirm("请认真核对课程名称和分数!", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
...@@ -306,13 +307,8 @@ export default { ...@@ -306,13 +307,8 @@ export default {
}); });
}); });
} }
}, }
}
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment