table.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594
  1. <template>
  2. <view :style="{'padding-top':navHeight+ 'px'}" class="index u-skeleton">
  3. <u-skeleton :loading="loading" :animation="true"></u-skeleton>
  4. <header-nav>
  5. <view style="font-size:#fff ;font-weight: 550;font-size: 17px;display: inline-block; width:25px"
  6. @click="backList">
  7. <u-icon name="arrow-left"></u-icon>
  8. </view>
  9. <picker @change="bindPickerChange" :value="value" :range="weekSelectlist" :range-key="'name'" style="display: inline-block;">
  10. <view style="font-size: #333333; font-weight: 550; font-size: 17px;display: inline-block;">
  11. 第{{ week }}周
  12. </view>
  13. </picker>
  14. </header-nav>
  15. <view class="room-name">
  16. {{room_name}}
  17. </view>
  18. <view class="table">
  19. <u-tabs :list="roomList" :current="currentRoom" @change="change"></u-tabs>
  20. <view class="week">
  21. <view class="week-item">
  22. </view>
  23. <view class="week-item" v-for="(item,index) in weekList" :key='index'>
  24. <view class="">
  25. {{item.week_name}}
  26. </view>
  27. <view class="week-day">
  28. {{item.day}}
  29. </view>
  30. </view>
  31. </view>
  32. <view class="jie" v-for="(item,index) in jieList" :key='index'>
  33. <view class="jie-item">
  34. {{item.name}}
  35. </view>
  36. <view class="jie-item" v-for="(course,index1) in calendar[index]" :key='index1'>
  37. <!-- 课程存在时 有课且课程为正常课程-->
  38. <image src="../../static/image/stop.png" mode="" v-if="course.is_stop_lesson == true"
  39. class="tags_ting"></image>
  40. <view v-if="course.is_lesson && !course.is_open_appointment" style="height: 100%; with:100%">
  41. <!-- 有课-->
  42. <view v-if="!course.is_migrate_lesson" class="course_3"
  43. @click="showDetail(course.lesson.id,course.is_stop_lesson,weekList[index1], index)">
  44. <view class="course-item" slot="reference">
  45. <view>
  46. {{course.lesson && course.lesson.lesson? course.lesson.lesson.name: '--'}}
  47. </view>
  48. <view>
  49. ({{ course.lesson && course.lesson.teacher? course.lesson.teacher.name: '--'}})
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 补课 -->
  54. <view v-if=" course.is_migrate_lesson" class="course_4"
  55. @click="showDetail(course.lesson.id,course.is_stop_lesson,weekList[index1], index)">
  56. <view class="course-item" slot="reference">
  57. <view>
  58. {{course.lesson && course.lesson.lesson? course.lesson.lesson.name: '--'}}
  59. </view>
  60. <view>
  61. ({{course.lesson && course.lesson.teacher? course.lesson.teacher.name: '--'}})
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 主库有课开放预约 -->
  67. <view v-if="!course.is_lesson && course.is_open_appointment" style="height: 100%; with:100%">
  68. <view class="course_7"
  69. v-if="$transformAuth('200201') && course.open_appointment.admin_id!==user_id">
  70. <view class="course-item" slot="reference">
  71. <view>
  72. {{course.open_appointment? course.open_appointment.applicant_name: '--' }}
  73. </view>
  74. <view>
  75. ({{course.open_appointment? course.open_appointment.department: '--'}})
  76. </view>
  77. </view>
  78. </view>
  79. <view class="course_5" v-else
  80. @click="openOrderDetail(course.open_appointment.id,course.is_stop_lesson,weekList[index1], index)">
  81. <view class="course-item" slot="reference">
  82. <view>
  83. {{course.open_appointment? course.open_appointment.applicant_name: '--' }}
  84. </view>
  85. <view>
  86. ({{course.open_appointment? course.open_appointment.department: '--'}})
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 停课角标 -->
  92. <view
  93. v-if="course.is_stop_lesson == true && !course.is_open_appointment && !course.is_lesson && !course.is_migrate_lesson"
  94. @click="stop_detail(weekList[index1], index,1)" class="course_8">
  95. <image src="../../static/image/stop.png" mode="" class="tags_ting"></image>
  96. </view>
  97. <!-- 维护中 -->
  98. <view v-if="course.is_maintain" class="course_6">
  99. <view class="course-item" @click="repairDetail(course.is_maintain)">
  100. <view style="text-align: center">
  101. <view>维护中</view>
  102. <!-- <view>取消维护</view> -->
  103. </view>
  104. </view>
  105. </view>
  106. <view v-if="!course.is_lesson && !course.is_maintain" class="course">
  107. <view class="course-item">
  108. <!-- @click="orderRoom(item.day)" -->
  109. <view style="text-align: center"></view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="change-week">
  115. <view :class="week==1 ?'disable-buttom':'change-buttom'" @click="lastWeek">
  116. 上一周
  117. </view>
  118. <view :class="week==maxWeek ?'disable-buttom':'change-buttom'" @click="nextWeek">
  119. 下一周
  120. </view>
  121. </view>
  122. <!-- 状态提示 -->
  123. <view class="sort-top">
  124. <view class="sort_1 sort-item">
  125. <text class="dian"></text>
  126. 开放预约
  127. </view>
  128. <view class="sort_2 sort-item">
  129. <text class="dian"></text>
  130. 补课
  131. </view>
  132. <view class="sort_3 sort-item">
  133. <text class="dian"></text>
  134. 有课
  135. </view>
  136. <view class="sort_4 sort-item">
  137. <text class="dian"></text>
  138. 维护中
  139. </view>
  140. </view>
  141. </view>
  142. <!-- 课程详情 -->
  143. <view class="sel-prop" v-if="show" @click="closeSelsProp">
  144. <view class="sel-prop-content" @tap.stop.prevent>
  145. <u-tabs :list="totalCourse" count="type" :offset="[18,0]" v-if="totalCourse.length>1"
  146. :current="currentName" @change="changName()"></u-tabs>
  147. <view class="prop-title">
  148. {{detail.lesson ? detail.lesson.name:'--'}}
  149. </view>
  150. <view class="content-item">
  151. <view class="prop-label">
  152. 授课老师:
  153. </view>
  154. <view class="prop-text">
  155. {{detail.teacher ? detail.teacher.name:'--'}}
  156. </view>
  157. </view>
  158. <view class="content-item">
  159. <view class="prop-label">
  160. 上课实验室:
  161. </view>
  162. <view class="prop-text">
  163. {{room_name}}
  164. </view>
  165. </view>
  166. <view class="content-item">
  167. <view class="prop-label">
  168. 授课方式:
  169. </view>
  170. <view class="prop-text">
  171. {{detail.teach_type_name ? detail.teach_type_name :'实验'}}/{{detail.group_name}}
  172. </view>
  173. </view>
  174. <view class="content-item">
  175. <view class="prop-label">
  176. 上课人数:
  177. </view>
  178. <view class="prop-text">
  179. {{detail.student_nums}}人
  180. </view>
  181. </view>
  182. <view class="content-item">
  183. <view class="prop-label">
  184. 上课班级:
  185. </view>
  186. <view class="prop-text">
  187. {{detail.grade ? detail.grade.name:'--'}}
  188. </view>
  189. </view>
  190. <view class="content-item">
  191. <view class="prop-label">
  192. 上课时间:
  193. </view>
  194. <view class="prop-text">
  195. {{ detail.day || '--' }} · 第{{ detail.week || '--' }}周 ·
  196. {{detail.time_id ? detail.time_id.name : '--'}}
  197. </view>
  198. </view>
  199. <view class="content-item">
  200. <view class="prop-label">
  201. 上课内容:
  202. </view>
  203. <view class="prop-text">
  204. {{ detail.teach_title || '--' }}
  205. </view>
  206. </view>
  207. <view class="pop-btn">
  208. <view style="background: #3665FF;color: #fff;" @click="show = false,totalCourse=[],currentName=0">
  209. <text>确定</text>
  210. </view>
  211. </view>
  212. </view>
  213. </view>
  214. <!-- 开放预约 -->
  215. <view class="sel-prop" v-if="openOrderShow" @click="openOrderShow=false,currentName=0">
  216. <view class="sel-prop-content" @tap.stop.prevent>
  217. <u-tabs :list="totalCourse" count="type" :offset="[18,0]" v-if="totalCourse.length>1"
  218. :current="currentName" @change="changName()"></u-tabs>
  219. <!-- 开放预约 -->
  220. <view class="" v-if="currentName==0">
  221. <view class="prop-title">
  222. 开放预约申请
  223. </view>
  224. <!-- <view class="over-scroll"> -->
  225. <!-- <scroll-view scroll-y="true" style="height: 200px;"> -->
  226. <view class="content-item">
  227. <view class="prop-label">
  228. 申请人:
  229. </view>
  230. <view class="prop-text">
  231. {{ open_order_detail.applicant_name }}
  232. </view>
  233. </view>
  234. <view class="content-item">
  235. <view class="prop-label">
  236. 所属部门:
  237. </view>
  238. <view class="prop-text">
  239. {{ open_order_detail.department }}
  240. </view>
  241. </view>
  242. <view class="content-item">
  243. <view class="prop-label">
  244. 申请实验室:
  245. </view>
  246. <view class="prop-text">
  247. {{room_name}}
  248. </view>
  249. </view>
  250. <view class="content-item">
  251. <view class="prop-label">
  252. 申请原因:
  253. </view>
  254. <view class="prop-text">
  255. {{ open_order_detail.use_need ? open_order_detail.use_need : '暂无' }}
  256. </view>
  257. </view>
  258. <view class="content-item">
  259. <view class="prop-label">
  260. 使用需求:
  261. </view>
  262. <view class="prop-text">
  263. {{ open_order_detail.use_reason }}
  264. </view>
  265. </view>
  266. </view>
  267. <!-- 停课 -->
  268. <view class="" v-else>
  269. <view class="prop-title">
  270. {{detail.lesson ? detail.lesson.name:'--'}}
  271. </view>
  272. <view class="content-item">
  273. <view class="prop-label">
  274. 授课老师:
  275. </view>
  276. <view class="prop-text">
  277. {{detail.teacher ? detail.teacher.name:'--'}}
  278. </view>
  279. </view>
  280. <view class="content-item">
  281. <view class="prop-label">
  282. 上课实验室:
  283. </view>
  284. <view class="prop-text">
  285. {{room_name}}
  286. </view>
  287. </view>
  288. <view class="content-item">
  289. <view class="prop-label">
  290. 授课方式:
  291. </view>
  292. <view class="prop-text">
  293. {{detail.teach_type_name ? etail.teach_type_name :'实验'}}/{{detail.group_name}}
  294. </view>
  295. </view>
  296. <view class="content-item">
  297. <view class="prop-label">
  298. 上课人数:
  299. </view>
  300. <view class="prop-text">
  301. {{detail.student_nums}}人
  302. </view>
  303. </view>
  304. <view class="content-item">
  305. <view class="prop-label">
  306. 上课班级:
  307. </view>
  308. <view class="prop-text">
  309. {{detail.grade ? detail.grade.name:'--'}}
  310. </view>
  311. </view>
  312. <view class="content-item">
  313. <view class="prop-label">
  314. 上课时间:
  315. </view>
  316. <view class="prop-text">
  317. {{ detail.day || '--' }} · 第{{ detail.week || '--' }}周 ·
  318. {{detail.time_id ? detail.time_id.name : '--'}}
  319. </view>
  320. </view>
  321. <view class="content-item">
  322. <view class="prop-label">
  323. 上课内容:
  324. </view>
  325. <view class="prop-text">
  326. {{ detail.teach_title || '--' }}
  327. </view>
  328. </view>
  329. </view>
  330. <view class="pop-btn">
  331. <view style="background: #3665FF;color: #fff;"
  332. @click="openOrderShow = false,totalCourse=[],currentName=0">
  333. <text>确定</text>
  334. </view>
  335. </view>
  336. </view>
  337. </view>
  338. <!-- 维护详情弹框 -->
  339. <u-popup v-model="repairShow" mode="center" border-radius="24" width="85%">
  340. <view class="prop-content">
  341. <image src="../../static/image/index/icon_6.png" mode="" class="prop-image"></image>
  342. <view class="prop-title">
  343. 维护详情
  344. </view>
  345. <view class="content-item">
  346. <view class="prop-label">
  347. 维护人:
  348. </view>
  349. <view class="prop-text">
  350. {{ repair_detail.admin ? repair_detail.admin.name : '--' }}
  351. </view>
  352. </view>
  353. <view class="content-item">
  354. <view class="prop-label">
  355. 维护实验室:
  356. </view>
  357. <view class="prop-text">
  358. {{room_name}}
  359. </view>
  360. </view>
  361. <view class="content-item">
  362. <view class="prop-label">
  363. 维护时间:
  364. </view>
  365. <view class="prop-text">
  366. {{ repair_detail.day }}(第{{ repair_detail.week }}周 {{ repair_detail.week_index }})
  367. {{ repair_detail.time ? repair_detail.time.name : '--' }}
  368. </view>
  369. </view>
  370. <view class="content-item">
  371. <view class="prop-label">
  372. 维护内容:
  373. </view>
  374. <view class="prop-text">
  375. <u-parse :html="repair_detail.body" v-if="repair_detail.body"></u-parse>
  376. <span v-else>暂无内容</span>
  377. </view>
  378. </view>
  379. <view class="prop-srue" @click="repairShow=false,currentName=0">
  380. 确定
  381. </view>
  382. </view>
  383. </u-popup>
  384. </view>
  385. </template>
  386. <script>
  387. var app = getApp()
  388. export default {
  389. data() {
  390. return {
  391. show: false,
  392. showFalse: false,
  393. openOrderShow: false,
  394. repairShow: false,
  395. simpleShow: false,
  396. repair_detail: '',
  397. navHeight: app.globalData.navHeight,
  398. currentRoom: 0,
  399. open_order_detail: '', //开放预约详情
  400. detail: '', //课程详情
  401. list: [{
  402. id: 1,
  403. name: '停课'
  404. }, {
  405. id: 2,
  406. name: '调课'
  407. }],
  408. roomList: [],
  409. weekList: [],
  410. jieList: [],
  411. calendar: [],
  412. room_id: 18,
  413. week: 0,
  414. // 时间选择简版课表数据开始
  415. simple_weekList: [],
  416. simple_jieList: [],
  417. simple_calendar: [],
  418. simple_room_id: 18,
  419. simple_week: 0,
  420. simple_currentRoom: 0,
  421. //时间选择简版数据结束
  422. maxWeek: '',
  423. today: '', //今日日期
  424. selected: [], //已选择
  425. migrate_data: [],
  426. current_course: '', //当前课程
  427. type: '', //停调课类型、1停课,2调课
  428. body: '',
  429. courser_id: '', //课程id
  430. room_name: '', //上课实验室
  431. loading: true,
  432. currentName: '',
  433. totalCourse: [],
  434. weekSelectlist: [],
  435. value: ''
  436. }
  437. },
  438. onLoad(options) {
  439. console.log(options, 'opopopo')
  440. this.room_name = options.room_name
  441. this.room_id = options.id
  442. this.maxWeek = Number(this.vuex_term_weeks)
  443. // this.getRoomList()
  444. this.getTable()
  445. this.getWeeks()
  446. // this.getChangeTime()
  447. },
  448. onHide() {
  449. this.show = false
  450. this.showFalse = false
  451. this.openOrderShow = false
  452. this.repairShow = false
  453. this.simpleShow = false
  454. },
  455. methods: {
  456. bindPickerChange(e) {
  457. console.log(e.detail.value, '90')
  458. let index = e.detail.value
  459. this.value = index
  460. this.week = Number(index) + 1
  461. this.getTable()
  462. },
  463. //教学周列表
  464. getWeeks() {
  465. console.log(this.weeks, '-------------')
  466. let weeks = this.vuex_term_weeks
  467. for (let index = 1; index <= weeks; index++) {
  468. this.weekSelectlist.push({
  469. name: '第' + index + '周',
  470. value: index,
  471. })
  472. }
  473. // this.$set(this.queryForm, 'week', this.weekList[0].value)
  474. },
  475. changName(e) {
  476. console.log(e, 'ppppppppppp')
  477. this.currentName = e
  478. this.detail = this.totalCourse[e].detail
  479. },
  480. //返回上一页
  481. backList() {
  482. uni.navigateBack()
  483. },
  484. //匹配节次
  485. getTime(time) {
  486. var time1 = ''
  487. this.jieList.map((item) => {
  488. if (item.id == time) {
  489. time1 = item.name
  490. }
  491. })
  492. return time1
  493. },
  494. //判断课程是否过期
  495. checkOld(tableDay) {
  496. var nowDay = Number(this.today.replace(/-/g, ''))
  497. //表格日期
  498. var day2 = Number(tableDay.replace(/-/g, ''))
  499. if (nowDay > day2) {
  500. return true
  501. } else {
  502. return false
  503. }
  504. },
  505. //判断是否为当天日期
  506. checkToday(tableDay) {
  507. var nowDay = Number(this.today.replace(/-/g, ''))
  508. //表格日期
  509. var day2 = Number(tableDay.replace(/-/g, ''))
  510. if (nowDay == day2) {
  511. return true
  512. } else {
  513. return false
  514. }
  515. },
  516. //选择时间上一周
  517. simpleLastWeek() {
  518. this.simple_week--
  519. this.getChangeTime()
  520. },
  521. //选择时间下一周
  522. simpleNextWeek() {
  523. this.simple_week++
  524. this.getChangeTime()
  525. },
  526. //判断是否已选择
  527. checkIselect(week_index, time_id) {
  528. var status = false
  529. if (this.selected.length == 0) return false
  530. this.selected.map((item) => {
  531. if (
  532. this.simple_week == item.week &&
  533. this.simple_room_id == item.room_id &&
  534. week_index == item.week_index &&
  535. time_id == item.time_id
  536. ) {
  537. status = true
  538. }
  539. })
  540. return status
  541. },
  542. //选择时间点
  543. //选择时间点
  544. selectTime(row, index1) {
  545. this.selected = []
  546. this.migrate_data = []
  547. let id =
  548. row.week_index.toString() +
  549. this.simple_jieList[index1].id.toString() +
  550. this.simple_room_id.toString()
  551. let index = false
  552. this.migrate_data.map((item) => {
  553. if (item.id == id) index = true
  554. })
  555. console.log(index, '000', id)
  556. if (!index) {
  557. let arr1 = [{
  558. id: id,
  559. week: row.week,
  560. day: row.day,
  561. week_index: row.week_index,
  562. time_id: this.simple_jieList[index1].id,
  563. time_name: this.simple_jieList[index1].name,
  564. room_id: this.simple_room_id,
  565. room_name: this.roomList[this.simple_currentRoom].name,
  566. }, ]
  567. this.migrate_data = this.migrate_data.concat(arr1)
  568. let arr = [{
  569. id: row.week_index.toString() +
  570. this.simple_jieList[index1].id.toString() +
  571. this.simple_room_id.toString(),
  572. time_id: this.simple_jieList[index1].id,
  573. week_index: row.week_index,
  574. week: row.week,
  575. room_id: this.simple_room_id,
  576. }, ]
  577. // this.selected = this.selected.concat(arr) //开放预约可多选
  578. this.selected = arr
  579. // this.$forceUpdate()
  580. // this.$set(this.selected, this.selected.concat(arr))
  581. } else {
  582. this.selected = this.selected.filter((item) => {
  583. return item.id !== id
  584. })
  585. this.migrate_data = this.migrate_data.filter((item) => {
  586. return item.id !== id
  587. })
  588. }
  589. },
  590. //选择时间切换实验室
  591. simpleChangeRoom(item) {
  592. this.simple_currentRoom = item
  593. this.simple_room_id = this.roomList[item].id
  594. this.getChangeTime()
  595. },
  596. //点击选择时间
  597. chaneTime() {
  598. this.simpleShow = true
  599. this.simple_room_id = this.room_id
  600. this.simple_week = this.week
  601. this.simple_currentRoom = this.currentRoom
  602. this.getChangeTime()
  603. },
  604. //取消选择时间
  605. cancelSelectTime() {
  606. this.selected = [],
  607. this.migrate_data = []
  608. this.simpleShow = false
  609. },
  610. //确定选择
  611. sureSelectTime() {
  612. this.simpleShow = false
  613. },
  614. //切换实验室
  615. change(item) {
  616. console.log('item', item);
  617. this.currentRoom = item
  618. this.room_id = this.roomList[item].id
  619. this.getTable()
  620. },
  621. // 上一周
  622. lastWeek() {
  623. console.log(this.week)
  624. if (this.week > 1) {
  625. this.week--
  626. this.getTable()
  627. }
  628. },
  629. // 下一周
  630. nextWeek() {
  631. if (this.week < this.maxWeek) {
  632. this.week++;
  633. this.getTable()
  634. }
  635. },
  636. radioGroupChange(e) {
  637. console.log(e)
  638. },
  639. radioChange(e) {
  640. //单选按钮事件
  641. },
  642. //点击查看课程详情
  643. showDetail(id, stop, item, index) {
  644. this.$u.get('/school/schedule/info/' + id).then(res => {
  645. this.detail = res.data
  646. this.current_course = {
  647. time_id: res.data.time_id.id,
  648. week_index: res.data.week_index,
  649. room_id: this.room_id,
  650. week: this.week,
  651. }
  652. this.courser_id = res.data.id
  653. this.totalCourse = [{
  654. name: res.data.lesson ? res.data.lesson.name : '未知',
  655. type: '',
  656. detail: res.data
  657. }]
  658. this.show = true
  659. if (stop) {
  660. this.stop_detail(item, index)
  661. }
  662. })
  663. console.log(item, index)
  664. },
  665. //停课详情
  666. stop_detail(item, index, type) {
  667. let weekIndex = item.week
  668. let params = {
  669. week_index: weekIndex,
  670. week: this.week,
  671. room_id: this.room_id,
  672. time_id: this.jieList[index].id,
  673. }
  674. this.$u.post('/school/schedule/history', params).then(res => {
  675. let data = res.data.list
  676. let arr = []
  677. data.map(item => {
  678. arr.push({
  679. name: item.lesson ? item.lesson.name : '未知',
  680. type: '停',
  681. detail: item
  682. })
  683. })
  684. this.totalCourse = this.totalCourse.concat(arr)
  685. if (type) {
  686. this.detail = data[0]
  687. this.show = true
  688. }
  689. console.log(this.totalCourse, 'totalCoursetotalCoursetotalCourse')
  690. })
  691. },
  692. closeSelsProp() {
  693. this.show = false
  694. this.totalCourse = []
  695. this.currentName = 0
  696. },
  697. //开放预约查看课程详情
  698. openOrderDetail(id, stop, item, index) {
  699. this.$u.get('/lab/open-appointment/info/' + id).then(res => {
  700. this.open_order_detail = res.data
  701. this.totalCourse = [{
  702. name: '开放预约申请',
  703. type: '',
  704. detail: res.data
  705. }]
  706. this.openOrderShow = true
  707. if (stop) {
  708. this.stop_detail(item, index)
  709. }
  710. })
  711. },
  712. //查看维护相亲
  713. repairDetail(id) {
  714. this.$u.get('/lab/maintain/info/' + id).then(res => {
  715. this.repair_detail = res.data
  716. this.repairShow = true
  717. })
  718. },
  719. //获取课表
  720. getTable() {
  721. this.$u.post('/school/schedule/calendar-cross', {
  722. // week: 11,
  723. // room_id: 16
  724. week: this.week,
  725. room_id: this.room_id
  726. }).then(res => {
  727. console.log(res)
  728. this.jieList = res.data.times;
  729. var head = res.data.headers;
  730. var xingqi = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
  731. for (var i = 0; i < head.length; i++) {
  732. head[i].week_name = xingqi[i];
  733. head[i].day = head[i].day.slice(5, 11).replace("-", "/");
  734. head[i].week = head[i].week;
  735. }
  736. this.weekList = head;
  737. this.calendar = res.data.calendar;
  738. this.week = res.data.week;
  739. this.value = res.data.week - 1
  740. this.today = res.data.day;
  741. this.loading = false;
  742. })
  743. },
  744. //获取实验室列表
  745. getRoomList() {
  746. this.$u.get('/school/room-select-options', {
  747. status: 1
  748. }).then(res => {
  749. this.roomList = res.data
  750. this.room_id = res.data[this.currentRoom].id
  751. })
  752. },
  753. //获取时间选择列表
  754. getChangeTime() {
  755. this.$u.post('/school/schedule/calendar-simple', {
  756. room_id: this.simple_room_id,
  757. // term_id: this.vuex_term_id,
  758. week: this.simple_week,
  759. }).then(res => {
  760. this.simple_jieList = res.data.times;
  761. var head = res.data.headers;
  762. var xingqi = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
  763. for (var i = 0; i < head.length; i++) {
  764. head[i].week = xingqi[i];
  765. head[i].day = head[i].day.slice(5, 11).replace("-", "/");
  766. }
  767. this.simple_weekList = head;
  768. this.simple_calendar = res.data.calendar
  769. this.simple_week = res.data.week
  770. })
  771. },
  772. //确定停调课
  773. sureHandle() {
  774. if (!this.type) {
  775. uni.showToast({
  776. title: '请选择类型',
  777. icon: 'none'
  778. })
  779. return
  780. }
  781. if (this.type == 2 && this.migrate_data.length == 0) {
  782. uni.showToast({
  783. title: '请选择调课时间',
  784. icon: 'none'
  785. })
  786. return
  787. }
  788. if (!this.body) {
  789. uni.showToast({
  790. title: '请输入停调课原因',
  791. icon: 'none'
  792. })
  793. return
  794. }
  795. let data = {
  796. type: this.type,
  797. body: this.body,
  798. id: this.detail.id,
  799. migrate_data: this.migrate_data[0]
  800. }
  801. this.$u.post('/school/schedule/change', data).then(res => {
  802. this.show = false
  803. this.showFalse = false
  804. this.handleClear()
  805. uni.showToast({
  806. title: '提交成功,请等待管理员审核!',
  807. icon: 'none'
  808. })
  809. })
  810. }, //取消停调可
  811. cancelHandle() {
  812. this.showFalse = false
  813. this.handleClear()
  814. },
  815. //清除表单信息
  816. handleClear() {
  817. this.selected = []
  818. this.migrate_data = []
  819. this.type = ''
  820. this.body = ''
  821. }
  822. },
  823. }
  824. </script>
  825. <style lang="scss" scoped>
  826. //弹框样式
  827. .prop-image {
  828. // position: absolute;
  829. // top: -50px;
  830. height: 68px;
  831. width: 90px;
  832. margin-top: -54px;
  833. position: fixed;
  834. }
  835. .prop-content {
  836. padding: 15px;
  837. display: flex;
  838. flex-direction: column;
  839. align-items: center;
  840. .prop-title {
  841. text-align: center;
  842. font-size: 18px;
  843. margin-bottom: 5px;
  844. font-weight: bold;
  845. color: #333333;
  846. margin-top: 30px;
  847. }
  848. .content-item {
  849. display: flex;
  850. color: #333333;
  851. margin-top: 8px;
  852. width: 100%;
  853. .prop-label {
  854. flex: 0 0 90px;
  855. font-size: 15px;
  856. font-weight: 550;
  857. }
  858. .prop-text {
  859. flex: 1;
  860. .change-time {
  861. display: inline-block;
  862. padding: 0 8px;
  863. line-height: 30px;
  864. height: 30px;
  865. font-size: 12px;
  866. color: #FFFFFF;
  867. background-color: #3665FF;
  868. border-radius: 5px;
  869. }
  870. .table-title {
  871. display: flex;
  872. border-left: solid 1px#b3b3b3;
  873. .title-item {
  874. flex: 1;
  875. padding: 5px 0;
  876. text-align: center;
  877. border-right: solid 1px #b3b3b3;
  878. border-bottom: solid 1px#b3b3b3;
  879. }
  880. }
  881. .table-title:first-child {
  882. background-color: #e3e3e3;
  883. border-top: solid 1px #b3b3b3;
  884. }
  885. }
  886. .prop-content {
  887. font-size: 15px;
  888. }
  889. }
  890. .prop-srue {
  891. width: 279px;
  892. height: 44px;
  893. background: #3665FF;
  894. text-align: center;
  895. margin-top: 30px;
  896. line-height: 44px;
  897. color: #FFFFFF;
  898. border-radius: 22px 22px 22px 22px;
  899. font-size: 16px;
  900. margin-bottom: 5px;
  901. }
  902. .pop-btn {
  903. margin-top: 40px;
  904. width: 84%;
  905. display: flex;
  906. align-items: center;
  907. // justify-content: space-between;
  908. justify-content: center;
  909. view {
  910. display: flex;
  911. align-items: center;
  912. justify-content: center;
  913. width: 130px;
  914. height: 44px;
  915. font-size: 16px;
  916. font-weight: bold;
  917. border-radius: 22px 22px 22px 22px;
  918. opacity: 1;
  919. }
  920. }
  921. }
  922. .room-name {
  923. text-align: center;
  924. font-size: 16px;
  925. font-weight: bold;
  926. color: #fff;
  927. background-color: #3665FF;
  928. padding: 10px 0;
  929. }
  930. .table {
  931. // background-color: #18B566;
  932. padding-bottom: 85px;
  933. .week {
  934. display: flex;
  935. padding: 8px;
  936. color: #333333;
  937. font-size: 12px;
  938. border-bottom: solid 1px #F2F2F2;
  939. border-top: solid 1px #F2F2F2;
  940. background-color: #FBFCFF;
  941. .week-item {
  942. flex: 1;
  943. text-align: center;
  944. .week-day {
  945. margin-top: 3px;
  946. }
  947. }
  948. }
  949. .jie {
  950. display: flex;
  951. text-align: center;
  952. min-height: 65px;
  953. .jie-item:first-child {
  954. background-color: #FBFCFF;
  955. border-right: dashed 1px #e4e4e4;
  956. // border: none;
  957. display: flex;
  958. align-items: center;
  959. justify-content: center;
  960. }
  961. .jie-item {
  962. flex: 1;
  963. display: flex;
  964. align-items: center;
  965. justify-content: center;
  966. border: 1px dashed #F2F2F2;
  967. border-top: none;
  968. border-left: none;
  969. text-align: center;
  970. position: relative;
  971. }
  972. }
  973. .jie:nth-of-type(even) {
  974. background-color: #FBFCFF;
  975. }
  976. }
  977. .change-week {
  978. position: fixed;
  979. bottom: 60px;
  980. right: 0;
  981. display: flex;
  982. .change-buttom,
  983. .disable-buttom {
  984. padding: 7px 16px;
  985. background-color: #3665FF;
  986. color: #FFFFFF;
  987. margin-left: 10px;
  988. border-radius: 15px;
  989. }
  990. .disable-buttom {
  991. background-color: #dddcdc;
  992. color: #7c7b7b;
  993. }
  994. }
  995. .sort-top {
  996. position: fixed;
  997. bottom: 0;
  998. display: flex;
  999. height: 45px;
  1000. line-height: 45px;
  1001. background-color: #F2F2F2;
  1002. justify-content: center;
  1003. width: 100%;
  1004. .sort-item,
  1005. .sort_1,
  1006. .sort_2,
  1007. .sort_3,
  1008. .sort_4 {
  1009. // flex: 1;
  1010. margin-right: 10px;
  1011. .dian {
  1012. display: inline-block;
  1013. height: 10px;
  1014. width: 10px;
  1015. margin-right: 5px;
  1016. }
  1017. }
  1018. .sort_1 {
  1019. color: #30D143;
  1020. .dian {
  1021. background-color: #30D143;
  1022. }
  1023. }
  1024. .sort_2 {
  1025. color: #FE6F0F;
  1026. .dian {
  1027. background-color: #FE6F0F;
  1028. }
  1029. }
  1030. .sort_3 {
  1031. color: #3665FF;
  1032. .dian {
  1033. background-color: #3665FF;
  1034. }
  1035. }
  1036. .sort_4 {
  1037. color: #868686;
  1038. .dian {
  1039. background-color: #e5e5e5;
  1040. }
  1041. }
  1042. }
  1043. .pop-bj {
  1044. width: 100vw;
  1045. height: 100vh;
  1046. background: #000000;
  1047. opacity: 0.6;
  1048. z-index: 1;
  1049. position: fixed;
  1050. top: 0;
  1051. left: 0;
  1052. }
  1053. .pop {
  1054. width: 327px;
  1055. height: 395px;
  1056. background: #FFFFFF;
  1057. border-radius: 12px;
  1058. opacity: 1;
  1059. position: fixed;
  1060. transform: translate(-50%, -50%);
  1061. background: white;
  1062. z-index: 2;
  1063. top: 56%;
  1064. left: 50%;
  1065. display: flex;
  1066. flex-direction: column;
  1067. align-items: center;
  1068. u-radio-group {
  1069. width: 150px;
  1070. margin-left: 15px;
  1071. }
  1072. .txt1 {
  1073. font-size: 18px;
  1074. font-weight: bold;
  1075. color: #333;
  1076. padding-top: 16px;
  1077. padding-bottom: 8px;
  1078. }
  1079. .msg {
  1080. display: flex;
  1081. align-items: center;
  1082. margin-top: 8px;
  1083. width: 86%;
  1084. }
  1085. .txt2 {
  1086. flex: 0 0 90px;
  1087. font-size: 16px;
  1088. color: #333;
  1089. font-weight: bold;
  1090. }
  1091. .txt3 {
  1092. font-size: 15px;
  1093. color: #333;
  1094. font-weight: 400;
  1095. }
  1096. textarea {
  1097. width: 287px;
  1098. height: 100px;
  1099. background: #F8F8F8;
  1100. border-radius: 4px;
  1101. opacity: 1;
  1102. padding-left: 12px;
  1103. padding-top: 12px;
  1104. box-sizing: border-box;
  1105. font-size: 16px;
  1106. margin-top: 4px;
  1107. }
  1108. .pop-btn {
  1109. margin-top: 40px;
  1110. width: 84%;
  1111. display: flex;
  1112. align-items: center;
  1113. justify-content: space-between;
  1114. view {
  1115. display: flex;
  1116. align-items: center;
  1117. justify-content: center;
  1118. width: 130px;
  1119. height: 44px;
  1120. font-size: 16px;
  1121. font-weight: bold;
  1122. border-radius: 22px 22px 22px 22px;
  1123. opacity: 1;
  1124. }
  1125. }
  1126. }
  1127. .course-item {
  1128. word-break: break-all;
  1129. }
  1130. .tags_ting {
  1131. width: 30px;
  1132. height: 30px;
  1133. position: absolute;
  1134. top: 0%;
  1135. left: 0;
  1136. }
  1137. //有课
  1138. .course_1,
  1139. .course_2,
  1140. .course_3,
  1141. .course_4,
  1142. .course_5,
  1143. .course_6,
  1144. .course_7,
  1145. .course_8 {
  1146. // background-color: #3665FF;
  1147. display: flex;
  1148. align-items: center;
  1149. height: 100%;
  1150. padding: 10px 1px;
  1151. width: 100%;
  1152. font-size: 13px;
  1153. }
  1154. .course_2 {
  1155. background-color: #FCBD12;
  1156. color: #FFFFFF;
  1157. }
  1158. .course_3 {
  1159. background-color: #3665FF;
  1160. color: #FFFFFF;
  1161. }
  1162. .course_4 {
  1163. background-color: #FE6F0F;
  1164. color: #FFFFFF;
  1165. }
  1166. .course_5 {
  1167. background-color: #30D143;
  1168. color: #FFFFFF;
  1169. }
  1170. .course_7 {
  1171. background-color: #77cf87;
  1172. color: #FFFFFF;
  1173. }
  1174. .course_6 {
  1175. background-color: #e5e5e5;
  1176. color: #868686;
  1177. justify-content: center;
  1178. }
  1179. .over-scroll {
  1180. height: 200px;
  1181. overflow-y: scroll !important;
  1182. background-color: #00b315;
  1183. width: 100%;
  1184. }
  1185. //时间选择弹框
  1186. .change-time-prop {
  1187. height: 100%;
  1188. width: 100%;
  1189. background-color: #fff;
  1190. position: fixed;
  1191. top: 0;
  1192. left: 0;
  1193. z-index: 99999999999;
  1194. .table_1 {
  1195. .simple-week {
  1196. text-align: right;
  1197. padding: 10px;
  1198. background-color: #fff;
  1199. border-bottom: solid 1px #dddcdc;
  1200. .change-buttom,
  1201. .disable-buttom {
  1202. display: inline-block;
  1203. padding: 8px 30px;
  1204. background-color: #3665FF;
  1205. color: #FFFFFF;
  1206. // margin-left: 10px;
  1207. border-radius: 18px;
  1208. }
  1209. .week-text {
  1210. display: inline-block;
  1211. font-size: 15px;
  1212. margin: 0 10px;
  1213. font-weight: bold;
  1214. }
  1215. .disable-buttom {
  1216. background-color: #dddcdc;
  1217. color: #7c7b7b;
  1218. }
  1219. }
  1220. .sure-buttom {
  1221. text-align: center;
  1222. margin-top: 20px;
  1223. .cancel {
  1224. display: inline-block;
  1225. width: 150px;
  1226. height: 45px;
  1227. line-height: 45px;
  1228. border: solid 1px #3665FF;
  1229. color: #3665FF;
  1230. border-radius: 22px;
  1231. }
  1232. .sure {
  1233. display: inline-block;
  1234. width: 150px;
  1235. height: 45px;
  1236. line-height: 45px;
  1237. background-color: #3665FF;
  1238. color: #FFFFFF;
  1239. margin-left: 10px;
  1240. border-radius: 22px;
  1241. }
  1242. }
  1243. .table-border {
  1244. display: flex;
  1245. .week {
  1246. display: flex;
  1247. padding: 8px;
  1248. color: #333333;
  1249. font-size: 12px;
  1250. border-bottom: solid 1px #F2F2F2;
  1251. border-top: solid 1px #F2F2F2;
  1252. background-color: #FBFCFF;
  1253. .week-item {
  1254. flex: 1;
  1255. text-align: center;
  1256. .week-day {
  1257. margin-top: 3px;
  1258. }
  1259. }
  1260. }
  1261. .jie {
  1262. text-align: center;
  1263. background-color: #FBFCFF;
  1264. }
  1265. .jie-item:first-child {
  1266. background-color: #FBFCFF;
  1267. display: flex;
  1268. align-items: center;
  1269. justify-content: center;
  1270. }
  1271. .jie-item {
  1272. flex: 1;
  1273. display: flex;
  1274. align-items: center;
  1275. justify-content: center;
  1276. border: 1px dashed #F2F2F2;
  1277. border-right: none;
  1278. border-top: none;
  1279. height: 50px;
  1280. border-left: none;
  1281. text-align: center;
  1282. }
  1283. .kong {
  1284. text-align: center;
  1285. // background-color: #0077ff;
  1286. color: #0077ff;
  1287. cursor: pointer;
  1288. // border-bottom: solid 1px #fff;
  1289. }
  1290. .course {
  1291. flex: 1;
  1292. display: flex;
  1293. align-items: center;
  1294. justify-content: center;
  1295. height: 50px;
  1296. border-left: none;
  1297. text-align: center;
  1298. width: 100%;
  1299. }
  1300. .current-course {
  1301. text-align: center;
  1302. background-color: #0077ff;
  1303. color: #fff;
  1304. display: flex;
  1305. align-items: center;
  1306. justify-content: center;
  1307. }
  1308. .xuan {
  1309. text-align: center;
  1310. background-color: #00b315;
  1311. color: #fff;
  1312. display: flex;
  1313. align-items: center;
  1314. justify-content: center;
  1315. }
  1316. .jie-item:last-child {
  1317. border-bottom: none;
  1318. }
  1319. .day {
  1320. flex: 1;
  1321. display: flex;
  1322. text-align: center;
  1323. .day-item {
  1324. flex: 1;
  1325. .time {
  1326. border-bottom: 1px dashed #F2F2F2;
  1327. background-color: #FBFCFF;
  1328. }
  1329. .today {
  1330. color: #df4d76;
  1331. }
  1332. background-color: #fff;
  1333. border: 1px dashed #F2F2F2;
  1334. }
  1335. .day-item-1 {
  1336. background-color: #cdced0;
  1337. }
  1338. }
  1339. }
  1340. }
  1341. }
  1342. .sel-prop {
  1343. position: fixed;
  1344. top: 0;
  1345. left: 0;
  1346. width: 100%;
  1347. background-color: rgba(0, 0, 0, 0.5);
  1348. height: 100vh;
  1349. .sel-prop-content {
  1350. margin: 0 auto;
  1351. background-color: #fff;
  1352. margin-top: 22vh;
  1353. border-radius: 12px;
  1354. padding: 15px;
  1355. width: 90vw;
  1356. .prop-title {
  1357. text-align: center;
  1358. font-size: 18px;
  1359. margin-bottom: 5px;
  1360. font-weight: bold;
  1361. color: #333333;
  1362. margin-top: 15px;
  1363. }
  1364. .content-item {
  1365. display: flex;
  1366. color: #333333;
  1367. margin-top: 8px;
  1368. width: 100%;
  1369. .prop-label {
  1370. flex: 0 0 90px;
  1371. font-size: 15px;
  1372. font-weight: 550;
  1373. }
  1374. .prop-text {
  1375. flex: 1;
  1376. .change-time {
  1377. display: inline-block;
  1378. padding: 0 8px;
  1379. line-height: 30px;
  1380. height: 30px;
  1381. font-size: 12px;
  1382. color: #FFFFFF;
  1383. background-color: #3665FF;
  1384. border-radius: 5px;
  1385. }
  1386. .table-title {
  1387. display: flex;
  1388. border-left: solid 1px#b3b3b3;
  1389. .title-item {
  1390. flex: 1;
  1391. padding: 5px 0;
  1392. text-align: center;
  1393. border-right: solid 1px #b3b3b3;
  1394. border-bottom: solid 1px#b3b3b3;
  1395. }
  1396. }
  1397. .table-title:first-child {
  1398. background-color: #e3e3e3;
  1399. border-top: solid 1px #b3b3b3;
  1400. }
  1401. textarea {
  1402. border: solid 1px #b3b3b3;
  1403. width: auto;
  1404. border-radius: 8px;
  1405. padding: 8px;
  1406. height: 100px;
  1407. }
  1408. }
  1409. .prop-content {
  1410. font-size: 15px;
  1411. }
  1412. }
  1413. .prop-srue {
  1414. width: 279px;
  1415. height: 44px;
  1416. background: #3665FF;
  1417. text-align: center;
  1418. margin-top: 30px;
  1419. line-height: 44px;
  1420. color: #FFFFFF;
  1421. border-radius: 22px 22px 22px 22px;
  1422. font-size: 16px;
  1423. margin-bottom: 5px;
  1424. }
  1425. .pop-btn {
  1426. width: 84%;
  1427. display: flex;
  1428. align-items: center;
  1429. justify-content: center;
  1430. margin: 0 auto;
  1431. margin-top: 40px;
  1432. view {
  1433. display: flex;
  1434. align-items: center;
  1435. justify-content: center;
  1436. width: 130px;
  1437. height: 44px;
  1438. font-size: 16px;
  1439. font-weight: bold;
  1440. border-radius: 22px 22px 22px 22px;
  1441. opacity: 1;
  1442. }
  1443. }
  1444. }
  1445. }
  1446. </style>