progressRequest.vue 15 KB

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