KindergartenUI/src/views/system/testItemScore/index.vue
2022-08-30 11:30:05 +08:00

1349 lines
36 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="所属班级" prop="className">
<el-input
v-model="queryParams.className"
placeholder="请输入所属班级"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="学生姓名" prop="studentName">
<el-input
v-model="queryParams.studentName"
placeholder="请输入学生姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批次编号" prop="batchCode">
<el-input
v-model="queryParams.batchCode"
placeholder="请输入批次编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:testItemScore:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:testItemScore:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:testItemScore:remove']"
>删除</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:testItemScore:export']"
>导出</el-button
>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="testItemScoreList"
@selection-change="handleSelectionChange"
@row-dblclick="handledbClick"
ref="table"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
width="150"
label="所属批次编号"
align="center"
prop="batchCode"
/>
<el-table-column label="批次名称" align="center" prop="batchName" />
<el-table-column label="班级名称" align="center" prop="className" />
<el-table-column label="学生姓名" align="center" prop="studentName" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<!-- <el-table-column label="修改人" align="center" prop="updateBy" />
<el-table-column label="修改时间" align="center" prop="updateTime" /> -->
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:testItemScore:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:testItemScore:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- //添加个人成绩录入管理 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1000px"
append-to-body
:before-close="cancel"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="110px"
:inline="true"
>
<el-form-item label="所属幼儿园" prop="classId" v-if="form.id == ''">
<el-button
type=""
@click="yryinnerVisible = true"
v-if="kindergartenName == '请选择幼儿园'"
style="
width: 240px;
text-align: left;
height: 36px;
color: #c0c4cc;
padding-left: -10px;
"
>{{ kindergartenName }}</el-button
>
<el-button
type=""
@click="yryinnerVisible = true"
v-else
style="
width: 240px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ kindergartenName }}</el-button
>
</el-form-item>
<el-form-item label="所属班级" prop="classId" v-if="form.id == ''">
<el-button
type=""
@click="handleQuery2"
v-if="xmname == '请选择所属班级'"
style="
width: 200px;
text-align: left;
height: 36px;
color: #c0c4cc;
padding-left: -10px;
"
>{{ xmname }}</el-button
>
<el-button
type=""
@click="handleQuery2"
v-else
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ xmname }}</el-button
>
</el-form-item>
<el-form-item label="学生姓名" prop="studentId" v-if="form.id == null">
<el-button
disabled
type=""
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ stname }}</el-button
>
</el-form-item>
<el-form-item label="学生姓名" prop="studentId" v-else>
<el-button
this.stname="row.studentName;"
type=""
@click="studentinfoclick"
v-if="stname == '请选择学生姓名'"
style="
width: 200px;
text-align: left;
height: 36px;
color: #c0c4cc;
padding-left: -10px;
"
>{{ stname }}</el-button
>
<el-button
this.stname="row.studentName"
type=""
@click="studentinfoclick"
v-else
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ stname }}</el-button
>
</el-form-item>
<el-form-item label="批次编号" prop="batchCode" v-if="form.id == null">
<el-button
type=""
disabled
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ itemNumbername }}</el-button
>
</el-form-item>
<el-form-item label="批次编号" prop="batchCode" v-else>
<el-button
this.itemNumbername="row.batchCode;"
type=""
@click="testclick"
v-if="itemNumbername == '请选择批次编号'"
style="
width: 200px;
text-align: left;
height: 36px;
color: #c0c4cc;
padding-left: -10px;
"
>{{ itemNumbername }}</el-button
>
<el-button
type=""
@click="testclick"
v-else
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ itemNumbername }}</el-button
>
</el-form-item>
</el-form>
<el-table
ref="singleTable"
:data="form.itemScoreList"
style="width: 95%; margin: 20px auto"
>
<el-table-column
property="itemCode"
label="项目编号"
width="185"
align="center"
>
</el-table-column>
<el-table-column
property="itemName"
label="项目名称"
width="185"
align="center"
>
</el-table-column>
<!-- <el-table-column
property="scoreDictId"
label="字典类型"
align="center"
width="120"
>
<template slot-scope="scope">
{{
scope.row.scoreDictId == ResultType1.dictCode
? ResultType1.dictLabel
: ""
}}{{
scope.row.scoreDictId == ResultType2.dictCode
? ResultType2.dictLabel
: ""
}}</template
>
</el-table-column> -->
<el-table-column
property="itemScore"
label="个人成绩"
width="180"
align="center"
>
<template slot-scope="scope">
<el-input
type="number"
v-model="scope.row.itemScore"
v-if="
scope.row.itemScore != null ||
scope.row.scoreDictId == ResultType1.dictCode
"
></el-input>
<el-input
v-model="scope.row.scoreDictValue"
v-if="
scope.row.scoreDictValue != null ||
scope.row.scoreDictId == ResultType2.dictCode
"
></el-input>
</template>
</el-table-column>
<el-table-column
property="itemFraction"
label="个人成绩得分"
width="180"
align="center"
>
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.itemFraction"></el-input>
</template>
</el-table-column>
<el-table-column
property="syntheticalAssess"
label="综合评价"
width="180"
align="center"
>
<template slot-scope="scope">
<el-input v-model="scope.row.syntheticalAssess"></el-input>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- //幼儿园 -->
<el-dialog
width="850px"
title="选择所属幼儿园"
:visible.sync="yryinnerVisible"
append-to-body
:before-close="kindergartencancel"
>
<el-table :data="kindergartenList">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
circle
@click="kindergartenNameclick(scope.row)"
v-if="kindergartenId == scope.row.id"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="kindergartenNameclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="kindergartenName"
label="幼儿园名字"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="kindergartenAddress"
label="幼儿园地址"
width="150"
align="center"
>
</el-table-column>
<el-table-column
label="幼儿园所在组织"
align="center"
prop="organizeName"
width="150"
>
</el-table-column>
<el-table-column
property="contacts"
label="联系人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="phone"
label="联系电话"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total6 > 0"
:total="total6"
:page.sync="kqueryParams.pageNum"
:limit.sync="kqueryParams.pageSize"
@pagination="getList"
/>
</el-dialog>
<!--所属班级 弹窗 -->
<el-dialog
width="850px"
title="选择所属班级"
:visible.sync="innerVisible"
append-to-body
>
<el-form
:model="queryParams2"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="班级名称" prop="className">
<el-input
v-model="queryParams2.className"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery2"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="classInfos">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="itemId2 == scope.row.id"
circle
@click="xmclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="xmclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="className"
label="班级名称"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="classType"
label="班级类型"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.row.classType == "LARGE_CLASS" ? "大班" : "" }}
{{ scope.row.classType == "MIDDLE_CLASS" ? "中班" : "" }}
{{ scope.row.classType == "SMALL_CLASS" ? "小班" : "" }}
{{ scope.row.classType == "GRADUATE" ? "毕业" : "" }}
</template>
</el-table-column>
<el-table-column
property="classTeacher"
label="班主任姓名"
width="150"
align="center"
>
</el-table-column>
<!-- <el-table-column
property="classType"
label="班级类型"
width="150"
align="center"
>
</el-table-column> -->
<el-table-column
property="phone"
label="联系电话"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="creatBy"
label="创建人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="createTime"
label="创建时间"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="updateBy"
label="修改人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="updateTime"
label="修改时间"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total2 > 0"
:total="total2"
:page.sync="queryParams2.pageNum"
:limit.sync="queryParams2.pageSize"
@pagination="getList"
/>
</el-dialog>
<!-- 学生姓名弹窗 -->
<el-dialog
width="850px"
title="选择学生姓名"
:visible.sync="innerVisible2"
append-to-body
>
<el-form
:model="queryParams3"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="学生姓名" prop="studentName">
<el-input
v-model="queryParams3.studentName"
placeholder="请输入学生姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery3"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="studentInfos">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="itemId3 == scope.row.id"
circle
@click="studentclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="studentclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="studentName"
label="学生姓名"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="studentSex"
label="学生性别"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.row.studentSex == "MALE" ? "男" : "" }}
{{ scope.row.studentSex == "FEMALE" ? "女" : "" }}
</template>
</el-table-column>
<el-table-column
property="studentNumber"
label="学生编号"
width="150"
align="center"
>
</el-table-column>
<!-- <el-table-column
property="classType"
label="班级类型"
width="150"
align="center"
>
</el-table-column> -->
<el-table-column
property="birthDate"
label="出生日期"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="cardNumber"
label="身份证号"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="onceName"
label="曾用名"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="homeAddress"
label="家庭住址"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="creatBy"
label="创建人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="createTime"
label="创建时间"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="updateBy"
label="修改人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="updateTime"
label="修改时间"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total3 > 0"
:total="total3"
:page.sync="queryParams3.pageNum"
:limit.sync="queryParams3.pageSize"
@pagination="getList"
/>
</el-dialog>
<!-- 批次编号 -->
<el-dialog
width="850px"
title="选择批次编号"
:visible.sync="innerVisible4"
append-to-body
>
<el-form
:model="queryParams5"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="批次编号" prop="batchCode">
<el-input
v-model="queryParams5.batchCode"
placeholder="请输入批次编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery5"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="testScoreBatchs">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="itemNumbername == scope.row.batchCode"
circle
@click="batchCodeclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="batchCodeclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="batchCode"
label="批次编号"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="batchName"
label="批次名称"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="remark"
label="备注信息"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="creatBy"
label="创建人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="createTime"
label="创建时间"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="updateBy"
label="修改人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="updateTime"
label="修改时间"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total5 > 0"
:total="total5"
:page.sync="queryParams5.pageNum"
:limit.sync="queryParams5.pageSize"
@pagination="getList"
/>
</el-dialog>
</div>
</template>
<script>
import {
listTestItemScore,
getTestItemScore,
delTestItemScore,
addTestItemScore,
updateTestItemScore,
classInfo,
studentInfo,
testScoreBatch,
getAllTestItemScoreInfo,
} from "@/api/system/testItemScore";
import {
tKindergartenInfo,
listKindergartenInfo,
} from "@/api/system/kindergartenInfo";
import Treeselect from "@riophae/vue-treeselect";
export default {
name: "TestItemScore",
components: { Treeselect },
data() {
return {
value: "",
//项目测试类型
itemResultType: "item_result_type",
//字典类型
itemResultTypelist: [],
ResultType1: "", //numberLeixing
ResultType2: "", //textleixing
// 遮罩层
// 遮罩层
loading: true,
itemScore: "",
yryinnerVisible: false,
testItemScoreLists: [],
xmname: "请选择所属班级",
studentInfos: [],
innerVisible: false,
stname: "请选择学生姓名",
innerVisible2: false,
testItemss: [],
testScoreBatchs: [],
innerVisible4: false,
itemNumbername: "请选择批次编号",
//幼儿园查询参数
kqueryParams: {
pageNum: 1,
pageSize: 10,
organizeId: null,
kindergartenName: null,
kindergartenAddress: null,
kindergartenType: null,
phone: null,
contacts: null,
},
//幼儿园list
kindergartenList: [],
//幼儿园名字
kindergartenName: "请选择幼儿园",
//幼儿园ID
kindergartenId: "",
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
total2: 0,
total3: 0,
total4: 0,
total5: 0,
total6: 0,
// 班级信息表格数据
classInfos: [],
// 个人成绩录入管理表格数据
testItemScoreList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
itemId2: "",
itemId3: "",
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
className: null,
studentName: null,
itemName: null,
batchCode: null,
},
// 班级
queryParams2: {
pageNum: 1,
pageSize: 10,
kindergartenId: "",
className: null,
classType: null,
},
// 学生姓名
queryParams3: {
pageNum: 1,
pageSize: 10,
studentName: null,
classId: "",
},
// 批次编号
queryParams5: {
pageNum: 1,
pageSize: 10,
batchCode: null,
},
addqueryParams: {
studentId: "",
batchId: "",
batchCode: "",
},
// 表单参数
form: {},
// 表单校验
rules: {
classId: [
{ required: true, message: "所属班级不能为空", trigger: "blur" },
],
studentId: [
{ required: true, message: "学生姓名不能为空", trigger: "blur" },
],
testItemId: [
{ required: true, message: "测试项目名称不能为空", trigger: "blur" },
],
batchCode: [
{
required: true,
message: "批次编号不能为空",
trigger: "blur",
},
],
},
testitems: [],
};
},
created() {
this.getList();
},
methods: {
handledbClick(row, event, column) {
// alert("我被双击了");
this.$refs.table.toggleRowSelection(row);
console.log(row, event, column);
},
testclick() {
if (this.addqueryParams.studentId == "") {
this.$message.error("请先选择学生");
} else {
this.innerVisible4 = true;
}
},
delitem(item) {
console.log(item);
this.form.itemScoreList = this.form.itemScoreList.filter((e) => {
return e.id != item.id;
});
},
getAllTestItemScore() {
this.form.itemScoreList = [];
console.log(this.addqueryParams);
getAllTestItemScoreInfo(this.addqueryParams).then((res) => {
console.log(this.form);
this.form.itemScoreList = res.data;
});
},
//幼儿园左侧点击
kindergartenNameclick(row) {
this.queryParams2.kindergartenId = row.id;
this.kindergartenName = row.kindergartenName;
this.kindergartenId = row.id;
this.yryinnerVisible = false;
this.xmname = "请选择所属班级";
this.stname = "请选择学生姓名";
this.itemId2 = "";
this.itemId3 = "";
this.form.classId = null;
this.form.studentId = null;
},
//幼儿园关闭
kindergartencancel() {
this.yryinnerVisible = false;
},
// 班级信息
xmclick(row) {
console.log(row);
this.xmname = row.className;
this.itemId2 = row.id;
this.form.classId = row.id;
console.log(this.form);
this.innerVisible = false;
this.form.className = row.className;
this.queryParams3.classId = row.id;
this.stname = "请选择学生姓名";
this.itemId3 = "";
this.form.studentId = null;
},
//打开选择学生页面
studentinfoclick() {
if (this.queryParams3.classId == "" || !this.queryParams3.classId) {
this.$message.error("请先选择班级");
} else {
//查询学生信息
studentInfo(this.queryParams3).then((res) => {
this.studentInfos = res.rows;
this.total3 = res.total;
this.innerVisible2 = true;
this.itemId2 = this.queryParams3.classId;
});
}
},
// 学生信息
studentclick(row) {
this.stname = row.studentName;
this.itemId3 = row.id;
this.form.studentId = row.id;
this.addqueryParams.studentId = row.id;
this.innerVisible2 = false;
this.form.studentName = row.studentName;
if (this.form.batchCode != null) {
this.getAllTestItemScore();
}
// console.log(row);
},
//批次编号
batchCodeclick(row) {
this.itemNumbername = row.batchCode;
this.addqueryParams.batchCode = row.batchCode;
this.addqueryParams.batchId = row.id;
console.log(this.addqueryParams);
this.innerVisible4 = false;
this.form.batchCode = row.batchCode;
this.getAllTestItemScore();
},
/** 查询个人成绩录入管理列表 */
getList() {
//查询班级信息
this.loading = true;
//获取幼儿园list
listKindergartenInfo(this.kqueryParams).then((response) => {
this.kindergartenList = response.rows;
this.total6 = response.total;
});
// 查询测试成绩批次编号
testScoreBatch(this.queryParams5).then((res) => {
this.testScoreBatchs = res.rows;
this.total5 = res.total;
this.loading = false;
});
listTestItemScore(this.queryParams).then((response) => {
this.testItemScoreList = response.rows;
this.total = response.total;
this.loading = false;
});
tKindergartenInfo(this.itemResultType).then((res) => {
// console.log(res);
this.itemResultTypelist = res.data;
this.ResultType1 = this.itemResultTypelist[0];
this.ResultType2 = this.itemResultTypelist[1];
console.log(this.ResultType1);
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.kindergartenName = "请选择幼儿园";
this.kindergartenId = "";
this.xmname = "请选择所属班级";
this.stname = "请选择学生姓名";
this.itemNumbername = "请选择批次编号";
this.itemId2 = "";
this.itemId3 = "";
this.queryParams2.kindergartenId = "";
this.queryParams3.classId = "";
},
// 表单重置
reset() {
this.form = {
id: "",
classId: null,
studentId: null,
batchCode: null,
itemScoreList: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
// 所属班级
handleQuery2() {
this.queryParams2.pageNum = 1;
if (this.queryParams2.kindergartenId == "") {
this.$message.error("请先选择幼儿园");
} else {
classInfo(this.queryParams2).then((response) => {
this.classInfos = response.rows;
this.total = response.total;
this.loading = false;
this.innerVisible = true;
});
}
},
// 学生姓名
handleQuery3() {
this.queryParams3.pageNum = 1;
studentInfo(this.queryParams).then((response) => {
this.studentInfo = response.rows;
this.total = response.total;
this.loading = false;
this.getList();
});
},
// 批次编号
handleQuery5() {
this.queryParams5.pageNum = 1;
testScoreBatch(this.queryParams).then((response) => {
this.testScoreBatch = response.rows;
this.total = response.total;
this.loading = false;
this.getList();
});
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.queryParams.className ="";
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.itemId2 = "";
this.itemId3 = "";
this.title = "添加个人成绩录入管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
var list = {
studentId: row.studentId,
batchCode: row.batchCode,
};
this.form.itemScoreList = [];
getTestItemScore(list).then((response) => {
console.log();
this.form = response.data;
this.open = true;
this.queryParams3.classId = response.data.classId;
this.stname = response.data.studentName;
this.itemId3 = response.data.studentId;
this.addqueryParams.studentId = response.data.studentId;
this.itemNumbername = response.data.batchCode;
console.log(this.form);
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id == null) {
updateTestItemScore(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
this.xmname = "请选择所属班级";
this.stname = "请选择学生姓名";
this.itemNumbername = "请选择批次编号";
this.itemId2 = "";
this.itemId3 = "";
this.kindergartenName = "请选择幼儿园";
this.kindergartenId = "";
this.queryParams2.kindergartenId = "";
});
} else {
this.form.itemScoreList.forEach((e) => {
e.testItemId = e.itemId;
});
addTestItemScore(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
this.xmname = "请选择所属班级";
this.stname = "请选择学生姓名";
this.itemNumbername = "请选择批次编号";
this.itemId2 = "";
this.itemId3 = "";
this.kindergartenName = "请选择幼儿园";
this.kindergartenId = "";
this.queryParams2.kindergartenId = "";
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const studentId = row.studentId;
const batchCode = row.batchCode;
this.$modal
.confirm("是否确认删除个人成绩的数据项")
.then(function () {
return delTestItemScore(studentId, batchCode);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/testItemScore/export",
{
...this.queryParams,
},
`testItemScore_${new Date().getTime()}.xlsx`
);
},
},
};
</script>