| | |
| | | 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')) |
| | |
| | | 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() |
| | |
| | | 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 }>) { |
| | |
| | | <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 |