salaryList.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <div>
  3. <el-form :inline="true"
  4. class="searchForm"
  5. v-model.trim="searchForm">
  6. <el-form-item>
  7. <el-date-picker v-model.trim="searchForm.date"
  8. style='width:400;'
  9. type="daterange"
  10. align="right"
  11. unlink-panels
  12. range-separator="-"
  13. start-placeholder="课程开始日期"
  14. end-placeholder="课程结束日期"
  15. value-format="yyyy-MM-dd"
  16. :picker-options="pickerOptions">
  17. </el-date-picker>
  18. </el-form-item>
  19. <el-form-item>
  20. <el-button @click="search"
  21. type="danger">搜索</el-button>
  22. </el-form-item>
  23. </el-form>
  24. <!-- 查询列表 -->
  25. <!-- 列表 -->
  26. <div class="tableWrap">
  27. <el-table :data='tableList'
  28. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  29. <el-table-column align='center'
  30. label="时间">
  31. <template slot-scope="scope">
  32. {{ scope.row.classDate }} {{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 5) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(0, 5) : '' }}
  33. </template>
  34. </el-table-column>
  35. <el-table-column align='center'
  36. prop="classGroupName"
  37. label="班级名称">
  38. </el-table-column>
  39. <el-table-column align='center'
  40. prop="courseScheduleType"
  41. label="课程类型">
  42. <template slot-scope="scope">
  43. <div>
  44. {{ scope.row.courseScheduleType | coursesType}}
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column align='center'
  49. prop="teacherNum"
  50. label="老师人数">
  51. </el-table-column>
  52. <el-table-column align='center'
  53. label="操作">
  54. <template slot-scope="scope">
  55. <div>
  56. <el-button type='text'
  57. v-if="permission('courseSchedule/queryTeacherSalary')"
  58. @click="setCourseInfo(scope.row)">课酬调整</el-button>
  59. </div>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. <pagination :total="rules.total"
  64. :page.sync="rules.page"
  65. :limit.sync="rules.limit"
  66. :page-sizes="rules.page_size"
  67. @pagination="getList" />
  68. </div>
  69. <el-dialog title="课酬调整"
  70. width="800px"
  71. :visible.sync="dialogTableVisible">
  72. <el-table :data="activeTeacherList"
  73. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  74. <el-table-column label="老师姓名"
  75. prop="teacherName"></el-table-column>
  76. <el-table-column label="老师角色">
  77. <template slot-scope="scope">
  78. <div>
  79. {{ scope.row.teacherRole |workType }}
  80. </div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="课程课酬"
  84. prop="expectSalary"></el-table-column>
  85. <el-table-column label="课时补贴"
  86. prop="subsidy"></el-table-column>
  87. <el-table-column label="操作">
  88. <template slot-scope="scope">
  89. <div>
  90. <el-button type='text'
  91. v-if="permission('courseSchedule/updateTeacherCoursesSalary')"
  92. @click="resetTeacher(scope.row)">操作</el-button>
  93. </div>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <el-dialog width="500px"
  98. title=""
  99. :visible.sync="innerVisible"
  100. append-to-body>
  101. <!-- 修改代码 -->
  102. <el-form :model="teacherMask"
  103. :rules="teacherRules"
  104. ref='teacherMask'>
  105. <el-form-item label="调整范围"
  106. prop="radio">
  107. <el-radio v-model.trim="teacherMask.radio"
  108. label="all">之后剩余课次</el-radio>
  109. <el-radio v-model.trim="teacherMask.radio"
  110. label="one">仅限本次</el-radio>
  111. </el-form-item>
  112. <el-form-item label="课程课酬"
  113. prop="salary">
  114. <el-input style="width:180px"
  115. v-model.trim="teacherMask.salary"></el-input>
  116. </el-form-item>
  117. <el-form-item label="课时补贴"
  118. prop="subsidy">
  119. <el-input style="width:180px"
  120. v-model.trim="teacherMask.subsidy"></el-input>
  121. </el-form-item>
  122. </el-form>
  123. <div slot="footer"
  124. class="dialog-footer">
  125. <el-button @click="innerVisible = false">取 消</el-button>
  126. <el-button type="primary"
  127. @click="resetSalary">确 定</el-button>
  128. </div>
  129. </el-dialog>
  130. </el-dialog>
  131. </div>
  132. </template>
  133. <script>
  134. import pagination from '@/components/Pagination/index'
  135. import { getCourseList, getTeacherSalary } from '@/api/buildTeam'
  136. import { updateTeacherCoursesSalary } from '@/api/teacherManager'
  137. import { permission } from '@/utils/directivePage'
  138. export default {
  139. name: 'tsalaryList',
  140. data () {
  141. return {
  142. dialogTableVisible: false,
  143. innerVisible: false,
  144. searchForm: {
  145. date: '' // 时间选择器返回的值
  146. },
  147. pickerOptions: {
  148. firstDayOfWeek: 1,
  149. }, // 时间选择器默认选项
  150. tableList: [], // table列表
  151. rules: {
  152. // 分页规则
  153. limit: 10, // 限制显示条数
  154. page: 1, // 当前页
  155. total: 0, // 总条数
  156. page_size: [10, 20, 40, 50] // 选择限制显示条数
  157. },
  158. searchLsit: [],
  159. activeTeacherList: [{ 1: 1 }],
  160. teacherMask: {
  161. salary: '',
  162. subsidy: '',
  163. radio: ''
  164. },
  165. courseScheduleId: '',
  166. teacherRules: {
  167. salary: [{ required: true, message: '请输入课程课酬', trigger: 'blur' }],
  168. subsidy: [{ required: true, message: '请输入课时补贴', trigger: 'blur' }],
  169. radio: [{ required: true, message: '请选择调整范围', trigger: 'blur' }]
  170. },
  171. tempSelectRow: {}, // 选中班级数据
  172. }
  173. },
  174. components: {
  175. pagination
  176. },
  177. mounted () {
  178. this.getList();
  179. },
  180. activated () {
  181. this.getList()
  182. },
  183. methods: {
  184. permission (str) {
  185. return permission(str)
  186. },
  187. search () {
  188. this.rules.page = 1;
  189. this.getList();
  190. },
  191. getList () {
  192. this.teamid = this.$route.query.id;
  193. // searchForm.date
  194. if (!this.searchForm.date) {
  195. this.searchForm.date = []
  196. }
  197. let obj = {
  198. musicGroupId: this.teamid,
  199. startTime: this.searchForm.date[0] || null,
  200. endTime: this.searchForm.date[1] || null,
  201. page: this.rules.page, rows: this.rules.limit
  202. }
  203. getCourseList(obj).then(res => {
  204. if (res.code == 200) {
  205. this.tableList = res.data.rows;
  206. this.rules.total = res.data.total;
  207. }
  208. })
  209. },
  210. setCourseInfo (row) {
  211. this.tempSelectRow = row
  212. getTeacherSalary({ courseScheduleId: row.courseScheduleId }).then(res => {
  213. if (res.code == 200) {
  214. this.dialogTableVisible = true;
  215. this.courseScheduleId = row.courseScheduleId;
  216. // row.teachingTeachers
  217. this.activeTeacherList = res.data;
  218. }
  219. })
  220. },
  221. resetTeacher (row) {
  222. this.innerVisible = true;
  223. this.activeTeacher = row;
  224. },
  225. resetSalary () {
  226. let that = this
  227. this.$refs['teacherMask'].validate(res => {
  228. if (res) {
  229. updateTeacherCoursesSalary({
  230. courseScheduleId: this.courseScheduleId,
  231. salary: this.teacherMask.salary,
  232. teacherId: this.activeTeacher.teacherId,
  233. subsidy: this.teacherMask.subsidy,
  234. scope: this.teacherMask.radio
  235. }).then(res => {
  236. if (res.code == 200) {
  237. this.$message.success('修改成功')
  238. this.teacherMask = {
  239. salary: '',
  240. subsidy: '',
  241. radio: ''
  242. }
  243. // this.dialogTableVisible = false;
  244. this.innerVisible = false;
  245. that.setCourseInfo(this.tempSelectRow)
  246. }
  247. })
  248. } else {
  249. this.$message.error('请填写必要参数')
  250. }
  251. })
  252. }
  253. }
  254. }
  255. </script>
  256. <style lang="scss" scope>
  257. </style>