Commit 241c0d86 by ningjihai

请假修改

parent ffd44599
...@@ -99,4 +99,19 @@ export function getLeaveRequrstBack(leaveRequestBackId) { ...@@ -99,4 +99,19 @@ export function getLeaveRequrstBack(leaveRequestBackId) {
url: `/attendance/attMobile/getLeaveRequrstBack/${leaveRequestBackId}`, url: `/attendance/attMobile/getLeaveRequrstBack/${leaveRequestBackId}`,
method: 'get' method: 'get'
}) })
}
// 预计算请假天数(后端精确计算,按班次与节假日排除非工作日)
export function precomputeLeaveDays(params) {
return request({
url: '/attendance/leaveRequest/precompute',
method: 'post',
data: params
})
}
export function getRestTime() {
return request({
url: '/attendance/leaveRequest/getRestTime',
method: 'get'
})
} }
\ No newline at end of file
<script setup lang="ts" name="LeaveDetailFlow"> <script setup lang="ts" name="LeaveDetailFlow">
/* 请假详情 */ /* 请假详情 */
import { ref, reactive, computed, onMounted } from 'vue' import { ref, reactive, computed, onMounted } from 'vue'
// import { useRouter } from 'vue-router' import { parseTime } from '/common/utils/ruoyi'
// import { showImagePreview } from 'vant'
import { getFlowChart } from '@/api/flowEngine/flowInterface' import { getFlowChart } from '@/api/flowEngine/flowInterface'
import { getLeaveRequestDetail } from '@/api/attendance/leave' import { getLeaveRequestDetail } from '@/api/attendance/leave'
import { selectDictLabel } from '@/common/utils/ruoyi' import { selectDictLabel } from '@/common/utils/ruoyi'
...@@ -79,14 +78,16 @@ function onDetailClose(item) { ...@@ -79,14 +78,16 @@ function onDetailClose(item) {
:options="breast_feed_type" :options="breast_feed_type"
:value="detail.breastFeedType" /> :value="detail.breastFeedType" />
</van-cell> </van-cell>
<van-cell title="开始时间" :value="detail.leaveType === '17' ? detail.beginTime.slice(0, 10) : detail.beginTime" /> <van-cell title="开始日期" :value="parseTime(detail.beginTime, '{y}-{m}-{d}')" />
<van-cell title="结束时间" :value="detail.leaveType === '17' ? detail.endTime.slice(0, 10) : detail.endTime" /> <van-cell title="开始上午/下午" :value="detail.startHalf === 'AM' ? '上午' : '下午'" />
<van-cell title="结束日期" :value="parseTime(detail.endTime, '{y}-{m}-{d}')" />
<van-cell title="结束上午/下午" :value="detail.startHalf === 'PM' ? '上午' : '下午'" />
<van-cell title="请假时长"> <van-cell title="请假时长">
{{ detail.duringTime }}小时 {{ detail.duringTime }}
</van-cell> </van-cell>
<van-cell title="代理人" :value="detail.agentName" /> <!-- <van-cell title="代理人" :value="detail.agentName" /> -->
<van-cell title="请假事由" :value="detail.reason" /> <van-cell title="请假事由" :value="detail.reason" />
<van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> <!-- <van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> -->
<van-grid <van-grid
v-if="detail.fileList?.length" v-if="detail.fileList?.length"
:border="false" :border="false"
......
<script setup lang="ts" name="LeaveDetailFlowClose"> <script setup lang="ts" name="LeaveDetailFlowClose">
/* 销假详情 */ /* 销假详情 */
// import { ref } from 'vue' import { parseTime } from '/common/utils/ruoyi'
// import { showImagePreview } from 'vant'
import { getLeaveRequrstBack } from '@/api/attendance/leave' import { getLeaveRequrstBack } from '@/api/attendance/leave'
import { getFlowChart } from '@/api/flowEngine/flowInterface' import { getFlowChart } from '@/api/flowEngine/flowInterface'
import { useDict } from '@/common/utils/dict' import { useDict } from '@/common/utils/dict'
...@@ -53,14 +52,16 @@ function onPreview(index) { ...@@ -53,14 +52,16 @@ function onPreview(index) {
:options="request_leave_type" :options="request_leave_type"
:value="detail?.leaveType" /> :value="detail?.leaveType" />
</van-cell> </van-cell>
<van-cell title="开始时间" :value="detail?.beginTime" /> <van-cell title="开始日期" :value="parseTime(detail.beginTime, '{y}-{m}-{d}')" />
<van-cell title="结束时间" :value="detail?.businessTripStatus === '2' ? detail?.realBackTime : detail?.endTime" /> <van-cell title="开始上午/下午" :value="detail.startHalf === 'AM' ? '上午' : '下午'" />
<van-cell title="请假时长"> <van-cell title="结束日期" :value="parseTime(detail.endTime, '{y}-{m}-{d}')" />
{{ detail?.duringTime }}小时 <van-cell title="结束上午/下午" :value="detail.startHalf === 'PM' ? '上午' : '下午'" />
</van-cell> <van-cell title="请假时长">
<van-cell title="代理人" :value="detail?.agentName" /> {{ detail.duringTime }}
</van-cell>
<!-- <van-cell title="代理人" :value="detail?.agentName" /> -->
<van-cell title="请假事由" :value="detail?.reason" /> <van-cell title="请假事由" :value="detail?.reason" />
<van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> <!-- <van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> -->
<van-grid <van-grid
v-if="detail?.fileList?.length" v-if="detail?.fileList?.length"
:border="false" :border="false"
......
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed, onMounted, onUnmounted } from 'vue' import { ref, reactive, computed, watch,onMounted, onUnmounted } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { addLeaveRequest, updateLeaveRequest, getLeaveRequestDetail } from '@/api/attendance/leave' import { addLeaveRequest, updateLeaveRequest, getLeaveRequestDetail,precomputeLeaveDays,getRestTime } from '@/api/attendance/leave'
import { selectEmployeesDetailByCode } from '@/api/user' import { selectEmployeesDetailByCode } from '@/api/user'
import { parseTime, selectDictLabel } from '../../common/utils/ruoyi' import { parseTime, selectDictLabel } from '../../common/utils/ruoyi'
import { useDict } from '../../common/utils/dict' import { useDict } from '../../common/utils/dict'
...@@ -24,12 +25,16 @@ const dateFormat = { ...@@ -24,12 +25,16 @@ const dateFormat = {
const formRef = ref() const formRef = ref()
const detail = ref<any>({}) const detail = ref<any>({})
const form = reactive({ const form = reactive<any>({
id: '', // 修改编辑 id: '', // 修改编辑
auditStatus: '', // 状态 auditStatus: '', // 状态
leaveType: '', // 请假类型 leaveType: '', // 请假类型
breastFeedType: '', // 哺乳假类型 breastFeedType: '', // 哺乳假类型
beginTime: '', // 结束时间 beginTime: '', // 结束时间
startHalf: 'AM',
startHalfLabel: '上午',
endHalf: 'PM',
endHalfLabel: '下午',
beginTimeStamp: '', beginTimeStamp: '',
endTimeStamp: '', endTimeStamp: '',
endTime: '', // 结束时间 endTime: '', // 结束时间
...@@ -39,6 +44,20 @@ const form = reactive({ ...@@ -39,6 +44,20 @@ const form = reactive({
urgentHandingOfAffairs: '', // 岗位紧急处理事务 urgentHandingOfAffairs: '', // 岗位紧急处理事务
fileList: [] // 图片 fileList: [] // 图片
}) })
const startHalf = ref('')
const endHalf = ref('')
const HalfColumns = ref([
[
{
value: 'AM',
label: '上午'
},
{
value: 'PM',
label: '下午'
}
]
])
const loading = ref(false) const loading = ref(false)
const activeTabStart = ref(0) const activeTabStart = ref(0)
...@@ -59,7 +78,50 @@ const show = reactive({ ...@@ -59,7 +78,50 @@ const show = reactive({
const isBreastFeed = computed(() => form.leaveType === '17') // 是否为哺乳假 const isBreastFeed = computed(() => form.leaveType === '17') // 是否为哺乳假
const leaveTypeName = computed(() => selectDictLabel(request_leave_type, form.leaveType)) // 请假类型名称 const leaveTypeName = computed(() => selectDictLabel(request_leave_type, form.leaveType)) // 请假类型名称
const breastFeedType = computed(() => selectDictLabel(breast_feed_type, form.breastFeedType)) // 哺乳假类型名称 const breastFeedType = computed(() => selectDictLabel(breast_feed_type, form.breastFeedType)) // 哺乳假类型名称
const remainAnnualLeave:any = ref(0)
const remainRestHour:any = ref(0)
onMounted(()=>{
getRestTime().then(res => {
console.log('getRestTime', res)
let data = res.data
if(!data) return
remainAnnualLeave.value = Number(data.remainAnnualLeave)
remainRestHour.value = Number(data.remainRestHour)
}).catch(err => {
console.error('getRestTime error', err)
})
})
function computeDuringDays() {
try {
if (!form.beginTime || !form.endTime) {
return
}
// use backend precompute for accurate result
const beginDate = String(form.beginTime).split(' ')[0]
const endDate = String(form.endTime).split(' ')[0]
const params = {
employeesCode: userInfo.value.userCode,
beginDate: beginDate,
startHalf: form.startHalf || 'AM',
endDate: endDate,
endHalf: form.endHalf || 'PM'
}
precomputeLeaveDays(params).then(res => {
if (res && res.data != null) {
form.duringTime = Number(res.data)
}
}).catch(err => {
console.error('precomputeLeaveDays error', err)
})
} catch (e) {
console.error('computeDuringDays error', e)
}
}
watch(() => [form.beginTime, form.startHalf, form.endTime, form.endHalf], () => {
computeDuringDays()
})
function formatterDate(type, option) { function formatterDate(type, option) {
option.text += dateFormat[type] option.text += dateFormat[type]
return option return option
...@@ -229,7 +291,25 @@ function onFailed(e) { ...@@ -229,7 +291,25 @@ function onFailed(e) {
// 校验结果 // 校验结果
function onSubmit(e) { function onSubmit(e) {
formRef.value?.validate().then(() => { formRef.value?.validate().then(() => {
if (form.leaveType === '8' && form.duringTime > remainRestHour.value) {
uni.showToast({
title: '剩余调休时长不足',
icon: 'none'
})
return
}
if (form.leaveType === '9') {
if (form.duringTime > remainAnnualLeave.value) {
uni.showToast({
title: '剩余年假时长不足',
icon: 'none'
})
return
}
}
loading.value = true loading.value = true
uni.showLoading({ uni.showLoading({
...@@ -245,11 +325,12 @@ function onSubmit(e) { ...@@ -245,11 +325,12 @@ function onSubmit(e) {
fileType: item.fileType fileType: item.fileType
})) }))
} }
if (isBreastFeed.value) { // if (isBreastFeed.value) {
requstData.beginTime += ' 00:00' requstData.beginTime += ' 00:00'
requstData.endTime += ' 00:00' requstData.endTime += ' 00:00'
} // }
console.log('requstData',requstData)
// return
const requestMethod = form.id ? updateLeaveRequest : addLeaveRequest const requestMethod = form.id ? updateLeaveRequest : addLeaveRequest
requestMethod(requstData).then(res => { requestMethod(requstData).then(res => {
uni.showToast({title: res.msg}) uni.showToast({title: res.msg})
...@@ -313,7 +394,29 @@ function timestampToTime(timestamp) { ...@@ -313,7 +394,29 @@ function timestampToTime(timestamp) {
const minutes = String(date.getMinutes()).padStart(2, '0'); // 分(补零) const minutes = String(date.getMinutes()).padStart(2, '0'); // 分(补零)
const seconds = String(date.getSeconds()).padStart(2, '0'); // 秒(补零) const seconds = String(date.getSeconds()).padStart(2, '0'); // 秒(补零)
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; return `${year}-${month}-${day}`;
}
const startHalfRef:any = ref(null)
const showStartHalf = ()=>{
startHalfRef?.value.open()
}
const onConfirmStartHalf = (e:any)=>{
console.log(e)
form.endHalf = e.value[0].value
form.endHalfLabel = e.value[0].label
}
const endHalfRef:any = ref(null)
const showEndHalf = ()=>{
endHalfRef?.value.open()
}
const onConfirmEndHalf = (e:any)=>{
console.log(e)
form.endHalf = e.value[0].value
form.endHalfLabel = e.value[0].label
} }
</script> </script>
...@@ -372,11 +475,11 @@ function timestampToTime(timestamp) { ...@@ -372,11 +475,11 @@ function timestampToTime(timestamp) {
/> />
<!-- 开始时间 --> <!-- 开始时间 -->
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="开始时间" prop="beginTime" required @click="openBeginPicker"> <uv-form-item customStyle="padding: 20rpx 32rpx;" label="开始日期" prop="beginTime" required @click="openBeginPicker">
<uv-input <uv-input
v-model="form.beginTime" v-model="form.beginTime"
disabled disabled
placeholder="点击选择开始时间" placeholder="点击选择开始日期"
border="bottom" border="bottom"
disabledColor="#fff" disabledColor="#fff"
/> />
...@@ -384,16 +487,38 @@ function timestampToTime(timestamp) { ...@@ -384,16 +487,38 @@ function timestampToTime(timestamp) {
<uv-icon name="arrow-right"></uv-icon> <uv-icon name="arrow-right"></uv-icon>
</template> </template>
</uv-form-item> </uv-form-item>
<uv-datetime-picker ref="beginTimeRef" :formatter="formatter" v-model="form.beginTimeStamp" mode="datetime" :minDate="nowStamp" @confirm="confirmBeginTime"> <uv-datetime-picker ref="beginTimeRef" :formatter="formatter" v-model="form.beginTimeStamp" mode="date" :minDate="nowStamp" @confirm="confirmBeginTime">
</uv-datetime-picker> </uv-datetime-picker>
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="开始上午/下午" prop="startHalf" required @click="showStartHalf">
<uv-input
v-model="form.startHalfLabel"
disabled
placeholder="选择请假类型"
border="bottom"
disabledColor="#fff"
/>
<template v-slot:right>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-form-item>
<uv-picker
ref="startHalfRef"
v-model="startHalf"
:columns="HalfColumns"
keyName="label"
@confirm="onConfirmStartHalf"
/>
<!-- 结束时间 --> <!-- 结束时间 -->
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="结束时间" prop="endTime" required @click="openEndPicker"> <uv-form-item customStyle="padding: 20rpx 32rpx;" label="结束日期" prop="endTime" required @click="openEndPicker">
<uv-input <uv-input
v-model="form.endTime" v-model="form.endTime"
disabled disabled
placeholder="点击选择结束时间" placeholder="点击选择结束日期"
border="bottom" border="bottom"
disabledColor="#fff" disabledColor="#fff"
...@@ -402,29 +527,47 @@ function timestampToTime(timestamp) { ...@@ -402,29 +527,47 @@ function timestampToTime(timestamp) {
<uv-icon name="arrow-right"></uv-icon> <uv-icon name="arrow-right"></uv-icon>
</template> </template>
</uv-form-item> </uv-form-item>
<uv-datetime-picker ref="endTimeRef" :formatter="formatter" v-model="form.endTimeStamp" mode="datetime" :minDate="nowStamp" @confirm="confirmEndTime"> <uv-datetime-picker ref="endTimeRef" :formatter="formatter" v-model="form.endTimeStamp" mode="date" :minDate="nowStamp" @confirm="confirmEndTime">
</uv-datetime-picker> </uv-datetime-picker>
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="结束上午/下午" prop="endHalf" required @click="showEndHalf">
<uv-input
v-model="form.endHalfLabel"
disabled
placeholder="选择请假类型"
border="bottom"
disabledColor="#fff"
/>
<template v-slot:right>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-form-item>
<uv-picker
ref="endHalfRef"
v-model="endHalf"
:columns="HalfColumns"
keyName="label"
@confirm="onConfirmEndHalf"
/>
<!-- 请假时长(小时) --> <!-- 请假时长(小时) -->
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="请假时长(小时)" prop="duringTime" required> <uv-form-item customStyle="padding: 20rpx 32rpx;" label="请假时长()" prop="duringTime" required>
<uv-input <uv-input
v-model="form.duringTime" v-model="form.duringTime"
type="number" disabled
placeholder="请输入请假时长" placeholder="请假时长(天)"
maxlength="5"
border="bottom" border="bottom"
/> />
</uv-form-item> </uv-form-item>
<!-- 代理人 --> <!-- 代理人 -->
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="代理人" prop="agentName" required> <!-- <uv-form-item customStyle="padding: 20rpx 32rpx;" label="代理人" prop="agentName" required>
<uv-input <uv-input
v-model="form.agentName" v-model="form.agentName"
placeholder="请输入代理人" placeholder="请输入代理人"
border="bottom" border="bottom"
/> />
</uv-form-item> </uv-form-item> -->
<!-- 请假事由 --> <!-- 请假事由 -->
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="事由" prop="reason" required> <uv-form-item customStyle="padding: 20rpx 32rpx;" label="事由" prop="reason" required>
...@@ -438,7 +581,7 @@ function timestampToTime(timestamp) { ...@@ -438,7 +581,7 @@ function timestampToTime(timestamp) {
</uv-form-item> </uv-form-item>
<!-- 岗位紧急处理事务 --> <!-- 岗位紧急处理事务 -->
<uv-form-item customStyle="padding: 20rpx 32rpx;" label="岗位紧急处理事务" prop="urgentHandingOfAffairs" required> <!-- <uv-form-item customStyle="padding: 20rpx 32rpx;" label="岗位紧急处理事务" prop="urgentHandingOfAffairs" required>
<uv-textarea <uv-textarea
v-model="form.urgentHandingOfAffairs" v-model="form.urgentHandingOfAffairs"
placeholder="请输入岗位紧急处理事务" placeholder="请输入岗位紧急处理事务"
...@@ -446,7 +589,7 @@ function timestampToTime(timestamp) { ...@@ -446,7 +589,7 @@ function timestampToTime(timestamp) {
count count
border="bottom" border="bottom"
/> />
</uv-form-item> </uv-form-item> -->
<!-- 图片上传 --> <!-- 图片上传 -->
......
<script setup lang="ts" name="LeaveDetailFlow"> <script setup lang="ts" name="LeaveDetailFlow">
/* 请假详情 */ /* 请假详情 */
import { ref, reactive, computed, onMounted } from 'vue' import { ref, reactive, computed, onMounted } from 'vue'
// import { useRouter } from 'vue-router' import { parseTime } from '/common/utils/ruoyi'
// import { showImagePreview } from 'vant'
import { getFlowChart } from '@/api/flowEngine/flowInterface' import { getFlowChart } from '@/api/flowEngine/flowInterface'
import { getLeaveRequestDetail } from '@/api/attendance/leave' import { getLeaveRequestDetail } from '@/api/attendance/leave'
import { selectDictLabel } from '@/common/utils/ruoyi' import { selectDictLabel } from '@/common/utils/ruoyi'
...@@ -79,14 +78,16 @@ function onDetailClose(item) { ...@@ -79,14 +78,16 @@ function onDetailClose(item) {
:options="breast_feed_type" :options="breast_feed_type"
:value="detail.breastFeedType" /> :value="detail.breastFeedType" />
</van-cell> </van-cell>
<van-cell title="开始时间" :value="detail.leaveType === '17' ? detail.beginTime.slice(0, 10) : detail.beginTime" /> <van-cell title="开始日期" :value="parseTime(detail.beginTime, '{y}-{m}-{d}')" />
<van-cell title="结束时间" :value="detail.leaveType === '17' ? detail.endTime.slice(0, 10) : detail.endTime" /> <van-cell title="开始上午/下午" :value="detail.startHalf === 'AM' ? '上午' : '下午'" />
<van-cell title="结束日期" :value="parseTime(detail.endTime, '{y}-{m}-{d}')" />
<van-cell title="结束上午/下午" :value="detail.startHalf === 'PM' ? '上午' : '下午'" />
<van-cell title="请假时长"> <van-cell title="请假时长">
{{ detail.duringTime }}小时 {{ detail.duringTime }}
</van-cell> </van-cell>
<van-cell title="代理人" :value="detail.agentName" /> <!-- <van-cell title="代理人" :value="detail.agentName" /> -->
<van-cell title="请假事由" :value="detail.reason" /> <van-cell title="请假事由" :value="detail.reason" />
<van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> <!-- <van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> -->
<van-grid <van-grid
v-if="detail.fileList?.length" v-if="detail.fileList?.length"
:border="false" :border="false"
......
<script setup lang="ts" name="LeaveDetailFlowClose"> <script setup lang="ts" name="LeaveDetailFlowClose">
/* 销假详情 */ import { parseTime } from '/common/utils/ruoyi'
// import { ref } from 'vue'
// import { showImagePreview } from 'vant'
import { getLeaveRequrstBack } from '@/api/attendance/leave' import { getLeaveRequrstBack } from '@/api/attendance/leave'
import { getFlowChart } from '@/api/flowEngine/flowInterface' import { getFlowChart } from '@/api/flowEngine/flowInterface'
import { useDict } from '../../../common/utils/dict' import { useDict } from '../../../common/utils/dict'
...@@ -54,14 +52,16 @@ function onPreview(index) { ...@@ -54,14 +52,16 @@ function onPreview(index) {
:options="request_leave_type" :options="request_leave_type"
:value="detail?.leaveType" /> :value="detail?.leaveType" />
</van-cell> </van-cell>
<van-cell title="开始时间" :value="detail?.beginTime" /> <van-cell title="开始日期" :value="parseTime(detail.beginTime, '{y}-{m}-{d}')" />
<van-cell title="结束时间" :value="detail?.businessTripStatus === '2' ? detail?.realBackTime : detail?.endTime" /> <van-cell title="开始上午/下午" :value="detail.startHalf === 'AM' ? '上午' : '下午'" />
<van-cell title="结束日期" :value="parseTime(detail.endTime, '{y}-{m}-{d}')" />
<van-cell title="结束上午/下午" :value="detail.startHalf === 'PM' ? '上午' : '下午'" />
<van-cell title="请假时长"> <van-cell title="请假时长">
{{ detail?.duringTime }}小时 {{ detail?.duringTime }}
</van-cell> </van-cell>
<van-cell title="代理人" :value="detail?.agentName" /> <!-- <van-cell title="代理人" :value="detail?.agentName" /> -->
<van-cell title="请假事由" :value="detail?.reason" /> <van-cell title="请假事由" :value="detail?.reason" />
<van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> <!-- <van-cell title="岗位紧急处理事务" :value="detail.urgentHandingOfAffairs || '无'" /> -->
<van-grid <van-grid
v-if="detail?.fileList?.length" v-if="detail?.fileList?.length"
:border="false" :border="false"
......
...@@ -41,10 +41,10 @@ function onRevoke() { ...@@ -41,10 +41,10 @@ function onRevoke() {
<div class="list-item__address"> <div class="list-item__address">
请假类型:<DictTag :tag="false" :options="request_leave_type" :value="props.item.leaveType ?? ''" /> 请假类型:<DictTag :tag="false" :options="request_leave_type" :value="props.item.leaveType ?? ''" />
</div> </div>
<div class="list-item__date">开始时间:{{ props.item.leaveType === '17' ? props.item.beginTime.slice(0, 10) : props.item.beginTime }}</div> <div class="list-item__date">开始日期:{{ parseTime(props.item.beginTime, '{y}-{m}-{d}') }}</div>
<!-- <div class="list-item__date">结束时间:{{ props.item.businessTripStatus === '2' ? props.item.realEndTime : props.item.endTime }}</div> --> <!-- <div class="list-item__date">结束时间:{{ props.item.businessTripStatus === '2' ? props.item.realEndTime : props.item.endTime }}</div> -->
<div class="list-item__date">结束时间:{{ props.item.leaveType === '17' ? props.item.endTime.slice(0, 10) : props.item.endTime }}</div> <div class="list-item__date">结束日期:{{ parseTime(props.item.endTime, '{y}-{m}-{d}') }}</div>
<div class="list-item__days">请假时长:{{ props.item.duringTime }}小时</div> <div class="list-item__days">请假时长:{{ props.item.duringTime }}</div>
<div class="list-item__detail"> <div class="list-item__detail">
<div>请假事由:</div> <div>请假事由:</div>
<div class="list-item__detail-content">{{ props.item.reason }}</div> <div class="list-item__detail-content">{{ props.item.reason }}</div>
......
...@@ -94,49 +94,57 @@ provide('process_group', process_group) ...@@ -94,49 +94,57 @@ provide('process_group', process_group)
provide('states', states) provide('states', states)
provide('onDetail', (approveCardData: any, type: string) => { provide('onDetail', (approveCardData: any, type: string) => {
console.log(approveCardData, type) console.log(approveCardData, type)
if (!processCode[approveCardData.processCode]) { const matchedKey = Object.keys(processCode).find(key =>
uni.showToast({ approveCardData.processCode.includes(key)
title:'请前往电脑端处理操作' )
}) if(matchedKey){
return console.log(matchedKey)
}
const page = { const page = {
'trip': '/attendance/trip/detail', 'trip': '/attendance/trip/detail',
'leave': '/attendance/leave/detail', 'leave': '/attendance/leave/detail',
'tripClose': '/attendance/trip/close-detail', 'tripClose': '/attendance/trip/close-detail',
'leaveClose': '/attendance/leave/close-detail', 'leaveClose': '/attendance/leave/close-detail',
'overTimeForLeave': '/attendance/overTimeForLeave/detail', 'overTimeForLeave': '/attendance/overTimeForLeave/detail',
'cardSign': '/attendance/cardSign/detail', 'cardSign': '/attendance/cardSign/detail',
'outside': '/attendance/outside/detail', 'outside': '/attendance/outside/detail',
'dayOff': '/attendance/dayOff/detail', 'dayOff': '/attendance/dayOff/detail',
'overtimeWork': '/attendance/overtimeWork/detail', 'overtimeWork': '/attendance/overtimeWork/detail',
'abnormalOvertime': '/attendance/abnormalOvertime/detail', 'abnormalOvertime': '/attendance/abnormalOvertime/detail',
'resignation': '/personnel/resignation/detail', 'resignation': '/personnel/resignation/detail',
'employeesChanges': '/personnel/employeesChanges/detail', 'employeesChanges': '/personnel/employeesChanges/detail',
'employmentApplication': '/personnel/employmentApplication/detail', 'employmentApplication': '/personnel/employmentApplication/detail',
'recruitmentNeeds': '/personnel/recruitmentNeeds/detail', 'recruitmentNeeds': '/personnel/recruitmentNeeds/detail',
'employeesDisciplinary': '/personnel/employeesDisciplinary/detail', 'employeesDisciplinary': '/personnel/employeesDisciplinary/detail',
'useCarApply': '/carUse/apply/detail' 'useCarApply': '/carUse/apply/detail'
}
// 待办
if (type === '1') {
uni.navigateTo({
url:'/approve/detail?type=' + processCode[approveCardData.processCode] + '&id=' + approveCardData.businessId + '&instanceId=' + approveCardData.instanceId + '&taskId=' + approveCardData.taskId + '&userId=' + approveCardData.userId + '&userName=' + approveCardData.userName + '&beginTime=' + approveCardData.beginTime + '&endTime=' + approveCardData.endTime
})
} else {
let instanceId = approveCardData.instanceId
// 已发
if (type === '3') {
instanceId = approveCardData.id
} }
// 抄送 // 待办
if (type === '4') { if (type === '1') {
instanceId = approveCardData.ruId uni.navigateTo({
url:'/approve/detail?type=' + processCode[matchedKey] + '&id=' + approveCardData.businessId + '&instanceId=' + approveCardData.instanceId + '&taskId=' + approveCardData.taskId + '&userId=' + approveCardData.userId + '&userName=' + approveCardData.userName + '&beginTime=' + approveCardData.beginTime + '&endTime=' + approveCardData.endTime
})
} else {
let instanceId = approveCardData.instanceId
// 已发
if (type === '3') {
instanceId = approveCardData.id
}
// 抄送
if (type === '4') {
instanceId = approveCardData.ruId
}
uni.navigateTo({
url: page[processCode[matchedKey]] + '?id=' + approveCardData.businessId + '&instanceId=' + instanceId + '&beginTime=' + approveCardData.beginTime + '&endTime=' + approveCardData.endTime
})
} }
uni.navigateTo({ }else{
url: page[processCode[approveCardData.processCode]] + '?id=' + approveCardData.businessId + '&instanceId=' + instanceId + '&beginTime=' + approveCardData.beginTime + '&endTime=' + approveCardData.endTime uni.showToast({
}) title:'请前往电脑端处理操作'
})
return
} }
}) })
function changeTotal(total, index) { function changeTotal(total, index) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论