diff --git a/index.html b/index.html
index 58fdaeb..737ab3d 100644
--- a/index.html
+++ b/index.html
@@ -6,6 +6,13 @@
那都AI寫的,不要問我 - HR 基礎資料維護系統
+
+
+
+
+
+
+
-
+
@@ -1262,8 +579,50 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1412,19 +771,44 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2135,7 +1519,7 @@
? `\n\n已填寫的資料(請參考這些內容來生成相關的資料):\n${JSON.stringify(existingData, null, 2)}`
: '';
- const prompt = `請為HR崗位管理系統生成崗位基礎資料。請用繁體中文回覆。
+ const prompt = `你是專業人資顧問,熟悉半導體製造業的人資所有流程。請生成崗位基礎資料。請用繁體中文回覆。
${contextInfo}
請「只生成」以下這些尚未填寫的欄位:${emptyFields.join(', ')}
@@ -2147,8 +1531,8 @@ ${contextInfo}
- positionNature: 崗位性質代碼(FT=全職, PT=兼職, CT=約聘, IN=實習)
- headcount: 編制人數(1-10之間的數字字串)
- positionLevel: 崗位級別(L1到L7)
-- positionDesc: 崗位描述(2-3句話描述工作內容)
-- positionRemark: 崗位備注(可選的補充說明)
+- positionDesc: 崗位描述(條列式,用換行分隔))
+- positionRemark: 崗位備注(條列式,用換行分隔)
請直接返回JSON格式,只包含需要生成的欄位,不要有任何其他文字:
{
@@ -2205,7 +1589,7 @@ ${contextInfo}
if (value) existingData[field] = value;
});
- const prompt = `請為HR崗位管理系統生成「${positionName}」的招聘要求資料。請用繁體中文回覆。
+ const prompt = `請生成「${positionName}」的招聘要求資料。請用繁體中文回覆。
已填寫的資料(請參考這些內容來生成相關的資料):
${JSON.stringify(existingData, null, 2)}
@@ -2224,9 +1608,9 @@ ${JSON.stringify(existingData, null, 2)}
- jobTitle: 職位名稱
- jobDesc: 職位描述(2-3句話)
- positionReq: 崗位要求(條列式,用換行分隔)
-- skillReq: 技能要求(用逗號分隔)
-- langReq: 語言要求
-- otherReq: 其他要求
+- skillReq: 技能要求(條列式,用換行分隔)
+- langReq: 語言要求(條列式,用換行分隔)
+- otherReq: 其他要求(條列式,用換行分隔)
請直接返回JSON格式,只包含需要生成的欄位:
{
@@ -2292,7 +1676,7 @@ ${JSON.stringify(existingData, null, 2)}
fieldsToGenerate.push('hasAttendanceBonus', 'hasHousingAllowance');
}
- const prompt = `請為HR職務管理系統生成職務基礎資料。請用繁體中文回覆。
+ const prompt = `你是專業人資顧問,熟悉半導體製造業的人資所有流程。請生成職務基礎資料。請用繁體中文回覆。
${contextInfo}
請「只生成」以下這些尚未填寫的欄位:${fieldsToGenerate.join(', ')}
@@ -2394,7 +1778,7 @@ ${contextInfo}
const fieldsToGenerate = emptyFields.map(f => f.replace('jd_', ''));
- const prompt = `請為HR崗位描述管理系統生成崗位描述資料。請用繁體中文回覆。
+ const prompt = `請生成崗位描述資料。請用繁體中文回覆。
${contextInfo}
請「只生成」以下這些尚未填寫的欄位:${fieldsToGenerate.join(', ')}
@@ -2413,11 +1797,11 @@ ${contextInfo}
- empAttribute: 員工屬性代碼(FT=正式員工, CT=約聘, PT=兼職, IN=實習, DP=派遣)
- positionPurpose: 崗位設置目的(1句話說明)
- mainResponsibilities: 主要崗位職責(用「1、」「2、」「3、」「4、」「5、」格式,每項換行,用\\n分隔)
-- education: 教育程度要求
-- basicSkills: 基本技能要求
-- professionalKnowledge: 專業知識要求
-- workExperienceReq: 工作經驗要求
-- otherRequirements: 其他要求
+- education: 教育程度要求(條列式,用換行分隔)
+- basicSkills: 基本技能要求(條列式,用換行分隔)
+- professionalKnowledge: 專業知識要求(條列式,用換行分隔)
+- workExperienceReq: 工作經驗要求(條列式,用換行分隔)
+- otherRequirements: 其他要求(條列式,用換行分隔)
請直接返回JSON格式,只包含需要生成的欄位:
{
@@ -3730,7 +3114,7 @@ ${contextInfo}
? `\n\n已填寫的資料(請參考這些內容來生成相關的資料):\n${JSON.stringify(existingData, null, 2)}`
: '';
- const prompt = `請為HR部門職責管理系統生成部門職責資料。請用繁體中文回覆。
+ const prompt = `你是專業人資顧問,熟悉半導體製造業的人資所有流程。請生成部門職責資料。請用繁體中文回覆。
${contextInfo}
請「只生成」以下這些尚未填寫的欄位:${emptyFields.join(', ')}
@@ -3952,7 +3336,7 @@ ${contextInfo}
// ==================== 初始化下拉選單 ====================
function initializeDropdowns() {
- // 初始化事業體下拉選單
+ // 初始化崗位基礎資料維護的事業體下拉選單
const businessUnitSelect = document.getElementById('businessUnit');
if (businessUnitSelect) {
businessUnitSelect.innerHTML = '';
@@ -3967,7 +3351,7 @@ ${contextInfo}
businessUnitSelect.addEventListener('change', onBusinessUnitChange);
}
- // 初始化處級單位下拉選單(預設為空,等待事業體選擇)
+ // 初始化崗位基礎資料維護的處級單位下拉選單(預設為空,等待事業體選擇)
const divisionSelect = document.getElementById('division');
if (divisionSelect) {
divisionSelect.innerHTML = '';
@@ -3975,11 +3359,35 @@ ${contextInfo}
divisionSelect.addEventListener('change', onDivisionChange);
}
- // 初始化部級單位下拉選單(預設為空,等待處級單位選擇)
+ // 初始化崗位基礎資料維護的部級單位下拉選單(預設為空,等待處級單位選擇)
const departmentSelect = document.getElementById('department');
if (departmentSelect) {
departmentSelect.innerHTML = '';
}
+
+ // ========== 初始化崗位描述模組的下拉選單 ==========
+ const jdBusinessUnitSelect = document.getElementById('jd_businessUnit');
+ if (jdBusinessUnitSelect) {
+ jdBusinessUnitSelect.innerHTML = '';
+ businessUnits.forEach(unit => {
+ const option = document.createElement('option');
+ option.value = unit;
+ option.textContent = unit;
+ jdBusinessUnitSelect.appendChild(option);
+ });
+ }
+
+ // ========== 初始化部門職責維護模組的下拉選單 ==========
+ const deptFuncBusinessUnitSelect = document.getElementById('deptFunc_businessUnit');
+ if (deptFuncBusinessUnitSelect) {
+ deptFuncBusinessUnitSelect.innerHTML = '';
+ businessUnits.forEach(unit => {
+ const option = document.createElement('option');
+ option.value = unit;
+ option.textContent = unit;
+ deptFuncBusinessUnitSelect.appendChild(option);
+ });
+ }
}
// ==================== 下拉選單連動函數 ====================
@@ -4029,6 +3437,148 @@ ${contextInfo}
}
}
+ // ==================== 崗位描述模組的階層式下拉選單 ====================
+
+ function onJobDescBusinessUnitChange(event) {
+ /**
+ * 當崗位描述的事業體改變時,更新處級單位選單
+ */
+ const selectedBusiness = event.target.value;
+ const divisionSelect = document.getElementById('jd_division');
+ const departmentSelect = document.getElementById('jd_department');
+ const positionSelect = document.getElementById('jd_positionTitle');
+
+ // 重置下層選單
+ divisionSelect.innerHTML = '';
+ departmentSelect.innerHTML = '';
+ positionSelect.innerHTML = '';
+
+ if (selectedBusiness && businessToDivision[selectedBusiness]) {
+ const divisions = businessToDivision[selectedBusiness];
+ divisions.forEach(division => {
+ const option = document.createElement('option');
+ option.value = division;
+ option.textContent = division;
+ divisionSelect.appendChild(option);
+ });
+ }
+ }
+
+ function onJobDescDivisionChange(event) {
+ /**
+ * 當崗位描述的處級單位改變時,更新部級單位選單
+ */
+ const selectedDivision = event.target.value;
+ const departmentSelect = document.getElementById('jd_department');
+ const positionSelect = document.getElementById('jd_positionTitle');
+
+ // 重置下層選單
+ departmentSelect.innerHTML = '';
+ positionSelect.innerHTML = '';
+
+ if (selectedDivision && divisionToDepartment[selectedDivision]) {
+ const departments = divisionToDepartment[selectedDivision];
+ departments.forEach(department => {
+ const option = document.createElement('option');
+ option.value = department;
+ option.textContent = department;
+ departmentSelect.appendChild(option);
+ });
+ }
+ }
+
+ function onJobDescDepartmentChange(event) {
+ /**
+ * 當崗位描述的部級單位改變時,更新崗位名稱選單
+ */
+ const selectedDepartment = event.target.value;
+ const positionSelect = document.getElementById('jd_positionTitle');
+
+ // 重置崗位選單
+ positionSelect.innerHTML = '';
+
+ if (selectedDepartment && departmentToPosition[selectedDepartment]) {
+ const positions = departmentToPosition[selectedDepartment];
+ positions.forEach(position => {
+ const option = document.createElement('option');
+ option.value = position;
+ option.textContent = position;
+ positionSelect.appendChild(option);
+ });
+ }
+ }
+
+ // ==================== 部門職責維護模組的階層式下拉選單 ====================
+
+ function onDeptFuncBusinessUnitChange(event) {
+ /**
+ * 當部門職責的事業體改變時,更新處級單位選單
+ */
+ const selectedBusiness = event.target.value;
+ const divisionSelect = document.getElementById('deptFunc_division');
+ const departmentSelect = document.getElementById('deptFunc_department');
+ const positionSelect = document.getElementById('deptFunc_positionTitle');
+
+ // 重置下層選單
+ divisionSelect.innerHTML = '';
+ departmentSelect.innerHTML = '';
+ positionSelect.innerHTML = '';
+
+ if (selectedBusiness && businessToDivision[selectedBusiness]) {
+ const divisions = businessToDivision[selectedBusiness];
+ divisions.forEach(division => {
+ const option = document.createElement('option');
+ option.value = division;
+ option.textContent = division;
+ divisionSelect.appendChild(option);
+ });
+ }
+ }
+
+ function onDeptFuncDivisionChange(event) {
+ /**
+ * 當部門職責的處級單位改變時,更新部級單位選單
+ */
+ const selectedDivision = event.target.value;
+ const departmentSelect = document.getElementById('deptFunc_department');
+ const positionSelect = document.getElementById('deptFunc_positionTitle');
+
+ // 重置下層選單
+ departmentSelect.innerHTML = '';
+ positionSelect.innerHTML = '';
+
+ if (selectedDivision && divisionToDepartment[selectedDivision]) {
+ const departments = divisionToDepartment[selectedDivision];
+ departments.forEach(department => {
+ const option = document.createElement('option');
+ option.value = department;
+ option.textContent = department;
+ departmentSelect.appendChild(option);
+ });
+ }
+ }
+
+ function onDeptFuncDepartmentChange(event) {
+ /**
+ * 當部門職責的部級單位改變時,更新崗位名稱選單
+ */
+ const selectedDepartment = event.target.value;
+ const positionSelect = document.getElementById('deptFunc_positionTitle');
+
+ // 重置崗位選單
+ positionSelect.innerHTML = '';
+
+ if (selectedDepartment && departmentToPosition[selectedDepartment]) {
+ const positions = departmentToPosition[selectedDepartment];
+ positions.forEach(position => {
+ const option = document.createElement('option');
+ option.value = position;
+ option.textContent = position;
+ positionSelect.appendChild(option);
+ });
+ }
+ }
+
// ==================== 用戶信息與登出功能 ====================
function loadUserInfo() {