增加t自定义服务费单价

This commit is contained in:
2026-07-15 11:23:02 +08:00
parent 9c3c1e26cc
commit 96cca34de0
6 changed files with 245 additions and 28 deletions

View File

@@ -87,6 +87,14 @@ function showCreateModal() {
const showMonthlyTotalCheckbox = document.getElementById('show-monthly-total');
if (showMonthlyTotalCheckbox) showMonthlyTotalCheckbox.checked = false;
// 重置自定义服务费单价
const customServiceFeePriceInput = document.getElementById('custom-service-fee-price');
if (customServiceFeePriceInput) customServiceFeePriceInput.value = '';
// 重置自定义服务费表头名称
const customServiceFeeNameInput = document.getElementById('custom-service-fee-name');
if (customServiceFeeNameInput) customServiceFeeNameInput.value = '';
document.getElementById('config-modal').classList.add('active');
}
@@ -479,6 +487,14 @@ async function saveConfig() {
// 获取月度总计开关
const showMonthlyTotal = document.getElementById('show-monthly-total')?.checked || false;
// 获取自定义服务费单价
const customServiceFeePriceInput = document.getElementById('custom-service-fee-price');
const customServiceFeePrice = customServiceFeePriceInput?.value !== '' ? parseFloat(customServiceFeePriceInput.value) : null;
// 获取自定义服务费表头名称
const customServiceFeeNameInput = document.getElementById('custom-service-fee-name');
const customServiceFeeName = customServiceFeeNameInput?.value.trim() || null;
if (!configName || !splitType || !splitValue) {
alert('请填写所有必填字段');
@@ -519,7 +535,9 @@ async function saveConfig() {
merge_telecom: mergeTelecom,
telecom_vehicle_no: telecomVehicleNo,
field_custom_names: fieldCustomNamesData,
show_monthly_total: showMonthlyTotal
show_monthly_total: showMonthlyTotal,
custom_service_fee_price: customServiceFeePrice,
custom_service_fee_name: customServiceFeeName
};
try {
@@ -600,6 +618,18 @@ async function editConfig(configId) {
showMonthlyTotalCheckbox.checked = config.show_monthly_total === 1 || config.show_monthly_total === true;
}
// 加载自定义服务费单价
const customServiceFeePriceInput = document.getElementById('custom-service-fee-price');
if (customServiceFeePriceInput) {
customServiceFeePriceInput.value = config.custom_service_fee_price !== null && config.custom_service_fee_price !== undefined ? config.custom_service_fee_price : '';
}
// 加载自定义服务费表头名称
const customServiceFeeNameInput = document.getElementById('custom-service-fee-name');
if (customServiceFeeNameInput) {
customServiceFeeNameInput.value = config.custom_service_fee_name || '';
}
document.getElementById('config-modal').classList.add('active');
}
}