accompanys.vue 46 KB

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