| | |
| | | } |
| | | |
| | | const model = ref({ ...initialModel }) |
| | | const validationErrors = reactive<Record<string, string>>({}) |
| | | |
| | | function clearValidationErrors() { |
| | | Object.keys(validationErrors).forEach((key) => { |
| | | delete validationErrors[key] |
| | | }) |
| | | } |
| | | |
| | | function setValidationError(paths: string | string[], message: string) { |
| | | const normalizedPaths = Array.isArray(paths) ? paths : [paths] |
| | | normalizedPaths.forEach((path) => { |
| | | validationErrors[path] = message |
| | | }) |
| | | } |
| | | |
| | | function getValidationMessage(paths: string | string[]) { |
| | | const normalizedPaths = Array.isArray(paths) ? paths : [paths] |
| | | for (const path of normalizedPaths) { |
| | | if (validationErrors[path]) |
| | | return validationErrors[path] |
| | | } |
| | | return '' |
| | | } |
| | | |
| | | function getFormItemValidationProps(paths: string | string[]) { |
| | | const message = getValidationMessage(paths) |
| | | if (!message) { |
| | | return { |
| | | validationStatus: undefined, |
| | | feedback: undefined, |
| | | } |
| | | } |
| | | return { |
| | | validationStatus: 'error' as const, |
| | | feedback: message, |
| | | } |
| | | } |
| | | |
| | | function getFieldStatus(paths: string | string[]) { |
| | | return getValidationMessage(paths) ? 'error' : undefined |
| | | } |
| | | |
| | | function getWeatherRuleFieldPath(rule: any) { |
| | | const index = (model.value.dynamicPricingJson.weatherRules || []).findIndex( |
| | | (item: any) => normalizeWeatherType(item?.weatherType) === normalizeWeatherType(rule?.weatherType), |
| | | ) |
| | | return index === -1 ? '' : `dynamicPricingJson.weatherRules.${index}.ratio` |
| | | } |
| | | |
| | | function buildFixedWeatherRules(rawRules: any[] = []) { |
| | | const ratioMap = new Map<string, any>() |
| | |
| | | const sectionConfigList = Object.values(SPECIAL_PRICE_SECTION_CONFIG) |
| | | const hasEnabledSection = sectionConfigList.some(section => Number(pricingConfig[section.enabledKey]) === 1) |
| | | if (!hasEnabledSection) { |
| | | setValidationError('basicPricingJson1.isSpecialPrice', '请至少开启一个特殊价格费项') |
| | | window.$message.error('请至少开启一个特殊价格费项') |
| | | return false |
| | | } |
| | |
| | | for (const section of sectionConfigList) { |
| | | if (Number(pricingConfig[section.enabledKey]) !== 1) |
| | | continue |
| | | const hasMissingRequiredValue = section.requiredKeys.some(key => !hasDisplayValue(pricingConfig[key])) |
| | | if (hasMissingRequiredValue) { |
| | | const missingKeys = section.requiredKeys.filter(key => !hasDisplayValue(pricingConfig[key])) |
| | | if (missingKeys.length) { |
| | | setValidationError(missingKeys.map(key => `basicPricingJson1.${key}`), `请配置${section.label}`) |
| | | window.$message.error(`请配置${section.label}`) |
| | | return false |
| | | } |
| | |
| | | const sectionConfigList = Object.values(DYNAMIC_PRICING_SECTION_CONFIG) |
| | | const hasEnabledSection = sectionConfigList.some(section => Number(dynamicConfig[section.enabledKey]) === 1) |
| | | if (!hasEnabledSection) { |
| | | setValidationError('isDynamicPrice', '请至少开启一个动态定价规则') |
| | | window.$message.error('请至少开启一个动态定价规则') |
| | | return false |
| | | } |
| | |
| | | continue |
| | | |
| | | if (section.enabledKey === 'weatherEnabled') { |
| | | const hasWeatherRuleValue = (dynamicConfig.weatherRules || []).some((rule: any) => hasDisplayValue(rule?.ratio)) |
| | | const weatherRules = dynamicConfig.weatherRules || [] |
| | | const hasWeatherRuleValue = weatherRules.some((rule: any) => hasDisplayValue(rule?.ratio)) |
| | | if (!hasWeatherRuleValue) { |
| | | const emptyWeatherRulePaths = weatherRules |
| | | .map((rule: any, index: number) => hasDisplayValue(rule?.ratio) ? '' : `dynamicPricingJson.weatherRules.${index}.ratio`) |
| | | .filter(Boolean) |
| | | setValidationError(['dynamicPricingJson.weatherRules', ...emptyWeatherRulePaths], '请至少配置一条天气调价规则') |
| | | window.$message.error('请至少配置一条天气调价规则') |
| | | return false |
| | | } |
| | | continue |
| | | } |
| | | |
| | | const hasMissingRequiredValue = section.requiredKeys.some(key => !hasDisplayValue(dynamicConfig[key])) |
| | | if (hasMissingRequiredValue) { |
| | | const missingKeys = section.requiredKeys.filter(key => !hasDisplayValue(dynamicConfig[key])) |
| | | if (missingKeys.length) { |
| | | setValidationError(missingKeys.map(key => `dynamicPricingJson.${key}`), `请配置${section.label}`) |
| | | window.$message.error(`请配置${section.label}`) |
| | | return false |
| | | } |
| | |
| | | return true |
| | | |
| | | if (!Array.isArray(model.value.startingFareJson) || model.value.startingFareJson.length === 0) { |
| | | setValidationError('startingFareJson', '请至少配置一个起步价时段') |
| | | window.$message.error('请配置起步价') |
| | | return false |
| | | } |
| | |
| | | const requiredKeys = ['num1', 'num2', 'num3', 'num4', 'num5', 'num6'] |
| | | for (let index = 0; index < model.value.startingFareJson.length; index++) { |
| | | const item = model.value.startingFareJson[index] |
| | | const hasMissingRequiredValue = requiredKeys.some(key => !hasDisplayValue(item?.[key])) |
| | | if (hasMissingRequiredValue) { |
| | | const missingKeys = requiredKeys.filter(key => !hasDisplayValue(item?.[key])) |
| | | if (missingKeys.length) { |
| | | setValidationError(missingKeys.map(key => `startingFareJson.${index}.${key}`), `请配置第${index + 1}个时段的基础定价`) |
| | | window.$message.error(`请配置第${index + 1}个时段的基础定价`) |
| | | return false |
| | | } |
| | |
| | | <n-input |
| | | value={row.item1.ratio} |
| | | placeholder="请输入" |
| | | status={getFieldStatus(getWeatherRuleFieldPath(row.item1))} |
| | | input-props={{ inputmode: 'numeric' }} |
| | | onUpdateValue={(val: any) => { |
| | | row.item1.ratio = normalizeMoneyInput(val, { max: 100, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | <n-input |
| | | value={row.item2.ratio} |
| | | placeholder="请输入" |
| | | status={getFieldStatus(getWeatherRuleFieldPath(row.item2))} |
| | | input-props={{ inputmode: 'numeric' }} |
| | | onUpdateValue={(val: any) => { |
| | | row.item2.ratio = normalizeMoneyInput(val, { max: 100, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | }) |
| | | |
| | | async function handleSubmit() { |
| | | clearValidationErrors() |
| | | if (!validateTimeRanges()) { |
| | | return |
| | | } |
| | | await formRef.value?.validate() |
| | | try { |
| | | await formRef.value?.validate() |
| | | } |
| | | catch { |
| | | return |
| | | } |
| | | if (type.value === 'add') { |
| | | if (category.value === '2' && hasNullValue(model.value.basicPricingJson2, ['num5'])) { |
| | | window.$message.error('请配置基础定价') |
| | | return |
| | | if (category.value === '2') { |
| | | const requiredBasePricingKeys = ['num1', 'num2', 'num3', 'num4'] |
| | | const missingBasePricingPaths = requiredBasePricingKeys |
| | | .filter(key => !hasDisplayValue(model.value.basicPricingJson2[key])) |
| | | .map(key => `basicPricingJson2.${key}`) |
| | | if (missingBasePricingPaths.length > 0) { |
| | | setValidationError(missingBasePricingPaths, '请配置基础定价') |
| | | window.$message.error('请配置基础定价') |
| | | return |
| | | } |
| | | } |
| | | if (category.value === '1') { |
| | | if (!validateSpecialPriceSections()) { |
| | |
| | | const endMinutes = endHour * 60 + endMinute |
| | | |
| | | if (startMinutes >= endMinutes) { |
| | | const itemIndex = model.value.startingFareJson.findIndex((currentItem: any) => currentItem.id === item.id) |
| | | if (itemIndex !== -1) { |
| | | setValidationError( |
| | | [`startingFareJson.${itemIndex}.num1`, `startingFareJson.${itemIndex}.num2`], |
| | | '结束时间必须大于开始时间', |
| | | ) |
| | | } |
| | | window.$message.error('起步价时段中,结束时间必须大于开始时间') |
| | | return false |
| | | } |
| | |
| | | |
| | | // 检查两个时间段是否重叠 |
| | | if (start1 < end2 && start2 < end1) { |
| | | setValidationError( |
| | | [ |
| | | `startingFareJson.${i}.num1`, |
| | | `startingFareJson.${i}.num2`, |
| | | `startingFareJson.${j}.num1`, |
| | | `startingFareJson.${j}.num2`, |
| | | ], |
| | | '起步价时段不能重叠', |
| | | ) |
| | | window.$message.error('起步价时段不能重叠') |
| | | return false |
| | | } |
| | |
| | | const endMinutes = endHour * 60 + endMinute |
| | | |
| | | if (startMinutes >= endMinutes) { |
| | | setValidationError(['basicPricingJson1.num14', 'basicPricingJson1.num141'], '结束时间必须大于开始时间') |
| | | window.$message.error('夜间行驶费用时段中,结束时间必须大于开始时间') |
| | | return false |
| | | } |
| | |
| | | const endMinutes = endHour * 60 + endMinute |
| | | |
| | | if (startMinutes >= endMinutes) { |
| | | setValidationError(['basicPricingJson1.num21', 'basicPricingJson1.num211'], '结束时间必须大于开始时间') |
| | | window.$message.error('高峰期费用时段中,结束时间必须大于开始时间') |
| | | return false |
| | | } |
| | |
| | | const endMinutes = endHour * 60 + endMinute |
| | | |
| | | if (startMinutes >= endMinutes) { |
| | | setValidationError(['basicPricingJson1.num22', 'basicPricingJson1.num221'], '结束时间必须大于开始时间') |
| | | window.$message.error('高峰期费用时段中,结束时间必须大于开始时间') |
| | | return false |
| | | } |
| | |
| | | |
| | | // 检查两个高峰期时段是否重叠 |
| | | if (start1 < end2 && start2 < end1) { |
| | | setValidationError( |
| | | ['basicPricingJson1.num21', 'basicPricingJson1.num211', 'basicPricingJson1.num22', 'basicPricingJson1.num221'], |
| | | '高峰期费用时段不能重叠', |
| | | ) |
| | | window.$message.error('高峰期费用时段不能重叠') |
| | | return false |
| | | } |
| | |
| | | return value !== null && value !== undefined && value !== '' |
| | | } |
| | | |
| | | function parseTimeToMinutes(time: string | null | undefined) { |
| | | if (!time) |
| | | return null |
| | | const [hour, minute] = time.split(':').map(Number) |
| | | if (Number.isNaN(hour) || Number.isNaN(minute)) |
| | | return null |
| | | return hour * 60 + minute |
| | | } |
| | | |
| | | function isStartingFareEndHourDisabled(hour: number, item: any) { |
| | | const startMinutes = parseTimeToMinutes(item?.num1) |
| | | if (startMinutes === null) |
| | | return false |
| | | return hour < Math.floor(startMinutes / 60) |
| | | } |
| | | |
| | | function isStartingFareEndMinuteDisabled(minute: number, hour: number, item: any) { |
| | | const startMinutes = parseTimeToMinutes(item?.num1) |
| | | if (startMinutes === null) |
| | | return false |
| | | |
| | | const startHour = Math.floor(startMinutes / 60) |
| | | const startMinute = startMinutes % 60 |
| | | if (hour < startHour) |
| | | return true |
| | | if (hour === startHour) |
| | | return minute <= startMinute |
| | | return false |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getPricingDetailData(id.value as string) |
| | | }) |
| | | |
| | | function closeTimePicker() { |
| | | if (document.activeElement) { |
| | | (document.activeElement as HTMLElement).blur() |
| | | } |
| | | } |
| | | |
| | | const onlyAllowInteger = (value: string) => !value || /^\d+$/.test(value) |
| | | const onlyAllowDecimal = (value: string) => !value || /^\d*(?:\.\d{0,2})?$/.test(value) |
| | |
| | | </div> |
| | | <div v-if="type === 'add'"> |
| | | <n-form |
| | | ref="formRef" :model="model" label-placement="left" inline :show-feedback="false" |
| | | ref="formRef" :model="model" label-placement="left" inline |
| | | require-mark-placement="left" class="w-full" |
| | | > |
| | | <n-spin :show="loading" class="w-full"> |
| | |
| | | <div class="line" /> |
| | | <!-- 一口价 --> |
| | | <!-- 基础定价 --> |
| | | <NSpace v-if="category === '2'" vertical :size="16"> |
| | | <NSpace v-if="category === '2'" vertical :size="8"> |
| | | <div class="head mb-0!"> |
| | | 基础定价 |
| | | </div> |
| | | <div> |
| | | <n-form-item label="起步价设置:" path="num1" required> |
| | | <n-form-item |
| | | class="pricing-form-item-label-center" |
| | | label="起步价设置:" |
| | | path="num1" |
| | | required |
| | | v-bind="getFormItemValidationProps(['basicPricingJson2.num1', 'basicPricingJson2.num2', 'basicPricingJson2.num3'])" |
| | | > |
| | | 起步价为 |
| | | <n-input |
| | | :value="model.basicPricingJson2.num1" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('basicPricingJson2.num1')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson2.num1 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 元,起步价包含 |
| | | <n-input |
| | | :value="model.basicPricingJson2.num2" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('basicPricingJson2.num2')" |
| | | :input-props="{ inputmode: 'numeric' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson2.num2 = normalizeMoneyInput(val, { max: 999, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | 公里, |
| | | <n-input |
| | | :value="model.basicPricingJson2.num3" placeholder="最多3位数" class="mr-2 w-115px!" |
| | | :status="getFieldStatus('basicPricingJson2.num3')" |
| | | :input-props="{ inputmode: 'numeric' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson2.num3 = normalizeMoneyInput(val, { max: 999, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | </n-form-item> |
| | | </div> |
| | | <div> |
| | | <n-form-item label="里程费设置:" path="num4" required> |
| | | <n-form-item |
| | | label="里程费设置:" |
| | | path="num4" |
| | | required |
| | | v-bind="getFormItemValidationProps('basicPricingJson2.num4')" |
| | | > |
| | | 超过起步里程后每公里 |
| | | <n-input |
| | | :value="model.basicPricingJson2.num4" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('basicPricingJson2.num4')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson2.num4 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | <div class="head"> |
| | | 基础定价 |
| | | </div> |
| | | <div v-for="(item, index) in model.startingFareJson" :key="index" class="mb-16px"> |
| | | <NSpace vertical :size="16" :style="Number(index) > 0 ? { marginTop: '24px' } : ''"> |
| | | <n-form-item label="时段:" path="item.num1" required> |
| | | <div v-for="(item, index) in model.startingFareJson" :key="index" class="mb-8px"> |
| | | <NSpace vertical :size="8" :style="Number(index) > 0 ? { marginTop: '24px' } : ''"> |
| | | <n-form-item |
| | | label="时段:" |
| | | path="item.num1" |
| | | required |
| | | v-bind="getFormItemValidationProps([`startingFareJson.${index}.num1`, `startingFareJson.${index}.num2`])" |
| | | > |
| | | <n-time-picker |
| | | v-model:formatted-value="item.num1" format="HH:mm" value-format="HH:mm" clearable |
| | | class="mr-2 w-115px!" placeholder="开始时间" |
| | | :status="getFieldStatus(`startingFareJson.${index}.num1`)" |
| | | class="mr-2 w-115px!" placeholder="开始时间" :actions="['now']" @update:value="closeTimePicker" |
| | | />至 |
| | | <n-time-picker |
| | | v-model:formatted-value="item.num2" format="HH:mm" value-format="HH:mm" clearable |
| | | class="mx-2 w-115px!" placeholder="结束时间" |
| | | :status="getFieldStatus(`startingFareJson.${index}.num2`)" |
| | | :is-hour-disabled="(hour: number) => isStartingFareEndHourDisabled(hour, item)" |
| | | :is-minute-disabled="(minute: number, hour: number) => isStartingFareEndMinuteDisabled(minute, hour, item)" |
| | | class="mx-2 w-115px!" placeholder="结束时间" :actions="['now']" @update:value="closeTimePicker" |
| | | /> |
| | | <icon-park-outline-delete class="cursor-pointer" @click="removeTimePeriod(item)" /> |
| | | </n-form-item> |
| | | <div> |
| | | <n-form-item label="起步价设置:" path="item.num3" required> |
| | | <n-form-item |
| | | label="起步价设置:" |
| | | path="item.num3" |
| | | required |
| | | v-bind="getFormItemValidationProps([`startingFareJson.${index}.num3`, `startingFareJson.${index}.num4`, `startingFareJson.${index}.num5`])" |
| | | > |
| | | 起步价为 |
| | | <n-input |
| | | :value="item.num3" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus(`startingFareJson.${index}.num3`)" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | item.num3 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 元,起步价包含 |
| | | <n-input |
| | | :value="item.num4" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus(`startingFareJson.${index}.num4`)" |
| | | :input-props="{ inputmode: 'numeric' }" |
| | | @update:value="(val:any) => { |
| | | item.num4 = normalizeMoneyInput(val, { max: 999, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | 公里, |
| | | <n-input |
| | | :value="item.num5" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus(`startingFareJson.${index}.num5`)" |
| | | :input-props="{ inputmode: 'numeric' }" |
| | | @update:value="(val:any) => { |
| | | item.num5 = normalizeMoneyInput(val, { max: 999, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | </n-form-item> |
| | | </div> |
| | | <div> |
| | | <n-form-item label="里程费设置:" path="item.num6" required> |
| | | <n-form-item |
| | | label="里程费设置:" |
| | | path="item.num6" |
| | | required |
| | | v-bind="getFormItemValidationProps(`startingFareJson.${index}.num6`)" |
| | | > |
| | | 超过起步里程后每公里 |
| | | <n-input |
| | | :value="item.num6" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus(`startingFareJson.${index}.num6`)" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | item.num6 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | </template> |
| | | 添加时段 |
| | | </NButton> |
| | | <div |
| | | v-if="getValidationMessage('startingFareJson')" |
| | | style="margin-top: 8px; color: #d03050; font-size: 12px;" |
| | | > |
| | | {{ getValidationMessage('startingFareJson') }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-if="category === '1'" class="box"> |
| | | <div class="head"> |
| | | 特殊价格 |
| | | </div> |
| | | <div class="mb-24px"> |
| | | <n-form-item label="是否开启特殊价格" required label-style="font-weight: 600;"> |
| | | <n-radio-group v-model:value="model.basicPricingJson1.isSpecialPrice" name="isSpecialPrice" class="ml-2"> |
| | | <div class="mb-16px"> |
| | | <n-form-item |
| | | label="是否开启特殊价格" |
| | | required |
| | | label-style="font-weight: 600;" |
| | | v-bind="getFormItemValidationProps('basicPricingJson1.isSpecialPrice')" |
| | | > |
| | | <n-radio-group v-model:value="model.basicPricingJson1.isSpecialPrice" name="isSpecialPrice" class="ml-2 h-32px flex items-center"> |
| | | <NSpace> |
| | | <n-radio :value="1"> |
| | | 是 |
| | |
| | | </template> |
| | | </n-switch> |
| | | </div> |
| | | <n-form-item v-if="isSpecialPriceSectionEnabled('wait')" label="" path="basicPricingJson1.num4"> |
| | | <n-form-item |
| | | v-if="isSpecialPriceSectionEnabled('wait')" |
| | | label="" |
| | | path="basicPricingJson1.num4" |
| | | v-bind="getFormItemValidationProps(['basicPricingJson1.num4', 'basicPricingJson1.num5'])" |
| | | > |
| | | 司机到达预约地点 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num4" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num4')" |
| | | :input-props="{ inputmode: 'numeric' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num4 = normalizeMoneyInput(val, { max: 999, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | 分钟后开始收取等待费,为 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num5" placeholder="最多3位数" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num5')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num5 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | </template> |
| | | </n-switch> |
| | | </div> |
| | | <n-form-item v-if="isSpecialPriceSectionEnabled('longDistance')" label="" path="basicPricingJson1.num6"> |
| | | <n-form-item |
| | | v-if="isSpecialPriceSectionEnabled('longDistance')" |
| | | label="" |
| | | path="basicPricingJson1.num6" |
| | | v-bind="getFormItemValidationProps(['basicPricingJson1.num7', 'basicPricingJson1.num8', 'basicPricingJson1.num10', 'basicPricingJson1.num11', 'basicPricingJson1.num13'])" |
| | | > |
| | | <NSpace vertical :size="16"> |
| | | <NSpace align="center" :size="[8, 16]"> |
| | | 总里程超过起步包含公里数时,公里不足 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num7" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num7')" |
| | | :input-props="{ inputmode: 'numeric' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num7 = normalizeMoneyInput(val, { max: 999, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | 公里,超出部分每公里加收 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num8" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num8')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num8 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 不足 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num10" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num10')" |
| | | :input-props="{ inputmode: 'numeric' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num10 = normalizeMoneyInput(val, { max: 999, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | 公里时,超出部分每公里加收 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num11" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num11')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num11 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 公里以后,超出部分每公里加收 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num13" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num13')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num13 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | </n-form-item> |
| | | </div> |
| | | <div> |
| | | <div class="flex items-center mb-12px text-14px font-600 mt-32px"> |
| | | <div class="flex items-center mb-12px text-14px font-600 mt-24px"> |
| | | <img src="@/assets/pricingManagement/night.svg" class="w-16px h-16px mr-8px"> |
| | | 夜间行驶费用设置 |
| | | <n-switch |
| | |
| | | </template> |
| | | </n-switch> |
| | | </div> |
| | | <n-form-item v-if="isSpecialPriceSectionEnabled('night')" label="" path="basicPricingJson1.num14"> |
| | | <n-form-item |
| | | v-if="isSpecialPriceSectionEnabled('night')" |
| | | label="" |
| | | path="basicPricingJson1.num14" |
| | | v-bind="getFormItemValidationProps(['basicPricingJson1.num14', 'basicPricingJson1.num141', 'basicPricingJson1.num15', 'basicPricingJson1.num16', 'basicPricingJson1.num18', 'basicPricingJson1.num19', 'basicPricingJson1.num20'])" |
| | | > |
| | | <NSpace vertical :size="16"> |
| | | <NSpace align="center" :size="[8, 16]"> |
| | | <n-time-picker |
| | | v-model:formatted-value="model.basicPricingJson1.num14" format="HH:mm" |
| | | value-format="HH:mm" clearable class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num14')" |
| | | />至 |
| | | <n-time-picker |
| | | v-model:formatted-value="model.basicPricingJson1.num141" format="HH:mm" |
| | | value-format="HH:mm" clearable class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num141')" |
| | | /> |
| | | 点为夜间行车时间,起步价变为 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num15" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num15')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num15 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 里程费为每公里 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num16" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num16')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num16 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 远途费为每公里加收 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num18" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num18')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num18 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | /> |
| | | <n-input |
| | | :value="model.basicPricingJson1.num19" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num19')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num19 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | /> |
| | | <n-input |
| | | :value="model.basicPricingJson1.num20" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num20')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num20 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | </n-form-item> |
| | | </div> |
| | | <div> |
| | | <div class="flex items-center mb-12px text-14px font-600 mt-32px"> |
| | | <div class="flex items-center mb-12px text-14px font-600 mt-24px"> |
| | | <img src="@/assets/pricingManagement/peakhours.svg" class="w-16px h-16px mr-8px"> |
| | | 高峰期费用设置 |
| | | <n-switch |
| | |
| | | </template> |
| | | </n-switch> |
| | | </div> |
| | | <n-form-item v-if="isSpecialPriceSectionEnabled('peak')" label="" path="basicPricingJson1.num21"> |
| | | <n-form-item |
| | | v-if="isSpecialPriceSectionEnabled('peak')" |
| | | label="" |
| | | path="basicPricingJson1.num21" |
| | | v-bind="getFormItemValidationProps(['basicPricingJson1.num21', 'basicPricingJson1.num211', 'basicPricingJson1.num22', 'basicPricingJson1.num221', 'basicPricingJson1.num23', 'basicPricingJson1.num24', 'basicPricingJson1.num26', 'basicPricingJson1.num27', 'basicPricingJson1.num28'])" |
| | | > |
| | | <NSpace vertical :size="16"> |
| | | <NSpace align="center" :size="[8, 16]"> |
| | | <n-time-picker |
| | | v-model:formatted-value="model.basicPricingJson1.num21" format="HH:mm" |
| | | value-format="HH:mm" clearable class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num21')" |
| | | />至 |
| | | <n-time-picker |
| | | v-model:formatted-value="model.basicPricingJson1.num211" format="HH:mm" |
| | | value-format="HH:mm" clearable class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num211')" |
| | | /> |
| | | 和 |
| | | <n-time-picker |
| | | v-model:formatted-value="model.basicPricingJson1.num22" format="HH:mm" |
| | | value-format="HH:mm" clearable class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num22')" |
| | | />至 |
| | | <n-time-picker |
| | | v-model:formatted-value="model.basicPricingJson1.num221" format="HH:mm" |
| | | value-format="HH:mm" clearable class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num221')" |
| | | /> |
| | | 为高峰期行车时间,起步价变为 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num23" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num23')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num23 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 里程费为每公里 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num24" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num24')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num24 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 远途费为每公里加收 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num26" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num26')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num26 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | /> |
| | | <n-input |
| | | :value="model.basicPricingJson1.num27" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num27')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num27 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | /> |
| | | <n-input |
| | | :value="model.basicPricingJson1.num28" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num28')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num28 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | </n-form-item> |
| | | </div> |
| | | <div> |
| | | <div class="flex items-center mb-12px text-14px font-600 mt-32px"> |
| | | <div class="flex items-center mb-12px text-14px font-600 mt-24px"> |
| | | <img src="@/assets/pricingManagement/holidays.svg" class="w-16px h-16px mr-8px"> |
| | | 节假日额外收费 |
| | | <n-switch |
| | |
| | | </template> |
| | | </n-switch> |
| | | </div> |
| | | <n-form-item v-if="isSpecialPriceSectionEnabled('holiday')" label="" path="basicPricingJson1.num29"> |
| | | <n-form-item |
| | | v-if="isSpecialPriceSectionEnabled('holiday')" |
| | | label="" |
| | | path="basicPricingJson1.num29" |
| | | v-bind="getFormItemValidationProps(['basicPricingJson1.num29', 'basicPricingJson1.num30', 'basicPricingJson1.num32', 'basicPricingJson1.num33', 'basicPricingJson1.num34'])" |
| | | > |
| | | <NSpace vertical :size="16"> |
| | | <NSpace align="center" :size="[8, 16]"> |
| | | 节假日起步价变为 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num29" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num29')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num29 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 里程费为每公里 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num30" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num30')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num30 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | 远途费为每公里加收 |
| | | <n-input |
| | | :value="model.basicPricingJson1.num32" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num32')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num32 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | /> |
| | | <n-input |
| | | :value="model.basicPricingJson1.num33" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num33')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num33 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | /> |
| | | <n-input |
| | | :value="model.basicPricingJson1.num34" placeholder="最多3位数" class="w-115px!" |
| | | :status="getFieldStatus('basicPricingJson1.num34')" |
| | | :input-props="{ inputmode: 'decimal' }" |
| | | @update:value="(val:any) => { |
| | | model.basicPricingJson1.num34 = normalizeMoneyInput(val, { max: 999.99, maxIntegerDigits: 3, maxFractionDigits: 2 }) |
| | |
| | | <div class="head"> |
| | | 动态定价 |
| | | </div> |
| | | <div class="mb-32px"> |
| | | <n-form-item label="是否开启动态调价" path="isDynamicPrice" required label-style="font-weight: 600;"> |
| | | <n-radio-group v-model:value="model.isDynamicPrice" name="radiogroup" class="ml-2"> |
| | | <div class="mb-16px"> |
| | | <n-form-item |
| | | label="是否开启动态调价" |
| | | path="isDynamicPrice" |
| | | required |
| | | label-style="font-weight: 600;" |
| | | v-bind="getFormItemValidationProps('isDynamicPrice')" |
| | | > |
| | | <n-radio-group v-model:value="model.isDynamicPrice" name="radiogroup" class="ml-2 h-32px flex items-center"> |
| | | <NSpace> |
| | | <n-radio :value="1"> |
| | | 是 |
| | |
| | | </n-form-item> |
| | | </div> |
| | | <div v-if="model.isDynamicPrice === 1"> |
| | | <div class="mb-12px"> |
| | | <div class="mb-4px"> |
| | | <n-form-item required label-style="font-weight: 600;"> |
| | | <template #label> |
| | | 供需关系调价规则 |
| | |
| | | v-model:value="model.dynamicPricingJson.supplyDemandEnabled" |
| | | :checked-value="1" |
| | | :unchecked-value="0" |
| | | class="ml-8px font-400! text-13px!" |
| | | class="ml-8px font-400! text-13px! h-32px flex items-center" |
| | | > |
| | | <template #checked> |
| | | 启用 |
| | |
| | | </n-switch> |
| | | </n-form-item> |
| | | </div> |
| | | <div v-if="isDynamicPricingSectionEnabled('supplyDemand')" class="mb-16px flex"> |
| | | <n-form-item label="供需计算周期:" path="dynamicPricingJson.num1" label-style="color:rgba(23, 31, 38, 0.8)"> |
| | | <div v-if="isDynamicPricingSectionEnabled('supplyDemand')" class="mb-8px flex"> |
| | | <n-form-item |
| | | label="供需计算周期:" |
| | | path="dynamicPricingJson.num1" |
| | | label-style="color:rgba(23, 31, 38, 0.8)" |
| | | v-bind="getFormItemValidationProps('dynamicPricingJson.num1')" |
| | | > |
| | | <n-input |
| | | v-model:value="model.dynamicPricingJson.num1" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num1')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | />分钟 |
| | | </n-form-item> |
| | | <n-form-item label="订单需求阈值:" path="dynamicPricingJson.num2" label-style="color:rgba(23, 31, 38, 0.8)"> |
| | | <n-form-item |
| | | label="订单需求阈值:" |
| | | path="dynamicPricingJson.num2" |
| | | label-style="color:rgba(23, 31, 38, 0.8)" |
| | | v-bind="getFormItemValidationProps('dynamicPricingJson.num2')" |
| | | > |
| | | <n-input |
| | | v-model:value="model.dynamicPricingJson.num2" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num2')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | />单以上开始上浮 |
| | | </n-form-item> |
| | | <n-form-item label="车辆供给阈值:" path="dynamicPricingJson.num3" label-style="color:rgba(23, 31, 38, 0.8)"> |
| | | <n-form-item |
| | | label="车辆供给阈值:" |
| | | path="dynamicPricingJson.num3" |
| | | label-style="color:rgba(23, 31, 38, 0.8)" |
| | | v-bind="getFormItemValidationProps('dynamicPricingJson.num3')" |
| | | > |
| | | <n-input |
| | | v-model:value="model.dynamicPricingJson.num3" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num3')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | />辆以下开始触发上浮 |
| | | </n-form-item> |
| | | </div> |
| | | <div v-if="isDynamicPricingSectionEnabled('supplyDemand')" class="mb-16px flex"> |
| | | <n-form-item label="供需价格系数:" path="dynamicPricingJson.num4" label-style="color:rgba(23, 31, 38, 0.8)"> |
| | | <div v-if="isDynamicPricingSectionEnabled('supplyDemand')" class="mb-8px flex"> |
| | | <n-form-item |
| | | label="供需价格系数:" |
| | | path="dynamicPricingJson.num4" |
| | | label-style="color:rgba(23, 31, 38, 0.8)" |
| | | v-bind="getFormItemValidationProps(['dynamicPricingJson.num4', 'dynamicPricingJson.num5'])" |
| | | > |
| | | 每增加 |
| | | <n-input |
| | | v-model:value="model.dynamicPricingJson.num4" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num4')" |
| | | :allow-input="onlyAllowDecimal" placeholder="请输入" |
| | | /> |
| | | 单,价格上浮 |
| | | <n-input |
| | | :value="model.dynamicPricingJson.num5" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num5')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | @update:value="(val:any) => { |
| | | model.dynamicPricingJson.num5 = normalizeMoneyInput(val, { max: 100, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | />% |
| | | </n-form-item> |
| | | </div> |
| | | <div v-if="isDynamicPricingSectionEnabled('supplyDemand')" class="mb-32px flex"> |
| | | <n-form-item label="供需冷却时间:" path="dynamicPricingJson.num6" label-style="color:rgba(23, 31, 38, 0.8)"> |
| | | <div v-if="isDynamicPricingSectionEnabled('supplyDemand')" class="mb-24px flex"> |
| | | <n-form-item |
| | | label="供需冷却时间:" |
| | | path="dynamicPricingJson.num6" |
| | | label-style="color:rgba(23, 31, 38, 0.8)" |
| | | v-bind="getFormItemValidationProps('dynamicPricingJson.num6')" |
| | | > |
| | | 调价后 |
| | | <n-input |
| | | v-model:value="model.dynamicPricingJson.num6" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num6')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | /> |
| | | 分钟内不再重复调整 |
| | | </n-form-item> |
| | | </div> |
| | | <div class="mb-12px"> |
| | | <div class="mb-4px"> |
| | | <n-form-item required label-style="font-weight: 600;"> |
| | | <template #label> |
| | | 区域拥堵调价规则(根据实时路况自动调整价格) |
| | |
| | | v-model:value="model.dynamicPricingJson.congestionEnabled" |
| | | :checked-value="1" |
| | | :unchecked-value="0" |
| | | class="ml-8px font-400! text-13px!" |
| | | class="ml-8px font-400! text-13px! h-32px flex items-center" |
| | | > |
| | | <template #checked> |
| | | 启用 |
| | |
| | | </n-switch> |
| | | </n-form-item> |
| | | </div> |
| | | <div v-if="isDynamicPricingSectionEnabled('congestion')" class="mb-16px flex"> |
| | | <n-form-item label="拥堵判断阈值:" path="dynamicPricingJson.num7" label-style="color:rgba(23, 31, 38, 0.8)"> |
| | | <div v-if="isDynamicPricingSectionEnabled('congestion')" class="mb-8px flex"> |
| | | <n-form-item |
| | | label="拥堵判断阈值:" |
| | | path="dynamicPricingJson.num7" |
| | | label-style="color:rgba(23, 31, 38, 0.8)" |
| | | v-bind="getFormItemValidationProps(['dynamicPricingJson.num7', 'dynamicPricingJson.num8'])" |
| | | > |
| | | 道路速度 |
| | | < <n-input |
| | | v-model:value="model.dynamicPricingJson.num7" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num7')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | /> |
| | | km/h视为拥堵,拥堵价格上浮比例: |
| | | <n-input |
| | | :value="model.dynamicPricingJson.num8" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num8')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | @update:value="(val:any) => { |
| | | model.dynamicPricingJson.num8 = normalizeMoneyInput(val, { max: 100, maxIntegerDigits: 3, maxFractionDigits: 0 }) |
| | |
| | | />% |
| | | </n-form-item> |
| | | </div> |
| | | <div v-if="isDynamicPricingSectionEnabled('congestion')" class="mb-16px"> |
| | | <n-form-item label="拥堵影响半径:" path="dynamicPricingJson.num9" label-style="color:rgba(23, 31, 38, 0.8)"> |
| | | <div v-if="isDynamicPricingSectionEnabled('congestion')" class="mb-8px"> |
| | | <n-form-item |
| | | label="拥堵影响半径:" |
| | | path="dynamicPricingJson.num9" |
| | | label-style="color:rgba(23, 31, 38, 0.8)" |
| | | v-bind="getFormItemValidationProps('dynamicPricingJson.num9')" |
| | | > |
| | | 以订单起点为中心 |
| | | <n-input |
| | | v-model:value="model.dynamicPricingJson.num9" class="mx-2 w-115px!" |
| | | :status="getFieldStatus('dynamicPricingJson.num9')" |
| | | :allow-input="onlyAllowInteger" placeholder="请输入" |
| | | /> |
| | | m范围内 |
| | | </n-form-item> |
| | | </div> |
| | | <div class="mb-12px flex items-center justify-between"> |
| | | <div class="mb-4px flex items-center justify-between"> |
| | | <n-form-item required label-style="font-weight: 600;"> |
| | | <template #label> |
| | | 天气调价规则 |
| | |
| | | v-model:value="model.dynamicPricingJson.weatherEnabled" |
| | | :checked-value="1" |
| | | :unchecked-value="0" |
| | | class="ml-8px font-400! text-13px!" |
| | | class="ml-8px font-400! text-13px! h-32px flex items-center" |
| | | > |
| | | <template #checked> |
| | | 启用 |
| | |
| | | </n-form-item> |
| | | </div> |
| | | <div v-if="isDynamicPricingSectionEnabled('weather')"> |
| | | <n-data-table |
| | | :columns="weatherColumns" |
| | | :data="splitWeatherRules" |
| | | :bordered="false" |
| | | <n-form-item |
| | | label="" |
| | | path="dynamicPricingJson.weatherRules" |
| | | v-bind="getFormItemValidationProps('dynamicPricingJson.weatherRules')" |
| | | > |
| | | <template #empty> |
| | | <div class="flex-center"> |
| | | <img :src="noDataImg" style="width:123px;height:125px" @error="(e: any) => { e.target.src = 'https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/9bed493b-a6aa-4ef6-ac10-7f67f5c6adc5.png' }"> |
| | | </div> |
| | | </template> |
| | | </n-data-table> |
| | | <n-data-table |
| | | :columns="weatherColumns" |
| | | :data="splitWeatherRules" |
| | | :bordered="false" |
| | | > |
| | | <template #empty> |
| | | <div class="flex-center"> |
| | | <img :src="noDataImg" style="width:123px;height:125px" @error="(e: any) => { e.target.src = 'https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/9bed493b-a6aa-4ef6-ac10-7f67f5c6adc5.png' }"> |
| | | </div> |
| | | </template> |
| | | </n-data-table> |
| | | </n-form-item> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div v-else> |
| | | <n-form |
| | | ref="formRef" :model="model" label-placement="left" inline :show-feedback="false" |
| | | ref="formRef" :model="model" label-placement="left" inline |
| | | require-mark-placement="left" |
| | | > |
| | | <n-spin :show="loading" class="w-full"> |
| | |
| | | |
| | | <style scoped lang="scss"> |
| | | .content { |
| | | height: calc(100vh - 76px); |
| | | height: calc(100vh - 76px - 28px); |
| | | width: 100%; |
| | | overflow-y: auto; |
| | | scrollbar-width: none; |
| | |
| | | |
| | | :deep(.n-form-item-label) { |
| | | padding-right: 0; |
| | | min-height: auto; |
| | | height: 100%; |
| | | } |
| | | |
| | | :deep(.n-form-item-blank) { |
| | | color: rgba(23, 31, 38, 0.8); |
| | | min-height: auto; |
| | | height: 100%; |
| | | height: auto; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | :deep(.n-form-item-feedback-wrapper) { |
| | | width: 100%; |
| | | } |
| | | |
| | | :deep(.n-form.n-form--inline .n-form-item) { |