|
@@ -6,87 +6,68 @@
|
|
|
学生考勤列表
|
|
|
</h2>
|
|
|
<div class="m-core">
|
|
|
- <!-- <el-form :inline="true"
|
|
|
- ref='searchForm'
|
|
|
- :model="searchForm">
|
|
|
+ <save-form
|
|
|
+ :inline="true"
|
|
|
+ ref="searchForm"
|
|
|
+ :model="searchForm"
|
|
|
+ @submit="search"
|
|
|
+ @reset="onReSet"
|
|
|
+ >
|
|
|
<el-form-item>
|
|
|
- <el-input v-model.trim="searchForm.search"
|
|
|
- style="width:260px"
|
|
|
- @keyup.enter.native="search"
|
|
|
- placeholder='学生编号,姓名,课程编号,课程名'></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="organId">
|
|
|
- <el-select class="multiple"
|
|
|
- v-model.trim="searchForm.organId"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- placeholder="请选择分部">
|
|
|
- <el-option v-for="(item,index) in organList"
|
|
|
- :key="index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchForm.studentID"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="search"
|
|
|
+ placeholder="学生编号"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-select v-model.trim="searchForm.courseScheduleType"
|
|
|
- clearable
|
|
|
- placeholder="请选择课程类型">
|
|
|
- <el-option v-for='(item,index) in courseType'
|
|
|
- :key="index"
|
|
|
- :value="item.value"
|
|
|
- :label="item.label"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchForm.musicGroupId"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="search"
|
|
|
+ placeholder="乐团编号"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-select v-model.trim="searchForm.signInStatus"
|
|
|
- clearable
|
|
|
- placeholder="签到状态">
|
|
|
- <el-option :value="1"
|
|
|
- label="正常签到"></el-option>
|
|
|
- <el-option :value="0"
|
|
|
- label="异常签到"></el-option>
|
|
|
- <el-option :value="3"
|
|
|
- label="未签到"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchForm.courseScheduleId"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="search"
|
|
|
+ placeholder="课程编号"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-select v-model.trim="searchForm.signOutStatus"
|
|
|
- clearable
|
|
|
- placeholder="签退状态">
|
|
|
- <el-option :value="1"
|
|
|
- label="正常签退"></el-option>
|
|
|
- <el-option :value="0"
|
|
|
- label="异常签退"></el-option>
|
|
|
- <el-option :value="3"
|
|
|
- label="未签退"></el-option>
|
|
|
+ <el-select
|
|
|
+ v-model.trim="searchForm.groupType"
|
|
|
+ placeholder="请选择课程组类型"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in courseListType"
|
|
|
+ :key="index"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-date-picker v-model.trim="courseTime"
|
|
|
- style="width:410px;"
|
|
|
- type="daterange"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="考勤开始日期"
|
|
|
- :picker-options="{
|
|
|
- firstDayOfWeek: 1
|
|
|
- }"
|
|
|
- end-placeholder="考勤结束日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button @click="search"
|
|
|
- type="danger">搜索</el-button>
|
|
|
- <el-button @click="onReSet"
|
|
|
- type="primary">重置</el-button>
|
|
|
+ <el-select
|
|
|
+ v-model.trim="searchForm.status"
|
|
|
+ placeholder="请选择学生状态"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in attendanceStatus"
|
|
|
+ :key="index"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button @click="onExport"
|
|
|
- type="primary"
|
|
|
- v-permission="'export/queryTeacherAttendances'"
|
|
|
- style="background-color: #14928a; border: 1px solid #14928a;">导出</el-button>
|
|
|
+ <el-button native-type="submit" type="danger">搜索</el-button>
|
|
|
+ <el-button native-type="reset" type="primary">重置</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form> -->
|
|
|
+ </save-form>
|
|
|
<div class="tableWrap">
|
|
|
<el-table
|
|
|
style="width: 100%"
|
|
@@ -95,19 +76,27 @@
|
|
|
>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="organName"
|
|
|
+ prop="courseSchedule.organization.name"
|
|
|
label="分部"
|
|
|
></el-table-column>
|
|
|
+ <el-table-column align="center" prop="username" label="学生姓名">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{ scope.row.username }}
|
|
|
+ <p style="color: #f56c6c">({{ scope.row.userId }})</p >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="teacherName"
|
|
|
- label="学生姓名"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="teacherName"
|
|
|
+ prop="courseSchedule.teacherName"
|
|
|
label="老师姓名"
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.courseSchedule.teacherName }}
|
|
|
+ <p style="color: #f56c6c">({{ scope.row.teacherId }})</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="courseScheduleId"
|
|
@@ -115,14 +104,25 @@
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="courseScheduleName"
|
|
|
+ prop="musicGroupId"
|
|
|
+ label="乐团编号"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="courseSchedule.name"
|
|
|
label="课程名称"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="classDate"
|
|
|
+ prop="courseSchedule.classDate"
|
|
|
label="上课日期"
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{ scope.row.courseSchedule.classDate | dayjsFormat }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="startClassTime"
|
|
@@ -130,32 +130,40 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{ scope.row.startClassTime + "-" + scope.row.endClassTime }}
|
|
|
+ {{
|
|
|
+ scope.row.courseSchedule.startClassTime | dayjsFormatMinute
|
|
|
+ }}-{{
|
|
|
+ scope.row.courseSchedule.endClassTime | dayjsFormatMinute
|
|
|
+ }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="startClassTime"
|
|
|
- label="课程类型"
|
|
|
+ label="课程组类型"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{ scope.row.courseScheduleType | coursesType }}
|
|
|
+ {{ scope.row.groupType | coursesType }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="签到时间">
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="startClassTime"
|
|
|
+ label="课程类型"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{ scope.row.signInTime }}
|
|
|
+ {{ scope.row.courseSchedule.type | coursesType }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="签到状态">
|
|
|
+ <el-table-column align="center" label="签到时间" width="180px">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{ scope.row.signInStatus | attendanceType }}
|
|
|
+ {{ scope.row.signInTime }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -163,6 +171,7 @@
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="startClassTime"
|
|
|
+ width="180px"
|
|
|
label="签退时间"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
@@ -171,21 +180,16 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="签退状态">
|
|
|
+ <el-table-column align="center" label="学生状态">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{ scope.row.signOutStatus | attendanceOutType }}
|
|
|
+ {{ scope.row.status | clockingIn }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="remark"
|
|
|
- label="备注"
|
|
|
- ></el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
- sync
|
|
|
+ sync
|
|
|
:total.sync="rules.total"
|
|
|
:page.sync="rules.page"
|
|
|
:limit.sync="rules.limit"
|
|
@@ -204,27 +208,27 @@ import pagination from "@/components/Pagination/index";
|
|
|
import load from "@/utils/loading";
|
|
|
import qs from "qs";
|
|
|
import { findStudentAttendance } from "@/api/buildTeam";
|
|
|
+
|
|
|
// import { queryTeacherAttendances } from "@/api/recodeManager";
|
|
|
-import { courseType } from "@/utils/searchArray";
|
|
|
-let nowTime = new Date();
|
|
|
-nowTime =
|
|
|
- nowTime.getFullYear() +
|
|
|
- "-" +
|
|
|
- (nowTime.getMonth() + 1) +
|
|
|
- "-" +
|
|
|
- nowTime.getDate();
|
|
|
+import {
|
|
|
+ courseType,
|
|
|
+ courseListType,
|
|
|
+ attendanceStatus,
|
|
|
+} from "@/utils/searchArray";
|
|
|
export default {
|
|
|
components: { pagination },
|
|
|
data() {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
- search: null,
|
|
|
- organId: null,
|
|
|
- signInStatus: null,
|
|
|
- signOutStatus: null,
|
|
|
+ studentID: '',
|
|
|
+ groupType: "MUSIC",
|
|
|
+ musicGroupId: "",
|
|
|
+ courseScheduleId: "",
|
|
|
+ status: "",
|
|
|
},
|
|
|
- courseTime: [nowTime, nowTime],
|
|
|
courseType,
|
|
|
+ courseListType,
|
|
|
+ attendanceStatus,
|
|
|
// teacherList: [],
|
|
|
tableList: [],
|
|
|
organList: [],
|
|
@@ -241,17 +245,6 @@ export default {
|
|
|
created() {},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
- // getTeacher().then(res => {
|
|
|
- // if (res.code == 200) {
|
|
|
- // this.teacherList = res.data;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // 获取分部
|
|
|
- // getEmployeeOrgan().then((res) => {
|
|
|
- // if (res.code == 200) {
|
|
|
- // this.organList = res.data;
|
|
|
- // }
|
|
|
- // });
|
|
|
this.init();
|
|
|
},
|
|
|
|
|
@@ -260,15 +253,11 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
getList() {
|
|
|
- let obj = { page: this.rules.page, rows: this.rules.limit };
|
|
|
- // Object.assign(obj, this.searchForm);
|
|
|
- // if (this.courseTime && this.courseTime.length > 0) {
|
|
|
- // obj.courseStartDate = this.courseTime[0];
|
|
|
- // obj.courseEndDate = this.courseTime[1];
|
|
|
- // } else {
|
|
|
- // this.$message.error("请选择搜索时间");
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ let obj = {
|
|
|
+ page: this.rules.page,
|
|
|
+ rows: this.rules.limit,
|
|
|
+ ...this.searchForm,
|
|
|
+ };
|
|
|
findStudentAttendance(obj).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.tableList = res.data.rows;
|
|
@@ -283,74 +272,14 @@ export default {
|
|
|
onReSet() {
|
|
|
this.searchForm = {
|
|
|
search: null,
|
|
|
- organIdList: null,
|
|
|
- signInStatus: null,
|
|
|
- signOutStatus: null,
|
|
|
+ groupType: "MUSIC",
|
|
|
+ musicGroupId: "",
|
|
|
+ courseScheduleId: "",
|
|
|
+ status: "",
|
|
|
};
|
|
|
- this.courseTime = [nowTime, nowTime];
|
|
|
this.$refs["searchForm"].resetFields();
|
|
|
this.search();
|
|
|
},
|
|
|
- onExport() {
|
|
|
- let obj = { page: this.rules.page, rows: this.rules.limit };
|
|
|
- Object.assign(obj, this.searchForm);
|
|
|
- if (this.courseTime && this.courseTime.length > 0) {
|
|
|
- obj.courseStartDate = this.courseTime[0];
|
|
|
- obj.courseEndDate = this.courseTime[1];
|
|
|
- } else {
|
|
|
- this.$message.error("请选择搜索时间");
|
|
|
- return;
|
|
|
- }
|
|
|
- let url = "/api-web/export/queryTeacherAttendances";
|
|
|
- const options = {
|
|
|
- method: "POST",
|
|
|
- headers: {
|
|
|
- Authorization: getToken(),
|
|
|
- },
|
|
|
- params: obj,
|
|
|
- url,
|
|
|
- responseType: "blob",
|
|
|
- };
|
|
|
- this.$confirm("您确定导出考勤列表", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- load.startLoading();
|
|
|
- axios(options)
|
|
|
- .then((res) => {
|
|
|
- let blob = new Blob([res.data], {
|
|
|
- // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
- type: "application/vnd.ms-excel;charset=utf-8",
|
|
|
- //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
- });
|
|
|
-
|
|
|
- let text = new Response(blob).text();
|
|
|
- text.then((res) => {
|
|
|
- // 判断是否报错
|
|
|
- if (res.indexOf("code") != -1) {
|
|
|
- let json = JSON.parse(res);
|
|
|
- this.$message.error(json.msg);
|
|
|
- } else {
|
|
|
- let objectUrl = URL.createObjectURL(blob);
|
|
|
- let link = document.createElement("a");
|
|
|
- let fname = "考勤列表" + new Date().getTime(); //下载文件的名字
|
|
|
- link.href = objectUrl;
|
|
|
- link.setAttribute("download", fname);
|
|
|
- document.body.appendChild(link);
|
|
|
- link.click();
|
|
|
- }
|
|
|
- });
|
|
|
- load.endLoading();
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- this.$message.error("导出数据失败,请联系管理员");
|
|
|
- load.endLoading();
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|