v1.0.12: 企业/人员/媒体去删除入口;企业/人员加产品入口;企业详情去产品品类/关联联系人;编辑企业改Tab卡(工商信息/财务信息/资质认证)
This commit is contained in:
+210
-41
@@ -29,7 +29,6 @@ $(function () {
|
||||
' <button class="btn btn-success" id="btn-add">+ 新增</button>' +
|
||||
' <button class="btn btn-warning" id="btn-import">导入CSV</button>' +
|
||||
' <button class="btn" id="btn-export">导出</button>' +
|
||||
' <button class="btn btn-danger" id="btn-del-batch">批量删除</button>' +
|
||||
' </div>' +
|
||||
' <div class="table-wrap"><table class="grid">' +
|
||||
' <thead><tr><th><input type="checkbox" id="check-all"></th><th>ID</th><th>公司名称</th><th>行业</th><th>行业细分</th><th>国家</th><th>业务角色</th><th>注册号</th><th>法人</th><th>上市</th><th>创建时间</th><th>操作</th></tr></thead>' +
|
||||
@@ -67,8 +66,8 @@ $(function () {
|
||||
'<td class="ops">' +
|
||||
' <a onclick="viewCompany(' + r.id + ')">详情</a>' +
|
||||
' <a onclick="viewEmployees(' + r.id + ')">员工</a>' +
|
||||
' <a onclick="viewProducts(' + r.id + ')">产品</a>' +
|
||||
' <a onclick="editCompany(' + r.id + ')">编辑</a>' +
|
||||
' <a class="danger" onclick="delCompany(' + r.id + ')">删除</a>' +
|
||||
'</td></tr>';
|
||||
});
|
||||
if (!rows.length) {
|
||||
@@ -87,18 +86,26 @@ $(function () {
|
||||
});
|
||||
|
||||
/* ---------- 新增/编辑 ---------- */
|
||||
$('#btn-add').on('click', function () { openForm(null); });
|
||||
$('#btn-add').on('click', function () {
|
||||
httpGet('company/cert_types.php').then(function (d) {
|
||||
openForm(null, [], [], d.types || []);
|
||||
});
|
||||
});
|
||||
window.editCompany = function (id) {
|
||||
httpGet('company/detail.php', { id: id }).then(function (d) {
|
||||
openForm(d.company);
|
||||
openForm(d.company, d.financials, d.certifications, d.certification_types);
|
||||
});
|
||||
};
|
||||
|
||||
function openForm(company) {
|
||||
function openForm(company, financials, certifications, certTypes) {
|
||||
var isEdit = !!company;
|
||||
var c = company || {};
|
||||
var content =
|
||||
'<form id="company-form" style="padding:18px 22px 4px;">' +
|
||||
financials = financials || [];
|
||||
certifications = certifications || [];
|
||||
certTypes = certTypes || [];
|
||||
|
||||
// Tab1 工商信息
|
||||
var bizHtml =
|
||||
'<div class="form-grid">' +
|
||||
' <div class="form-item"><label>公司名称<span class="req">*</span></label><input type="text" name="name_zh" value="' + escHtml(c.name_zh) + '"></div>' +
|
||||
' <div class="form-item"><label>英文名称</label><input type="text" name="name_en" value="' + escHtml(c.name_en) + '"></div>' +
|
||||
@@ -106,32 +113,81 @@ $(function () {
|
||||
' <div class="form-item"><label>国家/地区</label><input type="text" name="country" value="' + escHtml(c.country) + '"></div>' +
|
||||
' <div class="form-item"><label>注册号</label><input type="text" name="registration_number" value="' + escHtml(c.registration_number) + '"></div>' +
|
||||
' <div class="form-item"><label>注册地址</label><input type="text" name="address" value="' + escHtml(c.address) + '"></div>' +
|
||||
' <div class="form-item"><label>法律形式</label><input type="text" name="legal_form" value="' + escHtml(c.legal_form) + '"></div>' +
|
||||
' <div class="form-item"><label>法定代表人</label><input type="text" name="legal_representative" value="' + escHtml(c.legal_representative) + '"></div>' +
|
||||
' <div class="form-item"><label>行业</label><input type="text" name="industry" value="' + escHtml(c.industry) + '"></div>' +
|
||||
' <div class="form-item"><label>行业细分</label><input type="text" name="industry_subdivision" value="' + escHtml(c.industry_subdivision) + '"></div>' +
|
||||
' <div class="form-item"><label>官网</label><input type="text" name="website" value="' + escHtml(c.website) + '"></div>' +
|
||||
' <div class="form-item"><label>注册资本(万元)</label><input type="text" name="registered_capital" value="' + escHtml(c.registered_capital) + '"></div>' +
|
||||
' <div class="form-item"><label>成立日期</label><input type="date" name="established_date" value="' + escHtml(c.established_date) + '"></div>' +
|
||||
' <div class="form-item"><label>员工数</label><input type="number" name="latest_employee_count" value="' + escHtml(c.latest_employee_count) + '"></div>' +
|
||||
' <div class="form-item"><label>最新年营收</label><input type="text" name="latest_annual_revenue" value="' + escHtml(c.latest_annual_revenue) + '"></div>' +
|
||||
' <div class="form-item"><label>注册资本(万元)</label><input type="text" name="registered_capital" value="' + escHtml(c.registered_capital) + '"></div>' +
|
||||
' <div class="form-item"><label>官网</label><input type="text" name="website" value="' + escHtml(c.website) + '"></div>' +
|
||||
' <div class="form-item"><label>是否上市</label><select name="is_listed">' +
|
||||
' <option value="0"' + (c.is_listed ? '' : ' selected') + '>否</option>' +
|
||||
' <option value="1"' + (c.is_listed ? ' selected' : '') + '>是</option></select></div>' +
|
||||
' <div class="form-item"><label>股票代码</label><input type="text" name="stock_code" value="' + escHtml(c.stock_code) + '"></div>' +
|
||||
' <div class="form-item full"><label>经营范围</label><textarea name="business_scope">' + escHtml(c.business_scope) + '</textarea></div>' +
|
||||
'</div>';
|
||||
|
||||
// Tab2 财务信息:最新冗余字段 + 年度财务明细列表
|
||||
var finRowsHtml = '';
|
||||
if (!financials.length) {
|
||||
finRowsHtml = finYearRowHtml(null);
|
||||
} else {
|
||||
financials.forEach(function (f) { finRowsHtml += finYearRowHtml(f); });
|
||||
}
|
||||
var finHtml =
|
||||
'<div class="form-grid">' +
|
||||
' <div class="form-item"><label>最新员工数</label><input type="number" name="latest_employee_count" value="' + escHtml(c.latest_employee_count) + '"></div>' +
|
||||
' <div class="form-item"><label>最新年营收</label><input type="text" name="latest_annual_revenue" value="' + escHtml(c.latest_annual_revenue) + '"></div>' +
|
||||
'</div>' +
|
||||
'<div style="display:flex;justify-content:space-between;align-items:center;margin:16px 0 8px;">' +
|
||||
' <b style="font-size:13px;color:#1e2a3a;">年度财务明细</b>' +
|
||||
' <button type="button" class="btn btn-sm" id="add-fin-row">+ 添加年度</button>' +
|
||||
'</div>' +
|
||||
'<div id="fin-rows">' + finRowsHtml + '</div>';
|
||||
|
||||
// Tab3 资质认证:列表形式(瞪羚企业等)
|
||||
var certRowsHtml = '';
|
||||
if (!certifications.length) {
|
||||
certRowsHtml = certRowHtml(null, certTypes);
|
||||
} else {
|
||||
certifications.forEach(function (ct) { certRowsHtml += certRowHtml(ct, certTypes); });
|
||||
}
|
||||
var certHtml =
|
||||
'<div style="display:flex;justify-content:space-between;align-items:center;margin:0 0 8px;">' +
|
||||
' <b style="font-size:13px;color:#1e2a3a;">资质认证</b>' +
|
||||
' <button type="button" class="btn btn-sm" id="add-cert-row">+ 添加认证</button>' +
|
||||
'</div>' +
|
||||
'<div id="cert-rows">' + certRowsHtml + '</div>' +
|
||||
'<div style="font-size:12px;color:#8a94a6;margin-top:8px;">如:瞪羚企业、国家高新技术企业、专精特新企业、ISO9001认证等</div>';
|
||||
|
||||
var content =
|
||||
'<form id="company-form" style="padding:14px 22px 4px;">' +
|
||||
' <div class="edit-tabs">' +
|
||||
' <div class="edit-tabs-head">' +
|
||||
' <span class="edit-tab active" data-tab="biz" onclick="switchEditTab(this)">工商信息</span>' +
|
||||
' <span class="edit-tab" data-tab="fin" onclick="switchEditTab(this)">财务信息</span>' +
|
||||
' <span class="edit-tab" data-tab="cert" onclick="switchEditTab(this)">资质认证</span>' +
|
||||
' </div>' +
|
||||
' <div class="edit-tabs-body">' +
|
||||
' <div class="edit-pane" id="edit-pane-biz">' + bizHtml + '</div>' +
|
||||
' <div class="edit-pane" id="edit-pane-fin" style="display:none;">' + finHtml + '</div>' +
|
||||
' <div class="edit-pane" id="edit-pane-cert" style="display:none;">' + certHtml + '</div>' +
|
||||
' </div>' +
|
||||
' </div>' +
|
||||
'<div class="dialog-footer"><button type="button" class="btn" id="form-cancel">取消</button>' +
|
||||
'<button type="submit" class="btn btn-primary">保存</button></div>' +
|
||||
'</form>';
|
||||
|
||||
var idx = Dialog.open({
|
||||
title: isEdit ? '编辑企业' : '新增企业',
|
||||
area: ['760px', 'auto'],
|
||||
area: ['820px', 'auto'],
|
||||
content: content,
|
||||
btn: false
|
||||
});
|
||||
|
||||
$('#form-cancel').on('click', function () { Dialog.close(idx); });
|
||||
$('#add-fin-row').on('click', function () { $('#fin-rows').append(finYearRowHtml(null)); });
|
||||
$('#add-cert-row').on('click', function () { $('#cert-rows').append(certRowHtml(null, certTypes)); });
|
||||
|
||||
$('#company-form').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
@@ -143,6 +199,45 @@ $(function () {
|
||||
Dialog.error('公司名称或英文名称至少填写一项');
|
||||
return;
|
||||
}
|
||||
|
||||
// 年度财务明细(整表替换)
|
||||
var financials = [];
|
||||
$('#fin-rows .fin-year').each(function () {
|
||||
var $y = $(this);
|
||||
var year = $.trim($y.find('[name="fin-fiscal_year"]').val());
|
||||
if (!year) return;
|
||||
financials.push({
|
||||
fiscal_year: year,
|
||||
employee_count: $y.find('[name="fin-employee_count"]').val(),
|
||||
total_revenue: $y.find('[name="fin-total_revenue"]').val(),
|
||||
net_profit: $y.find('[name="fin-net_profit"]').val(),
|
||||
total_assets: $y.find('[name="fin-total_assets"]').val(),
|
||||
total_liabilities: $y.find('[name="fin-total_liabilities"]').val(),
|
||||
owner_equity: $y.find('[name="fin-owner_equity"]').val(),
|
||||
gross_margin: $y.find('[name="fin-gross_margin"]').val(),
|
||||
net_margin: $y.find('[name="fin-net_margin"]').val(),
|
||||
debt_ratio: $y.find('[name="fin-debt_ratio"]').val(),
|
||||
financial_report_url: $y.find('[name="fin-financial_report_url"]').val(),
|
||||
data_source: $y.find('[name="fin-data_source"]').val()
|
||||
});
|
||||
});
|
||||
fd.append('financials', JSON.stringify(financials));
|
||||
|
||||
// 资质认证(整表替换)
|
||||
var certs = [];
|
||||
$('#cert-rows .cert-row').each(function () {
|
||||
var $r = $(this);
|
||||
var tid = $r.find('[name="cert-type"]').val();
|
||||
if (!tid) return;
|
||||
certs.push({
|
||||
certification_type_id: tid,
|
||||
certificate_number: $r.find('[name="cert-number"]').val(),
|
||||
issue_date: $r.find('[name="cert-issue"]').val(),
|
||||
expiry_date: $r.find('[name="cert-expiry"]').val()
|
||||
});
|
||||
});
|
||||
fd.append('certifications', JSON.stringify(certs));
|
||||
|
||||
httpPost(isEdit ? 'company/update.php' : 'company/add.php', fd, true).then(function () {
|
||||
Dialog.success('保存成功', function () {
|
||||
Dialog.close(idx);
|
||||
@@ -152,6 +247,56 @@ $(function () {
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- 编辑弹窗 Tab 切换 ---------- */
|
||||
window.switchEditTab = function (el) {
|
||||
var $tabs = $(el).closest('.edit-tabs');
|
||||
$tabs.find('.edit-tab').removeClass('active');
|
||||
$(el).addClass('active');
|
||||
$tabs.find('.edit-pane').hide();
|
||||
$('#edit-pane-' + $(el).data('tab')).show();
|
||||
};
|
||||
|
||||
/** 年度财务明细行模板 */
|
||||
function finYearRowHtml(f) {
|
||||
f = f || {};
|
||||
var empty = function (v) { return (v === null || v === undefined) ? '' : v; };
|
||||
return '<div class="fin-year">' +
|
||||
' <div class="fin-year-head">' +
|
||||
' <b>财年 <input type="number" name="fin-fiscal_year" min="1990" max="2100" placeholder="如 2024" value="' + escHtml(empty(f.fiscal_year)) + '"></b>' +
|
||||
' <button type="button" class="btn btn-sm btn-danger" onclick="$(this).closest(\'.fin-year\').remove()">移除</button>' +
|
||||
' </div>' +
|
||||
' <div class="form-grid" style="gap:8px 12px;">' +
|
||||
' <div class="form-item"><label>员工数</label><input type="number" name="fin-employee_count" value="' + escHtml(empty(f.employee_count)) + '"></div>' +
|
||||
' <div class="form-item"><label>总营收(万元)</label><input type="text" name="fin-total_revenue" value="' + escHtml(empty(f.total_revenue)) + '"></div>' +
|
||||
' <div class="form-item"><label>净利润(万元)</label><input type="text" name="fin-net_profit" value="' + escHtml(empty(f.net_profit)) + '"></div>' +
|
||||
' <div class="form-item"><label>总资产(万元)</label><input type="text" name="fin-total_assets" value="' + escHtml(empty(f.total_assets)) + '"></div>' +
|
||||
' <div class="form-item"><label>总负债(万元)</label><input type="text" name="fin-total_liabilities" value="' + escHtml(empty(f.total_liabilities)) + '"></div>' +
|
||||
' <div class="form-item"><label>所有者权益(万元)</label><input type="text" name="fin-owner_equity" value="' + escHtml(empty(f.owner_equity)) + '"></div>' +
|
||||
' <div class="form-item"><label>毛利率(%)</label><input type="text" name="fin-gross_margin" value="' + escHtml(empty(f.gross_margin)) + '"></div>' +
|
||||
' <div class="form-item"><label>净利率(%)</label><input type="text" name="fin-net_margin" value="' + escHtml(empty(f.net_margin)) + '"></div>' +
|
||||
' <div class="form-item"><label>资产负债率(%)</label><input type="text" name="fin-debt_ratio" value="' + escHtml(empty(f.debt_ratio)) + '"></div>' +
|
||||
' <div class="form-item full"><label>财务报表链接</label><input type="text" name="fin-financial_report_url" value="' + escHtml(empty(f.financial_report_url)) + '"></div>' +
|
||||
' <div class="form-item"><label>数据来源</label><input type="text" name="fin-data_source" value="' + escHtml(empty(f.data_source)) + '" placeholder="手动录入"></div>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
/** 资质认证行模板 */
|
||||
function certRowHtml(ct, certTypes) {
|
||||
ct = ct || {};
|
||||
var opts = '<option value="">请选择认证类型</option>';
|
||||
certTypes.forEach(function (t) {
|
||||
opts += '<option value="' + t.id + '"' + (String(t.id) === String(ct.certification_type_id) ? ' selected' : '') + '>' + escHtml(t.name) + '</option>';
|
||||
});
|
||||
return '<div class="cert-row">' +
|
||||
'<select name="cert-type">' + opts + '</select>' +
|
||||
'<input type="text" name="cert-number" placeholder="证书编号" value="' + escHtml(ct.certificate_number || '') + '">' +
|
||||
'<input type="date" name="cert-issue" value="' + escHtml(ct.issue_date || '') + '">' +
|
||||
'<input type="date" name="cert-expiry" value="' + escHtml(ct.expiry_date || '') + '">' +
|
||||
'<button type="button" class="btn btn-sm btn-danger" onclick="$(this).closest(\'.cert-row\').remove()">删除</button>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
function roleOptions(sel) {
|
||||
var opts = ['', 'manufacturer', 'integrator', 'distributor', 'brand_operator', 'others'];
|
||||
var labels = { 'manufacturer': '生产型', 'integrator': '集成商', 'distributor': '代理商', 'brand_operator': '品牌运营', 'others': '其他' };
|
||||
@@ -163,27 +308,6 @@ $(function () {
|
||||
return html;
|
||||
}
|
||||
|
||||
/* ---------- 删除(软删除) ---------- */
|
||||
window.delCompany = function (id) {
|
||||
Dialog.confirm('确定删除该企业吗?(软删除,可恢复)', function () {
|
||||
httpPost('company/delete.php', { id: id }).then(function () {
|
||||
Dialog.success('删除成功', function () { loadList(currentPage); });
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/* ---------- 批量删除 ---------- */
|
||||
$('#btn-del-batch').on('click', function () {
|
||||
var ids = [];
|
||||
$('.row-check:checked').each(function () { ids.push($(this).val()); });
|
||||
if (!ids.length) { Dialog.error('请先勾选记录'); return; }
|
||||
Dialog.confirm('确定删除选中的 ' + ids.length + ' 条记录吗?', function () {
|
||||
httpPost('company/delete.php', { ids: ids.join(',') }).then(function () {
|
||||
Dialog.success('删除成功', function () { loadList(currentPage); });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/* ---------- 导入 ---------- */
|
||||
$('#btn-import').on('click', function () {
|
||||
triggerFileInput('.csv', function (file) {
|
||||
@@ -226,9 +350,7 @@ $(function () {
|
||||
detailRow('是否上市', c.is_listed ? '是' : '否') + detailRow('股票代码', c.stock_code) +
|
||||
'</div>' +
|
||||
' <h4 style="margin:16px 0 8px;">经营范围</h4><div style="font-size:13px;color:#5a6472;">' + escHtml(c.business_scope || '-') + '</div>' +
|
||||
' <h4 style="margin:16px 0 8px;">产品品类</h4>' + miniTable(['品类', '描述', '核心'], d.products.map(function (p) { return [p.category_name, p.category_description || '-', p.is_core ? '是' : '否']; })) +
|
||||
' <h4 style="margin:16px 0 8px;">关联需求</h4>' + miniTable(['联系人', '需求大类', '意向品类', '场景'], d.needs.map(function (n) { return [n.contact_person || '-', n.need_category || '-', n.target_product_category || '-', n.application_scenario || '-']; })) +
|
||||
' <h4 style="margin:16px 0 8px;">关联联系人</h4>' + miniTable(['姓名', '职位', '联系方式'], d.contacts.map(function (p) { return [p.full_name || '-', p.position || '-', p.contacts || '-']; })) +
|
||||
'</div>';
|
||||
Dialog.open({ title: '企业详情', area: ['820px', 'auto'], content: html, btn: ['关闭'] });
|
||||
});
|
||||
@@ -256,15 +378,18 @@ $(function () {
|
||||
empCompanyId = companyId;
|
||||
empPage = 1;
|
||||
var content =
|
||||
'<div style="padding:16px 18px 6px;">' +
|
||||
' <div class="toolbar">' +
|
||||
' <input type="text" id="emp-keyword" placeholder="姓名关键词">' +
|
||||
' <select id="emp-level"><option value="">全部职级</option></select>' +
|
||||
'<div style="padding:14px 18px 6px;overflow:hidden;height:330px;">' +
|
||||
' <div class="toolbar" style="margin-bottom:10px;">' +
|
||||
' <input type="text" id="emp-keyword" placeholder="姓名关键词" style="width:140px;">' +
|
||||
' <select id="emp-level" style="width:130px;"><option value="">全部职级</option></select>' +
|
||||
' <span style="font-size:13px;color:#5a6472;">状态:</span>' +
|
||||
' <label style="font-size:13px;color:#5a6472;"><input type="checkbox" id="emp-cur" checked> 在岗</label>' +
|
||||
' <label style="font-size:13px;color:#5a6472;"><input type="checkbox" id="emp-off" checked> 离职</label>' +
|
||||
' <button class="btn btn-primary btn-sm" id="emp-search">搜索</button>' +
|
||||
' <button class="btn btn-sm" id="emp-reset">重置</button>' +
|
||||
' </div>' +
|
||||
' <div class="table-wrap"><table class="grid">' +
|
||||
' <thead><tr><th>姓名</th><th>联系方式</th><th>邮箱</th><th>职级</th><th>部门</th><th>岗位</th><th>入职日期</th><th>是否在职</th></tr></thead>' +
|
||||
' <div class="table-wrap"><table class="grid" style="font-size:13px;">' +
|
||||
' <thead><tr><th>姓名</th><th>联系方式</th><th>邮箱</th><th>职级</th><th>部门</th><th>岗位</th><th>入职日期</th><th>状态</th></tr></thead>' +
|
||||
' <tbody id="emp-tbody"></tbody>' +
|
||||
' </table></div>' +
|
||||
' <div class="pagination" id="emp-pagination"></div>' +
|
||||
@@ -278,6 +403,8 @@ $(function () {
|
||||
$('#emp-reset').on('click', function () {
|
||||
$('#emp-keyword').val('');
|
||||
$('#emp-level').val('');
|
||||
$('#emp-cur').prop('checked', true);
|
||||
$('#emp-off').prop('checked', true);
|
||||
loadEmployees(1);
|
||||
});
|
||||
};
|
||||
@@ -287,8 +414,13 @@ $(function () {
|
||||
var params = { company_id: empCompanyId, page: page, limit: 5 };
|
||||
var kw = $.trim($('#emp-keyword').val());
|
||||
var lv = $('#emp-level').val();
|
||||
var cur = $('#emp-cur').prop('checked');
|
||||
var off = $('#emp-off').prop('checked');
|
||||
if (kw) params.keyword = kw;
|
||||
if (lv) params.job_level = lv;
|
||||
// 状态筛选:只勾一项则按该项过滤;都不勾视为全部
|
||||
if (cur && !off) params.is_current = 1;
|
||||
else if (!cur && off) params.is_current = 0;
|
||||
|
||||
httpGet('company/employees.php', params).then(function (data) {
|
||||
var rows = data.list || [];
|
||||
@@ -323,4 +455,41 @@ $(function () {
|
||||
renderPagination($('#emp-pagination'), data, loadEmployees);
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- 产品品类弹窗(按企业查看产品品类,分页) ---------- */
|
||||
var prodCompanyId = 0;
|
||||
|
||||
window.viewProducts = function (companyId) {
|
||||
prodCompanyId = companyId;
|
||||
var content =
|
||||
'<div style="padding:14px 18px 6px;overflow:hidden;height:330px;">' +
|
||||
' <div class="table-wrap"><table class="grid" style="font-size:13px;">' +
|
||||
' <thead><tr><th>品类名称</th><th>品类描述</th><th>是否核心</th><th>状态</th></tr></thead>' +
|
||||
' <tbody id="prod-tbody"></tbody>' +
|
||||
' </table></div>' +
|
||||
' <div class="pagination" id="prod-pagination"></div>' +
|
||||
'</div>';
|
||||
Dialog.open({ title: '产品品类', area: ['720px', 'auto'], content: content, btn: ['关闭'] });
|
||||
loadProducts(1);
|
||||
};
|
||||
|
||||
function loadProducts(page) {
|
||||
httpGet('company/products.php', { company_id: prodCompanyId, page: page, limit: 5 }).then(function (data) {
|
||||
var rows = data.list || [];
|
||||
var html = '';
|
||||
rows.forEach(function (r) {
|
||||
html += '<tr>' +
|
||||
'<td>' + escHtml(r.category_name) + '</td>' +
|
||||
'<td>' + escHtml(r.category_description || '-') + '</td>' +
|
||||
'<td>' + (r.is_core ? '<span class="tag">核心</span>' : '-') + '</td>' +
|
||||
'<td>' + (r.is_active ? '<span class="tag tag-green">在产</span>' : '<span class="tag tag-gray">停产</span>') + '</td>' +
|
||||
'</tr>';
|
||||
});
|
||||
if (!rows.length) {
|
||||
html = '<tr><td colspan="4" class="empty-tip" style="padding:30px 0;">暂无产品品类</td></tr>';
|
||||
}
|
||||
$('#prod-tbody').html(html);
|
||||
renderPagination($('#prod-pagination'), data, loadProducts);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user