修改费用配置页面

This commit is contained in:
LHG 2025-04-16 11:42:37 +08:00
parent f9f4c6e4cc
commit f693104d1e

View File

@ -372,7 +372,7 @@ const isAdd = ref(true);
const warmReminder = ref("");
const field = ref("");
const form = ref({
const formData = () => ({
costConfigId: "",
regionId: "",
chargingMode: "",
@ -394,6 +394,8 @@ const form = ref({
whetherOpenLongRent: ""
});
const form = ref(formData());
//
const columns = ref([])
@ -406,6 +408,129 @@ const changeFreeDurationMode = (data) => {
}
}
const timePeriodColumns = [
{
title: '阶段',
key: 'phase',
width: 70,
align: 'center',
dataIndex: 'phase'
},
{
title: '起始时间',
key: 'startupTime',
width: 130,
align: 'center',
dataIndex: 'startupTime',
type: 'time'
},
{
title: '结束时间',
key: 'endTime',
width: 130,
align: 'center',
dataIndex: 'endTime',
type: 'time'
},
{
title: '起步费用(元)',
key: 'startupCost',
width: 120,
align: 'center',
dataIndex: 'startupCost',
type: 'input'
},
{
title: '起步时长(分)',
key: 'startupDuration',
width: 120,
align: 'center',
dataIndex: 'startupDuration',
type: 'input'
},
{
title: '时长费用(元)',
key: 'durationCost',
width: 120,
align: 'center',
dataIndex: 'durationCost',
type: 'input'
},
{
title: '时长(分)',
key: 'duration',
width: 100,
align: 'center',
dataIndex: 'duration',
type: 'input'
},
{
title: '操作',
key: 'action',
width: 80,
align: 'center',
fixed: 'right',
}
]
const weekColumns = [
{
title: '名称',
key: 'configName',
width: 100,
align: 'center',
dataIndex: 'configName',
type: 'input'
},
{
title: '周',
key: 'week',
width: 170,
align: 'center',
dataIndex: 'week',
type: 'select'
},
{
title: '起步费用(元)',
key: 'startupCost',
width: 50,
align: 'center',
dataIndex: 'startupCost',
type: 'input'
},
{
title: '起步时长(分)',
key: 'startupDuration',
width: 120,
align: 'center',
dataIndex: 'startupDuration',
type: 'input'
},
{
title: '时长费用(元)',
key: 'durationCost',
width: 120,
align: 'center',
dataIndex: 'durationCost',
type: 'input'
},
{
title: '时长(分)',
key: 'duration',
width: 100,
align: 'center',
dataIndex: 'duration',
type: 'input'
},
{
title: '操作',
key: 'action',
width: 80,
align: 'center',
fixed: 'right',
}
]
const changeTimeDivisionCharging = (data) => {
const value = data.target.value;
if (value == "2") {
@ -416,70 +541,7 @@ const changeTimeDivisionCharging = (data) => {
form.value.ebikeSysRcostsetWeekDtos = [];
deteilShow.value = true;
warmReminder.value = "温馨提示当天结束的阶段为23:59:59没有设置的话默认配置为上面的字段。";
columns.value = [
{
title: '阶段',
key: 'phase',
width: 70,
align: 'center',
dataIndex: 'phase'
},
{
title: '起始时间',
key: 'startupTime',
width: 130,
align: 'center',
dataIndex: 'startupTime',
type: 'time'
},
{
title: '结束时间',
key: 'endTime',
width: 130,
align: 'center',
dataIndex: 'endTime',
type: 'time'
},
{
title: '起步费用(元)',
key: 'startupCost',
width: 120,
align: 'center',
dataIndex: 'startupCost',
type: 'input'
},
{
title: '起步时长(分)',
key: 'startupDuration',
width: 120,
align: 'center',
dataIndex: 'startupDuration',
type: 'input'
},
{
title: '时长费用(元)',
key: 'durationCost',
width: 120,
align: 'center',
dataIndex: 'durationCost',
type: 'input'
},
{
title: '时长(分)',
key: 'duration',
width: 100,
align: 'center',
dataIndex: 'duration',
type: 'input'
},
{
title: '操作',
key: 'action',
width: 80,
align: 'center',
fixed: 'right',
}
]
columns.value = timePeriodColumns;
} else if (value == "3") {
field.value = "ebikeSysRcostsetWeekDtos";
if (form.value['ebikeSysRcostsetWeekDtos'] == null) {
@ -488,63 +550,7 @@ const changeTimeDivisionCharging = (data) => {
form.value.ebikeSysRcostsetTimePeriodDtos = [];
deteilShow.value = true;
warmReminder.value = "温馨提示周的日期支持多选比如可以选择周一、周二、周三为1种计费方式没有选择的按默认选择方式来。";
columns.value = [
{
title: '名称',
key: 'configName',
width: 100,
align: 'center',
dataIndex: 'configName',
type: 'input'
},
{
title: '周',
key: 'week',
width: 170,
align: 'center',
dataIndex: 'week',
type: 'select'
},
{
title: '起步费用(元)',
key: 'startupCost',
width: 50,
align: 'center',
dataIndex: 'startupCost',
type: 'input'
},
{
title: '起步时长(分)',
key: 'startupDuration',
width: 120,
align: 'center',
dataIndex: 'startupDuration',
type: 'input'
},
{
title: '时长费用(元)',
key: 'durationCost',
width: 120,
align: 'center',
dataIndex: 'durationCost',
type: 'input'
},
{
title: '时长(分)',
key: 'duration',
width: 100,
align: 'center',
dataIndex: 'duration',
type: 'input'
},
{
title: '操作',
key: 'action',
width: 80,
align: 'center',
fixed: 'right',
}
]
columns.value = weekColumns;
} else {
field.value = "";
deteilShow.value = false;
@ -557,6 +563,9 @@ const changeTimeDivisionCharging = (data) => {
const openForm = (params = {}) => {
deteilShow.value = false;
Object.assign(form.value, formData());
formRef.value.resetFields();
isAdd.value = true;
if (params['regionId']) {
form.value.regionId = params['regionId']
spinning.value = true;
@ -579,136 +588,15 @@ const openForm = (params = {}) => {
field.value = "ebikeSysRcostsetTimePeriodDtos";
deteilShow.value = true;
warmReminder.value = "温馨提示当天结束的阶段为23:59:59没有设置的话默认配置为上面的字段。";
columns.value = [
{
title: '阶段',
key: 'phase',
width: 70,
align: 'center',
dataIndex: 'phase'
},
{
title: '起始时间',
key: 'startupTime',
width: 130,
align: 'center',
dataIndex: 'startupTime',
type: 'time'
},
{
title: '结束时间',
key: 'endTime',
width: 130,
align: 'center',
dataIndex: 'endTime',
type: 'time'
},
{
title: '起步费用(元)',
key: 'startupCost',
width: 120,
align: 'center',
dataIndex: 'startupCost',
type: 'input'
},
{
title: '起步时长(分)',
key: 'startupDuration',
width: 120,
align: 'center',
dataIndex: 'startupDuration',
type: 'input'
},
{
title: '时长费用(元)',
key: 'durationCost',
width: 120,
align: 'center',
dataIndex: 'durationCost',
type: 'input'
},
{
title: '时长(分)',
key: 'duration',
width: 100,
align: 'center',
dataIndex: 'duration',
type: 'input'
},
{
title: '操作',
key: 'action',
width: 80,
align: 'center',
fixed: 'right',
}
]
columns.value = timePeriodColumns;
} else if (res.data.timeDivisionCharging == '3') {
field.value = "ebikeSysRcostsetWeekDtos";
deteilShow.value = true;
warmReminder.value = "温馨提示周的日期支持多选比如可以选择周一、周二、周三为1种计费方式没有选择的按默认选择方式来。";
columns.value = [
{
title: '名称',
key: 'configName',
width: 100,
align: 'center',
dataIndex: 'configName',
type: 'input'
},
{
title: '周',
key: 'week',
width: 170,
align: 'center',
dataIndex: 'week',
type: 'select'
},
{
title: '起步费用(元)',
key: 'startupCost',
width: 120,
align: 'center',
dataIndex: 'startupCost',
type: 'input'
},
{
title: '起步时长(分)',
key: 'startupDuration',
width: 120,
align: 'center',
dataIndex: 'startupDuration',
type: 'input'
},
{
title: '时长费用(元)',
key: 'durationCost',
width: 120,
align: 'center',
dataIndex: 'durationCost',
type: 'input'
},
{
title: '时长(分)',
key: 'duration',
width: 100,
align: 'center',
dataIndex: 'duration',
type: 'input'
},
{
title: '操作',
key: 'action',
width: 80,
align: 'center',
fixed: 'right',
}
]
columns.value = weekColumns;
} else {
field.value = "";
}
} else {
formRef.value.resetFields()
}
} else {
message.error(res.message);
@ -763,6 +651,7 @@ const remove = (val, filed, array) => {
const formSave = (callBack) => {
formRef.value.validate().then(() => {
debugger;
tipContent.value = "保存中..."
spinning.value = true;
let url = "regionFeeConfigAdds";
@ -781,7 +670,6 @@ const formSave = (callBack) => {
if (callBack) {
res.data = param;
callBack(res);
formRef.value.resetFields()
}
})
}).catch(error => {