teacherList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <div class="tableWrap">
  3. <el-table :data='tableList'
  4. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  5. <el-table-column align='center'
  6. prop="teacherName"
  7. width="150px"
  8. label="老师姓名">
  9. <template slot-scope="scope">
  10. <div>
  11. <span>{{scope.row.teacherName}}</span><br/>
  12. <span style="color: #f56c6c">(<copy-text>{{scope.row.teacherId}}</copy-text>)</span>
  13. </div>
  14. </template>
  15. </el-table-column>
  16. <el-table-column align='center'
  17. prop="teacherRole"
  18. label="老师类型">
  19. <template slot-scope="scope">
  20. <div>
  21. {{ scope.row.teacherRole|workType}}
  22. </div>
  23. </template>
  24. </el-table-column>
  25. <el-table-column align='center'
  26. prop="teacherPhone"
  27. label="签到时间">
  28. <template slot-scope="scope">
  29. <div>
  30. {{scope.row.signInTime | dayjsFormatMinute}}
  31. </div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column align='center'
  35. prop="teacherPhone"
  36. label="签退时间">
  37. <template slot-scope="scope">
  38. <div>
  39. {{scope.row.signOutTime | dayjsFormatMinute}}
  40. </div>
  41. </template>
  42. </el-table-column>
  43. <el-table-column align='center'
  44. prop="complaintsContent"
  45. width="120"
  46. label="考勤申诉内容">
  47. <template slot-scope="scope">
  48. <div v-if="scope.row.teacherAttendance">
  49. <overflow-text :text="scope.row.teacherAttendance.complaintsContent" width="100%">
  50. {{ scope.row.teacherAttendance.complaintsContent}}
  51. </overflow-text>
  52. </div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column align='center'
  56. prop="complaintsTime"
  57. width="160"
  58. label="考勤申诉时间">
  59. <template slot-scope="scope">
  60. <div>
  61. {{ scope.row.teacherAttendance && scope.row.teacherAttendance.complaintsTime}}
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column align='center'
  66. prop="complaintsStatus"
  67. width="140"
  68. label="考勤申诉状态">
  69. <template slot-scope="scope">
  70. <div v-if="scope.row.teacherAttendance">
  71. {{scope.row.teacherAttendance.complaintsStatus | complaintsStatusEnum}}
  72. </div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column align='center'
  76. prop="teacherPhone"
  77. label="签到状态">
  78. <template slot-scope="scope">
  79. <div>{{ scope.row.signInStatus | attendanceType}}</div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column align='center'
  83. prop="teacherPhone"
  84. label="签退状态">
  85. <template slot-scope="scope">
  86. <div>{{ scope.row.signOutStatus | attendanceOutType}}</div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column align='center'
  90. prop="signOutAttachments"
  91. label="签退照片">
  92. <template slot-scope="scope">
  93. <el-image
  94. v-if="scope.row.teacherAttendance && scope.row.teacherAttendance.signOutAttachments"
  95. style="width: 60px; height: 60px"
  96. fit="cover"
  97. :src="scope.row.teacherAttendance.signOutAttachments"
  98. :previewSrcList="[scope.row.teacherAttendance.signOutAttachments]"
  99. >
  100. </el-image>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align='center'
  104. width="200px"
  105. fixed="right"
  106. label="操作">
  107. <template slot-scope="scope">
  108. <div>
  109. <el-button type="text"
  110. size="small"
  111. v-permission="'teacherAttendance/updateTeacherAttendance'"
  112. @click="mackAttendance(scope.row)">补考勤</el-button>
  113. <el-button type="text"
  114. v-if="teachMode == 'OFFLINE'"
  115. size="small"
  116. @click="lookGPS(scope.row)">GPS定位</el-button>
  117. <el-button type="text"
  118. size="small"
  119. v-permission="'courseSchedule/queryTeacherSalary'"
  120. @click="setCourseInfo(scope.row)">课酬调整</el-button>
  121. </div>
  122. </template>
  123. </el-table-column>
  124. </el-table>
  125. <el-dialog width="1000px"
  126. :visible.sync="gpsVisible"
  127. append-to-body>
  128. <gpsLoction v-if="gpsVisible"
  129. :activeRow='activeRow' />
  130. </el-dialog>
  131. <!-- <el-dialog title="课酬调整"
  132. width="800px"
  133. append-to-body
  134. :visible.sync="dialogTableVisible">
  135. <el-table :data="activeTeacherList"
  136. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  137. <el-table-column label="老师姓名"
  138. prop="teacherName"></el-table-column>
  139. <el-table-column label="老师角色">
  140. <template slot-scope="scope">
  141. <div>
  142. {{ scope.row.teacherRole |workType }}
  143. </div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="课程课酬"
  147. prop="expectSalary"></el-table-column> -->
  148. <!-- <el-table-column label="课时补贴"
  149. prop="subsidy"></el-table-column> -->
  150. <!-- <el-table-column label="操作">
  151. <template slot-scope="scope">
  152. <div>
  153. <el-button type='text'
  154. v-permission="'courseSchedule/updateTeacherCoursesSalary'"
  155. @click="resetTeacher(scope.row)">操作</el-button>
  156. </div>
  157. </template>
  158. </el-table-column>
  159. </el-table> -->
  160. <el-dialog width="500px"
  161. :title="activeTeacher&&(activeTeacher.teacherName + ` (${activeTeacher.teacherId})`)"
  162. :visible.sync="innerVisible"
  163. append-to-body>
  164. <!-- 修改代码 -->
  165. <el-form :model="teacherMask"
  166. :rules="teacherRules"
  167. ref='teacherMask'>
  168. <el-form-item label="原课程课酬"
  169. prop="expectSalary">
  170. <span>{{activeTeacher && activeTeacher.expectSalary | moneyFormat}}</span>
  171. </el-form-item>
  172. <el-form-item label="调整范围"
  173. prop="radio">
  174. <el-radio v-model.trim="teacherMask.radio"
  175. label="all">之后剩余课次</el-radio>
  176. <el-radio v-model.trim="teacherMask.radio"
  177. label="one">仅限本次</el-radio>
  178. </el-form-item>
  179. <el-form-item label="课程课酬"
  180. prop="salary">
  181. <el-input style="width:180px"
  182. v-model.trim="teacherMask.salary"></el-input>
  183. </el-form-item>
  184. </el-form>
  185. <div slot="footer"
  186. class="dialog-footer">
  187. <el-button @click="innerVisible = false">取 消</el-button>
  188. <el-button type="primary"
  189. @click="resetSalary">确 定</el-button>
  190. </div>
  191. </el-dialog>
  192. <!-- </el-dialog> -->
  193. </div>
  194. </template>
  195. <script>
  196. import { updateTeacherAttendance, getCourseList, getTeacherSalary } from "@/api/buildTeam";
  197. import { updateTeacherCoursesSalary } from '@/api/teacherManager'
  198. import { getCourseTeachers } from "@/api/teacherManager";
  199. import gpsLoction from "../componentCourse/gpsLocation";
  200. export default {
  201. components: { gpsLoction },
  202. props: ['courseScheduleId', 'teachMode'],
  203. data () {
  204. return {
  205. tableList: [],
  206. gpsVisible: false,
  207. activeRow: null,
  208. activeTeacherList: [],
  209. dialogTableVisible: false,
  210. innerVisible: false,
  211. activeTeacher: null,
  212. teacherMask: {
  213. salary: '',
  214. subsidy: '',
  215. radio: ''
  216. },
  217. teacherRules: {
  218. salary: [{ required: true, message: '请输入课程课酬', trigger: 'blur' }],
  219. subsidy: [{ required: true, message: '请输入课时补贴', trigger: 'blur' }],
  220. radio: [{ required: true, message: '请选择调整范围', trigger: 'blur' }]
  221. },
  222. }
  223. },
  224. mounted () {
  225. this.init()
  226. console.log(this.teachMode)
  227. },
  228. activated () { },
  229. methods: {
  230. getList () {
  231. getCourseTeachers({ courseScheduleId: this.courseScheduleId }).then(res => {
  232. if (res.code == 200) {
  233. this.tableList = res.data
  234. }
  235. })
  236. },
  237. init () {
  238. this.getList()
  239. },
  240. lookGPS (row) {
  241. this.activeRow = row;
  242. this.gpsVisible = true
  243. },
  244. mackAttendance (row) {
  245. this.$confirm('确定补考勤', '提示', {
  246. confirmButtonText: '确定',
  247. cancelButtonText: '取消',
  248. type: 'warning'
  249. }).then(() => {
  250. let params = {
  251. teacherId: row.teacherId,
  252. courseScheduleId: this.courseScheduleId,
  253. signInStatus: 1,
  254. signOutStatus: 1
  255. };
  256. updateTeacherAttendance(params).then(res => {
  257. if (res.code == 200) {
  258. this.$message.success("补卡成功");
  259. this.getList();
  260. } else {
  261. this.$message.error(res.msg);
  262. }
  263. });
  264. }).catch(() => { })
  265. },
  266. setCourseInfo (row) {
  267. // this.tempSelectRow = row
  268. getTeacherSalary({ courseScheduleId: this.courseScheduleId }).then(res => {
  269. if (res.code == 200) {
  270. this.innerVisible = true;
  271. for (const item of res.data) {
  272. if (row.teacherId == item.teacherId) {
  273. this.activeTeacher = item
  274. break
  275. }
  276. }
  277. // this.courseScheduleId = row.courseScheduleId;
  278. // row.teachingTeachers
  279. // this.activeTeacherList = res.data;
  280. }
  281. })
  282. },
  283. resetTeacher (row) {
  284. this.innerVisible = true;
  285. this.activeTeacher = row;
  286. },
  287. resetSalary () {
  288. let that = this
  289. this.$refs['teacherMask'].validate(res => {
  290. if (res) {
  291. updateTeacherCoursesSalary({
  292. courseScheduleId: this.courseScheduleId,
  293. salary: this.teacherMask.salary,
  294. teacherId: this.activeTeacher.teacherId,
  295. scope: this.teacherMask.radio
  296. }).then(res => {
  297. if (res.code == 200) {
  298. this.$message.success('修改成功')
  299. this.teacherMask = {
  300. salary: '',
  301. subsidy: '',
  302. radio: ''
  303. }
  304. // this.dialogTableVisible = false;
  305. this.innerVisible = false;
  306. // that.setCourseInfo(this.tempSelectRow)
  307. }
  308. })
  309. } else {
  310. this.$message.error('请填写必要参数')
  311. }
  312. })
  313. }
  314. },
  315. }
  316. </script>