scheduling.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;"
  3. body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  4. <div slot="header">
  5. <span>排期管理</span>
  6. </div>
  7. <!-- 排班 -->
  8. <el-card class="box-card" style="margin-bottom: 10px;">
  9. <el-container class="scheduling-box">
  10. <el-aside width="400px" class="scheduling-aside" v-loading="loading">
  11. <div class="date-box">
  12. <div class="title">{{userDetail.user_name}}</div>
  13. <div class="sub-title">{{currentDate}} {{activeDateWeek}}</div>
  14. </div>
  15. <template>
  16. <div class="date-box">
  17. <div>
  18. <div class="flex-between">
  19. <div class="date-title">{{ userDetail.type === 1 ? '休息' : '上班' }}时间设置</div>
  20. </div>
  21. <el-form ref="form" :model="form">
  22. <el-form-item>
  23. <el-radio-group v-model="form.is_all_day">
  24. <el-radio :label="0">选择时间</el-radio>
  25. <el-radio :label="1">全天</el-radio>
  26. </el-radio-group>
  27. </el-form-item>
  28. <el-form-item v-if='form.is_all_day == 0'>
  29. <el-button type="primary" size="small" :disabled="isExpire"
  30. @click="handle('add')" style="margin-bottom:5px;">添 加
  31. </el-button>
  32. <div v-for="(item, index) in form.schedulingTime"
  33. class="my_time_picker flex-between" style="margin-bottom:5px;">
  34. <el-time-picker size="small" v-model="form.schedulingTime[index].start"
  35. :picker-options="startTimeChange(form, index)"
  36. placeholder="开始时间"></el-time-picker>
  37. <span style="margin: 0 10px">至</span>
  38. <el-time-picker size="small" v-model="form.schedulingTime[index].end"
  39. :picker-options="{
  40. selectableRange: `${form.schedulingTime[index].start} - ${defaultEndTime()}`
  41. }" placeholder="结束时间"></el-time-picker>
  42. <el-button icon="el-icon-delete" type="danger" size="mini"
  43. :disabled="isExpire" @click="handle('del', index)"
  44. style="margin-left:5px;"></el-button>
  45. </div>
  46. </el-form-item>
  47. <el-button size="small" :disabled="isExpire" @click="handle('delete')"
  48. icon="el-icon-delete" type="danger" :loading="loading"
  49. v-if='isShowDelete'>
  50. 删除
  51. </el-button>
  52. <el-button v-if="form.schedulingTime && form.schedulingTime.length > 0"
  53. type="primary" size="small" :disabled="isExpire" @click="handle('save')"
  54. :loading="loading">
  55. 保 存
  56. </el-button>
  57. </el-form>
  58. </div>
  59. </div>
  60. </template>
  61. </el-aside>
  62. <el-main class="scheduling-main">
  63. <div class="flex-between operate-box">
  64. <div>
  65. <el-select v-model="form.user_id" placeholder="请选择" style="margin-right:10px;"
  66. @change="userChange">
  67. <el-option v-for="item in userList" :key="item.user_id" :label="item.name"
  68. :value="item.user_id">
  69. </el-option>
  70. </el-select>
  71. <el-date-picker v-model="calendarDate" type="month" placeholder="选择日期"></el-date-picker>
  72. </div>
  73. <template>
  74. <el-button type="primary" size="small" :disabled="isExpire"
  75. @click="handle('openMonthDialog')">
  76. 批量设置当前月份
  77. </el-button>
  78. </template>
  79. </div>
  80. <el-calendar v-model="calendarDate">
  81. <template slot="dateCell" slot-scope="{date, data}">
  82. <div class="calendar-day-box" :class="isScheduling(data.day) && 'is-active'">
  83. <div v-if="data.type === 'current-month'" class="cell-box"
  84. @click="updateCurrentDate(data)">
  85. <el-popover placement="top-start" :title="data.day" width="170" trigger="hover">
  86. <p v-html="schedulingTimeText(data.day)" class="time-text"></p>
  87. <div slot="reference">
  88. <p class="day-text">{{ data.day.split('-')[2] }}</p>
  89. <span>{{schedulingLabelText(data.day)}}</span>
  90. </div>
  91. </el-popover>
  92. </div>
  93. </div>
  94. </template>
  95. </el-calendar>
  96. </el-main>
  97. </el-container>
  98. </el-card>
  99. <!-- 批量设置当月的排班时间--开始-->
  100. <el-dialog title="批量设置" :visible.sync="dialogScheduling" width="500px">
  101. <div class="date-box" style="border-top:1px solid #eee; padding-top:10px;padding-left:30px;">
  102. <el-form ref="form1" :model="form1">
  103. <el-form-item :label="`${userDetail.type === 1 ? '休息' : '上班'}时间`">
  104. <el-radio-group v-model="form1.is_all_day">
  105. <el-radio :label="0">选择时间</el-radio>
  106. <el-radio :label="1">全天</el-radio>
  107. </el-radio-group>
  108. </el-form-item>
  109. <el-form-item v-if='form1.is_all_day == 0' label="设定范围:">
  110. <el-button type="primary" size="small" :disabled="isExpire" @click="batchSetSchedule"
  111. style="margin-bottom:5px;">添 加
  112. </el-button>
  113. <div v-for="(item, index) in form1.schedulingTime" :key="index"
  114. class="my_time_picker flex-between" style="margin-bottom:5px;margin-left:80px;">
  115. <el-time-picker size="small" v-model="form1.schedulingTime[index].start"
  116. :picker-options="startTimeChange(form1, index)" placeholder="开始时间"
  117. style="width: 120px;"></el-time-picker>
  118. <span style="margin: 0 10px">至</span>
  119. <el-time-picker size="small" v-model="form1.schedulingTime[index].end" :picker-options="{
  120. selectableRange: `${form1.schedulingTime[index].start} - ${defaultEndTime()}`
  121. }" placeholder="结束时间" style="width: 120px;"></el-time-picker>
  122. <el-button icon="el-icon-delete" type="danger" size="small" :disabled="isExpire"
  123. @click="handle('batchDelete', index)" style="margin-left:5px;"></el-button>
  124. </div>
  125. </el-form-item>
  126. </el-form>
  127. </div>
  128. <div slot="footer" class="dialog-footer">
  129. <el-button type="primary" @click="dialogScheduling = false">关 闭</el-button>
  130. <el-button type="primary" @click="saveMonthScheduling" :loading="loading">提 交</el-button>
  131. </div>
  132. </el-dialog>
  133. <!-- 批量设置讲师当月的排班时间--结束-->
  134. </el-card>
  135. </div>
  136. <script>
  137. const app = new Vue({
  138. el: '#app',
  139. data: {
  140. loading: false,
  141. // 是否显示排期删除按钮
  142. isShowDelete: false,
  143. // 批量设置弹窗
  144. dialogScheduling: false,
  145. // 单个日期表单
  146. form: {},
  147. // 批量设置表单
  148. form1: {},
  149. // 用户列表
  150. userList: [],
  151. // 排班时间段数组
  152. timeData: [],
  153. // 当前日期
  154. currentDate: '',
  155. // 当前用户id
  156. currentUserId: 0,
  157. // 日历组件日期
  158. calendarDate: new Date(),
  159. // 当前月份
  160. currentMonth: new Date().getMonth() + 1,
  161. default_start_time: '',
  162. default_end_time: '',
  163. },
  164. computed: {
  165. // 当前日期星期
  166. activeDateWeek() {
  167. const weekArray = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
  168. return weekArray[new Date(this.currentDate).getDay()]
  169. },
  170. // 是否已过期
  171. isExpire() {
  172. // 管理员默认可以修改已过期的排期
  173. return false
  174. // 保留注释原因:后续管理员可能改为不可修改已过期的排期
  175. // return new Date(this.currentDate).getTime() < new Date(this.getSpecificDate()).getTime()
  176. },
  177. userDetail() {
  178. return this.userList.find(item => item.user_id === this.currentUserId) || {}
  179. }
  180. },
  181. watch: {
  182. calendarDate(val) {
  183. this.currentDate = this.getSpecificDate(val)
  184. this.currentMonth = this.currentDate.split('-')[1]
  185. this.loadData();
  186. }
  187. },
  188. mounted() {
  189. this.currentDate = this.getSpecificDate();
  190. this.loadData();
  191. },
  192. methods: {
  193. handle(type, index) {
  194. switch (type) {
  195. case 'save':
  196. this.saveScheduling()
  197. break;
  198. case 'openMonthDialog':
  199. this.form1 = {
  200. is_all_day: 1,
  201. user_id: this.currentUserId,
  202. type: 1,
  203. schedulingTime: [
  204. {
  205. start: this.parseTime(this.defaultStartTime()),
  206. end: this.parseTime(this.defaultEndTime())
  207. }
  208. ]
  209. };
  210. this.dialogScheduling = true;
  211. break;
  212. case 'add':
  213. const lastIndex = this.form.schedulingTime.length - 1;
  214. let startTime;
  215. if (lastIndex >= 0 && this.form.schedulingTime[lastIndex].end) {
  216. startTime = this.form.schedulingTime[lastIndex].end;
  217. } else {
  218. startTime = this.parseTime(this.defaultStartTime());
  219. }
  220. this.form.schedulingTime.push({
  221. start: startTime,
  222. end: this.parseTime(this.defaultEndTime())
  223. });
  224. break;
  225. case 'del': // 删除单个排班时间段
  226. if (this.form.schedulingTime[index].id > 0) {
  227. this.deleteTimeData(this.form.schedulingTime[index], index);
  228. } else {
  229. this.form.schedulingTime.splice(index, 1)
  230. }
  231. break;
  232. case 'batchDelete': // 批量删除排班时间段
  233. this.form1.schedulingTime.splice(index, 1)
  234. break
  235. case 'delete': // 删除当日排班
  236. this.$confirm('此操作将删除当日排期, 是否继续?', '提示', {
  237. confirmButtonText: '确定',
  238. cancelButtonText: '取消',
  239. type: 'warning'
  240. }).then(() => {
  241. this.deleteScheduling();
  242. })
  243. break;
  244. }
  245. },
  246. // 更新当前日期数据
  247. updateCurrentDate(data) {
  248. data.isSelected = true
  249. // 更新当前日期
  250. this.currentDate = data.day
  251. this.getDetail(data.day)
  252. },
  253. // 批量设置排班
  254. batchSetSchedule() {
  255. const lastIndex = this.form1.schedulingTime.length - 1;
  256. let startTime;
  257. if (lastIndex >= 0 && this.form1.schedulingTime[lastIndex].end) {
  258. startTime = this.form1.schedulingTime[lastIndex].end;
  259. } else {
  260. startTime = this.parseTime(this.defaultStartTime());
  261. }
  262. this.form1.schedulingTime.push({
  263. start: startTime,
  264. end: this.parseTime(this.defaultEndTime())
  265. });
  266. },
  267. // 用户列表选择
  268. userChange(id) {
  269. this.currentUserId = id
  270. this.loadData()
  271. },
  272. // 日历日期排期文本处理
  273. schedulingLabelText(value) {
  274. const scheduleInfo = this.isScheduling(value)
  275. if (scheduleInfo) {
  276. const label = scheduleInfo.type === 1 ? '休息' : '上班'
  277. return scheduleInfo.is_all_day === 1 ? `全天${label}` : label
  278. }
  279. return `全天${this.userDetail.type === 1 ? '上班' : '休息'}`
  280. },
  281. // 排班时间段文本处理
  282. schedulingTimeText(value) {
  283. let result = '';
  284. const scheduleInfo = this.isScheduling(value);
  285. if (!scheduleInfo) return result;
  286. if (Array.isArray(scheduleInfo.schedulingTime) && scheduleInfo.is_all_day === 0) {
  287. for (const timeSlot of scheduleInfo.schedulingTime) {
  288. if (timeSlot.start_time && timeSlot.end_time) {
  289. result += `<br/>[${timeSlot.start_time} - ${timeSlot.end_time}]`;
  290. }
  291. }
  292. } else {
  293. result = '全天';
  294. }
  295. return result;
  296. },
  297. // 是否有排班
  298. isScheduling(value) {
  299. if (this.timeData.length > 0) {
  300. let findResult = this.timeData.find(item => item.date_time === value)
  301. if (findResult) {
  302. return findResult
  303. }
  304. }
  305. return false
  306. },
  307. // 初始化新表单
  308. initData() {
  309. return {
  310. is_all_day: 1,
  311. user_id: this.currentUserId,
  312. type: 1,
  313. date_time: this.getSpecificDate(this.currentDate),
  314. schedulingTime: [
  315. {
  316. start: this.parseTime(this.defaultStartTime()),
  317. end: this.parseTime(this.defaultEndTime())
  318. }
  319. ],
  320. business_time: `${this.defaultStartTime()} - ${this.defaultEndTime()}`
  321. }
  322. },
  323. // 获取默认开始时间
  324. defaultStartTime() {
  325. return this.formatTime(this.default_start_time);
  326. },
  327. // 获取默认结束时间
  328. defaultEndTime() {
  329. return this.formatTime(this.default_end_time);
  330. },
  331. formatTime(dateTimeString) {
  332. // 将日期时间字符串转换为 Date 对象
  333. const date = new Date(dateTimeString);
  334. // 获取小时、分钟和秒,并确保它们是两位数显示
  335. const hours = String(date.getHours()).padStart(2, '0');
  336. const minutes = String(date.getMinutes()).padStart(2, '0');
  337. const seconds = String(date.getSeconds()).padStart(2, '0');
  338. // 返回 hh:mm:ss 格式的时间字符串
  339. return `${hours}:${minutes}:${seconds}`;
  340. },
  341. // 上班开始时间段
  342. startTimeChange(formData, index) {
  343. if (index === 0) {
  344. return {
  345. selectableRange: `${this.defaultStartTime()} - ${this.defaultEndTime()}`
  346. }
  347. }
  348. const prevEndTime = formData.schedulingTime[index - 1]?.end;
  349. if (!prevEndTime) return {
  350. selectableRange: `${this.defaultStartTime()} - ${this.defaultEndTime()}`
  351. };
  352. return {
  353. selectableRange: `${this.formatTimeValue(prevEndTime)} - ${this.defaultEndTime()}`
  354. }
  355. },
  356. formatTimeValue(time) {
  357. if (!time) return '';
  358. let date;
  359. if (time instanceof Date) {
  360. date = time;
  361. } else if (typeof time === 'string') {
  362. const [hours, minutes, seconds] = time.split(':').map(Number);
  363. date = new Date();
  364. date.setHours(hours || 0, minutes || 0, seconds || 0);
  365. } else {
  366. return '';
  367. }
  368. if (isNaN(date.getTime())) return '';
  369. const hours = String(date.getHours()).padStart(2, '0');
  370. const minutes = String(date.getMinutes()).padStart(2, '0');
  371. const seconds = String(date.getSeconds()).padStart(2, '0');
  372. return `${hours}:${minutes}:${seconds}`;
  373. },
  374. parseTime(timeStr) {
  375. if (!timeStr) return null;
  376. let date = new Date();
  377. if (typeof timeStr === 'string') {
  378. const [hours, minutes, seconds] = timeStr.split(':').map(Number);
  379. date.setHours(hours || 0, minutes || 0, seconds || 0);
  380. } else if (timeStr instanceof Date) {
  381. return timeStr;
  382. }
  383. return date;
  384. },
  385. // 获取日期字符串
  386. getSpecificDate(timeStr) {
  387. const date = timeStr ? new Date(timeStr) : new Date();
  388. const year = date.getFullYear();
  389. const month = date.getMonth() + 1;
  390. const day = date.getDate();
  391. return year + '-' + (month < 10 ? '0' : "") + month + '-' + (day < 10 ? '0' : "") + day;
  392. },
  393. // 获取选择日期排班详情
  394. getDetail(date_time) {
  395. this.loading = true;
  396. const params = {
  397. r: 'store/client/reserve-staff/technician-scheduling-detail',
  398. user_id: this.currentUserId,
  399. date_time,
  400. ...this.search
  401. };
  402. request({ params, method: 'get' }).then(res => {
  403. const { code, msg, data } = res.data;
  404. if (code) throw new Error(msg);
  405. // 初始化表单
  406. this.form = this.initData();
  407. if (data.id) {
  408. // 转换接口返回的数据结构为表单所需结构
  409. const schedulingTime = data.schedulingTime?.map(item => ({
  410. id: item.id,
  411. start: this.parseTime(item.start_time),
  412. end: this.parseTime(item.end_time)
  413. })) || [];
  414. this.form = {
  415. ...this.form,
  416. id: data.id,
  417. is_all_day: data.is_all_day,
  418. user_id: data.user_id,
  419. type: data.type,
  420. date_time: data.date_time,
  421. schedulingTime
  422. };
  423. this.isShowDelete = true;
  424. }
  425. }).catch((error) => {
  426. this.$message.error(error.message);
  427. }).finally(() => {
  428. this.loading = false;
  429. });
  430. },
  431. //获取排班列表
  432. loadData() {
  433. this.loading = true;
  434. const params = {
  435. r: 'store/client/reserve-staff/scheduling',
  436. date: this.currentDate,
  437. month: this.currentMonth,
  438. user_id: this.currentUserId,
  439. ...this.search
  440. };
  441. request({ params, method: 'get' }).then(res => {
  442. const { code, msg, data } = res.data;
  443. this.default_start_time = data.default_start_time;
  444. this.default_end_time = data.default_end_time;
  445. if (code) throw new Error(msg);
  446. const { time_data, user_list, user_detail } = data;
  447. this.userList = user_list;
  448. this.timeData = time_data;
  449. if (!this.currentUserId) {
  450. this.currentUserId = user_detail.user_id;
  451. }
  452. this.getDetail(this.currentDate);
  453. }).catch((error) => {
  454. this.$message.error(error.message);
  455. }).finally(() => {
  456. this.loading = false;
  457. });
  458. },
  459. //保存排班
  460. saveScheduling() {
  461. if (this.form.is_all_day === 0 && !this.form.schedulingTime.length) {
  462. this.$message.error('请选择时间段');
  463. return;
  464. }
  465. if (this.checkTimeOverlap(this.form.schedulingTime)) {
  466. this.$message.error('时间段不能重叠');
  467. return;
  468. }
  469. // 转换时间数据结构
  470. const schedulingTime = this.form.schedulingTime.map(item => ({
  471. id: item.id || 0,
  472. start_time: this.formatTimeValue(item.start),
  473. end_time: this.formatTimeValue(item.end)
  474. }));
  475. const postData = {
  476. ...this.form,
  477. schedulingTime
  478. };
  479. this.loading = true;
  480. let params = {
  481. r: 'store/client/reserve-staff/scheduling'
  482. };
  483. request({
  484. params: params,
  485. method: 'post',
  486. data: postData
  487. }).then(res => {
  488. const { code, msg } = res.data;
  489. if (code) throw new Error(msg);
  490. this.loadData();
  491. this.$message.success(res.data.msg);
  492. }).catch((error) => {
  493. this.$message.error(error.message);
  494. }).finally(() => {
  495. this.loading = false;
  496. });
  497. },
  498. saveMonthScheduling() {
  499. if (this.form1.is_all_day === 0 && !this.form1.schedulingTime.length) {
  500. this.$message.error('请选择时间段');
  501. return;
  502. }
  503. if (this.checkTimeOverlap(this.form1.schedulingTime)) {
  504. this.$message.error('时间段不能重叠');
  505. return;
  506. }
  507. // 转换时间数据结构
  508. const schedulingTime = this.form1.schedulingTime.map(item => ({
  509. id: item.id || 0,
  510. start_time: this.formatTimeValue(item.start),
  511. end_time: this.formatTimeValue(item.end)
  512. }));
  513. this.loading = true;
  514. const params = {
  515. r: 'store/client/reserve-staff/set-all-month'
  516. };
  517. const postData = {
  518. ...this.form1,
  519. date: this.currentDate,
  520. month: this.currentMonth,
  521. user_id: this.userDetail.user_id,
  522. schedulingTime
  523. };
  524. request({
  525. params,
  526. method: 'post',
  527. data: postData
  528. }).then(res => {
  529. const { code, msg } = res.data;
  530. if (code) throw new Error(msg);
  531. this.dialogScheduling = false;
  532. this.loadData();
  533. this.$message.success(res.data.msg);
  534. }).catch((error) => {
  535. this.$message.error(error.message);
  536. }).finally(() => {
  537. this.loading = false;
  538. });
  539. },
  540. // 时间段重复验证
  541. checkTimeOverlap(timeDataArray) {
  542. // 将每个时间段转换为Date对象
  543. const dateRanges = timeDataArray.map(data => {
  544. const { start, end } = data;
  545. return {
  546. start: new Date(start),
  547. end: new Date(end)
  548. };
  549. });
  550. // 检查每个时间段是否与其他时间段重叠
  551. for (let i = 0; i < dateRanges.length; i++) {
  552. for (let j = i + 1; j < dateRanges.length; j++) {
  553. const range1 = dateRanges[i];
  554. const range2 = dateRanges[j];
  555. // 检查是否重叠
  556. if (range1.start < range2.end && range1.end > range2.start) {
  557. return true; // 有重叠
  558. }
  559. }
  560. }
  561. return false; // 没有重叠
  562. },
  563. deleteTimeData(data, index) {
  564. // 判断是否为当前日期的最后一个时间段
  565. if (index === this.form.schedulingTime.length - 1 && this.form.schedulingTime[index - 1] === undefined) {
  566. // 删除当天排期
  567. this.deleteScheduling()
  568. return
  569. }
  570. let params = {
  571. r: 'store/client/reserve-staff/del-scheduling-time',
  572. user_id: this.currentUserId,
  573. id: data.id,
  574. status: -1,
  575. };
  576. request({
  577. params: params,
  578. method: 'post',
  579. data: {
  580. user_id: this.currentUserId,
  581. id: data.id,
  582. status: -1,
  583. }
  584. }).then(res => {
  585. const { code, msg } = res.data;
  586. if (code) throw new Error(msg);
  587. this.form.schedulingTime.splice(index, 1);
  588. }).catch((error) => {
  589. this.$message.error(error.message);
  590. }).finally(() => {
  591. this.loading = false;
  592. });
  593. },
  594. deleteScheduling() {
  595. const params = {
  596. r: 'store/client/reserve-staff/delete-scheduling',
  597. };
  598. request({
  599. params,
  600. method: 'post',
  601. data: {
  602. user_id: this.currentUserId,
  603. id: this.form.id,
  604. status: -1,
  605. }
  606. }).then(res => {
  607. const { code, msg } = res.data;
  608. if (code) throw new Error(msg);
  609. this.$message.success(res.data.msg);
  610. this.isShowDelete = false
  611. this.loadData();
  612. }).catch((error) => {
  613. this.$message.error(error.message);
  614. }).finally(() => {
  615. this.loading = false;
  616. });
  617. }
  618. }
  619. });
  620. </script>
  621. <style lang="scss" scoped>
  622. .scheduling-box {
  623. .flex-between {
  624. display: flex;
  625. justify-content: space-between;
  626. align-items: center;
  627. }
  628. .scheduling-aside {
  629. color: #333333;
  630. background-color: #f8f8f8;
  631. padding: 32px;
  632. box-sizing: border-box;
  633. margin-right: 12px;
  634. border-radius: 8px;
  635. .date-box {
  636. padding-bottom: 32px;
  637. }
  638. .title {
  639. font-size: 20px;
  640. font-weight: bold;
  641. margin-bottom: 12px;
  642. }
  643. .sub-title,
  644. .date-title {
  645. font-size: 18px;
  646. font-weight: bold;
  647. }
  648. }
  649. .my_time_picker {
  650. .el-date-editor {
  651. width: 185px;
  652. }
  653. .el-range-input {
  654. width: 60px;
  655. }
  656. .el-range-separator {
  657. width: 12%;
  658. }
  659. }
  660. .scheduling-main {
  661. color: #333;
  662. text-align: center;
  663. background-color: #f8f8f8;
  664. border-radius: 8px;
  665. .operate-box {
  666. margin-bottom: 20px;
  667. }
  668. .cell-box {
  669. display: flex;
  670. align-items: center;
  671. justify-content: center;
  672. height: 100%;
  673. flex-direction: column;
  674. font-size: 13px;
  675. .day-text {
  676. font-size: 26px;
  677. }
  678. .time-text {
  679. overflow: hidden;
  680. text-overflow: ellipsis;
  681. display: -webkit-box;
  682. -webkit-line-clamp: 2;
  683. -webkit-box-orient: vertical;
  684. }
  685. }
  686. /* 日历设置 */
  687. .el-calendar {
  688. border-radius: 8px;
  689. }
  690. .el-calendar__body {
  691. padding: 0;
  692. }
  693. .el-calendar-table {
  694. &:not(.is-range) {
  695. td.next {
  696. pointer-events: none;
  697. .calendar-day-box {
  698. background-color: #FFF;
  699. }
  700. }
  701. td.prev {
  702. pointer-events: none;
  703. .calendar-day-box {
  704. background-color: #FFF;
  705. }
  706. }
  707. }
  708. .el-calendar-day {
  709. padding: 0;
  710. }
  711. .calendar-day-box {
  712. width: 100%;
  713. height: 100%;
  714. color: #7F7F7F;
  715. background-color: #f1f5f6;
  716. }
  717. }
  718. .calendar-day-box.is-active {
  719. color: #02a7f0;
  720. background-color: #FFF;
  721. }
  722. .is-selected {
  723. .calendar-day-box {
  724. color: #FFF;
  725. background-color: #02a7f0;
  726. }
  727. }
  728. }
  729. }
  730. </style>