payAppeal.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 考勤申诉
  7. </h2>
  8. <div class="m-core">
  9. <save-form :inline="true" :model.sync="searchForm" ref="searchForm">
  10. <el-form-item>
  11. <el-input
  12. v-model.trim="searchForm.search"
  13. clearable
  14. @keyup.enter.native="search"
  15. placeholder="老师名称、课程编号"
  16. ></el-input>
  17. </el-form-item>
  18. <el-form-item>
  19. <el-select
  20. v-model.trim="searchForm.organId"
  21. clearable
  22. filterable
  23. placeholder="请选择分部"
  24. >
  25. <el-option
  26. v-for="(item, index) in selects.branchs"
  27. :key="index"
  28. :label="item.name"
  29. :value="item.id"
  30. ></el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item>
  34. <el-select
  35. v-model.trim="searchForm.complaintsStatus"
  36. clearable
  37. filterable
  38. placeholder="申诉状态"
  39. >
  40. <el-option label="已拒绝" :value="0"></el-option>
  41. <el-option label="已通过" :value="1"></el-option>
  42. <el-option label="待处理" :value="2"></el-option>
  43. <el-option label="已撤销" :value="3"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-date-picker
  48. v-model.trim="searchForm.timer"
  49. style="width: 400px"
  50. type="daterange"
  51. value-format="yyyy-MM-dd"
  52. range-separator="至"
  53. start-placeholder="课程开始日期"
  54. end-placeholder="课程结束日期"
  55. :picker-options="{
  56. firstDayOfWeek: 1,
  57. }"
  58. ></el-date-picker>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-button type="danger" @click="search">搜索</el-button>
  62. <el-button @click="onReSet" type="primary">重置</el-button>
  63. </el-form-item>
  64. </save-form>
  65. <div class="tableWrap">
  66. <el-table
  67. style="width: 100%"
  68. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  69. :data="tableList"
  70. >
  71. <el-table-column
  72. align="center"
  73. prop="organName"
  74. label="分部"
  75. ></el-table-column>
  76. <el-table-column
  77. align="center"
  78. prop="courseScheduleId"
  79. label="课程编号"
  80. ></el-table-column>
  81. <el-table-column
  82. align="center"
  83. prop="courseScheduleName"
  84. label="课程名称"
  85. ></el-table-column>
  86. <el-table-column
  87. align="center"
  88. width="180"
  89. prop="courseScheduleTime"
  90. label="课程时间"
  91. >
  92. <template slot-scope="scope">
  93. <div>
  94. <p>
  95. {{ scope.row.courseScheduleTime }}
  96. {{ scope.row.courseScheduleStartTime | timerForMinFormat }}-{{
  97. scope.row.courseScheduleEndTime | timerForMinFormat
  98. }}
  99. </p>
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="center" prop="status" label="签到状态">
  104. <template slot-scope="scope">
  105. <div>
  106. <p>{{ scope.row.signInStatus | attendanceType }}</p>
  107. </div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" prop="status" label="签退状态">
  111. <template slot-scope="scope">
  112. <div>
  113. <p>{{ scope.row.signOutStatus | attendanceOutType }}</p>
  114. </div>
  115. </template>
  116. </el-table-column>
  117. <el-table-column
  118. align="center"
  119. prop="teacherName"
  120. label="老师名称"
  121. ></el-table-column>
  122. <el-table-column align="center" prop="studentId" label="状态">
  123. <template slot-scope="scope">
  124. <div>
  125. {{ scope.row.complaintsStatusEnum | complaintsStatusEnum }}
  126. </div>
  127. </template>
  128. </el-table-column>
  129. <el-table-column align="center" label="修复记录">
  130. <template slot-scope="scope">
  131. <div>
  132. {{ scope.row.updateAttendanceEnum | updateAttendanceEnum }}
  133. </div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column
  137. align="center"
  138. prop="operatorName"
  139. label="申诉处理者"
  140. ></el-table-column>
  141. <el-table-column align="center" label="操作">
  142. <!-- teacherAttendance/agreeTeacherAttendanceComplaints -->
  143. <template slot-scope="scope">
  144. <div>
  145. <el-button
  146. type="text"
  147. v-if="permission('teacherAttendance/operation')&&scope.row.complaintsStatusEnum == 2"
  148. @click="lookDetail(scope.row)"
  149. >操作</el-button
  150. >
  151. <el-button
  152. type="text"
  153. v-if="permission('teacherAttendance/operation')&&scope.row.complaintsStatusEnum != 2"
  154. @click="lookDetail(scope.row)"
  155. >查看</el-button
  156. >
  157. <!-- complaintsStatusEnum -->
  158. </div>
  159. </template>
  160. </el-table-column>
  161. </el-table>
  162. <pagination
  163. sync
  164. :total.sync="rules.total"
  165. :page.sync="rules.page"
  166. :limit.sync="rules.limit"
  167. :page-sizes="rules.page_size"
  168. @pagination="getList"
  169. />
  170. </div>
  171. </div>
  172. <el-dialog title="考勤申诉" :visible.sync="dialogVisible" width="500px">
  173. <div>
  174. <el-form ref="visibleForm" :model="visibleForm" class="visibleForm">
  175. <el-form-item label="签到时间">
  176. {{ visibleForm.signInTime }}
  177. </el-form-item>
  178. <el-form-item label="签退时间">
  179. {{ visibleForm.signOutTime }}
  180. </el-form-item>
  181. <el-form-item label="申诉图片">
  182. <el-row>
  183. <el-col v-for="(item, index) in visibleForm.srcList" :key="index" :span='6'>
  184. <el-image
  185. style="width: 100px; height: 100px"
  186. fit="cover"
  187. :src="item"
  188. :preview-src-list="visibleForm.srcList"
  189. >
  190. </el-image>
  191. </el-col>
  192. </el-row>
  193. </el-form-item>
  194. <el-form-item
  195. label="申诉内容"
  196. :rules="[
  197. { required: true, message: '请填写申诉内容', trigger: 'blur' },
  198. ]"
  199. prop="complaintsContent"
  200. >
  201. <el-input
  202. type="textarea"
  203. :rows="5"
  204. :disabled="visibleForm.complaintsStatusEnum != '2'"
  205. v-model.trim="visibleForm.complaintsContent"
  206. ></el-input>
  207. </el-form-item>
  208. <el-form-item
  209. label="处理意见"
  210. :rules="[
  211. { required: true, message: '请填写处理意见', trigger: 'blur' },
  212. ]"
  213. prop="disposeContent"
  214. >
  215. <el-input
  216. type="textarea"
  217. :rows="5"
  218. :disabled="visibleForm.complaintsStatusEnum != '2'"
  219. v-model.trim="visibleForm.disposeContent"
  220. ></el-input>
  221. </el-form-item>
  222. <!-- -->
  223. <el-form-item
  224. label="请选择需要补正的状态"
  225. v-if="visibleForm.complaintsStatusEnum == '2'"
  226. >
  227. <br />
  228. <el-checkbox
  229. v-model="visibleForm.reSignInStatus"
  230. :disabled="visibleForm.complaintsStatusEnum != '2'"
  231. >签到状态</el-checkbox
  232. >
  233. <el-checkbox
  234. v-model="visibleForm.reSignOutStatus"
  235. :disabled="visibleForm.complaintsStatusEnum != '2'"
  236. >签退状态</el-checkbox
  237. >
  238. </el-form-item>
  239. </el-form>
  240. </div>
  241. <div slot="footer" v-if="visibleForm.complaintsStatusEnum == '2'">
  242. <el-button
  243. v-permission="'teacherAttendance/rejectTeacherAttendanceComplaints'"
  244. @click="subreset('DENIED')"
  245. >拒绝</el-button
  246. >
  247. <el-button
  248. v-permission="'teacherAttendance/agreeTeacherAttendanceComplaints'"
  249. type="primary"
  250. @click="subreset('AGREED')"
  251. >同意</el-button
  252. >
  253. </div>
  254. </el-dialog>
  255. </div>
  256. </template>
  257. <script>
  258. import axios from "axios";
  259. import { getToken } from "@/utils/auth";
  260. import pagination from "@/components/Pagination/index";
  261. import load from "@/utils/loading";
  262. import { permission } from "@/utils/directivePage";
  263. import {
  264. queryTeacherAttendanceComplaints,
  265. agreeTeacherAttendanceComplaints,
  266. rejectTeacherAttendanceComplaints,
  267. } from "@/api/journal";
  268. export default {
  269. components: { pagination },
  270. data() {
  271. return {
  272. searchForm: {
  273. search: null,
  274. organId: null,
  275. complaintsStatus: null,
  276. timer: [],
  277. },
  278. teacherList: [],
  279. tableList: [],
  280. rules: {
  281. // 分页规则
  282. limit: 10, // 限制显示条数
  283. page: 1, // 当前页
  284. total: 0, // 总条数
  285. page_size: [10, 20, 40, 50], // 选择限制显示条数
  286. },
  287. dialogVisible: false,
  288. visibleForm: {
  289. complaintsContent: null,
  290. complaintsStatusEnum: null,
  291. disposeContent: null,
  292. signInStatus: null,
  293. signOutStatus: null,
  294. teacherAttendanceId: null,
  295. reSignInStatus: null,
  296. reSignOutStatus: null,
  297. url: null,
  298. },
  299. };
  300. },
  301. //生命周期 - 创建完成(可以访问当前this实例)
  302. created() {},
  303. //生命周期 - 挂载完成(可以访问DOM元素)
  304. async mounted() {
  305. await this.$store.dispatch("setBranchs");
  306. this.init();
  307. },
  308. methods: {
  309. init() {
  310. this.getList();
  311. },
  312. permission(str) {
  313. return permission(str);
  314. },
  315. getList() {
  316. let obj = {};
  317. Object.assign(obj, this.searchForm);
  318. if (obj.timer && obj.timer.length > 0) {
  319. obj.courseScheduleStartDate = obj.timer[0];
  320. obj.courseScheduleEndDate = obj.timer[1];
  321. }
  322. obj.rows = this.rules.limit;
  323. obj.page = this.rules.page;
  324. delete obj.timer;
  325. queryTeacherAttendanceComplaints(obj).then((res) => {
  326. if (res.code == 200) {
  327. this.rules.total = res.data.total;
  328. this.tableList = res.data.rows;
  329. }
  330. });
  331. },
  332. search() {
  333. this.rules.page = 1;
  334. this.$refs.searchForm.save(this.searchForm);
  335. this.$refs.searchForm.save(this.pageInfo, "page");
  336. this.getList();
  337. },
  338. onReSet() {
  339. this.searchForm = {
  340. search: null,
  341. organId: null,
  342. complaintsStatus: null,
  343. timer: [],
  344. };
  345. this.search();
  346. },
  347. subreset(str) {
  348. if (str == "AGREED") {
  349. // 同意
  350. this.$refs["visibleForm"].validate((flag) => {
  351. if (flag) {
  352. let obj = {};
  353. if (
  354. !this.visibleForm.reSignInStatus &&
  355. !this.visibleForm.reSignOutStatus
  356. ) {
  357. this.$message.error("请修正签到状态或签退状态");
  358. return;
  359. }
  360. let str = "是否将此课程的";
  361. //visibleForm.reSignInStatus
  362. if (this.visibleForm.reSignInStatus) {
  363. obj.signInStatus = 1;
  364. str += "【签到状态】";
  365. }
  366. if (this.visibleForm.reSignOutStatus) {
  367. obj.signOutStatus = 1;
  368. str += "【签退状态】";
  369. }
  370. str += "修正为正常";
  371. obj.content = this.visibleForm.disposeContent;
  372. obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
  373. this.$confirm(str, "是否", {
  374. confirmButtonText: "确定",
  375. cancelButtonText: "取消",
  376. type: "warning",
  377. })
  378. .then(() => {
  379. agreeTeacherAttendanceComplaints(obj).then((res) => {
  380. if (res.code == 200) {
  381. this.dialogVisible = false;
  382. this.$message.success("同意申诉成功");
  383. this.getList();
  384. }
  385. });
  386. })
  387. .catch(() => {});
  388. }
  389. });
  390. } else {
  391. // 拒绝
  392. this.$refs["visibleForm"].validate((flag) => {
  393. if (flag) {
  394. let obj = {};
  395. obj.content = this.visibleForm.disposeContent;
  396. obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
  397. this.$confirm("驳回申诉", "是否", {
  398. confirmButtonText: "确定",
  399. cancelButtonText: "取消",
  400. type: "warning",
  401. })
  402. .then(() => {
  403. rejectTeacherAttendanceComplaints(obj).then((res) => {
  404. if (res.code == 200) {
  405. this.dialogVisible = false;
  406. this.$message.success("拒绝申诉成功");
  407. this.getList();
  408. }
  409. });
  410. })
  411. .catch(() => {});
  412. }
  413. });
  414. }
  415. },
  416. lookDetail(row) {
  417. this.visibleForm = {
  418. complaintsContent: row.complaintsContent,
  419. complaintsStatusEnum: row.complaintsStatusEnum,
  420. disposeContent: row.disposeContent,
  421. signInStatus: row.signInStatus,
  422. signOutStatus: row.signOutStatus,
  423. signInTime: row.signInTime,
  424. signOutTime: row.signOutTime,
  425. teacherAttendanceId: row.teacherAttendanceId,
  426. // reSignInStatus: row.signInStatus == 1 ? true : false,
  427. // reSignOutStatus: row.signOutStatus == 1 ? true : false,
  428. reSignInStatus: null,
  429. reSignOutStatus: null,
  430. srcList: row.url.split(","),
  431. };
  432. this.dialogVisible = true;
  433. },
  434. },
  435. watch: {
  436. dialogVisible(val) {
  437. if (!val) {
  438. this.visibleForm = {
  439. complaintsContent: null,
  440. complaintsStatusEnum: null,
  441. disposeContent: null,
  442. signInStatus: null,
  443. signOutStatus: null,
  444. teacherAttendanceId: null,
  445. reSignInStatus: null,
  446. reSignOutStatus: null,
  447. };
  448. }
  449. },
  450. },
  451. };
  452. </script>
  453. <style lang='scss' scoped>
  454. .titleP {
  455. line-height: 30px;
  456. }
  457. </style>