payAppeal.vue 12 KB

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