fetch(modify):修改原来的bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m53s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m53s
This commit is contained in:
@@ -48,7 +48,12 @@
|
||||
:close-on-click-modal="false"
|
||||
@closed="handleCostPriceDialogClosed"
|
||||
>
|
||||
<ElForm ref="costPriceFormRef" :model="costPriceForm" :rules="costPriceRules" label-width="120px">
|
||||
<ElForm
|
||||
ref="costPriceFormRef"
|
||||
:model="costPriceForm"
|
||||
:rules="costPriceRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<ElFormItem label="套餐名称">
|
||||
<ElInput v-model="costPriceForm.package_name" disabled />
|
||||
</ElFormItem>
|
||||
@@ -56,7 +61,12 @@
|
||||
<ElInput v-model="costPriceForm.shop_name" disabled />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="原成本价(分)">
|
||||
<ElInputNumber v-model="costPriceForm.old_cost_price" disabled :controls="false" style="width: 100%" />
|
||||
<ElInputNumber
|
||||
v-model="costPriceForm.old_cost_price"
|
||||
disabled
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="新成本价(分)" prop="cost_price">
|
||||
<ElInputNumber
|
||||
@@ -71,7 +81,11 @@
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<ElButton @click="costPriceDialogVisible = false">取消</ElButton>
|
||||
<ElButton type="primary" @click="handleCostPriceSubmit(costPriceFormRef)" :loading="costPriceSubmitLoading">
|
||||
<ElButton
|
||||
type="primary"
|
||||
@click="handleCostPriceSubmit(costPriceFormRef)"
|
||||
:loading="costPriceSubmitLoading"
|
||||
>
|
||||
提交
|
||||
</ElButton>
|
||||
</div>
|
||||
@@ -154,11 +168,7 @@
|
||||
import { ShopPackageAllocationService, PackageManageService, ShopService } from '@/api/modules'
|
||||
import { ElMessage, ElMessageBox, ElSwitch } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import type {
|
||||
ShopPackageAllocationResponse,
|
||||
PackageResponse,
|
||||
ShopResponse
|
||||
} from '@/types/api'
|
||||
import type { ShopPackageAllocationResponse, PackageResponse, ShopResponse } from '@/types/api'
|
||||
import type { SearchFormItem } from '@/types'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import ArtButtonTable from '@/components/core/forms/ArtButtonTable.vue'
|
||||
@@ -281,7 +291,9 @@
|
||||
if (value === undefined || value === null || value === '') {
|
||||
callback(new Error('请输入成本价'))
|
||||
} else if (form.package_base_price && value < form.package_base_price) {
|
||||
callback(new Error(`成本价不能低于套餐价格 ¥${(form.package_base_price / 100).toFixed(2)}`))
|
||||
callback(
|
||||
new Error(`成本价不能低于套餐价格 ¥${(form.package_base_price / 100).toFixed(2)}`)
|
||||
)
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
@@ -355,7 +367,8 @@
|
||||
prop: 'calculated_cost_price',
|
||||
label: '原计算成本价',
|
||||
width: 120,
|
||||
formatter: (row: ShopPackageAllocationResponse) => `¥${(row.calculated_cost_price / 100).toFixed(2)}`
|
||||
formatter: (row: ShopPackageAllocationResponse) =>
|
||||
`¥${(row.calculated_cost_price / 100).toFixed(2)}`
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
@@ -624,7 +637,7 @@
|
||||
const handlePackageChange = (packageId: number | undefined) => {
|
||||
if (packageId) {
|
||||
// 从套餐选项中找到选中的套餐
|
||||
const selectedPackage = packageOptions.value.find(pkg => pkg.id === packageId)
|
||||
const selectedPackage = packageOptions.value.find((pkg) => pkg.id === packageId)
|
||||
if (selectedPackage) {
|
||||
// 将套餐的价格设置为成本价
|
||||
form.cost_price = selectedPackage.price
|
||||
|
||||
@@ -94,11 +94,7 @@
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="流量类型" prop="data_type">
|
||||
<ElSelect
|
||||
v-model="form.data_type"
|
||||
placeholder="请选择流量类型"
|
||||
style="width: 100%"
|
||||
>
|
||||
<ElSelect v-model="form.data_type" placeholder="请选择流量类型" style="width: 100%">
|
||||
<ElOption
|
||||
v-for="option in DATA_TYPE_OPTIONS"
|
||||
:key="option.value"
|
||||
@@ -116,7 +112,11 @@
|
||||
placeholder="请输入真流量额度"
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="虚流量额度(MB)" prop="virtual_data_mb" v-if="form.data_type === 'virtual'">
|
||||
<ElFormItem
|
||||
label="虚流量额度(MB)"
|
||||
prop="virtual_data_mb"
|
||||
v-if="form.data_type === 'virtual'"
|
||||
>
|
||||
<ElInputNumber
|
||||
v-model="form.virtual_data_mb"
|
||||
:min="0"
|
||||
@@ -135,12 +135,7 @@
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="价格(分)" prop="price">
|
||||
<ElInputNumber
|
||||
v-model="form.price"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<ElInputNumber v-model="form.price" :min="0" :controls="false" style="width: 100%" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="套餐描述" prop="description">
|
||||
<ElInput
|
||||
@@ -387,10 +382,8 @@
|
||||
label: '套餐类型',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
return h(
|
||||
ElTag,
|
||||
{ type: getPackageTypeTag(row.package_type), size: 'small' },
|
||||
() => getPackageTypeLabel(row.package_type)
|
||||
return h(ElTag, { type: getPackageTypeTag(row.package_type), size: 'small' }, () =>
|
||||
getPackageTypeLabel(row.package_type)
|
||||
)
|
||||
}
|
||||
},
|
||||
@@ -399,10 +392,8 @@
|
||||
label: '流量类型',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
return h(
|
||||
ElTag,
|
||||
{ type: getDataTypeTag(row.data_type), size: 'small' },
|
||||
() => getDataTypeLabel(row.data_type)
|
||||
return h(ElTag, { type: getDataTypeTag(row.data_type), size: 'small' }, () =>
|
||||
getDataTypeLabel(row.data_type)
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -176,7 +176,11 @@
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem
|
||||
:label="form.one_time_commission_config.mode === 'fixed' ? '佣金金额(分)' : '佣金比例(千分比)'"
|
||||
:label="
|
||||
form.one_time_commission_config.mode === 'fixed'
|
||||
? '佣金金额(分)'
|
||||
: '佣金比例(千分比)'
|
||||
"
|
||||
prop="one_time_commission_config.value"
|
||||
>
|
||||
<ElInputNumber
|
||||
@@ -197,8 +201,16 @@
|
||||
<template v-if="form.one_time_commission_config.type === 'tiered'">
|
||||
<ElFormItem label="梯度档位">
|
||||
<div class="tier-list">
|
||||
<div v-for="(tier, index) in form.one_time_commission_config.tiers" :key="index" class="tier-item">
|
||||
<ElSelect v-model="tier.tier_type" placeholder="梯度类型" style="width: 120px">
|
||||
<div
|
||||
v-for="(tier, index) in form.one_time_commission_config.tiers"
|
||||
:key="index"
|
||||
class="tier-item"
|
||||
>
|
||||
<ElSelect
|
||||
v-model="tier.tier_type"
|
||||
placeholder="梯度类型"
|
||||
style="width: 120px"
|
||||
>
|
||||
<ElOption label="销量" value="sales_count" />
|
||||
<ElOption label="销售额" value="sales_amount" />
|
||||
</ElSelect>
|
||||
@@ -903,12 +915,14 @@
|
||||
}
|
||||
// 梯度类型配置
|
||||
else if (form.one_time_commission_config.type === 'tiered') {
|
||||
data.one_time_commission_config.tiers = form.one_time_commission_config.tiers.map((t: any) => ({
|
||||
tier_type: t.tier_type,
|
||||
threshold: t.threshold,
|
||||
mode: t.mode,
|
||||
value: t.value
|
||||
}))
|
||||
data.one_time_commission_config.tiers = form.one_time_commission_config.tiers.map(
|
||||
(t: any) => ({
|
||||
tier_type: t.tier_type,
|
||||
threshold: t.threshold,
|
||||
mode: t.mode,
|
||||
value: t.value
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -962,9 +976,9 @@
|
||||
}
|
||||
|
||||
.form-tip {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.tier-list {
|
||||
@@ -981,26 +995,26 @@
|
||||
.info-row {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin-bottom: 18px;
|
||||
padding: 12px;
|
||||
margin-bottom: 18px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 14px;
|
||||
color: var(--art-primary);
|
||||
font-weight: 500;
|
||||
color: var(--art-primary);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user