// 客户管理字典映射配置(id -> 名称) export const customerMaps = { industryClass: { '1': '钢铁', '2': '电力', '3': '化工' }, coopStatus: { '1': '潜在', '2': '意向', '3': '正式', '4': '暂停', '5': '终止' }, enterpriseType: { '1': '国有企业', '2': '民营企业', '3': '外资企业' }, custReg: { '1': '核心', '2': '重点', '3': '一般' }, creditRate: { '1': '优', '2': '良', '3': '中', '4': '差' }, payMeth: { '1': '预付', '2': '月付', '3': '承兑' }, enabledStatus: { '1': '启用', '2': '未启用' }, storeType: { 1: '原料库', 2: '在制品库', 3: '成品库' }, } // 根据映射自动生成下拉选项 export const customerOptions = {} for (const key in customerMaps) { const map = customerMaps[key] customerOptions[key] = Object.entries(map).map(([id, fullName]) => ({ id: Number(id), fullName })) } // 获取显示名称 export function getCustomerLabel(type, value) { const map = customerMaps[type] return map ? (map[value] || value) : value }