| | |
| | | RESPONDENT: 'respondent', |
| | | VISIT_REASON: 'visit_reason', |
| | | VISIT_START_TIME: 'visit_start_time', |
| | | LICENSE_PLATE: 'license_plate', |
| | | DRIVER: 'driver', |
| | | } as const |
| | | |
| | | interface AppointmentVehicle { |
| | |
| | | const isVisitReasonRequired = computed(() => isFieldRequired(APPOINTMENT_FIELD_CODES.VISIT_REASON, true)) |
| | | const isRespondentRequired = computed(() => isFieldRequired(APPOINTMENT_FIELD_CODES.RESPONDENT, true)) |
| | | const isVisitTimeRequired = computed(() => isFieldRequired(APPOINTMENT_FIELD_CODES.VISIT_START_TIME, true)) |
| | | const showVehicleEntryOption = computed(() => |
| | | isFieldVisible(APPOINTMENT_FIELD_CODES.LICENSE_PLATE, true) |
| | | || isFieldVisible(APPOINTMENT_FIELD_CODES.DRIVER, true), |
| | | ) |
| | | const showCustomReasonInput = computed(() => Boolean(selectedVisitReason.value)) |
| | | const showReasonPicker = ref(false) |
| | | const appointmentIcons = { |
| | |
| | | return defaultValue |
| | | } |
| | | return config.requiredFlag === 1 |
| | | } |
| | | |
| | | function isFieldVisible(fieldCode: string, defaultValue = true) { |
| | | const config = findFieldConfig(fieldCode) |
| | | if (!config) { |
| | | return defaultValue |
| | | } |
| | | return config.visible === 1 |
| | | } |
| | | |
| | | function handlePlateCharClick(vehicleIndex: number, charIndex: number) { |
| | |
| | | if (lastFilledIndex < 7) { |
| | | focusNextPlateChar(vehicleIndex, lastFilledIndex + 1) |
| | | } |
| | | } |
| | | |
| | | function handleIntervieweeInput(e: any) { |
| | | formData.interviewee = e?.detail?.value || '' |
| | | } |
| | | |
| | | function handlePlateDelete(vehicleIndex: number, charIndex: number) { |
| | |
| | | async function loadFieldConfigs() { |
| | | try { |
| | | fieldConfigs.value = await fetchMiniFieldConfigs() |
| | | if (!showVehicleEntryOption.value) { |
| | | handleVehicleEntryChange(false) |
| | | } |
| | | } |
| | | catch (error) { |
| | | fieldConfigs.value = [] |
| | |
| | | }, |
| | | ) |
| | | |
| | | watch( |
| | | showVehicleEntryOption, |
| | | (visible) => { |
| | | if (!visible) { |
| | | handleVehicleEntryChange(false) |
| | | } |
| | | }, |
| | | ) |
| | | |
| | | onLoad((options) => { |
| | | uni.$on('selectVisitors', handleVisitorSelection) |
| | | rebookOrderId.value = options?.rebookOrderId ? Number(options.rebookOrderId) : null |
| | |
| | | class="mb-[48rpx] rounded-[16rpx] bg-white pl-[32rpx] pr-[12rpx] py-[8rpx] shadow-[0px_4px_8px_0px_rgba(6,47,108,0.1608)]"> |
| | | <wd-form :model="formData"> |
| | | <!-- 被访人 --> |
| | | <wd-input v-model="formData.interviewee" placeholder="请输入要拜访谁" align="right" custom-class="custom-cell" |
| | | placeholder-class="custom-placeholder"> |
| | | <template #label> |
| | | <view class="inline-flex items-start"> |
| | | <text class="text-[28rpx] text-[#333333]">被访人</text> |
| | | <text v-if="isRespondentRequired" class="text-[24rpx] text-[#FF4D4F] ml-[4rpx] mt-[-4rpx]">*</text> |
| | | </view> |
| | | </template> |
| | | </wd-input> |
| | | <view class="custom-cell flex items-center justify-between"> |
| | | <view class="inline-flex items-start shrink-0"> |
| | | <text class="text-[28rpx] text-[#333333]">被访人</text> |
| | | <text v-if="isRespondentRequired" class="text-[24rpx] text-[#FF4D4F] ml-[4rpx] mt-[-4rpx]">*</text> |
| | | </view> |
| | | <input |
| | | :value="formData.interviewee" |
| | | type="text" |
| | | placeholder="请输入要拜访谁" |
| | | placeholder-class="text-[#B3B3B3]" |
| | | class="ml-[32rpx] h-[64rpx] flex-1 text-right text-[28rpx] text-[#333333]" |
| | | confirm-type="search" |
| | | :adjust-position="true" |
| | | :cursor-spacing="120" |
| | | @input="handleIntervieweeInput" |
| | | @confirm="handleSearchVisitedUser" |
| | | /> |
| | | </view> |
| | | <view v-if="selectedVisitedUser" class="px-[20rpx] pb-[16rpx] text-right text-[22rpx] text-[#999999]"> |
| | | 已选:{{ selectedVisitedUser.realName }}{{ selectedVisitedUser.deptName ? ` / ${selectedVisitedUser.deptName}` : '' }} |
| | | </view> |
| | |
| | | </view> |
| | | <text class="ml-[12rpx] text-[28rpx] text-[#999999]">人员进场</text> |
| | | </view> |
| | | <view class="flex items-center" @click="handleVehicleEntryChange(!formData.vehicleEntry)"> |
| | | <view v-if="showVehicleEntryOption" class="flex items-center" @click="handleVehicleEntryChange(!formData.vehicleEntry)"> |
| | | <view |
| | | class="flex items-center justify-center w-[28rpx] h-[28rpx] rounded-full border-[2rpx] border-solid transition-colors duration-200" |
| | | :class="formData.vehicleEntry ? 'border-[#1677FF]' : 'border-[#CFCFCF]'"> |
| | | <view v-if="formData.vehicleEntry" class="w-[16rpx] h-[16rpx] rounded-full bg-[#1677FF]"> |
| | | </view> |
| | | </view> |
| | | <text class="ml-[12rpx] text-[28rpx]" :class="formData.vehicleEntry ? 'text-[#333333]' : 'text-[#999999]'">车辆进场</text> |
| | | <text class="ml-[12rpx] text-[28rpx]" :class="formData.vehicleEntry ? 'text-[#333333]' : 'text-[#999999]'">接送货</text> |
| | | </view> |
| | | </view> |
| | | </view> |