fix app flow

This commit is contained in:
2025-02-17 21:18:24 +08:00
parent 708909928c
commit 253bdabb97
5 changed files with 42 additions and 36 deletions

View File

@@ -507,13 +507,13 @@ const statusFieldMap = {
'園長確認中': '主幹',
'完了': '園長'
}
function getUpdateFieldByNextFlow(nextStatus) {
return statusFieldMap[nextStatus];
}
function addApproveFlowAction() {
return kintone.events.on("app.record.detail.process.proceed", (event) => {
event.record[getUpdateFieldByNextFlow(event.nextStatus.value)].value = kintone.getLoginUser().name;
const field = statusFieldMap[event.nextStatus.value];
if (field) {
event.record[field].value = kintone.getLoginUser().name;
}
return event;
});
}

View File

@@ -1,17 +1,18 @@
(function () {
"use strict";
kintone.events.on("app.record.detail.process.proceed", (event) => {
event.record[getUpdateFieldByNextFlow(event.nextStatus.value)].value = kintone.getLoginUser().name;
return event;
});
const statusFieldMap = {
'主幹確認中': '指導',
'園長確認中': '主幹',
'完了': '園長'
}
function getUpdateFieldByNextFlow(nextStatus) {
return statusFieldMap[nextStatus];
kintone.events.on("app.record.detail.process.proceed", (event) => {
const field = statusFieldMap[event.nextStatus.value];
if (field) {
event.record[field].value = kintone.getLoginUser().name;
}
return event;
});
})();

View File

@@ -1,11 +1,6 @@
(function () {
"use strict";
kintone.events.on("app.record.detail.process.proceed", (event) => {
event.record[getUpdateFieldByNextFlow(event.nextStatus.value)].value = kintone.getLoginUser().name;
return event;
});
const statusFieldMap = {
'主幹確認中4週目': '指導',
'園長確認中4週目': '主幹',
@@ -15,7 +10,13 @@
'園長確認中5週目': '主幹',
'完了5週目': '園長',
}
function getUpdateFieldByNextFlow(nextStatus) {
return statusFieldMap[nextStatus];
kintone.events.on("app.record.detail.process.proceed", (event) => {
const field = statusFieldMap[event.nextStatus.value];
if (field) {
event.record[field].value = kintone.getLoginUser().name;
}
return event;
});
})();

View File

@@ -1,18 +1,19 @@
(function () {
"use strict";
kintone.events.on("app.record.detail.process.proceed", (event) => {
event.record[getUpdateFieldByNextFlow(event.nextStatus.value)].value = kintone.getLoginUser().name;
return event;
});
const statusFieldMap = {
'指導教諭確認中': '担任',
'主幹確認中': '指導',
'園長確認中': '主幹',
'完了': '園長'
}
function getUpdateFieldByNextFlow(nextStatus) {
return statusFieldMap[nextStatus];
kintone.events.on("app.record.detail.process.proceed", (event) => {
const field = statusFieldMap[event.nextStatus.value];
if (field) {
event.record[field].value = kintone.getLoginUser().name;
}
return event;
});
})();

View File

@@ -1,23 +1,26 @@
(function () {
"use strict";
kintone.events.on("app.record.detail.process.proceed", (event) => {
event.record[getUpdateFieldByNextFlow(event.nextStatus.value)].value = kintone.getLoginUser().name;
return event;
});
const statusFieldMap = {
'主幹確認中1学期': '指導1',
'園長確認中1学期': '主幹1',
'完了1学期': '園長1',
'担任作成中2学期': '園長1',
'主幹確認中2学期': '指導2',
'園長確認中2学期': '主幹2',
'完了2学期': '園長2',
'担任作成中3学期': '園長2',
'主幹確認中3学期': '指導3',
'園長確認中3学期': '主幹3',
'完了3学期': '園長3',
}
function getUpdateFieldByNextFlow(nextStatus) {
return statusFieldMap[nextStatus];
kintone.events.on("app.record.detail.process.proceed", (event) => {
const field = statusFieldMap[event.nextStatus.value];
if (field) {
event.record[field].value = kintone.getLoginUser().name;
}
return event;
});
})();