|
|
|
@@ -30,6 +30,15 @@ const 各種申請完了 = (record: 各種申請) => { |
|
|
|
}), |
|
|
|
}); |
|
|
|
}; |
|
|
|
const 各種申請処理中 = (record: 各種申請) => { |
|
|
|
return client.record.updateRecord({ |
|
|
|
app: AppID.各種申請, |
|
|
|
id: record.$id.value, |
|
|
|
record: makeRecordData({ |
|
|
|
[各種申請フィールド名.状況]: 状況Dropdown.処理中, |
|
|
|
}), |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
const 口座変更申請承認 = async (record: 各種申請) => { |
|
|
|
const customer = await get顧客マスタ({ |
|
|
|
@@ -70,7 +79,7 @@ const getCallBack口座変更申請承認 = (record: 各種申請) => { |
|
|
|
|
|
|
|
try { |
|
|
|
await showLoadingDialog(); |
|
|
|
口座変更申請承認(record); |
|
|
|
await 口座変更申請承認(record); |
|
|
|
} catch (e) { |
|
|
|
console.error(e); |
|
|
|
ErrorDialog.fire(); |
|
|
|
@@ -100,7 +109,9 @@ const 解約申請承認 = async (record: 各種申請) => { |
|
|
|
const email = await sendEmail(EmailID.解約承認, { |
|
|
|
application_no: record.申請番号.value, |
|
|
|
}); |
|
|
|
console.log("メール", email); |
|
|
|
if (!email) { |
|
|
|
throw new Error("メール送信失敗"); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const getCallBack解約申請承認 = (record: 各種申請) => { |
|
|
|
@@ -112,7 +123,111 @@ const getCallBack解約申請承認 = (record: 各種申請) => { |
|
|
|
|
|
|
|
try { |
|
|
|
await showLoadingDialog(); |
|
|
|
解約申請承認(record); |
|
|
|
await 解約申請承認(record); |
|
|
|
} catch (e) { |
|
|
|
console.error(e); |
|
|
|
ErrorDialog.fire(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
SuccessDialog.fire().then(() => { |
|
|
|
location.reload(); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
const 利用者情報変更申請承認 = async (record: 各種申請) => { |
|
|
|
// 顧客マスタへの反映 |
|
|
|
const customer = await get顧客マスタ({ |
|
|
|
顧客コード: Number(record.顧客コード.value), |
|
|
|
}); |
|
|
|
|
|
|
|
await client.record.updateRecord({ |
|
|
|
app: AppID.顧客マスタ, |
|
|
|
id: customer.$id.value, |
|
|
|
record: makeRecordData({ |
|
|
|
[顧客マスタフィールド名.顧客名]: |
|
|
|
record.利用者情報変更申請_変更後_氏名.value ?? "", |
|
|
|
[顧客マスタフィールド名.顧客名カナ]: |
|
|
|
record.利用者情報変更申請_変更後_氏名カナ.value ?? "", |
|
|
|
[顧客マスタフィールド名.契約者_郵便番号]: |
|
|
|
record.利用者情報変更申請_変更後_郵便番号.value ?? "", |
|
|
|
[顧客マスタフィールド名.住所]: |
|
|
|
record.利用者情報変更申請_変更後_住所.value ?? "", |
|
|
|
[顧客マスタフィールド名.電話番号]: |
|
|
|
record.利用者情報変更申請_変更後_電話番号.value ?? "", |
|
|
|
}), |
|
|
|
}); |
|
|
|
|
|
|
|
// 申請の完了 |
|
|
|
await 各種申請完了(record); |
|
|
|
|
|
|
|
// メールの送信 |
|
|
|
const email = await sendEmail(EmailID.利用者情報変更完了, { |
|
|
|
application_no: record.申請番号.value, |
|
|
|
}); |
|
|
|
if (!email) { |
|
|
|
throw new Error("メール送信失敗"); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const getCallBack利用者情報変更申請承認 = (record: 各種申請) => { |
|
|
|
return async () => { |
|
|
|
const confirm = await ConfirmDialog.fire({ |
|
|
|
title: "承認しますか", |
|
|
|
}); |
|
|
|
if (!confirm.isConfirmed) return; |
|
|
|
|
|
|
|
try { |
|
|
|
await showLoadingDialog(); |
|
|
|
await 利用者情報変更申請承認(record); |
|
|
|
} catch (e) { |
|
|
|
console.error(e); |
|
|
|
ErrorDialog.fire(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
SuccessDialog.fire().then(() => { |
|
|
|
location.reload(); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
const 車両番号_防犯登録番号変更申請承認 = async (record: 各種申請) => { |
|
|
|
// 車室契約情報アプリへの反映 |
|
|
|
const F = 車室契約情報フィールド名; |
|
|
|
await client.record.updateRecord({ |
|
|
|
app: AppID.車室契約情報, |
|
|
|
id: record.$id.value, |
|
|
|
record: makeRecordData({ |
|
|
|
[F.車両番号]: |
|
|
|
record.車両番号_防犯番号変更申請_変更後_車両番号.value ?? "", |
|
|
|
[F.防犯登録番号]: |
|
|
|
record.車両番号_防犯番号変更申請_変更後_防犯登録番号.value ?? "", |
|
|
|
}), |
|
|
|
}); |
|
|
|
|
|
|
|
// 申請の完了 |
|
|
|
await 各種申請完了(record); |
|
|
|
|
|
|
|
// メールの送信 |
|
|
|
const email = await sendEmail(EmailID.車両番号_防犯登録番号変更完了, { |
|
|
|
application_no: record.申請番号.value, |
|
|
|
}); |
|
|
|
if (!email) { |
|
|
|
throw new Error("メール送信失敗"); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const getCallBack車両番号_防犯登録番号変更申請承認 = (record: 各種申請) => { |
|
|
|
return async () => { |
|
|
|
const confirm = await ConfirmDialog.fire({ |
|
|
|
title: "承認しますか", |
|
|
|
}); |
|
|
|
if (!confirm.isConfirmed) return; |
|
|
|
|
|
|
|
try { |
|
|
|
await showLoadingDialog(); |
|
|
|
await 車両番号_防犯登録番号変更申請承認(record); |
|
|
|
} catch (e) { |
|
|
|
console.error(e); |
|
|
|
ErrorDialog.fire(); |
|
|
|
@@ -147,5 +262,24 @@ const getCallBack解約申請承認 = (record: 各種申請) => { |
|
|
|
) { |
|
|
|
setHeaderButton("解約申請 承認", getCallBack解約申請承認(currentRecord)); |
|
|
|
} |
|
|
|
if ( |
|
|
|
currentRecord.状況.value !== 状況Dropdown.完了 && |
|
|
|
currentRecord.申請種別.value === 申請種別Dropdown.利用者情報変更 |
|
|
|
) { |
|
|
|
setHeaderButton( |
|
|
|
"利用者情報変更申請 承認", |
|
|
|
getCallBack利用者情報変更申請承認(currentRecord) |
|
|
|
); |
|
|
|
} |
|
|
|
if ( |
|
|
|
currentRecord.状況.value !== 状況Dropdown.完了 && |
|
|
|
currentRecord.申請種別.value === |
|
|
|
申請種別Dropdown.車両番号_防犯登録番号変更 |
|
|
|
) { |
|
|
|
setHeaderButton( |
|
|
|
"車両番号・防犯登録番号変更申請 承認", |
|
|
|
getCallBack車両番号_防犯登録番号変更申請承認(currentRecord) |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
})(); |