Fix 伝達事項
This commit is contained in:
BIN
document/①仕様書_園児別出欠簿入力_20250408.xlsx
Normal file
BIN
document/①仕様書_園児別出欠簿入力_20250408.xlsx
Normal file
Binary file not shown.
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
// ------------------- 詳細画面表示時の処理 -------------------
|
// ------------------- 詳細画面表示時の処理 -------------------
|
||||||
kintone.events.on('app.record.detail.show', function (event) {
|
kintone.events.on('app.record.detail.show', function (event) {
|
||||||
|
// 「登園/帰園」ボタン
|
||||||
const area = kintone.app.record.getSpaceElement('header-clocking-btn-area');
|
const area = kintone.app.record.getSpaceElement('header-clocking-btn-area');
|
||||||
|
|
||||||
const clockIn = createBtn('clock-in', '登園', dateToFieldInDetail('登園時刻'));
|
const clockIn = createBtn('clock-in', '登園', dateToFieldInDetail('登園時刻'));
|
||||||
@@ -12,9 +13,19 @@
|
|||||||
area.appendChild(clockOut);
|
area.appendChild(clockOut);
|
||||||
|
|
||||||
hideSpaceField(['clock-in-btn-area', 'clock-out-btn-area']);
|
hideSpaceField(['clock-in-btn-area', 'clock-out-btn-area']);
|
||||||
|
|
||||||
|
// 「伝達事項」
|
||||||
|
if (!isBaby(event.record['学年'].value)) {
|
||||||
|
kintone.app.record.setFieldShown('伝達事項', false);
|
||||||
|
}
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function isBaby(grade) {
|
||||||
|
return grade === "0歳児" || grade === "1歳児";
|
||||||
|
}
|
||||||
|
|
||||||
function dateToFieldInDetail(fieldCode) {
|
function dateToFieldInDetail(fieldCode) {
|
||||||
return async function (e) {
|
return async function (e) {
|
||||||
await new KintoneRestAPIClient().record.updateRecord({
|
await new KintoneRestAPIClient().record.updateRecord({
|
||||||
@@ -32,16 +43,28 @@
|
|||||||
|
|
||||||
// ------------------- 印刷画面表示時の処理 -------------------
|
// ------------------- 印刷画面表示時の処理 -------------------
|
||||||
kintone.events.on('app.record.print.show', (event) => {
|
kintone.events.on('app.record.print.show', (event) => {
|
||||||
|
// 「登園/帰園」ボタン
|
||||||
hideSpaceField(['clock-in-btn-area', 'clock-out-btn-area']);
|
hideSpaceField(['clock-in-btn-area', 'clock-out-btn-area']);
|
||||||
|
|
||||||
|
// 「伝達事項」
|
||||||
|
if (!isBaby(event.record['学年'].value)) {
|
||||||
|
kintone.app.record.setFieldShown('伝達事項', false);
|
||||||
|
}
|
||||||
return event;
|
return event;
|
||||||
});
|
});
|
||||||
|
|
||||||
// ------------------- 編集画面表示時の処理 -------------------
|
// ------------------- 編集画面表示時の処理 -------------------
|
||||||
kintone.events.on(['app.record.create.show', 'app.record.edit.show'], function (event) {
|
kintone.events.on(['app.record.create.show', 'app.record.edit.show'], function (event) {
|
||||||
|
// 「登園/帰園」ボタン
|
||||||
const clockIn = createBtn('clock-in', '登園', dateToFieldInEdit('登園時刻'));
|
const clockIn = createBtn('clock-in', '登園', dateToFieldInEdit('登園時刻'));
|
||||||
kintone.app.record.getSpaceElement('clock-in-btn-area').appendChild(clockIn);
|
kintone.app.record.getSpaceElement('clock-in-btn-area').appendChild(clockIn);
|
||||||
const clockOut = createBtn('clock-out', '帰園', dateToFieldInEdit('帰園時刻'));
|
const clockOut = createBtn('clock-out', '帰園', dateToFieldInEdit('帰園時刻'));
|
||||||
kintone.app.record.getSpaceElement('clock-out-btn-area').appendChild(clockOut);
|
kintone.app.record.getSpaceElement('clock-out-btn-area').appendChild(clockOut);
|
||||||
|
|
||||||
|
// 「伝達事項」
|
||||||
|
if (!isBaby(event.record['学年'].value)) {
|
||||||
|
kintone.app.record.setFieldShown('伝達事項', false);
|
||||||
|
}
|
||||||
return event;
|
return event;
|
||||||
});
|
});
|
||||||
|
|
||||||
Reference in New Issue
Block a user