index.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  1. <template>
  2. <view class="sheduling">
  3. <!-- 添加排班 -->
  4. <u-popup v-model="teacher_show" mode="right" border-radius="19" @close="handleClose">
  5. <view class="pop_wrap pop_wrap_1" style="width: 85vw;">
  6. <view class="pop_top">
  7. <text class="title">请您确认排班时间</text>
  8. </view>
  9. <u-form :model="form" ref="uForm" label-width="180" style="width: 80vw;">
  10. <u-form-item label="值班日期">
  11. {{now_date}}
  12. </u-form-item>
  13. <u-form-item label="值班时间">
  14. {{time.start_time}}-{{time.end_time}}
  15. </u-form-item>
  16. <u-form-item label="最大预约人数">
  17. <u-input placeholder="请输入最大预约人数" v-model="form.max_student_nums" type='number' clearable></u-input>
  18. </u-form-item>
  19. <u-form-item label="教室名称">
  20. <u-input v-model="form.room_name" type="select" @click="roomShow = true" />
  21. </u-form-item>
  22. <u-select mode="mutil-column-auto" value-name="id" label-name="name" :list="roomList"
  23. @confirm="actionSheetCallback" v-model="roomShow"></u-select>
  24. </u-form>
  25. <view class="pop_bootom">
  26. <button type="default" @click="sure_choose">确认</button>
  27. </view>
  28. </view>
  29. </u-popup>
  30. <!-- 取消排班 -->
  31. <u-popup v-model="cancel_show" mode="center" border-radius="19">
  32. <view class="pop_wrap">
  33. <view class="pop_top">
  34. <text class="title">您确定要取消如下排班吗</text>
  35. </view>
  36. <view class="pop_center">
  37. <text>上课日期:{{cancel_detail.day}}</text>
  38. <text>上课时间:{{cancel_detail.start_time}}-{{cancel_detail.end_time}}</text>
  39. </view>
  40. <view class="pop_bootom">
  41. <button type="default" @click="sure_cancel">确定取消</button>
  42. </view>
  43. </view>
  44. </u-popup>
  45. <u-popup v-model="stu_show" mode="center" border-radius="42" width="85%">
  46. <view class="student-show">
  47. <view class="stu-title">
  48. 预约学生基本信息
  49. </view>
  50. <view class="stu-mess">
  51. <image :src="stu_detail.student ? stu_detail.student.headimg : '../../static/images/avator.png'"
  52. mode="">
  53. </image>
  54. <view class="right">
  55. <view class="stu-text">
  56. 姓名:{{stu_detail.student?stu_detail.student.truename:'--'}}
  57. </view>
  58. <view class="stu-text">
  59. 学号:{{stu_detail.student?stu_detail.student.account:'--'}}
  60. </view>
  61. <view class="stu-text">
  62. 班级:{{stu_detail.student ? stu_detail.student.class :'--'}}
  63. </view>
  64. <view class="stu-text">
  65. 手机号:{{stu_detail.student ? stu_detail.student.mobile :'--'}}
  66. </view>
  67. </view>
  68. </view>
  69. <view class="e-mail">
  70. <u-icon name="email"></u-icon>:{{stu_detail.student ? stu_detail.student.email :'--'}}
  71. </view>
  72. <view class="remark-title">
  73. {{stu_detail.student?stu_detail.student.sex==2?"她":"他":'--'}}的备注
  74. </view>
  75. <view class="remark">
  76. {{stu_detail.remark?stu_detail.remark:'暂无'}}
  77. </view>
  78. </view>
  79. </u-popup>
  80. <view class="sheduling-top" v-if="notice.length>0">
  81. <image src="../../static/images/nock.png" mode=""></image>
  82. <view class="title">
  83. <u-notice-bar :volume-icon="false" type='none' color='#2B9155' :speed="120" :list="notice">
  84. </u-notice-bar>
  85. </view>
  86. </view>
  87. <view class="tab">
  88. <view v-for="(item,index) in tab_list" :key='index' :class="current_tab==index ? 'active-item' : 'item'"
  89. @click="changTab(index)">
  90. <view class="week">
  91. {{item}}
  92. </view>
  93. <text class="line" v-if="current_tab==index">
  94. </text>
  95. </view>
  96. </view>
  97. <view class="content">
  98. <view class="top">
  99. <view :class="current_date==index ? 'active-item':'item'" v-for="(item,index) in table_week"
  100. :key='index' @click="changeDate(index,item)">
  101. <view class="week">
  102. {{item.week}}
  103. </view>
  104. <view class="date">
  105. {{getDay(item.day)}}
  106. </view>
  107. </view>
  108. </view>
  109. <view class="shedule">
  110. <view class="left">
  111. <view class="left_1">
  112. <view :class="current_time==-1 ? 'active-item':'item'" @click="changeTime(-1)">
  113. <image class="all" v-if="current_time==-1" src="../../static/images/all.png" mode="">
  114. </image>
  115. 全部时间
  116. <image class="jian" v-if="current_time==-1" src="../../static/images/01.png" mode="">
  117. </image>
  118. </view>
  119. <view :class="current_time==index? 'active-item':'item'" v-for="(item,index) in time_list"
  120. :key='index' @click="changeTime(item,index)">
  121. {{item.start_time}}-{{item.end_time}}
  122. <image v-if="current_time==index" class="jian" src="../../static/images/01.png" mode="">
  123. <!-- <image v-if="current_time==item.id" class="jian" src="../../static/images/01.png" mode=""> -->
  124. </image>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="right">
  129. <view class="" v-for="(item,index) in shedule_list" :key='index'>
  130. <view v-if="item.schedulings && index==current_time && index!=-1">
  131. <view class="item" v-for="(child,value) in item.schedulings">
  132. <view class="item-right">
  133. <view class="text">
  134. <image src="../../static/images/icon-2.png" mode=""></image>
  135. <view class="time">
  136. {{child.scheduling.day}}
  137. </view>
  138. </view>
  139. <view class="text">
  140. <image src="../../static/images/icon-1.png" mode=""></image>
  141. <view class="time">
  142. {{child.scheduling.start_time}}-{{child.scheduling.end_time}}
  143. </view>
  144. </view>
  145. <view class="text">
  146. <image src="../../static/images/icon-3.png" mode=""></image>
  147. <view class="time">
  148. {{child.scheduling.teacher ? child.scheduling.teacher.truename :'--'}}
  149. </view>
  150. </view>
  151. <view class="text">
  152. <image src="../../static/images/icon-3.png" mode=""></image>
  153. <view class="time">
  154. {{child.scheduling.room_name }}
  155. </view>
  156. </view>
  157. </view>
  158. <view class="cancel" @click="cancelShedule(child)" v-if="child.is_me && child.is_del">
  159. 取消
  160. </view>
  161. <view class="cancel" @click="stuDetail(child.scheduling)"
  162. v-if="child.scheduling.student">
  163. 查看学生
  164. </view>
  165. <view class="" v-if="!item.schedulings">
  166. {{ item.is_scheduling == false ? '已过期' : '立即排班' }}
  167. </view>
  168. </view>
  169. </view>
  170. <!-- 当时间未全部index==0 -->
  171. <view v-if="item.schedulings.length>0 && current_time==-1">
  172. <view class="item" v-for="(child,value) in item.schedulings">
  173. <view class="item-right">
  174. <view class="text">
  175. <image src="../../static/images/icon-2.png" mode=""></image>
  176. <view class="time">
  177. {{child.scheduling.day}}
  178. </view>
  179. </view>
  180. <view class="text">
  181. <image src="../../static/images/icon-1.png" mode=""></image>
  182. <view class="time">
  183. {{child.scheduling.start_time}}-{{child.scheduling.end_time}}
  184. </view>
  185. </view>
  186. <view class="text">
  187. <image src="../../static/images/icon-3.png" mode=""></image>
  188. <view class="time">
  189. {{child.scheduling.teacher ? child.scheduling.teacher.truename :'--'}}
  190. </view>
  191. </view>
  192. <view class="text">
  193. <image src="../../static/images/icon-3.png" mode=""></image>
  194. <view class="time">
  195. {{child.scheduling.room_name }}
  196. </view>
  197. </view>
  198. </view>
  199. <view class="cancel" @click="cancelShedule(child)" v-if="child.is_me && child.is_del">
  200. 取消
  201. </view>
  202. <view class="cancel" @click="stuDetail(child.scheduling)"
  203. v-if="child.scheduling.student">
  204. 查看学生
  205. </view>
  206. <view class="" v-if="!item.schedulings">
  207. {{ item.is_scheduling == false ? '已过期' : '立即排班' }}
  208. </view>
  209. </view>
  210. </view>
  211. <view class="add add1" v-if=" index == current_time">
  212. <image src="../../static/images/pass1.png" mode="widthFix"
  213. v-if="item.schedulings.length==0">
  214. </image>
  215. <view class="add-buttom" v-if="current_time != -1" @click="teacher_show = true">
  216. 添加排班
  217. </view>
  218. </view>
  219. <!-- <view class="add"
  220. v-if="!item.scheduling &&item.is_scheduling == false && index == current_time ">
  221. <image src="../../static/images/pass1.png" mode="widthFix"></image>
  222. <view class="add-text">
  223. 已截止
  224. </view>
  225. </view> -->
  226. </view>
  227. </view>
  228. </view>
  229. <view class="table">
  230. <view class="title">
  231. 工作排班信息
  232. </view>
  233. <view class="table_1">
  234. <view class="table-week">
  235. <view class="table-item" v-for="(item,index) in table_week" :key='index'>
  236. <view>{{ item.week ? item.week.slice(1) : '--'}}</view>
  237. <view>{{getDay(item.day)}}</view>
  238. </view>
  239. </view>
  240. <view class="table-tr">
  241. <view class="table-time" v-for="(item1,index1) in table_list" :key='index1'>
  242. <view v-for="(item,index) in item1" :key='index' class="time-item"
  243. :class="checkShedul(item.schedulings) ? 'me-item' : '' ">
  244. <view class="" v-if="item.schedulings.length>0" @click="lookTeacher(item.schedulings)">
  245. <view class="teacher" style="text-align: center;">
  246. {{item.schedulings.length}}位导师排班
  247. </view>
  248. </view>
  249. </view>
  250. </view>
  251. </view>
  252. </view>
  253. <view class="tips">
  254. <view class="tip-item">
  255. <span class="yellow">*</span>点击单元格可查看导师排班列表
  256. </view>
  257. </view>
  258. </view>
  259. <!-- 添加排班 -->
  260. <u-popup v-model="paibanList" mode="right">
  261. <view class="shedule-detail">
  262. <view class="pop_top">
  263. <text class="title">导师排班列表</text>
  264. </view>
  265. <view class="shedul-list">
  266. <view class="item" v-for="(item,index) in tableList" :key="index">
  267. <view class="item-right">
  268. <view class="text">
  269. <image src="../../static/images/icon-2.png" mode=""></image>
  270. <view class="time">
  271. {{item.scheduling.day}}
  272. </view>
  273. </view>
  274. <view class="text">
  275. <image src="../../static/images/icon-1.png" mode=""></image>
  276. <view class="time">
  277. {{item.scheduling.start_time}}-{{item.scheduling.end_time}}
  278. </view>
  279. </view>
  280. <view class="text">
  281. <image src="../../static/images/icon-3.png" mode=""></image>
  282. <view class="time">
  283. {{item.scheduling.teacher ? item.scheduling.teacher.truename :'--'}}
  284. </view>
  285. </view>
  286. <view class="text">
  287. <image src="../../static/images/icon-3.png" mode=""></image>
  288. <view class="time">
  289. {{item.scheduling.room_name }}
  290. </view>
  291. </view>
  292. </view>
  293. </view>
  294. </view>
  295. </view>
  296. </u-popup>
  297. </view>
  298. <tab-bar :current="1"></tab-bar>
  299. </view>
  300. </template>
  301. <script>
  302. export default {
  303. data() {
  304. return {
  305. form: {
  306. status: 1,
  307. room_type: 1,
  308. room_name: '',
  309. room_id: '',
  310. max_student_nums:'',
  311. },
  312. roomList: [],
  313. roomShow: false,
  314. teacher_show: false,
  315. time_detail: '', //预约时间弹框
  316. stu_show: false, //学生信息弹框
  317. stu_detail: '', //查看学生详情
  318. date: [1, 1, 1, 1, 1, 1, 1],
  319. time_list: [1, 1, 1, 1, 1, 1],
  320. current_time: 0, //当前时间
  321. current_date: 0,
  322. current_tab: 0, //本周下周
  323. tab_list: ['本周', '下周'],
  324. table_week: 7,
  325. time_list: [],
  326. current_item: 0, //当前周索引
  327. now_date: '', //今天日期日期
  328. shedule_list: [], //排班列表
  329. teacher_id: '',
  330. time: '', //当前选中的时间段的内容--传参添加页面使用
  331. table_list: [], //表格列数
  332. day: '', //当天日期
  333. notice: '', //通知公告
  334. now_time: '',
  335. now_list: [],
  336. cancel_detail: '',
  337. cancel_show: false, //取消排班
  338. paibanList: false,
  339. tableList: []
  340. }
  341. },
  342. async onShow() {
  343. await this.getNowDate()
  344. await this.getSheuling()
  345. //await this.getList()
  346. },
  347. onLoad() {
  348. if (this.is_weixin()) {
  349. this.navTitle()
  350. }
  351. this.notice = []
  352. this.teacher_id = this.$store.state.vuex_user.type_id
  353. this.getNotice()
  354. this.getSetting()
  355. },
  356. computed: {
  357. getEmpty() {
  358. let a = true
  359. for (let i in this.shedule_list) {
  360. console.log(i, this.shedule_list[i].scheduling, 'YYYYYYYY')
  361. // console.log(this.shedule_list[i-1], 'YYTTTTTTTT')
  362. if (this.shedule_list[i].scheduling != null) {
  363. a = false
  364. break
  365. }
  366. }
  367. return a
  368. },
  369. },
  370. methods: {
  371. handleClose() {
  372. this.form = {
  373. status: 1,
  374. room_type: 0,
  375. room_name: '',
  376. room_id: '',
  377. }
  378. this.teacher_show = false
  379. },
  380. //获取配置项
  381. getSetting() {
  382. this.$u.get('/base/setting-key', {
  383. key: 'CLASS_ROOM_LIST'
  384. }).then(res => {
  385. this.roomList = JSON.parse(res.data.value)
  386. })
  387. },
  388. // 点击actionSheet回调
  389. actionSheetCallback(e) {
  390. console.log(e, 'ppp')
  391. this.form.room_id = e[0].value
  392. this.form.room_name = e[0].label
  393. },
  394. checkShedul(arr) {
  395. var status = false
  396. if (arr.length > 0) {
  397. arr.map((item) => {
  398. if (item.teacher_id == this.teacher_id) {
  399. status = true
  400. return
  401. }
  402. })
  403. } else {
  404. status = false
  405. }
  406. return status
  407. },
  408. //判断是否是微信
  409. is_weixin() {
  410. let ua = navigator.userAgent.toLowerCase();
  411. return ua.indexOf('micromessenger') != -1;
  412. },
  413. navTitle() {
  414. let navTitle = document.getElementsByTagName('uni-page-head');
  415. navTitle[0].style.display = 'none'
  416. },
  417. //取消排班
  418. cancelShedule(item) {
  419. console.log(item.scheduling, 'ppp')
  420. this.cancel_detail = item.scheduling
  421. this.cancel_show = true
  422. },
  423. sure_cancel() {
  424. let id = this.cancel_detail.id
  425. this.$u.delete('/mentor/scheduling/' + id).then(res => {
  426. console.log(res, 'ppp')
  427. if (res.code == 200) {
  428. uni.showToast({
  429. title: '取消排班成功',
  430. icon: 'none'
  431. })
  432. }
  433. this.cancel_show = false
  434. this.getSheuling()
  435. })
  436. },
  437. //获取通知公告
  438. getNotice() {
  439. this.$u.get('/notice').then(res => {
  440. console.log(res, 'pppppp')
  441. if (res.data.notice) {
  442. this.notice.push(res.data.notice)
  443. }
  444. })
  445. },
  446. //姓名截取 获取前三个字
  447. getName(name) {
  448. if (name) {
  449. return name.truename.substr(0, 3)
  450. } else {
  451. return '--'
  452. }
  453. },
  454. //日期截取
  455. getDay(day) {
  456. if (day) {
  457. return day.slice(5)
  458. }
  459. },
  460. //查看学生信息
  461. stuDetail(item) {
  462. console.log(item, 'item')
  463. this.stu_show = true
  464. this.stu_detail = item
  465. },
  466. //查看导师列表
  467. lookTeacher(item) {
  468. console.log(item)
  469. this.paibanList = true
  470. this.tableList = item
  471. },
  472. //获取值班列表
  473. // async getList() {
  474. // console.log(this.current_tab, '当前时间')
  475. // if (this.current_tab == 1) {
  476. // if (this.current_date != 0) {
  477. // } else {
  478. // this.now_date = this.table_week[0].day
  479. // this.current_date = 0
  480. // }
  481. // }
  482. // console.log(this.now_date, '当前时间')
  483. // let data = {
  484. // day: this.now_date,
  485. // time_id: this.current_time == 0 ? '' : this.current_time,
  486. // }
  487. // await this.$u.get('/mentor/scheduling', data).then(res => {
  488. // console.log(res, '我的值班信息')
  489. // this.shedule_list = res.data.list
  490. // })
  491. // },
  492. //获取排班信息
  493. async getSheuling() {
  494. await this.$u.get('/mentor/scheduling-calendar', {
  495. type: this.current_tab
  496. }).then(res => {
  497. console.log(res, '排班信息')
  498. this.time_list = res.data.times
  499. this.table_list = res.data.list
  500. this.time = res.data.times[0]
  501. let table_week = res.data.days
  502. table_week.map((item, index) => {
  503. // if (this.current_tab == 0) {
  504. // this.now_date = this.day
  505. // }
  506. // this.now_date = this.table_week[this.current_date].day
  507. if (this.now_date == item.day) {
  508. this.current_date = index
  509. }
  510. switch (item.week) {
  511. case 0:
  512. item.week = '周日'
  513. break
  514. case 1:
  515. item.week = '周一'
  516. break
  517. case 2:
  518. item.week = '周二'
  519. break
  520. case 3:
  521. item.week = '周三'
  522. break
  523. case 4:
  524. item.week = '周四'
  525. break
  526. case 5:
  527. item.week = '周五'
  528. break
  529. case 6:
  530. item.week = '周六'
  531. break
  532. }
  533. return item
  534. })
  535. this.table_week = table_week
  536. this.now_date = this.table_week[this.current_date].day
  537. let data = res.data.list
  538. this.shedule_list = data[this.current_date]
  539. console.log(this.shedule_list)
  540. console.log(this.current_date, 'YYYYYYYYYYY')
  541. })
  542. },
  543. //获取当前年月日
  544. getNowDate() {
  545. //获取当前年月日
  546. let nowDate = new Date()
  547. let year = nowDate.getFullYear()
  548. let month = nowDate.getMonth() + 1
  549. let date = nowDate.getDate()
  550. month = month >= 10 ? month : '0' + month
  551. date = date >= 10 ? date : '0' + date
  552. this.day = this.now_date = year + '-' + month + '-' + date
  553. console.log(this.now_date, '09--25')
  554. },
  555. //选择日期
  556. changeDate(index, item) {
  557. console.log(index, 'index----')
  558. console.log(item, 'index----')
  559. this.current_date = index
  560. this.now_date = item.day
  561. this.getSheuling()
  562. },
  563. //选择时间段
  564. changeTime(item, index) {
  565. console.log(item, 'llllllll')
  566. if (item.id) {
  567. this.current_time = index
  568. this.time = item
  569. } else {
  570. this.current_time = item
  571. }
  572. },
  573. //选择本周还是下周
  574. async changTab(index) {
  575. this.current_tab = index
  576. if (index == 0) {
  577. this.now_date = this.day
  578. }
  579. if (index == 1) {
  580. this.current_date = 0
  581. this.now_date = this.table_week[0].day
  582. console.log(this.now_date, 'pppp')
  583. }
  584. console.log(this.now_date, 'pppp')
  585. this.getSheuling();
  586. },
  587. // //添加排班
  588. // add() {
  589. // uni.navigateTo({
  590. // url: './add?time_id=' + this.current_time + '&day=' + this.now_date +
  591. // '&start_time=' + this
  592. // .time.start_time + '&end_time=' + this.time.end_time
  593. // })
  594. // },
  595. //确认添加排班
  596. sure_choose() {
  597. // let data = {
  598. // status: 1,
  599. // teacher_id: this.$store.state.vuex_user.type_id,
  600. // day: this.now_date,
  601. // time_ids: this.time.id
  602. // }
  603. if(this.form.max_student_nums==''){
  604. uni.showToast({
  605. title:'请输入最大预约人数',
  606. icon:'none'
  607. })
  608. return
  609. }
  610. if(!this.form.room_id){
  611. uni.showToast({
  612. title:'请选择值班教室',
  613. icon:'none'
  614. })
  615. return
  616. }
  617. this.form.teacher_id = this.$store.state.vuex_user.type_id
  618. this.form.day = this.now_date
  619. this.form.time_ids = this.time.id
  620. this.$u.post('/mentor/scheduling', this.form).then(res => {
  621. console.log(res, '添加排班')
  622. if (res.code == 200) {
  623. uni.showToast({
  624. title: '添加成功',
  625. icon: 'none'
  626. })
  627. this.teacher_show = false
  628. this.getSheuling()
  629. } else {
  630. }
  631. })
  632. }
  633. }
  634. }
  635. </script>
  636. <style lang="scss" scoped>
  637. .sheduling {
  638. padding-bottom: 70px;
  639. .shedule-detail {
  640. width: 270px;
  641. display: flex;
  642. flex-direction: column;
  643. align-items: center;
  644. .pop_top {
  645. margin-top: 32px;
  646. text {
  647. display: block;
  648. font-size: 13px;
  649. color: rgba(40, 40, 40, 0.5);
  650. text-align: center;
  651. line-height: 18px;
  652. }
  653. .title {
  654. font-size: 18px;
  655. font-weight: bold;
  656. color: #282828;
  657. line-height: 25px;
  658. margin-bottom: 2px;
  659. }
  660. }
  661. .shedul-list {
  662. width: 90%;
  663. overflow-y: auto;
  664. height: 85vh;
  665. }
  666. .item {
  667. display: flex;
  668. position: relative;
  669. align-items: center;
  670. padding: 10px;
  671. margin-top: 12px;
  672. font-size: 13px;
  673. background: rgba(234, 237, 242, .28);
  674. border-radius: 7px;
  675. .tips {
  676. position: absolute;
  677. width: 57px;
  678. height: 20px;
  679. background: #C1915A;
  680. line-height: 20px;
  681. font-size: 12px;
  682. font-family: PingFang SC;
  683. font-weight: 400;
  684. color: #FFFFFF;
  685. opacity: 1;
  686. opacity: 1;
  687. right: 12px;
  688. z-index: 2;
  689. top: 0;
  690. text-align: center;
  691. border-radius: 0px 0px 6px 6px;
  692. }
  693. .item-left {
  694. margin-right: 10px;
  695. .image {
  696. height: 42px;
  697. width: 42px;
  698. border: solid 1px;
  699. border-radius: 50%;
  700. background-position: center;
  701. background-repeat: no-repeat;
  702. background-size: cover;
  703. }
  704. .name {
  705. font-size: 10px;
  706. font-family: PingFang SC;
  707. font-weight: 400;
  708. text-align: center;
  709. line-height: 20px;
  710. color: #292929;
  711. opacity: 1;
  712. width: 50px;
  713. /*指定宽度*/
  714. word-break: keep-all;
  715. /* 不换行 */
  716. white-space: nowrap;
  717. /* 强制在同一行内显示所有文本,直到文本结束或者遭遇 br 对象。不换行 */
  718. overflow: hidden;
  719. /* 内容超出宽度时隐藏超出部分的内容 */
  720. text-overflow: ellipsis;
  721. /* IE 专有属性,当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  722. }
  723. }
  724. .item-right {
  725. flex: 1;
  726. .text {
  727. line-height: 17px;
  728. font-size: 12px;
  729. font-family: PingFang SC;
  730. font-weight: 400;
  731. color: #282828;
  732. opacity: 1;
  733. image {
  734. height: 13px;
  735. width: 13px;
  736. display: inline-block;
  737. margin-right: 4px;
  738. }
  739. .time {
  740. font-family: PingFang SC;
  741. font-weight: 400;
  742. color: #282828;
  743. opacity: 1;
  744. display: inline-block;
  745. margin-top: 4px;
  746. }
  747. }
  748. }
  749. }
  750. }
  751. //添加排班弹框
  752. .pop_wrap {
  753. width: 290px;
  754. height: 250px;
  755. display: flex;
  756. flex-direction: column;
  757. align-items: center;
  758. .pop_top {
  759. margin-top: 32px;
  760. text {
  761. display: block;
  762. font-size: 13px;
  763. color: rgba(40, 40, 40, 0.5);
  764. text-align: center;
  765. line-height: 18px;
  766. }
  767. .title {
  768. font-size: 18px;
  769. font-weight: bold;
  770. color: #282828;
  771. line-height: 25px;
  772. margin-bottom: 2px;
  773. }
  774. }
  775. .pop_center {
  776. margin-top: 22px;
  777. text {
  778. font-size: 16px;
  779. font-family: PingFang SC;
  780. font-weight: 400;
  781. line-height: 20px;
  782. color: #353535;
  783. opacity: 0.79;
  784. display: block;
  785. margin-bottom: 6px;
  786. }
  787. }
  788. .pop_bootom {
  789. margin-top: 30px;
  790. button {
  791. border: 1px solid #FF5A26;
  792. width: 98px;
  793. // height: 36px;
  794. padding: 0 5px;
  795. line-height: 36px;
  796. background-color: #fff;
  797. color: #FF5A26;
  798. }
  799. }
  800. }
  801. //查看学生信息弹框
  802. .student-show {
  803. padding-bottom: 5px;
  804. .stu-title {
  805. font-size: 20px;
  806. font-family: PingFang SC;
  807. font-weight: bold;
  808. line-height: 20px;
  809. color: #282828;
  810. opacity: 1;
  811. text-align: center;
  812. padding: 20px 0 30px;
  813. }
  814. .stu-mess {
  815. display: flex;
  816. padding: 0 22px;
  817. image {
  818. height: 75px;
  819. width: 75px;
  820. margin-right: 14px;
  821. border-radius: 9px;
  822. }
  823. .right {
  824. flex: 1;
  825. .stu-text {
  826. font-size: 13px;
  827. font-family: PingFang SC;
  828. font-weight: 400;
  829. line-height: 20px;
  830. color: #282828;
  831. overflow: hidden;
  832. display: -webkit-box; //将对象作为弹性伸缩盒子模型显示;
  833. text-overflow: ellipsis; //溢出部分用省略号代替
  834. -webkit-line-clamp: 2; //设置文本显示两行
  835. -webkit-box-orient: vertical; //从上到下排列子元素;
  836. white-space: normal;
  837. }
  838. }
  839. }
  840. .e-mail {
  841. margin: 18px 22px 10px;
  842. height: 36px;
  843. line-height: 36px;
  844. font-size: 14px;
  845. font-family: PingFang SC;
  846. font-weight: bold;
  847. color: rgba(40, 40, 40, .78);
  848. border-bottom: 1px solid rgba(112, 112, 112, .06);
  849. }
  850. .remark-title {
  851. margin: 10px 22px 0px;
  852. padding: 5px;
  853. font-size: 13px;
  854. font-family: PingFang SC;
  855. font-weight: bold;
  856. line-height: 20px;
  857. color: #282828;
  858. opacity: 0.61;
  859. }
  860. .remark {
  861. margin: 0px 22px 22px;
  862. font-size: 12px;
  863. font-family: PingFang SC;
  864. font-weight: 400;
  865. line-height: 20px;
  866. color: #282828;
  867. opacity: 0.54;
  868. padding: 5px;
  869. overflow: hidden;
  870. display: -webkit-box; //将对象作为弹性伸缩盒子模型显示;
  871. text-overflow: ellipsis; //溢出部分用省略号代替
  872. -webkit-line-clamp: 3; //设置文本显示两行
  873. -webkit-box-orient: vertical; //从上到下排列子元素;
  874. white-space: normal;
  875. // border-bottom: 1px solid rgba(112, 112, 112, .06);
  876. }
  877. }
  878. .sheduling-top {
  879. display: flex;
  880. align-items: center;
  881. justify-items: center;
  882. height: 46px;
  883. background-color: #E6FFF0;
  884. padding: 0 30px;
  885. font-size: 13px;
  886. font-family: PingFang SC;
  887. font-weight: 400;
  888. color: #2B9155;
  889. image {
  890. height: 20px;
  891. width: 20px;
  892. margin-right: 9px;
  893. }
  894. .title {
  895. flex: 1;
  896. white-space: nowrap;
  897. /*设置不换行*/
  898. overflow: hidden;
  899. /*设置隐藏*/
  900. text-overflow: ellipsis;
  901. /*设置隐藏部分为省略号*/
  902. }
  903. }
  904. .tab {
  905. display: flex;
  906. align-items: center;
  907. width: 50%;
  908. margin: 0 auto;
  909. // background-color: #18B566;
  910. .item,
  911. .active-item {
  912. margin-top: 17px;
  913. view {
  914. display: block;
  915. }
  916. font-size: 18px;
  917. font-family: PingFang SC;
  918. font-weight: bold;
  919. line-height: 20px;
  920. color: rgba(113, 113, 113, .43);
  921. opacity: 0.43;
  922. opacity: 1;
  923. flex: 1;
  924. text-align: center;
  925. .week {
  926. padding-bottom: 12px;
  927. }
  928. .line {
  929. width: 25px;
  930. height: 4px;
  931. background: #96203a;
  932. opacity: 1;
  933. border-radius: 1px;
  934. display: block;
  935. margin: 0 auto;
  936. }
  937. }
  938. .active-item {
  939. font-size: 18px;
  940. font-family: PingFang SC;
  941. font-weight: bold;
  942. line-height: 20px;
  943. color: #96203a;
  944. .week {
  945. padding-bottom: 8px;
  946. }
  947. }
  948. }
  949. .content {
  950. padding: 17px;
  951. .top {
  952. display: flex;
  953. align-items: center;
  954. justify-items: center;
  955. background: rgba(238, 238, 238, .46);
  956. border-radius: 12px 12px 0 0;
  957. overflow: hidden;
  958. .item,
  959. .active-item {
  960. padding: 9px 0;
  961. flex: 1;
  962. text-align: center;
  963. .week {
  964. font-size: 14px;
  965. font-family: PingFang SC;
  966. font-weight: 500;
  967. line-height: 20px;
  968. color: #282828;
  969. opacity: 1;
  970. }
  971. .date {
  972. font-size: 12px;
  973. font-family: PingFang SC;
  974. font-weight: 400;
  975. line-height: 20px;
  976. color: #282828;
  977. opacity: 0.6;
  978. }
  979. }
  980. .active-item {
  981. background-color: #96203a;
  982. .week,
  983. .date {
  984. color: #fff;
  985. }
  986. }
  987. }
  988. .shedule {
  989. display: flex;
  990. position: relative;
  991. .add {
  992. display: flex;
  993. text-align: center;
  994. align-items: center;
  995. flex-direction: column;
  996. color: #FFFFFF;
  997. opacity: 1;
  998. image {
  999. width: 60%;
  1000. margin-top: 25%;
  1001. }
  1002. .add-buttom {
  1003. font-size: 14px;
  1004. color: #292929;
  1005. padding: 10px 20px;
  1006. background-color: #3E7855;
  1007. color: #fff;
  1008. margin-top: 30px;
  1009. border-radius: 10px;
  1010. }
  1011. .add-text {
  1012. color: #3E7855;
  1013. font-size: 14px;
  1014. margin-top: 40px;
  1015. }
  1016. }
  1017. .left {
  1018. flex: 0 0 100px;
  1019. height: 425px;
  1020. opacity: 1;
  1021. overflow-y: auto;
  1022. border-radius: 0px 0px 0px 12px;
  1023. .left_1 {
  1024. height: 100%;
  1025. width: 92px;
  1026. background: #F7F7F7;
  1027. }
  1028. .item,
  1029. .active-item {
  1030. font-size: 13px;
  1031. padding: 15px 0;
  1032. text-align: center;
  1033. display: flex;
  1034. justify-content: center;
  1035. align-items: center;
  1036. position: relative;
  1037. .all {
  1038. height: 13px;
  1039. width: 13px;
  1040. margin-right: 6px;
  1041. }
  1042. .jian {
  1043. position: absolute;
  1044. height: 14px;
  1045. width: 8px;
  1046. right: -8px;
  1047. }
  1048. }
  1049. .active-item {
  1050. background-color: #96203a;
  1051. color: #FFFFFF;
  1052. }
  1053. }
  1054. .right {
  1055. flex: 1;
  1056. margin-left: 3px;
  1057. height: 425px;
  1058. overflow-y: scroll;
  1059. .item {
  1060. display: flex;
  1061. position: relative;
  1062. align-items: center;
  1063. padding: 10px;
  1064. margin-top: 12px;
  1065. font-size: 13px;
  1066. background: rgba(234, 237, 242, .28);
  1067. border-radius: 7px;
  1068. .tips {
  1069. position: absolute;
  1070. width: 57px;
  1071. height: 20px;
  1072. background: #C1915A;
  1073. line-height: 20px;
  1074. font-size: 12px;
  1075. font-family: PingFang SC;
  1076. font-weight: 400;
  1077. color: #FFFFFF;
  1078. opacity: 1;
  1079. opacity: 1;
  1080. right: 12px;
  1081. z-index: 2;
  1082. top: 0;
  1083. text-align: center;
  1084. border-radius: 0px 0px 6px 6px;
  1085. }
  1086. .item-left {
  1087. margin-right: 10px;
  1088. .image {
  1089. height: 42px;
  1090. width: 42px;
  1091. border: solid 1px;
  1092. border-radius: 50%;
  1093. background-position: center;
  1094. background-repeat: no-repeat;
  1095. background-size: cover;
  1096. }
  1097. .name {
  1098. font-size: 10px;
  1099. font-family: PingFang SC;
  1100. font-weight: 400;
  1101. text-align: center;
  1102. line-height: 20px;
  1103. color: #292929;
  1104. opacity: 1;
  1105. width: 50px;
  1106. /*指定宽度*/
  1107. word-break: keep-all;
  1108. /* 不换行 */
  1109. white-space: nowrap;
  1110. /* 强制在同一行内显示所有文本,直到文本结束或者遭遇 br 对象。不换行 */
  1111. overflow: hidden;
  1112. /* 内容超出宽度时隐藏超出部分的内容 */
  1113. text-overflow: ellipsis;
  1114. /* IE 专有属性,当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  1115. }
  1116. }
  1117. .item-right {
  1118. flex: 1;
  1119. .text {
  1120. line-height: 17px;
  1121. font-size: 12px;
  1122. font-family: PingFang SC;
  1123. font-weight: 400;
  1124. color: #282828;
  1125. opacity: 1;
  1126. image {
  1127. height: 13px;
  1128. width: 13px;
  1129. display: inline-block;
  1130. margin-right: 4px;
  1131. }
  1132. .time {
  1133. font-family: PingFang SC;
  1134. font-weight: 400;
  1135. color: #282828;
  1136. opacity: 1;
  1137. display: inline-block;
  1138. margin-top: 4px;
  1139. }
  1140. }
  1141. }
  1142. .cancel {
  1143. width: 58px;
  1144. height: 23px;
  1145. line-height: 23px;
  1146. border: 1px solid rgba(193, 145, 90, 0.44);
  1147. border-radius: 12px;
  1148. font-size: 12px;
  1149. font-family: PingFang SC;
  1150. font-weight: 500;
  1151. line-height: 20px;
  1152. color: #C1915A;
  1153. opacity: 1;
  1154. text-align: center;
  1155. }
  1156. }
  1157. }
  1158. }
  1159. .table {
  1160. .tips {
  1161. display: flex;
  1162. margin-top: 25px;
  1163. .tip-item {
  1164. flex: 1;
  1165. font-size: 11px;
  1166. font-family: PingFang SC;
  1167. font-weight: 400;
  1168. line-height: 20px;
  1169. color: rgba(40, 40, 40, .56);
  1170. opacity: 1;
  1171. .yellow {
  1172. color: #3E7855;
  1173. }
  1174. }
  1175. }
  1176. .title {
  1177. font-size: 18px;
  1178. font-family: PingFang SC;
  1179. font-weight: bold;
  1180. line-height: 20px;
  1181. color: #282828;
  1182. opacity: 1;
  1183. margin: 30px 0
  1184. }
  1185. .table_1 {
  1186. background-color: rgba(249, 250, 252, 1);
  1187. .table-week {
  1188. display: flex;
  1189. align-items: center;
  1190. justify-content: center;
  1191. .table-item {
  1192. display: flex;
  1193. justify-content: center;
  1194. flex-direction: column;
  1195. height: 53px;
  1196. // line-height: 53px;
  1197. text-align: center;
  1198. flex: 1;
  1199. border-right: solid 1px rgba(112, 112, 112, .08);
  1200. view:last-child {
  1201. font-size: 10px;
  1202. }
  1203. }
  1204. }
  1205. .table-tr {
  1206. display: flex;
  1207. .table-time {
  1208. flex: 1;
  1209. .time-item {
  1210. display: flex;
  1211. justify-content: center;
  1212. align-items: center;
  1213. flex-flow: column;
  1214. height: 53px;
  1215. border-top: solid 1px rgba(112, 112, 112, .08);
  1216. border-right: solid 1px rgba(112, 112, 112, .08);
  1217. font-size: 10px;
  1218. font-family: PingFang SC;
  1219. font-weight: 400;
  1220. color: #333;
  1221. opacity: 1;
  1222. }
  1223. .active-time-item {
  1224. display: flex;
  1225. justify-content: center;
  1226. align-items: center;
  1227. flex-flow: column;
  1228. height: 53px;
  1229. border-top: solid 1px rgba(255, 255, 255, .08);
  1230. border-right: solid 1px rgba(255, 255, 255, .08);
  1231. font-size: 10px;
  1232. font-family: PingFang SC;
  1233. font-weight: 400;
  1234. color: #333;
  1235. opacity: 1;
  1236. background-color: rgba(62, 120, 85, 1);
  1237. .teacher {
  1238. font-size: 10px;
  1239. font-family: PingFang SC;
  1240. font-weight: 500;
  1241. line-height: 20px;
  1242. color: #FFFFFF;
  1243. opacity: 1;
  1244. text-align: center;
  1245. white-space: nowrap;
  1246. /*设置不换行*/
  1247. overflow: hidden;
  1248. opacity: 1;
  1249. }
  1250. .stu {
  1251. text-align: center;
  1252. font-size: 10px;
  1253. font-family: PingFang SC;
  1254. font-weight: 400;
  1255. line-height: 20px;
  1256. color: #FEEF7E;
  1257. opacity: 1;
  1258. }
  1259. }
  1260. .me-item {
  1261. display: flex;
  1262. justify-content: center;
  1263. align-items: center;
  1264. flex-flow: column;
  1265. height: 53px;
  1266. border-top: solid 1px rgba(255, 255, 255, .08);
  1267. border-right: solid 1px rgba(255, 255, 255, .08);
  1268. font-size: 10px;
  1269. font-family: PingFang SC;
  1270. font-weight: 400;
  1271. color: #333;
  1272. opacity: 1;
  1273. background-color: rgba(193, 145, 90, 1);
  1274. .teacher {
  1275. font-size: 10px;
  1276. font-family: PingFang SC;
  1277. font-weight: 500;
  1278. line-height: 20px;
  1279. color: #FFFFFF;
  1280. opacity: 1;
  1281. }
  1282. .stu {
  1283. font-size: 10px;
  1284. font-family: PingFang SC;
  1285. font-weight: 400;
  1286. line-height: 20px;
  1287. color: #FEEF7E;
  1288. opacity: 1;
  1289. text-align: center;
  1290. }
  1291. }
  1292. }
  1293. }
  1294. }
  1295. }
  1296. }
  1297. }
  1298. </style>