accompanys.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <el-page-header @back="goBack" :content="name"></el-page-header>
  5. </h2>
  6. <!-- v-permission="'vipGroupManage/updateVipBaseInfo'" -->
  7. <div class="wrap">
  8. <div
  9. class="newBand"
  10. @click="resetTeachers"
  11. v-permission="'courseSchedule/practiceGroupTeacherAdjust'"
  12. >课程组调整</div>
  13. <!-- // accompanys/addCourse -->
  14. <div v-permission="{ child:'courseSchedule/batchAddCourses',parent:'/accompanys'}" class="newBand" @click="addCourse">网管课加课</div>
  15. <div class="newBand" v-permission="'courseSchedule/batchUpdateCourseSchedule'" @click="adjustment">批量调整</div>
  16. </div>
  17. <div class="tableWrap">
  18. <el-table
  19. :data="tableList"
  20. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  21. @selection-change="handleSelectionChange"
  22. >
  23. <el-table-column type="selection" :selectable="isDisabled" width="55"></el-table-column>
  24. <el-table-column label="课程编号" align="center" prop="id"></el-table-column>
  25. <el-table-column label="课程名称" align="center" prop="name"></el-table-column>
  26. <el-table-column label="主教老师" align="center" prop="teacherName"></el-table-column>
  27. <!-- <el-table-column label="主教老师" align="center" >
  28. <template slot-scope="scope">
  29. <div v-if="scope.row.teacher">
  30. {{scope.row.teacher.realName}}
  31. </div>
  32. </template>
  33. </el-table-column>-->
  34. <!-- <el-table-column label="班级id"
  35. align="center"
  36. prop="classGroupId">
  37. </el-table-column>-->
  38. <el-table-column label="上课日期" align="center" prop="classDate">
  39. <template slot-scope="scope">
  40. <div>{{ scope.row.classDate | formatTimer}}</div>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="是否点名" align="center" prop="status">
  44. <template slot-scope="scope">{{ scope.row.isCallNames ? '是' : '否' }}</template>
  45. </el-table-column>
  46. <el-table-column label="课程状态" align="center" prop="status">
  47. <template slot-scope="scope">
  48. <div>{{ scope.row.status | coursesStatus }}</div>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="结算状态" align="center">
  52. <template slot-scope="scope">
  53. <div>{{scope.row.isSettlement?'已结算':'未结算'}}</div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="开始时间" align="center" prop="startClassTimeStr"></el-table-column>
  57. <el-table-column label="结束时间" align="center" prop="endClassTimeStr"></el-table-column>
  58. <!-- <el-table-column label="教学点" align="center" prop="schoolName">
  59. <template slot-scope="scope">
  60. <div>{{scope.row.schoolName?scope.row.schoolName:'网络教室'}}</div>
  61. </template>
  62. </el-table-column>-->
  63. <el-table-column label="操作" width="250px" align="center" fixed="right">
  64. <template slot-scope="scope">
  65. <div>
  66. <el-button
  67. type="text"
  68. v-permission="'courseSchedule/classStartDateAdjust'"
  69. v-if="!scope.row.isSettlement"
  70. @click="resetClass(scope.row)"
  71. >调整</el-button>
  72. <el-button
  73. type="text"
  74. v-permission="'accompanys/remove'"
  75. v-if="!scope.row.isSettlement && scope.row.status == 'NOT_START'"
  76. @click="removeClass(scope.row)"
  77. >删除</el-button>
  78. <el-button
  79. v-permission="'courseSchedule/practiceCourseTeacherAdjust'"
  80. type="text"
  81. v-if="scope.row.status == 'NOT_START'"
  82. @click="resetTeacher(scope.row)"
  83. >更换老师</el-button>
  84. <el-button
  85. type="text"
  86. v-permission="'accompanys/cleanAttendance'"
  87. v-if="!scope.row.isSettlement"
  88. @click="clearAttend(scope.row)"
  89. >清除考勤</el-button>
  90. </div>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <pagination
  95. :total="rules.total"
  96. :page.sync="rules.page"
  97. :limit.sync="rules.limit"
  98. :page-sizes="rules.page_size"
  99. @pagination="getList"
  100. />
  101. </div>
  102. <el-dialog title="课程调整" width="400px" :before-close="handleClose" :visible.sync="courseVisible">
  103. <el-form
  104. :model="maskForm"
  105. ref="maskForm"
  106. :rules="maskRules"
  107. label-position="right"
  108. label-width="80px;"
  109. :inline="true"
  110. >
  111. <el-form-item label="上课日期" prop="date">
  112. <el-date-picker
  113. v-model.trim="maskForm.date"
  114. style="width:200px!important;"
  115. type="date"
  116. :picker-options="courseOption"
  117. value-format="yyyy-MM-dd"
  118. placeholder="选择日期"
  119. ></el-date-picker>
  120. </el-form-item>
  121. <el-form-item label="开始时间" prop="startTime">
  122. <el-time-select
  123. placeholder="起始时间"
  124. style="width:200px!important;"
  125. v-model.trim="startTime"
  126. :picker-options="{
  127. start: '08:30',
  128. step: '00:30',
  129. end: '23:00'
  130. }"
  131. ></el-time-select>
  132. </el-form-item>
  133. <!-- <el-form-item label="结束时间"
  134. prop="endTime">
  135. <el-time-select placeholder="结束时间"
  136. v-model.trim="maskForm.endTime"
  137. :picker-options="{
  138. start: '04:30',
  139. step: '00:05',
  140. end: '23:30',
  141. minTime: maskForm.startTime
  142. }">
  143. </el-time-select>
  144. </el-form-item> v-if="maskForm.teachMode=='OFFLINE'"-->
  145. <!-- <el-form-item label="课程类型" prop="courseType">
  146. <el-select clearable v-model.trim="maskForm.teachMode">
  147. <el-option label="线上课" value="ONLINE"></el-option>
  148. <el-option label="线下课" value="OFFLINE"></el-option>
  149. </el-select>
  150. </el-form-item>-->
  151. <!-- <el-form-item label="教学地点" v-if="maskForm.teachMode == 'OFFLINE'">
  152. <el-select v-model.trim="maskForm.address" filterable clearable>
  153. <el-option
  154. v-for="(item,index) in schoolList"
  155. :key="index"
  156. :value="item.id"
  157. :label="item.name"
  158. ></el-option>
  159. </el-select>
  160. </el-form-item>-->
  161. </el-form>
  162. <div slot="footer" class="dialog-footer">
  163. <el-button @click="courseVisible = false">取 消</el-button>
  164. <el-button type="primary" @click="submitResetClass">确 定</el-button>
  165. </div>
  166. </el-dialog>
  167. <el-dialog
  168. title="课程组调整"
  169. width="400px"
  170. :before-close="teacherClose"
  171. :visible.sync="teacherVisible"
  172. >
  173. <el-form
  174. :model="teacherForm"
  175. ref="teacherForm"
  176. :rules="teacherRules"
  177. label-position="right"
  178. label-width="80px;"
  179. :inline="true"
  180. >
  181. <el-form-item label="课程班名称">
  182. <el-input v-model.trim="teacherForm.name" disabled></el-input>
  183. </el-form-item>
  184. <el-form-item label="课程组声部">
  185. <el-select v-model.trim="teacherForm.subject" @change="changeSound" filterable clearable>
  186. <el-option
  187. v-for="(item,index) in subjectList"
  188. :key="index"
  189. :value="item.id"
  190. :label="item.name"
  191. ></el-option>
  192. </el-select>
  193. </el-form-item>
  194. <el-form-item label="课程组老师">
  195. <el-select v-model.trim="teacherForm.teacher" filterable clearable>
  196. <el-option
  197. v-for="(item,index) in teacherList"
  198. :key="index"
  199. :value="item.id"
  200. :label="item.realName"
  201. ></el-option>
  202. </el-select>
  203. </el-form-item>
  204. <el-form-item>
  205. <p style="color:#FF5353">*更改课程组老师,将更换全部未开始课程的老师</p>
  206. </el-form-item>
  207. </el-form>
  208. <div slot="footer" class="dialog-footer">
  209. <el-button @click="teacherVisible = false">取 消</el-button>
  210. <el-button type="primary" @click="subresetTeacher">确 定</el-button>
  211. </div>
  212. </el-dialog>
  213. <el-dialog :title="adjustmentName" width="800px" :visible.sync="adjustmentVisible">
  214. <el-form
  215. :model="adjustmentForm"
  216. label-position="right"
  217. label-width="120px"
  218. ref="adjustmentForm"
  219. :rules="adjustmentRules"
  220. :inline="true"
  221. >
  222. <el-form-item label="已选择课时数" v-if="!isaddCourse">
  223. <el-input disabled v-model.trim="adjustmentForm.count"></el-input>
  224. </el-form-item>
  225. <el-form-item label="添加课时数" prop="addCount" v-if="isaddCourse">
  226. <el-input type="number" @mousewheel.native.prevent v-model.trim="adjustmentForm.addCount"></el-input>
  227. </el-form-item>
  228. <br />
  229. <!-- <el-form-item label="单课费用" prop="fee" v-if="isaddCourse">
  230. <el-input v-model.trim="adjustmentForm.fee"></el-input>
  231. </el-form-item>-->
  232. <el-form-item label="排课起始时间" prop="courseTime">
  233. <el-date-picker
  234. v-model.trim="adjustmentForm.courseTime"
  235. :picker-options="pickerOptions"
  236. style="width:200px!important;"
  237. type="date"
  238. value-format="yyyy-MM-dd"
  239. placeholder="选择日期"
  240. ></el-date-picker>
  241. <el-checkbox style="margin-left:10px;" v-model.trim="adjustmentForm.checked">是否跳过节假日</el-checkbox>
  242. </el-form-item>
  243. </el-form>
  244. <div class="WeekWrap">
  245. <h3 style="margin-bottom:20px;">
  246. 循环次数
  247. <el-button type="text" style="margin-left:10px;" @click="addWeek">添加</el-button>
  248. </h3>
  249. <div class="countWrap" style="margin-bottom:10px;">
  250. <div
  251. class="countItem"
  252. style="margin-bottom:20px;"
  253. v-for="(item,index) in weekList"
  254. :key="index"
  255. >
  256. <span>循环周期:</span>
  257. <el-select v-model.trim="item.dayOfWeek" filterable clearable>
  258. <el-option
  259. v-for="(item,index) in weekDateList"
  260. :key="index"
  261. :label="item.label"
  262. :value="item.value"
  263. ></el-option>
  264. </el-select>
  265. <span style="margin-left:10px;">开始时间</span>
  266. <el-time-select
  267. style="margin-left:10px;"
  268. placeholder
  269. v-model.trim="item.startClassTime"
  270. :picker-options="{
  271. start: '04:30',
  272. step: '00:05',
  273. end: '23:55'
  274. }"
  275. ></el-time-select>
  276. <el-button
  277. style="margin-left:10px;"
  278. type="danger"
  279. @click="removeWeek(item)"
  280. icon="el-icon-delete"
  281. circle
  282. ></el-button>
  283. </div>
  284. </div>
  285. </div>
  286. <div slot="footer" class="dialog-footer">
  287. <el-button @click="adjustmentVisible = false">取 消</el-button>
  288. <el-button type="primary" v-if="!isaddCourse" @click="submitAdjustment">确 定</el-button>
  289. <el-button type="primary" v-if="isaddCourse" @click="addCourseSubmit">确 定</el-button>
  290. </div>
  291. </el-dialog>
  292. </div>
  293. </template>
  294. <script>
  295. import pagination from "@/components/Pagination/index";
  296. import {
  297. findPracticeGroupCourseSchedules,
  298. practiceCourseAdjus,
  299. getTeacher,
  300. practiceGroupManage,
  301. practiceGroupTeacherAdjust,
  302. practiceCourseTeacherAdjust,
  303. cleanAttendance,
  304. batchAddCourses,
  305. getPracticeApplySubjects,
  306. batchUpdateCourseSchedule
  307. } from "@/api/buildTeam";
  308. import {
  309. vipCourseAdjust,
  310. batchAppendVipGroupCourses,
  311. bathDelete
  312. } from "@/api/vipSeting";
  313. export default {
  314. components: {
  315. pagination
  316. },
  317. data() {
  318. return {
  319. adjustmentName: "",
  320. isaddCourse: false,
  321. adjustmentVisible: false,
  322. isMultiple: true,
  323. name: "网管课程组",
  324. courseVisible: false,
  325. teacherVisible: false,
  326. Frules: null,
  327. FsearchForm: null,
  328. userId: null,
  329. activeRow: null,
  330. rules: {
  331. // 分页规则
  332. limit: 20, // 限制显示条数
  333. page: 1, // 当前页
  334. total: 0, // 总条数
  335. page_size: [10, 20, 50, 100] // 选择限制显示条数
  336. },
  337. tableList: [],
  338. teacherList: [],
  339. courseData: [],
  340. practiceId: null,
  341. subjectList: [],
  342. maskForm: {
  343. date: "",
  344. startTime: "",
  345. id: ""
  346. },
  347. adjustmentForm: {
  348. count: "",
  349. courseTime: "",
  350. checked: false,
  351. addCount: "",
  352. courseType: "",
  353. fee: ""
  354. },
  355. startTime: null,
  356. maskRules: {
  357. date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
  358. // startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
  359. endTime: [
  360. { required: true, message: "请选择上课结束时间", trigger: "blur" }
  361. ]
  362. },
  363. teacherRules: {
  364. teacher: [{ required: true, message: "请选择老师", trigger: "blur" }],
  365. subject: [{ required: true, message: "请选择声部", trigger: "blur" }]
  366. },
  367. teacherForm: {
  368. teacher: null,
  369. name: null,
  370. subject: null
  371. },
  372. courseOption: null,
  373. coursesExpireDate: null,
  374. adjustmentRules: {
  375. courseTime: [{ required: true, message: "请选择开始时间" }],
  376. addCount: [{ required: true, message: "请输入加课次数" }],
  377. courseType: [{ required: true, message: "请选择课程类型" }],
  378. fee: [{ required: true, message: "请输入费用" }]
  379. },
  380. pickerOptions: {
  381. disabledDate(time) {
  382. return time.getTime() + 86400000 <= new Date().getTime();
  383. }
  384. },
  385. weekList: [
  386. {
  387. dayOfWeek: "",
  388. startTime: "",
  389. endTime: "",
  390. moid: new Date().getTime()
  391. }
  392. ],
  393. weekDateList: [
  394. { value: "1", label: "星期一" },
  395. { value: "2", label: "星期二" },
  396. { value: "3", label: "星期三" },
  397. { value: "4", label: "星期四" },
  398. { value: "5", label: "星期五" },
  399. { value: "6", label: "星期六" },
  400. { value: "7", label: "星期日" }
  401. ],
  402. activeList: []
  403. };
  404. },
  405. created() {
  406. this.init();
  407. },
  408. activated() {
  409. this.init();
  410. },
  411. methods: {
  412. init() {
  413. this.practiceId = this.$route.query.id;
  414. this.userId = this.$route.query.userId;
  415. if (this.$route.query.rules) {
  416. this.Frules = this.$route.query.rules;
  417. }
  418. if (this.$route.query.searchForm) {
  419. this.FsearchForm = this.$route.query.searchForm;
  420. }
  421. // console.log(this.practiceId)
  422. // <!-- 状态 指导老师 活动方案-->
  423. getTeacher({ organId: this.organId }).then(res => {
  424. if (res.code == 200) {
  425. this.teacherList = res.data;
  426. }
  427. });
  428. // 获取默认声部信息
  429. getPracticeApplySubjects().then(res => {
  430. if (res.code == 200) {
  431. this.subjectList = res.data;
  432. }
  433. });
  434. // 获取课程组信息
  435. this.courseOption = this.coursesDate();
  436. this.getCourseGroup();
  437. this.getList();
  438. },
  439. getCourseGroup() {
  440. practiceGroupManage({ search: this.practiceId }).then(res => {
  441. if (res.code == 200) {
  442. this.courseData = res.data.rows;
  443. if (this.courseData.length > 0) {
  444. this.name = this.courseData[0].name;
  445. }
  446. }
  447. });
  448. },
  449. getList() {
  450. findPracticeGroupCourseSchedules({ practiceId: this.practiceId }).then(
  451. res => {
  452. if (res.code == 200) {
  453. this.tableList = res.data.pageInfo.rows;
  454. this.rules.total = res.data.pageInfo.total;
  455. }
  456. }
  457. );
  458. },
  459. goBack() {
  460. this.$router.push({
  461. path: "/business/accompanyList",
  462. query: { rules: this.Frules, searchForm: this.FsearchForm }
  463. });
  464. },
  465. teacherClose() {
  466. this.isMultiple = true;
  467. this.teacherForm.teacher = null;
  468. this.teacherVisible = false;
  469. },
  470. handleClose() {
  471. this.courseVisible = false;
  472. this.startTime = "";
  473. this.maskForm = {
  474. date: "",
  475. startTime: "",
  476. id: ""
  477. };
  478. this.$refs["maskForm"].resetFields();
  479. },
  480. submitResetClass() {
  481. // endClassTimeStr: this.maskForm.endTime,
  482. if (!this.startTime) {
  483. this.$message.error("请填写修改时间");
  484. return;
  485. }
  486. let obj = {
  487. startClassTimeStr: this.startTime,
  488. id: this.maskForm.id,
  489. classDate: this.maskForm.date
  490. };
  491. practiceCourseAdjus(obj).then(res => {
  492. if (res.code == 200) {
  493. this.$message.success("修改成功");
  494. this.courseVisible = false;
  495. this.getList();
  496. } //else {
  497. // this.$message.error(res.msg)
  498. // }
  499. });
  500. },
  501. resetClass(row) {
  502. /**
  503. * maskForm.startTime
  504. *
  505. */
  506. this.maskForm.date = row.classDate;
  507. this.startTime = row.startClassTimeStr;
  508. // this.maskForm.endTime = row.endClassTimeStr;
  509. this.maskForm.id = row.id;
  510. this.coursesExpireDate = row.coursesExpireDate;
  511. // 修改课时
  512. this.courseVisible = true;
  513. },
  514. resetTeacher(row) {
  515. // 单节课
  516. this.isMultiple = false;
  517. this.activeRow = row;
  518. this.teacherForm.teacher = row.actualTeacherId;
  519. this.teacherVisible = true;
  520. },
  521. resetTeachers() {
  522. // 课程组
  523. this.isMultiple = true;
  524. this.teacherForm.teacher = this.courseData[0].userId;
  525. this.teacherForm.name = this.courseData[0].name;
  526. this.teacherForm.subject = this.courseData[0].subjectId;
  527. this.teacherVisible = true;
  528. },
  529. // 提交课程组修改
  530. subresetTeacher() {
  531. this.$refs.teacherForm.validate(some => {
  532. if (some) {
  533. if (this.isMultiple) {
  534. // 修改课程组老师
  535. practiceGroupTeacherAdjust({
  536. practiceGroupId: this.practiceId,
  537. teacherId: this.teacherForm.teacher
  538. }).then(res => {
  539. if (res.code == 200) {
  540. this.$message.success("修改成功");
  541. this.getCourseGroup();
  542. this.getList();
  543. this.teacherVisible = false;
  544. }
  545. });
  546. } else {
  547. // 修改单节课老师
  548. practiceCourseTeacherAdjust({
  549. courseScheduleId: this.activeRow.id,
  550. teacherId: this.teacherForm.teacher,
  551. subjectId:this.teacherForm.subjectId
  552. }).then(res => {
  553. if (res.code == 200) {
  554. this.$message.success("修改成功");
  555. this.getList();
  556. this.teacherVisible = false;
  557. }
  558. });
  559. }
  560. } else {
  561. return;
  562. }
  563. });
  564. },
  565. coursesDate() {
  566. let self = this;
  567. return {
  568. disabledDate: time => {
  569. // if (self.leftForm.courseStart) {
  570. // let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
  571. // coursesExpireDate
  572. let date = new Date(this.coursesExpireDate.replace(/-/, "/"));
  573. return time.getTime() > date.getTime();
  574. // }
  575. // return;
  576. }
  577. };
  578. },
  579. // 是否允许批量调整
  580. isDisabled(row, index) {
  581. // || !row.isCallNames
  582. if (row.isSettlement) {
  583. return false;
  584. } else {
  585. return true;
  586. }
  587. },
  588. adjustment() {
  589. this.adjustmentName = "批量调整";
  590. this.isaddCourse = false;
  591. if (this.adjustmentForm.count <= 0) {
  592. this.$message.error("请至少勾选一节课");
  593. } else {
  594. this.adjustmentVisible = true;
  595. }
  596. },
  597. changeSound(val){
  598. if(val){
  599. this.subjectList.forEach(item=>{
  600. if(item.id == val){
  601. let strArr = this.teacherForm.name.split('•')
  602. this.teacherForm.name = item.name+'•'+strArr[1]
  603. }
  604. })
  605. }
  606. },
  607. addWeek() {
  608. // 添加循环周期
  609. this.weekList.push({
  610. dayOfWeek: "",
  611. startClassTime: "",
  612. endClassTime: "",
  613. id: new Date()
  614. });
  615. },
  616. // 删除循环周
  617. removeWeek(item) {
  618. for (let i in this.weekList) {
  619. if (this.weekList[i].id == item.id) {
  620. this.weekList.splice(i, 1);
  621. }
  622. }
  623. },
  624. // 批量调整
  625. submitAdjustment() {
  626. this.$refs["adjustmentForm"].validate(item => {
  627. if (item) {
  628. let week = this.weekList;
  629. if (!week[0] || !week[0].startClassTime || !week[0].dayOfWeek) {
  630. this.$message.error("至少排一节课");
  631. return;
  632. }
  633. // 开始
  634. let obj = {};
  635. let idArr = this.activeList.map(item => {
  636. return item.id;
  637. });
  638. // courseScheduleIdList
  639. let courseScheduleIdList = idArr;
  640. obj.courseScheduleIdList = courseScheduleIdList;
  641. obj.startDate = this.adjustmentForm.courseTime;
  642. obj.coursesTimes = this.adjustmentForm.addCount;
  643. obj.teachingArrangementList = this.weekList;
  644. obj.isJumpHoliday = this.adjustmentForm.checked;
  645. obj.musicGroupId = this.practiceId;
  646. obj.teachMode = this.adjustmentForm.courseType;
  647. obj.type = "PRACTICE";
  648. batchUpdateCourseSchedule(obj).then(res => {
  649. if (res.code == 200) {
  650. this.$message.success("恭喜您修改成功");
  651. this.adjustmentVisible = false;
  652. this.getList();
  653. }
  654. });
  655. }
  656. });
  657. },
  658. handleSelectionChange(val) {
  659. this.adjustmentForm.count = val.length;
  660. this.activeList = val;
  661. },
  662. clearAttend(row) {
  663. this.$confirm("是否清除考勤记录?", "提示", {
  664. confirmButtonText: "确定",
  665. cancelButtonText: "取消",
  666. type: "warning"
  667. })
  668. .then(() => {
  669. cleanAttendance({ courseScheduleIds: row.id }).then(res => {
  670. if (res.code == 200) {
  671. this.$message.success("清除成功");
  672. this.getList();
  673. } else {
  674. this.$message.error(res.msg);
  675. }
  676. });
  677. })
  678. .catch(() => {});
  679. },
  680. // 网管课加课弹窗
  681. addCourse() {
  682. this.adjustmentName = "网管课加课";
  683. this.isaddCourse = true;
  684. this.adjustmentVisible = true;
  685. },
  686. // 网管课加课提交
  687. addCourseSubmit() {
  688. this.$refs["adjustmentForm"].validate(item => {
  689. if (item) {
  690. let week = this.weekList;
  691. if (!week[0] || !week[0].startClassTime || !week[0].dayOfWeek) {
  692. this.$message.error("至少排一节课");
  693. return;
  694. }
  695. // 开始
  696. let obj = {};
  697. obj.startDate = this.adjustmentForm.courseTime;
  698. obj.coursesTimes = this.adjustmentForm.addCount;
  699. obj.teachingArrangementList = this.weekList;
  700. obj.isJumpHoliday = this.adjustmentForm.checked;
  701. obj.musicGroupId = this.practiceId;
  702. obj.teachMode = this.adjustmentForm.courseType;
  703. obj.type = "PRACTICE";
  704. // console.log(obj)
  705. // return
  706. batchAddCourses(obj).then(res => {
  707. if (res.code == 200) {
  708. this.$message.success("恭喜您添加成功");
  709. this.adjustmentVisible = false;
  710. this.getList();
  711. }
  712. });
  713. }
  714. });
  715. },
  716. // 删除
  717. removeClass(row) {
  718. this.$confirm("是否删除该课程?", "提示", {
  719. confirmButtonText: "确定",
  720. cancelButtonText: "取消",
  721. type: "warning"
  722. }).then(() => {
  723. bathDelete({ courseScheduleIds: row.id }).then(res => {
  724. if (res.code == 200) {
  725. this.$message.success("删除成功");
  726. this.getList();
  727. }
  728. });
  729. });
  730. },
  731. // closeAdjustment(){
  732. // console.log(111)
  733. // }
  734. },
  735. watch:{
  736. adjustmentVisible(val){
  737. if(!val){
  738. this.$refs.adjustmentForm.resetFields();
  739. }
  740. }
  741. }
  742. };
  743. </script>
  744. <style lang="scss" scoped>
  745. .wrap {
  746. display: flex;
  747. flex-direction: row;
  748. justify-content: flex-start;
  749. div {
  750. margin-right: 20px;
  751. }
  752. }
  753. </style>