v1.0.41: 硬数据流程调整 - 区块标题去【】+preliminary_data瘦身(删非必要字段品类/描述,备份表已建)+硬数据标准(人员需手机/邮箱至少一,企业需名称必填,前后端校验)+完整度字段改4项

This commit is contained in:
nanguaboss
2026-08-10 00:10:53 +08:00
parent df8439fcb5
commit 7fc0546a1e
7 changed files with 41 additions and 26 deletions
+6 -8
View File
@@ -42,7 +42,7 @@ $(function () {
// ================= 硬碎片 =================
'<div class="card" style="margin-top:14px;">' +
' <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;">' +
' <b style="font-size:15px;color:#1e2a3a;">【硬数据新增与处理】</b>' +
' <b style="font-size:15px;color:#1e2a3a;">硬数据新增与处理</b>' +
' <span style="font-size:12px;color:#8a94a6;">关键字段缺失、未入主表的原始线索(不含已转换/已废弃)</span>' +
' </div>' +
' <div class="toolbar">' +
@@ -68,7 +68,7 @@ $(function () {
// ================= 软碎片 =================
'<div class="card" style="margin-top:14px;">' +
' <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;">' +
' <b style="font-size:15px;color:#1e2a3a;">【软数据碎片处理】</b>' +
' <b style="font-size:15px;color:#1e2a3a;">软数据碎片处理</b>' +
' <span style="font-size:12px;color:#8a94a6;">已入主表但完整度低于阈值的记录(is_incomplete=1)</span>' +
' </div>' +
' <div class="toolbar">' +
@@ -212,7 +212,6 @@ $(function () {
' <div class="form-item"><label>联系电话</label><input type="text" name="contact_phone" placeholder="如:13812345678"></div>' +
' <div class="form-item"><label>联系邮箱</label><input type="text" name="contact_email" placeholder="如:a@b.com"></div>' +
' <div class="form-item" id="ha-f-idnumber"><label>身份证号码</label><input type="text" name="id_number" placeholder="15 或 18 位"></div>' +
' <div class="form-item" id="ha-f-category"><label>意向产品品类</label><input type="text" name="target_product_category" placeholder="如:工业机器人"></div>' +
' <div class="form-item"><label>来源渠道</label><select name="source_channel" id="ha-source"><option value="手动录入">手动录入</option></select></div>' +
' <div class="form-item" id="ha-f-platform"><label>社媒平台</label><select name="platform" id="ha-platform"><option value="">-</option>' +
' <option value="wechat">微信</option><option value="weibo">微博</option><option value="douyin">抖音</option>' +
@@ -246,7 +245,6 @@ $(function () {
var t = $('#ha-type').val();
$('#ha-f-company_name').toggle(t !== 'person');
$('#ha-f-person_name').toggle(t === 'person' || t === 'mixed');
$('#ha-f-category').toggle(t === 'product' || t === 'need');
}
$('#ha-type').on('change', syncFields);
syncFields();
@@ -260,6 +258,9 @@ $(function () {
if (name) fd[name] = $(this).val();
});
fd.source_type = $('#ha-type').val();
// 硬数据标准校验:企业/产品/需求 → 企业名称必填;人员 → 手机、邮箱至少一项
if (fd.source_type !== 'person' && !$.trim(fd.company_name)) { Dialog.error('企业类型硬数据:企业名称为必填项'); return; }
if (fd.source_type === 'person' && !$.trim(fd.contact_phone) && !$.trim(fd.contact_email)) { Dialog.error('人员类型硬数据:手机号码、邮箱至少填写一项'); return; }
// 格式校验:手机 / 邮箱 / 身份证
if (fd.contact_phone && !validatePhoneCN(fd.contact_phone)) { Dialog.error('手机号码格式不正确(应为国内 11 位手机号,如 13812345678)'); return; }
if (fd.contact_email && !validateEmail(fd.contact_email)) { Dialog.error('邮箱格式不正确'); return; }
@@ -281,7 +282,7 @@ $(function () {
var rowHtml = '';
var fields = [
['类型', d.source_type_label], ['公司名称', d.company_name], ['联系人', d.person_name],
['联系电话', d.contact_phone], ['联系邮箱', d.contact_email], ['意向品类', d.target_product_category],
['联系电话', d.contact_phone], ['联系邮箱', d.contact_email],
['来源渠道', d.source_channel], ['录入人', d.recorded_by], ['状态', d.status],
['录入时间', d.created_at], ['处理时间', d.processed_at]
];
@@ -289,9 +290,6 @@ $(function () {
rowHtml += '<div style="display:flex;margin:6px 0;"><span style="width:80px;color:#8a94a6;">' + f[0] + '</span>' +
'<span>' + escHtml(f[1] || '-') + '</span></div>';
});
if (d.description) {
rowHtml += '<div style="margin:6px 0;"><span style="color:#8a94a6;">原始描述</span><div style="margin-top:4px;padding:8px;background:#f7f8fa;border-radius:4px;font-size:12px;max-height:120px;overflow:auto;">' + escHtml(d.description) + '</div></div>';
}
Dialog.open({
title: '硬碎片详情(完整度 ' + d.completeness + '%)',
area: ['560px', 'auto'],