serverIndexList.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="titleWrap">
  6. <div class="squrt"></div>
  7. 服务指标
  8. </div>
  9. <el-button
  10. type="text"
  11. icon="el-icon-question"
  12. @click="lookServerDetail"
  13. style="color: red"
  14. >服务指标规则</el-button
  15. >
  16. </h2>
  17. <div class="m-core">
  18. <save-form
  19. ref="searchForm"
  20. :inline="true"
  21. :model="searchForm"
  22. @submit="search"
  23. @reset="onReSet"
  24. >
  25. <el-form-item>
  26. <remote-search
  27. :commit="'setTeachers'"
  28. v-model="searchForm.teacherId"
  29. :isForzenWithQueryCondition="true"
  30. />
  31. </el-form-item>
  32. <el-form-item>
  33. <el-input
  34. v-model.trim="searchForm.search"
  35. @keyup.enter.native="
  36. (e) => {
  37. e.target.blur();
  38. $refs.searchForm.save();
  39. search();
  40. }
  41. "
  42. clearable
  43. placeholder="学生姓名"
  44. ></el-input>
  45. </el-form-item>
  46. <el-form-item label="周次选择">
  47. <el-date-picker
  48. v-model.trim="searchForm.timer"
  49. style="width: 400px"
  50. type="daterange"
  51. :picker-options="{
  52. firstDayOfWeek: 1,
  53. }"
  54. value-format="yyyy-MM-dd"
  55. range-separator="至"
  56. start-placeholder="周次开始日期"
  57. end-placeholder="周次结束日期"
  58. @change="getWeekTime"
  59. ></el-date-picker>
  60. </el-form-item>
  61. <el-form-item>
  62. <el-button
  63. :type="isSearch ? 'primary' : 'info'"
  64. icon="el-icon-circle-plus-outline"
  65. @click="showMove = true"
  66. >更多选项</el-button
  67. >
  68. <el-button type="danger" native-type="submit">搜索</el-button>
  69. <el-button native-type="reset" type="primary">重置</el-button>
  70. <el-button
  71. @click="onExport"
  72. type="primary"
  73. v-permission="'export/exercisesSituations'"
  74. >导出</el-button
  75. >
  76. </el-form-item>
  77. </save-form>
  78. <div class="tableWrap">
  79. <el-table
  80. style="width: 100%"
  81. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  82. :data="tableList"
  83. >
  84. <el-table-column align="center" prop="studentId" label="学员编号">
  85. <template slot-scope="scope">
  86. <div>
  87. <copy-text>{{ scope.row.studentId }}</copy-text>
  88. </div>
  89. </template>
  90. </el-table-column>
  91. <el-table-column align="center" prop="studentName" label="学生姓名">
  92. <template slot-scope="scope">
  93. <div>
  94. <copy-text>{{ scope.row.studentName }}</copy-text>
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column align="center" prop="organName" label="所属分部">
  99. <template slot-scope="scope">
  100. <div>
  101. <copy-text>{{ scope.row.organName }}</copy-text>
  102. </div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column align="center" prop="groupNames" label="乐团名称">
  106. <template slot-scope="scope">
  107. <overflow-text
  108. width="100%"
  109. :text="scope.row.groupNames"
  110. ></overflow-text>
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="center" prop="teacherName" label="服务老师">
  114. <template slot-scope="scope">
  115. <div>
  116. <copy-text>{{ scope.row.teacherName }}</copy-text>
  117. </div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column
  121. align="center"
  122. prop="educationalTeacherName"
  123. label="乐团主管"
  124. ></el-table-column>
  125. <el-table-column
  126. align="center"
  127. prop="courseIds"
  128. width="100"
  129. label="服务课程"
  130. >
  131. <template slot-scope="scope">
  132. <copy-text>{{ scope.row.courseIds || "课外训练" }}</copy-text>
  133. </template>
  134. </el-table-column>
  135. <el-table-column align="center" label="预期训练布置">
  136. <template slot-scope="scope">
  137. <div>{{ scope.row.expectExercisesNum + "次" }}</div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column align="center" width="120" prop>
  141. <template slot="header" slot-scope="scope">
  142. <p style="position: relative">
  143. 实际训练布置
  144. <el-tooltip placement="top" popper-class="mTooltip">
  145. <div slot="content">
  146. 以周为单位,每周服务指标指定的课程布置训练记一次实际训练布置
  147. </div>
  148. <!-- <img :src="imageIcon"
  149. class="micon el-tooltip"
  150. style="width:8px height:8px"
  151. alt /> -->
  152. <i
  153. class="el-icon-question"
  154. style="font-size: 18px; color: #f56c6c"
  155. ></i>
  156. </el-tooltip>
  157. </p>
  158. </template>
  159. <template slot-scope="scope">
  160. <div
  161. :style="
  162. scope.row.actualExercisesNum < scope.row.expectExercisesNum
  163. ? 'color:red'
  164. : ''
  165. "
  166. >
  167. {{ scope.row.actualExercisesNum + "次" }}
  168. </div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column align="center" prop label="提交次数">
  172. <template slot-scope="scope">
  173. <div>{{ scope.row.exercisesReplyNum + "次" }}</div>
  174. </template>
  175. </el-table-column>
  176. <el-table-column align="center" prop label="评价次数">
  177. <template slot-scope="scope">
  178. <div
  179. :style="
  180. scope.row.exercisesMessageNum < scope.row.exercisesReplyNum
  181. ? 'color:red'
  182. : ''
  183. "
  184. >
  185. {{ scope.row.exercisesMessageNum + "次" }}
  186. </div>
  187. </template>
  188. </el-table-column>
  189. <el-table-column align="center" prop label="及时评价次数">
  190. <template slot-scope="scope">
  191. <div>{{ scope.row.exercisesMessageTimelyNum + "次" }}</div>
  192. </template>
  193. </el-table-column>
  194. <el-table-column align="center" label="VIP课">
  195. <template slot-scope="scope">
  196. <div>{{ scope.row.existVipCourse + "节" }}</div>
  197. </template>
  198. </el-table-column>
  199. <el-table-column align="center" label="付费网管课">
  200. <template slot-scope="scope">
  201. <div>{{ scope.row.existPracticeCourse + "节" }}</div>
  202. </template>
  203. </el-table-column>
  204. <el-table-column align="center" label="训练提交时间">
  205. <template slot-scope="scope">
  206. <div>{{ scope.row.lastSubmitTime }}</div>
  207. </template>
  208. </el-table-column>
  209. <el-table-column align="center" width="120" label="服务周期">
  210. <template slot-scope="scope">
  211. <div>{{ dayjs(scope.row.monday).format("YYYY-MM-DD") }}</div>
  212. <div>{{ dayjs(scope.row.sunday).format("YYYY-MM-DD") }}</div>
  213. </template>
  214. </el-table-column>
  215. <el-table-column align="center" label="操作">
  216. <!-- -->
  217. <template slot-scope="scope">
  218. <div v-if="scope.row.actualExercisesNum > 0">
  219. <el-button type="text" @click="lookDetail(scope.row)"
  220. >查看</el-button
  221. >
  222. </div>
  223. </template>
  224. </el-table-column>
  225. </el-table>
  226. <pagination
  227. sync
  228. :total.sync="rules.total"
  229. :page.sync="rules.page"
  230. :limit.sync="rules.limit"
  231. :page-sizes="rules.page_size"
  232. @pagination="getList"
  233. />
  234. </div>
  235. </div>
  236. <el-dialog title="服务指标规则说明" :visible.sync="lookServer">
  237. <div class="serverInfo">
  238. <p style="font-weight:600">系统规则:</p>
  239. <p>
  240. 1、每<span>周一凌晨</span>系统根据下方流程图,为每个乐团<span>独立生成</span>本周训练布置路径
  241. </p>
  242. <p>
  243. 2、系统<span>每10分钟</span>根据乐团最新的课程、班级信息<span>更新</span>本周训练布置路径
  244. </p>
  245. <p style="margin-top: 20px;font-weight:600">前提条件:</p>
  246. <p>1、学员管理中,【是否服务】为 【是】</p>
  247. <p>2、学员在【进行中】乐团在读</p>
  248. <p>3、乐团截止本周日前,有声部课(含集训)或合奏课(含集训)</p>
  249. <p style="margin-top: 20px;font-weight:600">特殊情况:</p>
  250. <p>1、学员在多个乐团时,可能存在多次作业</p>
  251. <p>2、老师<span>已布置训练后</span>,由于班级、学员、课程变动<span>更新</span>训练布置路径时,可能存在多次作业,但<span>服务指标相关数据统计仅按最新的训练布置路径统计</span></p>
  252. <p>3、学员不在【课外训练布置班级】所设置的班级类型中时,不会生成课外训练</p>
  253. <div class="imgWrap">
  254. <el-image
  255. :src="serverImg"
  256. class="img"
  257. fit="cover"
  258. >
  259. </el-image>
  260. </div>
  261. </div>
  262. </el-dialog>
  263. <el-dialog
  264. title="更多选项"
  265. :visible.sync="showMove"
  266. v-if="showMove"
  267. width="700px"
  268. >
  269. <el-form
  270. :inline="true"
  271. class="searchForm"
  272. @submit="search"
  273. @reset="onReSet"
  274. ref="searchForm2"
  275. :model.sync="searchForm"
  276. label-width="120px"
  277. >
  278. <el-form-item prop="organId" label="分部">
  279. <el-select
  280. class="multiple"
  281. v-model.trim="searchForm.organIdList"
  282. filterable
  283. clearable
  284. placeholder="请选择分部"
  285. >
  286. <el-option
  287. v-for="(item, index) in selects.branchs"
  288. :key="index"
  289. :label="item.name"
  290. :value="item.id"
  291. ></el-option>
  292. </el-select>
  293. </el-form-item>
  294. <el-form-item label="实际训练布置">
  295. <el-select
  296. placeholder="实际训练布置"
  297. v-model="searchForm.actualExercisesNumIsAchieve"
  298. clearable
  299. >
  300. <el-option label="符合预期" value="1"></el-option>
  301. <el-option label="不符合预期" value="0"></el-option>
  302. </el-select>
  303. </el-form-item>
  304. <el-form-item label="服务是否异常">
  305. <el-select
  306. placeholder="服务是否异常"
  307. v-model="searchForm.serviceIsError"
  308. clearable
  309. >
  310. <el-option label="是" value="1"></el-option>
  311. </el-select>
  312. </el-form-item>
  313. <el-form-item label="提交次数">
  314. <el-select
  315. placeholder="提交次数"
  316. v-model="searchForm.exercisesReplyNumIsAchieve"
  317. clearable
  318. >
  319. <el-option label="符合预期" value="1"></el-option>
  320. <el-option label="不符合预期" value="0"></el-option>
  321. </el-select>
  322. </el-form-item>
  323. <el-form-item label="评价次数">
  324. <el-select
  325. placeholder="评价次数"
  326. v-model="searchForm.exercisesMessageNumIsAchieve"
  327. clearable
  328. >
  329. <el-option label="符合预期" value="1"></el-option>
  330. <el-option label="不符合预期" value="0"></el-option>
  331. </el-select>
  332. </el-form-item>
  333. <el-form-item label="及时评价">
  334. <el-select
  335. placeholder="及时评价"
  336. v-model="searchForm.exercisesMessageTimelyNumIsAchieve"
  337. clearable
  338. >
  339. <el-option label="符合预期" value="1"></el-option>
  340. <el-option label="不符合预期" value="0"></el-option>
  341. </el-select>
  342. </el-form-item>
  343. <el-form-item label="是否有VIP课">
  344. <el-select
  345. placeholder="是否有VIP课"
  346. v-model="searchForm.existVipCourse"
  347. clearable
  348. >
  349. <el-option label="是" value="1"></el-option>
  350. <el-option label="否" value="0"></el-option>
  351. </el-select>
  352. </el-form-item>
  353. <el-form-item label="有付费网管课">
  354. <el-select
  355. placeholder="是否有付费网管课"
  356. v-model="searchForm.existPracticeCourse"
  357. clearable
  358. >
  359. <el-option label="是" value="1"></el-option>
  360. <el-option label="否" value="0"></el-option>
  361. </el-select>
  362. </el-form-item>
  363. <el-form-item label="训练提交时间">
  364. <el-date-picker
  365. v-model.trim="searchForm.workTimer"
  366. style="width: 400px"
  367. type="daterange"
  368. :picker-options="{
  369. firstDayOfWeek: 1,
  370. }"
  371. value-format="yyyy-MM-dd"
  372. range-separator="至"
  373. start-placeholder="提交开始日期"
  374. end-placeholder="提交结束日期"
  375. ></el-date-picker>
  376. </el-form-item>
  377. </el-form>
  378. <span slot="footer" class="dialog-footer">
  379. <el-button @click="cancleMore">取 消</el-button>
  380. <el-button type="primary" @click="okMore">确 定</el-button>
  381. </span>
  382. </el-dialog>
  383. </div>
  384. </template>
  385. <script>
  386. import axios from "axios";
  387. import { getToken, getTenantId } from "@/utils/auth";
  388. import pagination from "@/components/Pagination/index";
  389. import load from "@/utils/loading";
  390. import dayjs from "dayjs";
  391. import { getEmployeeOrgan, getTeacher } from "@/api/buildTeam";
  392. import { infoList } from "./modals/infoList";
  393. import { findStudentExtracurricularExercisesSituations } from "@/api/afterSchool";
  394. // findStudentExtracurricularExercisesSituations
  395. let nowTime = new Date();
  396. nowTime =
  397. nowTime.getFullYear() +
  398. "-" +
  399. (nowTime.getMonth() + 1) +
  400. "-" +
  401. nowTime.getDate();
  402. export default {
  403. components: { pagination },
  404. data() {
  405. return {
  406. serverImg: require("./images/serverIndexDetail.png"),
  407. tableList: [],
  408. searchForm: {
  409. timer: [],
  410. search: null,
  411. organIdList: null,
  412. actualExercisesNumIsAchieve: null, // 训练次数
  413. exercisesMessageNumIsAchieve: null, //评价
  414. exercisesMessageTimelyNumIsAchieve: null, //及时评价
  415. exercisesReplyNumIsAchieve: null, // 提交次数
  416. teacherId: null,
  417. existVipCourse: null,
  418. existPracticeCourse: null,
  419. workTimer: [],
  420. serviceIsError: null,
  421. },
  422. organList: [],
  423. teacherList: [],
  424. rules: {
  425. // 分页规则
  426. limit: 10, // 限制显示条数
  427. page: 1, // 当前页
  428. total: 0, // 总条数
  429. page_size: [10, 20, 40, 50], // 选择限制显示条数
  430. },
  431. lookServer: false,
  432. infoList: infoList,
  433. showMove: false,
  434. // imageIcon: require("@/assets/images/base/warning.png"),
  435. };
  436. },
  437. //生命周期 - 创建完成(可以访问当前this实例)
  438. created() {
  439. // 设置默认为当前周
  440. this.searchForm.timer = [];
  441. this.searchForm.timer.push(this.getNowDateAndMonday(nowTime));
  442. this.searchForm.timer.push(this.getNowDateAndSunday(nowTime));
  443. },
  444. //生命周期 - 挂载完成(可以访问DOM元素)
  445. mounted() {
  446. this.$store.dispatch("setBranchs");
  447. // getTeacher().then((res) => {
  448. // if (res.code == 200) {
  449. // this.teacherList = res.data;
  450. // }
  451. // });
  452. // getEmployeeOrgan().then((res) => {
  453. // if (res.code == 200) {
  454. // this.organList = res.data;
  455. // }
  456. // });
  457. // 获取分部 老师
  458. this.init();
  459. },
  460. activated() {
  461. this.init();
  462. },
  463. methods: {
  464. dayjs,
  465. init() {
  466. if (this.$route.query.teacherId) {
  467. this.searchForm.teacherId = this.$route.query.teacherId * 1;
  468. }
  469. if (this.$route.query.search) {
  470. this.$route.query.search instanceof Object
  471. ? (this.topForm = this.$route.query.search)
  472. : (this.topForm = JSON.parse(this.$route.query.search));
  473. }
  474. if (this.$route.query.rules) {
  475. this.$route.query.rules instanceof Object
  476. ? (this.rules = this.$route.query.rules)
  477. : (this.rules = JSON.parse(this.$route.query.rules));
  478. }
  479. this.getList();
  480. },
  481. getDate() {
  482. let obj = {
  483. search: this.searchForm.search || null,
  484. actualExercisesNumIsAchieve:
  485. this.searchForm.actualExercisesNumIsAchieve || null, // 训练次数
  486. exercisesMessageNumIsAchieve:
  487. this.searchForm.exercisesMessageNumIsAchieve || null, //评价
  488. exercisesMessageTimelyNumIsAchieve:
  489. this.searchForm.exercisesMessageTimelyNumIsAchieve || null, //及时评价
  490. exercisesReplyNumIsAchieve:
  491. this.searchForm.exercisesReplyNumIsAchieve || null, // 提交次数
  492. organIdList: this.searchForm.organIdList || null,
  493. teacherId: this.searchForm.teacherId,
  494. page: this.rules.page,
  495. rows: this.rules.limit,
  496. existVipCourse: this.searchForm.existVipCourse || null,
  497. existPracticeCourse: this.searchForm.existPracticeCourse || null,
  498. serviceIsError: this.searchForm.serviceIsError || null,
  499. };
  500. if (this.searchForm.timer && this.searchForm.timer.length > 0) {
  501. obj.monday = this.searchForm.timer[0];
  502. obj.sunday = this.searchForm.timer[1];
  503. } else {
  504. this.$message.error("请选择周次");
  505. return false;
  506. }
  507. if (this.searchForm.workTimer && this.searchForm.workTimer.length > 0) {
  508. obj.submitStartDate = this.searchForm.workTimer[0];
  509. obj.submitEndDate = this.searchForm.workTimer[1];
  510. }
  511. return obj;
  512. },
  513. getList() {
  514. let obj = this.getDate();
  515. if (!obj) return;
  516. findStudentExtracurricularExercisesSituations(obj).then((res) => {
  517. if (res.code == 200) {
  518. this.tableList = res.data.rows;
  519. this.rules.total = res.data.total;
  520. }
  521. });
  522. },
  523. onReSet() {
  524. this.searchForm = {
  525. timer: [],
  526. search: null,
  527. actualExercisesNumIsAchieve: null, // 训练次数
  528. exercisesMessageNumIsAchieve: null, //评价
  529. exercisesMessageTimelyNumIsAchieve: null, //及时评价
  530. exercisesReplyNumIsAchieve: null, // 提交次数
  531. teacherId: null,
  532. existVipCourse: null,
  533. };
  534. this.searchForm.timer = [];
  535. this.searchForm.timer.push(this.getNowDateAndMonday(nowTime));
  536. this.searchForm.timer.push(this.getNowDateAndSunday(nowTime));
  537. this.search();
  538. },
  539. cancleMore() {
  540. // this.$refs.searchForm2.resetFields()
  541. this.showMove = false;
  542. },
  543. okMore() {
  544. this.getList();
  545. this.showMove = false;
  546. },
  547. onExport() {
  548. let url = "/api-web/export/exercisesSituations";
  549. let obj = this.getDate();
  550. const options = {
  551. method: "get",
  552. headers: {
  553. Authorization: getToken(),
  554. tenantId: getTenantId(),
  555. },
  556. url,
  557. params: obj,
  558. responseType: "blob",
  559. };
  560. this.$confirm("您确定导出列表?", "提示", {
  561. confirmButtonText: "确定",
  562. cancelButtonText: "取消",
  563. type: "warning",
  564. })
  565. .then(() => {
  566. load.startLoading();
  567. axios(options)
  568. .then((res) => {
  569. let blob = new Blob([res.data], {
  570. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
  571. type: "application/vnd.ms-excel;charset=utf-8",
  572. // word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  573. });
  574. let text = new Response(blob).text();
  575. text.then((res) => {
  576. // 判断是否报错
  577. if (res.indexOf("code") != -1) {
  578. let json = JSON.parse(res);
  579. if (json.code == 403) {
  580. this.$message.error(`登录过期,请重新登录!`);
  581. setTimeout(() => {
  582. this.$store.dispatch("user/resetToken").then(() => {
  583. location.reload();
  584. });
  585. }, 1000);
  586. return;
  587. }
  588. this.$message.error(json.msg);
  589. } else {
  590. let objectUrl = URL.createObjectURL(blob);
  591. let link = document.createElement("a");
  592. let nowTime = new Date();
  593. let ymd =
  594. nowTime.getFullYear() +
  595. "" +
  596. (nowTime.getMonth() + 1) +
  597. "" +
  598. nowTime.getDate() +
  599. "" +
  600. nowTime.getHours() +
  601. "" +
  602. nowTime.getMinutes();
  603. let fname = ymd + "服务指标.xls";
  604. link.href = objectUrl;
  605. link.setAttribute("download", fname);
  606. document.body.appendChild(link);
  607. link.click();
  608. }
  609. });
  610. load.endLoading();
  611. })
  612. .catch((error) => {
  613. this.$message.error("导出数据失败,请联系管理员");
  614. load.endLoading();
  615. });
  616. })
  617. .catch(() => {});
  618. },
  619. search() {
  620. this.rules.page = 1;
  621. this.$refs.searchForm.save(this.searchForm);
  622. this.getList();
  623. },
  624. getNowDateAndMonday(time) {
  625. let timestamp = new Date(time.replace(/-/g, "/")).getTime();
  626. let serverDate = new Date(time);
  627. if (serverDate.getDay() == 0) {
  628. timestamp -= 7 * 24 * 60 * 60 * 1000;
  629. }
  630. let mondayTime =
  631. timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
  632. let mondayData = new Date(mondayTime);
  633. //年
  634. let mondayY = mondayData.getFullYear();
  635. //月
  636. let mondayM =
  637. mondayData.getMonth() + 1 < 10
  638. ? "0" + (mondayData.getMonth() + 1)
  639. : mondayData.getMonth() + 1;
  640. //日
  641. let mondayD =
  642. mondayData.getDate() < 10
  643. ? "0" + mondayData.getDate()
  644. : mondayData.getDate();
  645. let str = mondayY + "-" + mondayM + "-" + mondayD;
  646. return str;
  647. },
  648. getNowDateAndSunday(time) {
  649. let timestamp = new Date(time.replace(/-/g, "/")).getTime();
  650. let serverDate = new Date(time);
  651. let num = 7 - serverDate.getDay();
  652. if (num == 7) {
  653. num = 0;
  654. }
  655. let sundayTiem = timestamp + num * 24 * 60 * 60 * 1000;
  656. let SundayData = new Date(sundayTiem);
  657. //年
  658. let tomorrowY = SundayData.getFullYear(); //月
  659. let tomorrowM =
  660. SundayData.getMonth() + 1 < 10
  661. ? "0" + (SundayData.getMonth() + 1)
  662. : SundayData.getMonth() + 1;
  663. //日
  664. let tomorrowD =
  665. SundayData.getDate() < 10
  666. ? "0" + SundayData.getDate()
  667. : SundayData.getDate();
  668. let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
  669. return str;
  670. },
  671. getWeekTime(val) {
  672. if (val && val.length > 0) {
  673. let start = this.getNowDateAndMonday(val[0]);
  674. let end = this.getNowDateAndSunday(val[1]);
  675. this.searchForm.timer.splice(0, 1, start);
  676. this.searchForm.timer.splice(1, 1, end);
  677. }
  678. },
  679. lookDetail(row) {
  680. // this.afterSchoolVisible = true;
  681. let rules = JSON.stringify(this.rules);
  682. let searchForm = JSON.stringify(this.searchForm);
  683. this.$router.push({
  684. path: "/operateManager/serverIndexDetail",
  685. query: {
  686. studentId: row.studentId,
  687. studentName: row.studentName,
  688. rules,
  689. searchForm,
  690. title: row.studentName,
  691. extracurricularExercisesId: "yes",
  692. startTime: this.searchForm.timer[0],
  693. endTime: this.searchForm.timer[1],
  694. },
  695. });
  696. },
  697. lookServerDetail() {
  698. this.lookServer = true;
  699. },
  700. arraySpanMethod({ row, column, rowIndex, columnIndex }) {
  701. if (columnIndex === 0) {
  702. if (rowIndex % 2 === 0) {
  703. return {
  704. rowspan: 2,
  705. colspan: 1,
  706. };
  707. } else {
  708. return {
  709. rowspan: 0,
  710. colspan: 0,
  711. };
  712. }
  713. }
  714. },
  715. },
  716. computed: {
  717. isSearch() {
  718. return (
  719. this.searchForm.organIdList ||
  720. this.searchForm.actualExercisesNumIsAchieve ||
  721. this.searchForm.exercisesReplyNumIsAchieve ||
  722. this.searchForm.exercisesMessageNumIsAchieve ||
  723. this.searchForm.exercisesMessageTimelyNumIsAchieve ||
  724. this.searchForm.existVipCourse ||
  725. this.searchForm.existPracticeCourse ||
  726. this.searchForm.workTimer?.length > 0 ||
  727. this.searchForm.serviceIsError
  728. );
  729. },
  730. },
  731. };
  732. </script>
  733. <style lang='scss' scoped>
  734. .micon {
  735. position: absolute;
  736. top: 3px;
  737. right: 2px;
  738. }
  739. .serverInfo {
  740. line-height: 30px;
  741. span {
  742. color: red;
  743. font-weight: bold;
  744. }
  745. }
  746. .infoWrap {
  747. margin-top: 30px;
  748. span {
  749. color: red;
  750. font-weight: normal;
  751. }
  752. }
  753. .titleWrap {
  754. display: flex;
  755. flex-direction: row;
  756. justify-content: flex-start;
  757. align-items: center;
  758. }
  759. .m-container {
  760. h2 {
  761. justify-content: space-between;
  762. }
  763. }
  764. </style>