|  |  | 
 |  |  |       :contactPhoneNumber="contactPhoneNumber" | 
 |  |  |     > | 
 |  |  |       <template #actions> | 
 |  |  |         <nut-button | 
 |  |  |           v-if="checkReceiveStatus === EnumTaskCheckReceiveStatus.WaitCheckReceive" | 
 |  |  |           type="primary" | 
 |  |  |           class="task-check-card-phone-btn" | 
 |  |  |           >验收</nut-button | 
 |  |  |         > | 
 |  |  |         <div v-else class="task-check-card-phone-status" :style="{ color: Colors.Success }"> | 
 |  |  |           {{ EnumTaskCheckReceiveStatusText[checkReceiveStatus] }} | 
 |  |  |         </div> | 
 |  |  |         <template v-if="checkReceiveMethod === EnumTaskCheckReceiveMethod.CheckIn"> | 
 |  |  |           <!-- <nut-button | 
 |  |  |             v-if="!checkInTime" | 
 |  |  |             type="primary" | 
 |  |  |             class="task-check-card-phone-btn" | 
 |  |  |             @click.stop="emit('checkInOrOut', CheckInOrOutEventEnum.CheckIn)" | 
 |  |  |             >签到</nut-button | 
 |  |  |           > | 
 |  |  |           <nut-button | 
 |  |  |             v-else-if="!checkOutTime" | 
 |  |  |             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" | 
 |  |  |             >验收</nut-button | 
 |  |  |           > | 
 |  |  |           <div v-else class="task-check-card-phone-status" :style="{ color: Colors.Success }"> | 
 |  |  |             {{ EnumTaskCheckReceiveStatusText[checkReceiveStatus] }} | 
 |  |  |           </div> | 
 |  |  |         </template> | 
 |  |  |       </template> | 
 |  |  |     </TaskCheckPersonalView> | 
 |  |  |   </div> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script setup lang="ts"> | 
 |  |  | import TaskCheckPersonalView from './TaskCheckPersonalView.vue'; | 
 |  |  | import { | 
 |  |  |   Colors, | 
 |  |  |   EnumUserGender, | 
 |  |  |   EnumTaskCheckReceiveStatus, | 
 |  |  |   EnumTaskCheckReceiveStatusText, | 
 |  |  |   EnumTaskCheckReceiveMethod, | 
 |  |  |   EnumGetCheckReceiveTasksQueryResultItemCheckStatus, | 
 |  |  |   EnumTaskUserSubmitCheckReceiveStatus, | 
 |  |  | } from '@12333/constants'; | 
 |  |  | import { TaskCheckPersonalView } from '@12333/components'; | 
 |  |  | import { CheckInOrOutEventEnum } from '../constants'; | 
 |  |  | import { Portal } from 'senin-mini/components'; | 
 |  |  | import { ActionSheet } from '@nutui/nutui-taro'; | 
 |  |  |  | 
 |  |  | defineOptions({ | 
 |  |  |   name: 'TaskCheckCard', | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | enum ManageActions { | 
 |  |  |   CheckIn = 1, | 
 |  |  |   CheckOut, | 
 |  |  |   OutWork, | 
 |  |  | } | 
 |  |  |  | 
 |  |  | type Props = { | 
 |  |  |   avatar?: string; | 
 |  |  | 
 |  |  |   isReal?: boolean; | 
 |  |  |   contactPhoneNumber?: string; | 
 |  |  |   checkReceiveStatus?: EnumTaskCheckReceiveStatus; | 
 |  |  |   /** 签到时间 */ | 
 |  |  |   checkInTime?: string; | 
 |  |  |   /** 签出时间 */ | 
 |  |  |   checkOutTime?: string; | 
 |  |  |   checkReceiveMethod?: EnumTaskCheckReceiveMethod; | 
 |  |  |  | 
 |  |  |   submitCheckReceiveStatus?: EnumTaskUserSubmitCheckReceiveStatus; | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | const props = withDefaults(defineProps<Props>(), {}); | 
 |  |  |  | 
 |  |  | const emit = defineEmits<{ | 
 |  |  |   (e: 'checkReceive'): void; | 
 |  |  |   (e: 'checkInOrOut', ev: EnumTaskUserSubmitCheckReceiveStatus): void; | 
 |  |  | }>(); | 
 |  |  |  | 
 |  |  | const menuList = computed(() => { | 
 |  |  |   let _menuList = []; | 
 |  |  |   if (props.checkReceiveMethod === EnumTaskCheckReceiveMethod.CheckIn) { | 
 |  |  |     _menuList.push({ | 
 |  |  |       name: '未到岗', | 
 |  |  |       value: ManageActions.OutWork, | 
 |  |  |     }); | 
 |  |  |     if (!props.checkInTime) { | 
 |  |  |       _menuList.push({ | 
 |  |  |         name: '签到', | 
 |  |  |         value: ManageActions.CheckIn, | 
 |  |  |       }); | 
 |  |  |     } else if (!props.checkOutTime) { | 
 |  |  |       _menuList.push({ | 
 |  |  |         name: '签出', | 
 |  |  |         value: ManageActions.CheckOut, | 
 |  |  |       }); | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   return _menuList; | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | function handleMore() { | 
 |  |  |   Portal.add((key) => { | 
 |  |  |     return h( | 
 |  |  |       Portal.Container, | 
 |  |  |       { keyNumber: key, delayOpen: true }, | 
 |  |  |       { | 
 |  |  |         default: ({ open, onClose }) => | 
 |  |  |           // @ts-ignore | 
 |  |  |           h(ActionSheet, { | 
 |  |  |             visible: open.value, | 
 |  |  |             'onUpdate:visible': () => onClose(), | 
 |  |  |             menuItems: menuList.value, | 
 |  |  |             onChoose: (item) => { | 
 |  |  |               handleEmit(item); | 
 |  |  |               onClose(); | 
 |  |  |             }, | 
 |  |  |           }), | 
 |  |  |       } | 
 |  |  |     ); | 
 |  |  |   }); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | function handleEmit(action: { name: string; value: number }) { | 
 |  |  |   switch (action.value) { | 
 |  |  |     case ManageActions.CheckIn: | 
 |  |  |       emit('checkInOrOut', EnumTaskUserSubmitCheckReceiveStatus.WaitCheckReceive); | 
 |  |  |       break; | 
 |  |  |     case ManageActions.CheckOut: | 
 |  |  |       emit('checkInOrOut', EnumTaskUserSubmitCheckReceiveStatus.Success); | 
 |  |  |       break; | 
 |  |  |     case ManageActions.OutWork: | 
 |  |  |       emit('checkInOrOut', EnumTaskUserSubmitCheckReceiveStatus.Fail); | 
 |  |  |       break; | 
 |  |  |   } | 
 |  |  | } | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <style lang="scss"> |