日期计算
This commit is contained in:
parent
11a9d5db54
commit
ef5f6da7e4
|
|
@ -258,7 +258,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPersonSelect, addEvection, getTravelPersonSelect } from '../../api/index.js'
|
import { getPersonSelect, addEvection, getTravelPersonSelect, getDays } from '../../api/index.js'
|
||||||
import RecordList from '../../pages/evection/recordList.vue'
|
import RecordList from '../../pages/evection/recordList.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -384,9 +384,20 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算出差时长(天数差)
|
let dateData = {
|
||||||
const duration = Math.round((end - start) / (1000 * 60 * 60 * 24))
|
startTime: startDate,
|
||||||
this.formData.leaveDuration = duration + 1
|
endTime: endDate
|
||||||
|
}
|
||||||
|
if (startDate!=null && startDate!=='' && endDate!=null && endDate!=='') {
|
||||||
|
getDays(dateData).then(response => {
|
||||||
|
if (response.status === 200) {
|
||||||
|
console.log(response)
|
||||||
|
this.formData.leaveDuration=response.data
|
||||||
|
} else {
|
||||||
|
this.formData.leaveDuration=''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onApprovalChange(e) {
|
onApprovalChange(e) {
|
||||||
this.formData.isAgree = e.detail.value
|
this.formData.isAgree = e.detail.value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue