index.vue 35 KB

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