feat: 规范报表名称格式,添加补单检测,设置充电量为必选字段
Coze-Commit-Type: user Coze-User-ID: 3722323274763196 Coze-Conversation-ID: 9894087
This commit is contained in:
@@ -351,6 +351,27 @@
|
||||
border: 1px solid #bee5eb;
|
||||
}
|
||||
|
||||
.checkbox-item.required-field {
|
||||
background: #fff3cd;
|
||||
border: 1px solid #ffc107;
|
||||
}
|
||||
|
||||
.checkbox-item.required-field:hover {
|
||||
background: #fff3cd;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.required-badge {
|
||||
display: inline-block;
|
||||
padding: 2px 6px;
|
||||
background: #ffc107;
|
||||
color: #000;
|
||||
border-radius: 3px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.checkbox-item input[type="checkbox"] {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
@@ -1177,14 +1198,19 @@
|
||||
const fieldsList = document.getElementById('fields-list');
|
||||
const sumFieldsList = document.getElementById('sum-fields-list');
|
||||
|
||||
fieldsList.innerHTML = allFields.map(field => `
|
||||
<div class="checkbox-item ${selectedFields.includes(field.key) ? 'checked' : ''}" onclick="toggleCheckboxItem(this)">
|
||||
<input type="checkbox" value="${field.key}"
|
||||
${selectedFields.includes(field.key) ? 'checked' : ''}
|
||||
onchange="onFieldCheckboxChange(this)">
|
||||
<label>${field.display}</label>
|
||||
</div>
|
||||
`).join('');
|
||||
fieldsList.innerHTML = allFields.map(field => {
|
||||
const isSelected = selectedFields.includes(field.key);
|
||||
const isRequired = field.key === 'charge_degree'; // 充电量为必选字段
|
||||
return `
|
||||
<div class="checkbox-item ${isSelected ? 'checked' : ''} ${isRequired ? 'required-field' : ''}" onclick="${isRequired ? '' : 'toggleCheckboxItem(this)'}">
|
||||
<input type="checkbox" value="${field.key}"
|
||||
${isSelected ? 'checked' : ''}
|
||||
${isRequired ? 'disabled checked' : ''}
|
||||
onchange="onFieldCheckboxChange(this)">
|
||||
<label>${field.display}${isRequired ? ' <span class="required-badge">必选</span>' : ''}</label>
|
||||
</div>
|
||||
`;
|
||||
}).join('');
|
||||
|
||||
// 初始化求和字段列表(只显示已选字段中的可求和字段)
|
||||
refreshSumFieldsList(selectedFields, sumFields);
|
||||
@@ -1201,6 +1227,12 @@
|
||||
|
||||
// 字段 checkbox 变化时更新求和字段列表和已选字段顺序
|
||||
function onFieldCheckboxChange(cb) {
|
||||
// 防止取消选择必选字段(充电量)
|
||||
if (cb.value === 'charge_degree' && !cb.checked) {
|
||||
cb.checked = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const item = cb.closest('.checkbox-item');
|
||||
if (item) item.classList.toggle('checked', cb.checked);
|
||||
|
||||
@@ -1651,6 +1683,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保充电量为必选字段
|
||||
if (!selectedFields.includes('charge_degree')) {
|
||||
selectedFields.push('charge_degree');
|
||||
}
|
||||
|
||||
// 验证合并特来电配置
|
||||
if (mergeTelecom && splitType !== 'company_id') {
|
||||
alert('合并特来电数据仅支持按企业拆分');
|
||||
|
||||
Reference in New Issue
Block a user