From d562070a47f91b5299900998c6c58f332f49a558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8A=B2=E9=BE=99?= <2860996570@qq.com> Date: Thu, 26 Dec 2024 16:44:42 +0800 Subject: [PATCH] =?UTF-8?q?gengxin=E6=97=B6=E9=97=B4=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/auditPages/taskManagement/index.vue | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/src/views/auditPages/taskManagement/index.vue b/src/views/auditPages/taskManagement/index.vue index 8e4c22e..191e62e 100644 --- a/src/views/auditPages/taskManagement/index.vue +++ b/src/views/auditPages/taskManagement/index.vue @@ -155,8 +155,14 @@ - + 取消 @@ -261,7 +267,8 @@ export default { window.removeEventListener('resize', this.cancalDebounce); }, methods: { - checkboxChange(){ + + checkboxChange() { console.log(111); this.ruleForm.dwmc = [] this.tabclicklist = [] @@ -282,9 +289,31 @@ export default { this.tabclicklist = [] this.btnloading = false }, - submitForm(formName) { - console.log(this.ruleForm); + fonsisis(data) { + // 定义特定的时间字符串 + const specificTimeStr = data; + + // 将时间字符串转换为Date对象 + const specificTime = new Date(specificTimeStr); + + // 获取当前时间 + const currentTime = new Date(); + + // 比较当前时间是否大于特定时间 + if (currentTime > specificTime) { + return false + } else { + return true + } + }, + submitForm(formName) { + console.log(this.ruleForm.taskDeadline); + this.fonsisis(this.ruleForm.taskDeadline) + if(!this.fonsisis(this.ruleForm.taskDeadline)) { + this.$message.error('选择时间不能小于当前时间'); + return false + } this.$refs[formName].validate((valid) => { if (valid) { this.btnloading = true @@ -295,9 +324,6 @@ export default { this.getInfo(); this.$modal.msgSuccess("新增成功"); this.btnloading = false - - - }) setTimeout(() => { this.ruleForm.dwmc = this.ruleForm.dwmc.split(",") @@ -445,7 +471,7 @@ export default { type: 'warning' }).then(() => { - assetTaskclose({ taskId: row.id,taskName:row.taskName }).then(res => { + assetTaskclose({ taskId: row.id, taskName: row.taskName }).then(res => { if (res.code == 200) { this.$message({ type: 'success',