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. @click="onChangeRollCall('TRUANT', scope.row)"
  607. type="primary"
  608. round
  609. >未到</el-button
  610. >
  611. <el-button
  612. @click="onChangeRollCall('LEAVE', scope.row)"
  613. type="warning"
  614. round
  615. >请假</el-button
  616. >
  617. <el-button
  618. @click="onChangeRollCall('NORMAL', scope.row)"
  619. type="success"
  620. round
  621. >到课</el-button
  622. >
  623. </template>
  624. </el-table-column>
  625. </el-table>
  626. <pagination
  627. :total="rollCall.total"
  628. :page.sync="rollCall.page"
  629. :limit.sync="rollCall.limit"
  630. :page-sizes="rollCall.page_size"
  631. @pagination="getCallName"
  632. />
  633. </el-dialog>
  634. </div>
  635. </template>
  636. <script>
  637. import pagination from "@/components/Pagination/index";
  638. import { permission } from "@/utils/directivePage";
  639. import { nextMonthLastDay } from "@/utils/validate";
  640. import {
  641. findPracticeGroupCourseSchedules,
  642. practiceCourseAdjus,
  643. getTeacher,
  644. practiceGroupManage,
  645. practiceGroupTeacherAdjust,
  646. practiceCourseTeacherAdjust,
  647. cleanAttendance,
  648. batchAddCourses,
  649. getPracticeApplySubjects,
  650. batchUpdateCourseSchedule,
  651. findEducationUsers,
  652. updateTeacherAttendance,
  653. updateCoursesExpireDate,
  654. updateCoursesExpireDateOnlyNormal,
  655. findAttendanceStudentByCourseWithPage,
  656. updateStudentAttendances,
  657. resetCourse,
  658. } from "@/api/buildTeam";
  659. import {
  660. vipCourseAdjust,
  661. batchAppendVipGroupCourses,
  662. bathDelete,
  663. } from "@/api/vipSeting";
  664. import merge from "webpack-merge";
  665. // import { start } from 'repl';
  666. import { diffTimerFormMinute, addTimerFormMinute } from "@/utils/date";
  667. import dayjs from "dayjs";
  668. let that;
  669. export default {
  670. components: {
  671. pagination,
  672. },
  673. data() {
  674. return {
  675. adjustmentName: "",
  676. isaddCourse: false,
  677. adjustmentVisible: false,
  678. expireVisible: false,
  679. isMultiple: true,
  680. name: "网管课程组",
  681. courseVisible: false,
  682. teacherVisible: false,
  683. Frules: null,
  684. FsearchForm: null,
  685. userId: null,
  686. activeRow: null,
  687. courseType: null,
  688. rules: {
  689. // 分页规则
  690. limit: 20, // 限制显示条数
  691. page: 1, // 当前页
  692. total: 0, // 总条数
  693. page_size: [10, 20, 50, 100], // 选择限制显示条数
  694. },
  695. tableList: [],
  696. teacherList: [],
  697. courseData: [],
  698. practiceId: null,
  699. subjectList: [],
  700. maskForm: {
  701. date: "",
  702. startTime: "",
  703. id: "",
  704. endTime: "",
  705. },
  706. adjustmentForm: {
  707. count: "",
  708. courseTime: "",
  709. checked: false,
  710. addCount: "",
  711. courseType: "",
  712. fee: "",
  713. },
  714. startTime: null,
  715. expireForm: {
  716. coursesExpireDate: null,
  717. coursesStartDate: null,
  718. tempCoursesExpireDate: null,
  719. },
  720. expireRules: {
  721. coursesStartDate: [
  722. { required: true, message: "请选择有效期开始时间", trigger: "blur" },
  723. ],
  724. coursesExpireDate: [
  725. { required: true, message: "请选择有效期结束时间", trigger: "blur" },
  726. ],
  727. },
  728. maskRules: {
  729. date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
  730. // startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
  731. // endTime: [
  732. // { required: true, message: "请选择上课结束时间", trigger: "blur" }
  733. // ]
  734. },
  735. teacherRules: {
  736. teacher: [{ required: true, message: "请选择老师", trigger: "blur" }],
  737. subjectId: [{ required: true, message: "请选择声部", trigger: "blur" }],
  738. educationalTeacherId: [
  739. { required: true, message: "请选择乐团主管", trigger: "blur" },
  740. ],
  741. },
  742. teacherForm: {
  743. teacher: null,
  744. name: null,
  745. subjectId: null,
  746. educationalTeacherId: null,
  747. },
  748. courseOption: null,
  749. coursesExpireDate: null,
  750. adjustmentRules: {
  751. courseTime: [{ required: true, message: "请选择开始时间" }],
  752. addCount: [{ required: true, message: "请输入加课次数" }],
  753. courseType: [{ required: true, message: "请选择课程类型" }],
  754. fee: [{ required: true, message: "请输入费用" }],
  755. },
  756. pickerOptions: {
  757. firstDayOfWeek: 1,
  758. disabledDate(time) {
  759. return time.getTime() + 86400000 <= new Date().getTime();
  760. },
  761. },
  762. weekList: [
  763. {
  764. dayOfWeek: "",
  765. startTime: "",
  766. endTime: "",
  767. moid: new Date().getTime(),
  768. },
  769. ],
  770. weekDateList: [
  771. { value: "1", label: "星期一" },
  772. { value: "2", label: "星期二" },
  773. { value: "3", label: "星期三" },
  774. { value: "4", label: "星期四" },
  775. { value: "5", label: "星期五" },
  776. { value: "6", label: "星期六" },
  777. { value: "7", label: "星期日" },
  778. ],
  779. activeList: [],
  780. educationList: [],
  781. timers: null,
  782. markAttendance: {
  783. // 考勤状态
  784. status: false,
  785. dataInfo: {},
  786. },
  787. bigin: this.beginDate(),
  788. rollCall: {
  789. // 点名表
  790. status: false,
  791. gridData: [],
  792. selectItem: {}, // 选中状态
  793. limit: 10, // 限制显示条数
  794. page: 1, // 当前页
  795. total: 0, // 总条数
  796. page_size: [10, 20, 40, 50], // 选择限制显示条数
  797. },
  798. accompanTime: 25,
  799. updateCourseStatus: 1,
  800. };
  801. },
  802. created() {
  803. that = this;
  804. },
  805. mounted() {
  806. this.init();
  807. },
  808. methods: {
  809. init() {
  810. this.practiceId = this.$route.query.id;
  811. this.userId = this.$route.query.userId;
  812. this.courseType = this.$route.query.type;
  813. this.expireForm.coursesExpireDate = this.$route.query.coursesExpireDate;
  814. this.expireForm.coursesStartDate = this.$route.query.coursesStartDate;
  815. this.timers =
  816. this.$route.query.coursesStartDate +
  817. "至" +
  818. this.$route.query.coursesExpireDate;
  819. // 获取乐团主管
  820. findEducationUsers().then((res) => {
  821. if (res.code == 200) {
  822. this.educationList = res.data;
  823. }
  824. });
  825. // <!-- 状态 指导老师 活动方案-->
  826. getTeacher({ organId: this.organId }).then((res) => {
  827. if (res.code == 200) {
  828. this.teacherList = res.data;
  829. }
  830. });
  831. // 获取默认声部信息
  832. getPracticeApplySubjects().then((res) => {
  833. if (res.code == 200) {
  834. this.subjectList = res.data;
  835. }
  836. });
  837. // 获取课程组信息
  838. this.courseOption = this.coursesDate();
  839. this.getCourseGroup();
  840. this.getList();
  841. },
  842. onUpdateCourse(type) {
  843. this.updateCourseStatus = type;
  844. this.expireVisible = true;
  845. },
  846. onCallName(item) {
  847. // 点名表
  848. this.rollCall.page = 1;
  849. this.rollCall.selectItem = item;
  850. this.getCallName();
  851. },
  852. getCallName() {
  853. let rollCall = this.rollCall;
  854. let params = {
  855. page: rollCall.page,
  856. rows: rollCall.limit,
  857. courseScheduleId: rollCall.selectItem.id,
  858. };
  859. findAttendanceStudentByCourseWithPage(params).then((res) => {
  860. let result = res.data;
  861. rollCall.status = true;
  862. if (res.code == 200) {
  863. rollCall.gridData = result.rows;
  864. rollCall.total = result.total;
  865. }
  866. });
  867. },
  868. onChangeRollCall(type, row) {
  869. let rollCall = this.rollCall;
  870. let params = {
  871. courseScheduleId: rollCall.selectItem.id,
  872. studentAttendances: [
  873. {
  874. userId: row.studentId,
  875. status: type,
  876. },
  877. ],
  878. };
  879. updateStudentAttendances(params).then((res) => {
  880. if (res.code == 200) {
  881. this.$message.success("修改成功");
  882. row.status = type;
  883. this.getList();
  884. } else {
  885. this.$message.error(res.msg);
  886. }
  887. });
  888. },
  889. lookStudents(row) {
  890. let id = row.id;
  891. getStudyStudents({ courseScheduleId: id }).then((res) => {
  892. if (res.code == 200) {
  893. this.studentList = res.data;
  894. this.studentVisible = true;
  895. }
  896. });
  897. },
  898. getCourseGroup() {
  899. practiceGroupManage({ search: this.practiceId }).then((res) => {
  900. if (res.code == 200) {
  901. this.courseData = res.data.rows;
  902. if (this.courseData.length > 0) {
  903. this.name = this.courseData[0].name;
  904. let originalStartDate = this.courseData[0].coursesStartDate
  905. ? new Date(this.courseData[0].coursesStartDate)
  906. : new Date();
  907. let buyMonths = this.courseData[0].buyMonths;
  908. this.accompanTime = this.courseData[0].singleClassMinutes || 25;
  909. let lastDayNum = nextMonthLastDay(
  910. originalStartDate.getFullYear(),
  911. originalStartDate.getMonth() + buyMonths + 1
  912. );
  913. if (lastDayNum[2] >= originalStartDate.getDate()) {
  914. originalStartDate.setMonth(
  915. originalStartDate.getMonth() + buyMonths
  916. );
  917. } else {
  918. originalStartDate = new Date(lastDayNum.join("-"));
  919. }
  920. originalStartDate.setDate(originalStartDate.getDate() - 1);
  921. let overTime =
  922. originalStartDate.getFullYear() +
  923. "-" +
  924. (originalStartDate.getMonth() + 1) +
  925. "-" +
  926. originalStartDate.getDate();
  927. this.expireForm.tempCoursesExpireDate = overTime;
  928. }
  929. }
  930. });
  931. },
  932. permission(str, parent) {
  933. return permission(str, parent);
  934. },
  935. beginDate() {
  936. let self = this;
  937. return {
  938. firstDayOfWeek: 1,
  939. disabledDate(time) {
  940. if (self.tableList[self.tableList.length - 1].classDate) {
  941. return (
  942. new Date(
  943. self.tableList[self.tableList.length - 1].classDate
  944. ).getTime() >=
  945. time.getTime() + 24 * 60 * 60 * 1000
  946. );
  947. } else {
  948. return time.getTime() >= Date.now();
  949. //开始时间不选时,结束时间最大值小于等于当天
  950. }
  951. },
  952. };
  953. },
  954. resetDate() {
  955. let self = this;
  956. return {
  957. firstDayOfWeek: 1,
  958. disabledDate(time) {
  959. if (self.tableList[self.tableList.length - 1].classDate) {
  960. return (
  961. new Date(
  962. self.tableList[self.tableList.length - 1].classDate
  963. ).getTime() >= time.getTime()
  964. );
  965. } else {
  966. return time.getTime() >= Date.now();
  967. //开始时间不选时,结束时间最大值小于等于当天
  968. }
  969. },
  970. };
  971. },
  972. startBigin() {
  973. let timer;
  974. if (this.tableList[0]?.classDate) {
  975. timer = this.tableList[0]?.classDate;
  976. }
  977. return {
  978. firstDayOfWeek: 1,
  979. disabledDate(time) {
  980. // 该时间不可调整到课程组第一节课程开始时间之后
  981. if (timer) {
  982. return new Date(timer).getTime() < time.getTime();
  983. } else {
  984. return time.getTime() >= Date.now();
  985. //开始时间不选时,结束时间最大值小于等于当天
  986. }
  987. },
  988. };
  989. },
  990. submitExpireDate() {
  991. this.$refs.expireForm.validate((some) => {
  992. if (some) {
  993. if (this.updateCourseStatus == 1) {
  994. updateCoursesExpireDate({
  995. practiceGroupId: this.practiceId,
  996. coursesExpireDate: this.expireForm.coursesExpireDate,
  997. coursesStartDate: this.expireForm.coursesStartDate,
  998. }).then((res) => {
  999. if (res.code == 200) {
  1000. this.$message.success("有效期修改成功");
  1001. this.$router.push({
  1002. query: merge(this.$route.query, {
  1003. coursesStartDate: this.expireForm.coursesStartDate,
  1004. coursesExpireDate: this.expireForm.coursesExpireDate,
  1005. }),
  1006. });
  1007. this.timers =
  1008. this.expireForm.coursesStartDate +
  1009. "至" +
  1010. this.expireForm.coursesExpireDate;
  1011. this.expireVisible = false;
  1012. this.getCourseGroup();
  1013. this.getList();
  1014. } else {
  1015. this.$message.error(res.msg);
  1016. }
  1017. });
  1018. } else if (this.updateCourseStatus == 2) {
  1019. updateCoursesExpireDateOnlyNormal({
  1020. practiceGroupId: this.practiceId,
  1021. coursesExpireDate: this.expireForm.coursesExpireDate,
  1022. coursesStartDate: this.expireForm.coursesStartDate,
  1023. }).then((res) => {
  1024. if (res.code == 200) {
  1025. this.$message.success("有效期修改成功");
  1026. this.$router.push({
  1027. query: merge(this.$route.query, {
  1028. coursesStartDate: this.expireForm.coursesStartDate,
  1029. coursesExpireDate: this.expireForm.coursesExpireDate,
  1030. }),
  1031. });
  1032. this.timers =
  1033. this.expireForm.coursesStartDate +
  1034. "至" +
  1035. this.expireForm.coursesExpireDate;
  1036. this.expireVisible = false;
  1037. this.getCourseGroup();
  1038. this.getList();
  1039. } else {
  1040. this.$message.error(res.msg);
  1041. }
  1042. });
  1043. }
  1044. } else {
  1045. return;
  1046. }
  1047. });
  1048. },
  1049. onMarkAttendance(item) {
  1050. // 补考勤
  1051. this.markAttendance = {
  1052. status: true,
  1053. dataInfo: item,
  1054. };
  1055. },
  1056. batchAdjustmentTime() {
  1057. let tempData = this.markAttendance.dataInfo;
  1058. let params = {
  1059. teacherId: tempData.actualTeacherId,
  1060. courseScheduleId: tempData.id,
  1061. signInStatus: 1,
  1062. signOutStatus: 1,
  1063. };
  1064. updateTeacherAttendance(params).then((res) => {
  1065. if (res.code == 200) {
  1066. this.$message.success("补卡成功");
  1067. this.markAttendance.status = false;
  1068. this.getList();
  1069. } else {
  1070. this.$message.error(res.msg);
  1071. }
  1072. });
  1073. },
  1074. getList() {
  1075. // 乔乔说后台分页数据是假的所以不分页 page: this.rules.page, rows: this.rules.limit this.rules.total = res.data.pageInfo.total;
  1076. findPracticeGroupCourseSchedules({ practiceId: this.practiceId }).then(
  1077. (res) => {
  1078. if (res.code == 200) {
  1079. this.tableList = res.data.pageInfo.rows;
  1080. }
  1081. }
  1082. );
  1083. },
  1084. goBack() {
  1085. this.$store.dispatch("delVisitedViews", this.$route);
  1086. this.$router.push({
  1087. path: "/accompanyManager/accompany",
  1088. });
  1089. },
  1090. teacherClose() {
  1091. this.isMultiple = false;
  1092. this.teacherForm.teacher = null;
  1093. this.teacherVisible = false;
  1094. },
  1095. handleClose() {
  1096. this.$refs["maskForm"].resetFields();
  1097. this.courseVisible = false;
  1098. // this.startTime = "";
  1099. // this.maskForm = {
  1100. // date: "",
  1101. // startTime: "",
  1102. // id: ""
  1103. // };
  1104. },
  1105. expireClose() {
  1106. this.expireVisible = false;
  1107. this.expireForm.coursesExpireDate = null;
  1108. this.$refs["expireForm"].resetFields();
  1109. },
  1110. submitResetClass() {
  1111. // endClassTimeStr: this.maskForm.endTime,
  1112. let maskForm = this.maskForm;
  1113. let diff = dayjs(maskForm.date + " " + maskForm.startTime).diff(
  1114. new Date(),
  1115. "second"
  1116. );
  1117. if (diff <= 0) {
  1118. this.$message.error("课程开始时间必须大于当前时间");
  1119. return;
  1120. }
  1121. this.$refs.maskForm.validate((valid) => {
  1122. if (valid) {
  1123. let obj = {
  1124. startClassTime: dayjs(
  1125. this.maskForm.date + " " + this.maskForm.startTime
  1126. ).format("YYYY-MM-DD HH:mm:ss"),
  1127. id: this.maskForm.id,
  1128. classDate: this.maskForm.date,
  1129. groupType: "PRACTICE",
  1130. };
  1131. resetCourse(obj).then((res) => {
  1132. if (res.code == 200) {
  1133. this.$message.success("修改成功");
  1134. this.courseVisible = false;
  1135. this.getList();
  1136. }
  1137. });
  1138. }
  1139. });
  1140. },
  1141. resetClass(row) {
  1142. /**
  1143. * maskForm.startTime
  1144. *
  1145. */
  1146. this.$nextTick(() => {
  1147. this.maskForm = {
  1148. date: dayjs(row.classDate).format("YYYY-MM-DD"),
  1149. startTime: row.startClassTimeStr.substring(0, 5),
  1150. endTime: row.endClassTimeStr.substring(0, 5),
  1151. id: row.id,
  1152. };
  1153. // this.startTime = row.startClassTimeStr.substring(0, 5);
  1154. });
  1155. this.coursesExpireDate = row.coursesExpireDate;
  1156. // 修改课时
  1157. this.courseVisible = true;
  1158. },
  1159. resetTeacher(row) {
  1160. // 单节课
  1161. this.isMultiple = false;
  1162. this.activeRow = row;
  1163. this.teacherForm.teacher = row.actualTeacherId;
  1164. this.teacherVisible = true;
  1165. },
  1166. resetTeachers() {
  1167. // 课程组
  1168. this.isMultiple = true;
  1169. this.teacherForm.teacher = this.courseData[0].userId;
  1170. this.teacherForm.name = this.courseData[0].name;
  1171. this.teacherForm.subjectId = this.courseData[0].subjectId;
  1172. this.teacherForm.educationalTeacherId =
  1173. this.courseData[0].educationalTeacherId || null;
  1174. this.teacherVisible = true;
  1175. },
  1176. // 提交课程组修改
  1177. subresetTeacher() {
  1178. this.$refs.teacherForm.validate((some) => {
  1179. if (some) {
  1180. if (this.isMultiple) {
  1181. // 修改课程组老师
  1182. practiceGroupTeacherAdjust({
  1183. practiceGroupId: this.practiceId,
  1184. teacherId: this.teacherForm.teacher,
  1185. subjectId: this.teacherForm.subjectId,
  1186. educationalTeacherId: this.teacherForm.educationalTeacherId,
  1187. }).then((res) => {
  1188. if (res.code == 200) {
  1189. this.$message.success("修改成功");
  1190. this.getCourseGroup();
  1191. this.getList();
  1192. this.teacherVisible = false;
  1193. }
  1194. });
  1195. } else {
  1196. // 修改单节课老师
  1197. practiceCourseTeacherAdjust({
  1198. courseScheduleId: this.activeRow.id,
  1199. teacherId: this.teacherForm.teacher,
  1200. }).then((res) => {
  1201. if (res.code == 200) {
  1202. this.$message.success("修改成功");
  1203. this.getList();
  1204. this.teacherVisible = false;
  1205. }
  1206. });
  1207. }
  1208. } else {
  1209. return;
  1210. }
  1211. });
  1212. },
  1213. coursesDate() {
  1214. let self = this;
  1215. return {
  1216. firstDayOfWeek: 1,
  1217. disabledDate: (time) => {
  1218. // if (self.leftForm.courseStart) {
  1219. // let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
  1220. // coursesExpireDate
  1221. let dayjs = this.$helpers.dayjs;
  1222. let nowDate = dayjs(new Date()).valueOf() - 24 * 60 * 60 * 1000;
  1223. let coursesStartDate = dayjs(
  1224. this.expireForm.coursesStartDate
  1225. ).valueOf();
  1226. let coursesExpireDate = dayjs(
  1227. this.expireForm.coursesExpireDate
  1228. ).valueOf();
  1229. let startTime =
  1230. coursesStartDate - nowDate > 0 ? coursesStartDate : nowDate;
  1231. return (
  1232. time.getTime() < startTime || time.getTime() > coursesExpireDate
  1233. );
  1234. // }
  1235. // return;
  1236. },
  1237. };
  1238. },
  1239. // 是否允许批量调整
  1240. isDisabled(row, index) {
  1241. // || !row.isCallNames
  1242. if (row.isSettlement) {
  1243. return false;
  1244. } else {
  1245. return true;
  1246. }
  1247. },
  1248. onCourseExpireDate() {
  1249. // 修改课程有效期
  1250. },
  1251. adjustment() {
  1252. this.adjustmentName = "批量调整";
  1253. this.isaddCourse = false;
  1254. if (this.adjustmentForm.count <= 0) {
  1255. this.$message.error("请至少勾选一节课");
  1256. } else {
  1257. this.adjustmentVisible = true;
  1258. }
  1259. },
  1260. changeSound(val) {
  1261. if (val) {
  1262. this.subjectList.forEach((item) => {
  1263. if (item.id == val) {
  1264. let strArr = this.teacherForm.name.split("•");
  1265. this.teacherForm.name = item.name + "•" + strArr[1];
  1266. }
  1267. });
  1268. }
  1269. },
  1270. addWeek() {
  1271. // 添加循环周期
  1272. this.weekList.push({
  1273. dayOfWeek: "",
  1274. startClassTime: "",
  1275. endClassTime: "",
  1276. id: new Date(),
  1277. });
  1278. },
  1279. // 删除循环周
  1280. removeWeek(item) {
  1281. for (let i in this.weekList) {
  1282. if (this.weekList[i].id == item.id) {
  1283. this.weekList.splice(i, 1);
  1284. }
  1285. }
  1286. },
  1287. // 批量调整
  1288. submitAdjustment() {
  1289. this.$refs["adjustmentForm"].validate((item) => {
  1290. if (item) {
  1291. let week = this.weekList;
  1292. if (!week[0] || !week[0].startClassTime || !week[0].dayOfWeek) {
  1293. this.$message.error("至少排一节课");
  1294. return;
  1295. }
  1296. // 开始
  1297. let obj = {};
  1298. let idArr = this.activeList.map((item) => {
  1299. return item.id;
  1300. });
  1301. // courseScheduleIdList
  1302. let courseScheduleIdList = idArr;
  1303. obj.courseScheduleIdList = courseScheduleIdList;
  1304. obj.startDate = this.adjustmentForm.courseTime;
  1305. obj.coursesTimes = this.adjustmentForm.addCount;
  1306. obj.teachingArrangementList = this.weekList;
  1307. obj.isJumpHoliday = this.adjustmentForm.checked;
  1308. obj.musicGroupId = this.practiceId;
  1309. obj.teachMode = "ONLINE";
  1310. obj.type = "PRACTICE";
  1311. batchUpdateCourseSchedule(obj).then((res) => {
  1312. if (res.code == 200) {
  1313. this.$message.success("恭喜您修改成功");
  1314. this.adjustmentVisible = false;
  1315. this.getList();
  1316. }
  1317. });
  1318. }
  1319. });
  1320. },
  1321. handleSelectionChange(val) {
  1322. this.adjustmentForm.count = val.length;
  1323. this.activeList = val;
  1324. },
  1325. clearAttend(row) {
  1326. this.$confirm("是否清除考勤记录?", "提示", {
  1327. confirmButtonText: "确定",
  1328. cancelButtonText: "取消",
  1329. type: "warning",
  1330. })
  1331. .then(() => {
  1332. cleanAttendance({ courseScheduleIds: row.id }).then((res) => {
  1333. if (res.code == 200) {
  1334. this.$message.success("清除成功");
  1335. this.getList();
  1336. } else {
  1337. this.$message.error(res.msg);
  1338. }
  1339. });
  1340. })
  1341. .catch(() => {});
  1342. },
  1343. // 网管课加课弹窗
  1344. addCourse() {
  1345. this.adjustmentName = "网管课加课";
  1346. this.isaddCourse = true;
  1347. this.adjustmentVisible = true;
  1348. },
  1349. // 网管课加课提交
  1350. addCourseSubmit() {
  1351. this.$refs["adjustmentForm"].validate((item) => {
  1352. if (item) {
  1353. let week = this.weekList;
  1354. if (!week[0] || !week[0].startClassTime || !week[0].dayOfWeek) {
  1355. this.$message.error("至少排一节课");
  1356. return;
  1357. }
  1358. // 开始
  1359. let obj = {};
  1360. obj.startDate = this.adjustmentForm.courseTime;
  1361. obj.coursesTimes = this.adjustmentForm.addCount;
  1362. obj.teachingArrangementList = this.weekList;
  1363. obj.isJumpHoliday = this.adjustmentForm.checked;
  1364. obj.musicGroupId = this.practiceId;
  1365. obj.teachMode = "ONLINE";
  1366. obj.type = "PRACTICE";
  1367. batchAddCourses(obj).then((res) => {
  1368. if (res.code == 200) {
  1369. this.$message.success("恭喜您添加成功");
  1370. this.adjustmentVisible = false;
  1371. this.getList();
  1372. }
  1373. });
  1374. }
  1375. });
  1376. },
  1377. // 删除
  1378. removeClass(row) {
  1379. this.$confirm("是否删除该课程?", "提示", {
  1380. confirmButtonText: "确定",
  1381. cancelButtonText: "取消",
  1382. type: "warning",
  1383. }).then(() => {
  1384. bathDelete({ courseScheduleIds: row.id }).then((res) => {
  1385. if (res.code == 200) {
  1386. this.$message.success("删除成功");
  1387. this.getList();
  1388. }
  1389. });
  1390. });
  1391. },
  1392. changeStartTime(val) {
  1393. this.$nextTick((res) => {
  1394. if (val) {
  1395. this.$set(
  1396. this.maskForm,
  1397. "endTime",
  1398. addTimerFormMinute(this.maskForm.date, val, this.accompanTime)
  1399. );
  1400. } else {
  1401. this.$set(this.maskForm, "endTime", "");
  1402. }
  1403. });
  1404. },
  1405. changeStartTimes(val, item) {
  1406. this.$nextTick((res) => {
  1407. if (val) {
  1408. let str = dayjs(new Date()).format("YYYY-MM-DD");
  1409. this.$set(
  1410. item,
  1411. "endClassTime",
  1412. addTimerFormMinute(str, val, this.accompanTime)
  1413. );
  1414. } else {
  1415. this.$set(item, "endClassTime", "");
  1416. }
  1417. });
  1418. },
  1419. },
  1420. filters: {
  1421. studentCallName: (value) => {
  1422. let template = {
  1423. NORMAL: "到课",
  1424. TRUANT: "未到",
  1425. LEAVE: "请假",
  1426. DROP_OUT: "退学",
  1427. "": "未到",
  1428. };
  1429. return template[value];
  1430. },
  1431. },
  1432. watch: {
  1433. adjustmentVisible(val) {
  1434. if (!val) {
  1435. if( this.$refs.adjustmentForm){
  1436. this.$refs.adjustmentForm.resetFields();
  1437. }
  1438. this.weekList = [
  1439. {
  1440. dayOfWeek: "",
  1441. startTime: "",
  1442. endTime: "",
  1443. moid: new Date().getTime(),
  1444. },
  1445. ];
  1446. }
  1447. },
  1448. },
  1449. computed: {},
  1450. };
  1451. </script>
  1452. <style lang="scss" scoped>
  1453. .titlewrap {
  1454. display: flex;
  1455. flex-direction: row;
  1456. justify-content: flex-start;
  1457. align-items: center;
  1458. }
  1459. .wrap {
  1460. display: flex;
  1461. flex-direction: row;
  1462. justify-content: flex-start;
  1463. div {
  1464. margin-right: 20px;
  1465. max-width: inherit;
  1466. }
  1467. }
  1468. .countWrap {
  1469. /deep/.el-date-editor.el-input,
  1470. /deep/.el-date-editor.el-input__inner {
  1471. width: 100px !important;
  1472. }
  1473. }
  1474. </style>