accompanys.vue 46 KB

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