shinnosuke
2026-08-19 c920c574d9587ef798d0c7f82d574e3e30bfde3a
talent-card-admin/src/views/MerchantCreateView.vue
@@ -91,7 +91,6 @@
const isSpouseEmploymentMerchant = computed(() => normalizedMerchantType.value === '配偶推荐就业')
const isApprovalMerchant = computed(() => normalizedMerchantType.value === '行政审批')
const isServiceMerchant = computed(() => isFoodMerchant.value || normalizedMerchantType.value === '景区服务')
const requiresFoodMerchantSettings = computed(() => !isEditMode.value && isFoodMerchant.value)
const supportsStoreConsumption = computed(() => [
  '酒店服务', '景区服务', '餐饮服务', '口腔治疗保健', '免费体检',
].includes(normalizedMerchantType.value) || (isCarWashMerchant.value && form.miniProgramJumpType === 'normal'))
@@ -250,12 +249,6 @@
  contactMobile: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
  address: isApartmentMerchant.value ? [] : [{ required: true, message: '请输入商家地址', trigger: 'blur' }],
  coverUrl: [{ required: true, message: '请上传商家封面图', trigger: 'change' }],
  businessHours: [{
    validator: (_rule, _value, callback) => isApprovalMerchant.value || hasValidBusinessHours()
      ? callback()
      : callback(new Error('请选择有效的营业时间')),
    trigger: 'change',
  }],
  sortNo: [{
    validator: (_rule, value, callback) => {
      const text = String(value ?? '').trim()
@@ -1158,15 +1151,10 @@
  businessHours.splice(index, 1)
}
function hasValidBusinessHours() {
  return businessHours.length > 0 && businessHours.every((item) => {
    const [startTime, endTime] = item.value
    return Boolean(startTime && endTime && startTime !== endTime)
  })
}
function businessHoursPayload() {
  return businessHours.map((item) => ({ startTime: item.value[0], endTime: item.value[1] }))
  return businessHours
    .map((item) => ({ startTime: item.value[0], endTime: item.value[1] }))
    .filter((item) => item.startTime && item.endTime && item.startTime !== item.endTime)
}
function resetBusinessHours(hours?: Array<{ startTime: string; endTime: string }>) {
@@ -2270,7 +2258,7 @@
              <el-input v-model="form.createdAt" readonly />
            </div>
            <el-form-item v-if="!isApprovalMerchant" class="merchant-hours-block" label="营业时间" prop="businessHours" required>
            <el-form-item v-if="!isApprovalMerchant" class="merchant-hours-block" label="营业时间" prop="businessHours">
              <div class="merchant-hours-list">
                <div v-for="(item, index) in businessHours" :key="item.id" class="merchant-hour-row">
                  <el-time-picker