|
@@ -1022,7 +1022,9 @@
|
|
<!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
|
|
<!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
|
|
<el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
|
|
<el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
|
|
<el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
|
|
<el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
|
|
- <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
|
|
|
|
|
|
+ <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
|
|
|
|
+ <!--针对景昱,先检查工时是否存在异常-->
|
|
|
|
+ <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- 重庆物奇私人定制的按周填报 -->
|
|
<!-- 重庆物奇私人定制的按周填报 -->
|
|
@@ -6823,6 +6825,43 @@
|
|
this.selProjectList = []
|
|
this.selProjectList = []
|
|
this.selCon = []
|
|
this.selCon = []
|
|
},
|
|
},
|
|
|
|
+ checkDateWorkTime() {
|
|
|
|
+ //针对苏州景昱,单独的检查逻辑
|
|
|
|
+ if (this.user.companyId == 5978) {
|
|
|
|
+ //调接口,先检查工时是否存在异常
|
|
|
|
+ var zhi = this.zhoData;
|
|
|
|
+ var array = [];
|
|
|
|
+ for(let n in zhi){
|
|
|
|
+ if(zhi[n].he){
|
|
|
|
+ var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
|
|
|
|
+ array.push(workData)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.submitingReport = true;
|
|
|
|
+ this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
|
|
|
|
+ res => {
|
|
|
|
+ this.submitingReport = false;
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.submitWeekReport(0)
|
|
|
|
+ } else {
|
|
|
|
+ this.$confirm(res.msg, '提示', {
|
|
|
|
+ confirmButtonText: '忽略并提交',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'error'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.submitWeekReport(0)
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 提交按周填报
|
|
// 提交按周填报
|
|
submitWeekReport(isDraft) {
|
|
submitWeekReport(isDraft) {
|
|
var zhi = this.zhoData
|
|
var zhi = this.zhoData
|
|
@@ -6899,7 +6938,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- if(overcorp != ''){
|
|
|
|
|
|
+ if(this.user.companyId != 5978 && overcorp != ''){
|
|
overcorp = overcorp.substring(0,overcorp.length - 1)
|
|
overcorp = overcorp.substring(0,overcorp.length - 1)
|
|
this.$message({
|
|
this.$message({
|
|
message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
|
|
message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
|
|
@@ -7479,18 +7518,83 @@
|
|
this.isDraft = isDraft;
|
|
this.isDraft = isDraft;
|
|
this.$refs.workForm.validate(valid => {
|
|
this.$refs.workForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- if(this.totalReportHours < this.user.timeType.allday){
|
|
|
|
- this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- this.submitReportSon()
|
|
|
|
- }).catch(() => {
|
|
|
|
- });
|
|
|
|
- }else{
|
|
|
|
- this.submitReportSon()
|
|
|
|
- }
|
|
|
|
|
|
+ if (!isDraft) {
|
|
|
|
+ //针对苏州景昱,单独的检查逻辑
|
|
|
|
+ if (this.user.companyId == 5978) {
|
|
|
|
+ //调接口,先检查工时是否存在异常
|
|
|
|
+ var totalTime = 0;
|
|
|
|
+ for (var t=0;t<this.workForm.domains.length; t++) {
|
|
|
|
+ totalTime += parseFloat(this.workForm.domains[t].workingTime);
|
|
|
|
+ }
|
|
|
|
+ var array = [];
|
|
|
|
+ if (this.isBatch) {
|
|
|
|
+ var startDate = new Date(this.workForm.createDate[0]);
|
|
|
|
+ var endDate = new Date(this.workForm.createDate[1]);
|
|
|
|
+ if (startDate > endDate) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '开始日期不能大于结束日期',
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ while(true){
|
|
|
|
+ var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
|
|
|
|
+ array.push(workData);
|
|
|
|
+ startDate.setDate(startDate.getDate() + 1);
|
|
|
|
+ if (startDate > endDate) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ var workData = {date: this.workForm.createDate, workingTime: totalTime};
|
|
|
|
+ array.push(workData)
|
|
|
|
+ }
|
|
|
|
+ this.submitingReport = true;
|
|
|
|
+ var passUserId = this.user.id;
|
|
|
|
+ if (this.isSubstitude) {
|
|
|
|
+ passUserId = this.targetUids;
|
|
|
|
+ }
|
|
|
|
+ this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
|
|
|
|
+ res => {
|
|
|
|
+ this.submitingReport = false;
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.submitReportSon()
|
|
|
|
+ } else {
|
|
|
|
+ this.$confirm(res.msg, '提示', {
|
|
|
|
+ confirmButtonText: '忽略并提交',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'error'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.submitReportSon()
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ if(this.totalReportHours < this.user.timeType.allday){
|
|
|
|
+ this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.submitReportSon()
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ this.submitReportSon()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //暂存,不需要检查工时是否超过考勤
|
|
|
|
+ this.submitReportSon()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -7690,8 +7794,8 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //针对凡己,不校验考勤时长
|
|
|
|
- if (this.user.companyId != 3918 && this.reportTimeType.type == 1 && this.workForm.time) {
|
|
|
|
|
|
+ //针对凡己和景昱,此处不校验考勤时长
|
|
|
|
+ if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
|
|
if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
|
|
if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
|
|
this.$message({
|
|
this.$message({
|
|
message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
|
|
message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
|