贾胜凯
This commit is contained in:
parent
e14dac7cca
commit
be8cd0e6e7
|
|
@ -111,6 +111,8 @@
|
|||
v-model="baseForm.processDate"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
:disabled-date="disabledBeforeToday"
|
||||
:picker-options="pickerOptions"
|
||||
format="yyyy-MM-dd" style="width: 100%"
|
||||
value-format="yyyy-MM-dd"></el-date-picker>
|
||||
</el-form-item>
|
||||
|
|
@ -145,6 +147,13 @@
|
|||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
// 选择今天以及今天之后的日期
|
||||
return time.getTime() < Date.now() - 8.64e7// 如果没有后面的-8.64e7就是不可以选择
|
||||
// 选择今天以及今天之前的日期
|
||||
// return time.getTime() > Date.now() - 8.64e7// 如果没有后面的-8.64e7就是不可以选择今天的
|
||||
} },
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
|
@ -215,6 +224,14 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
disabledBeforeToday(time) {
|
||||
// 获取今天的日期
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0); // 设置时间为午夜12点,以确保比较时不考虑时间部分
|
||||
// 比较传入的日期是否早于今天
|
||||
console.log("disabledBeforeToday",time)
|
||||
return time.getTime() < today.getTime();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue