/** * preliminary.js - 碎片处理逻辑(待定逻辑,暂做基础列表 + 状态统计) */ $(function () { renderShell('碎片处理', '数据管理 / 碎片处理(占位)'); renderPage(); initPage('preliminary', function (user) { if (!checkPagePermission('preliminary')) return; loadStats(); loadList(1); }); var currentPage = 1; /** 渲染页面内容(统计卡+工具栏+表格+分页) */ function renderPage() { $('#page-content').html( '
' + '
' + '
' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + '
' + ' ' + ' ' + '
ID类型公司姓名电话邮箱跟进人录入时间
' + ' ' + '
' ); } function loadStats() { httpGet('preliminary/stats.php').then(function (d) { $('#stat-cards').html( '
' + d.total + '
碎片总数
' + '
' + d.today + '
今日新增
' ); }); } function loadList(page) { currentPage = page; var params = buildFilterParam(); params.page = page; params.limit = PAGE_SIZE; httpGet('preliminary/list.php', params).then(function (data) { var rows = data.list || []; var html = ''; rows.forEach(function (r) { html += '' + '' + r.id + '' + '' + escHtml(r.source_type || '-') + '' + '' + escHtml(r.company_name || '-') + '' + '' + escHtml(r.person_name || '-') + '' + '' + escHtml(r.contact_phone || '-') + '' + '' + escHtml(r.contact_email || '-') + '' + '' + escHtml(r.follow_person || '-') + '' + '' + fmtDate(r.created_at) + ''; }); if (!rows.length) { html = '暂无数据碎片'; } $('#pre-tbody').html(html); renderPagination($('#pagination'), data, loadList); }); } $('#btn-search').on('click', function () { loadList(1); }); $('#btn-reset').on('click', function () { $('.toolbar [data-filter]').val(''); loadList(1); }); });