operationalList.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 运营预警
  6. </h2>
  7. <div class="m-core">
  8. <save-form :inline="true" :model="searchForm" @submit='search' @reset='onReSet'>
  9. <el-form-item>
  10. <el-select
  11. v-model.trim="searchForm.organId"
  12. placeholder="请选择分部"
  13. clearable
  14. filterable
  15. >
  16. <el-option
  17. v-for="(item, index) in selects.branchs"
  18. :key="index"
  19. :value="item.id"
  20. :label="item.name"
  21. ></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item>
  25. <remote-search
  26. :commit="'setTeachers'"
  27. v-model="searchForm.userId"
  28. />
  29. </el-form-item>
  30. <el-form-item>
  31. <el-date-picker
  32. style="width: 100% !important"
  33. v-model.trim="searchForm.monthStr"
  34. type="month"
  35. value-format="yyyy-MM"
  36. placeholder="选择月"
  37. >
  38. </el-date-picker>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-select
  42. v-model.trim="searchForm.lowSalary"
  43. placeholder="请选择是否预警"
  44. clearable
  45. filterable
  46. >
  47. <el-option
  48. value="0"
  49. label="否"
  50. ></el-option>
  51. <el-option
  52. value="1"
  53. label="是"
  54. ></el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-input v-model="searchForm.minSalary" type="number" placeholder="预警课酬大于"></el-input>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-input v-model="searchForm.maxSalary" type="number" placeholder="预警课酬小于"></el-input>
  62. </el-form-item>
  63. <el-form-item>
  64. <el-button type="danger" native-type="submit">搜索</el-button>
  65. <el-button native-type="reset" type="primary">重置</el-button>
  66. <el-button type="primary" @click="onExport" v-permission="'export/teacherCourseStatistics'">导出</el-button>
  67. </el-form-item>
  68. </save-form>
  69. <div class="tableWrap">
  70. <el-table
  71. :data="tableList"
  72. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  73. >
  74. <el-table-column align="center" prop="monthStr" label="月份">
  75. </el-table-column>
  76. <el-table-column align="center" prop="organName" label="分部">
  77. <template slot-scope="scope">
  78. <div>
  79. <copy-text>{{ scope.row.organName }}</copy-text>
  80. </div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column align="center" prop="realName" label="老师">
  84. <template slot-scope="scope">
  85. <div>
  86. <copy-text>{{ scope.row.realName }}</copy-text>
  87. </div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column align="center" prop="subjectListStr" label="专业">
  91. <template slot-scope="scope">
  92. <overflow-text width="100%" :text="scope.row.subjectListStr" />
  93. </template>
  94. </el-table-column>
  95. <el-table-column
  96. align="center"
  97. prop="musicCourseNum"
  98. label="乐团节数"
  99. >
  100. </el-table-column>
  101. <el-table-column align="center" prop="vipCourseNum" label="VIP节数">
  102. </el-table-column>
  103. <el-table-column align="center" prop="practiceCourseNum" label="网管节数">
  104. </el-table-column>
  105. <el-table-column
  106. align="center"
  107. prop="expectMusicCourseSalary"
  108. label="预计乐团课酬"
  109. >
  110. <template slot-scope="scope">
  111. <div>
  112. {{ scope.row.expectMusicCourseSalary | moneyFormat }}
  113. </div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column
  117. align="center"
  118. prop="expectVipCourseSalary"
  119. label="预计VIP课酬"
  120. >
  121. <template slot-scope="scope">
  122. <div>
  123. {{ scope.row.expectVipCourseSalary | moneyFormat }}
  124. </div>
  125. </template>
  126. </el-table-column>
  127. <el-table-column
  128. align="center"
  129. prop="expectPracticeCourseSalary"
  130. label="预计网管课酬"
  131. >
  132. <template slot-scope="scope">
  133. <div>
  134. {{ scope.row.expectPracticeCourseSalary | moneyFormat }}
  135. </div>
  136. </template>
  137. </el-table-column>
  138. <el-table-column
  139. align="center"
  140. label="预计课酬合计"
  141. prop="expectTotalSalary"
  142. >
  143. <template slot-scope="scope">
  144. <div>
  145. {{ scope.row.expectTotalSalary | moneyFormat }}
  146. </div>
  147. </template>
  148. </el-table-column>
  149. <el-table-column
  150. align="center"
  151. prop="averageClassMinutes"
  152. label="平均上课时长"
  153. >
  154. </el-table-column>
  155. </el-table>
  156. <pagination
  157. sync
  158. :total.sync="pageInfo.total"
  159. :page.sync="pageInfo.page"
  160. :limit.sync="pageInfo.limit"
  161. :page-sizes="pageInfo.page_size"
  162. @pagination="getList"
  163. />
  164. </div>
  165. </div>
  166. </div>
  167. </template>
  168. <script>
  169. import {
  170. getEmployeeOrgan,
  171. teacherCourseStatistics,
  172. getTeacher,
  173. } from "@/api/buildTeam";
  174. import pagination from "@/components/Pagination/index";
  175. import { Export } from "@/utils/downLoadFile";
  176. import qs from 'qs'
  177. let nowDate = new Date();
  178. let nowMonth =
  179. nowDate.getFullYear() +
  180. "-" +
  181. (nowDate.getMonth() + 1 >= 10
  182. ? nowDate.getMonth() + 1
  183. : "0" + (nowDate.getMonth() + 1));
  184. export default {
  185. name: "operationalList",
  186. components: { pagination },
  187. data() {
  188. return {
  189. searchForm: {
  190. organId: null,
  191. monthStr: nowMonth,
  192. userId: null,
  193. maxSalary: null,
  194. lowSalary: null,
  195. },
  196. tableList: [{}],
  197. organList: [],
  198. teacherList: [],
  199. pageInfo: {
  200. // 分页规则
  201. limit: 10, // 限制显示条数
  202. page: 1, // 当前页
  203. total: 0, // 总条数
  204. page_size: [10, 20, 40, 50], // 选择限制显示条数
  205. },
  206. };
  207. },
  208. mounted() {
  209. // 获取分部
  210. // getEmployeeOrgan().then(res => {
  211. // if (res.code == 200) {
  212. // this.organList = res.data;
  213. // }
  214. // })
  215. const { lowSalary, organId } = this.$route.query
  216. if (organId) {
  217. this.searchForm.organId = organId
  218. }
  219. let string = lowSalary == 1 || lowSalary == 0 ? String(lowSalary) : ''
  220. if (string) {
  221. this.$set(this.searchForm, 'lowSalary', string)
  222. }
  223. this.$store.dispatch("setBranchs");
  224. // 获取老师列表
  225. // getTeacher({ organId: this.organId }).then(res => {
  226. // if (res.code == 200) {
  227. // this.teacherList = res.data;
  228. // }
  229. // })
  230. this.getList();
  231. },
  232. methods: {
  233. search() {
  234. this.pageInfo.page = 1;
  235. this.getList();
  236. },
  237. onReSet() {
  238. this.searchForm = {
  239. organId: null,
  240. monthStr: nowMonth,
  241. userId: null,
  242. maxSalary: null,
  243. lowSalary: null,
  244. };
  245. this.getList();
  246. },
  247. getList() {
  248. let params = this.searchForm;
  249. // params.page = this.pageInfo.page
  250. // params.rows = this.pageInfo.limit
  251. teacherCourseStatistics({ ...params, page: this.pageInfo.page, rows: this.pageInfo.limit }).then((res) => {
  252. let result = res.data;
  253. if (res.code == 200) {
  254. this.tableList = result.rows;
  255. this.pageInfo.total = result.total;
  256. }
  257. });
  258. },
  259. onExport() {
  260. const { ...rest } = this.searchForm;
  261. Export(
  262. this,
  263. {
  264. url: "/api-web/export/teacherCourseStatistics",
  265. fileName: "运营预警.xls",
  266. method: "post",
  267. params: qs.stringify({
  268. ...rest
  269. }),
  270. },
  271. "您确定导出运营预警?"
  272. );
  273. },
  274. },
  275. };
  276. </script>
  277. <style lang="scss" scoped>
  278. </style>