diff --git a/document/PVC.one b/document/PVC.one index 3fc4009..1cde515 100644 Binary files a/document/PVC.one and b/document/PVC.one differ diff --git a/src/env.js b/src/env.js index d7094b1..ed2a9d0 100644 --- a/src/env.js +++ b/src/env.js @@ -5,8 +5,8 @@ const env = { appId: 19, excelName: "出欠集計表", view: { - '0,1歳日誌データ連携用途': 13352636, - '2歳以上日誌データ連携用途': 13352638, + linkFor0to1: 13352636, + linkForOthers: 13352638, } }, "0,1歳日誌出力用": { diff --git a/src/utils.js b/src/utils.js index 50f1c00..1a5d274 100644 --- a/src/utils.js +++ b/src/utils.js @@ -268,24 +268,24 @@ function showError(show, text) { } } -function showSuccess(show, text) { +function showSuccess(show, text, time = 3000) { if (show) { - buildNotification('success', text); + buildNotification('success', text, time); notificationEl.open(); } else { notificationEl && notificationEl.close(); } } -function buildNotification(type, text) { +function buildNotification(type, text, duration = -1) { + const param = { + type, + text, + duration + } if (!notificationEl) { - notificationEl = new Kuc.Notification({ - type, - text - }); + notificationEl = new Kuc.Notification(param); } else { - notificationEl.close(); - notificationEl.type = type; - notificationEl.text = text; + Object.assign(notificationEl, param) } } \ No newline at end of file diff --git a/src/園児別出欠簿入力/BatchCreateHandler.js b/src/園児別出欠簿入力/BatchCreateHandler.js index 020853b..08cb2b9 100644 --- a/src/園児別出欠簿入力/BatchCreateHandler.js +++ b/src/園児別出欠簿入力/BatchCreateHandler.js @@ -29,6 +29,7 @@ class BatchCreateHandler { // console.log(records); const createResult = await this.createData(api, records, todayString); + showSuccess(true, "出欠簿一括作成完了"); location.reload(); loading(false); } diff --git a/src/園児別出欠簿入力/Link2Handler.js b/src/園児別出欠簿入力/Link2Handler.js index a136dc0..1eefb4c 100644 --- a/src/園児別出欠簿入力/Link2Handler.js +++ b/src/園児別出欠簿入力/Link2Handler.js @@ -44,7 +44,7 @@ class Link2Handler { return await api.record.getAllRecordsWithId({ app: env["園児別出欠簿入力"].appId, fields: ['クラス', "園児名", "園での様子_伝達事項", "評価反省"], - condition: `学年 not in ("0歳児", "1歳児") and 登園日 = "${dateString}"` + condition: `学年 in ("2歳児", "3歳児", "4歳児", "5歳児") and 登園日 = "${dateString}"` }); } catch (e) { showError(true, '園児台帳アプリのデータ読み取りエラー\n - ' + e); @@ -78,13 +78,16 @@ class Link2Handler { condition: `登園日 = "${dateString}"` }) const generatedRecordId = generatedRecords[0]?.$id.value; + const param = { app: env["2歳以上日誌出力用"].appId, record } + let addResult; if (generatedRecordId) { param.id = generatedRecordId; + // 本アプリの当日データでテーブルを上書きし、対応する園児データがない行を【削除】します addResult = await api.record.updateRecord(param); } else { addResult = await api.record.addRecord(param); diff --git a/src/園児別出欠簿入力/main.js b/src/園児別出欠簿入力/main.js index 77798c1..31e32ee 100644 --- a/src/園児別出欠簿入力/main.js +++ b/src/園児別出欠簿入力/main.js @@ -5,12 +5,12 @@ kintone.events.on("app.record.index.show", (event) => { const headerSpace = getHeaderSpace('single-label-line'); - if (event.viewId === APP_ENV.view["0,1歳日誌データ連携用途"]) { + if (event.viewId === APP_ENV.view.linkFor0to1) { Link1Handler.getInstance(headerSpace); return event; } - if (event.viewId === APP_ENV.view["2歳以上日誌データ連携用途"]) { + if (event.viewId === APP_ENV.view.linkForOthers) { Link2Handler.getInstance(headerSpace); return event; }