index.vue 33 KB

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