|
@@ -230,6 +230,24 @@
|
|
@change="qecCreateTimeChange"
|
|
@change="qecCreateTimeChange"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-form-item label="营期课程时间" prop="periodTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="periodTimeText"
|
|
|
|
+ type="datetimerange"
|
|
|
|
+ align="right"
|
|
|
|
+ unlink-panels
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
+ @change="qecPeriodTimeChange"
|
|
|
|
+ :default-time="['00:00:00', '23:59:59']">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
@@ -452,16 +470,19 @@ export default {
|
|
createCalendarKey: 0,
|
|
createCalendarKey: 0,
|
|
updateCalendarKey: 0,
|
|
updateCalendarKey: 0,
|
|
qecCalendarKey: 0,
|
|
qecCalendarKey: 0,
|
|
|
|
+ periodTimeKey: 0,
|
|
|
|
|
|
createTimeText: '',
|
|
createTimeText: '',
|
|
scheduleTimeText: '', // 新增
|
|
scheduleTimeText: '', // 新增
|
|
updateTimeText: '', // 新增
|
|
updateTimeText: '', // 新增
|
|
qecCreateTimeText: '', // 新增
|
|
qecCreateTimeText: '', // 新增
|
|
|
|
+ periodTimeText: '', // 营期课程时间
|
|
|
|
|
|
scheduleTime: [], // 改为数组
|
|
scheduleTime: [], // 改为数组
|
|
createTime: [], // 改为数组
|
|
createTime: [], // 改为数组
|
|
updateTime: [], // 改为数组
|
|
updateTime: [], // 改为数组
|
|
qecCreateTime: [], // 改为数组
|
|
qecCreateTime: [], // 改为数组
|
|
|
|
+ periodTime: [], // 改为数组
|
|
|
|
|
|
// 控制日历显隐
|
|
// 控制日历显隐
|
|
showScheduleCalendar: false,
|
|
showScheduleCalendar: false,
|
|
@@ -517,9 +538,9 @@ export default {
|
|
|
|
|
|
pickerOptions: {
|
|
pickerOptions: {
|
|
disabledDate(time) {
|
|
disabledDate(time) {
|
|
- // 获取6天前的日期(加上今天就是7天)
|
|
|
|
|
|
+ // 获取13天前的日期(加上今天就是14天)
|
|
const sixDaysAgo = new Date();
|
|
const sixDaysAgo = new Date();
|
|
- sixDaysAgo.setDate(sixDaysAgo.getDate() - 6);
|
|
|
|
|
|
+ sixDaysAgo.setDate(sixDaysAgo.getDate() - 13);
|
|
sixDaysAgo.setHours(0, 0, 0, 0);
|
|
sixDaysAgo.setHours(0, 0, 0, 0);
|
|
|
|
|
|
// 获取明天的日期(不包括今天)
|
|
// 获取明天的日期(不包括今天)
|
|
@@ -554,6 +575,8 @@ export default {
|
|
upETime:null,
|
|
upETime:null,
|
|
qecSTime:null,
|
|
qecSTime:null,
|
|
qecETime:null,
|
|
qecETime:null,
|
|
|
|
+ periodSTime:null,
|
|
|
|
+ periodETime:null,
|
|
scheduleStartTime: null,
|
|
scheduleStartTime: null,
|
|
scheduleEndTime: null,
|
|
scheduleEndTime: null,
|
|
sendType:process.env.VUE_APP_COURSE_DEFAULT,
|
|
sendType:process.env.VUE_APP_COURSE_DEFAULT,
|
|
@@ -595,17 +618,20 @@ export default {
|
|
this.createTime = [];
|
|
this.createTime = [];
|
|
this.updateTime = [];
|
|
this.updateTime = [];
|
|
this.qecCreateTime = [];
|
|
this.qecCreateTime = [];
|
|
|
|
+ this.periodTime = [];
|
|
|
|
|
|
this.scheduleTimeText = '';
|
|
this.scheduleTimeText = '';
|
|
this.createTimeText = '';
|
|
this.createTimeText = '';
|
|
this.updateTimeText = '';
|
|
this.updateTimeText = '';
|
|
this.qecCreateTimeText = '';
|
|
this.qecCreateTimeText = '';
|
|
|
|
+ this.periodTimeText = [];
|
|
|
|
|
|
// 强制刷新日历组件
|
|
// 强制刷新日历组件
|
|
this.scheduleCalendarKey++;
|
|
this.scheduleCalendarKey++;
|
|
this.createCalendarKey++;
|
|
this.createCalendarKey++;
|
|
this.updateCalendarKey++;
|
|
this.updateCalendarKey++;
|
|
this.qecCalendarKey++;
|
|
this.qecCalendarKey++;
|
|
|
|
+ this.periodTimeKey++;
|
|
},
|
|
},
|
|
formatDateRange(dates) {
|
|
formatDateRange(dates) {
|
|
if (!dates || dates.length < 2) return '';
|
|
if (!dates || dates.length < 2) return '';
|
|
@@ -687,6 +713,8 @@ export default {
|
|
this.queryParams.upETime = null;
|
|
this.queryParams.upETime = null;
|
|
this.queryParams.qecSTime = null;
|
|
this.queryParams.qecSTime = null;
|
|
this.queryParams.qecETime = null;
|
|
this.queryParams.qecETime = null;
|
|
|
|
+ this.queryParams.periodSTime = null;
|
|
|
|
+ this.queryParams.periodDTime = null;
|
|
this.queryParams.scheduleStartTime = null;
|
|
this.queryParams.scheduleStartTime = null;
|
|
this.queryParams.scheduleEndTime = null;
|
|
this.queryParams.scheduleEndTime = null;
|
|
this.queryParams.sopId = null; // 重置SOP ID
|
|
this.queryParams.sopId = null; // 重置SOP ID
|
|
@@ -891,6 +919,71 @@ export default {
|
|
this.queryParams.qecETime = null;
|
|
this.queryParams.qecETime = null;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ //营期课程时间
|
|
|
|
+ qecPeriodTimeChange(periodTime){
|
|
|
|
+
|
|
|
|
+ if (periodTime && periodTime.length >= 2) {
|
|
|
|
+ // 检查选择的日期范围是否超过7天(包括起始和结束日期)
|
|
|
|
+ const startDate = new Date(periodTime[0]);
|
|
|
|
+ const endDate = new Date(periodTime[1]);
|
|
|
|
+
|
|
|
|
+ // 设置时间为当天开始,避免时间部分影响计算
|
|
|
|
+ startDate.setHours(0, 0, 0, 0);
|
|
|
|
+ endDate.setHours(0, 0, 0, 0);
|
|
|
|
+
|
|
|
|
+ const timeDiff = Math.abs(endDate - startDate);
|
|
|
|
+ const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
|
|
|
|
+
|
|
|
|
+ // 如果超过6天的范围(总共7天,包括起始日)
|
|
|
|
+ if (diffDays > 13) {
|
|
|
|
+ this.$message.error('时间选择范围不能超过14天');
|
|
|
|
+ // 清空选择
|
|
|
|
+ this.periodTime = [];
|
|
|
|
+ this.periodTimeText = [];
|
|
|
|
+ this.queryParams.periodSTime = null;
|
|
|
|
+ this.queryParams.periodETime = null;
|
|
|
|
+ this.periodTimeKey++;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.queryParams.periodSTime = this.formatDate(periodTime[0]) || null;
|
|
|
|
+ this.queryParams.periodETime = this.formatDate(periodTime[1]) || null;
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ this.periodTimeText = '';
|
|
|
|
+ this.queryParams.periodSTime = null;
|
|
|
|
+ this.queryParams.periodETime = null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ formatDate(date) {
|
|
|
|
+ if (!date) return ''
|
|
|
|
+
|
|
|
|
+ // 确保 date 是 Date 对象
|
|
|
|
+ let dateObj = date
|
|
|
|
+ if (typeof date === 'string') {
|
|
|
|
+ dateObj = new Date(date)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 如果转换失败,返回空字符串
|
|
|
|
+ if (!(dateObj instanceof Date) || isNaN(dateObj.getTime())) {
|
|
|
|
+ return ''
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 使用更安全的格式化方法
|
|
|
|
+ const year = dateObj.getFullYear()
|
|
|
|
+ const month = String(dateObj.getMonth() + 1).padStart(2, '0')
|
|
|
|
+ const day = String(dateObj.getDate()).padStart(2, '0')
|
|
|
|
+ const hours = String(dateObj.getHours()).padStart(2, '0')
|
|
|
|
+ const minutes = String(dateObj.getMinutes()).padStart(2, '0')
|
|
|
|
+ const seconds = String(dateObj.getSeconds()).padStart(2, '0')
|
|
|
|
+
|
|
|
|
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
|
+ },
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据名称模糊查询用户列表
|
|
* 根据名称模糊查询用户列表
|
|
* @param query 参数
|
|
* @param query 参数
|