123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- <!-- -->
- <template>
- <div class="m-core">
- <save-form :inline="true" :model.sync="searchForm" ref="searchForm">
- <el-form-item>
- <el-input
- v-model.trim="searchForm.search"
- clearable
- @keyup.enter.native="search"
- placeholder="老师名称、课程编号"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model.trim="searchForm.organId"
- clearable
- filterable
- 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>
- <el-select
- v-model.trim="searchForm.complaintsStatus"
- clearable
- filterable
- placeholder="申诉状态"
- >
- <el-option label="已拒绝" :value="0"></el-option>
- <el-option label="已通过" :value="1"></el-option>
- <el-option label="待处理" :value="2"></el-option>
- <el-option label="已撤销" :value="3"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-date-picker
- v-model.trim="searchForm.timer"
- style="width: 400px"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="课程开始日期"
- end-placeholder="课程结束日期"
- :picker-options="{
- firstDayOfWeek: 1,
- }"
- ></el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="danger" @click="search">搜索</el-button>
- <el-button @click="onReSet" type="primary">重置</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="organName"
- label="分部"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="courseScheduleId"
- label="课程编号"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="courseScheduleName"
- label="课程名称"
- ></el-table-column>
- <el-table-column
- align="center"
- width="180"
- prop="courseScheduleTime"
- label="课程时间"
- >
- <template slot-scope="scope">
- <div>
- <p>
- {{ scope.row.courseScheduleTime }}
- {{ scope.row.courseScheduleStartTime | timerForMinFormat }}-{{
- scope.row.courseScheduleEndTime | timerForMinFormat
- }}
- </p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="status" label="签到状态">
- <template slot-scope="scope">
- <div>
- <p>{{ scope.row.signInStatus | attendanceType }}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="status" label="签退状态">
- <template slot-scope="scope">
- <div>
- <p>{{ scope.row.signOutStatus | attendanceOutType }}</p>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="teacherName"
- label="老师名称"
- ></el-table-column>
- <el-table-column align="center" prop="studentId" label="状态">
- <template slot-scope="scope">
- <div>
- {{ scope.row.complaintsStatusEnum | complaintsStatusEnum }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="修复记录">
- <template slot-scope="scope">
- <div>
- {{ scope.row.updateAttendanceEnum | updateAttendanceEnum }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="operatorName"
- label="申诉处理者"
- ></el-table-column>
- <el-table-column align="center" label="操作">
- <!-- teacherAttendance/agreeTeacherAttendanceComplaints -->
- <template slot-scope="scope">
- <div>
- <el-button
- type="text"
- v-if="
- permission('teacherAttendance/operation/update') &&
- scope.row.complaintsStatusEnum == 2&&!settlemented
- "
- @click="lookDetail(scope.row)"
- >处理申诉</el-button
- >
- <el-button
- type="text"
- v-if="
- permission('teacherAttendance/operation') &&
- (scope.row.complaintsStatusEnum != 2|| settlemented)
- "
- @click="lookDetail(scope.row)"
- >查看</el-button
- >
- <!-- complaintsStatusEnum -->
- </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"
- />
- </div>
- <el-dialog title="考勤申诉" :visible.sync="dialogVisible" width="500px">
- <div>
- <el-form
- ref="visibleForm"
- :model="visibleForm"
- label-width="100px"
- class="visibleForm"
- >
- <el-form-item label="签到时间">
- {{ visibleForm.signInTime }}
- </el-form-item>
- <el-form-item label="签退时间">
- {{ visibleForm.signOutTime }}
- </el-form-item>
- <el-form-item label="申诉图片">
- <el-row>
- <el-col
- v-for="(item, index) in visibleForm.srcList"
- :key="index"
- :span="6"
- >
- <el-image
- style="width: 100px; height: 100px"
- fit="cover"
- :src="item"
- :preview-src-list="visibleForm.srcList"
- >
- </el-image>
- </el-col>
- </el-row>
- </el-form-item>
- <el-form-item label="申诉考勤状态">
- <el-checkbox
- v-if="
- visibleForm.complaintsType == 'SIGN_IN' ||
- visibleForm.complaintsType == 'ALL'
- "
- disabled
- :value="true"
- >签到状态</el-checkbox
- >
- <el-checkbox
- v-if="
- visibleForm.complaintsType == 'SIGN_OUT' ||
- visibleForm.complaintsType == 'ALL'
- "
- disabled
- :value="true"
- >签退状态</el-checkbox
- >
- </el-form-item>
- <el-form-item
- label="申诉内容"
- :rules="[
- { required: true, message: '请填写申诉内容', trigger: 'blur' },
- ]"
- prop="complaintsContent"
- >
- <el-input
- type="textarea"
- :rows="4"
- :disabled="visibleForm.complaintsStatusEnum != '2'"
- v-model.trim="visibleForm.complaintsContent"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="处理意见"
- :rules="[
- { required: true, message: '请填写处理意见', trigger: 'blur' },
- ]"
- prop="disposeContent"
- >
- <el-input
- type="textarea"
- :rows="4"
- :disabled="visibleForm.complaintsStatusEnum != '2'"
- v-model.trim="visibleForm.disposeContent"
- ></el-input>
- </el-form-item>
- <!-- -->
- <!-- <el-form-item
- label="请选择需要补正的状态"
- v-if="visibleForm.complaintsStatusEnum == '2'"
- >
- <br />
- <el-checkbox
- v-model="visibleForm.reSignInStatus"
- :disabled="visibleForm.complaintsStatusEnum != '2'"
- >签到状态</el-checkbox
- >
- <el-checkbox
- v-model="visibleForm.reSignOutStatus"
- :disabled="visibleForm.complaintsStatusEnum != '2'"
- >签退状态</el-checkbox
- >
- </el-form-item> -->
- </el-form>
- </div>
- <div slot="footer" v-if="visibleForm.complaintsStatusEnum == '2'">
- <el-button
- v-permission="'teacherAttendance/rejectTeacherAttendanceComplaints'"
- @click="subreset('DENIED')"
- >拒绝</el-button
- >
- <el-button
- v-permission="'teacherAttendance/agreeTeacherAttendanceComplaints'"
- type="primary"
- @click="subreset('AGREED')"
- >同意</el-button
- >
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import axios from "axios";
- import { getToken } from "@/utils/auth";
- import pagination from "@/components/Pagination/index";
- import load from "@/utils/loading";
- import { permission } from "@/utils/directivePage";
- import {
- queryTeacherAttendanceComplaints,
- agreeTeacherAttendanceComplaints,
- rejectTeacherAttendanceComplaints,
- } from "@/api/journal";
- export default {
- props:['isSettle'],
- components: { pagination },
- data() {
- return {
- searchForm: {
- settlemented:null,
- search: null,
- organId: null,
- complaintsStatus: null,
- timer: [],
- },
- teacherList: [],
- tableList: [],
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- dialogVisible: false,
- visibleForm: {
- complaintsContent: null,
- complaintsStatusEnum: null,
- disposeContent: null,
- signInStatus: null,
- signOutStatus: null,
- teacherAttendanceId: null,
- reSignInStatus: null,
- reSignOutStatus: null,
- complaintsType: null,
- url: null,
- },
- };
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- //生命周期 - 挂载完成(可以访问DOM元素)
- async mounted() {
- await this.$store.dispatch("setBranchs");
- this.init();
- },
- computed:{
- settlemented(){
- return this.isSettle
- }
- },
- methods: {
- init() {
- this.getList();
- },
- permission(str) {
- return permission(str);
- },
- getList() {
- let obj = {};
- Object.assign(obj, this.searchForm);
- if (obj.timer && obj.timer.length > 0) {
- obj.courseScheduleStartDate = obj.timer[0];
- obj.courseScheduleEndDate = obj.timer[1];
- }
- obj.rows = this.rules.limit;
- obj.page = this.rules.page;
- obj.settlemented = this.settlemented
- delete obj.timer;
- queryTeacherAttendanceComplaints(obj).then((res) => {
- if (res.code == 200) {
- this.rules.total = res.data.total;
- this.tableList = res.data.rows;
- }
- });
- },
- search() {
- this.rules.page = 1;
- this.$refs.searchForm.save(this.searchForm);
- this.$refs.searchForm.save(this.pageInfo, "page");
- this.getList();
- },
- onReSet() {
- this.searchForm = {
- search: null,
- organId: null,
- complaintsStatus: null,
- timer: [],
- };
- this.search();
- },
- subreset(str) {
- if (str == "AGREED") {
- // 同意
- this.$refs["visibleForm"].validate((flag) => {
- if (flag) {
- let obj = {};
- // if (
- // !this.visibleForm.reSignInStatus &&
- // !this.visibleForm.reSignOutStatus
- // ) {
- // this.$message.error("请修正签到状态或签退状态");
- // return;
- // }
- // let str = "是否将此课程的";
- // if (this.visibleForm.complaintsType == 'SIGN_IN' || this.visibleForm.complaintsType == 'ALL') {
- // str += "【签到状态】";
- // }
- // if (this.visibleForm.complaintsType == 'SIGN_OUT' || this.visibleForm.complaintsType == 'ALL') {
- // str += "【签退状态】";
- // }
- // str += "修正为正常";
- obj.content = this.visibleForm.disposeContent;
- obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
- this.$confirm("您是否同意该申诉?", "是否", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- agreeTeacherAttendanceComplaints(obj).then((res) => {
- if (res.code == 200) {
- this.dialogVisible = false;
- this.$message.success("同意申诉成功");
- this.getList();
- }
- });
- })
- .catch(() => {});
- }
- });
- } else {
- // 拒绝
- this.$refs["visibleForm"].validate((flag) => {
- if (flag) {
- let obj = {};
- obj.content = this.visibleForm.disposeContent;
- obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
- this.$confirm("驳回申诉", "是否", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- rejectTeacherAttendanceComplaints(obj).then((res) => {
- if (res.code == 200) {
- this.dialogVisible = false;
- this.$message.success("拒绝申诉成功");
- this.getList();
- }
- });
- })
- .catch(() => {});
- }
- });
- }
- },
- lookDetail(row) {
- this.visibleForm = {
- complaintsContent: row.complaintsContent,
- complaintsStatusEnum: row.complaintsStatusEnum,
- disposeContent: row.disposeContent,
- signInStatus: row.signInStatus,
- signOutStatus: row.signOutStatus,
- signInTime: row.signInTime,
- signOutTime: row.signOutTime,
- teacherAttendanceId: row.teacherAttendanceId,
- // reSignInStatus: row.signInStatus == 1 ? true : false,
- // reSignOutStatus: row.signOutStatus == 1 ? true : false,
- reSignInStatus: null,
- reSignOutStatus: null,
- complaintsType: row.complaintsType,
- srcList: row.url.split(","),
- };
- this.dialogVisible = true;
- },
- },
- watch: {
- dialogVisible(val) {
- if (!val) {
- this.visibleForm = {
- complaintsContent: null,
- complaintsStatusEnum: null,
- disposeContent: null,
- signInStatus: null,
- signOutStatus: null,
- teacherAttendanceId: null,
- reSignInStatus: null,
- reSignOutStatus: null,
- };
- }
- },
- },
- };
- </script>
- <style lang='scss' scoped>
- .titleP {
- line-height: 30px;
- }
- </style>
|