From 0428fdbb912cff4e665558020a8b2cd49d355f97 Mon Sep 17 00:00:00 2001 From: shidongli Date: Fri, 27 Dec 2024 14:47:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/ManuallyCreatingTasks/index.vue | 91 +++++++++---------- 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/src/views/system/ManuallyCreatingTasks/index.vue b/src/views/system/ManuallyCreatingTasks/index.vue index b8a7606..5d24ebb 100644 --- a/src/views/system/ManuallyCreatingTasks/index.vue +++ b/src/views/system/ManuallyCreatingTasks/index.vue @@ -623,6 +623,7 @@ export default { name: "ManuallyCreatingTasks", data() { return { + errorShown: false, hms: '', time: '', datePickerVisible: true, @@ -860,11 +861,10 @@ export default { }).then(() => { this.updata.routeNodeList = this.list; var newObj = JSON.parse(JSON.stringify(this.updata)); - - newObj.routeNodeList.every(e => { + const invalidTimes = []; + newObj.routeNodeList.forEach(e => { if (e.timedata) { e.nodePlanTime = e.timedata - } const dateParts = e.nodePlanTime.split(' '); if (dateParts[1] == "00:00:00") { @@ -880,63 +880,56 @@ export default { const startTime = 8; const endTime = 20; const parts = e.nodePlanTime.split(' '); - const time = parts[1].split(':').map(Number); - console.log(time[0],endTime,'endTime') - console.log(time[0],startTime,'startTime') - console.log(time[0] < startTime || time[0] > endTime) + const time = parts[1].split(':'); if (time[0] < startTime || time[0] >= endTime) { - // console.log('请修改时间点') - this.$message.error("时间点在8:00到20:00之间,请修改时间点"); - return false - - } else { - signrouteadd(newObj).then((res) => { - var message = '' - if (this.$route.query.path == "/patient/signRecord") { - message = '保存成功,即将返回签约患者列表' - } else if (this.$route.query.path == "/patient/patientinfoimport") { - message = '保存成功,即将返回患者导入列表' - - } else if (this.$route.query.path == "/patient/ImportDetails") { - message = '保存成功,即将返回导入明细列表' - } - else if (this.$route.query.path == "/task/Patientmanagement") { - message = '保存成功,即将返回创建任务列表' - } - this.$notify({ - type: "success", - title: "提示", - message: message, - duration: 3000, - }); - setTimeout(() => { - this.$store - .dispatch("tagsView/delView", this.$route) - .then(({ visitedViews }) => { - this.$router.push({ - path: this.$route.query.path - }); - }); - }, 3000); - }); - - - - - + invalidTimes.push(e); } }) + console.log(invalidTimes, 'invalidTimes') + if(invalidTimes.length>0){ + this.$message.error("时间点在8:00到20:00之间,请修改时间点"); + + }else{ + signrouteadd(newObj).then((res) => { + var message = '' + if (this.$route.query.path == "/patient/signRecord") { + message = '保存成功,即将返回签约患者列表' + } else if (this.$route.query.path == "/patient/patientinfoimport") { + message = '保存成功,即将返回患者导入列表' + + } else if (this.$route.query.path == "/patient/ImportDetails") { + message = '保存成功,即将返回导入明细列表' + } + else if (this.$route.query.path == "/task/Patientmanagement") { + message = '保存成功,即将返回创建任务列表' + } + this.$notify({ + type: "success", + title: "提示", + message: message, + duration: 3000, + }); + setTimeout(() => { + this.$store + .dispatch("tagsView/delView", this.$route) + .then(({ visitedViews }) => { + this.$router.push({ + path: this.$route.query.path + }); + }); + }, 3000); + }); + + } + // var nulllength= newObj.routeNodeList.filter(item => item.routeNodeName=="" || item.routeNodeName==null || item.routeNodeName==undefined); // console.log(nulllength,'nulllength') // if(nulllength.length>0){ // this.$message.error('节点名称不能为空!'); // return // } - - console.log(newObj, 'this.newObj') console.log(this.updata, 'this.updata') - // return }) },