statisticsList.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <div class="vipClass">
  3. <save-form :inline="true" class="searchForm" ref="searchForm" @submit="getList" @reset="reset"
  4. save-key="smallCourseConsumption-actualList" :model.sync="searchForm">
  5. <el-form-item prop="organId">
  6. <el-select class="multiple" filterable v-model.trim="searchForm.organId" multiple collapse-tags clearable
  7. placeholder="请选择分部">
  8. <el-option v-for="(item, index) in selects.branchs" :key="index" :label="item.name" :value="item.id">
  9. </el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-date-picker
  14. v-model.trim="searchForm.timer"
  15. style="width: 400px"
  16. type="daterange"
  17. value-format="yyyy-MM-dd"
  18. :picker-options="{
  19. firstDayOfWeek: 1,
  20. }"
  21. range-separator="至"
  22. start-placeholder="开始日期"
  23. end-placeholder="结束日期"
  24. ></el-date-picker>
  25. </el-form-item>
  26. <el-form-item>
  27. <el-button native-type="submit" type="danger">搜索</el-button>
  28. <el-button native-type="reset" type="primary">重置</el-button>
  29. </el-form-item>
  30. </save-form>
  31. <ExportChiose
  32. v-permission="'export/EXPORT_COURSE_CONSUMER_SUM'"
  33. style="margin-bottom: 20px;margin-right:10px;"
  34. name="课耗统计导出"
  35. ExportEnum="EXPORT_COURSE_CONSUMER_SUM"
  36. :exportData="onExport"
  37. fileName="课耗统计导出"
  38. errorMsg="请选择时间"
  39. :isDownList="true"
  40. />
  41. <div class="tableWrap">
  42. <el-table :data="tableList" :header-cell-style="{ background: '#EDEEF0', color: '#444' }">
  43. <el-table-column align="center" prop="organName" label="所属分部">
  44. <template slot-scope="scope">
  45. <copy-text>{{
  46. scope.row.organName
  47. }}</copy-text>
  48. </template>
  49. </el-table-column>
  50. <el-table-column align="center" prop="normalNum" label="在读人数">
  51. <template slot-scope="scope">
  52. <p>
  53. {{
  54. scope.row.normalNum
  55. }}人
  56. </p>
  57. </template>
  58. </el-table-column>
  59. <el-table-column align="center" prop="normalNum" label="应有课耗">
  60. <template slot-scope="scope">
  61. <p>
  62. {{
  63. scope.row.courseConsumerNum
  64. }}节
  65. </p>
  66. </template>
  67. </el-table-column>
  68. <el-table-column align="center" prop="normalNum" label="实际课耗">
  69. <template slot-scope="scope">
  70. <p>
  71. {{
  72. scope.row.courseSum
  73. }}节
  74. </p>
  75. </template>
  76. </el-table-column>
  77. <el-table-column align="center" prop="normalNum" label="课耗达标率">
  78. <template slot-scope="scope">
  79. <p>
  80. {{
  81. scope.row.courseConsumerRate
  82. }}%
  83. </p>
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="center" prop="studentBasicInfo.subjectName" label="大于等于5节">
  87. <template slot-scope="scope">
  88. <p>
  89. {{
  90. scope.row.num5
  91. }}人
  92. </p>
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="center" prop="studentBasicInfo.subjectName" label="4节">
  96. <template slot-scope="scope">
  97. <p>
  98. {{
  99. scope.row.num4
  100. }}人
  101. </p>
  102. </template>
  103. </el-table-column>
  104. <el-table-column align="center" prop="studentBasicInfo.subjectName" label="3节">
  105. <template slot-scope="scope">
  106. <p>
  107. {{
  108. scope.row.num3
  109. }}人
  110. </p>
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="center" prop="studentBasicInfo.subjectName" label="2节">
  114. <template slot-scope="scope">
  115. <p>
  116. {{
  117. scope.row.num2
  118. }}人
  119. </p>
  120. </template>
  121. </el-table-column>
  122. <el-table-column align="center" prop="studentBasicInfo.subjectName" label="1节">
  123. <template slot-scope="scope">
  124. <p>
  125. {{
  126. scope.row.num1
  127. }}人
  128. </p>
  129. </template>
  130. </el-table-column>
  131. <el-table-column align="center" prop="studentBasicInfo.subjectName" label="0节">
  132. <template slot-scope="scope">
  133. <p>
  134. {{
  135. scope.row.num0
  136. }}人
  137. </p>
  138. </template>
  139. </el-table-column>
  140. <el-table-column align="center" prop="studentBasicInfo.subjectName" label="达标占比">
  141. <template slot-scope="scope">
  142. <p>
  143. {{
  144. scope.row.standRate
  145. }}%
  146. </p>
  147. </template>
  148. </el-table-column>
  149. <!-- <el-table-column align="center" width="180px" label="操作">
  150. <template slot-scope="scope">
  151. <el-button type="text" @click="lookDetail(scope.row)">查看详情</el-button>
  152. </template>
  153. </el-table-column> -->
  154. </el-table>
  155. <preDetail ref='preDetailRef'/>
  156. <!-- <pagination
  157. sync
  158. save-key="smallCourseConsumption-actualList"
  159. :total.sync="pageInfo.total"
  160. :page.sync="pageInfo.page"
  161. :limit.sync="pageInfo.limit"
  162. :page-sizes="pageInfo.page_size"
  163. @pagination="getList"
  164. /> -->
  165. </div>
  166. </div>
  167. </template>
  168. <script>
  169. import { getCourseConsumerSum } from '../api'
  170. import pagination from "@/components/Pagination/index";
  171. import dayjs from 'dayjs'
  172. import preDetail from '../modals/preDetail.vue'
  173. import ExportChiose from "@/components/Export-chiose";
  174. import { getTimes } from "@/utils";
  175. export default {
  176. name: "actualList",
  177. components: {
  178. pagination,
  179. preDetail,
  180. ExportChiose
  181. },
  182. provide() {
  183. return {
  184. organId: () => this.searchForm.organId.join(","),
  185. isSearch: () => this.isSearch,
  186. };
  187. },
  188. data() {
  189. return {
  190. searchForm: {
  191. organId: [],
  192. timer:[dayjs(new Date().setDate(1)).format('YYYY-MM-DD'), dayjs(new Date()).format('YYYY-MM-DD')]
  193. },
  194. pageInfo: {
  195. // 分页规则
  196. limit: 10, // 限制显示条数
  197. page: 1, // 当前页
  198. total: 0, // 总条数
  199. page_size: [10, 20, 40, 50], // 选择限制显示条数
  200. },
  201. tableList: [],
  202. };
  203. },
  204. async mounted() {
  205. this.$store.dispatch("setBranchs");
  206. this.getList()
  207. },
  208. methods: {
  209. __init() { },
  210. reset() {
  211. this.searchForm.organId = [];
  212. this.searchForm.timer=[dayjs(new Date().setDate(1)).format('YYYY-MM-DD'), dayjs(new Date()).format('YYYY-MM-DD')]
  213. this.pageInfo.page = 1;
  214. this.getList();
  215. },
  216. async getList() {
  217. try {
  218. const { timer, ...rest } = this.searchForm;
  219. let obj = {
  220. ...rest,
  221. organId: this.searchForm.organId.join(","),
  222. ...getTimes(timer, ["startDate", "endDate"]),
  223. // rows: this.rues.limit,
  224. // page: this.rulles.page,
  225. }
  226. const res = await getCourseConsumerSum(obj)
  227. this.tableList = res.data;
  228. } catch (e) {
  229. console.log(e)
  230. }
  231. },
  232. lookDetail(row){
  233. this.$refs.preDetailRef.openDialog(row,this.searchForm.timer)
  234. }
  235. },
  236. computed:{
  237. onExport(){
  238. const { timer, ...rest } = this.searchForm;
  239. let obj = {
  240. organId: this.searchForm.organId.join(","),
  241. ...getTimes(timer, ["startDate", "endDate"]),
  242. // rows: this.rues.limit,
  243. // page: this.rulles.page,
  244. }
  245. return obj
  246. }
  247. }
  248. };
  249. </script>
  250. <style lang="scss" scoped>
  251. .rows {
  252. >div {
  253. margin-bottom: 20px;
  254. }
  255. }
  256. ::v-deep .el-card__body .statistic {
  257. margin-bottom: 15px;
  258. padding: 0;
  259. }
  260. .statistic {
  261. .statistic-content>span {
  262. font-size: 22px !important;
  263. &:first-child {
  264. font-size: 14px !important;
  265. }
  266. }
  267. }
  268. </style>