禁用禁用

main
李劲龙 2 weeks ago
parent d562070a47
commit 071b4bec49

@ -155,14 +155,9 @@
</el-col>
</el-form-item>
<el-form-item label="任务期限" prop="taskDeadline">
<el-date-picker
type="datetime"
placeholder="选择日期"
v-model="ruleForm.taskDeadline"
style="width: 100%;"
value-format="yyyy-MM-dd HH:mm:ss"
default-time="23:59:59"
></el-date-picker>
<el-date-picker type="datetime" placeholder="选择日期" v-model="ruleForm.taskDeadline" style="width: 100%;"
value-format="yyyy-MM-dd HH:mm:ss" default-time="23:59:59"
:picker-options="pickerOptions"></el-date-picker>
</el-form-item>
<el-form-item class="newTask-form-item">
<el-button @click="resetForm('ruleForm')"></el-button>
@ -193,6 +188,21 @@ export default {
components: { myPagination, myDialog, danweiList },
data() {
return {
pickerOptions: {
disabledDate(time) {
const date = new Date();
const oneday = date.getTime();
return time.getTime() < new Date().getTime() - 86400000;
},
selectableRange: (() => {
let data = new Date();
let hour = data.getHours();
let minute = data.getMinutes();
let second = data.getSeconds();
return [`${hour}:${minute}:${second} - 23:59:59`]
})(),
},
btnloading: false,
formInline: {
name: "",
@ -267,7 +277,12 @@ export default {
window.removeEventListener('resize', this.cancalDebounce);
},
methods: {
disabledDate(time) {
//
console.log(time);
return time.getTime() < Date.now() - 8.64e7; //
},
checkboxChange() {
console.log(111);
this.ruleForm.dwmc = []
@ -310,7 +325,7 @@ export default {
submitForm(formName) {
console.log(this.ruleForm.taskDeadline);
this.fonsisis(this.ruleForm.taskDeadline)
if(!this.fonsisis(this.ruleForm.taskDeadline)) {
if (!this.fonsisis(this.ruleForm.taskDeadline)) {
this.$message.error('选择时间不能小于当前时间');
return false
}

Loading…
Cancel
Save