historyError.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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. @change="changeBranch"
  19. >
  20. <el-option
  21. v-for="(item, index) in selects.branchs"
  22. :key="index"
  23. :label="item.name"
  24. :value="item.id"
  25. ></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item>
  29. <el-select
  30. class="multiple"
  31. v-model.trim="searchForm.educationUserId"
  32. filterable
  33. clearable
  34. placeholder="请选择乐团主管"
  35. >
  36. <el-option
  37. v-for="(item, index) in educationList"
  38. :key="index"
  39. :label="item.userName"
  40. :value="item.userId"
  41. >
  42. <span style="float: left">{{ item.userName }}</span>
  43. <span style="float: right; color: #8492a6; font-size: 13px">{{
  44. item.userId
  45. }}</span>
  46. </el-option>
  47. </el-select>
  48. </el-form-item>
  49. <el-form-item prop="timer">
  50. <el-date-picker
  51. v-model.trim="searchForm.timer"
  52. type="daterange"
  53. value-format="yyyy-MM-dd"
  54. range-separator="至"
  55. start-placeholder="开始日期"
  56. end-placeholder="结束日期"
  57. :picker-options="{
  58. firstDayOfWeek: 1,
  59. }"
  60. ></el-date-picker>
  61. </el-form-item>
  62. <el-form-item>
  63. <el-button native-type="submit" type="primary">搜索</el-button>
  64. <el-button native-type="reset" type="danger">重置</el-button>
  65. <el-button
  66. type="primary"
  67. v-if="permission('export/exportIndexHistoryErrData')"
  68. @click="exportIndexErr"
  69. >导出</el-button
  70. >
  71. </el-form-item>
  72. </save-form>
  73. <statistic :col="5" class="statistic" :cols="0">
  74. <statistic-item>
  75. <span>乐团巡查事项异常剩余/总数</span>
  76. <span>
  77. {{
  78. statInfo.musicPatrolItemSurplus
  79. ? statInfo.musicPatrolItemSurplus
  80. : "0"
  81. }}
  82. /
  83. {{ statInfo.musicPatrolItem ? statInfo.musicPatrolItem : "0" }}</span
  84. >
  85. </statistic-item>
  86. <statistic-item>
  87. <span>乐团巡查任务未提交剩余/总数</span>
  88. <span>
  89. {{
  90. statInfo.inspectionItemPlanSurplus
  91. ? statInfo.inspectionItemPlanSurplus
  92. : "0"
  93. }}
  94. /
  95. {{
  96. statInfo.inspectionItemPlan ? statInfo.inspectionItemPlan : "0"
  97. }}</span
  98. >
  99. </statistic-item>
  100. <statistic-item>
  101. <span>课程考情异常剩余/总数</span>
  102. <span>
  103. {{
  104. statInfo.teacherExceptionAttendanceSurplus
  105. ? statInfo.teacherExceptionAttendanceSurplus
  106. : "0"
  107. }}
  108. /
  109. {{
  110. statInfo.teacherExceptionAttendance
  111. ? statInfo.teacherExceptionAttendance
  112. : "0"
  113. }}
  114. </span>
  115. </statistic-item>
  116. <statistic-item>
  117. <span>课程异常剩余/总数</span>
  118. <span>
  119. {{
  120. statInfo.teacherNotAClassSurplus
  121. ? statInfo.teacherNotAClassSurplus
  122. : "0"
  123. }}
  124. /
  125. {{
  126. statInfo.teacherNotAClass ? statInfo.teacherNotAClass : "0"
  127. }}</span
  128. >
  129. </statistic-item>
  130. </statistic>
  131. <el-table
  132. style="width: 100%"
  133. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  134. :data="tableList"
  135. >
  136. <el-table-column align="center" prop="month" label="日期">
  137. <template slot-scope="scope">
  138. <div>
  139. {{ scope.row.generateTime }}
  140. </div>
  141. </template>
  142. </el-table-column>
  143. <el-table-column align="center" prop="organName" label="分部">
  144. <template slot-scope="scope">
  145. <div>
  146. <copy-text>{{ scope.row.organName }}</copy-text>
  147. </div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column align="center" prop="organName" label="乐团主管">
  151. <template slot-scope="scope">
  152. <div>
  153. {{ scope.row.dealUserName }}
  154. </div>
  155. </template>
  156. </el-table-column>
  157. <!-- -->
  158. <el-table-column
  159. align="center"
  160. prop="userName"
  161. label="乐团巡查事项异常剩余/总数"
  162. >
  163. <template slot-scope="scope">
  164. <div>
  165. {{
  166. scope.row.musicPatrolItemSurplus
  167. ? scope.row.musicPatrolItemSurplus
  168. : "0"
  169. }}
  170. / {{ scope.row.musicPatrolItem ? scope.row.musicPatrolItem : "0" }}
  171. </div>
  172. </template>
  173. </el-table-column>
  174. <el-table-column
  175. align="center"
  176. prop="item"
  177. label="乐团巡查任务未提交剩余/总数"
  178. >
  179. <template slot-scope="scope">
  180. <div>
  181. {{
  182. scope.row.inspectionItemPlanSurplus
  183. ? scope.row.inspectionItemPlanSurplus
  184. : "0"
  185. }}
  186. /
  187. {{
  188. scope.row.inspectionItemPlan ? scope.row.inspectionItemPlan : "0"
  189. }}
  190. </div>
  191. </template>
  192. </el-table-column>
  193. <!-- <el-table-column
  194. align="center"
  195. prop="times"
  196. label="回访任务未完成剩余/总数"
  197. >
  198. <template slot-scope="scope">
  199. <div>
  200. {{
  201. scope.row.studentVisitSurplus
  202. ? scope.row.studentVisitSurplus
  203. : "0"
  204. }}
  205. / {{ scope.row.studentVisit ? scope.row.studentVisit : "0" }}
  206. </div>
  207. </template>
  208. </el-table-column> -->
  209. <el-table-column
  210. align="center"
  211. prop="plannedTimes"
  212. label="课程考勤异常剩余/总数"
  213. >
  214. <template slot-scope="scope">
  215. <div>
  216. {{
  217. scope.row.teacherExceptionAttendanceSurplus
  218. ? scope.row.teacherExceptionAttendanceSurplus
  219. : "0"
  220. }}
  221. /
  222. {{
  223. scope.row.teacherExceptionAttendance
  224. ? scope.row.teacherExceptionAttendance
  225. : "0"
  226. }}
  227. </div>
  228. </template>
  229. </el-table-column>
  230. <el-table-column
  231. align="center"
  232. prop="submittedTimes"
  233. label="课程异常剩余/总数"
  234. >
  235. <template slot-scope="scope">
  236. <div>
  237. {{
  238. scope.row.teacherNotAClassSurplus
  239. ? scope.row.teacherNotAClassSurplus
  240. : "0"
  241. }}
  242. /
  243. {{ scope.row.teacherNotAClass ? scope.row.teacherNotAClass : "0" }}
  244. </div>
  245. </template>
  246. </el-table-column>
  247. </el-table>
  248. <pagination
  249. sync
  250. :total.sync="rules.total"
  251. saveKey="indexErrDataRecord-historyError"
  252. :page.sync="rules.page"
  253. :limit.sync="rules.limit"
  254. :page-sizes="rules.page_size"
  255. @pagination="getList"
  256. />
  257. </div>
  258. </template>
  259. <script>
  260. // import { getInspectionItem, resetInspectionItem } from "../api";
  261. import countTo from "vue-count-to";
  262. import { permission } from "@/utils/directivePage";
  263. import pagination from "@/components/Pagination/index";
  264. import {
  265. getIndexErrData,
  266. getErrDataSummarizing,
  267. getAllEducationUsers,
  268. } from "../api";
  269. import dayjs from "dayjs";
  270. import { getTimes } from "@/utils";
  271. import { Export } from "@/utils/downLoadFile";
  272. import qs from "qs";
  273. export default {
  274. props: ["searchType"],
  275. components: { pagination, "count-to": countTo },
  276. data() {
  277. return {
  278. searchForm: {
  279. organIds: "",
  280. timer: [],
  281. educationUserId: "",
  282. },
  283. tableList: [],
  284. handleVisible: false,
  285. rules: {
  286. // 分页规则
  287. limit: 10, // 限制显示条数
  288. page: 1, // 当前页
  289. total: 0, // 总条数
  290. page_size: [10, 20, 40, 50], // 选择限制显示条数
  291. },
  292. statInfo: {
  293. inspectionItemPlan: 0,
  294. inspectionItemPlanSurplus: 0,
  295. musicPatrolItem: 0,
  296. musicPatrolItemSurplus: 0,
  297. teacherExceptionAttendance: 0,
  298. teacherExceptionAttendanceSurplus: 0,
  299. teacherNotAClass: 0,
  300. teacherNotAClassSurplus: 0,
  301. studentVisit: 0,
  302. studentVisitSurplus: 0,
  303. },
  304. educationList: [],
  305. };
  306. },
  307. async mounted() {
  308. this.$store.dispatch("setBranchs");
  309. try {
  310. const res = await getAllEducationUsers();
  311. this.educationList = res.data;
  312. } catch (e) {}
  313. this.getList();
  314. },
  315. methods: {
  316. permission(str) {
  317. return permission(str);
  318. },
  319. onReSet() {
  320. this.$refs.searchForm.resetFields();
  321. this.search();
  322. },
  323. search() {
  324. this.rules.page = 1;
  325. this.getList();
  326. },
  327. async changeBranch(val) {
  328. this.searchForm.educationUserId = null;
  329. try {
  330. const res = await getAllEducationUsers({ organIds: val });
  331. this.educationList = res.data;
  332. } catch (e) {}
  333. },
  334. async getList() {
  335. let { timer, ...rest } = this.searchForm;
  336. let params = {
  337. ...rest,
  338. page: this.rules.page,
  339. rows: this.rules.limit,
  340. ...getTimes(timer, ["startDate", "endDate"]),
  341. searchType: this.searchType,
  342. };
  343. try {
  344. const res = await getIndexErrData(params);
  345. // console.log(erDate);
  346. this.tableList = res.data.rows;
  347. this.rules.total = res.data.total;
  348. } catch (e) {
  349. console.log(e);
  350. }
  351. try {
  352. const erDate = await getErrDataSummarizing(params);
  353. this.statInfo = { ...erDate.data };
  354. } catch (e) {
  355. console.log(e);
  356. }
  357. },
  358. resetLine(row) {
  359. let { id, memo } = row;
  360. this.handleForm = { id, memo };
  361. this.handleVisible = true;
  362. },
  363. // async submitHandle() {
  364. // try {
  365. // const res = await resetInspectionItem(this.handleForm);
  366. // this.$message.success("提交成功");
  367. // this.getList();
  368. // this.handleVisible = false;
  369. // } catch (e) {
  370. // console.log(e);
  371. // }
  372. // },
  373. gotoHander(row) {
  374. let startTime = dayjs(row.month).startOf("month").format("YYYY-MM-DD");
  375. let endTime = dayjs(row.month).endOf("month").format("YYYY-MM-DD");
  376. if (row.item == "VISIT") {
  377. // 学员回访
  378. // 跳到回访页面 搜索条件 教务老师 时间范围
  379. this.$router.push({
  380. path: "/studentManager/returnVisitList",
  381. query: { teacher: row.userName, timer: [startTime, endTime] },
  382. });
  383. } else {
  384. // 下校巡查
  385. this.$router.push({
  386. path: "/main/scheduleDetail",
  387. query: {
  388. teacher: row.userId,
  389. startTime,
  390. endTime,
  391. name: row.userName,
  392. organId: row.organId,
  393. itemId: row.id,
  394. times: row.times,
  395. },
  396. });
  397. }
  398. },
  399. exportIndexErr() {
  400. Export(
  401. this,
  402. {
  403. url: "/api-web/export/exportIndexHistoryErrData",
  404. fileName: "首页历史异常统计.xls",
  405. method: "post",
  406. params: qs.stringify({ ...this.searchForm }),
  407. },
  408. "您确定导出首页历史异常统计?"
  409. );
  410. },
  411. },
  412. };
  413. </script>
  414. <style lang="scss" scoped>
  415. </style>