From 700f9d0da314a4ea701fe9f68d305b67d72ec5fb Mon Sep 17 00:00:00 2001
From: longz <longzhaoz@qq.com>
Date: 星期三, 08 七月 2026 15:08:37 +0800
Subject: [PATCH] 各类修复fix

---
 yuyueMiniProgram/src/pages/appointment/index.vue |   59 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/yuyueMiniProgram/src/pages/appointment/index.vue b/yuyueMiniProgram/src/pages/appointment/index.vue
index a89331a..d58af96 100644
--- a/yuyueMiniProgram/src/pages/appointment/index.vue
+++ b/yuyueMiniProgram/src/pages/appointment/index.vue
@@ -40,6 +40,8 @@
   RESPONDENT: 'respondent',
   VISIT_REASON: 'visit_reason',
   VISIT_START_TIME: 'visit_start_time',
+  LICENSE_PLATE: 'license_plate',
+  DRIVER: 'driver',
 } as const
 
 interface AppointmentVehicle {
@@ -93,6 +95,10 @@
 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 = {
@@ -124,6 +130,14 @@
     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) {
@@ -190,6 +204,10 @@
   if (lastFilledIndex < 7) {
     focusNextPlateChar(vehicleIndex, lastFilledIndex + 1)
   }
+}
+
+function handleIntervieweeInput(e: any) {
+  formData.interviewee = e?.detail?.value || ''
 }
 
 function handlePlateDelete(vehicleIndex: number, charIndex: number) {
@@ -954,6 +972,9 @@
 async function loadFieldConfigs() {
   try {
     fieldConfigs.value = await fetchMiniFieldConfigs()
+    if (!showVehicleEntryOption.value) {
+      handleVehicleEntryChange(false)
+    }
   }
   catch (error) {
     fieldConfigs.value = []
@@ -1307,6 +1328,15 @@
   },
 )
 
+watch(
+  showVehicleEntryOption,
+  (visible) => {
+    if (!visible) {
+      handleVehicleEntryChange(false)
+    }
+  },
+)
+
 onLoad((options) => {
   uni.$on('selectVisitors', handleVisitorSelection)
   rebookOrderId.value = options?.rebookOrderId ? Number(options.rebookOrderId) : null
@@ -1368,15 +1398,24 @@
         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>
@@ -1517,7 +1556,7 @@
                 </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]'">

--
Gitblit v1.7.1