payAppeal.vue 15 KB

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