サービスレポート・出張経費精算入力の修正
This commit is contained in:
@@ -75,7 +75,8 @@
|
||||
|
||||
// システムコントロールの「サービス」と section に設定された組織と一致するか、
|
||||
// およびログインユーザーが「勤怠強制連携担当者」に設定されたユーザーするかを取得
|
||||
return getSystemControlRecord().then(function (systemRecord) {
|
||||
var detailUserCode = record.engineer_mechanic.value.length > 0 ? record.engineer_mechanic.value[0].code : "";
|
||||
return getSystemControlRecord(detailUserCode).then(function (systemRecord) {
|
||||
isSectionService = false;
|
||||
if (
|
||||
systemRecord != null &&
|
||||
@@ -143,7 +144,8 @@
|
||||
// 管理者かどうかを取得
|
||||
isAdmin = groupCodes.indexOf(adminGroupCode) !== -1;
|
||||
|
||||
return getSystemControlRecord().then(function (systemRecord) {
|
||||
var editUserCode = record.engineer_mechanic.value.length > 0 ? record.engineer_mechanic.value[0].code : "";
|
||||
return getSystemControlRecord(editUserCode).then(function (systemRecord) {
|
||||
if (systemRecord != null) {
|
||||
// サービスレポート承認者グループに所属するユーザーかどうかを取得
|
||||
const serviceReportAuthorizerCodes =
|
||||
@@ -987,16 +989,44 @@
|
||||
|
||||
/**
|
||||
* システムコントロールのレコードを取得します。
|
||||
* @param {string} userCode - ユーザーコード(engineer_mechanic.コード)
|
||||
* @returns {Promise<kintone.AppRecord__システムコントロール | null>}
|
||||
*/
|
||||
function getSystemControlRecord() {
|
||||
function getSystemControlRecord(userCode) {
|
||||
// ステップ1: SIGNATURE_MASTERアプリからユーザーの勤務パターンNOを取得
|
||||
return new KintoneRestAPIClient().record
|
||||
.getRecords({
|
||||
app: pvc.env.app.システムコントロール.appId,
|
||||
query: "limit 1",
|
||||
app: pvc.env.app.SIGNATURE_MASTER.appId,
|
||||
query: pvc.util.kintone.makeQuery("担当者 in ((@担当者))", {
|
||||
担当者: userCode,
|
||||
}),
|
||||
fields: ["$id", "担当者", "勤務パターンNO"],
|
||||
})
|
||||
.then(function (resp) {
|
||||
return resp.records.length > 0 ? resp.records[0] : null;
|
||||
// ステップ2: 勤務パターンNOを取得、不存在または未設定の場合は"1"とする
|
||||
var patternNo = "1";
|
||||
if (resp.records.length > 0) {
|
||||
var signatureRecord = resp.records[0];
|
||||
if (
|
||||
signatureRecord.勤務パターンNO != null &&
|
||||
signatureRecord.勤務パターンNO.value != null &&
|
||||
signatureRecord.勤務パターンNO.value !== ""
|
||||
) {
|
||||
patternNo = signatureRecord.勤務パターンNO.value;
|
||||
}
|
||||
}
|
||||
|
||||
// ステップ3: システムコントロールからパターンNO等于勤務パターンNO的记录を取得
|
||||
return new KintoneRestAPIClient().record
|
||||
.getRecords({
|
||||
app: pvc.env.app.システムコントロール.appId,
|
||||
query: pvc.util.kintone.makeQuery("パターンNO in ((@パターンNO))", {
|
||||
パターンNO: patternNo,
|
||||
}),
|
||||
})
|
||||
.then(function (systemResp) {
|
||||
return systemResp.records.length > 0 ? systemResp.records[0] : null;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2462,7 +2492,7 @@
|
||||
* @param {kintone.AppRecord__サービスレポート_出張経費精算入力} record
|
||||
*/
|
||||
function setLimitSagyouJikanJououTableRows(record) {
|
||||
const maxRowNum = 7;
|
||||
const maxRowNum = 20;
|
||||
const sagyouTableClass = "pvc-desktop-main__sagyouJikanJouhouTable";
|
||||
let sagyouTable = document.querySelector("." + sagyouTableClass);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user