login画面追加
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script src="js/auth.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>給与管理 - 給与設定</title>
|
||||
<link rel="stylesheet" href="/css/style.css" />
|
||||
@@ -213,7 +214,7 @@
|
||||
async function loadEmployees() {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${API_BASE}/payroll/employees/?is_active=true`
|
||||
`${API_BASE}/payroll/employees/?is_active=true`,
|
||||
);
|
||||
employees = await response.json();
|
||||
|
||||
@@ -223,7 +224,7 @@
|
||||
employees
|
||||
.map(
|
||||
(emp) =>
|
||||
`<option value="${emp.employee_id}">${emp.employee_code} - ${emp.name}</option>`
|
||||
`<option value="${emp.employee_id}">${emp.employee_code} - ${emp.name}</option>`,
|
||||
)
|
||||
.join("");
|
||||
|
||||
@@ -241,7 +242,7 @@
|
||||
for (const emp of employees) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${API_BASE}/payroll/settings/salary/${emp.employee_id}/current`
|
||||
`${API_BASE}/payroll/settings/salary/${emp.employee_id}/current`,
|
||||
);
|
||||
if (response.ok) {
|
||||
const setting = await response.json();
|
||||
@@ -255,7 +256,7 @@
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`従業員 ${emp.employee_id} の給与設定取得失敗`,
|
||||
error
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -316,7 +317,7 @@
|
||||
})" style="padding: 5px 10px; font-size: 12px;">編集</button>
|
||||
</td>
|
||||
</tr>
|
||||
`
|
||||
`,
|
||||
)
|
||||
.join("")
|
||||
: '<tr><td colspan="11" style="text-align:center;">給与設定が登録されていません</td></tr>'
|
||||
@@ -334,7 +335,7 @@
|
||||
// 全従業員の設定を取得して該当するものを探す
|
||||
for (const emp of employees) {
|
||||
const response = await fetch(
|
||||
`${API_BASE}/payroll/settings/salary/${emp.employee_id}`
|
||||
`${API_BASE}/payroll/settings/salary/${emp.employee_id}`,
|
||||
);
|
||||
const settings = await response.json();
|
||||
const setting = settings.find((s) => s.setting_id === settingId);
|
||||
@@ -408,7 +409,7 @@
|
||||
commute_allowance: parseFloat(formData.get("commute_allowance")) || 0,
|
||||
other_allowance: parseFloat(formData.get("other_allowance")) || 0,
|
||||
employment_insurance_eligible: document.getElementById(
|
||||
"employment_insurance_eligible"
|
||||
"employment_insurance_eligible",
|
||||
).checked,
|
||||
valid_from: formData.get("valid_from"),
|
||||
};
|
||||
@@ -431,7 +432,7 @@
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(data),
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
// 新規追加
|
||||
@@ -444,7 +445,7 @@
|
||||
|
||||
if (response.ok) {
|
||||
alert(
|
||||
settingId ? "給与設定を更新しました" : "給与設定を保存しました"
|
||||
settingId ? "給与設定を更新しました" : "給与設定を保存しました",
|
||||
);
|
||||
hideAddForm();
|
||||
loadAllSalarySettings();
|
||||
|
||||
Reference in New Issue
Block a user