123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538 |
- <!-- <filter-search @reload="reloadSearch" searchKey="ids" /> -->
- <template>
- <div class="m-container">
- <h2>
- <div class="squrt"></div>
- 学生考勤列表
- </h2>
- <div class="m-core">
- <save-form
- :inline="true"
- ref="searchForm"
- :model="searchForm"
- @submit="search"
- @reset="onReSet"
- >
- <el-form-item prop="studentID">
- <el-input
- v-model.trim="searchForm.studentID"
- clearable
- @keyup.enter.native="search"
- placeholder="学生编号"
- ></el-input>
- </el-form-item>
- <el-form-item prop="teacherId">
- <remote-search
- :commit="'setTeachers'"
- v-model="searchForm.teacherId"
- />
- </el-form-item>
- <el-form-item prop="organId">
- <el-select
- class="multiple"
- filterable
- style="width: 180px !important"
- v-model.trim="searchForm.organId"
- clearable
- placeholder="请选择分部"
- >
- <el-option
- v-for="(item, index) in selects.branchs"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="musicGroupId">
- <el-input
- v-model.trim="searchForm.musicGroupId"
- clearable
- @keyup.enter.native="search"
- placeholder="乐团编号"
- ></el-input>
- </el-form-item>
- <el-form-item prop="courseScheduleId">
- <el-input
- v-model.trim="searchForm.courseScheduleId"
- clearable
- @keyup.enter.native="search"
- placeholder="课程编号"
- ></el-input>
- </el-form-item>
- <el-form-item prop="groupType">
- <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 prop="courseScheduleType">
- <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-form-item>
- <el-form-item prop="visitFlag">
- <el-select
- v-model.trim="searchForm.visitFlag"
- placeholder="请选择是否回访"
- clearable
- >
- <el-option label="否" value="0"></el-option>
- <el-option label="是" value="1"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="status">
- <el-select
- v-model.trim="searchForm.status"
- placeholder="请选择考勤状态"
- clearable
- >
- <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 prop="dates">
- <el-date-picker
- v-model="searchForm.dates"
- type="daterange"
- style="width: 405px"
- range-separator="至"
- start-placeholder="课程开始日期"
- end-placeholder="课程结束日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button native-type="submit" type="danger">搜索</el-button>
- <el-button native-type="reset" type="primary">重置</el-button>
- <!-- <el-button
- @click="onExport"
- type="primary"
- v-permission="'export/queryTeacherAttendances'"
- style="background-color: #14928a; border: 1px solid #14928a"
- >导出</el-button> -->
- </el-form-item>
- </save-form>
- <div class="tableWrap">
- <el-table
- style="width: 100%"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- :data="tableList"
- >
- <el-table-column
- align="center"
- prop="courseSchedule.organization.name"
- label="分部"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="username"
- label="学生姓名"
- width="110px"
- >
- <template slot-scope="scope">
- <div>
- {{ scope.row.username }}
- <p style="color: #f56c6c">
- (<copy-text>{{ scope.row.userId }}</copy-text
- >)
- </p>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="courseSchedule.teacherName"
- width="120px"
- label="老师姓名"
- >
- <template slot-scope="scope">
- {{ scope.row.courseSchedule.teacherName }}
- <p style="color: #f56c6c" v-if="scope.row.teacherId">
- (<copy-text>{{ scope.row.teacherId }}</copy-text
- >)
- </p>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="musicGroupId" label="乐团编号">
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.musicGroupId }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="courseScheduleId"
- label="课程编号"
- >
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.courseScheduleId }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="courseSchedule.name"
- label="课程名称"
- ></el-table-column>
- <!-- <el-table-column
- align="center"
- prop="courseSchedule.classDate"
- label="上课日期"
- >
- <template slot-scope="scope">
- <div>
- </div>
- </template>
- </el-table-column> -->
- <el-table-column
- align="center"
- prop="startClassTime"
- label="课程组类型"
- >
- <template slot-scope="scope">
- <div>
- {{ scope.row.groupType | coursesType }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="startClassTime"
- label="课程类型"
- >
- <template slot-scope="scope">
- <div>
- {{ scope.row.courseSchedule.type | coursesType }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="合并类型">
- <template slot-scope="scope">
- <div>
- <!-- {{ scope.row.courseSchedule.newCourseId > 0 ? "是" : "否" }} -->
- {{
- scope.row.courseSchedule.newCourseId > 0 &&
- scope.row.courseSchedule.newCourseId ==
- scope.row.courseScheduleId
- ? "合并课"
- : null
- }}
- {{
- scope.row.courseSchedule.newCourseId > 0 &&
- scope.row.courseSchedule.newCourseId !=
- scope.row.courseScheduleId
- ? "被合并课"
- : null
- }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- width="180px"
- align="center"
- prop="startClassTime"
- label="上课时间"
- >
- <template slot-scope="scope">
- <div>
- {{ scope.row.courseSchedule.classDate | dayjsFormat }}
- {{
- scope.row.courseSchedule.startClassTime | dayjsFormatMinute
- }}-{{
- scope.row.courseSchedule.endClassTime | dayjsFormatMinute
- }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="签到时间" width="180px">
- <template slot-scope="scope">
- <div>
- {{ scope.row.signInTime }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="startClassTime"
- width="180px"
- label="签退时间"
- >
- <template slot-scope="scope">
- <div>
- {{ scope.row.signOutTime }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="考勤回访">
- <template slot-scope="scope">
- <div>{{ scope.row.visitFlag | yesOrNo }}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="考勤状态">
- <template slot-scope="scope">
- <div
- v-if="
- scope.row.courseSchedule &&
- scope.row.courseSchedule.status != 'NOT_START'
- "
- >
- {{ scope.row.status | clockingIn }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- fixed="right"
- label="操作"
- v-if="permission(getFullPermission('visit/add'))"
- >
- <template slot-scope="scope">
- <div>
- <el-button
- type="text"
- v-if="
- permission(getFullPermission('visit/add')) &&
- !scope.row.visitFlag
- "
- @click="addVisit(scope.row)"
- >新增回访</el-button
- >
- <el-button
- type="text"
- @click="lookVisit(scope.row)"
- v-if="
- scope.row.visitFlag &&
- permission(getFullPermission('visit/queryPage'))
- "
- >查看回访</el-button
- >
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- sync
- :total.sync="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList"
- />
- <el-dialog title="新增回访" width="500px" :visible.sync="visitVisible">
- <visit
- v-if="visitVisible && detail"
- :detail="detail"
- :username="detail.username"
- @close="visitVisible = false"
- @submited="getList"
- :isMainGo="true"
- />
- </el-dialog>
- </div>
- </div>
- </div>
- </template>
- <script>
- import axios from "axios";
- import { getToken } from "@/utils/auth";
- import pagination from "@/components/Pagination/index";
- import load from "@/utils/loading";
- import { getTimes } from "@/utils";
- import qs from "qs";
- import { permission } from "@/utils/directivePage";
- import { findStudentAttendance } from "@/api/buildTeam";
- import { Export } from "@/utils/downLoadFile";
- import cleanDeep from "clean-deep";
- // import { queryTeacherAttendances } from "@/api/recodeManager";
- import { courseType, courseListType, stuAttendance } from "@/utils/searchArray";
- import visit from "@/views/withdrawal-application/modals/visit";
- export default {
- components: { pagination, visit },
- data() {
- return {
- visitVisible: false,
- detail: null,
- searchForm: {
- studentID: "",
- groupType: "MUSIC",
- musicGroupId: "",
- courseScheduleId: "",
- status: "",
- teacherId: "",
- courseScheduleType: "",
- organId: "",
- visitFlag: "",
- dates: [],
- },
- courseType,
- courseListType,
- attendanceStatus: stuAttendance,
- // teacherList: [],
- tableList: [],
- organList: [],
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- };
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- const { query } = this.$route;
- if (this.searchForm.dates?.length < 1) {
- const start = query.start || new Date();
- const end = query.end || new Date();
- this.searchForm.dates = [start, end];
- }
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- const { query } = this.$route;
- if (query.visitFlag == 1 || query.visitFlag == 0) {
- this.searchForm.visitFlag = String(query.visitFlag);
- }
- if (query.status) {
- this.searchForm.status = query.status;
- }
- this.init();
- },
- methods: {
- permission,
- reloadSearch() {
- this.rules.page = 1;
- this.getList();
- },
- async init() {
- await this.$store.dispatch("setBranchs");
- this.getList();
- },
- addVisit(row) {
- this.visitVisible = true;
- this.detail = row;
- },
- // 导出
- async onExport() {
- const { dates, ...rest } = this.searchForm;
- let obj = {
- ...rest,
- page: this.rules.page,
- rows: this.rules.limit,
- ids: this.$route.query.ids,
- ...getTimes(dates, ["classStartDate", "classEndDate"], "YYYY-MM-DD"),
- };
- await Export(
- this,
- {
- url: "/api-web/export/exportStudentAttendances",
- fileName: "考勤列表.xls",
- method: "post",
- params: qs.stringify(cleanDeep(obj)),
- },
- "您确定考勤列表?"
- );
- },
- getList() {
- const { dates, ...rest } = this.searchForm;
- let obj = {
- ...rest,
- page: this.rules.page,
- rows: this.rules.limit,
- ...getTimes(
- dates,
- ["startDateOfCourse", "endDateOfCourse"],
- "YYYY-MM-DD"
- ),
- };
- // let obj = {
- // page: this.rules.page,
- // rows: this.rules.limit,
- // ...this.searchForm,
- // ...getTimes(
- // this.dates,
- // ["startDateOfCourse", "endDateOfCourse"],
- // "YYYY-MM-DD"
- // ),
- // };
- findStudentAttendance(obj, {
- ids: this.$route.query.ids,
- }).then((res) => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.rules.total = res.data.total;
- }
- });
- },
- clearSearchUrl() {
- const { query } = this.$route;
- if (
- query.status ||
- query.visitFlag == 0 ||
- query.visitFlag == 1 ||
- query.start ||
- query.end
- ) {
- this.$router.replace({
- status: undefined,
- visitFlag: undefined,
- start: undefined,
- end: undefined,
- });
- }
- },
- search() {
- this.rules.page = 1;
- this.clearSearchUrl();
- this.getList();
- },
- onReSet() {
- this.$refs["searchForm"].resetFields();
- this.clearSearchUrl();
- this.search();
- },
- lookVisit(row) {
- this.$router.push({
- path: "/studentManager/returnVisitList",
- query: { search: row.id },
- });
- },
- },
- };
- </script>
- <style lang='scss' scoped>
- </style>
|