修改时间

This commit is contained in:
shidongli 2024-12-27 14:47:34 +08:00
parent d6e97d8472
commit 0428fdbb91

View File

@ -623,6 +623,7 @@ export default {
name: "ManuallyCreatingTasks", name: "ManuallyCreatingTasks",
data() { data() {
return { return {
errorShown: false,
hms: '', hms: '',
time: '', time: '',
datePickerVisible: true, datePickerVisible: true,
@ -860,11 +861,10 @@ export default {
}).then(() => { }).then(() => {
this.updata.routeNodeList = this.list; this.updata.routeNodeList = this.list;
var newObj = JSON.parse(JSON.stringify(this.updata)); var newObj = JSON.parse(JSON.stringify(this.updata));
const invalidTimes = [];
newObj.routeNodeList.every(e => { newObj.routeNodeList.forEach(e => {
if (e.timedata) { if (e.timedata) {
e.nodePlanTime = e.timedata e.nodePlanTime = e.timedata
} }
const dateParts = e.nodePlanTime.split(' '); const dateParts = e.nodePlanTime.split(' ');
if (dateParts[1] == "00:00:00") { if (dateParts[1] == "00:00:00") {
@ -880,16 +880,16 @@ export default {
const startTime = 8; const startTime = 8;
const endTime = 20; const endTime = 20;
const parts = e.nodePlanTime.split(' '); const parts = e.nodePlanTime.split(' ');
const time = parts[1].split(':').map(Number); const time = parts[1].split(':');
console.log(time[0],endTime,'endTime')
console.log(time[0],startTime,'startTime')
console.log(time[0] < startTime || time[0] > endTime)
if (time[0] < startTime || time[0] >= endTime) { if (time[0] < startTime || time[0] >= endTime) {
// console.log('') invalidTimes.push(e);
}
})
console.log(invalidTimes, 'invalidTimes')
if(invalidTimes.length>0){
this.$message.error("时间点在8:00到20:00之间,请修改时间点"); this.$message.error("时间点在8:00到20:00之间,请修改时间点");
return false
} else { }else{
signrouteadd(newObj).then((res) => { signrouteadd(newObj).then((res) => {
var message = '' var message = ''
if (this.$route.query.path == "/patient/signRecord") { if (this.$route.query.path == "/patient/signRecord") {
@ -920,23 +920,16 @@ export default {
}, 3000); }, 3000);
}); });
} }
})
// var nulllength= newObj.routeNodeList.filter(item => item.routeNodeName=="" || item.routeNodeName==null || item.routeNodeName==undefined); // var nulllength= newObj.routeNodeList.filter(item => item.routeNodeName=="" || item.routeNodeName==null || item.routeNodeName==undefined);
// console.log(nulllength,'nulllength') // console.log(nulllength,'nulllength')
// if(nulllength.length>0){ // if(nulllength.length>0){
// this.$message.error(''); // this.$message.error('');
// return // return
// } // }
console.log(newObj, 'this.newObj') console.log(newObj, 'this.newObj')
console.log(this.updata, 'this.updata') console.log(this.updata, 'this.updata')
// return
}) })
}, },