chem_mes/jnpf-java-boot/jnpf-web/src/views/example/customer/options.js

28 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 客户管理字典映射配置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
}