This commit is contained in:
@@ -259,8 +259,8 @@
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
align-items: center;
|
||||
padding-bottom: 16px;
|
||||
|
||||
.detail-title {
|
||||
@@ -274,10 +274,10 @@
|
||||
.loading-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60px 20px;
|
||||
gap: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
|
||||
.el-icon {
|
||||
|
||||
@@ -61,11 +61,11 @@
|
||||
<ElDialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogType === 'add' ? '新增套餐' : '编辑套餐'"
|
||||
width="60%"
|
||||
width="45%"
|
||||
:close-on-click-modal="false"
|
||||
@closed="handleDialogClosed"
|
||||
>
|
||||
<ElForm ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<ElForm ref="formRef" :model="form" :rules="rules" label-width="150px">
|
||||
<ElRow :gutter="20">
|
||||
<ElCol :span="24">
|
||||
<ElFormItem label="套餐编码" prop="package_code">
|
||||
@@ -109,7 +109,7 @@
|
||||
:value="series.id"
|
||||
/>
|
||||
<template #empty>
|
||||
<div style="padding: 10px; text-align: center; color: #909399">
|
||||
<div style="padding: 10px; color: #909399; text-align: center">
|
||||
暂无套餐系列,请先创建套餐系列
|
||||
</div>
|
||||
</template>
|
||||
@@ -182,17 +182,17 @@
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
|
||||
<!-- 流量重置天数(calendar_type为by_day时显示) -->
|
||||
<ElRow :gutter="20" v-if="form.calendar_type === 'by_day'">
|
||||
<!-- 套餐天数(流量重置周期为每日,或calendar_type为by_day时显示) -->
|
||||
<ElRow :gutter="20" v-if="form.data_reset_cycle === 'daily' || form.calendar_type === 'by_day'">
|
||||
<ElCol :span="12">
|
||||
<ElFormItem label="流量重置天数" prop="duration_days">
|
||||
<ElFormItem label="套餐天数" prop="duration_days">
|
||||
<ElInputNumber
|
||||
v-model="form.duration_days"
|
||||
:min="1"
|
||||
:max="3650"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
placeholder="请输入流量重置天数"
|
||||
placeholder="请输入套餐天数"
|
||||
/>
|
||||
</ElFormItem>
|
||||
</ElCol>
|
||||
@@ -341,7 +341,11 @@
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<ElButton @click="retailPriceDialogVisible = false">取消</ElButton>
|
||||
<ElButton type="primary" @click="handleConfirmUpdateRetailPrice" :loading="retailPriceLoading">
|
||||
<ElButton
|
||||
type="primary"
|
||||
@click="handleConfirmUpdateRetailPrice"
|
||||
:loading="retailPriceLoading"
|
||||
>
|
||||
确认修改
|
||||
</ElButton>
|
||||
</div>
|
||||
@@ -547,13 +551,25 @@
|
||||
cost_price: [{ required: true, message: '请输入成本价', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
// 如果启用虚流量,则虚流量额度为必填
|
||||
// 如果启用虚流量,则虚流量额度为必填,并且不能超过真流量额度
|
||||
if (form.enable_virtual_data) {
|
||||
baseRules.virtual_data_mb = [{ required: true, message: '请输入虚流量额度', trigger: 'blur' }]
|
||||
baseRules.virtual_data_mb = [
|
||||
{ required: true, message: '请输入虚流量额度', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value && form.real_data_mb && value > form.real_data_mb) {
|
||||
callback(new Error('虚流量额度不能超过真流量额度'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// 如果套餐周期类型是按天,则套餐天数为必填
|
||||
if (form.calendar_type === 'by_day') {
|
||||
// 如果流量重置周期是每日,或套餐周期类型是按天,则套餐天数为必填
|
||||
if (form.data_reset_cycle === 'daily' || form.calendar_type === 'by_day') {
|
||||
baseRules.duration_days = [
|
||||
{ required: true, message: '请输入套餐天数', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, max: 3650, message: '套餐天数范围 1-3650 天', trigger: 'blur' }
|
||||
@@ -755,22 +771,36 @@
|
||||
}
|
||||
)
|
||||
|
||||
// 监听流量重置周期变化,不是每月时清空套餐周期类型
|
||||
// 监听真流量额度变化,如果虚流量超过真流量则触发验证
|
||||
watch(
|
||||
() => form.real_data_mb,
|
||||
() => {
|
||||
if (form.enable_virtual_data && formRef.value) {
|
||||
formRef.value.validateField('virtual_data_mb')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// 监听流量重置周期变化
|
||||
watch(
|
||||
() => form.data_reset_cycle,
|
||||
(cycle) => {
|
||||
// 不是每月时清空套餐周期类型
|
||||
if (cycle !== 'monthly') {
|
||||
form.calendar_type = undefined
|
||||
}
|
||||
// 不是每日且calendar_type不是按天时,清空套餐天数
|
||||
if (cycle !== 'daily' && form.calendar_type !== 'by_day') {
|
||||
form.duration_days = undefined
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// 监听套餐周期类型变化,不是按天时清空套餐天数
|
||||
// 监听套餐周期类型变化,不是按天且流量重置周期不是每日时清空套餐天数
|
||||
watch(
|
||||
() => form.calendar_type,
|
||||
(type) => {
|
||||
if (type !== 'by_day') {
|
||||
if (type !== 'by_day' && form.data_reset_cycle !== 'daily') {
|
||||
form.duration_days = undefined
|
||||
}
|
||||
}
|
||||
@@ -1036,7 +1066,8 @@
|
||||
if (form.data_reset_cycle === 'monthly' && form.calendar_type) {
|
||||
data.calendar_type = form.calendar_type
|
||||
}
|
||||
if (form.calendar_type === 'by_day' && form.duration_days) {
|
||||
// 当流量重置周期为每日,或套餐周期类型为按天时,传递套餐天数
|
||||
if ((form.data_reset_cycle === 'daily' || form.calendar_type === 'by_day') && form.duration_days) {
|
||||
data.duration_days = form.duration_days
|
||||
}
|
||||
if (suggestedRetailPriceInCents !== undefined) {
|
||||
|
||||
@@ -244,8 +244,8 @@
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
align-items: center;
|
||||
padding-bottom: 16px;
|
||||
|
||||
.detail-title {
|
||||
@@ -259,10 +259,10 @@
|
||||
.loading-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60px 20px;
|
||||
gap: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
|
||||
.el-icon {
|
||||
|
||||
@@ -597,8 +597,8 @@
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
align-items: center;
|
||||
padding-bottom: 16px;
|
||||
margin-bottom: 20px;
|
||||
border-bottom: 1px solid var(--el-border-color);
|
||||
@@ -619,8 +619,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 8px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--el-text-color-primary);
|
||||
@@ -642,10 +642,10 @@
|
||||
.loading-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 60px 20px;
|
||||
gap: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
|
||||
.el-icon {
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
<ElDialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogType === 'add' ? '新增代理系列授权' : '编辑代理系列授权'"
|
||||
width="60%"
|
||||
width="45%"
|
||||
:close-on-click-modal="false"
|
||||
@closed="handleDialogClosed"
|
||||
>
|
||||
@@ -2184,8 +2184,8 @@
|
||||
}
|
||||
|
||||
.form-section-title {
|
||||
margin: 20px 0 16px;
|
||||
padding-bottom: 8px;
|
||||
margin: 20px 0 16px;
|
||||
border-bottom: 1px solid var(--el-border-color);
|
||||
|
||||
.title-text {
|
||||
@@ -2197,8 +2197,8 @@
|
||||
|
||||
.commission-type-display {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
|
||||
.type-hint {
|
||||
font-size: 13px;
|
||||
@@ -2252,8 +2252,8 @@
|
||||
|
||||
.cost-price-input-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
|
||||
.min-cost-hint {
|
||||
font-size: 12px;
|
||||
@@ -2282,8 +2282,8 @@
|
||||
.info-label {
|
||||
margin-right: 8px;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
color: var(--el-text-color-regular);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
@@ -2294,8 +2294,8 @@
|
||||
|
||||
.readonly-value {
|
||||
font-size: 14px;
|
||||
color: var(--el-text-color-primary);
|
||||
font-weight: 500;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.package-list-dialog-content {
|
||||
|
||||
Reference in New Issue
Block a user