payAppeal.vue 13 KB

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