historyError.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <div>
  3. <save-form
  4. :inline="true"
  5. :model="searchForm"
  6. ref="searchForm"
  7. @submit="search"
  8. @reset="onReSet"
  9. saveKey="indexErrDataRecord-historyError"
  10. >
  11. <el-form-item prop="organIds">
  12. <el-select
  13. class="multiple"
  14. v-model.trim="searchForm.organIds"
  15. filterable
  16. clearable
  17. placeholder="请选择分部"
  18. >
  19. <el-option
  20. v-for="(item, index) in selects.branchs"
  21. :key="index"
  22. :label="item.name"
  23. :value="item.id"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item prop="timer">
  28. <el-date-picker
  29. v-model.trim="searchForm.timer"
  30. type="daterange"
  31. value-format="yyyy-MM-dd"
  32. range-separator="至"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期"
  35. :picker-options="{
  36. firstDayOfWeek: 1,
  37. }"
  38. ></el-date-picker>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button native-type="submit" type="primary">搜索</el-button>
  42. <el-button native-type="reset" type="danger">重置</el-button>
  43. <el-button type="primary" v-if="permission('export/exportIndexHistoryErrData')" @click="exportIndexErr">导出</el-button>
  44. </el-form-item>
  45. </save-form>
  46. <el-table
  47. style="width: 100%"
  48. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  49. :data="tableList"
  50. >
  51. <el-table-column align="center" prop="month" label="日期">
  52. <template slot-scope="scope">
  53. <div>
  54. {{ scope.row.generateTime }}
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column align="center" prop="organName" label="分部">
  59. <template slot-scope="scope">
  60. <div>
  61. <copy-text>{{ scope.row.organName }}</copy-text>
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column
  66. align="center"
  67. prop="userName"
  68. label="乐团巡查事项异常剩余/总数"
  69. >
  70. <template slot-scope="scope">
  71. <div>
  72. {{ scope.row.musicPatrolItemSurplus?scope.row.musicPatrolItemSurplus:'0'}} / {{ scope.row.musicPatrolItem?scope.row.musicPatrolItem:'0'}}
  73. </div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column
  77. align="center"
  78. prop="item"
  79. label="乐团巡查任务未提交剩余/总数"
  80. >
  81. <template slot-scope="scope">
  82. <div>
  83. {{ scope.row.inspectionItemPlanSurplus?scope.row.inspectionItemPlanSurplus:'0'}} / {{ scope.row.inspectionItemPlan?scope.row.inspectionItemPlan:'0'}}
  84. </div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. align="center"
  89. prop="times"
  90. label="回访任务未完成剩余/总数"
  91. >
  92. <template slot-scope="scope">
  93. <div>
  94. {{ scope.row.studentVisitSurplus?scope.row.studentVisitSurplus:'0'}} / {{ scope.row.studentVisit?scope.row.studentVisit:'0'}}
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column
  99. align="center"
  100. prop="plannedTimes"
  101. label="课程考勤异常剩余/总数"
  102. >
  103. <template slot-scope="scope">
  104. <div>
  105. {{ scope.row.teacherExceptionAttendanceSurplus?scope.row.teacherExceptionAttendanceSurplus:'0'}} / {{scope.row.teacherExceptionAttendance?scope.row.teacherExceptionAttendance:'0'}}
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. align="center"
  111. prop="submittedTimes"
  112. label="课程异常剩余/总数"
  113. >
  114. <template slot-scope="scope">
  115. <div
  116. >
  117. {{ scope.row.teacherNotAClassSurplus?scope.row.teacherNotAClassSurplus:'0'}} / {{ scope.row.teacherNotAClass?scope.row.teacherNotAClass:'0'}}
  118. </div>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <pagination
  123. sync
  124. :total.sync="rules.total"
  125. saveKey="indexErrDataRecord-historyError"
  126. :page.sync="rules.page"
  127. :limit.sync="rules.limit"
  128. :page-sizes="rules.page_size"
  129. @pagination="getList"
  130. />
  131. </div>
  132. </template>
  133. <script>
  134. // import { getInspectionItem, resetInspectionItem } from "../api";
  135. import { permission } from "@/utils/directivePage";
  136. import pagination from "@/components/Pagination/index";
  137. import { getIndexErrData } from "../api";
  138. import dayjs from "dayjs";
  139. import { getTimes } from "@/utils";
  140. import { Export } from "@/utils/downLoadFile";
  141. export default {
  142. props: ["searchType"],
  143. components: { pagination },
  144. data() {
  145. return {
  146. searchForm: {
  147. organIds: "",
  148. timer: [],
  149. },
  150. tableList: [],
  151. handleVisible: false,
  152. rules: {
  153. // 分页规则
  154. limit: 10, // 限制显示条数
  155. page: 1, // 当前页
  156. total: 0, // 总条数
  157. page_size: [10, 20, 40, 50], // 选择限制显示条数
  158. },
  159. };
  160. },
  161. mounted() {
  162. this.$store.dispatch("setBranchs");
  163. this.getList();
  164. },
  165. methods: {
  166. permission(str) {
  167. return permission(str);
  168. },
  169. onReSet() {
  170. this.$refs.searchForm.resetFields();
  171. this.search();
  172. },
  173. search() {
  174. this.rules.page = 1;
  175. this.getList();
  176. },
  177. async getList() {
  178. let { timer, ...rest } = this.searchForm;
  179. let params = {
  180. ...rest,
  181. page: this.rules.page,
  182. rows: this.rules.limit,
  183. ...getTimes(timer, ["startDate", "endDate"]),
  184. searchType: this.searchType,
  185. };
  186. try {
  187. const res = await getIndexErrData(params);
  188. this.tableList = res.data.rows;
  189. this.rules.total = res.data.total;
  190. } catch (e) {
  191. console.log(e);
  192. }
  193. },
  194. resetLine(row) {
  195. let { id, memo } = row;
  196. this.handleForm = { id, memo };
  197. this.handleVisible = true;
  198. },
  199. // async submitHandle() {
  200. // try {
  201. // const res = await resetInspectionItem(this.handleForm);
  202. // this.$message.success("提交成功");
  203. // this.getList();
  204. // this.handleVisible = false;
  205. // } catch (e) {
  206. // console.log(e);
  207. // }
  208. // },
  209. gotoHander(row) {
  210. let startTime = dayjs(row.month).startOf("month").format("YYYY-MM-DD");
  211. let endTime = dayjs(row.month).endOf("month").format("YYYY-MM-DD");
  212. if (row.item == "VISIT") {
  213. // 学员回访
  214. // 跳到回访页面 搜索条件 教务老师 时间范围
  215. this.$router.push({
  216. path: "/studentManager/returnVisitList",
  217. query: { teacher: row.userName, timer: [startTime, endTime] },
  218. });
  219. } else {
  220. // 下校巡查
  221. this.$router.push({
  222. path: "/main/scheduleDetail",
  223. query: {
  224. teacher: row.userId,
  225. startTime,
  226. endTime,
  227. name: row.userName,
  228. organId: row.organId,
  229. itemId: row.id,
  230. times: row.times,
  231. },
  232. });
  233. }
  234. },
  235. exportIndexErr(){
  236. Export(this, {
  237. url: '/api-web/export/exportIndexHistoryErrData',
  238. fileName: '首页历史异常统计.xls',
  239. method: 'post',
  240. params:qs.stringify({...this.searchForm})
  241. }, '您确定导出首页历史异常统计?')
  242. }
  243. },
  244. };
  245. </script>
  246. <style lang="scss" scoped>
  247. </style>