No Description

index.vue 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. <script lang="ts" setup>
  2. import { computed, onMounted, ref, watch } from 'vue';
  3. // @ts-ignore
  4. import { Page, useVbenDrawer } from '@vben/common-ui';
  5. import { useUserStore } from '@vben/stores';
  6. import {
  7. CaretLeft,
  8. CaretRight,
  9. Plus,
  10. Tickets,
  11. User,
  12. } from '@element-plus/icons-vue';
  13. import dayjs from 'dayjs';
  14. import { ElCheckbox, ElRadioButton, ElRadioGroup } from 'element-plus';
  15. import {
  16. addtodoaskslist,
  17. queryGasStationList,
  18. querytodoaskslist,
  19. } from '#/api/schedule/index';
  20. import CreateWorkOrder from './components/create/createworkorder.vue';
  21. import CreateTasK from './components/create/index.vue';
  22. import CreateVisitorTask from './components/create/visitortaskdraw.vue';
  23. import Day from './components/day/index.vue';
  24. // @ts-ignore
  25. import Month from './components/month/index.vue';
  26. // @ts-ignore
  27. import Week from './components/week/index.vue';
  28. const userStore = useUserStore();
  29. // 根据timeType计算默认日期
  30. const getDefaultDate = (type: string) => {
  31. switch (type) {
  32. case 'month': {
  33. return dayjs().format('YYYY-MM-DD');
  34. }
  35. case 'week': {
  36. return dayjs().format('YYYY-MM-DD');
  37. }
  38. default: {
  39. return dayjs().format('YYYY-MM-DD');
  40. }
  41. }
  42. };
  43. const gasstationlist = ref([]) as any;
  44. const searchParams = ref({
  45. timeType: 'day',
  46. station: '',
  47. date: getDefaultDate('day'),
  48. });
  49. // 当前显示的日期
  50. const currentDate = ref(dayjs()); // 时间对象包含时分秒
  51. const currentDate2 = ref(dayjs()); // 单独给月份的时间
  52. const daylist = ref([]);
  53. const overduedaylist = ref([]);
  54. // 主页面loading
  55. const mainloing = ref(false);
  56. // 抽屉loading
  57. const drawerloing = ref(false);
  58. // 访客任务抽屉loading
  59. const VisitorTaskloing = ref(false);
  60. // 当前选中的日期
  61. const selectedDate = ref(''); // 当前选中的日期2026-01-16
  62. // 任务授权状态
  63. const checkList = ref([]);
  64. // 0-未授权,1-已授权,2-被授权
  65. const checkAll = ref([
  66. {
  67. label: '任务可授权',
  68. value: '0',
  69. },
  70. {
  71. label: '任务已授权',
  72. value: '1',
  73. },
  74. {
  75. label: '任务被授权',
  76. value: '2',
  77. },
  78. ]);
  79. // 查询当前视图类型的数据
  80. const queryCurrentViewData = async (timeType: string, userId: any) => {
  81. switch (timeType) {
  82. case 'day': {
  83. await querytodoaskslistfn({
  84. showStartTime: dayjs(selectedDate.value).format('YYYY-MM-DD 00:00:00'),
  85. showEndTime: dayjs(selectedDate.value)
  86. .add(1, 'day')
  87. .format('YYYY-MM-DD 23:59:59'),
  88. authStatusStr: checkList.value.join(','),
  89. // status: '1',
  90. });
  91. break;
  92. }
  93. case 'month': {
  94. const monthStart = dayjs(currentDate.value).startOf('month');
  95. const monthEnd = dayjs(currentDate.value).endOf('month');
  96. await querytodoaskslistfn({
  97. showStartTime: monthStart.format('YYYY-MM-DD 00:00:00'),
  98. showEndTime: monthEnd.format('YYYY-MM-DD 23:59:59'),
  99. authStatusStr: checkList.value.join(','),
  100. });
  101. break;
  102. }
  103. case 'week': {
  104. const date = dayjs(selectedDate.value);
  105. const startOfWeek = date.startOf('week');
  106. const weekStart =
  107. startOfWeek.day() === 0 ? startOfWeek.subtract(1, 'day') : startOfWeek;
  108. const weekEnd = weekStart.add(6, 'day');
  109. await querytodoaskslistfn({
  110. showStartTime: weekStart.format('YYYY-MM-DD 00:00:00'),
  111. showEndTime: weekEnd.format('YYYY-MM-DD 23:59:59'),
  112. authStatusStr: checkList.value.join(','),
  113. userId,
  114. });
  115. break;
  116. }
  117. // No default
  118. }
  119. await queryoverduelistfn({
  120. authStatusStr: checkList.value.join(','),
  121. });
  122. };
  123. // 视图切换函数
  124. const handleTimeTypeChange = async (val: any) => {
  125. if (val === 'day' || val === 'week') {
  126. selectedDate.value = searchParams.value.date;
  127. }
  128. await queryCurrentViewData(val, searchParams.value.station?.split('-')[0]);
  129. };
  130. // 切换油站方法
  131. const handleStationChange = async (val: any) => {
  132. const userId = val.split('-')[0];
  133. // const stationId = val.split('-')[1];
  134. queryCurrentViewData(searchParams.value.timeType, userId);
  135. };
  136. // 当日和明日的任务列表
  137. const querytodoaskslistfn = async ({
  138. showStartTime,
  139. showEndTime,
  140. authStatusStr,
  141. }: any) => {
  142. mainloing.value = true;
  143. try {
  144. const stationId = searchParams.value.station.split('-')[1];
  145. const executorId = searchParams.value.station.split('-')[0];
  146. const res = await querytodoaskslist({
  147. showStartTime,
  148. showEndTime,
  149. authStatusStr,
  150. stationId,
  151. executorId,
  152. taskStatusStr: '0,1,3',
  153. // userId,
  154. // isOverdue: '0'
  155. });
  156. daylist.value = res || [];
  157. } catch (error) {
  158. console.error(error);
  159. } finally {
  160. mainloing.value = false;
  161. }
  162. };
  163. // 逾期任务列表
  164. const queryoverduelistfn = async ({ authStatusStr }: any) => {
  165. mainloing.value = true;
  166. try {
  167. const stationId = searchParams.value.station.split('-')[1];
  168. const executorId = searchParams.value.station.split('-')[0];
  169. const res = await querytodoaskslist({
  170. authStatusStr,
  171. status: '2',
  172. executorId,
  173. stationId,
  174. showStartTime: dayjs(currentDate.value).format('YYYY-MM-DD 00:00:00'),
  175. showEndTime: dayjs(currentDate.value)
  176. .add(1, 'day')
  177. .format('YYYY-MM-DD 23:59:59'),
  178. });
  179. overduedaylist.value = res || [];
  180. } catch (error) {
  181. console.log(error);
  182. } finally {
  183. mainloing.value = false;
  184. }
  185. };
  186. // 查询加油站列表
  187. const queryGasStationListfn = async () => {
  188. // mainloing.value = true;
  189. try {
  190. const res = await queryGasStationList({});
  191. gasstationlist.value = res || [];
  192. } catch (error) {
  193. console.log(error);
  194. } finally {
  195. // mainloing.value = false;
  196. }
  197. };
  198. // 处理创建任务的提交
  199. const handleCreateTask = async (formData: any) => {
  200. drawerloing.value = true;
  201. try {
  202. await addtodoaskslist({
  203. ...formData,
  204. type: '1',
  205. });
  206. await querytodoaskslistfn({
  207. showStartTime: dayjs(currentDate.value).format('YYYY-MM-DD 00:00:00'),
  208. showEndTime: dayjs(currentDate.value)
  209. .add(1, 'day')
  210. .format('YYYY-MM-DD 23:59:59'),
  211. authStatusStr: checkList.value.join(','),
  212. });
  213. await queryoverduelistfn({
  214. authStatusStr: checkList.value.join(','),
  215. });
  216. createTaskDrawerApi.close();
  217. } catch (error) {
  218. console.error('任务创建失败:', error);
  219. } finally {
  220. drawerloing.value = false;
  221. }
  222. };
  223. // 处理创建访客任务的提交
  224. const handleCreateVisitorTask = async (formData: any) => {
  225. VisitorTaskloing.value = true;
  226. try {
  227. await addtodoaskslist({
  228. ...formData,
  229. type: '1',
  230. });
  231. await querytodoaskslistfn({
  232. showStartTime: dayjs(currentDate.value).format('YYYY-MM-DD 00:00:00'),
  233. showEndTime: dayjs(currentDate.value)
  234. .add(1, 'day')
  235. .format('YYYY-MM-DD 23:59:59'),
  236. authStatusStr: checkList.value.join(','),
  237. });
  238. await queryoverduelistfn({
  239. authStatusStr: checkList.value.join(','),
  240. });
  241. createVisitorTaskDrawerApi.close();
  242. } catch (error) {
  243. console.error('任务创建失败:', error);
  244. } finally {
  245. VisitorTaskloing.value = false;
  246. }
  247. };
  248. onMounted(() => {
  249. queryGasStationListfn().then(() => {
  250. if (userStore.userInfo?.stations?.length) {
  251. searchParams.value.station = `${userStore.userInfo?.userId}-${userStore.userInfo?.stations[0]?.id}`;
  252. }
  253. queryCurrentViewData(
  254. searchParams.value.timeType,
  255. searchParams.value.station?.split('-')[0],
  256. );
  257. });
  258. selectedDate.value = searchParams.value.date;
  259. });
  260. // 处理复选框变化
  261. const handleCheckChange = async () => {
  262. await queryCurrentViewData(
  263. searchParams.value.timeType,
  264. searchParams.value.station?.split('-')[0],
  265. );
  266. };
  267. // 监听timeType变化,更新默认日期和当前显示日期
  268. watch(
  269. () => searchParams.value.timeType,
  270. (newType) => {
  271. searchParams.value.date = getDefaultDate(newType);
  272. currentDate.value = dayjs(searchParams.value.date);
  273. currentDate2.value = dayjs(searchParams.value.date); // 单独给月份的时间
  274. selectedDate.value =
  275. newType === 'day' || newType === 'week' ? searchParams.value.date : '';
  276. },
  277. );
  278. // 确保currentDate和currentDate2始终保持同步
  279. watch(
  280. () => currentDate.value,
  281. (newDate) => {
  282. currentDate2.value = newDate;
  283. },
  284. );
  285. // 单独给月份的监听器
  286. watch(
  287. () => currentDate2.value,
  288. (newDate) => {
  289. currentDate.value = newDate;
  290. },
  291. );
  292. // 计算年份和周数
  293. const year = computed(() => {
  294. return dayjs(searchParams.value.date).year();
  295. });
  296. const weekNumber = computed(() => {
  297. // @ts-ignore
  298. return dayjs(searchParams.value.date).week();
  299. });
  300. // 计算当前选中日期所在周的开始和结束日期
  301. const currentWeekRange = computed(() => {
  302. const date = dayjs(searchParams.value.date);
  303. // 计算周开始(周一)
  304. const startOfWeek = date.startOf('week');
  305. // 调整为周一(dayjs默认周日为一周开始)
  306. const monday =
  307. startOfWeek.day() === 0 ? startOfWeek.subtract(1, 'day') : startOfWeek;
  308. // 计算周日
  309. const sunday = monday.add(6, 'day');
  310. return {
  311. start: monday,
  312. end: sunday,
  313. };
  314. });
  315. // 生成日历天数
  316. const calendarDays = computed(() => {
  317. const days = [];
  318. const year = currentDate.value.year();
  319. const month = currentDate.value.month();
  320. const today = dayjs().startOf('day');
  321. // 获取当月第一天
  322. const firstDay = dayjs(new Date(year, month, 1));
  323. // 获取当月第一天是星期几(0-6,0是周日)
  324. const firstDayOfWeek = firstDay.day();
  325. // 计算需要显示的上个月天数
  326. const prevMonthDays = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;
  327. // 获取当月最后一天
  328. const lastDay = dayjs(new Date(year, month + 1, 0));
  329. const lastDate = lastDay.date();
  330. // 添加上个月的日期
  331. for (let i = prevMonthDays; i > 0; i--) {
  332. const date = firstDay.subtract(i, 'day');
  333. const isInCurrentWeek =
  334. searchParams.value.timeType === 'week' &&
  335. date.isAfter(currentWeekRange.value.start.subtract(1, 'day')) &&
  336. date.isBefore(currentWeekRange.value.end.add(1, 'day'));
  337. const isDisabled =
  338. searchParams.value.timeType === 'day' && date.isBefore(today);
  339. days.push({
  340. date: date.format('YYYY-MM-DD'),
  341. day: date.date(),
  342. isToday: date.isSame(dayjs(), 'day'),
  343. isOtherMonth: true,
  344. isInCurrentWeek,
  345. isDisabled,
  346. });
  347. }
  348. // 添加当月的日期
  349. for (let i = 1; i <= lastDate; i++) {
  350. const date = dayjs(new Date(year, month, i));
  351. const isInCurrentWeek =
  352. searchParams.value.timeType === 'week' &&
  353. date.isAfter(currentWeekRange.value.start.subtract(1, 'day')) &&
  354. date.isBefore(currentWeekRange.value.end.add(1, 'day'));
  355. const isDisabled =
  356. searchParams.value.timeType === 'day' && date.isBefore(today);
  357. days.push({
  358. date: date.format('YYYY-MM-DD'),
  359. day: i,
  360. isToday: date.isSame(dayjs(), 'day'),
  361. isOtherMonth: false,
  362. isInCurrentWeek,
  363. isDisabled,
  364. });
  365. }
  366. // 计算需要显示的下个月天数
  367. const totalDays = days.length;
  368. const nextMonthDays = 42 - totalDays; // 6行7列=42个格子
  369. // 添加下个月的日期
  370. for (let i = 1; i <= nextMonthDays; i++) {
  371. const date = lastDay.add(i, 'day');
  372. const isInCurrentWeek =
  373. searchParams.value.timeType === 'week' &&
  374. date.isAfter(currentWeekRange.value.start.subtract(1, 'day')) &&
  375. date.isBefore(currentWeekRange.value.end.add(1, 'day'));
  376. const isDisabled =
  377. searchParams.value.timeType === 'day' && date.isBefore(today);
  378. days.push({
  379. date: date.format('YYYY-MM-DD'),
  380. day: date.date(),
  381. isToday: date.isSame(dayjs(), 'day'),
  382. isOtherMonth: true,
  383. isInCurrentWeek,
  384. isDisabled,
  385. });
  386. }
  387. return days;
  388. });
  389. // 切换到上个月
  390. const prevMonth = async () => {
  391. currentDate.value = currentDate.value.subtract(1, 'month');
  392. currentDate2.value = currentDate2.value.subtract(1, 'month');
  393. if (searchParams.value.timeType === 'month') {
  394. await queryCurrentViewData(
  395. searchParams.value.timeType,
  396. searchParams.value.station?.split('-')[0],
  397. );
  398. }
  399. };
  400. // 切换到下个月
  401. const nextMonth = async () => {
  402. currentDate.value = currentDate.value.add(1, 'month');
  403. currentDate2.value = currentDate2.value.add(1, 'month');
  404. if (searchParams.value.timeType === 'month') {
  405. await queryCurrentViewData(
  406. searchParams.value.timeType,
  407. searchParams.value.station?.split('-')[0],
  408. );
  409. }
  410. };
  411. // 选择日期
  412. const selectDate = async (date: string) => {
  413. searchParams.value.date = date;
  414. selectedDate.value = date;
  415. currentDate.value = dayjs(date);
  416. currentDate2.value = dayjs(date);
  417. if (searchParams.value.timeType !== 'month') {
  418. await queryCurrentViewData(
  419. searchParams.value.timeType,
  420. searchParams.value.station?.split('-')[0],
  421. );
  422. }
  423. // let showStartTime, showEndTime;
  424. // const currentType = searchParams.value.timeType;
  425. // const selectedDateObj = dayjs(date);
  426. // if (currentType === 'day') {
  427. // // 日视图:查询选中日期当天的数据
  428. // showStartTime = selectedDateObj.format('YYYY-MM-DD 00:00:00');
  429. // showEndTime = selectedDateObj.add(1, 'day').format('YYYY-MM-DD 23:59:59');
  430. // await querytodoaskslistfn({
  431. // showStartTime,
  432. // showEndTime,
  433. // authStatusStr: checkList.value.join(','),
  434. // userId: searchParams.value.station?.split('-')[0],
  435. // });
  436. // } else if (currentType === 'week') {
  437. // // 周视图:查询选中日期所在周的数据(周一到周日)
  438. // const startOfWeek = selectedDateObj.startOf('week');
  439. // const weekStart = startOfWeek.day() === 0 ? startOfWeek.subtract(1, 'day') : startOfWeek;
  440. // const weekEnd = weekStart.add(6, 'day');
  441. // showStartTime = weekStart.format('YYYY-MM-DD 00:00:00');
  442. // showEndTime = weekEnd.format('YYYY-MM-DD 23:59:59');
  443. // await querytodoaskslistfn({
  444. // showStartTime,
  445. // showEndTime,
  446. // authStatusStr: checkList.value.join(','),
  447. // userId: searchParams.value.station?.split('-')[0],
  448. // });
  449. // }
  450. };
  451. // 新增油站任务抽屉
  452. const [CreateTaskDrawer, createTaskDrawerApi] = useVbenDrawer({
  453. // 连接抽离的组件
  454. connectedComponent: CreateTasK,
  455. // placement: 'left',
  456. });
  457. // 新增访客任务抽屉
  458. const [CreateVisitorTaskDrawer, createVisitorTaskDrawerApi] = useVbenDrawer({
  459. connectedComponent: CreateVisitorTask,
  460. });
  461. // 工单提报
  462. const [CreateWorkOrderDrawer, createWorkOrderDrawerApi] = useVbenDrawer({
  463. connectedComponent: CreateWorkOrder,
  464. });
  465. const createTaskDrawerEvent = () => {
  466. createTaskDrawerApi.setData({ isUpdate: false }).open();
  467. };
  468. // 新增访客任务抽屉
  469. const createVisitorTaskDrawerEvent = () => {
  470. createVisitorTaskDrawerApi.setData({ isUpdate: false }).open();
  471. };
  472. // 工单提报
  473. const createWorkOrderDrawerEvent = () => {
  474. createWorkOrderDrawerApi.setData({ isUpdate: false }).open();
  475. };
  476. </script>
  477. <template>
  478. <Page
  479. style="height: 100%"
  480. title=""
  481. :auto-content-height="true"
  482. class="h-screen"
  483. >
  484. <div class="flex h-full min-h-0 flex-row space-x-4">
  485. <!--左侧筛选区域-->
  486. <div
  487. class="relative flex h-full w-80 flex-shrink-0 flex-col rounded-lg bg-white shadow"
  488. >
  489. <div class="flex-1 overflow-y-auto p-4">
  490. <!--油站选择-->
  491. <div class="mb-4">
  492. <ElSelect
  493. v-model="searchParams.station"
  494. @change="handleStationChange"
  495. filterable
  496. placeholder="请选择油站"
  497. class="w-full"
  498. >
  499. <ElOption
  500. v-for="item in gasstationlist"
  501. :key="`${item.userId}-${item.stationId}`"
  502. :label="`${item.nickName}-${item.stationName}`"
  503. :value="`${item.userId}-${item.stationId}`"
  504. />
  505. </ElSelect>
  506. </div>
  507. <!--日期导航和视图切换-->
  508. <div class="mb-4">
  509. <div class="flex items-center justify-between">
  510. <!--时间筛选靠左-->
  511. <div class="flex items-center space-x-2">
  512. <el-icon><CaretLeft @click="prevMonth" /></el-icon>
  513. <span class="font-medium">{{
  514. currentDate.format('YYYY年 M月')
  515. }}</span>
  516. <el-icon><CaretRight @click="nextMonth" /></el-icon>
  517. </div>
  518. <!--视图切换靠右-->
  519. <ElRadioGroup
  520. v-model="searchParams.timeType"
  521. @change="handleTimeTypeChange"
  522. size="small"
  523. class="custom-radio-group"
  524. >
  525. <ElRadioButton label="day" class="custom-radio-btn">
  526. </ElRadioButton>
  527. <ElRadioButton label="week" class="custom-radio-btn">
  528. </ElRadioButton>
  529. <ElRadioButton label="month" class="custom-radio-btn">
  530. </ElRadioButton>
  531. </ElRadioGroup>
  532. </div>
  533. <!--日历显示-->
  534. <div class="calendar-container mt-1">
  535. <!--星期标题-->
  536. <div class="mb-1 flex justify-between text-xs text-gray-500">
  537. <div class="w-7 text-center">一</div>
  538. <div class="w-7 text-center">二</div>
  539. <div class="w-7 text-center">三</div>
  540. <div class="w-7 text-center">四</div>
  541. <div class="w-7 text-center">五</div>
  542. <div class="w-7 text-center">六</div>
  543. <div class="w-7 text-center">日</div>
  544. </div>
  545. <!--日期网格-->
  546. <div class="grid grid-cols-7 gap-1">
  547. <div
  548. v-for="day in calendarDays"
  549. :key="day.date"
  550. :style="
  551. day.date === '2025-12-22' || day.date === '2025-12-23'
  552. ? 'background-color: #FFE6E0'
  553. : day.isInCurrentWeek && !day.isToday
  554. ? 'background-color: #409EFF;color: #fff'
  555. : ''
  556. "
  557. class="flex h-7 w-7 items-center justify-center rounded text-xs"
  558. :class="{
  559. 'bg-blue-600 text-white': day.isToday,
  560. 'cursor-pointer bg-gray-200':
  561. day.date === selectedDate &&
  562. !day.isToday &&
  563. !day.isDisabled,
  564. 'bg-gray-100 text-gray-400': day.isOtherMonth,
  565. 'cursor-not-allowed bg-gray-100 text-gray-400':
  566. day.isDisabled,
  567. 'cursor-pointer': !day.isDisabled,
  568. }"
  569. @click="!day.isDisabled && selectDate(day.date)"
  570. >
  571. {{ day.day }}
  572. </div>
  573. </div>
  574. </div>
  575. </div>
  576. <!--任务授权状态-->
  577. <div class="mb-4">
  578. <div class="mb-2 font-medium">任务授权状态:</div>
  579. <div
  580. class="space-y-1"
  581. style="display: flex; flex-direction: column"
  582. >
  583. <el-checkbox-group
  584. @change="handleCheckChange"
  585. v-model="checkList"
  586. style="display: flex; flex-direction: column; gap: 8px"
  587. >
  588. <ElCheckbox
  589. v-for="value in checkAll"
  590. :key="value.value"
  591. :label="value.label"
  592. :value="value.value"
  593. />
  594. </el-checkbox-group>
  595. </div>
  596. </div>
  597. <!-- <div style="width: 50px;height: 50px; background-color: #339169;"></div> -->
  598. <div style="display: flex; flex-direction: column; gap: 12px">
  599. <div style="color: #409eff">蓝色任务:任务可处理</div>
  600. <div style="color: #67c23a">绿色任务:任务已完成</div>
  601. <div style="color: #e6a23c">黄色任务:即将到期任务</div>
  602. <div style="color: #909399">灰色任务:任务未开始/任务取消</div>
  603. <div style="color: #f56c6c">红色任务:任务过期未完成</div>
  604. </div>
  605. </div>
  606. <!--新增任务按钮固定在底部-->
  607. <div class="p-4">
  608. <div class="space-y-2">
  609. <ElButton
  610. type="primary"
  611. class="w-full"
  612. v-access:code="'schedule:view:addstationtask'"
  613. @click="createTaskDrawerEvent"
  614. >
  615. <template #icon>
  616. <el-icon><Plus /></el-icon>
  617. </template>
  618. 场站新增任务
  619. </ElButton>
  620. </div>
  621. <div class="mt-1 space-y-2">
  622. <ElButton
  623. type="default"
  624. class="w-full"
  625. v-access:code="'schedule:view:addvisittask'"
  626. @click="createVisitorTaskDrawerEvent"
  627. >
  628. <template #icon>
  629. <el-icon><User /></el-icon>
  630. </template>
  631. 访客新增任务
  632. </ElButton>
  633. </div>
  634. <div class="mt-1 space-y-2">
  635. <ElButton
  636. type="default"
  637. class="w-full"
  638. v-access:code="'schedule:view:addworktask'"
  639. @click="createWorkOrderDrawerEvent"
  640. >
  641. <template #icon>
  642. <el-icon><Tickets /></el-icon>
  643. </template>
  644. 工单提报
  645. </ElButton>
  646. </div>
  647. </div>
  648. </div>
  649. <!--右侧内容区域-->
  650. <div class="flex h-full min-h-0 flex-1 flex-col">
  651. <ElCard class="flex h-full w-full flex-col">
  652. <div
  653. class="min-h-0 flex-1 overflow-y-auto"
  654. style="max-height: calc(100vh - 120px)"
  655. v-loading="mainloing"
  656. >
  657. <Day
  658. v-if="searchParams.timeType === 'day'"
  659. :daylist="daylist"
  660. :overduedaylist="overduedaylist"
  661. :selected-date="selectedDate"
  662. />
  663. <Week
  664. v-if="searchParams.timeType === 'week'"
  665. :daylist="daylist"
  666. :overduedaylist="overduedaylist"
  667. :year="year"
  668. :week-number="weekNumber"
  669. />
  670. <Month
  671. v-if="searchParams.timeType === 'month'"
  672. :daylist="daylist"
  673. :overduedaylist="overduedaylist"
  674. :month="currentDate"
  675. />
  676. </div>
  677. </ElCard>
  678. </div>
  679. </div>
  680. <!-- 1油站新增 2访客新增 -->
  681. <CreateTaskDrawer @submit="handleCreateTask" :drawerloing="drawerloing" />
  682. <CreateVisitorTaskDrawer
  683. @submit="handleCreateVisitorTask"
  684. :VisitorTaskloing="VisitorTaskloing"
  685. />
  686. <CreateWorkOrderDrawer />
  687. </Page>
  688. </template>
  689. <style scoped lang="scss">
  690. // :deep(.el-card) {
  691. // border: none !important;
  692. // box-shadow: none !important;
  693. // background: transparent !important;
  694. // }
  695. :deep(.custom-radio-group .el-radio-button) {
  696. padding: 4px;
  697. // background: transparent !important;
  698. background-color: #fafafa !important;
  699. border: none !important;
  700. }
  701. :deep(.custom-radio-group .el-radio-button__inner) {
  702. padding: 0 8px;
  703. background: transparent !important;
  704. border: none !important;
  705. box-shadow: none !important;
  706. }
  707. :deep(.custom-radio-group .el-radio-button__inner:hover) {
  708. color: #1890ff !important;
  709. background: transparent !important;
  710. }
  711. :deep(.custom-radio-group .el-radio-button.is-active .el-radio-button__inner) {
  712. color: #1890ff !important;
  713. background: transparent !important;
  714. border: none !important;
  715. box-shadow: none !important;
  716. }
  717. </style>