diff --git a/scope-ui.js b/scope-ui.js
index e23b301..b295f44 100644
--- a/scope-ui.js
+++ b/scope-ui.js
@@ -161,6 +161,14 @@
// 區塊:沿用主看板的底色(CODA 藍、發票琥珀、組別綠灰),前後深淺交錯。
const block = (kind, title, body) => `
`;
+
+ // 人員異動:只給姓名和生效月份。不分離職或轉調,也不說轉調去哪,部長只需要知道編制什麼時候變。
+ function changesTable(list) {
+ const rows = list.map(c => `| ${esc(c.name)} | ${c.kind === 'leave' ? '離開本部門' : '加入本部門'} | ${esc(c.month)} |
`).join('');
+ return `
+ 已經排定、HR 還沒更新的異動。上面的數字已經照這些算了。
`;
+ }
+
function deptCard(d, data, simOpen) {
const showCost = d.groups.some(g => typeof g.totalCost === 'number');
const groupsRows = d.groups.map(g => g.missing ? `| ${esc(g.group)} | 目前沒有資料 |
` :
@@ -177,6 +185,7 @@
${kpi(d.multiplier?.company ? `倍率(${esc(d.multiplier.company)}全公司)` : '部門倍率', times(d.multiplier?.value), '部門內部成本(P+A+G,不含外包)÷ A 成本 × 人薪倍率')}
`)}
${d.invoice?.indicators ? block('inv2', '發票佔比怎麼來的', indicatorsBlock(d)) : ''}
+ ${d.changes && d.changes.length ? block('chg', '人員異動', changesTable(d.changes)) : ''}
${block('people', '人力', `
${d.headcount ? kpi('人數', `${d.headcount.total} 人`, headcountText(d.headcount)) : ''}
${typeof d.totalCost === 'number' ? kpi('部門總人力成本(年)', money(d.totalCost), '正職年薪 × 人薪倍率 + 外包 × 外包倍率,不含實習生') : ''}