|
@@ -92,7 +92,36 @@
|
|
}}份,备用{{ packageInfos.paperBackupCount }}份)
|
|
}}份,备用{{ packageInfos.paperBackupCount }}份)
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
- <el-button type="primary" @click="toAdd">新增考试对象</el-button>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'ExamTaskStudentObjectImport')"
|
|
|
|
+ type="success"
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
+ ><a :href="downloadUrl" :download="dfilename"
|
|
|
|
+ >模板下载</a
|
|
|
|
+ ></el-button
|
|
|
|
+ >
|
|
|
|
+ <upload-button
|
|
|
|
+ v-if="checkPrivilege('button', 'ExamTaskStudentObjectImport')"
|
|
|
|
+ btn-icon="el-icon-circle-plus-outline"
|
|
|
|
+ btn-content="批量导入"
|
|
|
|
+ btn-type="success"
|
|
|
|
+ :upload-url="uploadUrl"
|
|
|
|
+ :upload-data="uploadData"
|
|
|
|
+ :format="['xls', 'xlsx']"
|
|
|
|
+ accept=".xls,.xlsx"
|
|
|
|
+ @valid-error="validError"
|
|
|
|
+ @upload-success="uploadSuccess"
|
|
|
|
+ >
|
|
|
|
+ </upload-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'ExamTaskStudentObject')"
|
|
|
|
+ type="primary"
|
|
|
|
+ :disabled="studentUploaded && tableData.length"
|
|
|
|
+ @click="toAdd"
|
|
|
|
+ >新增考试对象</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<el-table ref="TableList" :data="tableData" border>
|
|
<el-table ref="TableList" :data="tableData" border>
|
|
<el-table-column type="index" width="50" label="卷袋序号">
|
|
<el-table-column type="index" width="50" label="卷袋序号">
|
|
@@ -189,7 +218,7 @@
|
|
<!-- ModifyExamStudent -->
|
|
<!-- ModifyExamStudent -->
|
|
<modify-exam-student
|
|
<modify-exam-student
|
|
ref="ModifyExamStudent"
|
|
ref="ModifyExamStudent"
|
|
- :selected-ids="selectedStudentIds"
|
|
|
|
|
|
+ :disabled-ids="disabledStudentIds"
|
|
:course-id="infoExamTask.courseId"
|
|
:course-id="infoExamTask.courseId"
|
|
@modified="examStudentModified"
|
|
@modified="examStudentModified"
|
|
></modify-exam-student>
|
|
></modify-exam-student>
|
|
@@ -208,10 +237,11 @@ import { listTaskPrintHouse } from "../../api";
|
|
import ModifyExamStudent from "./ModifyExamStudent";
|
|
import ModifyExamStudent from "./ModifyExamStudent";
|
|
import PreviewTaskStudent from "./PreviewTaskStudent";
|
|
import PreviewTaskStudent from "./PreviewTaskStudent";
|
|
import { mapState, mapMutations } from "vuex";
|
|
import { mapState, mapMutations } from "vuex";
|
|
|
|
+import UploadButton from "@/components/UploadButton";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "info-print-task",
|
|
name: "info-print-task",
|
|
- components: { ModifyExamStudent, PreviewTaskStudent },
|
|
|
|
|
|
+ components: { ModifyExamStudent, PreviewTaskStudent, UploadButton },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
modalForm: {
|
|
modalForm: {
|
|
@@ -235,11 +265,20 @@ export default {
|
|
paperBackupCount: 0
|
|
paperBackupCount: 0
|
|
},
|
|
},
|
|
selectedStudentIds: [],
|
|
selectedStudentIds: [],
|
|
|
|
+ disabledStudentIds: [],
|
|
examStudentList: [],
|
|
examStudentList: [],
|
|
// date-picker
|
|
// date-picker
|
|
curCreateTime: [],
|
|
curCreateTime: [],
|
|
createDate: "",
|
|
createDate: "",
|
|
- createTime: []
|
|
|
|
|
|
+ createTime: [],
|
|
|
|
+ // import
|
|
|
|
+ uploadUrl: "/api/admin/exam/task/exam_task_exam_student_import",
|
|
|
|
+ uploadData: {
|
|
|
|
+ examObjectType: "IMPORT_STUDENT"
|
|
|
|
+ },
|
|
|
|
+ downloadUrl: "/temps/studentTemplate.xlsx",
|
|
|
|
+ dfilename: "学生导入模板.xlsx",
|
|
|
|
+ studentUploaded: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -429,7 +468,7 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- this.selectedStudentIds = this.getTabelStudentIds();
|
|
|
|
|
|
+ this.disabledStudentIds = this.getTabelStudentIds();
|
|
this.$refs.ModifyExamStudent.open();
|
|
this.$refs.ModifyExamStudent.open();
|
|
},
|
|
},
|
|
getTabelStudentIds() {
|
|
getTabelStudentIds() {
|
|
@@ -445,6 +484,7 @@ export default {
|
|
let modalFormData = { ...this.modalForm };
|
|
let modalFormData = { ...this.modalForm };
|
|
delete modalFormData.printHouseId;
|
|
delete modalFormData.printHouseId;
|
|
let data = {
|
|
let data = {
|
|
|
|
+ id: "",
|
|
examPlace: "",
|
|
examPlace: "",
|
|
examRoom: "",
|
|
examRoom: "",
|
|
classId: "",
|
|
classId: "",
|
|
@@ -465,22 +505,24 @@ export default {
|
|
return data;
|
|
return data;
|
|
},
|
|
},
|
|
examStudentModified(selectedStudents) {
|
|
examStudentModified(selectedStudents) {
|
|
- let tableMap = {};
|
|
|
|
- const initTableRow = this.getInitTableRow();
|
|
|
|
- this.tableData.forEach(item => {
|
|
|
|
- tableMap[item.classId] = item;
|
|
|
|
|
|
+ if (this.studentUploaded) {
|
|
|
|
+ this.tableData = [];
|
|
|
|
+ this.studentUploaded = false;
|
|
|
|
+ }
|
|
|
|
+ let examTaskStudentObjectParamList = [];
|
|
|
|
+ selectedStudents.forEach(item => {
|
|
|
|
+ examTaskStudentObjectParamList.push(...item.children);
|
|
});
|
|
});
|
|
-
|
|
|
|
- this.tableData = selectedStudents.map(item => {
|
|
|
|
- const prevData = tableMap[item.classId] || initTableRow;
|
|
|
|
- return this.$objAssign(prevData, {
|
|
|
|
- backupCount: this.infoExamPrintPlan.backupCount,
|
|
|
|
- classId: item.classId,
|
|
|
|
- className: item.className,
|
|
|
|
- studentCount: item.children.length,
|
|
|
|
- examTaskStudentObjectParamList: item.children
|
|
|
|
- });
|
|
|
|
|
|
+ let tableRow = this.$objAssign(this.getInitTableRow(), {
|
|
|
|
+ id: this.$randomCode(),
|
|
|
|
+ classId: selectedStudents.map(item => item.classId).join(),
|
|
|
|
+ className: selectedStudents.map(item => item.className).join(),
|
|
|
|
+ backupCount: this.infoExamPrintPlan.backupCount,
|
|
|
|
+ studentCount: examTaskStudentObjectParamList.length,
|
|
|
|
+ examTaskStudentObjectParamList
|
|
});
|
|
});
|
|
|
|
+ this.tableData.push(tableRow);
|
|
|
|
+
|
|
this.updatePackageInfos();
|
|
this.updatePackageInfos();
|
|
},
|
|
},
|
|
toDelete(row) {
|
|
toDelete(row) {
|
|
@@ -490,16 +532,27 @@ export default {
|
|
this.updatePackageInfos();
|
|
this.updatePackageInfos();
|
|
},
|
|
},
|
|
toViewStudent(row) {
|
|
toViewStudent(row) {
|
|
- console.log(row);
|
|
|
|
|
|
+ // console.log(row);
|
|
this.examStudentList = row.examTaskStudentObjectParamList.map(item => {
|
|
this.examStudentList = row.examTaskStudentObjectParamList.map(item => {
|
|
return {
|
|
return {
|
|
id: item.studentId,
|
|
id: item.studentId,
|
|
studentName: item.studentName,
|
|
studentName: item.studentName,
|
|
studentCode: item.studentCode,
|
|
studentCode: item.studentCode,
|
|
- className: row.className
|
|
|
|
|
|
+ className: item.basicClazzName
|
|
};
|
|
};
|
|
});
|
|
});
|
|
this.$refs.PreviewTaskStudent.open();
|
|
this.$refs.PreviewTaskStudent.open();
|
|
|
|
+ },
|
|
|
|
+ // import
|
|
|
|
+ validError(errorData) {
|
|
|
|
+ this.$message.error(errorData.message);
|
|
|
|
+ },
|
|
|
|
+ uploadSuccess(res) {
|
|
|
|
+ this.studentUploaded = true;
|
|
|
|
+ console.log(res.data);
|
|
|
|
+ this.$message.success("导入成功!");
|
|
|
|
+ // this.getStudents("BASIC_CLAZZ_STUDENT");
|
|
|
|
+ // const selectedUsers = this.parseStudentData(res.data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|