accompanys.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428
  1. <template>
  2. <div class="m-container">
  3. <div class="titlewrap">
  4. <h2>
  5. <el-page-header @back="goBack" :content="name"></el-page-header>
  6. </h2>
  7. <p style="margin-bottom: 10px; margin-left: 30px">
  8. 课程有效期:{{ timers }}
  9. </p>
  10. </div>
  11. <!-- v-permission="'vipGroupManage/updateVipBaseInfo'" -->
  12. <div class="wrap">
  13. <div
  14. class="newBand"
  15. @click="resetTeachers"
  16. v-if="courseType && courseType != 'TRIAL'"
  17. v-permission="'courseSchedule/practiceGroupTeacherAdjust'"
  18. >
  19. 课程组调整
  20. </div>
  21. <!-- // accompanys/addCourse -->
  22. <div
  23. v-permission="{
  24. child: 'courseSchedule/batchAddCourses',
  25. parent: '/accompanys',
  26. }"
  27. class="newBand"
  28. @click="addCourse"
  29. >
  30. 网管课加课
  31. </div>
  32. <div
  33. class="newBand"
  34. v-if="courseType && courseType != 'TRIAL'"
  35. v-permission="'courseSchedule/batchUpdateCourseSchedule'"
  36. @click="adjustment"
  37. >
  38. 批量调整
  39. </div>
  40. <div
  41. class="newBand"
  42. v-permission="'courseSchedule/updateCoursesExpireDate'"
  43. @click="expireVisible = true"
  44. >
  45. 有效期调整
  46. </div>
  47. </div>
  48. <div class="tableWrap">
  49. <el-table
  50. :data="tableList"
  51. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  52. @selection-change="handleSelectionChange"
  53. >
  54. <el-table-column
  55. type="selection"
  56. :selectable="isDisabled"
  57. width="55"
  58. ></el-table-column>
  59. <el-table-column
  60. label="课程编号"
  61. align="center"
  62. prop="id"
  63. ></el-table-column>
  64. <el-table-column
  65. label="课程名称"
  66. align="center"
  67. prop="name"
  68. ></el-table-column>
  69. <el-table-column
  70. label="主教老师"
  71. align="center"
  72. prop="teacherName"
  73. ></el-table-column>
  74. <!-- <el-table-column label="主教老师" align="center" >
  75. <template slot-scope="scope">
  76. <div v-show="scope.row.teacher">
  77. {{scope.row.teacher.realName}}
  78. </div>
  79. </template>
  80. </el-table-column>-->
  81. <!-- <el-table-column label="班级id"
  82. align="center"
  83. prop="classGroupId">
  84. </el-table-column>-->
  85. <el-table-column label="上课日期" align="center" prop="classDate">
  86. <template slot-scope="scope">
  87. <div>
  88. {{ scope.row.classDate | formatTimer }}
  89. {{ scope.row.startClassTimeStr | timerForMinFormat }}~{{
  90. scope.row.endClassTimeStr | timerForMinFormat
  91. }}
  92. </div>
  93. </template>
  94. </el-table-column>
  95. <!-- <el-table-column label="开始时间"
  96. align="center"
  97. prop="startClassTimeStr">
  98. <template slot-scope="scope">
  99. <div>{{ scope.row.startClassTimeStr | timerForMinFormat}}</div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="结束时间"
  103. align="center"
  104. prop="endClassTimeStr">
  105. <template slot-scope="scope">
  106. <div>{{ scope.row.endClassTimeStr | timerForMinFormat}}</div>
  107. </template>
  108. </el-table-column> -->
  109. <el-table-column label="是否点名" align="center" prop="status">
  110. <template slot-scope="scope">{{
  111. scope.row.isCallNames ? "是" : "否"
  112. }}</template>
  113. </el-table-column>
  114. <el-table-column label="课程状态" align="center" prop="status">
  115. <template slot-scope="scope">
  116. <div>{{ scope.row.status | coursesStatus }}</div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="结算状态" align="center">
  120. <template slot-scope="scope">
  121. <div>{{ scope.row.isSettlement ? "已结算" : "未结算" }}</div>
  122. </template>
  123. </el-table-column>
  124. <!-- <el-table-column label="教学点" align="center" prop="schoolName">
  125. <template slot-scope="scope">
  126. <div>{{scope.row.schoolName?scope.row.schoolName:'网络教室'}}</div>
  127. </template>
  128. </el-table-column>-->
  129. <el-table-column
  130. label="操作"
  131. width="250px"
  132. align="center"
  133. fixed="right"
  134. >
  135. <template slot-scope="scope">
  136. <div>
  137. <el-button
  138. type="text"
  139. v-if="
  140. !scope.row.isSettlement &&
  141. permission('courseSchedule/practiceCourseAdjust')
  142. "
  143. @click="resetClass(scope.row)"
  144. >调整</el-button
  145. >
  146. <el-button
  147. type="text"
  148. v-if="
  149. !scope.row.isSettlement &&
  150. scope.row.status == 'NOT_START' &&
  151. permission('accompanys/remove')
  152. "
  153. @click="removeClass(scope.row)"
  154. >删除</el-button
  155. >
  156. <el-button
  157. type="text"
  158. v-if="
  159. scope.row.status == 'NOT_START' &&
  160. courseType != 'TRIAL' &&
  161. permission('courseSchedule/practiceCourseTeacherAdjust')
  162. "
  163. @click="resetTeacher(scope.row)"
  164. >更换老师</el-button
  165. >
  166. <el-button
  167. v-if="
  168. scope.row.status == 'OVER' &&
  169. scope.row.isSettlement == 0 &&
  170. permission(
  171. '/accompanys/teacherAttendance/updateTeacherAttendance'
  172. )
  173. "
  174. type="text"
  175. @click="onMarkAttendance(scope.row)"
  176. >补考勤</el-button
  177. >
  178. <!-- && permission('studentAttendance/updateStudentAttendances', '/accompanys') -->
  179. <el-button
  180. v-if="
  181. scope.row.status == 'OVER' &&
  182. permission(
  183. '/accompanys/studentAttendance/updateStudentAttendances'
  184. )
  185. "
  186. type="text"
  187. @click="onCallName(scope.row)"
  188. >点名表</el-button
  189. >
  190. <el-button
  191. type="text"
  192. v-if="
  193. !scope.row.isSettlement &&
  194. permission('accompanys/cleanAttendance')
  195. "
  196. @click="clearAttend(scope.row)"
  197. >清除考勤</el-button
  198. >
  199. </div>
  200. </template>
  201. </el-table-column>
  202. </el-table>
  203. <!-- <pagination :total="rules.total"
  204. :page.sync="rules.page"
  205. :limit.sync="rules.limit"
  206. :page-sizes="rules.page_size"
  207. @pagination="getList" /> 乔乔说后台没有分页所以一口气都展示-->
  208. </div>
  209. <el-dialog
  210. title="有效期调整"
  211. width="400px"
  212. :before-close="expireClose"
  213. :visible.sync="expireVisible"
  214. >
  215. <el-form
  216. :model="expireForm"
  217. ref="expireForm"
  218. :rules="expireRules"
  219. label-position="right"
  220. label-width="120px"
  221. :inline="true"
  222. >
  223. <el-form-item label="有效期开始时间" prop="coursesStartDate">
  224. <el-date-picker
  225. v-model.trim="expireForm.coursesStartDate"
  226. style="width: 200px !important"
  227. type="date"
  228. :picker-options="startBigin()"
  229. value-format="yyyy-MM-dd"
  230. placeholder="选择日期"
  231. ></el-date-picker>
  232. </el-form-item>
  233. <el-form-item label="有效期结束时间" prop="coursesExpireDate">
  234. <el-date-picker
  235. v-model.trim="expireForm.coursesExpireDate"
  236. style="width: 200px !important"
  237. type="date"
  238. :picker-options="bigin"
  239. value-format="yyyy-MM-dd"
  240. placeholder="选择日期"
  241. ></el-date-picker>
  242. </el-form-item>
  243. <div style="padding-left: 15px; color: red">
  244. <p>有效期开始时间不得晚于课程组第一节课日期</p>
  245. <p>有效期结束时间不得早于课程组最后一节课日期</p>
  246. </div>
  247. </el-form>
  248. <div slot="footer" class="dialog-footer">
  249. <el-button @click="expireVisible = false">取 消</el-button>
  250. <el-button type="primary" @click="submitExpireDate">确 定</el-button>
  251. </div>
  252. </el-dialog>
  253. <el-dialog
  254. title="补考勤"
  255. width="400px"
  256. :visible.sync="markAttendance.status"
  257. >
  258. <el-form>
  259. <el-form-item label="签到状态">{{
  260. markAttendance.dataInfo.isSignIn | attendanceType
  261. }}</el-form-item>
  262. <el-form-item label="签到时间">{{
  263. markAttendance.dataInfo.signInTime
  264. }}</el-form-item>
  265. <el-form-item label="签退状态">{{
  266. markAttendance.dataInfo.isSignOut | attendanceOutType
  267. }}</el-form-item>
  268. <el-form-item label="签退时间">{{
  269. markAttendance.dataInfo.signOutTime
  270. }}</el-form-item>
  271. </el-form>
  272. <div slot="footer" class="dialog-footer">
  273. <el-button @click="markAttendance.status = false">取 消</el-button>
  274. <el-button
  275. type="primary"
  276. :disabled="
  277. markAttendance.dataInfo.isSignIn == 1 &&
  278. markAttendance.dataInfo.isSignOut == 1
  279. ? true
  280. : false
  281. "
  282. @click="batchAdjustmentTime"
  283. >确定补卡</el-button
  284. >
  285. </div>
  286. </el-dialog>
  287. <el-dialog
  288. title="课程调整"
  289. width="400px"
  290. :before-close="handleClose"
  291. :visible.sync="courseVisible"
  292. >
  293. <el-form
  294. :model="maskForm"
  295. ref="maskForm"
  296. :rules="maskRules"
  297. label-position="right"
  298. label-width="80px"
  299. :inline="true"
  300. >
  301. <el-form-item label="上课日期" prop="date">
  302. <el-date-picker
  303. v-model.trim="maskForm.date"
  304. type="date"
  305. :picker-options="courseOption"
  306. value-format="yyyy-MM-dd"
  307. placeholder="选择日期"
  308. ></el-date-picker>
  309. </el-form-item>
  310. <!-- 试听课 v-if="courseType != 'TRIAL'"-->
  311. <!-- <el-form-item label="上课日期" prop="date" v-else>
  312. <el-date-picker
  313. v-model.trim="maskForm.date"
  314. style="width: 200px !important"
  315. type="date"
  316. value-format="yyyy-MM-dd"
  317. :picker-options="bigin"
  318. placeholder="选择日期"
  319. ></el-date-picker>
  320. </el-form-item> -->
  321. <el-form-item
  322. label="开始时间"
  323. prop="startTime"
  324. :rules="[
  325. { required: true, message: '请选择开始时间', trigger: 'change' },
  326. ]"
  327. >
  328. <el-time-picker
  329. placeholder="起始时间"
  330. v-model="maskForm.startTime"
  331. @change="changeStartTime"
  332. format="HH:mm"
  333. value-format="HH:mm"
  334. :picker-options="{
  335. selectableRange: `04:00:00 - 23:30:00`,
  336. }"
  337. ></el-time-picker>
  338. </el-form-item>
  339. <el-form-item label="结束时间" prop="endTime">
  340. <el-time-picker
  341. placeholder="结束时间"
  342. format="HH:mm"
  343. value-format="HH:mm"
  344. v-model="maskForm.endTime"
  345. disabled
  346. >
  347. </el-time-picker>
  348. </el-form-item>
  349. <!-- v-show="maskForm.teachMode=='OFFLINE'"-->
  350. <!-- <el-form-item label="课程类型" prop="courseType">
  351. <el-select clearable v-model.trim="maskForm.teachMode">
  352. <el-option label="线上课" value="ONLINE"></el-option>
  353. <el-option label="线下课" value="OFFLINE"></el-option>
  354. </el-select>
  355. </el-form-item>-->
  356. <!-- <el-form-item label="教学地点" v-show="maskForm.teachMode == 'OFFLINE'">
  357. <el-select v-model.trim="maskForm.address" filterable clearable>
  358. <el-option
  359. v-for="(item,index) in schoolList"
  360. :key="index"
  361. :value="item.id"
  362. :label="item.name"
  363. ></el-option>
  364. </el-select>
  365. </el-form-item> 1-->
  366. </el-form>
  367. <div slot="footer" class="dialog-footer">
  368. <el-button @click="handleClose">取 消</el-button>
  369. <el-button type="primary" @click="submitResetClass">确 定</el-button>
  370. </div>
  371. </el-dialog>
  372. <el-dialog
  373. :title="isMultiple ? '课程组调整' : '更换老师'"
  374. width="400px"
  375. :before-close="teacherClose"
  376. :visible.sync="teacherVisible"
  377. >
  378. <el-form
  379. :model="teacherForm"
  380. ref="teacherForm"
  381. :rules="teacherRules"
  382. label-position="right"
  383. label-width="100px"
  384. :inline="true"
  385. >
  386. <el-form-item label="课程班名称" v-show="isMultiple">
  387. <el-input v-model.trim="teacherForm.name" disabled></el-input>
  388. </el-form-item>
  389. <el-form-item label="课程组声部" v-show="isMultiple">
  390. <el-select
  391. v-model.trim="teacherForm.subjectId"
  392. @change="changeSound"
  393. filterable
  394. clearable
  395. >
  396. <el-option
  397. v-for="(item, index) in subjectList"
  398. :key="index"
  399. :value="item.id"
  400. :label="item.name"
  401. ></el-option>
  402. </el-select>
  403. </el-form-item>
  404. <el-form-item label="课程组老师" v-if="isMultiple">
  405. <el-select v-model.trim="teacherForm.teacher" filterable clearable>
  406. <el-option
  407. v-for="(item, index) in teacherList"
  408. :key="index"
  409. :value="item.id"
  410. :label="item.realName"
  411. ></el-option>
  412. </el-select>
  413. </el-form-item>
  414. <el-form-item label="指导老师" v-else="isMultiple">
  415. <el-select v-model.trim="teacherForm.teacher" filterable clearable>
  416. <el-option
  417. v-for="(item, index) in teacherList"
  418. :key="index"
  419. :value="item.id"
  420. :label="item.realName"
  421. ></el-option>
  422. </el-select>
  423. </el-form-item>
  424. <el-form-item label="乐团主管" v-show="isMultiple">
  425. <el-select
  426. v-model.trim="teacherForm.educationalTeacherId"
  427. filterable
  428. clearable
  429. >
  430. <el-option
  431. v-for="(item, index) in educationList"
  432. :key="index"
  433. :value="item.userId"
  434. :label="item.userName"
  435. ></el-option>
  436. </el-select>
  437. </el-form-item>
  438. <el-form-item v-if="isMultiple">
  439. <p style="color: #ff5353">
  440. *更改课程组老师,将更换全部未开始课程的老师
  441. </p>
  442. </el-form-item>
  443. </el-form>
  444. <div slot="footer" class="dialog-footer">
  445. <el-button @click="teacherVisible = false">取 消</el-button>
  446. <el-button type="primary" @click="subresetTeacher">确 定</el-button>
  447. </div>
  448. </el-dialog>
  449. <el-dialog
  450. :title="adjustmentName"
  451. width="800px"
  452. :visible.sync="adjustmentVisible"
  453. >
  454. <el-form
  455. :model="adjustmentForm"
  456. label-position="right"
  457. label-width="120px"
  458. ref="adjustmentForm"
  459. :rules="adjustmentRules"
  460. :inline="true"
  461. >
  462. <el-form-item label="已选择课时数" v-if="!isaddCourse">
  463. <el-input disabled v-model.trim="adjustmentForm.count"></el-input>
  464. </el-form-item>
  465. <el-form-item label="添加课时数" prop="addCount" v-if="isaddCourse">
  466. <el-input
  467. type="number"
  468. @mousewheel.native.prevent
  469. v-model.trim="adjustmentForm.addCount"
  470. ></el-input>
  471. </el-form-item>
  472. <br />
  473. <!-- <el-form-item label="单课费用" prop="fee" v-show="isaddCourse">
  474. <el-input v-model.trim="adjustmentForm.fee"></el-input>
  475. </el-form-item>-->
  476. <el-form-item label="排课起始时间" prop="courseTime">
  477. <el-date-picker
  478. v-model.trim="adjustmentForm.courseTime"
  479. :picker-options="pickerOptions"
  480. style="width: 200px !important"
  481. type="date"
  482. value-format="yyyy-MM-dd"
  483. placeholder="选择日期"
  484. ></el-date-picker>
  485. <el-checkbox
  486. style="margin-left: 10px"
  487. v-model.trim="adjustmentForm.checked"
  488. >是否跳过节假日</el-checkbox
  489. >
  490. </el-form-item>
  491. </el-form>
  492. <div class="WeekWrap">
  493. <h3 style="margin-bottom: 20px">
  494. 循环次数
  495. <el-button type="text" style="margin-left: 10px" @click="addWeek"
  496. >添加</el-button
  497. >
  498. </h3>
  499. <div class="countWrap" style="margin-bottom: 10px">
  500. <div
  501. class="countItem"
  502. style="margin-bottom: 20px"
  503. v-for="(item, index) in weekList"
  504. :key="index"
  505. >
  506. <span>循环周期:</span>
  507. <el-select v-model.trim="item.dayOfWeek" filterable clearable>
  508. <el-option
  509. v-for="(item, index) in weekDateList"
  510. :key="index"
  511. :label="item.label"
  512. :value="item.value"
  513. ></el-option>
  514. </el-select>
  515. <span style="margin-left: 10px">开始时间</span>
  516. <el-time-picker
  517. style="margin-left: 10px"
  518. placeholder
  519. v-model.trim="item.startClassTime"
  520. @change="
  521. (val) => {
  522. changeStartTimes(val, item);
  523. }
  524. "
  525. format="HH:mm"
  526. value-format="HH:mm"
  527. :picker-options="{
  528. selectableRange: '04:30:00 - 23:30:00',
  529. }"
  530. ></el-time-picker>
  531. <span style="margin-left: 10px">结束时间</span>
  532. <el-time-picker
  533. style="margin-left: 10px"
  534. placeholder
  535. v-model.trim="item.endClassTime"
  536. format="HH:mm"
  537. value-format="HH:mm"
  538. disabled
  539. :picker-options="{
  540. selectableRange: '04:30:00 - 23:30:00',
  541. }"
  542. ></el-time-picker>
  543. <el-button
  544. style="margin-left: 10px"
  545. type="danger"
  546. @click="removeWeek(item)"
  547. icon="el-icon-delete"
  548. circle
  549. ></el-button>
  550. </div>
  551. </div>
  552. </div>
  553. <div slot="footer" class="dialog-footer">
  554. <el-button @click="adjustmentVisible = false">取 消</el-button>
  555. <el-button
  556. type="primary"
  557. v-show="!isaddCourse"
  558. @click="submitAdjustment"
  559. >确 定</el-button
  560. >
  561. <el-button type="primary" v-show="isaddCourse" @click="addCourseSubmit"
  562. >确 定</el-button
  563. >
  564. </div>
  565. </el-dialog>
  566. <el-dialog title="点名表" width="700px" :visible.sync="rollCall.status">
  567. <el-table
  568. :data="rollCall.gridData"
  569. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  570. >
  571. <el-table-column
  572. align="center"
  573. property="userName"
  574. label="学员姓名"
  575. ></el-table-column>
  576. <el-table-column
  577. align="center"
  578. property="phone"
  579. label="手机号"
  580. ></el-table-column>
  581. <el-table-column
  582. align="center"
  583. property="subjectName"
  584. label="学员声部"
  585. ></el-table-column>
  586. <el-table-column align="center" label="到课状态">
  587. <template slot-scope="scope">
  588. {{ scope.row.status | studentCallName }}
  589. </template>
  590. </el-table-column>
  591. <el-table-column
  592. align="center"
  593. label="操作"
  594. v-if="rollCall.selectItem.isSettlement == 0"
  595. width="220px"
  596. >
  597. <template slot-scope="scope">
  598. <el-button
  599. size="small"
  600. @click="onChangeRollCall('TRUANT', scope.row)"
  601. type="primary"
  602. round
  603. >未到</el-button
  604. >
  605. <el-button
  606. size="small"
  607. @click="onChangeRollCall('LEAVE', scope.row)"
  608. type="warning"
  609. round
  610. >请假</el-button
  611. >
  612. <el-button
  613. size="small"
  614. @click="onChangeRollCall('NORMAL', scope.row)"
  615. type="success"
  616. round
  617. >到课</el-button
  618. >
  619. </template>
  620. </el-table-column>
  621. </el-table>
  622. <pagination
  623. :total="rollCall.total"
  624. :page.sync="rollCall.page"
  625. :limit.sync="rollCall.limit"
  626. :page-sizes="rollCall.page_size"
  627. @pagination="getCallName"
  628. />
  629. </el-dialog>
  630. </div>
  631. </template>
  632. <script>
  633. import pagination from "@/components/Pagination/index";
  634. import { permission } from "@/utils/directivePage";
  635. import { nextMonthLastDay } from "@/utils/validate";
  636. import {
  637. findPracticeGroupCourseSchedules,
  638. practiceCourseAdjus,
  639. getTeacher,
  640. practiceGroupManage,
  641. practiceGroupTeacherAdjust,
  642. practiceCourseTeacherAdjust,
  643. cleanAttendance,
  644. batchAddCourses,
  645. getPracticeApplySubjects,
  646. batchUpdateCourseSchedule,
  647. findEducationUsers,
  648. updateTeacherAttendance,
  649. updateCoursesExpireDate,
  650. findAttendanceStudentByCourseWithPage,
  651. updateStudentAttendances,
  652. resetCourse,
  653. } from "@/api/buildTeam";
  654. import {
  655. vipCourseAdjust,
  656. batchAppendVipGroupCourses,
  657. bathDelete,
  658. } from "@/api/vipSeting";
  659. import merge from "webpack-merge";
  660. // import { start } from 'repl';
  661. import { diffTimerFormMinute, addTimerFormMinute } from "@/utils/date";
  662. import dayjs from "dayjs";
  663. let that;
  664. export default {
  665. components: {
  666. pagination,
  667. },
  668. data() {
  669. return {
  670. adjustmentName: "",
  671. isaddCourse: false,
  672. adjustmentVisible: false,
  673. expireVisible: false,
  674. isMultiple: true,
  675. name: "网管课程组",
  676. courseVisible: false,
  677. teacherVisible: false,
  678. Frules: null,
  679. FsearchForm: null,
  680. userId: null,
  681. activeRow: null,
  682. courseType: null,
  683. rules: {
  684. // 分页规则
  685. limit: 20, // 限制显示条数
  686. page: 1, // 当前页
  687. total: 0, // 总条数
  688. page_size: [10, 20, 50, 100], // 选择限制显示条数
  689. },
  690. tableList: [],
  691. teacherList: [],
  692. courseData: [],
  693. practiceId: null,
  694. subjectList: [],
  695. maskForm: {
  696. date: "",
  697. startTime: "",
  698. id: "",
  699. endTime: "",
  700. },
  701. adjustmentForm: {
  702. count: "",
  703. courseTime: "",
  704. checked: false,
  705. addCount: "",
  706. courseType: "",
  707. fee: "",
  708. },
  709. startTime: null,
  710. expireForm: {
  711. coursesExpireDate: null,
  712. coursesStartDate: null,
  713. tempCoursesExpireDate: null,
  714. },
  715. expireRules: {
  716. coursesStartDate: [
  717. { required: true, message: "请选择有效期开始时间", trigger: "blur" },
  718. ],
  719. coursesExpireDate: [
  720. { required: true, message: "请选择有效期结束时间", trigger: "blur" },
  721. ],
  722. },
  723. maskRules: {
  724. date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
  725. // startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
  726. // endTime: [
  727. // { required: true, message: "请选择上课结束时间", trigger: "blur" }
  728. // ]
  729. },
  730. teacherRules: {
  731. teacher: [{ required: true, message: "请选择老师", trigger: "blur" }],
  732. subjectId: [{ required: true, message: "请选择声部", trigger: "blur" }],
  733. educationalTeacherId: [
  734. { required: true, message: "请选择乐团主管", trigger: "blur" },
  735. ],
  736. },
  737. teacherForm: {
  738. teacher: null,
  739. name: null,
  740. subjectId: null,
  741. educationalTeacherId: null,
  742. },
  743. courseOption: null,
  744. coursesExpireDate: null,
  745. adjustmentRules: {
  746. courseTime: [{ required: true, message: "请选择开始时间" }],
  747. addCount: [{ required: true, message: "请输入加课次数" }],
  748. courseType: [{ required: true, message: "请选择课程类型" }],
  749. fee: [{ required: true, message: "请输入费用" }],
  750. },
  751. pickerOptions: {
  752. firstDayOfWeek: 1,
  753. disabledDate(time) {
  754. return time.getTime() + 86400000 <= new Date().getTime();
  755. },
  756. },
  757. weekList: [
  758. {
  759. dayOfWeek: "",
  760. startTime: "",
  761. endTime: "",
  762. moid: new Date().getTime(),
  763. },
  764. ],
  765. weekDateList: [
  766. { value: "1", label: "星期一" },
  767. { value: "2", label: "星期二" },
  768. { value: "3", label: "星期三" },
  769. { value: "4", label: "星期四" },
  770. { value: "5", label: "星期五" },
  771. { value: "6", label: "星期六" },
  772. { value: "7", label: "星期日" },
  773. ],
  774. activeList: [],
  775. educationList: [],
  776. timers: null,
  777. markAttendance: {
  778. // 考勤状态
  779. status: false,
  780. dataInfo: {},
  781. },
  782. bigin: this.beginDate(),
  783. rollCall: {
  784. // 点名表
  785. status: false,
  786. gridData: [],
  787. selectItem: {}, // 选中状态
  788. limit: 10, // 限制显示条数
  789. page: 1, // 当前页
  790. total: 0, // 总条数
  791. page_size: [10, 20, 40, 50], // 选择限制显示条数
  792. },
  793. accompanTime: 25,
  794. };
  795. },
  796. created() {
  797. that = this;
  798. },
  799. mounted() {
  800. this.init();
  801. },
  802. methods: {
  803. init() {
  804. this.practiceId = this.$route.query.id;
  805. this.userId = this.$route.query.userId;
  806. this.courseType = this.$route.query.type;
  807. this.expireForm.coursesExpireDate = this.$route.query.coursesExpireDate;
  808. this.expireForm.coursesStartDate = this.$route.query.coursesStartDate;
  809. this.timers =
  810. this.$route.query.coursesStartDate +
  811. "至" +
  812. this.$route.query.coursesExpireDate;
  813. // 获取乐团主管
  814. findEducationUsers().then((res) => {
  815. if (res.code == 200) {
  816. this.educationList = res.data;
  817. }
  818. });
  819. // <!-- 状态 指导老师 活动方案-->
  820. getTeacher({ organId: this.organId }).then((res) => {
  821. if (res.code == 200) {
  822. this.teacherList = res.data;
  823. }
  824. });
  825. // 获取默认声部信息
  826. getPracticeApplySubjects().then((res) => {
  827. if (res.code == 200) {
  828. this.subjectList = res.data;
  829. }
  830. });
  831. // 获取课程组信息
  832. this.courseOption = this.coursesDate();
  833. this.getCourseGroup();
  834. this.getList();
  835. },
  836. onCallName(item) {
  837. // 点名表
  838. this.rollCall.page = 1;
  839. this.rollCall.selectItem = item;
  840. this.getCallName();
  841. },
  842. getCallName() {
  843. let rollCall = this.rollCall;
  844. let params = {
  845. page: rollCall.page,
  846. rows: rollCall.limit,
  847. courseScheduleId: rollCall.selectItem.id,
  848. };
  849. findAttendanceStudentByCourseWithPage(params).then((res) => {
  850. let result = res.data;
  851. rollCall.status = true;
  852. if (res.code == 200) {
  853. rollCall.gridData = result.rows;
  854. rollCall.total = result.total;
  855. }
  856. });
  857. },
  858. onChangeRollCall(type, row) {
  859. let rollCall = this.rollCall;
  860. let params = {
  861. courseScheduleId: rollCall.selectItem.id,
  862. studentAttendances: [
  863. {
  864. userId: row.studentId,
  865. status: type,
  866. },
  867. ],
  868. };
  869. updateStudentAttendances(params).then((res) => {
  870. if (res.code == 200) {
  871. this.$message.success("修改成功");
  872. row.status = type;
  873. this.getList();
  874. } else {
  875. this.$message.error(res.msg);
  876. }
  877. });
  878. },
  879. lookStudents(row) {
  880. let id = row.id;
  881. getStudyStudents({ courseScheduleId: id }).then((res) => {
  882. if (res.code == 200) {
  883. this.studentList = res.data;
  884. this.studentVisible = true;
  885. }
  886. });
  887. },
  888. getCourseGroup() {
  889. practiceGroupManage({ search: this.practiceId }).then((res) => {
  890. if (res.code == 200) {
  891. this.courseData = res.data.rows;
  892. if (this.courseData.length > 0) {
  893. this.name = this.courseData[0].name;
  894. let originalStartDate = this.courseData[0].coursesStartDate
  895. ? new Date(this.courseData[0].coursesStartDate)
  896. : new Date();
  897. let buyMonths = this.courseData[0].buyMonths;
  898. let lastDayNum = nextMonthLastDay(
  899. originalStartDate.getFullYear(),
  900. originalStartDate.getMonth() + buyMonths + 1
  901. );
  902. if (lastDayNum[2] >= originalStartDate.getDate()) {
  903. originalStartDate.setMonth(
  904. originalStartDate.getMonth() + buyMonths
  905. );
  906. } else {
  907. originalStartDate = new Date(lastDayNum.join("-"));
  908. }
  909. originalStartDate.setDate(originalStartDate.getDate() - 1);
  910. let overTime =
  911. originalStartDate.getFullYear() +
  912. "-" +
  913. (originalStartDate.getMonth() + 1) +
  914. "-" +
  915. originalStartDate.getDate();
  916. this.expireForm.tempCoursesExpireDate = overTime;
  917. }
  918. }
  919. });
  920. },
  921. permission(str, parent) {
  922. return permission(str, parent);
  923. },
  924. beginDate() {
  925. let self = this;
  926. return {
  927. firstDayOfWeek: 1,
  928. disabledDate(time) {
  929. if (self.tableList[self.tableList.length -1].classDate) {
  930. return (
  931. new Date(self.tableList[self.tableList.length -1].classDate).getTime() >=
  932. time.getTime()+24*60*60*1000
  933. );
  934. } else {
  935. return time.getTime() >= Date.now();
  936. //开始时间不选时,结束时间最大值小于等于当天
  937. }
  938. },
  939. };
  940. },
  941. resetDate() {
  942. let self = this;
  943. return {
  944. firstDayOfWeek: 1,
  945. disabledDate(time) {
  946. if (self.tableList[self.tableList.length -1].classDate) {
  947. return (
  948. new Date(self.tableList[self.tableList.length -1].classDate).getTime() >=
  949. time.getTime()
  950. );
  951. } else {
  952. return time.getTime() >= Date.now();
  953. //开始时间不选时,结束时间最大值小于等于当天
  954. }
  955. },
  956. };
  957. },
  958. startBigin() {
  959. let timer;
  960. if (this.tableList[0]?.classDate) {
  961. timer = this.tableList[0]?.classDate;
  962. }
  963. return {
  964. firstDayOfWeek: 1,
  965. disabledDate(time) {
  966. // 该时间不可调整到课程组第一节课程开始时间之后
  967. if (timer) {
  968. return new Date(timer).getTime() < time.getTime();
  969. } else {
  970. return time.getTime() >= Date.now();
  971. //开始时间不选时,结束时间最大值小于等于当天
  972. }
  973. },
  974. };
  975. },
  976. submitExpireDate() {
  977. this.$refs.expireForm.validate((some) => {
  978. if (some) {
  979. updateCoursesExpireDate({
  980. practiceGroupId: this.practiceId,
  981. coursesExpireDate: this.expireForm.coursesExpireDate,
  982. coursesStartDate: this.expireForm.coursesStartDate,
  983. }).then((res) => {
  984. if (res.code == 200) {
  985. this.$message.success("有效期修改成功");
  986. this.$router.push({
  987. query: merge(this.$route.query, {
  988. coursesStartDate: this.expireForm.coursesStartDate,
  989. coursesExpireDate: this.expireForm.coursesExpireDate,
  990. }),
  991. });
  992. this.timers =
  993. this.expireForm.coursesStartDate+
  994. "至" +
  995. this.expireForm.coursesExpireDate;
  996. this.expireVisible = false;
  997. this.getCourseGroup();
  998. this.getList();
  999. } else {
  1000. this.$message.error(res.msg);
  1001. }
  1002. });
  1003. } else {
  1004. return;
  1005. }
  1006. });
  1007. },
  1008. onMarkAttendance(item) {
  1009. // 补考勤
  1010. this.markAttendance = {
  1011. status: true,
  1012. dataInfo: item,
  1013. };
  1014. },
  1015. batchAdjustmentTime() {
  1016. let tempData = this.markAttendance.dataInfo;
  1017. let params = {
  1018. teacherId: tempData.actualTeacherId,
  1019. courseScheduleId: tempData.id,
  1020. signInStatus: 1,
  1021. signOutStatus: 1,
  1022. };
  1023. updateTeacherAttendance(params).then((res) => {
  1024. if (res.code == 200) {
  1025. this.$message.success("补卡成功");
  1026. this.markAttendance.status = false;
  1027. this.getList();
  1028. } else {
  1029. this.$message.error(res.msg);
  1030. }
  1031. });
  1032. },
  1033. getList() {
  1034. // 乔乔说后台分页数据是假的所以不分页 page: this.rules.page, rows: this.rules.limit this.rules.total = res.data.pageInfo.total;
  1035. findPracticeGroupCourseSchedules({ practiceId: this.practiceId }).then(
  1036. (res) => {
  1037. if (res.code == 200) {
  1038. this.tableList = res.data.pageInfo.rows;
  1039. }
  1040. }
  1041. );
  1042. },
  1043. goBack() {
  1044. this.$store.dispatch("delVisitedViews", this.$route);
  1045. this.$router.push({
  1046. path: "/business/accompany",
  1047. });
  1048. },
  1049. teacherClose() {
  1050. this.isMultiple = false;
  1051. this.teacherForm.teacher = null;
  1052. this.teacherVisible = false;
  1053. },
  1054. handleClose() {
  1055. this.$refs["maskForm"].resetFields();
  1056. this.courseVisible = false;
  1057. // this.startTime = "";
  1058. // this.maskForm = {
  1059. // date: "",
  1060. // startTime: "",
  1061. // id: ""
  1062. // };
  1063. },
  1064. expireClose() {
  1065. this.expireVisible = false;
  1066. this.expireForm.coursesExpireDate = null;
  1067. this.$refs["expireForm"].resetFields();
  1068. },
  1069. submitResetClass() {
  1070. // endClassTimeStr: this.maskForm.endTime,
  1071. let maskForm = this.maskForm;
  1072. let diff = dayjs(maskForm.date + " " + maskForm.startTime).diff(
  1073. new Date(),
  1074. "second"
  1075. );
  1076. if (diff <= 0) {
  1077. this.$message.error("课程开始时间必须大于当前时间");
  1078. return;
  1079. }
  1080. this.$refs.maskForm.validate((valid) => {
  1081. if (valid) {
  1082. let obj = {
  1083. startClassTime: dayjs(
  1084. this.maskForm.date + " " + this.maskForm.startTime
  1085. ).format("YYYY-MM-DD HH:mm:ss"),
  1086. id: this.maskForm.id,
  1087. classDate: this.maskForm.date,
  1088. groupType: "PRACTICE",
  1089. };
  1090. resetCourse(obj).then((res) => {
  1091. if (res.code == 200) {
  1092. this.$message.success("修改成功");
  1093. this.courseVisible = false;
  1094. this.getList();
  1095. }
  1096. });
  1097. }
  1098. });
  1099. },
  1100. resetClass(row) {
  1101. /**
  1102. * maskForm.startTime
  1103. *
  1104. */
  1105. this.$nextTick(() => {
  1106. this.maskForm = {
  1107. date: dayjs(row.classDate).format("YYYY-MM-DD"),
  1108. startTime: row.startClassTimeStr.substring(0, 5),
  1109. endTime: row.endClassTimeStr.substring(0, 5),
  1110. id: row.id,
  1111. };
  1112. // this.startTime = row.startClassTimeStr.substring(0, 5);
  1113. });
  1114. this.coursesExpireDate = row.coursesExpireDate;
  1115. // 修改课时
  1116. this.courseVisible = true;
  1117. },
  1118. resetTeacher(row) {
  1119. // 单节课
  1120. this.isMultiple = false;
  1121. this.activeRow = row;
  1122. this.teacherForm.teacher = row.actualTeacherId;
  1123. this.teacherVisible = true;
  1124. },
  1125. resetTeachers() {
  1126. // 课程组
  1127. this.isMultiple = true;
  1128. this.teacherForm.teacher = this.courseData[0].userId;
  1129. this.teacherForm.name = this.courseData[0].name;
  1130. this.teacherForm.subjectId = this.courseData[0].subjectId;
  1131. this.teacherForm.educationalTeacherId =
  1132. this.courseData[0].educationalTeacherId || null;
  1133. this.teacherVisible = true;
  1134. },
  1135. // 提交课程组修改
  1136. subresetTeacher() {
  1137. this.$refs.teacherForm.validate((some) => {
  1138. if (some) {
  1139. if (this.isMultiple) {
  1140. // 修改课程组老师
  1141. practiceGroupTeacherAdjust({
  1142. practiceGroupId: this.practiceId,
  1143. teacherId: this.teacherForm.teacher,
  1144. subjectId: this.teacherForm.subjectId,
  1145. educationalTeacherId: this.teacherForm.educationalTeacherId,
  1146. }).then((res) => {
  1147. if (res.code == 200) {
  1148. this.$message.success("修改成功");
  1149. this.getCourseGroup();
  1150. this.getList();
  1151. this.teacherVisible = false;
  1152. }
  1153. });
  1154. } else {
  1155. // 修改单节课老师
  1156. practiceCourseTeacherAdjust({
  1157. courseScheduleId: this.activeRow.id,
  1158. teacherId: this.teacherForm.teacher,
  1159. }).then((res) => {
  1160. if (res.code == 200) {
  1161. this.$message.success("修改成功");
  1162. this.getList();
  1163. this.teacherVisible = false;
  1164. }
  1165. });
  1166. }
  1167. } else {
  1168. return;
  1169. }
  1170. });
  1171. },
  1172. coursesDate() {
  1173. let self = this;
  1174. return {
  1175. firstDayOfWeek: 1,
  1176. disabledDate: (time) => {
  1177. // if (self.leftForm.courseStart) {
  1178. // let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
  1179. // coursesExpireDate
  1180. let dayjs = this.$helpers.dayjs;
  1181. let nowDate = dayjs(new Date()).valueOf()-24*60*60*1000
  1182. let coursesStartDate = dayjs(this.expireForm.coursesStartDate).valueOf()
  1183. let coursesExpireDate = dayjs(this.expireForm.coursesExpireDate).valueOf()
  1184. let startTime =
  1185. coursesStartDate - nowDate >0?coursesStartDate:nowDate
  1186. return (
  1187. time.getTime() <(startTime)||
  1188. time.getTime()>coursesExpireDate
  1189. );
  1190. // }
  1191. // return;
  1192. },
  1193. };
  1194. },
  1195. // 是否允许批量调整
  1196. isDisabled(row, index) {
  1197. // || !row.isCallNames
  1198. if (row.isSettlement) {
  1199. return false;
  1200. } else {
  1201. return true;
  1202. }
  1203. },
  1204. onCourseExpireDate() {
  1205. // 修改课程有效期
  1206. },
  1207. adjustment() {
  1208. this.adjustmentName = "批量调整";
  1209. this.isaddCourse = false;
  1210. if (this.adjustmentForm.count <= 0) {
  1211. this.$message.error("请至少勾选一节课");
  1212. } else {
  1213. this.adjustmentVisible = true;
  1214. }
  1215. },
  1216. changeSound(val) {
  1217. if (val) {
  1218. this.subjectList.forEach((item) => {
  1219. if (item.id == val) {
  1220. let strArr = this.teacherForm.name.split("•");
  1221. this.teacherForm.name = item.name + "•" + strArr[1];
  1222. }
  1223. });
  1224. }
  1225. },
  1226. addWeek() {
  1227. // 添加循环周期
  1228. this.weekList.push({
  1229. dayOfWeek: "",
  1230. startClassTime: "",
  1231. endClassTime: "",
  1232. id: new Date(),
  1233. });
  1234. },
  1235. // 删除循环周
  1236. removeWeek(item) {
  1237. for (let i in this.weekList) {
  1238. if (this.weekList[i].id == item.id) {
  1239. this.weekList.splice(i, 1);
  1240. }
  1241. }
  1242. },
  1243. // 批量调整
  1244. submitAdjustment() {
  1245. this.$refs["adjustmentForm"].validate((item) => {
  1246. if (item) {
  1247. let week = this.weekList;
  1248. if (!week[0] || !week[0].startClassTime || !week[0].dayOfWeek) {
  1249. this.$message.error("至少排一节课");
  1250. return;
  1251. }
  1252. // 开始
  1253. let obj = {};
  1254. let idArr = this.activeList.map((item) => {
  1255. return item.id;
  1256. });
  1257. // courseScheduleIdList
  1258. let courseScheduleIdList = idArr;
  1259. obj.courseScheduleIdList = courseScheduleIdList;
  1260. obj.startDate = this.adjustmentForm.courseTime;
  1261. obj.coursesTimes = this.adjustmentForm.addCount;
  1262. obj.teachingArrangementList = this.weekList;
  1263. obj.isJumpHoliday = this.adjustmentForm.checked;
  1264. obj.musicGroupId = this.practiceId;
  1265. obj.teachMode = "ONLINE";
  1266. obj.type = "PRACTICE";
  1267. batchUpdateCourseSchedule(obj).then((res) => {
  1268. if (res.code == 200) {
  1269. this.$message.success("恭喜您修改成功");
  1270. this.adjustmentVisible = false;
  1271. this.getList();
  1272. }
  1273. });
  1274. }
  1275. });
  1276. },
  1277. handleSelectionChange(val) {
  1278. this.adjustmentForm.count = val.length;
  1279. this.activeList = val;
  1280. },
  1281. clearAttend(row) {
  1282. this.$confirm("是否清除考勤记录?", "提示", {
  1283. confirmButtonText: "确定",
  1284. cancelButtonText: "取消",
  1285. type: "warning",
  1286. })
  1287. .then(() => {
  1288. cleanAttendance({ courseScheduleIds: row.id }).then((res) => {
  1289. if (res.code == 200) {
  1290. this.$message.success("清除成功");
  1291. this.getList();
  1292. } else {
  1293. this.$message.error(res.msg);
  1294. }
  1295. });
  1296. })
  1297. .catch(() => {});
  1298. },
  1299. // 网管课加课弹窗
  1300. addCourse() {
  1301. this.adjustmentName = "网管课加课";
  1302. this.isaddCourse = true;
  1303. this.adjustmentVisible = true;
  1304. },
  1305. // 网管课加课提交
  1306. addCourseSubmit() {
  1307. this.$refs["adjustmentForm"].validate((item) => {
  1308. if (item) {
  1309. let week = this.weekList;
  1310. if (!week[0] || !week[0].startClassTime || !week[0].dayOfWeek) {
  1311. this.$message.error("至少排一节课");
  1312. return;
  1313. }
  1314. // 开始
  1315. let obj = {};
  1316. obj.startDate = this.adjustmentForm.courseTime;
  1317. obj.coursesTimes = this.adjustmentForm.addCount;
  1318. obj.teachingArrangementList = this.weekList;
  1319. obj.isJumpHoliday = this.adjustmentForm.checked;
  1320. obj.musicGroupId = this.practiceId;
  1321. obj.teachMode = "ONLINE";
  1322. obj.type = "PRACTICE";
  1323. batchAddCourses(obj).then((res) => {
  1324. if (res.code == 200) {
  1325. this.$message.success("恭喜您添加成功");
  1326. this.adjustmentVisible = false;
  1327. this.getList();
  1328. }
  1329. });
  1330. }
  1331. });
  1332. },
  1333. // 删除
  1334. removeClass(row) {
  1335. this.$confirm("是否删除该课程?", "提示", {
  1336. confirmButtonText: "确定",
  1337. cancelButtonText: "取消",
  1338. type: "warning",
  1339. }).then(() => {
  1340. bathDelete({ courseScheduleIds: row.id }).then((res) => {
  1341. if (res.code == 200) {
  1342. this.$message.success("删除成功");
  1343. this.getList();
  1344. }
  1345. });
  1346. });
  1347. },
  1348. changeStartTime(val) {
  1349. this.$nextTick((res) => {
  1350. if (val) {
  1351. this.$set(
  1352. this.maskForm,
  1353. "endTime",
  1354. addTimerFormMinute(this.maskForm.date, val, this.accompanTime)
  1355. );
  1356. } else {
  1357. this.$set(this.maskForm, "endTime", "");
  1358. }
  1359. });
  1360. },
  1361. changeStartTimes(val, item) {
  1362. this.$nextTick((res) => {
  1363. if (val) {
  1364. let str = dayjs(new Date()).format("YYYY-MM-DD");
  1365. this.$set(
  1366. item,
  1367. "endClassTime",
  1368. addTimerFormMinute(str, val, this.accompanTime)
  1369. );
  1370. } else {
  1371. this.$set(item, "endClassTime", "");
  1372. }
  1373. });
  1374. },
  1375. },
  1376. filters: {
  1377. studentCallName: (value) => {
  1378. let template = {
  1379. NORMAL: "到课",
  1380. TRUANT: "未到",
  1381. LEAVE: "请假",
  1382. DROP_OUT: "退学",
  1383. "": "未到",
  1384. };
  1385. return template[value];
  1386. },
  1387. },
  1388. watch: {
  1389. adjustmentVisible(val) {
  1390. if (!val) {
  1391. this.$refs.adjustmentForm.resetFields();
  1392. }
  1393. },
  1394. },
  1395. computed: {},
  1396. };
  1397. </script>
  1398. <style lang="scss" scoped>
  1399. .titlewrap {
  1400. display: flex;
  1401. flex-direction: row;
  1402. justify-content: flex-start;
  1403. align-items: center;
  1404. }
  1405. .wrap {
  1406. display: flex;
  1407. flex-direction: row;
  1408. justify-content: flex-start;
  1409. div {
  1410. margin-right: 20px;
  1411. }
  1412. }
  1413. .countWrap {
  1414. /deep/.el-date-editor.el-input,
  1415. /deep/.el-date-editor.el-input__inner {
  1416. width: 100px !important;
  1417. }
  1418. }
  1419. </style>