|
|
@@ -16,13 +16,19 @@
|
|
|
<el-table-column label="车辆类型" align="center" width="180" prop="vehicle_type"></el-table-column>
|
|
|
<el-table-column label="初始费用" align="center" width="180" prop="start_fee"></el-table-column>
|
|
|
<el-table-column label="单位费用" align="center" width="180" prop="unit_fee"></el-table-column>
|
|
|
- <el-table-column label="车辆类型" align="center" width="180" prop="vehicle_type"></el-table-column>
|
|
|
+ <el-table-column label="是否为VIP" align="center" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button :type="scope.row.is_vip_free ? 'success' : 'danger'" plain>
|
|
|
+ {{scope.row.is_vip_free ? '已成为vip' : '未成为vip'}}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="每日最大费用" align="center" width="180" prop="daily_max_fee"></el-table-column>
|
|
|
<el-table-column label="vip折扣" align="center" width="180" prop="vip_discount"></el-table-column>
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-button text type="primary" icon="MessageBox">备注</el-button>
|
|
|
- <el-button @click="openPricing('编辑车主', scope.row)" icon="edit" text type="primary">编辑</el-button>
|
|
|
+ <el-button @click="openPricing('编辑车费配置', scope.row)" icon="edit" text type="primary">编辑</el-button>
|
|
|
<el-button @click="deletePricing(scope.row)" icon="delete" text type="primary">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -30,28 +36,40 @@
|
|
|
<el-dialog v-model="pricingShow" :title="pricingTitle" width="650">
|
|
|
<el-form label-width="120" size="large">
|
|
|
<el-form-item label="车辆类型:">
|
|
|
- <el-input v-model="pricingData.vehicle_type"/>
|
|
|
+ <el-select v-model="pricingData.vehicle_type">
|
|
|
+ <el-option label="月租车" value="月租车"></el-option>
|
|
|
+ <el-option label="临时车" value="临时车"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开始时间:">
|
|
|
- <el-input v-model="pricingData.start_time"/>
|
|
|
+ <el-input
|
|
|
+ v-model="pricingData.start_time"
|
|
|
+ @input="pricingData.start_time = pricingData.start_time.replace(/[^\d]/g, '')"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="起始费用:">
|
|
|
- <el-input v-model="pricingData.start_fee"/>
|
|
|
+ <el-input v-model="pricingData.start_fee" type="number"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="单位费用:">
|
|
|
- <el-input v-model="pricingData.unit_time"/>
|
|
|
+ <el-input v-model="pricingData.unit_fee" type="number"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位时间:">
|
|
|
+ <el-input
|
|
|
+ v-model="pricingData.unit_time"
|
|
|
+ @input="pricingData.start_time = pricingData.start_time.replace(/[^\d]/g, '')"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="每日最大费用:">
|
|
|
- <el-input v-model="pricingData.daily_max_fee"/>
|
|
|
+ <el-input v-model="pricingData.daily_max_fee" type="number"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="是否vip费用:">
|
|
|
+ <el-form-item label="是否为vip免费:">
|
|
|
<el-radio-group v-model="pricingData.is_vip_free" size="large" fill="#409eff">
|
|
|
<el-radio-button label="否" :value="false" />
|
|
|
<el-radio-button label="是" :value="true" />
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="vip折扣:">
|
|
|
- <el-input v-model="pricingData.vip_discount"/>
|
|
|
+ <el-input v-model="pricingData.vip_discount" type="number"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述:">
|
|
|
<el-input v-model="pricingData.description"></el-input>
|
|
|
@@ -75,9 +93,9 @@ const pricingTitle = ref('')
|
|
|
const pricingData = reactive({
|
|
|
id: 0,
|
|
|
vehicle_type: '',
|
|
|
- start_time: '',
|
|
|
+ start_time: 0,
|
|
|
start_fee: 0,
|
|
|
- unit_time: '',
|
|
|
+ unit_time: 0,
|
|
|
unit_fee: 0,
|
|
|
daily_max_fee: 0,
|
|
|
is_vip_free: false,
|
|
|
@@ -95,7 +113,7 @@ const getPricingList = () => {
|
|
|
|
|
|
const deletePricing = (data) => {
|
|
|
ElMessageBox.confirm(
|
|
|
- '确定要删除该车主信息吗?',
|
|
|
+ '确定要删除该收费配置吗?',
|
|
|
'提示',
|
|
|
{
|
|
|
confirmButtonText: '确认',
|
|
|
@@ -130,16 +148,39 @@ const deletePricing = (data) => {
|
|
|
const openPricing = (head, data) => {
|
|
|
pricingShow.value = true
|
|
|
pricingTitle.value = head
|
|
|
- if (head === '新增车主') {
|
|
|
+ if (head === '新增车费配置') {
|
|
|
pricingData.vehicle_type = ''
|
|
|
+ pricingData.start_time = 0
|
|
|
+ pricingData.start_fee = 0
|
|
|
+ pricingData.unit_time = 0
|
|
|
+ pricingData.unit_fee = 0
|
|
|
+ pricingData.daily_max_fee = 0
|
|
|
+ pricingData.vip_discount = 0
|
|
|
+ pricingData.is_vip_free = false
|
|
|
+ pricingData.description = ''
|
|
|
} else {
|
|
|
pricingData.vehicle_type = data.vehicle_type
|
|
|
+ pricingData.start_time = data.start_time
|
|
|
+ pricingData.start_fee = data.start_fee
|
|
|
+ pricingData.unit_time = data.unit_time
|
|
|
+ pricingData.unit_fee = data.unit_fee
|
|
|
+ pricingData.daily_max_fee = data.daily_max_fee
|
|
|
+ pricingData.vip_discount = data.vip_discount
|
|
|
+ pricingData.is_vip_free = data.is_vip_free
|
|
|
+ pricingData.description = data.description
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const pricingOperation = async () => {
|
|
|
+ pricingData.start_time = Number(pricingData.start_time)
|
|
|
+ pricingData.start_fee = Number(pricingData.start_fee)
|
|
|
+ pricingData.unit_time = Number(pricingData.unit_time)
|
|
|
+ pricingData.unit_fee = Number(pricingData.unit_fee)
|
|
|
+ pricingData.daily_max_fee = Number(pricingData.daily_max_fee)
|
|
|
+ pricingData.vip_discount = Number(pricingData.vip_discount)
|
|
|
if (pricingTitle.value === '新增收费配置') {
|
|
|
await addPricing(pricingData).then(res => {
|
|
|
+ console.log(res)
|
|
|
if (res.code === 0) {
|
|
|
ElMessage.success('添加成功')
|
|
|
pricingShow.value = false
|