operationalList.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 运营预警
  6. </h2>
  7. <div class="m-core">
  8. <el-form :inline="true"
  9. :model="searchForm">
  10. <el-form-item>
  11. <el-select v-model.trim="searchForm.organId"
  12. @clear="onClear('organId')"
  13. placeholder='请选择分部'
  14. clearable
  15. filterable>
  16. <el-option v-for='(item,index) in organList'
  17. :key="index"
  18. :value="item.id"
  19. :label="item.name"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item>
  23. <el-select v-model.trim="searchForm.userId"
  24. @clear="onClear('userId')"
  25. clearable
  26. filterable
  27. placeholder="指导老师">
  28. <el-option v-for="(item,index) in teacherList"
  29. :key='index'
  30. :value="item.id"
  31. :label="item.username"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-date-picker v-model.trim="searchForm.monthStr"
  36. @clear="onClear('monthStr')"
  37. type="month"
  38. value-format="yyyy-MM"
  39. placeholder="选择月">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item>
  43. <el-button type="danger"
  44. @click="search">搜索</el-button>
  45. <el-button @click="onReSet"
  46. type="primary">重置</el-button>
  47. </el-form-item>
  48. </el-form>
  49. <div class="tableWrap">
  50. <el-table :data='tableList'
  51. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  52. <el-table-column align='center'
  53. prop="monthStr"
  54. label="月份">
  55. </el-table-column>
  56. <el-table-column align='center'
  57. prop="organName"
  58. label="分部">
  59. </el-table-column>
  60. <el-table-column align='center'
  61. prop="realName"
  62. label="老师">
  63. </el-table-column>
  64. <el-table-column align='center'
  65. prop="subjectListStr"
  66. label="专业">
  67. </el-table-column>
  68. <el-table-column align='center'
  69. prop="musicCourseNum"
  70. label="乐团节数">
  71. </el-table-column>
  72. <el-table-column align='center'
  73. prop="vipCourseNum"
  74. label="小课节数">
  75. </el-table-column>
  76. <el-table-column align='center'
  77. prop="expectMusicCourseSalary"
  78. label="预计乐团课酬">
  79. <template slot-scope="scope">
  80. <div>
  81. {{scope.row.expectMusicCourseSalary | moneyFormat}}
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column align='center'
  86. prop="expectVipCourseSalary"
  87. label="预计小课课酬">
  88. <template slot-scope="scope">
  89. <div>
  90. {{scope.row.expectVipCourseSalary | moneyFormat}}
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align='center'
  95. label="预计课酬合计"
  96. prop="expectTotalSalary">
  97. <template slot-scope="scope">
  98. <div>
  99. {{scope.row.expectTotalSalary | moneyFormat}}
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align='center'
  104. prop="averageClassMinutes"
  105. label="平均上课时长">
  106. </el-table-column>
  107. </el-table>
  108. <pagination :total="pageInfo.total"
  109. :page.sync="pageInfo.page"
  110. :limit.sync="pageInfo.limit"
  111. :page-sizes="pageInfo.page_size"
  112. @pagination="getList" />
  113. </div>
  114. </div>
  115. </div>
  116. </template>
  117. <script>
  118. import { getEmployeeOrgan, teacherCourseStatistics, getTeacher } from '@/api/buildTeam'
  119. import pagination from '@/components/Pagination/index'
  120. let nowDate = new Date()
  121. let nowMonth = nowDate.getFullYear() + '-' + ((nowDate.getMonth() + 1) >= 10 ? (nowDate.getMonth() + 1) : '0' + (nowDate.getMonth() + 1))
  122. export default {
  123. name: 'operationalList',
  124. components: { pagination },
  125. data () {
  126. return {
  127. searchForm: {
  128. organId: null,
  129. monthStr: nowMonth,
  130. userId: null
  131. },
  132. tableList: [{}],
  133. organList: [],
  134. teacherList: [],
  135. pageInfo: {
  136. // 分页规则
  137. limit: 10, // 限制显示条数
  138. page: 1, // 当前页
  139. total: 0, // 总条数
  140. page_size: [10, 20, 40, 50] // 选择限制显示条数
  141. }
  142. }
  143. },
  144. mounted () {
  145. // 获取分部
  146. getEmployeeOrgan().then(res => {
  147. if (res.code == 200) {
  148. this.organList = res.data;
  149. }
  150. })
  151. // 获取老师列表
  152. getTeacher({ organId: this.organId }).then(res => {
  153. if (res.code == 200) {
  154. this.teacherList = res.data;
  155. }
  156. })
  157. this.getList();
  158. },
  159. methods: {
  160. search () {
  161. this.pageInfo.page = 1
  162. this.getList()
  163. },
  164. onClear (type) {
  165. if (type == 'organId') {
  166. this.searchForm.organId = null
  167. } else if (type == 'monthStr') {
  168. this.searchForm.monthStr = null
  169. } else if (type == 'userId') {
  170. this.searchForm.userId = null
  171. }
  172. },
  173. onReSet () {
  174. this.searchForm = {
  175. organId: null,
  176. monthStr: null,
  177. userId: null
  178. }
  179. this.getList()
  180. },
  181. getList () {
  182. let params = this.searchForm
  183. teacherCourseStatistics(params).then(res => {
  184. let result = res.data
  185. if (res.code == 200) {
  186. this.tableList = result.rows
  187. this.pageInfo.total = result.total
  188. }
  189. })
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. </style>