feat(CoilSelector): 新增入场卷号字段并调整当前卷号显示
feat(customer): 新增客户相关配卷和财务信息查询接口 fix(base.vue): 修复发货单时间条件显示问题 refactor(CustomerEdit): 替换地址选择组件为普通输入框 feat(CoilSelector): 增加入场卷号查询条件并调整对话框宽度 style(OrderEdit): 调整客户名称和销售员选择框宽度 refactor(ChinaAreaSelect): 优化地址解析逻辑并支持空对象处理 feat(FileUpload/FileList): 新增文件预览功能组件 refactor(KLPService/CustomerSelect): 优化客户选择组件并支持自定义字段绑定 fix(AbnormalForm): 修复异常位置校验逻辑并保留当前卷号 feat(ContractTabs): 新增合同附件展示功能 refactor(warehouse/record): 重构操作记录统计展示方式 feat(contract): 集成客户选择组件并优化合同信息填充 refactor(order): 调整订单表单布局并集成合同信息 feat(FilePreview): 新增文件预览组件 feat(customer): 新增财务状态和发货配卷展示 refactor(CustomerOrder): 移除冗余代码并优化布局 feat(PlanDetailForm): 新增合同附件查看功能 feat(dict): 新增字典管理页面
This commit is contained in:
@@ -47,12 +47,17 @@ function formatAreaText(value) {
|
||||
return { standard, custom };
|
||||
}
|
||||
|
||||
// 非组合格式(纯标准地址/纯自定义地址)→ 默认归为standard
|
||||
return { standard: trimVal, custom: '' };
|
||||
// 非组合格式(纯任意字符串)→ 归为custom
|
||||
return { standard: '', custom: trimVal };
|
||||
}
|
||||
|
||||
// ========== 场景3:输入是对象 → 格式化为组合字符串 ==========
|
||||
if (typeof value === 'object' && !Array.isArray(value)) {
|
||||
// 处理空对象
|
||||
if (Object.keys(value).length === 0) {
|
||||
return '[]()';
|
||||
}
|
||||
|
||||
const { standard = '', custom = '' } = value;
|
||||
// 转字符串并去空格
|
||||
const standardStr = String(standard).trim();
|
||||
@@ -71,11 +76,19 @@ function formatAreaText(value) {
|
||||
*/
|
||||
function formatAreaTextEnhanced(value, keyType = 'name') {
|
||||
// 先调用基础版解析/格式化
|
||||
const result = formatAreaText(value);
|
||||
let result = formatAreaText(value);
|
||||
|
||||
// 如果是解析模式(返回对象)且keyType为name,转换code为name
|
||||
// 如果是解析模式(返回对象)且keyType为name,检查是否为代码输入
|
||||
if (typeof result === 'object' && keyType === 'name') {
|
||||
result.standard = convertCodeToName(result.standard);
|
||||
// 检查custom是否可能是代码(不包含中文)
|
||||
if (result.custom && !/[\u4e00-\u9fa5]/.test(result.custom)) {
|
||||
// 尝试转换code为name
|
||||
const convertedName = convertCodeToName(result.custom);
|
||||
// 如果转换成功(返回非空字符串),则将其移到standard字段
|
||||
if (convertedName) {
|
||||
result = { standard: convertedName, custom: '' };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user