Commit 3d85ecf0 by lizhi

优化

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