55 lines
2.5 KiB
HTML
55 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>订单变更与插单 - 智能排产系统</title>
|
|
<link rel="stylesheet" href="../css/common.css">
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<header class="header" id="header"></header>
|
|
<div class="body">
|
|
<aside class="sidebar" id="sidebar"></aside>
|
|
<main class="main">
|
|
<h1 class="page-title">订单变更与插单</h1>
|
|
<div class="tabs">
|
|
<div class="tab active" onclick="switchTab(this,'changes')">变更记录</div>
|
|
<div class="tab" onclick="switchTab(this,'rush')">插单记录</div>
|
|
</div>
|
|
<div class="card">
|
|
<div class="card-body table-wrap">
|
|
<table id="changeTable">
|
|
<thead><tr><th>时间</th><th>订单号</th><th>客户</th><th>变更类型</th><th>原值</th><th>新值</th><th>原因</th><th>操作人</th></tr></thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
</div>
|
|
<script src="../js/data.js"></script>
|
|
<script src="../js/common.js"></script>
|
|
<script>
|
|
initPage('order-change');
|
|
let tab = 'changes';
|
|
function switchTab(el, t) { $$('.tab').forEach(x => x.classList.remove('active')); el.classList.add('active'); tab = t; render(); }
|
|
function render() {
|
|
const tbody = document.querySelector('#changeTable tbody');
|
|
let all = [];
|
|
if (tab === 'changes') {
|
|
apsData.salesOrders.forEach(o => {
|
|
(o.changes || []).forEach(c => all.push({ ...c, orderNo: o.orderNo, customerName: o.customerName }));
|
|
});
|
|
all.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
|
|
tbody.innerHTML = all.map(c => `<tr><td>${c.createdAt}</td><td>${c.orderNo}</td><td>${c.customerName}</td><td>${c.changeType}</td><td>${c.oldValue}</td><td>${c.newValue}</td><td>${c.reason}</td><td>${c.operator}</td></tr>`).join('') || '<tr><td colspan="8" class="text-center text-muted">无变更记录</td></tr>';
|
|
} else {
|
|
const rush = apsData.salesOrders.filter(o => o.isRush);
|
|
tbody.innerHTML = rush.map(o => `<tr><td>${o.createdAt}</td><td>${o.orderNo}</td><td>${o.customerName}</td><td>RUSH_ORDER</td><td>-</td><td>${o.rushStrategy}</td><td>紧急插单</td><td>${o.createdBy}</td></tr>`).join('') || '<tr><td colspan="8" class="text-center text-muted">无插单记录</td></tr>';
|
|
}
|
|
}
|
|
render();
|
|
</script>
|
|
</body>
|
|
</html>
|