Commit 584423c7 by peijy

pyj 7.14 个人工作-录播室预约-空闲情况日期完成

parent d6075f55
...@@ -67,10 +67,10 @@ export default [ ...@@ -67,10 +67,10 @@ export default [
}, },
//我的任务--礼堂申请审批 //我的任务--礼堂申请审批
{ {
path: "/indexMould/audApplicationapproval", path: "/indexMould/myTask",
component: Layout, component: Layout,
hidden: true, hidden: true,
// permissions: ["system:user:edit"], permissions: ["system:user:edit"],
children: [ children: [
{ {
path: "audApplicationapproval", path: "audApplicationapproval",
...@@ -85,7 +85,7 @@ export default [ ...@@ -85,7 +85,7 @@ export default [
}, },
//我的任务--科室申请审批 //我的任务--科室申请审批
{ {
path: "/indexMould/depBudgetapproval", path: "/indexMould/myTask",
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ["system:user:edit"], permissions: ["system:user:edit"],
......
...@@ -135,8 +135,7 @@ ...@@ -135,8 +135,7 @@
<el-card :body-style="{ padding: '0px' }" <el-card :body-style="{ padding: '0px' }"
style="height: 210px; width: 100%; margin-top: 3px; background-color: #ffffff"> style="height: 210px; width: 100%; margin-top: 3px; background-color: #ffffff">
<div class="cardHeader" style="margin-top: 5px"> <div class="cardHeader" style="margin-top: 5px">
<div style="display: inline-block; vertical-align: middle"><i class="el-icon-s-check" <div style="display: inline-block; vertical-align: middle"><i class="el-icon-s-check" style="color: #2f79ff"></i>
style="color: #2f79ff"></i>
<span>&emsp;我的任务</span></div> <span>&emsp;我的任务</span></div>
</div> </div>
<el-divider></el-divider> <el-divider></el-divider>
...@@ -530,6 +529,7 @@ export default { ...@@ -530,6 +529,7 @@ export default {
//从后端获取任务数量 //从后端获取任务数量
taskNum() { taskNum() {
getTaskNum().then(res => { getTaskNum().then(res => {
console.log('taskNumList',res)
this.taskNumList = res.data this.taskNumList = res.data
}) })
}, },
...@@ -659,6 +659,7 @@ export default { ...@@ -659,6 +659,7 @@ export default {
getShowCommonfunctionsList() { getShowCommonfunctionsList() {
this.offentUse = true this.offentUse = true
showCommonfunctionsList().then(res => { showCommonfunctionsList().then(res => {
this.blocks = res.data this.blocks = res.data
this.offentUse = false this.offentUse = false
}) })
......
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
<!-- 搜索条件表单 --> <!-- 搜索条件表单 -->
<el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="showSearch"> <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="showSearch">
<el-form-item label="日期" prop="startTime"> <el-form-item label="日期" prop="startTime">
<el-date-picker v-model="queryParams.startTime" type="daterange" range-separator="至" start-placeholder="开始日期" <el-date-picker size="small" v-model="queryParams.startTime" type="date" placeholder="开始日期" value-format="yyyy-MM-dd"
end-placeholder="结束日期" :disabledDate="disableDate"> format="yyyy-MM-dd" @change="changeDate" :picker-options="pickerOptions">
</el-date-picker>
<el-date-picker size="small" type="date" v-model="endTime" disabled>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -29,6 +32,7 @@ ...@@ -29,6 +32,7 @@
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<!-- 表格日期-->
<th v-for="day in days" :key="day">{{ day }}</th> <th v-for="day in days" :key="day">{{ day }}</th>
</tr> </tr>
</thead> </thead>
...@@ -63,9 +67,21 @@ import { ...@@ -63,9 +67,21 @@ import {
addIdle, // 新增录播室预约 addIdle, // 新增录播室预约
getstudioUse, // 查询录播室使用情况 getstudioUse, // 查询录播室使用情况
} from "@/api/smartSchool/personWork/recordingroomAppointment/IdleSituation"; } from "@/api/smartSchool/personWork/recordingroomAppointment/IdleSituation";
import moment from 'moment'
export default { export default {
data() { data() {
return { return {
//选择日期限制
pickerOptions: {
disabledDate(time) {
//包含今天
// return time.getTime() < Date.now() - 8.64e7;
//不含今天
return time.getTime() < Date.now() ;
}
},
time:'',
studioUseData: [], // 存储录播室占用情况数据 studioUseData: [], // 存储录播室占用情况数据
showSearch: true, // 是否显示搜索条件 showSearch: true, // 是否显示搜索条件
successDialogVisible: false, // 预约录播室成功的弹窗是否可见 successDialogVisible: false, // 预约录播室成功的弹窗是否可见
...@@ -85,18 +101,24 @@ export default { ...@@ -85,18 +101,24 @@ export default {
startTime: "", // 查询的开始时间 startTime: "", // 查询的开始时间
}, },
rooms: [], //录播室下拉列表存储 rooms: [], //录播室下拉列表存储
endTime:''
}; };
}, },
created() { created() {
this.queryParams.startTime = moment(new Date()).add(1,'days').format("YYYY-MM-DD");
this.endTime = moment(this.queryParams.startTime).add(9,'days')
// 初始化日期和时间段 // 初始化日期和时间段
this.initDays(); this.initDays();
this.initTimeSlots(); this.initTimeSlots();
// 获取录播室下拉框列表 // 获取录播室下拉框列表
this.getRoomList(); this.getRoomList();
this.fetchStudioUseData(); // this.fetchStudioUseData();
this.fetchData(); // this.fetchData();
}, },
methods: { methods: {
changeDate(){
this.endTime = moment(this.queryParams.startTime).add(9,'days')
},
fetchStudioUseData() { fetchStudioUseData() {
// 调用接口获取录播室占用情况数据 // 调用接口获取录播室占用情况数据
const params = { const params = {
...@@ -104,7 +126,7 @@ export default { ...@@ -104,7 +126,7 @@ export default {
studioId: this.queryParams.studioId, studioId: this.queryParams.studioId,
}; };
console.log(123654, params); console.log(123654, params);
getstudioUse({}).then((res) => { getstudioUse({params}).then((res) => {
this.studioUseData = res.rows; this.studioUseData = res.rows;
console.log(123, this.studioUseData); console.log(123, this.studioUseData);
}); });
...@@ -150,17 +172,22 @@ export default { ...@@ -150,17 +172,22 @@ export default {
"第十一节(晚上)", "第十一节(晚上)",
]; ];
}, },
//表格头部日期
initDays() { initDays() {
// 假设从明天开始,获取未来10天的日期 // 假设从明天开始,获取未来10天的日期
const startDate = new Date(); // const startDate = new Date();
startDate.setDate(startDate.getDate() + 1); // startDate.setDate(startDate.getDate() + 1);
// console.log('startDate',startDate)
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
const currentDate = new Date(startDate); const formattedDate = moment(this.queryParams.startTime).add(i,'days').format("YYYY-MM-DD");
currentDate.setDate(currentDate.getDate() + i); console.log('formattedDate',formattedDate)
const formattedDate = this.formatDate(currentDate); // const currentDate = new Date(startDate);
// currentDate.setDate(currentDate.getDate() + i);
// const formattedDate = this.formatDate(currentDate);
this.days.push(formattedDate); this.days.push(formattedDate);
} }
}, },
formatDate(date) { formatDate(date) {
// 格式化日期为'YYYY-MM-DD'的形式 // 格式化日期为'YYYY-MM-DD'的形式
...@@ -257,8 +284,9 @@ export default { ...@@ -257,8 +284,9 @@ export default {
}); });
}, },
fetchData() { fetchData() {
this.days = [];
// 查询按钮的点击事件处理程序 // 查询按钮的点击事件处理程序
this.initDays()
getstudioUse({ getstudioUse({
startTime: this.queryParams.startTime, startTime: this.queryParams.startTime,
studioId: this.queryParams.studioId, studioId: this.queryParams.studioId,
...@@ -308,15 +336,6 @@ export default { ...@@ -308,15 +336,6 @@ export default {
console.log("确定"); console.log("确定");
}, },
disableDate(time) {
// 禁用日期选择,只允许预约明天开始的录播室
const today = new Date();
today.setHours(0, 0, 0, 0);
const targetDate = new Date(time);
targetDate.setHours(0, 0, 0, 0);
return targetDate < today;
},
// isReservationDisabled() { // isReservationDisabled() {
// // 预约按钮是否禁用 // // 预约按钮是否禁用
// return this.selectedTimeSlots.length === 0; // return this.selectedTimeSlots.length === 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment