|
@@ -354,8 +354,8 @@
|
|
|
<el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
|
|
|
v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
|
|
|
<span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
|
|
|
- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span>
|
|
|
-
|
|
|
+ <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
|
|
|
+ <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
|
|
|
<span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
|
|
|
<span v-if="workForm.time.askLeaveTime">| 请假{{ workForm.time.askLeaveTime }}小时</span>
|
|
|
</span>
|
|
@@ -2194,6 +2194,24 @@
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(['upDataLoading']),
|
|
|
+
|
|
|
+ onBatchTimeChange() {
|
|
|
+ //反向计算每日工作时长
|
|
|
+ if (this.workForm.createDate) {
|
|
|
+ let sdate = new Date(this.workForm.createDate[0]);
|
|
|
+ let edate = new Date(this.workForm.createDate[1]);
|
|
|
+ let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
|
|
|
+ console.log('days===', days)
|
|
|
+ if (days < 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
|
|
|
+ //总时长发生改变,自动按比例计算
|
|
|
+ this.workForm.domains.forEach(d=>{
|
|
|
+ d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
openModImportTime(row) {
|
|
|
this.showModImportTimeDialog = true;
|
|
|
this.modItemDataId = row.id;
|
|
@@ -3872,6 +3890,17 @@
|
|
|
this.workForm.domains.forEach(d=>{
|
|
|
d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
|
|
|
});
|
|
|
+ //计算jsTime
|
|
|
+ if (this.workForm.createDate) {
|
|
|
+ let sdate = new Date(this.workForm.createDate[0]);
|
|
|
+ let edate = new Date(this.workForm.createDate[1]);
|
|
|
+ let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
|
|
|
+ console.log('days===', days)
|
|
|
+ if (days < 0) {
|
|
|
+ days = 0;
|
|
|
+ }
|
|
|
+ this.jsTime = this.reportTimeType.allday * days;
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 是否加班的单机事件
|