fix_train
This commit is contained in:
parent
da118f41f9
commit
569ca8479f
@ -72,8 +72,11 @@ async function loadCustomersForDropdown() {
|
||||
console.log('Customers data:', data);
|
||||
|
||||
const customers = data.customers || [];
|
||||
console.log('Number of customers:', customers.length);
|
||||
customersMap = {};
|
||||
// Use the complete customer map for ID->Name lookups
|
||||
customersMap = data.customerMap || {};
|
||||
|
||||
console.log('Number of unique customers:', customers.length);
|
||||
console.log('Number of customer ID mappings:', Object.keys(customersMap).length);
|
||||
|
||||
const select = document.getElementById('trialCustomerSelect');
|
||||
if (!select) {
|
||||
@ -84,15 +87,15 @@ async function loadCustomersForDropdown() {
|
||||
// Keep the first option (请选择客户)
|
||||
select.innerHTML = '<option value="">请选择客户</option>';
|
||||
|
||||
// Use the deduplicated list for dropdown options
|
||||
customers.forEach(customer => {
|
||||
customersMap[customer.id] = customer.customerName;
|
||||
const option = document.createElement('option');
|
||||
option.value = customer.id;
|
||||
option.textContent = customer.customerName;
|
||||
select.appendChild(option);
|
||||
});
|
||||
|
||||
console.log('Customers loaded successfully. Total:', customers.length);
|
||||
console.log('Customers loaded successfully. Dropdown options:', customers.length);
|
||||
} catch (error) {
|
||||
console.error('Error loading customers:', error);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user