|
@@ -6316,36 +6316,33 @@
|
|
|
alp.push(objs)
|
|
|
}
|
|
|
}
|
|
|
- // if(zhis.reportTimes){
|
|
|
- // for(let k in zhis.reportTimes){
|
|
|
- // let objs = {}
|
|
|
- // objs.s = zhis.reportTimes[k].split('-')[0]
|
|
|
- // objs.e = zhis.reportTimes[k].split('-')[1]
|
|
|
- // alp.push(objs)
|
|
|
- // }
|
|
|
- // }
|
|
|
console.log(alp)
|
|
|
this.dateAr = alp
|
|
|
- let str = this.$t('message.Filledtimeperiodsoverlap')
|
|
|
- if(this.dateAr.length > 0) {
|
|
|
- const trus = this.fns();
|
|
|
- const overlapDataTime = this.getOverlapData(alp);
|
|
|
- if (overlapDataTime.length > 0) {
|
|
|
- const arrList = overlapDataTime.map((item) => item.p);
|
|
|
- str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
|
|
|
- }
|
|
|
+ if (this.reportTimeType.timeCanOverlap == 0) {
|
|
|
+ let str = this.$t('message.Filledtimeperiodsoverlap')
|
|
|
+ if(this.dateAr.length > 0) {
|
|
|
+ const trus = this.fns();
|
|
|
+ const overlapDataTime = this.getOverlapData(alp);
|
|
|
+ if (overlapDataTime.length > 0) {
|
|
|
+ const arrList = overlapDataTime.map((item) => item.p);
|
|
|
+ str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
|
|
|
+ }
|
|
|
|
|
|
- ll += 1
|
|
|
- if(!trus) {
|
|
|
- this.$message({
|
|
|
- message: str,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- return false
|
|
|
+ ll += 1
|
|
|
+ if(!trus) {
|
|
|
+ this.$message({
|
|
|
+ message: str,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(this.dateAr.length > 0) {
|
|
|
+ ll +=1 ;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
if(ll == 0) {
|
|
|
this.$message({
|
|
|
message: this.$t('message.Pleasefillinthetime'),
|
|
@@ -6936,51 +6933,55 @@
|
|
|
},
|
|
|
submitReportSon() {
|
|
|
this.dateAr = []
|
|
|
- let alp = []
|
|
|
- if(this.user.timeType.multiWorktime != 1) {
|
|
|
- for(var p in this.workForm.domains) {
|
|
|
- if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
|
|
|
- let objs = {}
|
|
|
- objs.s = this.workForm.domains[p].startTime
|
|
|
- objs.e = this.workForm.domains[p].endTime
|
|
|
- alp.push(objs)
|
|
|
- }
|
|
|
+ //检查重叠
|
|
|
+ if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
|
|
|
+ let alp = []
|
|
|
+ if(this.user.timeType.multiWorktime != 1) {
|
|
|
+ for(var p in this.workForm.domains) {
|
|
|
+ if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
|
|
|
+ let objs = {}
|
|
|
+ objs.s = this.workForm.domains[p].startTime
|
|
|
+ objs.e = this.workForm.domains[p].endTime
|
|
|
+ alp.push(objs)
|
|
|
}
|
|
|
- this.dateAr = alp
|
|
|
- if(this.dateAr.length > 0) {
|
|
|
- let trus = this.fns()
|
|
|
- if(!trus) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('message.Filledtimeperiodsoverlap'),
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.dateAr = alp
|
|
|
+ if(this.dateAr.length > 0) {
|
|
|
+ let trus = this.fns()
|
|
|
+ if(!trus) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('message.Filledtimeperiodsoverlap'),
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ return
|
|
|
}
|
|
|
- } else {
|
|
|
- for(var p in this.workForm.domains) {
|
|
|
- var slll = this.workForm.domains[p]
|
|
|
- for(var o in slll.worktimeList) {
|
|
|
- if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
|
|
|
- let objs = {}
|
|
|
- objs.s = slll.worktimeList[o].startTime
|
|
|
- objs.e = slll.worktimeList[o].endTime
|
|
|
- alp.push(objs)
|
|
|
- }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for(var p in this.workForm.domains) {
|
|
|
+ var slll = this.workForm.domains[p]
|
|
|
+ for(var o in slll.worktimeList) {
|
|
|
+ if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
|
|
|
+ let objs = {}
|
|
|
+ objs.s = slll.worktimeList[o].startTime
|
|
|
+ objs.e = slll.worktimeList[o].endTime
|
|
|
+ alp.push(objs)
|
|
|
}
|
|
|
}
|
|
|
- this.dateAr = alp
|
|
|
- if(this.dateAr.length > 0) {
|
|
|
- let trus = this.fns()
|
|
|
- if(!trus) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('message.Filledtimeperiodsoverlap'),
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.dateAr = alp
|
|
|
+ if(this.dateAr.length > 0) {
|
|
|
+ let trus = this.fns()
|
|
|
+ if(!trus) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('message.Filledtimeperiodsoverlap'),
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//检查子项目
|
|
|
if (this.user.timeType.subProMustFill == 1) {
|
|
|
for(var p in this.workForm.domains) {
|
|
@@ -7267,16 +7268,19 @@
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- for (var p = j+1;p<workList.length; p++) {
|
|
|
- var jItem = workList[p];
|
|
|
- if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
|
|
|
- || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
|
|
|
- this.$message({
|
|
|
- message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
|
|
|
- jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- return;
|
|
|
+ //时间不可重叠
|
|
|
+ if (this.reportTimeType.timeCanOverlap == 0) {
|
|
|
+ for (var p = j+1;p<workList.length; p++) {
|
|
|
+ var jItem = workList[p];
|
|
|
+ if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
|
|
|
+ || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
|
|
|
+ jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|