VIP00Apply.vue 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140
  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. queryStudentsWithTeacher,
  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. data() {
  523. return {
  524. dataForm: {
  525. // 时间下拉框
  526. status: false,
  527. minDate: new Date(),
  528. maxDate: new Date(2025, 10, 1),
  529. currentDate: new Date(),
  530. },
  531. enlistForm: {
  532. // 时间下拉框
  533. updateStatus: "", // 修改哪个状态
  534. status: false,
  535. minDate: new Date(),
  536. maxDate: new Date(2025, 10, 1),
  537. currentDate: new Date(),
  538. },
  539. statusList: {
  540. // 散状态集合
  541. hasOnline: true, // 是否显示线上
  542. hasOffline: true, // 是否显示线下
  543. classTime: false, // 课表展示
  544. headerStatus: false, // 头部是否展示
  545. classTimerStatus: false, // 每课时长状态
  546. studentStatus: false, // 上课学生状态
  547. courseTypeStatus: false, // 排课类型
  548. },
  549. loadData: {
  550. // 下拉加载数据
  551. subjectList: [], // 声部列表
  552. subjectListSelect: [], // 选中的声部JSON
  553. vipGroupCategory: [], // 课程形式
  554. vipGroupCategorySelect: [], // 选中的课程形式JSON
  555. vipGroupActivity: [], // 活动文案
  556. vipGroupActivitySelect: [], // 选中的活动文案JSON
  557. teacherSchool: [], // 线下课地址
  558. teacherSchoolSelect: [], // 选中的线下课地址JSON
  559. teacherList: [], // 线下课地址
  560. teacherListSelect: [], // 选中的线下课地址JSON
  561. teacherCategory: [], // 老师课酬信息
  562. classTimer: [], // 每课时长
  563. },
  564. sheetForm: {
  565. // 上拉弹窗
  566. currentType: null, // 当前选择的类型
  567. sheetStatus: false,
  568. loading: true, // 加载数据
  569. index: 0, // 选中的索引值
  570. columns: [],
  571. },
  572. courseForm: {
  573. // 排课弹窗
  574. teachingStatus: false, // 课时安排状态
  575. columns: [
  576. {
  577. // 课程选项
  578. values: ["线上", "线下"],
  579. className: "type",
  580. },
  581. {
  582. values: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
  583. className: "week",
  584. },
  585. {
  586. values: [
  587. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
  588. ],
  589. className: "hours",
  590. defaultIndex: 7,
  591. },
  592. {
  593. values: minutes,
  594. className: "minutes",
  595. },
  596. ],
  597. },
  598. courseType: 'VIP', // VIP , PRACTICE
  599. courseTypeName: 'VIP课', // VIP , PRACTICE
  600. form: {
  601. name: null,
  602. subjectIdList: null,
  603. vipGroupCategoryId: null,
  604. vipGroupActivityId: null,
  605. teacherSchoolId: null,
  606. educationalTeacherId: null,
  607. studentNum: null,
  608. singleClassMinutes: null,
  609. onlineClassesNums: null,
  610. offlineClassesNums: null,
  611. registrationStartTime: null,
  612. coursesExpireDate: null,
  613. totalClassTime: null,
  614. courseStart: null,
  615. onlineClassesUnitPrice: null,
  616. offlineClassesUnitPrice: null,
  617. onlineTeacherSalary: null,
  618. offlineTeacherSalary: null,
  619. totalCount: null,
  620. },
  621. formName: {
  622. subjectListName: null, // 声部名称
  623. subjectListIndex: 0, // 声部名称
  624. vipGroupCategoryName: null, // 课程形式
  625. vipGroupCategoryIndex: 0, // 课程形式
  626. vipGroupActivityName: null, // 活动文案
  627. vipGroupActivityIndex: 0, // 活动文案
  628. teacherSchoolName: null, // 线下课地址
  629. teacherSchoolIndex: 0, // 线下课地址
  630. educationalTeacherName: null, // 乐团主管
  631. educationalTeacherIndex: 0,
  632. },
  633. other: {
  634. onlineSalary: null, // 线上课课酬结算方式
  635. offlineSalary: null, // 线下课课酬结算方式
  636. },
  637. scheduleList: [], // 课时安排
  638. timeTable: [], // 生成的课表
  639. onSubmitStatus: true, // 点击
  640. checkboxSelect: [],
  641. checkboxSelectIds: [],
  642. checkboxSelectList: [], //选中学生列表
  643. checkboxSelectDataList: [],
  644. loading: false,
  645. finished: false,
  646. params: {
  647. search: null,
  648. page: 1,
  649. rows: 20,
  650. },
  651. dataShow: true, // 是否有数据
  652. dataList: [],
  653. salaryStatus: true, // 是否跳过课酬二次确认
  654. singleClassMinutesPrice: 0, //网管课单价
  655. singleClassMinutesSalary: 0, // 网管课课酬
  656. };
  657. },
  658. mounted() {
  659. let params = this.$route.query;
  660. if (params.Authorization) {
  661. localStorage.setItem("Authorization", decodeURI(params.Authorization));
  662. localStorage.setItem("userInfo", decodeURI(params.Authorization));
  663. }
  664. document.title = "VIP课程申请";
  665. if (browser().android) {
  666. this.headerStatus = true;
  667. }
  668. },
  669. methods: {
  670. dayjs,
  671. onCheckStudent() {
  672. if (!this.form.vipGroupCategoryId && this.courseTypeVip) {
  673. // 判断是否选择了课程形式
  674. this.$toast("请选择课程形式");
  675. return;
  676. }
  677. this.statusList.studentStatus = true;
  678. },
  679. onGetSheetList(name) {
  680. // 获取科目列表
  681. let sheetForm = this.sheetForm;
  682. sheetForm.columns = [];
  683. if (!this.form.vipGroupCategoryId && name == "vipGroupActivity" && this.courseTypeVip) {
  684. this.$toast("请选择课程形式");
  685. return;
  686. } else if (
  687. (!this.checkboxSelectDataList ||
  688. (this.checkboxSelectDataList &&
  689. this.checkboxSelectDataList.length <= 0)) &&
  690. name == "vipGroupActivity"
  691. ) {
  692. // 判断是否选择了课程形式
  693. this.$toast("请选择上课学生");
  694. return;
  695. }
  696. sheetForm.sheetStatus = true;
  697. sheetForm.loading = true;
  698. sheetForm.currentType = name;
  699. sheetForm.index = 0;
  700. let arr = this.loadData[name];
  701. if (arr.length > 0) {
  702. sheetForm.columns = arr;
  703. sheetForm.index = this.formName[name + "Index"];
  704. sheetForm.loading = false;
  705. } else {
  706. this.onLoadingData(name);
  707. }
  708. },
  709. onLoadingData() {
  710. // 加载数据
  711. let sheetForm = this.sheetForm;
  712. if (sheetForm.currentType == "subjectList") {
  713. // 声部列表
  714. findSubSubjects().then((res) => {
  715. let result = res.data;
  716. if (result.code == 200 && result.data.length > 0) {
  717. let tempArr = [];
  718. result.data.forEach((item) => {
  719. item.value = item.id;
  720. item.text = item.name;
  721. tempArr.push(item);
  722. });
  723. this.loadData.subjectList = tempArr;
  724. sheetForm.columns = tempArr;
  725. sheetForm.loading = false;
  726. } else {
  727. this.$toast("暂无科目列表");
  728. sheetForm.loading = false;
  729. }
  730. });
  731. } else if (sheetForm.currentType == "vipGroupCategory") {
  732. // 课程形式
  733. vipGroupCategory().then((res) => {
  734. let result = res.data;
  735. if (result.code == 200 && result.data.length > 0) {
  736. let tempArr = [];
  737. result.data.forEach((item) => {
  738. item.value = item.id;
  739. item.text = item.name;
  740. tempArr.push(item);
  741. });
  742. this.loadData.vipGroupCategory = tempArr;
  743. sheetForm.columns = tempArr;
  744. sheetForm.loading = false;
  745. } else {
  746. this.$toast("暂无课程形式");
  747. sheetForm.loading = false;
  748. }
  749. });
  750. } else if (sheetForm.currentType == "vipGroupActivity") {
  751. // 活动文案
  752. let studentIds = [];
  753. if (
  754. this.checkboxSelectDataList &&
  755. this.checkboxSelectDataList.length > 0
  756. ) {
  757. this.checkboxSelectDataList.forEach((item) => {
  758. studentIds.push(item.userId);
  759. });
  760. }
  761. let params = {
  762. studentIds: studentIds.join(",")
  763. }
  764. if(this.courseTypeVip) {
  765. params.categoryId = this.form.vipGroupCategoryId
  766. } else if(this.courseTypePractice) {
  767. params.courseType = 'PRACTICE'
  768. }
  769. findByVipGroupCategory(params).then((res) => {
  770. let result = res.data;
  771. if (result.code == 200 && result.data.length > 0) {
  772. let tempArr = [];
  773. result.data.forEach((item) => {
  774. item.value = item.id;
  775. item.text = item.name;
  776. (item.startTime = item.startTime
  777. ? item.startTime.split(" ")[0]
  778. : null), // 报名开始时间
  779. (item.endTime = item.endTime
  780. ? item.endTime.split(" ")[0]
  781. : null); // 报名结束时间
  782. tempArr.push(item);
  783. });
  784. this.loadData.vipGroupActivity = tempArr;
  785. sheetForm.columns = tempArr;
  786. sheetForm.loading = false;
  787. } else {
  788. this.$toast("暂无活动方案");
  789. sheetForm.loading = false;
  790. }
  791. });
  792. } else if (sheetForm.currentType == "teacherSchool") {
  793. // 教师教学点
  794. findVipSchoolByTeacher2().then((res) => {
  795. let result = res.data;
  796. if (result.code == 200 && result.data.length > 0) {
  797. let tempArr = [];
  798. result.data.forEach((item) => {
  799. item.value = item.id;
  800. item.text = item.name;
  801. tempArr.push(item);
  802. });
  803. this.loadData.teacherSchool = tempArr;
  804. sheetForm.columns = tempArr;
  805. sheetForm.loading = false;
  806. } else {
  807. this.$toast("暂无教学点");
  808. sheetForm.loading = false;
  809. }
  810. });
  811. } else if (sheetForm.currentType == "teacherList") {
  812. // 乐团主管
  813. findEducationUsers().then((res) => {
  814. let result = res.data;
  815. if (result.code == 200 && result.data.length > 0) {
  816. let tempArr = [];
  817. result.data.forEach((item) => {
  818. item.value = item.userId;
  819. item.text = item.userName;
  820. tempArr.push(item);
  821. });
  822. this.loadData.teacherList = tempArr;
  823. sheetForm.columns = tempArr;
  824. sheetForm.loading = false;
  825. } else {
  826. this.$toast("暂无乐团主管");
  827. sheetForm.loading = false;
  828. }
  829. });
  830. }
  831. },
  832. findTeacherCategory(id) {
  833. // 获取教师课酬
  834. findByTeacherAndCategory({
  835. categoryId: id,
  836. }).then((res) => {
  837. let result = res.data;
  838. if (result.code == 200) {
  839. this.loadData.teacherCategory = result.data;
  840. }
  841. });
  842. },
  843. onSheetConfirm(value, index) {
  844. // 上拉弹窗
  845. let sheetForm = this.sheetForm,
  846. form = this.form,
  847. formName = this.formName,
  848. loadData = this.loadData;
  849. if (sheetForm.currentType == "subjectList") {
  850. // 科目名称赋值
  851. form.subjectIdList = value.value;
  852. formName.subjectListName = value.text;
  853. formName.subjectListIndex = index;
  854. loadData.subjectListSelect = value;
  855. } else if (sheetForm.currentType == "vipGroupCategory") {
  856. // 课程形式赋值
  857. if (loadData.vipGroupCategorySelect.id != value.id) {
  858. // 获取教师课酬
  859. this.findTeacherCategory(value.id);
  860. }
  861. form.vipGroupCategoryId = value.value;
  862. formName.vipGroupCategoryName = value.text;
  863. formName.vipGroupCategoryIndex = index;
  864. loadData.vipGroupCategorySelect = value;
  865. form.studentNum = value.studentNum; // 每班人数
  866. // form.singleClassMinutes = value.singleClassMinutes // 每课时长
  867. form.onlineClassesUnitPrice = Math.ceil(value.onlineClassesUnitPrice);
  868. // this.onlineUnitPrice = Math.ceil(value.onlineClassesUnitPrice)
  869. form.offlineClassesUnitPrice = Math.ceil(value.offlineClassesUnitPrice);
  870. // this.offLineUnitPrice = Math.ceil(value.offlineClassesUnitPrice)
  871. // 每课时长赋值
  872. form.singleClassMinutes = null;
  873. loadData.classTimer = [];
  874. let tempSingle = value.singleClassMinutes.split(",");
  875. tempSingle.forEach((item) => {
  876. this.loadData.classTimer.push({
  877. name: item,
  878. value: item,
  879. });
  880. });
  881. // 重置上课学生
  882. this.checkboxSelect = [];
  883. this.checkboxSelectIds = [];
  884. this.checkboxSelectList = []; //选中学生列表
  885. this.checkboxSelectDataList = [];
  886. // 重置活动文案
  887. form.vipGroupActivityId = null;
  888. formName.vipGroupActivityName = null;
  889. formName.vipGroupActivityIndex = 0;
  890. loadData.vipGroupActivity = [];
  891. loadData.vipGroupActivitySelect = [];
  892. } else if (sheetForm.currentType == "vipGroupActivity") {
  893. // 活动方案赋值
  894. // 重置线上课,线下课次数
  895. if (form.vipGroupActivityId != value.value) {
  896. form.offlineClassesNums = null;
  897. form.onlineClassesNums = null;
  898. }
  899. form.vipGroupActivityId = value.value;
  900. formName.vipGroupActivityName = value.text;
  901. formName.vipGroupActivityIndex = index;
  902. loadData.vipGroupActivitySelect = value;
  903. // 换活动之后单价重置
  904. form.onlineClassesUnitPrice = Math.ceil(
  905. loadData.vipGroupCategorySelect.onlineClassesUnitPrice || 0
  906. );
  907. form.offlineClassesUnitPrice = Math.ceil(
  908. loadData.vipGroupCategorySelect.offlineClassesUnitPrice || 0
  909. );
  910. form.singleClassMinutes = value.singleCourseTime
  911. if(this.courseTypeVip) {
  912. this.onCalcClassTimes(value); // 计算时间等.........
  913. } else {
  914. }
  915. this.getCalcClass(); // 课酬计算
  916. this.setTimeTable(); // 重新排课
  917. // 时间安排
  918. // form.registrationStartTime = value.startTime
  919. // form.coursesExpireDate = value.endTime
  920. } else if (sheetForm.currentType == "teacherSchool") {
  921. // 线下课地址
  922. form.teacherSchoolId = value.value;
  923. formName.teacherSchoolName = value.text;
  924. formName.teacherSchoolIndex = index;
  925. } else if (sheetForm.currentType == "teacherList") {
  926. // 乐团主管
  927. form.educationalTeacherId = value.value;
  928. formName.educationalTeacherName = value.text;
  929. formName.educationalTeacherIndex = index;
  930. }
  931. sheetForm.sheetStatus = false;
  932. },
  933. onClassKeyUp(type) {
  934. // 线上课&线下课修改时
  935. if (type == "offLine" && this.form.offlineClassesNums <= 0) {
  936. this.form.teacherSchoolId = null;
  937. this.formName.teacherSchoolName = null;
  938. this.formName.teacherSchoolIndex = 0;
  939. }
  940. let vas = this.loadData.vipGroupActivitySelect;
  941. this.onCalcClassTimes(vas);
  942. this.getCalcClass();
  943. this.setTimeTable();
  944. },
  945. onCalcClassTimes(vas) {
  946. // 计算课时总数
  947. let form = this.form,
  948. statusList = this.statusList;
  949. let totalCount = Number(form.onlineClassesNums) + Number(form.offlineClassesNums);
  950. // 获取总课次
  951. form.totalClassTime = totalCount
  952. // teachMode -1:所有;0:线上;1:线下
  953. // 设置是否有对的类型的课
  954. switch(vas.teachMode) {
  955. case -1:
  956. statusList.hasOffline = true;
  957. statusList.hasOnline = true;
  958. break;
  959. case 0:
  960. statusList.hasOnline = true;
  961. statusList.hasOffline = false;
  962. break;
  963. case 1:
  964. statusList.hasOnline = false;
  965. statusList.hasOffline = true;
  966. break;
  967. default:
  968. break;
  969. }
  970. },
  971. async onCourseTypeSelect(value) {
  972. // 课程类型
  973. this.statusList.courseTypeStatus = false
  974. if(value.value == this.courseType) return
  975. this.courseType = value.value
  976. this.courseTypeName = value.name
  977. let form = this.form,
  978. formName = this.formName,
  979. loadData = this.loadData
  980. // 课程形式重置
  981. form.vipGroupCategoryId = null
  982. formName.vipGroupCategoryName = null
  983. formName.vipGroupCategoryIndex = 0
  984. // 重置上课学生
  985. this.checkboxSelect = [];
  986. this.checkboxSelectIds = [];
  987. this.checkboxSelectList = []; //选中学生列表
  988. this.checkboxSelectDataList = [];
  989. // 重置活动文案
  990. form.vipGroupActivityId = null;
  991. formName.vipGroupActivityName = null;
  992. formName.vipGroupActivityIndex = 0;
  993. loadData.vipGroupActivity = [];
  994. loadData.vipGroupActivitySelect = [];
  995. // 更新每课时长
  996. form.singleClassMinutes = null
  997. // 课时总数
  998. form.totalClassTime = null
  999. form.offlineClassesNums = null
  1000. form.onlineClassesNums = null
  1001. this.scheduleList = [] // 清空课时安排
  1002. if(value.value == 'VIP') {
  1003. this.courseForm.columns[0].values = ["线上", "线下"]
  1004. form.studentNum = null
  1005. form.onlineClassesUnitPrice = 0
  1006. form.onlineTeacherSalary = 0
  1007. this.statusList.hasOnline = true
  1008. this.statusList.hasOffline = true
  1009. this.getCalcClass();
  1010. } else if(value.value == 'PRACTICE') {
  1011. this.courseForm.columns[0].values = ["线上"]
  1012. // 重置地址数据
  1013. this.form.teacherSchoolId = null;
  1014. this.formName.teacherSchoolName = null;
  1015. this.formName.teacherSchoolIndex = 0;
  1016. // 每班人数 (网管课固定1人)
  1017. form.studentNum = 1
  1018. loadData.classTimer = [{ name: 25, value: 25 }];
  1019. this.statusList.hasOnline = false
  1020. this.statusList.hasOffline = false
  1021. this.getCalcClass();
  1022. // 判断是否已经有金额了
  1023. if(!this.singleClassMinutesPrice) {
  1024. await queryPracticeGroupSellPrice().then(res => {
  1025. let result = res.data
  1026. if(result.code == 200) {
  1027. this.singleClassMinutesPrice = result.data.singleClassMinutesPrice || 0
  1028. }
  1029. })
  1030. }
  1031. if(!this.singleClassMinutesSalary) {
  1032. await getPracticeGroupCostCount().then(res => {
  1033. const result = res.data
  1034. if(result.code == 200) {
  1035. this.singleClassMinutesSalary = result.data.onlineTeacherSalary || 0
  1036. }
  1037. })
  1038. }
  1039. }
  1040. },
  1041. onClickSingleClass() {
  1042. if (!this.formName.vipGroupCategoryName && this.courseTypeVip) {
  1043. this.$toast("请选择课程形式");
  1044. return;
  1045. }
  1046. // 如果选择了活动则,课时不能选择
  1047. if(this.form.vipGroupActivityId) return
  1048. this.statusList.classTimerStatus = true;
  1049. },
  1050. onClassTimerSelect(value) {
  1051. // 每课时长设置
  1052. this.form.singleClassMinutes = value.value;
  1053. this.statusList.classTimerStatus = false;
  1054. this.getCalcClass();
  1055. },
  1056. onCurrentConfirm(value) {
  1057. // 排课开始时间
  1058. let selectDate = new Date(value);
  1059. let tempMonth =
  1060. selectDate.getMonth() + 1 >= 10
  1061. ? selectDate.getMonth() + 1
  1062. : "0" + (selectDate.getMonth() + 1);
  1063. let tempDay =
  1064. selectDate.getDate() >= 10
  1065. ? selectDate.getDate()
  1066. : "0" + selectDate.getDate();
  1067. this.form.courseStart =
  1068. selectDate.getFullYear() + "-" + tempMonth + "-" + tempDay;
  1069. this.dataForm.status = false;
  1070. },
  1071. onEnlistConfirm(value) {
  1072. // 报名开始/结束时间
  1073. let selectDate = new Date(value);
  1074. let tempMonth =
  1075. selectDate.getMonth() + 1 >= 10
  1076. ? selectDate.getMonth() + 1
  1077. : "0" + (selectDate.getMonth() + 1);
  1078. let tempDay =
  1079. selectDate.getDate() >= 10
  1080. ? selectDate.getDate()
  1081. : "0" + selectDate.getDate();
  1082. let enlistForm = this.enlistForm;
  1083. let form = this.form;
  1084. if (enlistForm.updateStatus == "start") {
  1085. form.registrationStartTime =
  1086. selectDate.getFullYear() + "-" + tempMonth + "-" + tempDay;
  1087. if (form.coursesExpireDate) {
  1088. let temps = new Date(
  1089. form.registrationStartTime.replace(/-/gi, "/")
  1090. ).getTime();
  1091. let tempe = new Date(
  1092. form.coursesExpireDate.replace(/-/gi, "/")
  1093. ).getTime();
  1094. // 如果开始时间大于结束时间,结束时间制空
  1095. if (temps > tempe) {
  1096. form.coursesExpireDate = null;
  1097. }
  1098. }
  1099. } else if (enlistForm.updateStatus == "end") {
  1100. form.coursesExpireDate =
  1101. selectDate.getFullYear() + "-" + tempMonth + "-" + tempDay;
  1102. }
  1103. enlistForm.status = false;
  1104. },
  1105. onEnListShow(type, value) {
  1106. // 报名开始/截止时间
  1107. let enlistForm = this.enlistForm;
  1108. if (type == "end") {
  1109. if (this.form.registrationStartTime) {
  1110. enlistForm.minDate = new Date(this.form.registrationStartTime.replace(/-/gi, "/"));
  1111. } else {
  1112. enlistForm.minDate = new Date();
  1113. }
  1114. } else if (type == "start") {
  1115. // 开始时默认为当前时间
  1116. enlistForm.minDate = new Date();
  1117. }
  1118. if (value) {
  1119. enlistForm.currentDate = new Date(value.replace(/-/gi, "/"));
  1120. } else {
  1121. enlistForm.currentDate = new Date();
  1122. }
  1123. enlistForm.updateStatus = type;
  1124. enlistForm.status = true;
  1125. },
  1126. onCourseShedule() {
  1127. // 课时安排
  1128. if (!this.form.singleClassMinutes) {
  1129. this.$toast("请选每课时长");
  1130. return;
  1131. }
  1132. if (!this.form.courseStart) {
  1133. this.$toast("请选择排课开始时间");
  1134. return;
  1135. }
  1136. this.courseForm.teachingStatus = true;
  1137. },
  1138. onScheduleRemove(item) {
  1139. // 删除课程安排
  1140. this.$dialog.confirm({
  1141. title: '提示',
  1142. message: '是否删除该课时安排?',
  1143. confirmButtonText: '确定',
  1144. confirmButtonColor: '#269a93',
  1145. cancelButtonText: '取消'
  1146. }).then(() => {
  1147. let index = this.scheduleList.indexOf(item);
  1148. if (index !== -1) {
  1149. this.scheduleList.splice(index, 1);
  1150. }
  1151. })
  1152. },
  1153. onTeachinConfirm(value) {
  1154. // 添加课程
  1155. let scheduleList = this.scheduleList;
  1156. let startTime =
  1157. (value[2] >= 10 ? value[2] : "0" + value[2]) +
  1158. ":" +
  1159. value[3].split("分")[0];
  1160. let endTime = this.MinutesTest(
  1161. value[2],
  1162. value[3],
  1163. this.form.singleClassMinutes
  1164. );
  1165. let isAdd = true;
  1166. scheduleList.forEach((item) => {
  1167. let isStartTime = this.timeIsrange(startTime, endTime, item.startTime);
  1168. let isEndTime = this.timeIsrange(startTime, endTime, item.endTime);
  1169. if (isAdd) {
  1170. //
  1171. if (value[1] == item.weekStr) {
  1172. if (isStartTime || isEndTime) {
  1173. isAdd = false;
  1174. } else {
  1175. isAdd = true;
  1176. }
  1177. } else if (value[1] != item.weekStr) {
  1178. isAdd = true;
  1179. }
  1180. }
  1181. });
  1182. if (isAdd) {
  1183. // 判断时间范围是否有重复
  1184. scheduleList.push({
  1185. type: value[0], // 线上还是线下
  1186. weekStr: value[1],
  1187. weekIndex: this.getWeek(value[1]),
  1188. startTime: startTime,
  1189. endTime: endTime,
  1190. id: Date.now(),
  1191. });
  1192. // scheduleList.sort((a, b) => {
  1193. // return a.weekStr
  1194. // })
  1195. this.courseForm.teachingStatus = false;
  1196. this.setTimeTable();
  1197. } else {
  1198. this.$toast("该时间段已排课请重选时间");
  1199. return;
  1200. }
  1201. },
  1202. onShowTimeTable() {
  1203. // 显示排课列表
  1204. if (!this.checkCourseList()) {
  1205. return;
  1206. }
  1207. this.statusList.classTime = true;
  1208. this.setTimeTable();
  1209. },
  1210. setTimeTable() {
  1211. if (!this.checkCourseList(false)) {
  1212. return;
  1213. }
  1214. // 重置排课列表
  1215. this.timeTable = [];
  1216. let form = this.form,
  1217. scheduleList = this.scheduleList;
  1218. // 拿到线上课数与线下课数 以及
  1219. let online = parseInt(form.onlineClassesNums || 0);
  1220. let offline = parseInt(form.offlineClassesNums || 0);
  1221. // 网管课默认只有线上课次
  1222. if(this.courseTypePractice) {
  1223. online = parseInt(form.totalClassTime || 0)
  1224. }
  1225. // 判断是否有课程安排
  1226. if (scheduleList.length <= 0) {
  1227. return;
  1228. }
  1229. let totalCount = Number(online) + Number(offline);
  1230. let tempCourseStart = form.courseStart.replace(/-/gi, "/");
  1231. let dateOperation = new Date(tempCourseStart);
  1232. let forMark = 0;
  1233. while (totalCount && totalCount > 0) {
  1234. for (let i = 0; i < scheduleList.length; i++) {
  1235. // console.log(totalCount, scheduleList)
  1236. if (online == 0 && offline == 0) break;
  1237. let num = scheduleList[i].weekIndex - dateOperation.getDay();
  1238. // 如果是同一天一个周期会出现排课都排到一天
  1239. if (forMark > 0 && num == 0 && i == 0) {
  1240. num = num + 7;
  1241. }
  1242. if (num < 0) {
  1243. // 如果为负数则为下周
  1244. num = num + 7;
  1245. }
  1246. let dataStr = this.getThinkDate(dateOperation, num);
  1247. // 判断是否大于当前时间
  1248. let nowGetTime = new Date().getTime();
  1249. let courseTime = new Date(
  1250. dataStr.replace(/-/gi, "/") +
  1251. " " +
  1252. scheduleList[i].startTime +
  1253. ":00"
  1254. ).getTime();
  1255. if (nowGetTime < courseTime) {
  1256. let tempArr = {
  1257. classDate: dataStr,
  1258. startClassTimeStr: scheduleList[i].startTime,
  1259. endClassTimeStr: scheduleList[i].endTime,
  1260. };
  1261. // console.log(scheduleList[i].type, online, offline)
  1262. if (scheduleList[i].type == "线上" && online > 0) {
  1263. tempArr.teachMode = "ONLINE";
  1264. this.timeTable.push(tempArr);
  1265. online--;
  1266. totalCount--;
  1267. } else if (scheduleList[i].type == "线下" && offline > 0) {
  1268. tempArr.teachMode = "OFFLINE";
  1269. this.timeTable.push(tempArr);
  1270. offline--;
  1271. totalCount--;
  1272. }
  1273. }
  1274. }
  1275. // 加一周
  1276. if (scheduleList.length == 1) {
  1277. dateOperation.setDate(dateOperation.getDate() + 7);
  1278. } else if (
  1279. scheduleList.every((item) => item.weekStr === scheduleList[0].weekStr)
  1280. ) {
  1281. // 标记循环次数(标记判断课程安排是不是同一天)
  1282. forMark++;
  1283. }
  1284. }
  1285. this.timeTable.sort((a, b) => {
  1286. let aStr = dayjs(dayjs(a.classDate).format("YYYY-MM-DD") + " " + a.startClassTimeStr + ":00").valueOf();
  1287. let bStr = dayjs(dayjs(b.classDate).format("YYYY-MM-DD") + " " + b.startClassTimeStr + ":00").valueOf();
  1288. return aStr - bStr;
  1289. });
  1290. // console.log(this.timeTable)
  1291. },
  1292. getCalcClass() {
  1293. // 计算课酬
  1294. let loadData = this.loadData;
  1295. let form = this.form;
  1296. let vas = loadData.vipGroupActivitySelect, // 活动
  1297. // vcs = loadData.vipGroupCategorySelect, // 课程形式
  1298. tc = loadData.teacherCategory, // 老师基本信息
  1299. oncn = form.onlineClassesNums ? form.onlineClassesNums : 0, // 线上课次数
  1300. offcn = form.offlineClassesNums ? form.offlineClassesNums : 0 // 线下课次数
  1301. // 网管课默认只有线上课次
  1302. if(this.courseTypePractice) {
  1303. oncn = parseInt(form.totalClassTime || 0)
  1304. }
  1305. // 优惠活动(如果没有则原价),可以为0,之前可以为空
  1306. const discount = (typeof vas.discount !== 'number' ? 100 : vas.discount) / 100
  1307. // 重置老师默认网管课金额
  1308. if(this.courseTypePractice) {
  1309. //老师课酬
  1310. form.onlineTeacherSalary = Math.round(this.singleClassMinutesSalary)
  1311. // 课程单价
  1312. form.onlineClassesUnitPrice = Math.round(this.singleClassMinutesPrice)
  1313. }
  1314. // ...
  1315. if (vas.salarySettlementJson) {
  1316. let obj = JSON.parse(vas.salarySettlementJson);
  1317. // 课程按课来计算
  1318. if(this.courseTypeVip) {
  1319. // 所有的课酬都取线下
  1320. if(obj && obj.vipOfflineSalarySettlement) {
  1321. let voss = obj.vipOfflineSalarySettlement
  1322. if(voss.salarySettlementType == 'TEACHER_DEFAULT') {
  1323. form.onlineTeacherSalary = Number(tc.offlineClassesSalary)
  1324. form.offlineTeacherSalary = Number(tc.offlineClassesSalary)
  1325. } else if(voss.salarySettlementType == 'FIXED_SALARY') {
  1326. form.onlineTeacherSalary = Number(voss.settlementValue)
  1327. form.offlineTeacherSalary = Number(voss.settlementValue)
  1328. }
  1329. } else {
  1330. form.onlineTeacherSalary = Number(tc.offlineClassesSalary)
  1331. form.offlineTeacherSalary = Number(tc.offlineClassesSalary)
  1332. }
  1333. } else if(this.courseTypePractice) {
  1334. // //老师课酬
  1335. if(obj && obj.practiceSalarySettlement) {
  1336. let pss = obj.practiceSalarySettlement
  1337. if(pss.salarySettlementType == 'TEACHER_DEFAULT') {
  1338. form.onlineTeacherSalary = Number(this.singleClassMinutesSalary)
  1339. } else if(pss.salarySettlementType == 'FIXED_SALARY') {
  1340. form.onlineTeacherSalary = Number(pss.settlementValue)
  1341. }
  1342. } else {
  1343. form.onlineTeacherSalary = Number(this.singleClassMinutesSalary)
  1344. }
  1345. }
  1346. } else {
  1347. if(this.courseTypeVip) {
  1348. form.onlineTeacherSalary = Number(tc.offlineClassesSalary)
  1349. form.offlineTeacherSalary = Number(tc.offlineClassesSalary)
  1350. }
  1351. }
  1352. let totalCount = 0
  1353. if(this.courseTypeVip) {
  1354. totalCount = Math.ceil(Math.ceil(((oncn * form.onlineClassesUnitPrice + offcn * form.offlineClassesUnitPrice) * discount) * 10000) / 10000);
  1355. } else {
  1356. totalCount = Math.ceil(Math.ceil(((oncn * form.onlineClassesUnitPrice) * discount) * 10000) / 10000);
  1357. }
  1358. form.totalCount = Number(totalCount);
  1359. },
  1360. getThinkDate(date, num) {
  1361. let Stamp = date;
  1362. Stamp.setDate(date.getDate() + num); // 获取当前月数的第几天
  1363. var year = Stamp.getFullYear(); //获取完整的年份(4位,1970-????)
  1364. var month = Stamp.getMonth() + 1; //获取当前月份(0-11,0代表1月)
  1365. var mvar = "";
  1366. if (month < 10) {
  1367. mvar = "0" + month;
  1368. } else {
  1369. mvar = month + "";
  1370. }
  1371. var day = Stamp.getDate();
  1372. var dvar = "";
  1373. if (day < 10) {
  1374. dvar = "0" + day;
  1375. } else {
  1376. dvar = day + "";
  1377. }
  1378. return year + "-" + mvar + "-" + dvar;
  1379. },
  1380. // 分钟小时相加减
  1381. MinutesTest(houer, mins, interval) {
  1382. let min = mins.split("分")[0];
  1383. let sdate1 = new Date(1900, 1, 1, houer, min);
  1384. sdate1.setMinutes(sdate1.getMinutes() + parseInt(interval));
  1385. let H = sdate1.getHours();
  1386. let M = sdate1.getMinutes();
  1387. if (H < 10) H = "0" + H;
  1388. if (M < 10) M = "0" + M;
  1389. return H + ":" + M;
  1390. },
  1391. // 判断时间是否在时间段内
  1392. timeIsrange(beginTime, endTime, nowTime) {
  1393. var strb = beginTime.split(":");
  1394. if (strb.length != 2) {
  1395. return false;
  1396. }
  1397. var stre = endTime.split(":");
  1398. if (stre.length != 2) {
  1399. return false;
  1400. }
  1401. var strn = nowTime.split(":");
  1402. if (stre.length != 2) {
  1403. return false;
  1404. }
  1405. var b = new Date();
  1406. var e = new Date();
  1407. var n = new Date();
  1408. b.setHours(strb[0]);
  1409. b.setMinutes(strb[1]);
  1410. e.setHours(stre[0]);
  1411. e.setMinutes(stre[1]);
  1412. n.setHours(strn[0]);
  1413. n.setMinutes(strn[1]);
  1414. if (n.getTime() - b.getTime() >= 0 && n.getTime() - e.getTime() <= 0) {
  1415. // 在时间范围内
  1416. return true;
  1417. } else {
  1418. // 不在时间范围内
  1419. return false;
  1420. }
  1421. },
  1422. getWeek(str) {
  1423. // 获取周几索引值
  1424. let template = {
  1425. 周一: 1,
  1426. 周二: 2,
  1427. 周三: 3,
  1428. 周四: 4,
  1429. 周五: 5,
  1430. 周六: 6,
  1431. 周日: 0,
  1432. };
  1433. return template[str];
  1434. },
  1435. formatter(type, value) {
  1436. if (type === "year") {
  1437. return `${value}年`;
  1438. } else if (type === "month") {
  1439. return `${value}月`;
  1440. } else if (type === "day") {
  1441. return `${value}日`;
  1442. }
  1443. return value;
  1444. },
  1445. async onSubmit(allowOverstepActivityStudentNum) {
  1446. // 次数限制是否可以继续创建
  1447. let form = this.form;
  1448. let statusList = this.statusList;
  1449. // if (!(form.name)) {
  1450. // this.$toast('请输入课程班名称')
  1451. // return false
  1452. // }
  1453. if (!form.subjectIdList) {
  1454. this.$toast("请选择科目");
  1455. return false;
  1456. }
  1457. if (!form.vipGroupCategoryId && this.courseTypeVip) {
  1458. this.$toast("请选择课程形式");
  1459. return false;
  1460. }
  1461. if (!form.educationalTeacherId) {
  1462. this.$toast("请选择乐团主管");
  1463. return;
  1464. }
  1465. if (this.checkboxSelectIds.length <= 0) {
  1466. this.$toast("请选择上课学生");
  1467. return;
  1468. }
  1469. // if (!form.vipGroupActivityId && this.courseTypeVip) {
  1470. // this.$toast("请选择活动方案");
  1471. // return false;
  1472. // }
  1473. if (!form.singleClassMinutes) {
  1474. this.$toast("请选择每课时长");
  1475. return false;
  1476. }
  1477. let onlineClassesStatus =
  1478. !form.onlineClassesNums && form.onlineClassesNums <= 0 ? true : false;
  1479. let offlineClassesStatus =
  1480. !form.offlineClassesNums && form.offlineClassesNums <= 0 ? true : false;
  1481. if (statusList.hasOnline) {
  1482. if (onlineClassesStatus) {
  1483. this.$toast("请输入线上课次数");
  1484. return false;
  1485. }
  1486. }
  1487. if (statusList.hasOffline) {
  1488. if (offlineClassesStatus) {
  1489. this.$toast("请输入线下课次数");
  1490. return false;
  1491. }
  1492. // 判断是否有线下
  1493. if (form.offlineClassesNums > 0 && !form.teacherSchoolId) {
  1494. this.$toast("请选择线下课地址");
  1495. return false;
  1496. }
  1497. }
  1498. // 判断课时总数
  1499. if(form.totalClassTime <= 0) {
  1500. this.$toast('请输入线上/线下课次数')
  1501. return false;
  1502. }
  1503. if (!form.registrationStartTime) {
  1504. this.$toast("请选择报名开始时间");
  1505. return false;
  1506. }
  1507. if (!form.coursesExpireDate) {
  1508. this.$toast("请选择报名结束时间");
  1509. return false;
  1510. }
  1511. if (this.scheduleList.length <= 0) {
  1512. this.$toast("课时安排不能为空");
  1513. return false;
  1514. }
  1515. let vipGroupActivitySelect = this.loadData.vipGroupActivitySelect;
  1516. if (vipGroupActivitySelect.minCourseNum > 0 && vipGroupActivitySelect.maxCourseNum > 0) {
  1517. // debugger
  1518. let tempCourseCount = Number(form.totalClassTime) || parseInt(form.onlineClassesNums || 0) + parseInt(form.offlineClassesNums || 0);
  1519. if (
  1520. vipGroupActivitySelect.minCourseNum > tempCourseCount ||
  1521. tempCourseCount > vipGroupActivitySelect.maxCourseNum
  1522. ) {
  1523. this.$toast(
  1524. `课时总数为${vipGroupActivitySelect.minCourseNum}~${vipGroupActivitySelect.maxCourseNum}节`
  1525. );
  1526. return;
  1527. }
  1528. }
  1529. if (!this.checkCourseList()) {
  1530. return;
  1531. }
  1532. // 排课
  1533. this.setTimeTable();
  1534. // 如果线上和线下课酬都为0时
  1535. if (statusList.hasOnline && statusList.hasOffline) {
  1536. if (
  1537. form.onlineClassesNums > 0 &&
  1538. form.onlineTeacherSalary <= 0 &&
  1539. form.offlineClassesNums > 0 &&
  1540. form.offlineTeacherSalary <= 0 &&
  1541. this.salaryStatus
  1542. ) {
  1543. this.$dialog
  1544. .confirm({
  1545. message: "当前课程课酬预计为0,是否继续?",
  1546. })
  1547. .then(() => {
  1548. this.salaryStatus = false;
  1549. this.onSubmit();
  1550. });
  1551. return;
  1552. }
  1553. }
  1554. if (statusList.hasOnline) {
  1555. if (!form.onlineClassesUnitPrice) {
  1556. this.$toast("请输入线上课单价");
  1557. return false;
  1558. }
  1559. if (!form.onlineTeacherSalary) {
  1560. this.$toast("请输入线上课课酬");
  1561. return false;
  1562. }
  1563. if (
  1564. form.onlineClassesNums > 0 &&
  1565. form.onlineTeacherSalary <= 0 &&
  1566. this.salaryStatus
  1567. ) {
  1568. this.$dialog
  1569. .confirm({
  1570. message: "当前课程线上课酬预计为0,是否继续?",
  1571. })
  1572. .then(() => {
  1573. this.salaryStatus = false;
  1574. this.onSubmit();
  1575. });
  1576. return;
  1577. }
  1578. }
  1579. if (statusList.hasOffline) {
  1580. if (!form.offlineClassesUnitPrice) {
  1581. this.$toast("请输入线下课单价");
  1582. return false;
  1583. }
  1584. if (!form.offlineTeacherSalary) {
  1585. this.$toast("请输入线下课课酬");
  1586. return false;
  1587. }
  1588. if (
  1589. form.offlineClassesNums > 0 &&
  1590. form.offlineTeacherSalary <= 0 &&
  1591. this.salaryStatus
  1592. ) {
  1593. this.$dialog
  1594. .confirm({
  1595. message: "当前课程线下课酬预计为0,是否继续?",
  1596. })
  1597. .then(() => {
  1598. this.salaryStatus = false;
  1599. this.onSubmit();
  1600. });
  1601. return;
  1602. }
  1603. }
  1604. form.onlineClassesNum = Number(form.onlineClassesNums);
  1605. form.offlineClassesNum = Number(form.offlineClassesNums);
  1606. if(this.courseTypePractice) { //网管课等于总课次
  1607. form.onlineClassesNum = Number(form.totalClassTime)
  1608. }
  1609. form.totalClassTimes = Number(form.onlineClassesNums) +Number(form.offlineClassesNums)
  1610. form.paymentExpireDate = form.coursesExpireDate;
  1611. form.studentIdList = this.checkboxSelectIds.join(",");
  1612. form.firstStudentId = this.checkboxSelectDataList.length > 0 ? this.checkboxSelectDataList[0].userId : null;
  1613. let params = {
  1614. courseSchedules: this.timeTable
  1615. };
  1616. if (allowOverstepActivityStudentNum == 1) {
  1617. params.allowOverstepActivityStudentNum = 1;
  1618. }
  1619. if (!this.onSubmitStatus) {
  1620. return;
  1621. }
  1622. this.onSubmitStatus = false;
  1623. if(this.courseTypeVip) {
  1624. params.vipGroupApplyBaseInfo = form
  1625. await this.getVipApply(params)
  1626. } else {
  1627. params.practiceGroupApplyBaseInfoDto = form
  1628. params.practiceGroupApplyBaseInfoDto.studentId = form.studentIdList
  1629. params.practiceGroupApplyBaseInfoDto.allCourseNum = form.totalClassTime
  1630. params.practiceGroupApplyBaseInfoDto.subjectId = form.subjectIdList
  1631. await this.getPracticeApply(params)
  1632. }
  1633. },
  1634. async getVipApply(params) {
  1635. setLoading(true);
  1636. await vipGroupApply(params)
  1637. .then((res) => {
  1638. let result = res.data;
  1639. setLoading(false);
  1640. if (result.code == 200) {
  1641. this.$toast("申请成功");
  1642. setTimeout(() => {
  1643. this.onSubmitStatus = true;
  1644. if (browser().iPhone) {
  1645. window.webkit.messageHandlers.DAYA.postMessage(
  1646. JSON.stringify({
  1647. api: "back",
  1648. })
  1649. );
  1650. } else if (browser().android) {
  1651. DAYA.postMessage(
  1652. JSON.stringify({
  1653. api: "back",
  1654. })
  1655. );
  1656. } else {
  1657. this.$router.push("/business");
  1658. }
  1659. }, 500);
  1660. } else if (result.code == 206) {
  1661. this.onSubmitStatus = true;
  1662. this.salaryStatus = true;
  1663. this.$dialog
  1664. .confirm({
  1665. message: result.msg,
  1666. showConfirmButton: true,
  1667. showCancelButton: true,
  1668. confirmButtonText: "继续创建",
  1669. cancelButtonText: "取消",
  1670. })
  1671. .then(() => {
  1672. this.salaryStatus = false;
  1673. this.onSubmit(1);
  1674. });
  1675. return;
  1676. } else {
  1677. this.onSubmitStatus = true;
  1678. this.salaryStatus = true;
  1679. this.$toast(result.msg);
  1680. }
  1681. })
  1682. .catch(() => {
  1683. this.onSubmitStatus = true;
  1684. this.salaryStatus = true;
  1685. setLoading(false);
  1686. });
  1687. },
  1688. async getPracticeApply(params) {
  1689. setLoading(true);
  1690. await practiceGroupApply(params)
  1691. .then((res) => {
  1692. let result = res.data;
  1693. setLoading(false);
  1694. if (result.code == 200) {
  1695. this.$toast("申请成功");
  1696. setTimeout(() => {
  1697. this.onSubmitStatus = true;
  1698. if (browser().iPhone) {
  1699. window.webkit.messageHandlers.DAYA.postMessage(
  1700. JSON.stringify({
  1701. api: "back",
  1702. })
  1703. );
  1704. } else if (browser().android) {
  1705. DAYA.postMessage(
  1706. JSON.stringify({
  1707. api: "back",
  1708. })
  1709. );
  1710. } else {
  1711. this.$router.push("/business");
  1712. }
  1713. }, 500);
  1714. } else if (result.code == 206) {
  1715. this.onSubmitStatus = true;
  1716. this.salaryStatus = true;
  1717. this.$dialog
  1718. .confirm({
  1719. message: result.msg,
  1720. showConfirmButton: true,
  1721. showCancelButton: true,
  1722. confirmButtonText: "继续创建",
  1723. cancelButtonText: "取消",
  1724. })
  1725. .then(() => {
  1726. this.salaryStatus = false;
  1727. this.onSubmit(1);
  1728. });
  1729. return;
  1730. } else {
  1731. this.onSubmitStatus = true;
  1732. this.salaryStatus = true;
  1733. this.$toast(result.msg);
  1734. }
  1735. })
  1736. .catch(() => {
  1737. this.onSubmitStatus = true;
  1738. this.salaryStatus = true;
  1739. setLoading(false);
  1740. });
  1741. },
  1742. checkCourseList(isShowToast = true) {
  1743. let form = this.form;
  1744. let scheduleList = this.scheduleList || [];
  1745. let hasOnLine = false; // 是否有线上课时安排
  1746. let hasOffLine = false;
  1747. scheduleList.forEach((item) => {
  1748. if (item.type == "线上") {
  1749. hasOnLine = true;
  1750. }
  1751. if (item.type == "线下") {
  1752. hasOffLine = true;
  1753. }
  1754. });
  1755. let statusList = this.statusList;
  1756. let onlineClassesStatus =
  1757. !form.onlineClassesNums && form.onlineClassesNums <= 0 ? true : false;
  1758. let offlineClassesStatus =
  1759. !form.offlineClassesNums && form.offlineClassesNums <= 0 ? true : false;
  1760. if (statusList.hasOnline) {
  1761. if (onlineClassesStatus) {
  1762. if (isShowToast) {
  1763. this.$toast("请输入线上课次数");
  1764. }
  1765. return false;
  1766. }
  1767. if (!onlineClassesStatus && !hasOnLine && form.onlineClassesNums > 0) {
  1768. if (isShowToast) {
  1769. this.$toast("课时安排缺少线上课类型");
  1770. }
  1771. return false;
  1772. }
  1773. }
  1774. if (statusList.hasOffline) {
  1775. if (offlineClassesStatus) {
  1776. if (isShowToast) {
  1777. this.$toast("请输入线下课次数");
  1778. }
  1779. return false;
  1780. }
  1781. if (
  1782. !offlineClassesStatus &&
  1783. !hasOffLine &&
  1784. form.offlineClassesNums > 0
  1785. ) {
  1786. if (isShowToast) {
  1787. this.$toast("课时安排缺少线下课类型");
  1788. }
  1789. return false;
  1790. }
  1791. }
  1792. return true;
  1793. },
  1794. // 搜索
  1795. onSearch() {
  1796. this.params.page = 1;
  1797. this.dataList = [];
  1798. this.dataShow = true;
  1799. this.loading = true;
  1800. this.finished = false;
  1801. this.getStudent();
  1802. },
  1803. getStudent() {
  1804. let params = this.params;
  1805. queryStudentsWithTeacher(params).then((res) => {
  1806. let result = res.data;
  1807. this.loading = false;
  1808. if (result.code == 200) {
  1809. params.page = result.data.pageNo;
  1810. this.dataList = this.dataList.concat(result.data.rows);
  1811. if (params.page >= result.data.totalPage) {
  1812. this.finished = true;
  1813. }
  1814. this.params.page++;
  1815. } else {
  1816. this.finished = true;
  1817. }
  1818. // 判断是否有数据
  1819. if (this.dataList.length <= 0) {
  1820. this.dataShow = false;
  1821. }
  1822. });
  1823. },
  1824. onPopupCancel() {
  1825. // 关闭弹窗
  1826. this.statusList.studentStatus = false;
  1827. // this.params.search = null
  1828. this.checkboxSelect = [];
  1829. this.checkboxSelectList = [];
  1830. },
  1831. onPopupSubmit() {
  1832. const vipGroupCategorySelect = this.loadData.vipGroupCategorySelect;
  1833. const compareNum = this.courseTypeVip ? vipGroupCategorySelect.studentNum : 1
  1834. console.log(compareNum)
  1835. if (this.checkboxSelect.length != compareNum) {
  1836. this.$toast(
  1837. `请选择学生${compareNum}名,当前选择${this.checkboxSelect.length}名`
  1838. );
  1839. return;
  1840. }
  1841. this.checkboxSelectDataList = JSON.parse(
  1842. JSON.stringify(this.checkboxSelectList)
  1843. );
  1844. this.checkboxSelectIds = JSON.parse(JSON.stringify(this.checkboxSelect));
  1845. this.checkboxSelect = [];
  1846. this.checkboxSelectList = [];
  1847. this.loadData.vipGroupActivity = [];
  1848. this.formName.vipGroupActivityName = null;
  1849. this.formName.vipGroupCategoryIndex = 0;
  1850. this.form.vipGroupActivityId = null;
  1851. this.statusList.studentStatus = false;
  1852. this.loadData.vipGroupActivitySelect.maxCourseNum = 0
  1853. this.loadData.vipGroupActivitySelect.minCourseNum = 0
  1854. console.log(this.loadData.vipGroupActivitySelect)
  1855. this.form.totalCount = null
  1856. },
  1857. onCheckboxSelect(value) {
  1858. if (this.checkboxSelect.includes(value.userId.toString())) {
  1859. this.checkboxSelect.forEach((item, index) => {
  1860. if (item == value.userId.toString()) {
  1861. this.checkboxSelect.splice(index, 1);
  1862. }
  1863. });
  1864. this.checkboxSelectList.forEach((item, index) => {
  1865. if (item.userId == value.userId) {
  1866. this.checkboxSelectList.splice(index, 1);
  1867. }
  1868. });
  1869. } else {
  1870. this.checkboxSelect.push(value.userId.toString());
  1871. this.checkboxSelectList.push(value);
  1872. }
  1873. // checkboxSelect = item.userId
  1874. },
  1875. desensitPhone(phone) {
  1876. // 手机号脱敏
  1877. let first = phone.substr(0, 3);
  1878. let last = phone.substr(-4);
  1879. return first + "****" + last;
  1880. },
  1881. },
  1882. computed: {
  1883. courseTypeVip() {
  1884. return this.courseType == 'VIP' ? true : false
  1885. },
  1886. courseTypePractice() {
  1887. return this.courseType == 'PRACTICE' ? true : false
  1888. }
  1889. }
  1890. };
  1891. </script>
  1892. <style lang='less' scoped>
  1893. @import url("../../assets/commonLess/variable.less");
  1894. .vipapply {
  1895. overflow: hidden;
  1896. }
  1897. .vip-title {
  1898. padding: .06rem .14rem .04rem;
  1899. font-size: .14rem;
  1900. color: #808080;
  1901. }
  1902. .courseTips {
  1903. font-size: 0.13rem;
  1904. padding: 10px 16px;
  1905. background: #f3f4f8;
  1906. & > span {
  1907. color: red;
  1908. }
  1909. }
  1910. .add-plan {
  1911. display: flex;
  1912. align-items: center;
  1913. justify-content: center;
  1914. padding: 0.2rem 0;
  1915. font-size: 0.16rem;
  1916. color: @tFontColor;
  1917. .van-icon {
  1918. margin-right: 0.05rem;
  1919. font-size: 0.2rem;
  1920. }
  1921. }
  1922. .title-time {
  1923. display: flex;
  1924. align-items: center;
  1925. flex: 1 auto;
  1926. color: #4a4a4a;
  1927. .online {
  1928. color: @tFontColor;
  1929. }
  1930. .week {
  1931. padding-left: 0.4rem;
  1932. padding-right: 0.15rem;
  1933. }
  1934. }
  1935. // /deep/.van-field__label,
  1936. // /deep/.van-cell__value {
  1937. // // flex: 1 auto;
  1938. // }
  1939. /deep/.van-field__label {
  1940. width: 50%;
  1941. }
  1942. /deep/.van-field__control:disabled {
  1943. color: #6a6969;
  1944. }
  1945. .button-group {
  1946. margin: 0.3rem 0.26rem 0.2rem;
  1947. .van-button--primary {
  1948. background: @mColor;
  1949. border-color: @mColor;
  1950. font-size: 0.18rem;
  1951. }
  1952. }
  1953. .van-row {
  1954. line-height: 0.4rem;
  1955. border-top: 1px solid #edeef0;
  1956. text-align: center;
  1957. font-size: 0.14rem;
  1958. &:first-child {
  1959. border-top: 0;
  1960. background: #edeef0;
  1961. color: #444;
  1962. font-size: 0.15rem;
  1963. }
  1964. }
  1965. .tableContainer {
  1966. max-height: 2.44rem;
  1967. overflow: auto;
  1968. .van-row {
  1969. color: #444;
  1970. &:first-child {
  1971. border-top: 0;
  1972. background: #fff;
  1973. font-size: 0.14rem;
  1974. }
  1975. }
  1976. }
  1977. .studentContainer {
  1978. /deep/.van-cell__title {
  1979. font-size: 0.14rem;
  1980. color: @mFontColor;
  1981. flex: 1 auto;
  1982. }
  1983. .logo {
  1984. width: 0.35rem;
  1985. height: 0.35rem;
  1986. margin-right: 0.12rem;
  1987. border-radius: 100%;
  1988. }
  1989. .input-cell {
  1990. padding: 0.12rem 0.16rem 0.2rem;
  1991. .van-checkbox {
  1992. justify-content: flex-end;
  1993. }
  1994. }
  1995. /deep/.van-cell__value {
  1996. height: 0.2rem;
  1997. }
  1998. /deep/.van-checkbox__icon .van-icon {
  1999. border-color: @sFontColor;
  2000. }
  2001. /deep/.van-checkbox__icon--checked .van-icon {
  2002. border-color: #01C1B5;
  2003. }
  2004. // /deep/.van-checkbox__icon--checked {
  2005. // .van-icon {
  2006. // border-color: @orangeColor;
  2007. // background: @orangeColor;
  2008. // }
  2009. // }
  2010. .van-tag {
  2011. margin-left: 0.08rem;
  2012. }
  2013. }
  2014. .paddingB80 {
  2015. padding-bottom: 0.8rem;
  2016. }
  2017. .button-group-popup {
  2018. position: fixed;
  2019. bottom: 0;
  2020. padding: 0.2rem 0;
  2021. width: 100%;
  2022. text-align: center;
  2023. background-color: #ffffff;
  2024. .btn {
  2025. padding: 0 0.45rem;
  2026. line-height: 0.4rem;
  2027. display: inline-block;
  2028. border: 1px solid @mColor;
  2029. border-radius: 1rem;
  2030. color: @mColor;
  2031. background: #fff;
  2032. font-size: 0.18rem;
  2033. &.primary {
  2034. color: #fff;
  2035. background: @mColor;
  2036. }
  2037. }
  2038. .btn + .btn {
  2039. margin-left: 0.1rem;
  2040. }
  2041. }
  2042. .studentColor {
  2043. color: @mColor;
  2044. }
  2045. .classStudent {
  2046. font-size: .14rem !important;
  2047. }
  2048. /deep/.van-field--disabled .van-field__label,
  2049. /deep/.van-field__label {
  2050. color: #323233;
  2051. }
  2052. .courseStudent {
  2053. .van-cell__value {
  2054. color: #b2b2b2;
  2055. font-size: 0.16rem;
  2056. }
  2057. }
  2058. /deep/.studentChiose {
  2059. border-radius: 0 0 0px 0px;
  2060. overflow: auto;
  2061. }
  2062. </style>