|
|
@@ -177,7 +177,8 @@
|
|
|
<div class="form-group row">
|
|
|
<label for="initial_weight" class="col-3 col-form-label text-right">晚饭时间</label>
|
|
|
<div class="col-7">
|
|
|
- <select :class="{ 'is-invalid' : errors.dinner_duration }" v-model="processDailyParticipantOne.dinner_duration" class="form-control">
|
|
|
+ <select :class="{ 'is-invalid' : errors.dinner_duration }" :data-old-value="processDailyParticipantOne.dinner_duration" v-model="processDailyParticipantOne.dinner_duration"
|
|
|
+ @change="updateDinnerDuration(processDailyParticipantOne,$event)" class="form-control">
|
|
|
<option value="0">无</option>
|
|
|
<option value="30">30分钟</option>
|
|
|
<option value="60">60分钟</option>
|
|
|
@@ -505,7 +506,8 @@
|
|
|
</span><span v-else>@{{ processDailyParticipant.unit_price }}</span></td>
|
|
|
<td>
|
|
|
<span v-if="!processDailyParticipant.user_detail_full_name && processDailyParticipant.isAddProcessDailyParticipant==false">
|
|
|
- <select :class="{ 'is-invalid' : errors.dinner_duration }" :data-original-title="errors.dinner_duration ? errors.dinner_duration[0] : ''" :id="processDailyParticipant.daily_id+'dinner_duration'" class="form-control tooltipTargetError" style="width:80px">
|
|
|
+ <select :class="{ 'is-invalid' : errors.dinner_duration }" @input="hourFilter(processDailyParticipant.daily_id,true)" :data-original-title="errors.dinner_duration ? errors.dinner_duration[0] : ''"
|
|
|
+ :id="processDailyParticipant.daily_id+'dinner_duration'" class="form-control tooltipTargetError" style="width:80px">
|
|
|
<option value="0">无</option>
|
|
|
<option value="30">30分钟</option>
|
|
|
<option value="60">60分钟</option>
|
|
|
@@ -1120,14 +1122,16 @@
|
|
|
let ended_at = new Date('2020/1/1 ' + $('#' + processDailyParticipant + 'ended_at')[0].value).getTime();
|
|
|
let hour_count = (ended_at - started_at) / 3600000;
|
|
|
if (started_at < start && ended_at > end) hour_count -= 1;
|
|
|
- $('#' + processDailyParticipant + 'hour_count')[0].value = hour_count;
|
|
|
+ let dinner_duration=Number($('#' + processDailyParticipant + 'dinner_duration')[0].value)/60;
|
|
|
+ $('#' + processDailyParticipant + 'hour_count')[0].value = (hour_count - dinner_duration).toFixed(1);
|
|
|
return;
|
|
|
}
|
|
|
let started_at = new Date('2020/1/1 ' + processDailyParticipant.started_at).getTime();
|
|
|
let ended_at = new Date('2020/1/1 ' + processDailyParticipant.ended_at).getTime();
|
|
|
let hour_count = (ended_at - started_at) / 3600000;
|
|
|
if (started_at < start && ended_at > end) hour_count -= 1;
|
|
|
- processDailyParticipant.hour_count = hour_count;
|
|
|
+ let dinner_duration=Number(processDailyParticipant.dinner_duration) / 60;
|
|
|
+ processDailyParticipant.hour_count = (hour_count - dinner_duration).toFixed(1);
|
|
|
},
|
|
|
//提交参与人
|
|
|
submitProcessDailyParticipant(e) {
|
|
|
@@ -1648,7 +1652,13 @@
|
|
|
tempTip.setDuration(4000);
|
|
|
tempTip.show('网络错误:'+err);
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ //修改时的晚饭时间改变计时工时
|
|
|
+ updateDinnerDuration(processDailyParticipantOne,e){
|
|
|
+ let oldValue=Number(e.target.dataset.oldValue) / 60;
|
|
|
+ let newValue=Number(processDailyParticipantOne.dinner_duration) / 60;
|
|
|
+ processDailyParticipantOne.hour_count += (oldValue-newValue);
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
</script>
|