payAppeal.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  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')"
  148. @click="lookDetail(scope.row)"
  149. >操作</el-button
  150. >
  151. </div>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. <pagination
  156. sync
  157. :total.sync="rules.total"
  158. :page.sync="rules.page"
  159. :limit.sync="rules.limit"
  160. :page-sizes="rules.page_size"
  161. @pagination="getList"
  162. />
  163. </div>
  164. </div>
  165. <el-dialog title="考勤申诉" :visible.sync="dialogVisible" width="500px">
  166. <div>
  167. <el-form ref="visibleForm" :model="visibleForm" class="visibleForm">
  168. <el-form-item label="签到时间">
  169. {{ visibleForm.signInTime }}
  170. </el-form-item>
  171. <el-form-item label="签退时间">
  172. {{ visibleForm.signOutTime }}
  173. </el-form-item>
  174. <el-form-item label="申诉图片">
  175. <el-row>
  176. <el-col v-for="(item, index) in visibleForm.srcList" :key="index" :span='6'>
  177. <el-image
  178. style="width: 100px; height: 100px"
  179. fit="cover"
  180. :src="item"
  181. :preview-src-list="visibleForm.srcList"
  182. >
  183. </el-image>
  184. </el-col>
  185. </el-row>
  186. </el-form-item>
  187. <el-form-item
  188. label="申诉内容"
  189. :rules="[
  190. { required: true, message: '请填写申诉内容', trigger: 'blur' },
  191. ]"
  192. prop="complaintsContent"
  193. >
  194. <el-input
  195. type="textarea"
  196. :rows="5"
  197. :disabled="visibleForm.complaintsStatusEnum != '2'"
  198. v-model.trim="visibleForm.complaintsContent"
  199. ></el-input>
  200. </el-form-item>
  201. <el-form-item
  202. label="处理意见"
  203. :rules="[
  204. { required: true, message: '请填写处理意见', trigger: 'blur' },
  205. ]"
  206. prop="disposeContent"
  207. >
  208. <el-input
  209. type="textarea"
  210. :rows="5"
  211. :disabled="visibleForm.complaintsStatusEnum != '2'"
  212. v-model.trim="visibleForm.disposeContent"
  213. ></el-input>
  214. </el-form-item>
  215. <!-- -->
  216. <el-form-item
  217. label="请选择需要补正的状态"
  218. v-if="visibleForm.complaintsStatusEnum == '2'"
  219. >
  220. <br />
  221. <el-checkbox
  222. v-model="visibleForm.reSignInStatus"
  223. :disabled="visibleForm.complaintsStatusEnum != '2'"
  224. >签到状态</el-checkbox
  225. >
  226. <el-checkbox
  227. v-model="visibleForm.reSignOutStatus"
  228. :disabled="visibleForm.complaintsStatusEnum != '2'"
  229. >签退状态</el-checkbox
  230. >
  231. </el-form-item>
  232. </el-form>
  233. </div>
  234. <div slot="footer" v-if="visibleForm.complaintsStatusEnum == '2'">
  235. <el-button
  236. v-permission="'teacherAttendance/rejectTeacherAttendanceComplaints'"
  237. @click="subreset('DENIED')"
  238. >拒绝</el-button
  239. >
  240. <el-button
  241. v-permission="'teacherAttendance/agreeTeacherAttendanceComplaints'"
  242. type="primary"
  243. @click="subreset('AGREED')"
  244. >同意</el-button
  245. >
  246. </div>
  247. </el-dialog>
  248. </div>
  249. </template>
  250. <script>
  251. import axios from "axios";
  252. import { getToken } from "@/utils/auth";
  253. import pagination from "@/components/Pagination/index";
  254. import load from "@/utils/loading";
  255. import { permission } from "@/utils/directivePage";
  256. import {
  257. queryTeacherAttendanceComplaints,
  258. agreeTeacherAttendanceComplaints,
  259. rejectTeacherAttendanceComplaints,
  260. } from "@/api/journal";
  261. export default {
  262. components: { pagination },
  263. data() {
  264. return {
  265. searchForm: {
  266. search: null,
  267. organId: null,
  268. complaintsStatus: null,
  269. timer: [],
  270. },
  271. teacherList: [],
  272. tableList: [],
  273. rules: {
  274. // 分页规则
  275. limit: 10, // 限制显示条数
  276. page: 1, // 当前页
  277. total: 0, // 总条数
  278. page_size: [10, 20, 40, 50], // 选择限制显示条数
  279. },
  280. dialogVisible: false,
  281. visibleForm: {
  282. complaintsContent: null,
  283. complaintsStatusEnum: null,
  284. disposeContent: null,
  285. signInStatus: null,
  286. signOutStatus: null,
  287. teacherAttendanceId: null,
  288. reSignInStatus: null,
  289. reSignOutStatus: null,
  290. url: null,
  291. },
  292. };
  293. },
  294. //生命周期 - 创建完成(可以访问当前this实例)
  295. created() {},
  296. //生命周期 - 挂载完成(可以访问DOM元素)
  297. async mounted() {
  298. await this.$store.dispatch("setBranchs");
  299. this.init();
  300. },
  301. methods: {
  302. init() {
  303. this.getList();
  304. },
  305. permission(str) {
  306. return permission(str);
  307. },
  308. getList() {
  309. let obj = {};
  310. Object.assign(obj, this.searchForm);
  311. if (obj.timer && obj.timer.length > 0) {
  312. obj.courseScheduleStartDate = obj.timer[0];
  313. obj.courseScheduleEndDate = obj.timer[1];
  314. }
  315. obj.rows = this.rules.limit;
  316. obj.page = this.rules.page;
  317. delete obj.timer;
  318. queryTeacherAttendanceComplaints(obj).then((res) => {
  319. if (res.code == 200) {
  320. this.rules.total = res.data.total;
  321. this.tableList = res.data.rows;
  322. }
  323. });
  324. },
  325. search() {
  326. this.rules.page = 1;
  327. this.$refs.searchForm.save(this.searchForm);
  328. this.$refs.searchForm.save(this.pageInfo, "page");
  329. this.getList();
  330. },
  331. onReSet() {
  332. this.searchForm = {
  333. search: null,
  334. organId: null,
  335. complaintsStatus: null,
  336. timer: [],
  337. };
  338. this.search();
  339. },
  340. subreset(str) {
  341. if (str == "AGREED") {
  342. // 同意
  343. this.$refs["visibleForm"].validate((flag) => {
  344. if (flag) {
  345. let obj = {};
  346. if (
  347. !this.visibleForm.reSignInStatus &&
  348. !this.visibleForm.reSignOutStatus
  349. ) {
  350. this.$message.error("请修正签到状态或签退状态");
  351. return;
  352. }
  353. let str = "是否将此课程的";
  354. //visibleForm.reSignInStatus
  355. if (this.visibleForm.reSignInStatus) {
  356. obj.signInStatus = 1;
  357. str += "【签到状态】";
  358. }
  359. if (this.visibleForm.reSignOutStatus) {
  360. obj.signOutStatus = 1;
  361. str += "【签退状态】";
  362. }
  363. str += "修正为正常";
  364. obj.content = this.visibleForm.disposeContent;
  365. obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
  366. this.$confirm(str, "是否", {
  367. confirmButtonText: "确定",
  368. cancelButtonText: "取消",
  369. type: "warning",
  370. })
  371. .then(() => {
  372. agreeTeacherAttendanceComplaints(obj).then((res) => {
  373. if (res.code == 200) {
  374. this.dialogVisible = false;
  375. this.$message.success("同意申诉成功");
  376. this.getList();
  377. }
  378. });
  379. })
  380. .catch(() => {});
  381. }
  382. });
  383. } else {
  384. // 拒绝
  385. this.$refs["visibleForm"].validate((flag) => {
  386. if (flag) {
  387. let obj = {};
  388. obj.content = this.visibleForm.disposeContent;
  389. obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
  390. this.$confirm("驳回申诉", "是否", {
  391. confirmButtonText: "确定",
  392. cancelButtonText: "取消",
  393. type: "warning",
  394. })
  395. .then(() => {
  396. rejectTeacherAttendanceComplaints(obj).then((res) => {
  397. if (res.code == 200) {
  398. this.dialogVisible = false;
  399. this.$message.success("拒绝申诉成功");
  400. this.getList();
  401. }
  402. });
  403. })
  404. .catch(() => {});
  405. }
  406. });
  407. }
  408. },
  409. lookDetail(row) {
  410. this.visibleForm = {
  411. complaintsContent: row.complaintsContent,
  412. complaintsStatusEnum: row.complaintsStatusEnum,
  413. disposeContent: row.disposeContent,
  414. signInStatus: row.signInStatus,
  415. signOutStatus: row.signOutStatus,
  416. signInTime: row.signInTime,
  417. signOutTime: row.signOutTime,
  418. teacherAttendanceId: row.teacherAttendanceId,
  419. // reSignInStatus: row.signInStatus == 1 ? true : false,
  420. // reSignOutStatus: row.signOutStatus == 1 ? true : false,
  421. reSignInStatus: null,
  422. reSignOutStatus: null,
  423. srcList: row.url.split(","),
  424. };
  425. this.dialogVisible = true;
  426. },
  427. },
  428. watch: {
  429. dialogVisible(val) {
  430. if (!val) {
  431. this.visibleForm = {
  432. complaintsContent: null,
  433. complaintsStatusEnum: null,
  434. disposeContent: null,
  435. signInStatus: null,
  436. signOutStatus: null,
  437. teacherAttendanceId: null,
  438. reSignInStatus: null,
  439. reSignOutStatus: null,
  440. };
  441. }
  442. },
  443. },
  444. };
  445. </script>
  446. <style lang='scss' scoped>
  447. .titleP {
  448. line-height: 30px;
  449. }
  450. </style>