serverIndexList.vue 25 KB

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