| | |
| | | :contactPhoneNumber="contactPhoneNumber" |
| | | > |
| | | <template #actions> |
| | | <template v-if="checkReceiveMethod === EnumTaskCheckReceiveMethod.CheckIn"> |
| | | <!-- <nut-button |
| | | v-if="!checkInTime" |
| | | <template v-if="OrderUtils.isContainCheckIn(checkReceiveMethods)"> |
| | | <nut-button |
| | | v-if=" |
| | | !userCheckHistoryType || |
| | | userCheckHistoryType === EnumTaskUserSubmitCheckHistoryType.CheckIn |
| | | " |
| | | type="primary" |
| | | class="task-check-card-phone-btn" |
| | | @click.stop="emit('checkInOrOut', CheckInOrOutEventEnum.CheckIn)" |
| | | >签到</nut-button |
| | | @click.stop="handleMore" |
| | | >操作</nut-button |
| | | > |
| | | <nut-button |
| | | v-else-if="!checkOutTime" |
| | | v-else |
| | | type="primary" |
| | | class="task-check-card-phone-btn" |
| | | @click.stop="emit('checkInOrOut', CheckInOrOutEventEnum.CheckOut)" |
| | | >签出</nut-button |
| | | > |
| | | <div v-else class="task-check-card-phone-status" :style="{ color: Colors.Success }"> |
| | | {{ EnumTaskCheckReceiveStatusText[checkReceiveStatus] }} |
| | | </div> --> |
| | | <template |
| | | v-if="props.submitCheckReceiveStatus !== EnumTaskUserSubmitCheckReceiveStatus.Fail" |
| | | > |
| | | <nut-button |
| | | v-if="!checkInTime || !checkOutTime" |
| | | type="primary" |
| | | class="task-check-card-phone-btn" |
| | | @click.stop="handleMore" |
| | | >操作</nut-button |
| | | > |
| | | <div v-else class="task-check-card-phone-status" :style="{ color: Colors.Success }"> |
| | | {{ EnumTaskCheckReceiveStatusText[checkReceiveStatus] }} |
| | | </div> |
| | | </template> |
| | | </template> |
| | | <template v-else> |
| | | <nut-button |
| | | v-if="checkReceiveStatus === EnumTaskCheckReceiveStatus.WaitCheckReceive" |
| | | type="primary" |
| | | class="task-check-card-phone-btn" |
| | | @click.stop="handleMore" |
| | | >验收</nut-button |
| | | > |
| | | <div v-else class="task-check-card-phone-status" :style="{ color: Colors.Success }"> |
| | | {{ EnumTaskCheckReceiveStatusText[checkReceiveStatus] }} |
| | | </div> |
| | | </template> |
| | | <nut-button v-else type="primary" class="task-check-card-phone-btn" @click.stop="handleMore" |
| | | >验收</nut-button |
| | | > |
| | | </template> |
| | | </TaskCheckPersonalView> |
| | | </div> |
| | |
| | | EnumTaskCheckReceiveMethod, |
| | | EnumGetCheckReceiveTasksQueryResultItemCheckStatus, |
| | | EnumTaskUserSubmitCheckReceiveStatus, |
| | | EnumTaskUserSubmitCheckHistoryType, |
| | | } from '@12333/constants'; |
| | | import { TaskCheckPersonalView } from '@12333/components'; |
| | | import { CheckInOrOutEventEnum } from '../constants'; |
| | | import { Portal } from 'senin-mini/components'; |
| | | import { ActionSheet } from '@nutui/nutui-taro'; |
| | | import { OrderUtils } from '@12333/utils'; |
| | | |
| | | defineOptions({ |
| | | name: 'TaskCheckCard', |
| | |
| | | checkReceiveMethods?: EnumTaskCheckReceiveMethod[]; |
| | | |
| | | submitCheckReceiveStatus?: EnumTaskUserSubmitCheckReceiveStatus; |
| | | |
| | | userCheckHistoryType?: EnumTaskUserSubmitCheckHistoryType; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'checkReceive'): void; |
| | | (e: 'checkInOrOut', ev: EnumTaskUserSubmitCheckReceiveStatus): void; |
| | | (e: 'checkInOrOut', ev: EnumTaskUserSubmitCheckHistoryType): void; |
| | | }>(); |
| | | |
| | | const menuList = computed(() => { |
| | | let _menuList = []; |
| | | if (props.checkReceiveMethod === EnumTaskCheckReceiveMethod.CheckIn) { |
| | | _menuList.push({ |
| | | name: '未到岗', |
| | | value: ManageActions.OutWork, |
| | | }); |
| | | if (OrderUtils.isContainCheckIn(props.checkReceiveMethods)) { |
| | | if (!props.checkInTime) { |
| | | _menuList.push({ |
| | | name: '签到', |
| | |
| | | value: ManageActions.CheckOut, |
| | | }); |
| | | } |
| | | _menuList.push({ |
| | | name: '未到岗', |
| | | value: ManageActions.OutWork, |
| | | }); |
| | | } |
| | | |
| | | return _menuList; |
| | |
| | | function handleEmit(action: { name: string; value: number }) { |
| | | switch (action.value) { |
| | | case ManageActions.CheckIn: |
| | | emit('checkInOrOut', EnumTaskUserSubmitCheckReceiveStatus.WaitCheckReceive); |
| | | emit('checkInOrOut', EnumTaskUserSubmitCheckHistoryType.CheckIn); |
| | | break; |
| | | case ManageActions.CheckOut: |
| | | emit('checkInOrOut', EnumTaskUserSubmitCheckReceiveStatus.Success); |
| | | emit('checkInOrOut', EnumTaskUserSubmitCheckHistoryType.CheckOut); |
| | | break; |
| | | case ManageActions.OutWork: |
| | | emit('checkInOrOut', EnumTaskUserSubmitCheckReceiveStatus.Fail); |
| | | emit('checkInOrOut', EnumTaskUserSubmitCheckHistoryType.UnCheckIn); |
| | | break; |
| | | } |
| | | } |