teacherList.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <template>
  2. <div class="tableWrap">
  3. <el-table
  4. :data="tableList"
  5. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  6. >
  7. <el-table-column
  8. align="center"
  9. prop="teacherName"
  10. width="150px"
  11. label="老师姓名"
  12. >
  13. <template slot-scope="scope">
  14. <div>
  15. <span
  16. >{{ scope.row.teacherName }}-{{
  17. scope.row.teacherRole | workType
  18. }}</span
  19. ><br />
  20. <span
  21. >(<copy-text>{{ scope.row.teacherId }}</copy-text
  22. >)</span
  23. ><!-- style="color: #f56c6c"-->
  24. </div>
  25. </template>
  26. </el-table-column>
  27. <!-- <el-table-column align="center" prop="teacherRole" label="老师类型">
  28. <template slot-scope="scope">
  29. <div>
  30. </div>
  31. </template>
  32. </el-table-column> -->
  33. <el-table-column
  34. align="center"
  35. prop="teacherPhone"
  36. label="签到签退"
  37. width="200px"
  38. >
  39. <template slot-scope="scope" v-if="courseStatus != 'NOT_START'">
  40. <div>
  41. {{ scope.row.signInTime | dayjsFormatMinute }}
  42. (<span :class="scope.row.signInStatus == 1 ? 'green' : 'red'">{{
  43. scope.row.signInStatus | attendanceType
  44. }}</span
  45. >) -
  46. {{ scope.row.signOutTime | dayjsFormatMinute }}
  47. (<span :class="scope.row.signOutStatus == 1 ? 'green' : 'red'">{{
  48. scope.row.signOutStatus | attendanceOutType
  49. }}</span
  50. >)
  51. </div>
  52. </template>
  53. </el-table-column>
  54. <!-- <el-table-column align="center" prop="teacherPhone" label="签退时间">
  55. <template slot-scope="scope">
  56. <div>
  57. </div>
  58. </template>
  59. </el-table-column> -->
  60. <!-- <el-table-column align="center" prop="teacherPhone" label="考勤状态">
  61. <template slot-scope="scope">
  62. <div v-if="courseStatus != 'NOT_START'">
  63. {{ scope.row.signInStatus | attendanceType }} <br />
  64. {{ scope.row.signOutStatus | attendanceOutType }}
  65. </div>
  66. </template>
  67. </el-table-column> -->
  68. <!-- <el-table-column align="center" prop="teacherPhone" label="签退状态">
  69. <template slot-scope="scope">
  70. <div v-if="courseStatus != 'NOT_START'">{{ scope.row.signOutStatus | attendanceOutType}}</div>
  71. </template>
  72. </el-table-column> -->
  73. <el-table-column
  74. align="center"
  75. prop="complaintsTime"
  76. width="160"
  77. label="申诉状态/时间"
  78. >
  79. <template slot-scope="scope">
  80. <div>
  81. <p>
  82. <span
  83. :class="
  84. complaintscolor(scope.row.teacherAttendance.complaintsStatus)
  85. "
  86. >
  87. {{
  88. scope.row.teacherAttendance.complaintsStatus
  89. | complaintsStatusEnum
  90. }}
  91. </span>
  92. </p>
  93. <p>
  94. {{
  95. scope.row.teacherAttendance &&
  96. scope.row.teacherAttendance.complaintsTime
  97. }}
  98. </p>
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column
  103. align="center"
  104. prop="complaintsContent"
  105. width="120"
  106. label="申诉内容"
  107. >
  108. <template slot-scope="scope">
  109. <div v-if="scope.row.teacherAttendance">
  110. <overflow-text
  111. :text="scope.row.teacherAttendance.complaintsContent"
  112. width="100%"
  113. >
  114. {{ scope.row.teacherAttendance.complaintsContent }}
  115. </overflow-text>
  116. </div>
  117. </template>
  118. </el-table-column>
  119. <!-- <el-table-column
  120. align="center"
  121. prop="complaintsStatus"
  122. width="120"
  123. label="申诉状态"
  124. >
  125. <template slot-scope="scope">
  126. <div v-if="scope.row.teacherAttendance">
  127. {{
  128. scope.row.teacherAttendance.complaintsStatus
  129. | complaintsStatusEnum
  130. }}
  131. </div>
  132. </template>
  133. </el-table-column> -->
  134. <el-table-column align="center" prop="disposeContent" label="处理意见">
  135. <template slot-scope="scope">
  136. <overflow-text
  137. width="100%"
  138. :text="
  139. scope.row.teacherAttendance &&
  140. scope.row.teacherAttendance.disposeContent
  141. "
  142. ></overflow-text>
  143. </template>
  144. </el-table-column>
  145. <el-table-column
  146. align="center"
  147. prop="signOutAttachments"
  148. label="签退照片"
  149. >
  150. <template slot-scope="scope">
  151. <el-image
  152. v-if="
  153. scope.row.teacherAttendance &&
  154. scope.row.teacherAttendance.signOutAttachments
  155. "
  156. style="width: 60px; height: 60px"
  157. fit="cover"
  158. :src="scope.row.teacherAttendance.signOutAttachments.split(',')[0]"
  159. :previewSrcList="
  160. scope.row.teacherAttendance.signOutAttachments.split(',')
  161. "
  162. >
  163. </el-image>
  164. </template>
  165. </el-table-column>
  166. <el-table-column align="center" width="200px" fixed="right" label="操作">
  167. <template slot-scope="scope">
  168. <div>
  169. <auth
  170. auths="teacherAttendance/updateTeacherAttendance/3485"
  171. v-if="courseStatus != 'NOT_START'"
  172. >
  173. <el-button
  174. type="text"
  175. size="small"
  176. @click="mackAttendance(scope.row)"
  177. >补考勤</el-button
  178. >
  179. </auth>
  180. <el-button
  181. type="text"
  182. v-if="teachMode == 'OFFLINE' && courseStatus != 'NOT_START'"
  183. size="small"
  184. @click="lookGPS(scope.row)"
  185. >GPS定位</el-button
  186. >
  187. <auth
  188. auths="courseSchedule/queryTeacherSalary"
  189. v-if="!scope.row.settlementTime"
  190. >
  191. <el-button
  192. type="text"
  193. size="small"
  194. @click="setCourseInfo(scope.row)"
  195. >课酬调剂</el-button
  196. >
  197. </auth>
  198. <auth
  199. auths="teacherAttendance/update?page=teamCourseList"
  200. v-if="courseStatus != 'NOT_START'"
  201. >
  202. <el-button
  203. size="small"
  204. type="text"
  205. @click="hand(scope.row)"
  206. v-if="
  207. (scope.row.signInStatus != 1 ||
  208. scope.row.signOutStatus != 1) &&
  209. courseStatus != 'NOT_START'
  210. "
  211. >处理意见</el-button
  212. >
  213. </auth>
  214. <auth
  215. auths="teacherAttendance/repealComplaints/4300"
  216. v-if="courseStatus != 'NOT_START'"
  217. >
  218. <el-button
  219. type="text"
  220. size="small"
  221. v-if="
  222. scope.row.jobNature != 'FULL_TIME' &&
  223. scope.row.teacherAttendance.complaintsStatus == 2
  224. "
  225. @click="unappeal(scope.row)"
  226. >撤销申诉</el-button
  227. >
  228. </auth>
  229. <auth
  230. auths="teacherAttendance/addComplaints/4299"
  231. v-if="courseStatus != 'NOT_START'"
  232. >
  233. <el-button
  234. size="small"
  235. v-if="
  236. scope.row.jobNature != 'FULL_TIME' &&
  237. (scope.row.teacherAttendance.complaintsStatus == null ||
  238. scope.row.teacherAttendance.complaintsStatus == 3)
  239. "
  240. type="text"
  241. @click="appeal(scope.row)"
  242. >考勤申诉</el-button
  243. >
  244. </auth>
  245. </div>
  246. </template>
  247. </el-table-column>
  248. </el-table>
  249. <el-dialog
  250. width="1000px"
  251. title="GPS定位"
  252. :visible.sync="gpsVisible"
  253. append-to-body
  254. >
  255. <gpsLoction v-if="gpsVisible" :activeRow="activeRow" />
  256. </el-dialog>
  257. <el-dialog
  258. title="处理意见"
  259. width="400px"
  260. :visible.sync="handVisible"
  261. append-to-body
  262. >
  263. <hand
  264. v-if="handVisible && detail"
  265. :detail="detail"
  266. @close="handVisible = false"
  267. @submited="getList"
  268. />
  269. </el-dialog>
  270. <!-- <el-dialog title="课酬调整"
  271. width="800px"
  272. append-to-body
  273. :visible.sync="dialogTableVisible">
  274. <el-table :data="activeTeacherList"
  275. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  276. <el-table-column label="老师姓名"
  277. prop="teacherName"></el-table-column>
  278. <el-table-column label="老师角色">
  279. <template slot-scope="scope">
  280. <div>
  281. {{ scope.row.teacherRole |workType }}
  282. </div>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="课程课酬"
  286. prop="expectSalary"></el-table-column> -->
  287. <!-- <el-table-column label="课时补贴"
  288. prop="subsidy"></el-table-column> -->
  289. <!-- <el-table-column label="操作">
  290. <template slot-scope="scope">
  291. <div>
  292. <el-button type='text'
  293. v-permission="'courseSchedule/updateTeacherCoursesSalary'"
  294. @click="resetTeacher(scope.row)">操作</el-button>
  295. </div>
  296. </template>
  297. </el-table-column>
  298. </el-table> -->
  299. <el-dialog
  300. width="500px"
  301. :title="
  302. activeTeacher &&
  303. activeTeacher.teacherName + ` (${activeTeacher.teacherId})`
  304. "
  305. :visible.sync="innerVisible"
  306. append-to-body
  307. >
  308. <!-- 修改代码 -->
  309. <el-form
  310. :model="teacherMask"
  311. :inline="true"
  312. :rules="teacherRules"
  313. @submit.native.prevent
  314. ref="teacherMask"
  315. >
  316. <el-form-item label="课程课酬" prop="expectSalary">
  317. <span>{{
  318. activeTeacher && activeTeacher.expectSalary | moneyFormat
  319. }}</span>
  320. </el-form-item>
  321. <el-form-item label="课程补贴" prop="expectSalary">
  322. <span>{{
  323. activeTeacher && activeTeacher.subsidy | moneyFormat
  324. }}</span>
  325. </el-form-item>
  326. <el-form-item label="总课酬" prop="expectSalary">
  327. <span>{{
  328. ((activeTeacher && activeTeacher.expectSalary) +
  329. (activeTeacher && activeTeacher.subsidy))
  330. | moneyFormat
  331. }}</span>
  332. </el-form-item>
  333. <br />
  334. <el-form-item label="调整范围" prop="radio">
  335. <el-radio v-model.trim="teacherMask.radio" label="all"
  336. >之后剩余课次</el-radio
  337. >
  338. <el-radio v-model.trim="teacherMask.radio" label="one"
  339. >仅限本次</el-radio
  340. >
  341. </el-form-item>
  342. <br />
  343. <el-form-item label="课程补贴" prop="subsidy">
  344. <el-input-number
  345. class="number-input"
  346. :controls="false"
  347. :min="activeTeacher&&activeTeacher.expectSalary?(0-activeTeacher.expectSalary):0"
  348. style="width: 180px;"
  349. v-model.number="teacherMask.subsidy"
  350. ></el-input-number>
  351. </el-form-item>
  352. </el-form>
  353. <div slot="footer" class="dialog-footer">
  354. <el-button @click="innerVisible = false">取 消</el-button>
  355. <el-button type="primary" @click="resetSalary">确 定</el-button>
  356. </div>
  357. </el-dialog>
  358. <el-dialog
  359. title="申诉"
  360. width="400px"
  361. :visible.sync="appealVisible"
  362. append-to-body
  363. >
  364. <appeal
  365. v-if="appealVisible && detail"
  366. :detail="detail"
  367. @close="appealVisible = false"
  368. @submited="getList"
  369. />
  370. </el-dialog>
  371. <!-- </el-dialog> -->
  372. </div>
  373. </template>
  374. <script>
  375. import { updateTeacherAttendance, getTeacherSalary } from "@/api/buildTeam";
  376. import { updateTeacherCoursesSalary } from "@/api/teacherManager";
  377. import { getCourseTeachers } from "@/api/teacherManager";
  378. import gpsLoction from "../componentCourse/gpsLocation";
  379. import appeal from "@/views/recodeManager/modals/appeal";
  380. import { repealComplaints } from "@/views/recodeManager/api";
  381. import hand from "@/views/recodeManager/modals/hand";
  382. export default {
  383. components: { gpsLoction, hand, appeal },
  384. props: ["courseScheduleId", "teachMode", "courseStatus"],
  385. data() {
  386. return {
  387. appealVisible: false,
  388. tableList: [],
  389. gpsVisible: false,
  390. activeRow: null,
  391. activeTeacherList: [],
  392. dialogTableVisible: false,
  393. innerVisible: false,
  394. activeTeacher: null,
  395. handVisible: null,
  396. detail: null,
  397. teacherMask: {
  398. subsidy: "",
  399. subsidy: "",
  400. radio: "one",
  401. },
  402. teacherRules: {
  403. subsidy: [
  404. { required: true, message: "请输入课程补贴", trigger: "blur" },
  405. ],
  406. subsidy: [
  407. { required: true, message: "请输入课时补贴", trigger: "blur" },
  408. ],
  409. radio: [{ required: true, message: "请选择调整范围", trigger: "blur" }],
  410. },
  411. };
  412. },
  413. mounted() {
  414. this.init();
  415. // console.log(this.teachMode, this.courseStatus)
  416. },
  417. activated() {},
  418. methods: {
  419. getList() {
  420. getCourseTeachers({ courseScheduleId: this.courseScheduleId }).then(
  421. (res) => {
  422. if (res.code == 200) {
  423. this.tableList = res.data;
  424. }
  425. }
  426. );
  427. },
  428. init() {
  429. this.getList();
  430. },
  431. lookGPS(row) {
  432. this.activeRow = row;
  433. this.gpsVisible = true;
  434. },
  435. hand(row) {
  436. this.detail = row;
  437. this.handVisible = true;
  438. },
  439. mackAttendance(row) {
  440. this.$confirm("确定补考勤", "提示", {
  441. confirmButtonText: "确定",
  442. cancelButtonText: "取消",
  443. type: "warning",
  444. })
  445. .then(() => {
  446. let params = {
  447. teacherId: row.teacherId,
  448. courseScheduleId: this.courseScheduleId,
  449. signInStatus: 1,
  450. signOutStatus: 1,
  451. };
  452. updateTeacherAttendance(params).then((res) => {
  453. if (res.code == 200) {
  454. this.$message.success("补卡成功");
  455. this.getList();
  456. this.$emit("syncTeacherAttend");
  457. } else {
  458. this.$message.error(res.msg);
  459. }
  460. });
  461. })
  462. .catch(() => {});
  463. },
  464. setCourseInfo(row) {
  465. // this.tempSelectRow = row
  466. getTeacherSalary({ courseScheduleId: this.courseScheduleId }).then(
  467. (res) => {
  468. if (res.code == 200) {
  469. this.innerVisible = true;
  470. for (const item of res.data) {
  471. if (row.teacherId == item.teacherId) {
  472. this.activeTeacher = item;
  473. this.teacherMask.subsidy = item.subsidy;
  474. break;
  475. }
  476. }
  477. // this.courseScheduleId = row.courseScheduleId;
  478. // row.teachingTeachers
  479. // this.activeTeacherList = res.data;
  480. }
  481. }
  482. );
  483. },
  484. resetTeacher(row) {
  485. this.innerVisible = true;
  486. this.activeTeacher = row;
  487. },
  488. complaintscolor(status) {
  489. /**
  490. * 0: "已拒绝",
  491. 1: "已通过",
  492. 2: "待处理",
  493. 3: "已撤销",
  494. */
  495. if (status == 0 || status == 2) {
  496. return "red";
  497. } else if (status == 1) {
  498. return "green";
  499. } else {
  500. return "";
  501. }
  502. },
  503. resetSalary() {
  504. let that = this;
  505. this.$refs["teacherMask"].validate((res) => {
  506. if (res) {
  507. updateTeacherCoursesSalary({
  508. courseScheduleId: this.courseScheduleId,
  509. subsidy: this.teacherMask.subsidy,
  510. teacherId: this.activeTeacher.teacherId,
  511. scope: this.teacherMask.radio,
  512. }).then((res) => {
  513. if (res.code == 200) {
  514. this.$message.success("修改成功");
  515. this.teacherMask = {
  516. subsidy: "",
  517. subsidy: "",
  518. radio: "one",
  519. };
  520. // this.dialogTableVisible = false;
  521. this.innerVisible = false;
  522. // that.setCourseInfo(this.tempSelectRow)
  523. }
  524. });
  525. } else {
  526. this.$message.error("请填写必要参数");
  527. }
  528. });
  529. },
  530. appeal(row) {
  531. this.appealVisible = true;
  532. this.detail = row;
  533. this.detail.courseScheduleId = row.teacherAttendance?.courseScheduleId;
  534. },
  535. async unappeal(row) {
  536. try {
  537. await this.$confirm("是否确认撤销申诉?", "提示", {
  538. type: "warning",
  539. });
  540. await repealComplaints({
  541. courseScheduleId: row.teacherAttendance.courseScheduleId,
  542. userId: row.teacherId,
  543. });
  544. this.$message.success("撤销成功");
  545. this.getList();
  546. } catch (error) {}
  547. },
  548. },
  549. };
  550. </script>
  551. <style lang="scss" scoped>
  552. .red {
  553. color: red;
  554. }
  555. .green {
  556. color: #14928a;
  557. }
  558. .orgin {
  559. color: #e6a23c;
  560. }
  561. .number-input{
  562. /deep/ .el-input__inner {
  563. text-align: left;
  564. }
  565. }
  566. </style>