VIP00Apply.vue 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167
  1. <template>
  2. <div class="vipapply">
  3. <m-header v-if="statusList.headerStatus" />
  4. <div class="vip-title">课程信息</div>
  5. <van-cell-group>
  6. <!-- <van-field v-model="form.name" label="课程班名称" input-align="right" size="large" placeholder="请输入班级名称" /> -->
  7. <van-field
  8. v-model="courseTypeName"
  9. @click="statusList.courseTypeStatus = true"
  10. label="排课类型"
  11. :readonly="true"
  12. input-align="right"
  13. is-link
  14. size="large"
  15. placeholder="请选择"
  16. />
  17. <van-field
  18. v-model="formName.subjectListName"
  19. @click="onGetSheetList('subjectList')"
  20. label="科目名称"
  21. :readonly="true"
  22. input-align="right"
  23. is-link
  24. size="large"
  25. placeholder="请选择"
  26. />
  27. <van-field
  28. v-show="courseTypeVip"
  29. v-model="formName.vipGroupCategoryName"
  30. @click="onGetSheetList('vipGroupCategory')"
  31. label="课程形式"
  32. :readonly="true"
  33. input-align="right"
  34. is-link
  35. size="large"
  36. placeholder="请选择"
  37. />
  38. <van-field
  39. v-model="formName.educationalTeacherName"
  40. @click="onGetSheetList('teacherList')"
  41. label="乐团主管"
  42. :readonly="true"
  43. input-align="right"
  44. is-link
  45. size="large"
  46. placeholder="请选择"
  47. />
  48. <van-cell
  49. class="courseStudent"
  50. title="上课学生"
  51. @click="onCheckStudent"
  52. :readonly="true"
  53. input-align="right"
  54. :is-link="checkboxSelectDataList.length > 0 ? false : true"
  55. size="large"
  56. :value="checkboxSelectDataList.length > 0 ? '重新选择' : '请选择'"
  57. :value-class="[checkboxSelectDataList.length > 0 ? 'studentColor' : null, 'classStudent']"
  58. />
  59. <div
  60. v-if="checkboxSelectDataList.length > 0"
  61. style="
  62. text-align: center;
  63. line-height: 1.8;
  64. padding: 0.05rem 0;
  65. background: #fafbff;
  66. "
  67. >
  68. <p
  69. style="color: #323233"
  70. v-for="(item, index) in checkboxSelectDataList"
  71. :key="index"
  72. >
  73. {{ item.userName }} - {{ item.phone }}
  74. </p>
  75. </div>
  76. <van-field
  77. v-model="formName.vipGroupActivityName"
  78. @click="onGetSheetList('vipGroupActivity')"
  79. label="活动方案"
  80. :readonly="true"
  81. input-align="right"
  82. is-link
  83. size="large"
  84. placeholder="请选择"
  85. />
  86. </van-cell-group>
  87. <div class="vip-title">课时组成</div>
  88. <van-cell-group>
  89. <van-field
  90. v-model="form.studentNum"
  91. label="每班人数"
  92. :readonly="true"
  93. input-align="right"
  94. size="large"
  95. placeholder="每班预计招收人数"
  96. />
  97. <van-field
  98. v-model="form.singleClassMinutes"
  99. @click="onClickSingleClass"
  100. label="每课时长"
  101. :readonly="true"
  102. input-align="right"
  103. :is-link="form.vipGroupActivityId ? false : true"
  104. size="large"
  105. placeholder="请输入每课时长"
  106. />
  107. <!-- 判断是否选择活动方案 -->
  108. <div
  109. class="courseTips"
  110. v-if="
  111. loadData.vipGroupActivitySelect.maxCourseNum > 0 &&
  112. loadData.vipGroupActivitySelect.minCourseNum > 0
  113. "
  114. >
  115. 该活动最小课时数:<span>{{loadData.vipGroupActivitySelect.minCourseNum}}</span>节 最大课时数:<span>{{loadData.vipGroupActivitySelect.maxCourseNum}}</span>节
  116. </div>
  117. <van-field
  118. v-if="statusList.hasOnline"
  119. v-model="form.onlineClassesNums"
  120. @keyup="onClassKeyUp"
  121. label="线上课"
  122. input-align="right"
  123. size="large"
  124. placeholder="请输入次数"
  125. type="number"
  126. />
  127. <van-field
  128. v-if="statusList.hasOffline"
  129. v-model="form.offlineClassesNums"
  130. @keyup="onClassKeyUp('offLine')"
  131. label="线下课"
  132. input-align="right"
  133. size="large"
  134. placeholder="请输入次数"
  135. type="number"
  136. />
  137. <van-field
  138. v-if="form.offlineClassesNums > 0"
  139. v-model="formName.teacherSchoolName"
  140. @click="onGetSheetList('teacherSchool')"
  141. label="线下课地址"
  142. :readonly="true"
  143. input-align="right"
  144. is-link
  145. size="large"
  146. placeholder="请选择"
  147. />
  148. <van-field
  149. v-model="form.totalClassTime"
  150. label="课时总数"
  151. :readonly="courseTypePractice ? false : true"
  152. @keyup="getCalcClass"
  153. type="number"
  154. input-align="right"
  155. size="large"
  156. placeholder="请输入次数"
  157. />
  158. </van-cell-group>
  159. <div class="vip-title">时间安排</div>
  160. <van-cell-group>
  161. <van-cell
  162. title="最早排课时间"
  163. :readonly="true"
  164. v-if="loadData.vipGroupActivitySelect.coursesStartTime"
  165. input-align="right"
  166. size="large"
  167. >
  168. <template #default>
  169. {{ dayjs(loadData.vipGroupActivitySelect.coursesStartTime).format("YYYY-MM-DD") }}
  170. </template>
  171. </van-cell>
  172. <van-cell
  173. title="最晚排课时间"
  174. :readonly="true"
  175. v-if="loadData.vipGroupActivitySelect.coursesEndTime"
  176. input-align="right"
  177. size="large"
  178. >
  179. <template #default>
  180. {{ dayjs(loadData.vipGroupActivitySelect.coursesEndTime).format("YYYY-MM-DD") }}
  181. </template>
  182. </van-cell>
  183. <van-field
  184. v-model="form.registrationStartTime"
  185. label="报名开始时间"
  186. :readonly="true"
  187. @click="onEnListShow('start', form.registrationStartTime)"
  188. input-align="right"
  189. is-link
  190. size="large"
  191. placeholder="请选择"
  192. />
  193. <van-field
  194. v-model="form.coursesExpireDate"
  195. label="报名截止时间"
  196. :readonly="true"
  197. @click="onEnListShow('end', form.coursesExpireDate)"
  198. input-align="right"
  199. is-link
  200. size="large"
  201. placeholder="请选择"
  202. />
  203. </van-cell-group>
  204. <div class="vip-title">课时安排</div>
  205. <van-cell-group>
  206. <van-field
  207. @click="dataForm.status = true"
  208. v-model="form.courseStart"
  209. label="排课开始时间"
  210. :readonly="true"
  211. input-align="right"
  212. is-link
  213. size="large"
  214. placeholder="请选择"
  215. />
  216. <van-cell
  217. title-class="title-time"
  218. v-for="(item, index) in scheduleList"
  219. :key="index"
  220. >
  221. <template slot="title">
  222. <span class="online">{{ item.type }}</span>
  223. <span class="week">{{ item.weekStr }}</span>
  224. <span class="timer">{{ item.startTime + "-" + item.endTime }}</span>
  225. </template>
  226. <template slot="default">
  227. <van-button
  228. type="warning"
  229. @click="onScheduleRemove(item)"
  230. round
  231. size="small"
  232. plain
  233. >删除</van-button
  234. >
  235. </template>
  236. </van-cell>
  237. <div class="add-plan van-cell" @click="onCourseShedule">
  238. <van-icon name="add-o" />课时安排
  239. </div>
  240. <van-field
  241. label="排课列表"
  242. v-if="scheduleList.length > 0"
  243. :readonly="true"
  244. input-align="right"
  245. @click="onShowTimeTable"
  246. is-link
  247. size="large"
  248. />
  249. </van-cell-group>
  250. <div class="vip-title">课酬设置</div>
  251. <van-cell-group>
  252. <van-field
  253. v-model="form.onlineClassesUnitPrice"
  254. label="线上课单价"
  255. type="number"
  256. input-align="right"
  257. size="large"
  258. @keyup="getCalcClass"
  259. :readonly="true"
  260. placeholder="金额(每课时)"
  261. v-if="statusList.hasOnline"
  262. />
  263. <van-field
  264. v-model="form.offlineClassesUnitPrice"
  265. label="线下课单价"
  266. type="number"
  267. input-align="right"
  268. size="large"
  269. @keyup="getCalcClass"
  270. :readonly="true"
  271. placeholder="金额(每课时)"
  272. v-if="statusList.hasOffline"
  273. />
  274. <!-- <van-field
  275. v-model="form.onlineTeacherSalary"
  276. label="线上课课酬"
  277. input-align="right"
  278. size="large"
  279. :readonly="true"
  280. placeholder="金额(每课时)"
  281. v-if="statusList.hasOnline"
  282. type="number"
  283. />
  284. <van-field
  285. v-model="form.offlineTeacherSalary"
  286. label="线下课课酬"
  287. input-align="right"
  288. size="large"
  289. :readonly="true"
  290. placeholder="金额(每课时)"
  291. v-if="statusList.hasOffline"
  292. type="number"
  293. /> -->
  294. <van-field
  295. :value="statusList.hasOffline ? form.offlineTeacherSalary : form.onlineTeacherSalary"
  296. label="VIP课酬"
  297. input-align="right"
  298. size="large"
  299. :readonly="true"
  300. placeholder="金额(每课时)"
  301. v-if="statusList.hasOffline || statusList.hasOnline"
  302. type="number"
  303. />
  304. <van-field
  305. v-model="singleClassMinutesPrice"
  306. label="网管课单价"
  307. input-align="right"
  308. size="large"
  309. :readonly="true"
  310. placeholder="金额(每课时)"
  311. v-if="courseTypePractice"
  312. type="number"
  313. />
  314. <van-field
  315. v-model="form.onlineTeacherSalary"
  316. label="网管课课酬"
  317. input-align="right"
  318. size="large"
  319. :readonly="true"
  320. placeholder="金额(每课时)"
  321. v-if="courseTypePractice"
  322. type="number"
  323. />
  324. <van-field
  325. v-model="form.totalCount"
  326. :readonly="true"
  327. label="课程总价"
  328. input-align="right"
  329. size="large"
  330. placeholder="金额(每课时)"
  331. />
  332. </van-cell-group>
  333. <div class="button-group">
  334. <van-button type="primary" @click="onSubmit" round size="large"
  335. >确认</van-button
  336. >
  337. </div>
  338. <!-- 每课时长 -->
  339. <van-action-sheet
  340. v-model="statusList.classTimerStatus"
  341. :actions="loadData.classTimer"
  342. cancel-text="取消"
  343. @cancel="statusList.classTimerStatus = false"
  344. @select="onClassTimerSelect"
  345. />
  346. <!-- 报名开始时间&报名结束时间 -->
  347. <van-popup v-model="enlistForm.status" position="bottom">
  348. <van-datetime-picker
  349. v-model="enlistForm.currentDate"
  350. type="date"
  351. :min-date="enlistForm.minDate"
  352. :max-date="enlistForm.maxDate"
  353. :formatter="formatter"
  354. @cancel="enlistForm.status = false"
  355. @confirm="onEnlistConfirm"
  356. />
  357. </van-popup>
  358. <!-- 赠课类型 -->
  359. <van-action-sheet
  360. v-model="statusList.courseTypeStatus"
  361. :actions='[{name: "VIP课",value: "VIP"},{name: "网管课",value: "PRACTICE"}]'
  362. cancel-text="取消"
  363. @cancel="statusList.courseTypeStatus = false"
  364. @select="onCourseTypeSelect"
  365. />
  366. <!-- 课程信息所用 :close-on-click-overlay="false" -->
  367. <van-popup v-model="sheetForm.sheetStatus" position="bottom">
  368. <van-picker
  369. :loading="sheetForm.loading"
  370. :default-index="sheetForm.index"
  371. :columns="sheetForm.columns"
  372. show-toolbar
  373. @cancel="sheetForm.sheetStatus = false"
  374. @confirm="onSheetConfirm"
  375. />
  376. </van-popup>
  377. <!-- 课时安排 -->
  378. <van-popup v-model="dataForm.status" position="bottom">
  379. <van-datetime-picker
  380. v-model="dataForm.currentDate"
  381. type="date"
  382. :min-date="dataForm.minDate"
  383. :max-date="dataForm.maxDate"
  384. :formatter="formatter"
  385. @cancel="dataForm.status = false"
  386. @confirm="onCurrentConfirm"
  387. />
  388. </van-popup>
  389. <!-- 课时安排 -->
  390. <van-popup v-model="courseForm.teachingStatus" position="bottom">
  391. <van-picker
  392. :columns="courseForm.columns"
  393. show-toolbar
  394. @cancel="courseForm.teachingStatus = false"
  395. @confirm="onTeachinConfirm"
  396. />
  397. </van-popup>
  398. <!-- 选择上课学生 -->
  399. <van-popup
  400. v-model="statusList.studentStatus"
  401. :lock-scroll="true"
  402. position="bottom"
  403. :style="{ height: '180%' }"
  404. class="studentChiose"
  405. >
  406. <van-sticky>
  407. <van-search
  408. show-action
  409. shape="round"
  410. @search="onSearch"
  411. v-model="params.search"
  412. placeholder="请输入学生名或手机号"
  413. >
  414. <template #action>
  415. <div @click="onSearch">搜索</div>
  416. </template>
  417. </van-search>
  418. </van-sticky>
  419. <div class="paddingB80">
  420. <van-list
  421. v-model="loading"
  422. class="studentContainer"
  423. v-if="dataShow"
  424. key="data"
  425. :finished="finished"
  426. finished-text=""
  427. @load="getStudent"
  428. >
  429. <van-checkbox-group v-model="checkboxSelect">
  430. <van-cell-group>
  431. <van-cell
  432. v-for="(item, index) in dataList"
  433. :key="index"
  434. @click="onCheckboxSelect(item)"
  435. class="input-cell"
  436. :center="true"
  437. >
  438. <template slot="icon">
  439. <img
  440. class="logo"
  441. v-if="item.avatar"
  442. :src="item.avatar"
  443. alt=""
  444. />
  445. <img
  446. class="logo"
  447. v-else
  448. src="@/assets/images/icon_student.png"
  449. alt=""
  450. />
  451. </template>
  452. <template slot="title">
  453. {{ item.userName }}
  454. </template>
  455. <template slot="label">
  456. <span>{{ desensitPhone(item.phone) }}</span>
  457. </template>
  458. <template slot="default">
  459. <van-checkbox :name="item.userId.toString()"></van-checkbox>
  460. </template>
  461. </van-cell>
  462. </van-cell-group>
  463. </van-checkbox-group>
  464. </van-list>
  465. <m-empty class="empty" msg="暂无学生" v-else key="data" />
  466. </div>
  467. <div class="button-group-popup">
  468. <span class="btn" @click="onPopupCancel">取消</span>
  469. <span class="btn primary" @click="onPopupSubmit">确定</span>
  470. </div>
  471. </van-popup>
  472. <!-- 课表展示 -->
  473. <van-popup v-model="statusList.classTime" position="bottom" >
  474. <van-row>
  475. <van-col span="12">上课类型</van-col>
  476. <van-col span="12">上课时间</van-col>
  477. </van-row>
  478. <div class="tableContainer">
  479. <van-row v-for="(item, index) in timeTable" :key="index">
  480. <van-col span="12">
  481. {{ item.teachMode == "ONLINE" ? "线上" : "线下" }}
  482. </van-col>
  483. <van-col span="12">
  484. {{ item.classDate }} {{ item.startClassTimeStr }}
  485. </van-col>
  486. </van-row>
  487. </div>
  488. </van-popup>
  489. </div>
  490. </template>
  491. <script>
  492. /* eslint-disable */
  493. import MHeader from "@/components/MHeader";
  494. import { browser } from "@/common/common";
  495. import MEmpty from "@/components/MEmpty";
  496. import {
  497. findSubSubjects,
  498. vipGroupCategory,
  499. findByVipGroupCategory,
  500. findVipSchoolByTeacher2,
  501. findByTeacherAndCategory,
  502. vipGroupApply,
  503. findEducationUsers,
  504. queryStudentsWithTeacherByOrganId,
  505. queryPracticeGroupSellPrice,
  506. getPracticeGroupCostCount,
  507. practiceGroupApply
  508. } from "@/api/teacher";
  509. import setLoading from "@/utils/loading";
  510. import dayjs from "dayjs";
  511. let minutes = []; // 分钟数
  512. for (let i = 0; i < 60; i++) {
  513. let mi = i < 10 ? "0" + i : i;
  514. minutes.push(mi + "分");
  515. }
  516. export default {
  517. name: "vipapply",
  518. components: {
  519. MHeader,
  520. MEmpty,
  521. },
  522. watch: {
  523. 'statusList.hasOffline'() {
  524. // console.log(this.statusList.hasOffline)
  525. }
  526. },
  527. data() {
  528. return {
  529. dataForm: {
  530. // 时间下拉框
  531. status: false,
  532. minDate: new Date(),
  533. maxDate: new Date(2025, 10, 1),
  534. currentDate: new Date(),
  535. },
  536. enlistForm: {
  537. // 时间下拉框
  538. updateStatus: "", // 修改哪个状态
  539. status: false,
  540. minDate: new Date(),
  541. maxDate: new Date(2025, 10, 1),
  542. currentDate: new Date(),
  543. },
  544. statusList: {
  545. // 散状态集合
  546. hasOnline: true, // 是否显示线上
  547. hasOffline: true, // 是否显示线下
  548. classTime: false, // 课表展示
  549. headerStatus: false, // 头部是否展示
  550. classTimerStatus: false, // 每课时长状态
  551. studentStatus: false, // 上课学生状态
  552. courseTypeStatus: false, // 排课类型
  553. },
  554. loadData: {
  555. // 下拉加载数据
  556. subjectList: [], // 声部列表
  557. subjectListSelect: [], // 选中的声部JSON
  558. vipGroupCategory: [], // 课程形式
  559. vipGroupCategorySelect: [], // 选中的课程形式JSON
  560. vipGroupActivity: [], // 活动文案
  561. vipGroupActivitySelect: [], // 选中的活动文案JSON
  562. teacherSchool: [], // 线下课地址
  563. teacherSchoolSelect: [], // 选中的线下课地址JSON
  564. teacherList: [], // 线下课地址
  565. teacherListSelect: [], // 选中的线下课地址JSON
  566. teacherCategory: [], // 老师课酬信息
  567. classTimer: [], // 每课时长
  568. },
  569. sheetForm: {
  570. // 上拉弹窗
  571. currentType: null, // 当前选择的类型
  572. sheetStatus: false,
  573. loading: true, // 加载数据
  574. index: 0, // 选中的索引值
  575. columns: [],
  576. },
  577. courseForm: {
  578. // 排课弹窗
  579. teachingStatus: false, // 课时安排状态
  580. columns: [
  581. {
  582. // 课程选项
  583. values: ["线上", "线下"],
  584. className: "type",
  585. },
  586. {
  587. values: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
  588. className: "week",
  589. },
  590. {
  591. values: [
  592. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
  593. ],
  594. className: "hours",
  595. defaultIndex: 7,
  596. },
  597. {
  598. values: minutes,
  599. className: "minutes",
  600. },
  601. ],
  602. },
  603. courseType: 'VIP', // VIP , PRACTICE
  604. courseTypeName: 'VIP课', // VIP , PRACTICE
  605. form: {
  606. name: null,
  607. subjectIdList: null,
  608. vipGroupCategoryId: null,
  609. vipGroupActivityId: null,
  610. teacherSchoolId: null,
  611. educationalTeacherId: null,
  612. studentNum: null,
  613. singleClassMinutes: null,
  614. onlineClassesNums: null,
  615. offlineClassesNums: null,
  616. registrationStartTime: null,
  617. coursesExpireDate: null,
  618. totalClassTime: null,
  619. courseStart: null,
  620. onlineClassesUnitPrice: null,
  621. offlineClassesUnitPrice: null,
  622. onlineTeacherSalary: null,
  623. offlineTeacherSalary: null,
  624. totalCount: null,
  625. },
  626. formName: {
  627. subjectListName: null, // 声部名称
  628. subjectListIndex: 0, // 声部名称
  629. vipGroupCategoryName: null, // 课程形式
  630. vipGroupCategoryIndex: 0, // 课程形式
  631. vipGroupActivityName: null, // 活动文案
  632. vipGroupActivityIndex: 0, // 活动文案
  633. teacherSchoolName: null, // 线下课地址
  634. teacherSchoolIndex: 0, // 线下课地址
  635. educationalTeacherName: null, // 乐团主管
  636. educationalTeacherIndex: 0,
  637. },
  638. other: {
  639. onlineSalary: null, // 线上课课酬结算方式
  640. offlineSalary: null, // 线下课课酬结算方式
  641. },
  642. scheduleList: [], // 课时安排
  643. timeTable: [], // 生成的课表
  644. onSubmitStatus: true, // 点击
  645. checkboxSelect: [],
  646. checkboxSelectIds: [],
  647. checkboxSelectList: [], //选中学生列表
  648. checkboxSelectDataList: [],
  649. loading: false,
  650. finished: false,
  651. params: {
  652. search: null,
  653. page: 1,
  654. rows: 20,
  655. },
  656. dataShow: true, // 是否有数据
  657. dataList: [],
  658. salaryStatus: true, // 是否跳过课酬二次确认
  659. singleClassMinutesPrice: 0, //网管课单价
  660. singleClassMinutesSalary: 0, // 网管课课酬
  661. };
  662. },
  663. mounted() {
  664. let params = this.$route.query;
  665. if (params.Authorization) {
  666. localStorage.setItem("Authorization", decodeURI(params.Authorization));
  667. localStorage.setItem("userInfo", decodeURI(params.Authorization));
  668. }
  669. console.log(params.Authorization)
  670. document.title = "VIP课程申请";
  671. if (browser().android) {
  672. this.headerStatus = true;
  673. }
  674. },
  675. methods: {
  676. dayjs,
  677. onCheckStudent() {
  678. if (!this.form.vipGroupCategoryId && this.courseTypeVip) {
  679. // 判断是否选择了课程形式
  680. this.$toast("请选择课程形式");
  681. return;
  682. }
  683. this.statusList.studentStatus = true;
  684. },
  685. onGetSheetList(name) {
  686. // 获取科目列表
  687. let sheetForm = this.sheetForm;
  688. sheetForm.columns = [];
  689. if (!this.form.vipGroupCategoryId && name == "vipGroupActivity" && this.courseTypeVip) {
  690. this.$toast("请选择课程形式");
  691. return;
  692. } else if (
  693. (!this.checkboxSelectDataList ||
  694. (this.checkboxSelectDataList &&
  695. this.checkboxSelectDataList.length <= 0)) &&
  696. name == "vipGroupActivity"
  697. ) {
  698. // 判断是否选择了课程形式
  699. this.$toast("请选择上课学生");
  700. return;
  701. }
  702. sheetForm.sheetStatus = true;
  703. sheetForm.loading = true;
  704. sheetForm.currentType = name;
  705. sheetForm.index = 0;
  706. let arr = this.loadData[name];
  707. if (arr.length > 0) {
  708. sheetForm.columns = arr;
  709. sheetForm.index = this.formName[name + "Index"];
  710. sheetForm.loading = false;
  711. } else {
  712. this.onLoadingData(name);
  713. }
  714. },
  715. onLoadingData() {
  716. // 加载数据
  717. let sheetForm = this.sheetForm;
  718. if (sheetForm.currentType == "subjectList") {
  719. // 声部列表
  720. findSubSubjects().then((res) => {
  721. let result = res.data;
  722. if (result.code == 200 && result.data.length > 0) {
  723. let tempArr = [];
  724. result.data.forEach((item) => {
  725. item.value = item.id;
  726. item.text = item.name;
  727. tempArr.push(item);
  728. });
  729. this.loadData.subjectList = tempArr;
  730. sheetForm.columns = tempArr;
  731. sheetForm.loading = false;
  732. } else {
  733. this.$toast("暂无科目列表");
  734. sheetForm.loading = false;
  735. }
  736. });
  737. } else if (sheetForm.currentType == "vipGroupCategory") {
  738. // 课程形式
  739. vipGroupCategory().then((res) => {
  740. let result = res.data;
  741. if (result.code == 200 && result.data.length > 0) {
  742. let tempArr = [];
  743. result.data.forEach((item) => {
  744. item.value = item.id;
  745. item.text = item.name;
  746. tempArr.push(item);
  747. });
  748. this.loadData.vipGroupCategory = tempArr;
  749. sheetForm.columns = tempArr;
  750. sheetForm.loading = false;
  751. } else {
  752. this.$toast("暂无课程形式");
  753. sheetForm.loading = false;
  754. }
  755. });
  756. } else if (sheetForm.currentType == "vipGroupActivity") {
  757. // 活动文案
  758. let studentIds = [];
  759. if (
  760. this.checkboxSelectDataList &&
  761. this.checkboxSelectDataList.length > 0
  762. ) {
  763. this.checkboxSelectDataList.forEach((item) => {
  764. studentIds.push(item.userId);
  765. });
  766. }
  767. let params = {
  768. studentIds: studentIds.join(",")
  769. }
  770. if(this.courseTypeVip) {
  771. params.categoryId = this.form.vipGroupCategoryId
  772. } else if(this.courseTypePractice) {
  773. params.courseType = 'PRACTICE'
  774. }
  775. findByVipGroupCategory(params).then((res) => {
  776. let result = res.data;
  777. if (result.code == 200 && result.data.length > 0) {
  778. let tempArr = [];
  779. result.data.forEach((item) => {
  780. item.value = item.id;
  781. item.text = item.name;
  782. (item.startTime = item.startTime
  783. ? item.startTime.split(" ")[0]
  784. : null), // 报名开始时间
  785. (item.endTime = item.endTime
  786. ? item.endTime.split(" ")[0]
  787. : null); // 报名结束时间
  788. tempArr.push(item);
  789. });
  790. this.loadData.vipGroupActivity = tempArr;
  791. sheetForm.columns = tempArr;
  792. sheetForm.loading = false;
  793. } else {
  794. this.$toast("暂无活动方案");
  795. sheetForm.loading = false;
  796. }
  797. });
  798. } else if (sheetForm.currentType == "teacherSchool") {
  799. // 教师教学点
  800. findVipSchoolByTeacher2().then((res) => {
  801. let result = res.data;
  802. if (result.code == 200 && result.data.length > 0) {
  803. let tempArr = [];
  804. result.data.forEach((item) => {
  805. item.value = item.id;
  806. item.text = item.name;
  807. tempArr.push(item);
  808. });
  809. this.loadData.teacherSchool = tempArr;
  810. sheetForm.columns = tempArr;
  811. sheetForm.loading = false;
  812. } else {
  813. this.$toast("暂无教学点");
  814. sheetForm.loading = false;
  815. }
  816. });
  817. } else if (sheetForm.currentType == "teacherList") {
  818. // 乐团主管
  819. findEducationUsers().then((res) => {
  820. let result = res.data;
  821. const EDUCATION = result.EDUCATION || [];
  822. if (result.code == 200 && EDUCATION.length > 0) {
  823. let tempArr = [];
  824. EDUCATION.forEach((item) => {
  825. item.value = item.userId;
  826. item.text = item.userName;
  827. tempArr.push(item);
  828. });
  829. this.loadData.teacherList = tempArr;
  830. sheetForm.columns = tempArr;
  831. sheetForm.loading = false;
  832. } else {
  833. this.$toast("暂无乐团主管");
  834. sheetForm.loading = false;
  835. }
  836. });
  837. }
  838. },
  839. findTeacherCategory(id) {
  840. // 获取教师课酬
  841. findByTeacherAndCategory({
  842. categoryId: id,
  843. }).then((res) => {
  844. let result = res.data;
  845. if (result.code == 200) {
  846. this.loadData.teacherCategory = result.data;
  847. }
  848. });
  849. },
  850. onSheetConfirm(value, index) {
  851. console.log({...value})
  852. // 上拉弹窗
  853. let sheetForm = this.sheetForm,
  854. form = this.form,
  855. formName = this.formName,
  856. loadData = this.loadData;
  857. if (sheetForm.currentType == "subjectList") {
  858. // 科目名称赋值
  859. form.subjectIdList = value.value;
  860. formName.subjectListName = value.text;
  861. formName.subjectListIndex = index;
  862. loadData.subjectListSelect = value;
  863. } else if (sheetForm.currentType == "vipGroupCategory") {
  864. // 课程形式赋值
  865. if (loadData.vipGroupCategorySelect.id != value.id) {
  866. // 获取教师课酬
  867. this.findTeacherCategory(value.id);
  868. }
  869. form.vipGroupCategoryId = value.value;
  870. formName.vipGroupCategoryName = value.text;
  871. formName.vipGroupCategoryIndex = index;
  872. loadData.vipGroupCategorySelect = value;
  873. form.studentNum = value.studentNum; // 每班人数
  874. // form.singleClassMinutes = value.singleClassMinutes // 每课时长
  875. form.onlineClassesUnitPrice = value.onlineClassesUnitPrice//Math.ceil(value.onlineClassesUnitPrice);
  876. // this.onlineUnitPrice = Math.ceil(value.onlineClassesUnitPrice)
  877. form.offlineClassesUnitPrice = value.offlineClassesUnitPrice//Math.ceil(value.offlineClassesUnitPrice);
  878. // this.offLineUnitPrice = Math.ceil(value.offlineClassesUnitPrice)
  879. // form.offlineTeacherSalary = JSON.parse(value.salarySettlementJson).offlineSalarySettlement.settlementValue
  880. // 每课时长赋值
  881. form.singleClassMinutes = null;
  882. loadData.classTimer = [];
  883. let tempSingle = value.singleClassMinutes.split(",");
  884. tempSingle.forEach((item) => {
  885. this.loadData.classTimer.push({
  886. name: item,
  887. value: item,
  888. });
  889. });
  890. // 重置上课学生
  891. this.checkboxSelect = [];
  892. this.checkboxSelectIds = [];
  893. this.checkboxSelectList = []; //选中学生列表
  894. this.checkboxSelectDataList = [];
  895. // 重置活动文案
  896. form.vipGroupActivityId = null;
  897. formName.vipGroupActivityName = null;
  898. formName.vipGroupActivityIndex = 0;
  899. loadData.vipGroupActivity = [];
  900. loadData.vipGroupActivitySelect = [];
  901. } else if (sheetForm.currentType == "vipGroupActivity") {
  902. // 活动方案赋值
  903. // 重置线上课,线下课次数
  904. if (form.vipGroupActivityId != value.value) {
  905. form.offlineClassesNums = null;
  906. form.onlineClassesNums = null;
  907. }
  908. form.vipGroupActivityId = value.value;
  909. formName.vipGroupActivityName = value.text;
  910. formName.vipGroupActivityIndex = index;
  911. loadData.vipGroupActivitySelect = value;
  912. // 换活动之后单价重置
  913. form.onlineClassesUnitPrice = parseFloat(
  914. loadData.vipGroupCategorySelect.onlineClassesUnitPrice || 0
  915. );
  916. form.offlineClassesUnitPrice = parseFloat(
  917. loadData.vipGroupCategorySelect.offlineClassesUnitPrice || 0
  918. );
  919. form.singleClassMinutes = value.singleCourseTime
  920. if(this.courseTypeVip) {
  921. this.onCalcClassTimes(value); // 计算时间等.........
  922. } else {
  923. }
  924. this.getCalcClass(); // 课酬计算
  925. this.setTimeTable(); // 重新排课
  926. // 时间安排
  927. // form.registrationStartTime = value.startTime
  928. // form.coursesExpireDate = value.endTime
  929. } else if (sheetForm.currentType == "teacherSchool") {
  930. // 线下课地址
  931. form.teacherSchoolId = value.value;
  932. formName.teacherSchoolName = value.text;
  933. formName.teacherSchoolIndex = index;
  934. } else if (sheetForm.currentType == "teacherList") {
  935. // 乐团主管
  936. form.educationalTeacherId = value.value;
  937. formName.educationalTeacherName = value.text;
  938. formName.educationalTeacherIndex = index;
  939. }
  940. sheetForm.sheetStatus = false;
  941. },
  942. onClassKeyUp(type) {
  943. // 线上课&线下课修改时
  944. if (type == "offLine" && this.form.offlineClassesNums <= 0) {
  945. this.form.teacherSchoolId = null;
  946. this.formName.teacherSchoolName = null;
  947. this.formName.teacherSchoolIndex = 0;
  948. }
  949. let vas = this.loadData.vipGroupActivitySelect;
  950. this.onCalcClassTimes(vas);
  951. this.getCalcClass();
  952. this.setTimeTable();
  953. },
  954. onCalcClassTimes(vas) {
  955. // 计算课时总数
  956. let form = this.form,
  957. statusList = this.statusList;
  958. let totalCount = Number(form.onlineClassesNums) + Number(form.offlineClassesNums);
  959. // 获取总课次
  960. form.totalClassTime = totalCount
  961. // teachMode -1:所有;0:线上;1:线下
  962. // 设置是否有对的类型的课
  963. switch(vas.teachMode) {
  964. case -1:
  965. statusList.hasOffline = true;
  966. statusList.hasOnline = true;
  967. break;
  968. case 0:
  969. statusList.hasOnline = true;
  970. statusList.hasOffline = false;
  971. break;
  972. case 1:
  973. statusList.hasOnline = false;
  974. statusList.hasOffline = true;
  975. break;
  976. default:
  977. break;
  978. }
  979. },
  980. async onCourseTypeSelect(value) {
  981. // 课程类型
  982. this.statusList.courseTypeStatus = false
  983. if(value.value == this.courseType) return
  984. this.courseType = value.value
  985. this.courseTypeName = value.name
  986. let form = this.form,
  987. formName = this.formName,
  988. loadData = this.loadData
  989. // 课程形式重置
  990. form.vipGroupCategoryId = null
  991. formName.vipGroupCategoryName = null
  992. formName.vipGroupCategoryIndex = 0
  993. // 重置上课学生
  994. this.checkboxSelect = [];
  995. this.checkboxSelectIds = [];
  996. this.checkboxSelectList = []; //选中学生列表
  997. this.checkboxSelectDataList = [];
  998. // 重置活动文案
  999. form.vipGroupActivityId = null;
  1000. formName.vipGroupActivityName = null;
  1001. formName.vipGroupActivityIndex = 0;
  1002. loadData.vipGroupActivity = [];
  1003. loadData.vipGroupActivitySelect = [];
  1004. // 更新每课时长
  1005. form.singleClassMinutes = null
  1006. // 课时总数
  1007. form.totalClassTime = null
  1008. form.offlineClassesNums = null
  1009. form.onlineClassesNums = null
  1010. this.scheduleList = [] // 清空课时安排
  1011. if(value.value == 'VIP') {
  1012. this.courseForm.columns[0].values = ["线上", "线下"]
  1013. form.studentNum = null
  1014. form.onlineClassesUnitPrice = 0
  1015. form.onlineTeacherSalary = 0
  1016. this.statusList.hasOnline = true
  1017. this.statusList.hasOffline = true
  1018. this.getCalcClass();
  1019. } else if(value.value == 'PRACTICE') {
  1020. this.courseForm.columns[0].values = ["线上"]
  1021. // 重置地址数据
  1022. this.form.teacherSchoolId = null;
  1023. this.formName.teacherSchoolName = null;
  1024. this.formName.teacherSchoolIndex = 0;
  1025. // 每班人数 (网管课固定1人)
  1026. form.studentNum = 1
  1027. loadData.classTimer = [{ name: 25, value: 25 }];
  1028. this.statusList.hasOnline = false
  1029. this.statusList.hasOffline = false
  1030. this.getCalcClass();
  1031. // 判断是否已经有金额了
  1032. if(!this.singleClassMinutesPrice) {
  1033. await queryPracticeGroupSellPrice().then(res => {
  1034. let result = res.data
  1035. if(result.code == 200) {
  1036. this.singleClassMinutesPrice = result.data.singleClassMinutesPrice || 0
  1037. }
  1038. })
  1039. }
  1040. if(!this.singleClassMinutesSalary) {
  1041. await getPracticeGroupCostCount().then(res => {
  1042. const result = res.data
  1043. if(result.code == 200) {
  1044. this.singleClassMinutesSalary = result.data.onlineTeacherSalary || 0
  1045. }
  1046. })
  1047. }
  1048. }
  1049. },
  1050. onClickSingleClass() {
  1051. if (!this.formName.vipGroupCategoryName && this.courseTypeVip) {
  1052. this.$toast("请选择课程形式");
  1053. return;
  1054. }
  1055. // 如果选择了活动则,课时不能选择
  1056. if(this.form.vipGroupActivityId) return
  1057. this.statusList.classTimerStatus = true;
  1058. },
  1059. onClassTimerSelect(value) {
  1060. // 每课时长设置
  1061. this.form.singleClassMinutes = value.value;
  1062. this.statusList.classTimerStatus = false;
  1063. this.getCalcClass();
  1064. },
  1065. onCurrentConfirm(value) {
  1066. // 排课开始时间
  1067. let selectDate = new Date(value);
  1068. let tempMonth =
  1069. selectDate.getMonth() + 1 >= 10
  1070. ? selectDate.getMonth() + 1
  1071. : "0" + (selectDate.getMonth() + 1);
  1072. let tempDay =
  1073. selectDate.getDate() >= 10
  1074. ? selectDate.getDate()
  1075. : "0" + selectDate.getDate();
  1076. this.form.courseStart =
  1077. selectDate.getFullYear() + "-" + tempMonth + "-" + tempDay;
  1078. this.dataForm.status = false;
  1079. },
  1080. onEnlistConfirm(value) {
  1081. // 报名开始/结束时间
  1082. let selectDate = new Date(value);
  1083. let tempMonth =
  1084. selectDate.getMonth() + 1 >= 10
  1085. ? selectDate.getMonth() + 1
  1086. : "0" + (selectDate.getMonth() + 1);
  1087. let tempDay =
  1088. selectDate.getDate() >= 10
  1089. ? selectDate.getDate()
  1090. : "0" + selectDate.getDate();
  1091. let enlistForm = this.enlistForm;
  1092. let form = this.form;
  1093. if (enlistForm.updateStatus == "start") {
  1094. form.registrationStartTime =
  1095. selectDate.getFullYear() + "-" + tempMonth + "-" + tempDay;
  1096. if (form.coursesExpireDate) {
  1097. let temps = new Date(
  1098. form.registrationStartTime.replace(/-/gi, "/")
  1099. ).getTime();
  1100. let tempe = new Date(
  1101. form.coursesExpireDate.replace(/-/gi, "/")
  1102. ).getTime();
  1103. // 如果开始时间大于结束时间,结束时间制空
  1104. if (temps > tempe) {
  1105. form.coursesExpireDate = null;
  1106. }
  1107. }
  1108. } else if (enlistForm.updateStatus == "end") {
  1109. form.coursesExpireDate =
  1110. selectDate.getFullYear() + "-" + tempMonth + "-" + tempDay;
  1111. }
  1112. enlistForm.status = false;
  1113. },
  1114. onEnListShow(type, value) {
  1115. // 报名开始/截止时间
  1116. let enlistForm = this.enlistForm;
  1117. if (type == "end") {
  1118. if (this.form.registrationStartTime) {
  1119. enlistForm.minDate = new Date(this.form.registrationStartTime.replace(/-/gi, "/"));
  1120. } else {
  1121. enlistForm.minDate = new Date();
  1122. }
  1123. } else if (type == "start") {
  1124. // 开始时默认为当前时间
  1125. enlistForm.minDate = new Date();
  1126. }
  1127. if (value) {
  1128. enlistForm.currentDate = new Date(value.replace(/-/gi, "/"));
  1129. } else {
  1130. enlistForm.currentDate = new Date();
  1131. }
  1132. enlistForm.updateStatus = type;
  1133. enlistForm.status = true;
  1134. },
  1135. onCourseShedule() {
  1136. // 课时安排
  1137. if (!this.form.singleClassMinutes) {
  1138. this.$toast("请选每课时长");
  1139. return;
  1140. }
  1141. if (!this.form.courseStart) {
  1142. this.$toast("请选择排课开始时间");
  1143. return;
  1144. }
  1145. this.courseForm.teachingStatus = true;
  1146. },
  1147. onScheduleRemove(item) {
  1148. // 删除课程安排
  1149. this.$dialog.confirm({
  1150. title: '提示',
  1151. message: '是否删除该课时安排?',
  1152. confirmButtonText: '确定',
  1153. confirmButtonColor: '#269a93',
  1154. cancelButtonText: '取消'
  1155. }).then(() => {
  1156. let index = this.scheduleList.indexOf(item);
  1157. if (index !== -1) {
  1158. this.scheduleList.splice(index, 1);
  1159. }
  1160. })
  1161. },
  1162. onTeachinConfirm(value) {
  1163. // 添加课程
  1164. let scheduleList = this.scheduleList;
  1165. let startTime =
  1166. (value[2] >= 10 ? value[2] : "0" + value[2]) +
  1167. ":" +
  1168. value[3].split("分")[0];
  1169. let endTime = this.MinutesTest(
  1170. value[2],
  1171. value[3],
  1172. this.form.singleClassMinutes
  1173. );
  1174. let isAdd = true;
  1175. scheduleList.forEach((item) => {
  1176. let isStartTime = this.timeIsrange(startTime, endTime, item.startTime);
  1177. let isEndTime = this.timeIsrange(startTime, endTime, item.endTime);
  1178. if (isAdd) {
  1179. //
  1180. if (value[1] == item.weekStr) {
  1181. if (isStartTime || isEndTime) {
  1182. isAdd = false;
  1183. } else {
  1184. isAdd = true;
  1185. }
  1186. } else if (value[1] != item.weekStr) {
  1187. isAdd = true;
  1188. }
  1189. }
  1190. });
  1191. if (isAdd) {
  1192. // 判断时间范围是否有重复
  1193. scheduleList.push({
  1194. type: value[0], // 线上还是线下
  1195. weekStr: value[1],
  1196. weekIndex: this.getWeek(value[1]),
  1197. startTime: startTime,
  1198. endTime: endTime,
  1199. id: Date.now(),
  1200. });
  1201. // scheduleList.sort((a, b) => {
  1202. // return a.weekStr
  1203. // })
  1204. this.courseForm.teachingStatus = false;
  1205. this.setTimeTable();
  1206. } else {
  1207. this.$toast("该时间段已排课请重选时间");
  1208. return;
  1209. }
  1210. },
  1211. onShowTimeTable() {
  1212. // 显示排课列表
  1213. if (!this.checkCourseList()) {
  1214. return;
  1215. }
  1216. this.statusList.classTime = true;
  1217. this.setTimeTable();
  1218. },
  1219. setTimeTable() {
  1220. if (!this.checkCourseList(false)) {
  1221. return;
  1222. }
  1223. // 重置排课列表
  1224. this.timeTable = [];
  1225. let form = this.form,
  1226. scheduleList = this.scheduleList;
  1227. // 拿到线上课数与线下课数 以及
  1228. let online = parseInt(form.onlineClassesNums || 0);
  1229. let offline = parseInt(form.offlineClassesNums || 0);
  1230. // 网管课默认只有线上课次
  1231. if(this.courseTypePractice) {
  1232. online = parseInt(form.totalClassTime || 0)
  1233. }
  1234. // 判断是否有课程安排
  1235. if (scheduleList.length <= 0) {
  1236. return;
  1237. }
  1238. let totalCount = Number(online) + Number(offline);
  1239. let tempCourseStart = form.courseStart.replace(/-/gi, "/");
  1240. let dateOperation = new Date(tempCourseStart);
  1241. let forMark = 0;
  1242. while (totalCount && totalCount > 0) {
  1243. for (let i = 0; i < scheduleList.length; i++) {
  1244. // console.log(totalCount, scheduleList)
  1245. if (online == 0 && offline == 0) break;
  1246. let num = scheduleList[i].weekIndex - dateOperation.getDay();
  1247. // 如果是同一天一个周期会出现排课都排到一天
  1248. if (forMark > 0 && num == 0 && i == 0) {
  1249. num = num + 7;
  1250. }
  1251. if (num < 0) {
  1252. // 如果为负数则为下周
  1253. num = num + 7;
  1254. }
  1255. let dataStr = this.getThinkDate(dateOperation, num);
  1256. // 判断是否大于当前时间
  1257. let nowGetTime = new Date().getTime();
  1258. let courseTime = new Date(
  1259. dataStr.replace(/-/gi, "/") +
  1260. " " +
  1261. scheduleList[i].startTime +
  1262. ":00"
  1263. ).getTime();
  1264. if (nowGetTime < courseTime) {
  1265. let tempArr = {
  1266. classDate: dataStr,
  1267. startClassTimeStr: scheduleList[i].startTime,
  1268. endClassTimeStr: scheduleList[i].endTime,
  1269. };
  1270. // console.log(scheduleList[i].type, online, offline)
  1271. if (scheduleList[i].type == "线上" && online > 0) {
  1272. tempArr.teachMode = "ONLINE";
  1273. this.timeTable.push(tempArr);
  1274. online--;
  1275. totalCount--;
  1276. } else if (scheduleList[i].type == "线下" && offline > 0) {
  1277. tempArr.teachMode = "OFFLINE";
  1278. this.timeTable.push(tempArr);
  1279. offline--;
  1280. totalCount--;
  1281. }
  1282. }
  1283. }
  1284. // 加一周
  1285. if (scheduleList.length == 1) {
  1286. dateOperation.setDate(dateOperation.getDate() + 7);
  1287. } else if (
  1288. scheduleList.every((item) => item.weekStr === scheduleList[0].weekStr)
  1289. ) {
  1290. // 标记循环次数(标记判断课程安排是不是同一天)
  1291. forMark++;
  1292. }
  1293. }
  1294. this.timeTable.sort((a, b) => {
  1295. let aStr = dayjs(dayjs(a.classDate).format("YYYY-MM-DD") + " " + a.startClassTimeStr + ":00").valueOf();
  1296. let bStr = dayjs(dayjs(b.classDate).format("YYYY-MM-DD") + " " + b.startClassTimeStr + ":00").valueOf();
  1297. return aStr - bStr;
  1298. });
  1299. // console.log(this.timeTable)
  1300. },
  1301. getCalcClass() {
  1302. // 计算课酬
  1303. let loadData = this.loadData;
  1304. let form = this.form;
  1305. let vas = loadData.vipGroupActivitySelect, // 活动
  1306. // vcs = loadData.vipGroupCategorySelect, // 课程形式
  1307. tc = loadData.teacherCategory, // 老师基本信息
  1308. oncn = form.onlineClassesNums ? form.onlineClassesNums : 0, // 线上课次数
  1309. offcn = form.offlineClassesNums ? form.offlineClassesNums : 0 // 线下课次数
  1310. // 网管课默认只有线上课次
  1311. if(this.courseTypePractice) {
  1312. oncn = parseInt(form.totalClassTime || 0)
  1313. }
  1314. // 优惠活动(如果没有则原价),可以为0,之前可以为空
  1315. const discount = (typeof vas.discount !== 'number' ? 100 : vas.discount) / 100
  1316. // 重置老师默认网管课金额
  1317. if(this.courseTypePractice) {
  1318. //老师课酬
  1319. form.onlineTeacherSalary = this.singleClassMinutesSalary//Math.round(this.singleClassMinutesSalary)
  1320. // 课程单价
  1321. form.onlineClassesUnitPrice = this.singleClassMinutesPrice//Math.round(this.singleClassMinutesPrice)
  1322. }
  1323. // ...
  1324. console.log('重新计算课酬',this.courseTypeVip)
  1325. if (vas.salarySettlementJson) {
  1326. let obj = JSON.parse(vas.salarySettlementJson);
  1327. // 课程按课来计算
  1328. if(this.courseTypeVip) {
  1329. // 所有的课酬都取线下
  1330. if(obj && obj.offlineSalarySettlement) {
  1331. let voss = obj.offlineSalarySettlement
  1332. if(voss.salarySettlementType == 'TEACHER_DEFAULT') {
  1333. form.onlineTeacherSalary = Number(tc.offlineClassesSalary)
  1334. form.offlineTeacherSalary = Number(tc.offlineClassesSalary)
  1335. } else if(voss.salarySettlementType == 'FIXED_SALARY') {
  1336. form.onlineTeacherSalary = Number(voss.settlementValue)
  1337. form.offlineTeacherSalary = Number(voss.settlementValue)
  1338. }
  1339. } else {
  1340. form.onlineTeacherSalary = Number(tc.offlineClassesSalary)
  1341. form.offlineTeacherSalary = Number(tc.offlineClassesSalary)
  1342. }
  1343. } else if(this.courseTypePractice) {
  1344. // //老师课酬
  1345. if(obj && obj.practiceSalarySettlement) {
  1346. let pss = obj.practiceSalarySettlement
  1347. if(pss.salarySettlementType == 'TEACHER_DEFAULT') {
  1348. form.onlineTeacherSalary = Number(this.singleClassMinutesSalary)
  1349. } else if(pss.salarySettlementType == 'FIXED_SALARY') {
  1350. form.onlineTeacherSalary = Number(pss.settlementValue)
  1351. }
  1352. } else {
  1353. form.onlineTeacherSalary = Number(this.singleClassMinutesSalary)
  1354. }
  1355. }
  1356. } else {
  1357. if(this.courseTypeVip) {
  1358. form.onlineTeacherSalary = Number(tc.offlineClassesSalary)
  1359. form.offlineTeacherSalary = Number(tc.offlineClassesSalary)
  1360. }
  1361. }
  1362. let totalCount = 0
  1363. if(this.courseTypeVip) {
  1364. totalCount = Math.ceil(parseFloat(((oncn * form.onlineClassesUnitPrice + offcn * form.offlineClassesUnitPrice) * discount) * 10000) / 10000);
  1365. } else {
  1366. totalCount = Math.ceil(parseFloat(((oncn * form.onlineClassesUnitPrice) * discount) * 10000) / 10000);
  1367. }
  1368. form.totalCount = Number(totalCount);
  1369. },
  1370. getThinkDate(date, num) {
  1371. let Stamp = date;
  1372. Stamp.setDate(date.getDate() + num); // 获取当前月数的第几天
  1373. var year = Stamp.getFullYear(); //获取完整的年份(4位,1970-????)
  1374. var month = Stamp.getMonth() + 1; //获取当前月份(0-11,0代表1月)
  1375. var mvar = "";
  1376. if (month < 10) {
  1377. mvar = "0" + month;
  1378. } else {
  1379. mvar = month + "";
  1380. }
  1381. var day = Stamp.getDate();
  1382. var dvar = "";
  1383. if (day < 10) {
  1384. dvar = "0" + day;
  1385. } else {
  1386. dvar = day + "";
  1387. }
  1388. return year + "-" + mvar + "-" + dvar;
  1389. },
  1390. // 分钟小时相加减
  1391. MinutesTest(houer, mins, interval) {
  1392. let min = mins.split("分")[0];
  1393. let sdate1 = new Date(1900, 1, 1, houer, min);
  1394. sdate1.setMinutes(sdate1.getMinutes() + parseInt(interval));
  1395. let H = sdate1.getHours();
  1396. let M = sdate1.getMinutes();
  1397. if (H < 10) H = "0" + H;
  1398. if (M < 10) M = "0" + M;
  1399. return H + ":" + M;
  1400. },
  1401. // 判断时间是否在时间段内
  1402. timeIsrange(beginTime, endTime, nowTime) {
  1403. var strb = beginTime.split(":");
  1404. if (strb.length != 2) {
  1405. return false;
  1406. }
  1407. var stre = endTime.split(":");
  1408. if (stre.length != 2) {
  1409. return false;
  1410. }
  1411. var strn = nowTime.split(":");
  1412. if (stre.length != 2) {
  1413. return false;
  1414. }
  1415. var b = new Date();
  1416. var e = new Date();
  1417. var n = new Date();
  1418. b.setHours(strb[0]);
  1419. b.setMinutes(strb[1]);
  1420. e.setHours(stre[0]);
  1421. e.setMinutes(stre[1]);
  1422. n.setHours(strn[0]);
  1423. n.setMinutes(strn[1]);
  1424. if (n.getTime() - b.getTime() >= 0 && n.getTime() - e.getTime() <= 0) {
  1425. // 在时间范围内
  1426. return true;
  1427. } else {
  1428. // 不在时间范围内
  1429. return false;
  1430. }
  1431. },
  1432. getWeek(str) {
  1433. // 获取周几索引值
  1434. let template = {
  1435. 周一: 1,
  1436. 周二: 2,
  1437. 周三: 3,
  1438. 周四: 4,
  1439. 周五: 5,
  1440. 周六: 6,
  1441. 周日: 0,
  1442. };
  1443. return template[str];
  1444. },
  1445. formatter(type, value) {
  1446. if (type === "year") {
  1447. return `${value}年`;
  1448. } else if (type === "month") {
  1449. return `${value}月`;
  1450. } else if (type === "day") {
  1451. return `${value}日`;
  1452. }
  1453. return value;
  1454. },
  1455. async onSubmit(allowOverstepActivityStudentNum) {
  1456. // 次数限制是否可以继续创建
  1457. let form = this.form;
  1458. let statusList = this.statusList;
  1459. // if (!(form.name)) {
  1460. // this.$toast('请输入课程班名称')
  1461. // return false
  1462. // }
  1463. if (!form.subjectIdList) {
  1464. this.$toast("请选择科目");
  1465. return false;
  1466. }
  1467. if (!form.vipGroupCategoryId && this.courseTypeVip) {
  1468. this.$toast("请选择课程形式");
  1469. return false;
  1470. }
  1471. if (!form.educationalTeacherId) {
  1472. this.$toast("请选择乐团主管");
  1473. return;
  1474. }
  1475. if (this.checkboxSelectIds.length <= 0) {
  1476. this.$toast("请选择上课学生");
  1477. return;
  1478. }
  1479. // if (!form.vipGroupActivityId && this.courseTypeVip) {
  1480. // this.$toast("请选择活动方案");
  1481. // return false;
  1482. // }
  1483. if (!form.singleClassMinutes) {
  1484. this.$toast("请选择每课时长");
  1485. return false;
  1486. }
  1487. let onlineClassesStatus =
  1488. !form.onlineClassesNums && form.onlineClassesNums <= 0 ? true : false;
  1489. let offlineClassesStatus =
  1490. !form.offlineClassesNums && form.offlineClassesNums <= 0 ? true : false;
  1491. if (statusList.hasOnline) {
  1492. if (onlineClassesStatus) {
  1493. this.$toast("请输入线上课次数");
  1494. return false;
  1495. }
  1496. }
  1497. if (statusList.hasOffline && !statusList.hasOnline) {
  1498. if (offlineClassesStatus) {
  1499. this.$toast("请输入线下课次数");
  1500. return false;
  1501. }
  1502. // 判断是否有线下
  1503. if (form.offlineClassesNums > 0 && !form.teacherSchoolId) {
  1504. this.$toast("请选择线下课地址");
  1505. return false;
  1506. }
  1507. }
  1508. if (
  1509. statusList.hasOffline &&
  1510. statusList.hasOnline &&
  1511. parseFloat(form.onlineClassesNums || 0) + parseFloat(form.offlineClassesNums || 0) != this.form.totalClassTime
  1512. ) {
  1513. this.$toast('线上课次数+线下课次数不等于总课次数')
  1514. return
  1515. }
  1516. // 判断课时总数
  1517. if(form.totalClassTime <= 0) {
  1518. this.$toast('请输入线上/线下课次数')
  1519. return false;
  1520. }
  1521. if (!form.registrationStartTime) {
  1522. this.$toast("请选择报名开始时间");
  1523. return false;
  1524. }
  1525. if (!form.coursesExpireDate) {
  1526. this.$toast("请选择报名结束时间");
  1527. return false;
  1528. }
  1529. if (this.scheduleList.length <= 0) {
  1530. this.$toast("课时安排不能为空");
  1531. return false;
  1532. }
  1533. let vipGroupActivitySelect = this.loadData.vipGroupActivitySelect;
  1534. if (vipGroupActivitySelect.minCourseNum > 0 && vipGroupActivitySelect.maxCourseNum > 0) {
  1535. // debugger
  1536. let tempCourseCount = Number(form.totalClassTime) || parseInt(form.onlineClassesNums || 0) + parseInt(form.offlineClassesNums || 0);
  1537. if (
  1538. vipGroupActivitySelect.minCourseNum > tempCourseCount ||
  1539. tempCourseCount > vipGroupActivitySelect.maxCourseNum
  1540. ) {
  1541. this.$toast(
  1542. `课时总数为${vipGroupActivitySelect.minCourseNum}~${vipGroupActivitySelect.maxCourseNum}节`
  1543. );
  1544. return;
  1545. }
  1546. }
  1547. if (!this.checkCourseList()) {
  1548. return;
  1549. }
  1550. // 排课
  1551. this.setTimeTable();
  1552. // 如果线上和线下课酬都为0时
  1553. if (statusList.hasOnline && statusList.hasOffline) {
  1554. if (
  1555. form.onlineClassesNums > 0 &&
  1556. form.onlineTeacherSalary <= 0 &&
  1557. form.offlineClassesNums > 0 &&
  1558. form.offlineTeacherSalary <= 0 &&
  1559. this.salaryStatus
  1560. ) {
  1561. this.$dialog
  1562. .confirm({
  1563. message: "当前课程课酬预计为0,是否继续?",
  1564. })
  1565. .then(() => {
  1566. this.salaryStatus = false;
  1567. this.onSubmit();
  1568. });
  1569. return;
  1570. }
  1571. }
  1572. if (statusList.hasOnline) {
  1573. if (!form.onlineClassesUnitPrice) {
  1574. this.$toast("请输入线上课单价");
  1575. return false;
  1576. }
  1577. if (!form.onlineTeacherSalary) {
  1578. this.$toast("请输入线上课课酬");
  1579. return false;
  1580. }
  1581. if (
  1582. form.onlineClassesNums > 0 &&
  1583. form.onlineTeacherSalary <= 0 &&
  1584. this.salaryStatus
  1585. ) {
  1586. this.$dialog
  1587. .confirm({
  1588. message: "当前课程线上课酬预计为0,是否继续?",
  1589. })
  1590. .then(() => {
  1591. this.salaryStatus = false;
  1592. this.onSubmit();
  1593. });
  1594. return;
  1595. }
  1596. }
  1597. if (statusList.hasOffline) {
  1598. if (!form.offlineClassesUnitPrice) {
  1599. this.$toast("请输入线下课单价");
  1600. return false;
  1601. }
  1602. if (!form.offlineTeacherSalary) {
  1603. this.$toast("请输入线下课课酬");
  1604. return false;
  1605. }
  1606. if (
  1607. form.offlineClassesNums > 0 &&
  1608. form.offlineTeacherSalary <= 0 &&
  1609. this.salaryStatus
  1610. ) {
  1611. this.$dialog
  1612. .confirm({
  1613. message: "当前课程线下课酬预计为0,是否继续?",
  1614. })
  1615. .then(() => {
  1616. this.salaryStatus = false;
  1617. this.onSubmit();
  1618. });
  1619. return;
  1620. }
  1621. }
  1622. form.onlineClassesNum = Number(form.onlineClassesNums);
  1623. form.offlineClassesNum = Number(form.offlineClassesNums);
  1624. if(this.courseTypePractice) { //网管课等于总课次
  1625. form.onlineClassesNum = Number(form.totalClassTime)
  1626. }
  1627. form.totalClassTimes = Number(form.onlineClassesNums) +Number(form.offlineClassesNums)
  1628. form.paymentExpireDate = form.coursesExpireDate;
  1629. form.studentIdList = this.checkboxSelectIds.join(",");
  1630. form.firstStudentId = this.checkboxSelectDataList.length > 0 ? this.checkboxSelectDataList[0].userId : null;
  1631. let params = {
  1632. courseSchedules: this.timeTable
  1633. };
  1634. if (allowOverstepActivityStudentNum == 1) {
  1635. params.allowOverstepActivityStudentNum = 1;
  1636. }
  1637. if (!this.onSubmitStatus) {
  1638. return;
  1639. }
  1640. this.onSubmitStatus = false;
  1641. if(this.courseTypeVip) {
  1642. params.vipGroupApplyBaseInfo = form
  1643. await this.getVipApply(params)
  1644. } else {
  1645. params.practiceGroupApplyBaseInfoDto = form
  1646. params.practiceGroupApplyBaseInfoDto.studentId = form.studentIdList
  1647. params.practiceGroupApplyBaseInfoDto.allCourseNum = form.totalClassTime
  1648. params.practiceGroupApplyBaseInfoDto.subjectId = form.subjectIdList
  1649. await this.getPracticeApply(params)
  1650. }
  1651. },
  1652. async getVipApply(params) {
  1653. setLoading(true);
  1654. await vipGroupApply(params)
  1655. .then((res) => {
  1656. let result = res.data;
  1657. setLoading(false);
  1658. if (result.code == 200) {
  1659. this.$toast("申请成功");
  1660. setTimeout(() => {
  1661. this.onSubmitStatus = true;
  1662. if (browser().iPhone) {
  1663. window.webkit.messageHandlers.DAYA.postMessage(
  1664. JSON.stringify({
  1665. api: "back",
  1666. })
  1667. );
  1668. } else if (browser().android) {
  1669. DAYA.postMessage(
  1670. JSON.stringify({
  1671. api: "back",
  1672. })
  1673. );
  1674. } else {
  1675. this.$router.push("/business");
  1676. }
  1677. }, 500);
  1678. } else if (result.code == 206) {
  1679. this.onSubmitStatus = true;
  1680. this.salaryStatus = true;
  1681. this.$dialog
  1682. .confirm({
  1683. message: result.msg,
  1684. showConfirmButton: true,
  1685. showCancelButton: true,
  1686. confirmButtonText: "继续创建",
  1687. cancelButtonText: "取消",
  1688. })
  1689. .then(() => {
  1690. this.salaryStatus = false;
  1691. this.onSubmit(1);
  1692. });
  1693. return;
  1694. } else {
  1695. this.onSubmitStatus = true;
  1696. this.salaryStatus = true;
  1697. this.$toast(result.msg);
  1698. }
  1699. })
  1700. .catch(() => {
  1701. this.onSubmitStatus = true;
  1702. this.salaryStatus = true;
  1703. setLoading(false);
  1704. });
  1705. },
  1706. async getPracticeApply(params) {
  1707. setLoading(true);
  1708. await practiceGroupApply(params)
  1709. .then((res) => {
  1710. let result = res.data;
  1711. setLoading(false);
  1712. if (result.code == 200) {
  1713. this.$toast("申请成功");
  1714. setTimeout(() => {
  1715. this.onSubmitStatus = true;
  1716. if (browser().iPhone) {
  1717. window.webkit.messageHandlers.DAYA.postMessage(
  1718. JSON.stringify({
  1719. api: "back",
  1720. })
  1721. );
  1722. } else if (browser().android) {
  1723. DAYA.postMessage(
  1724. JSON.stringify({
  1725. api: "back",
  1726. })
  1727. );
  1728. } else {
  1729. this.$router.push("/business");
  1730. }
  1731. }, 500);
  1732. } else if (result.code == 206) {
  1733. this.onSubmitStatus = true;
  1734. this.salaryStatus = true;
  1735. this.$dialog
  1736. .confirm({
  1737. message: result.msg,
  1738. showConfirmButton: true,
  1739. showCancelButton: true,
  1740. confirmButtonText: "继续创建",
  1741. cancelButtonText: "取消",
  1742. })
  1743. .then(() => {
  1744. this.salaryStatus = false;
  1745. this.onSubmit(1);
  1746. });
  1747. return;
  1748. } else {
  1749. this.onSubmitStatus = true;
  1750. this.salaryStatus = true;
  1751. this.$toast(result.msg);
  1752. }
  1753. })
  1754. .catch(() => {
  1755. this.onSubmitStatus = true;
  1756. this.salaryStatus = true;
  1757. setLoading(false);
  1758. });
  1759. },
  1760. checkCourseList(isShowToast = true) {
  1761. let form = this.form;
  1762. let scheduleList = this.scheduleList || [];
  1763. let hasOnLine = false; // 是否有线上课时安排
  1764. let hasOffLine = false;
  1765. scheduleList.forEach((item) => {
  1766. if (item.type == "线上") {
  1767. hasOnLine = true;
  1768. }
  1769. if (item.type == "线下") {
  1770. hasOffLine = true;
  1771. }
  1772. });
  1773. let statusList = this.statusList;
  1774. let onlineClassesStatus =
  1775. !form.onlineClassesNums && form.onlineClassesNums <= 0 ? true : false;
  1776. let offlineClassesStatus =
  1777. !form.offlineClassesNums && form.offlineClassesNums <= 0 ? true : false;
  1778. if (statusList.hasOnline) {
  1779. if (onlineClassesStatus) {
  1780. if (isShowToast) {
  1781. this.$toast("请输入线上课次数");
  1782. }
  1783. return false;
  1784. }
  1785. if (!onlineClassesStatus && !hasOnLine && form.onlineClassesNums > 0) {
  1786. if (isShowToast) {
  1787. this.$toast("课时安排缺少线上课类型");
  1788. }
  1789. return false;
  1790. }
  1791. }
  1792. if (statusList.hasOffline) {
  1793. if (offlineClassesStatus) {
  1794. if (isShowToast) {
  1795. this.$toast("请输入线下课次数");
  1796. }
  1797. return false;
  1798. }
  1799. if (
  1800. !offlineClassesStatus &&
  1801. !hasOffLine &&
  1802. form.offlineClassesNums > 0
  1803. ) {
  1804. if (isShowToast) {
  1805. this.$toast("课时安排缺少线下课类型");
  1806. }
  1807. return false;
  1808. }
  1809. }
  1810. return true;
  1811. },
  1812. // 搜索
  1813. onSearch() {
  1814. this.params.page = 1;
  1815. this.dataList = [];
  1816. this.dataShow = true;
  1817. this.loading = true;
  1818. this.finished = false;
  1819. this.getStudent();
  1820. },
  1821. getStudent() {
  1822. let params = this.params;
  1823. queryStudentsWithTeacherByOrganId(params).then((res) => {
  1824. let result = res.data;
  1825. this.loading = false;
  1826. if (result.code == 200) {
  1827. params.page = result.data.pageNo;
  1828. this.dataList = this.dataList.concat(result.data.rows);
  1829. if (params.page >= result.data.totalPage) {
  1830. this.finished = true;
  1831. }
  1832. this.params.page++;
  1833. } else {
  1834. this.finished = true;
  1835. }
  1836. // 判断是否有数据
  1837. if (this.dataList.length <= 0) {
  1838. this.dataShow = false;
  1839. }
  1840. });
  1841. },
  1842. onPopupCancel() {
  1843. // 关闭弹窗
  1844. this.statusList.studentStatus = false;
  1845. // this.params.search = null
  1846. this.checkboxSelect = [];
  1847. this.checkboxSelectList = [];
  1848. },
  1849. onPopupSubmit() {
  1850. const vipGroupCategorySelect = this.loadData.vipGroupCategorySelect;
  1851. const compareNum = this.courseTypeVip ? vipGroupCategorySelect.studentNum : 1
  1852. console.log(compareNum)
  1853. if (this.checkboxSelect.length != compareNum) {
  1854. this.$toast(
  1855. `请选择学生${compareNum}名,当前选择${this.checkboxSelect.length}名`
  1856. );
  1857. return;
  1858. }
  1859. this.checkboxSelectDataList = JSON.parse(
  1860. JSON.stringify(this.checkboxSelectList)
  1861. );
  1862. this.checkboxSelectIds = JSON.parse(JSON.stringify(this.checkboxSelect));
  1863. this.checkboxSelect = [];
  1864. this.checkboxSelectList = [];
  1865. this.loadData.vipGroupActivitySelect = {}
  1866. this.loadData.vipGroupActivity = [];
  1867. this.formName.vipGroupActivityName = null;
  1868. this.formName.vipGroupCategoryIndex = 0;
  1869. this.form.vipGroupActivityId = null;
  1870. this.statusList.studentStatus = false;
  1871. // 每次切换学生,重置活动方案后,非网管课需要重置线上,线下课
  1872. if (this.courseTypeName != '网管课') {
  1873. this.statusList.hasOffline = true;
  1874. }
  1875. // this.loadData.vipGroupActivitySelect.maxCourseNum = 0
  1876. // this.loadData.vipGroupActivitySelect.minCourseNum = 0
  1877. // console.log(this.loadData.vipGroupActivitySelect)
  1878. this.getCalcClass()
  1879. // this.form.totalCount = null
  1880. },
  1881. onCheckboxSelect(value) {
  1882. if (this.checkboxSelect.includes(value.userId.toString())) {
  1883. this.checkboxSelect.forEach((item, index) => {
  1884. if (item == value.userId.toString()) {
  1885. this.checkboxSelect.splice(index, 1);
  1886. }
  1887. });
  1888. this.checkboxSelectList.forEach((item, index) => {
  1889. if (item.userId == value.userId) {
  1890. this.checkboxSelectList.splice(index, 1);
  1891. }
  1892. });
  1893. } else {
  1894. this.checkboxSelect.push(value.userId.toString());
  1895. this.checkboxSelectList.push(value);
  1896. }
  1897. // checkboxSelect = item.userId
  1898. },
  1899. desensitPhone(phone) {
  1900. // 手机号脱敏
  1901. let first = phone.substr(0, 3);
  1902. let last = phone.substr(-4);
  1903. return first + "****" + last;
  1904. },
  1905. },
  1906. computed: {
  1907. courseTypeVip() {
  1908. return this.courseType == 'VIP' ? true : false
  1909. },
  1910. courseTypePractice() {
  1911. return this.courseType == 'PRACTICE' ? true : false
  1912. }
  1913. }
  1914. };
  1915. </script>
  1916. <style lang='less' scoped>
  1917. @import url("../../assets/commonLess/variable.less");
  1918. .vipapply {
  1919. overflow: hidden;
  1920. }
  1921. .vip-title {
  1922. padding: .06rem .14rem .04rem;
  1923. font-size: .14rem;
  1924. color: #808080;
  1925. }
  1926. .courseTips {
  1927. font-size: 0.13rem;
  1928. padding: 10px 16px;
  1929. background: #f3f4f8;
  1930. & > span {
  1931. color: red;
  1932. }
  1933. }
  1934. .add-plan {
  1935. display: flex;
  1936. align-items: center;
  1937. justify-content: center;
  1938. padding: 0.2rem 0;
  1939. font-size: 0.16rem;
  1940. color: @tFontColor;
  1941. .van-icon {
  1942. margin-right: 0.05rem;
  1943. font-size: 0.2rem;
  1944. }
  1945. }
  1946. .title-time {
  1947. display: flex;
  1948. align-items: center;
  1949. flex: 1 auto;
  1950. color: #4a4a4a;
  1951. .online {
  1952. color: @tFontColor;
  1953. }
  1954. .week {
  1955. padding-left: 0.4rem;
  1956. padding-right: 0.15rem;
  1957. }
  1958. }
  1959. // /deep/.van-field__label,
  1960. // /deep/.van-cell__value {
  1961. // // flex: 1 auto;
  1962. // }
  1963. /deep/.van-field__label {
  1964. width: 50%;
  1965. }
  1966. /deep/.van-field__control:disabled {
  1967. color: #6a6969;
  1968. }
  1969. .button-group {
  1970. margin: 0.3rem 0.26rem 0.2rem;
  1971. .van-button--primary {
  1972. background: @mColor;
  1973. border-color: @mColor;
  1974. font-size: 0.18rem;
  1975. }
  1976. }
  1977. .van-row {
  1978. line-height: 0.4rem;
  1979. border-top: 1px solid #edeef0;
  1980. text-align: center;
  1981. font-size: 0.14rem;
  1982. &:first-child {
  1983. border-top: 0;
  1984. background: #edeef0;
  1985. color: #444;
  1986. font-size: 0.15rem;
  1987. }
  1988. }
  1989. .tableContainer {
  1990. max-height: 2.44rem;
  1991. overflow: auto;
  1992. .van-row {
  1993. color: #444;
  1994. &:first-child {
  1995. border-top: 0;
  1996. background: #fff;
  1997. font-size: 0.14rem;
  1998. }
  1999. }
  2000. }
  2001. .studentContainer {
  2002. /deep/.van-cell__title {
  2003. font-size: 0.14rem;
  2004. color: @mFontColor;
  2005. flex: 1 auto;
  2006. }
  2007. .logo {
  2008. width: 0.35rem;
  2009. height: 0.35rem;
  2010. margin-right: 0.12rem;
  2011. border-radius: 100%;
  2012. }
  2013. .input-cell {
  2014. padding: 0.12rem 0.16rem 0.2rem;
  2015. .van-checkbox {
  2016. justify-content: flex-end;
  2017. }
  2018. }
  2019. /deep/.van-cell__value {
  2020. height: 0.2rem;
  2021. }
  2022. /deep/.van-checkbox__icon .van-icon {
  2023. border-color: @sFontColor;
  2024. }
  2025. /deep/.van-checkbox__icon--checked .van-icon {
  2026. border-color: #01C1B5;
  2027. }
  2028. // /deep/.van-checkbox__icon--checked {
  2029. // .van-icon {
  2030. // border-color: @orangeColor;
  2031. // background: @orangeColor;
  2032. // }
  2033. // }
  2034. .van-tag {
  2035. margin-left: 0.08rem;
  2036. }
  2037. }
  2038. .paddingB80 {
  2039. padding-bottom: 0.8rem;
  2040. }
  2041. .button-group-popup {
  2042. position: fixed;
  2043. bottom: 0;
  2044. padding: 0.2rem 0;
  2045. width: 100%;
  2046. text-align: center;
  2047. background-color: #ffffff;
  2048. .btn {
  2049. padding: 0 0.45rem;
  2050. line-height: 0.4rem;
  2051. display: inline-block;
  2052. border: 1px solid @mColor;
  2053. border-radius: 1rem;
  2054. color: @mColor;
  2055. background: #fff;
  2056. font-size: 0.18rem;
  2057. &.primary {
  2058. color: #fff;
  2059. background: @mColor;
  2060. }
  2061. }
  2062. .btn + .btn {
  2063. margin-left: 0.1rem;
  2064. }
  2065. }
  2066. .studentColor {
  2067. color: @mColor;
  2068. }
  2069. .classStudent {
  2070. font-size: .14rem !important;
  2071. }
  2072. /deep/.van-field--disabled .van-field__label,
  2073. /deep/.van-field__label {
  2074. color: #323233;
  2075. }
  2076. .courseStudent {
  2077. .van-cell__value {
  2078. color: #b2b2b2;
  2079. font-size: 0.16rem;
  2080. }
  2081. }
  2082. /deep/.studentChiose {
  2083. border-radius: 0 0 0px 0px;
  2084. overflow: auto;
  2085. }
  2086. </style>