6666666666
'use strict';
$(function () {
// ページロード時の画面制御
// お客様モード
var $customerMode = $('#customerMode');
if ($customerMode.prop('checked') === true) {
showCustomerMode();
} else {
showNonCustomerMode();
}
// 税法上の居住地国チェックボックス
var $checkTaxCountry3 = $('#CheckTaxCountry3');
if ($checkTaxCountry3.prop('checked') === true) {
$(".tax-country-3").prop('disabled', false);
}
var $checkResidentDiffReason = $('#CheckResidentDiffReason');
if ($checkResidentDiffReason.prop('checked') === true) {
$(".resident-diff-reason").prop('disabled', false);
}
// 委託者-お受取サイクルラジオボタン制御
if ($('input[class="recieveCycleDivChk"]:checked').val() === '4') {
$("#recieveCycleDivOtherwiseText").prop('disabled', false);
}
// 手続代理人-ご関係ラジオボタン制御
if ($('input[class="agentRelationshipChk"]:checked').val() === '900') {
$("#agentRelationshipOtherwiseText").prop('disabled', false);
}
// 次順位手続代理人-ご関係ラジオボタン制御
if ($('input[class="nextAgentRelationshipChk"]:checked').val() === '900') {
$("#nextAgentRelationshipOtherwiseText").prop('disabled', false);
}
// 自動振替サービス-付加有無チェックボックス制御
var $autoTransfer = $('#autoTransfer');
$autoTransfer.find('input[data-auto-transfer-flg-index]').each(function (idx, elm) {
var $input = $(elm);
var $recMoney = $('#RecieveMoney');
var $recText = $('#recieveCycleDivOtherwiseText');
var $recDayTx = $('#recieveDayText');
var $agRecMoy = $('#AgentRecieveMoney');
if ($input.prop('checked')) {
// 自動振替サービス-付加チェックあり
$recMoney.prop('readonly', false);
$recMoney.prop('disabled', false);
$recDayTx.prop('readonly', false);
$recDayTx.prop('disabled', false);
$agRecMoy.prop('readonly', false);
$agRecMoy.prop('disabled', false);
// 委託者受取金額による制御
if ($recMoney.val() === "0" || $recMoney.val() === "") {
// 委託者の受取金額がブランクの場合、受取サイクルは入力不可とする
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
$recieveCycleDiv.prop('readonly', true);
$recieveCycleDiv.prop('disabled', true);
$recieveCycleDiv.prop('checked', false);
});
$recText.prop('readonly', true);
$recText.prop('disabled', true);
$recText.val('');
$recDayTx.prop('readonly', true);
$recDayTx.prop('disabled', true);
$recDayTx.val('');
} else {
// 委託者の受取金額ありの場合、受取サイクルは入力可とする
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
$recieveCycleDiv.prop('readonly', false);
$recieveCycleDiv.prop('disabled', false);
var radioval = $recieveCycleDiv.val();
if ((radioval === "4" && $recieveCycleDiv.prop('checked'))) {
$recText.prop('readonly', false);
$recText.prop('disabled', false);
}
});
$recDayTx.prop('readonly', false);
$recDayTx.prop('disabled', false);
}
} else {
// 自動振替サービス-付加チェックなし
$recMoney.prop('readonly', true);
$recMoney.prop('disabled', true);
$recMoney.val('');
$recText.prop('readonly', true);
$recText.prop('disabled', true);
$recText.val('');
$recDayTx.prop('readonly', true);
$recDayTx.prop('disabled', true);
$recDayTx.val('');
$agRecMoy.prop('readonly', true);
$agRecMoy.prop('disabled', true);
$agRecMoy.val('');
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
$recieveCycleDiv.prop('readonly', true);
$recieveCycleDiv.prop('disabled', true);
$recieveCycleDiv.prop('checked', false);
});
}
});
// 次順位の代理人-ご関係ラジオボタン
var $nextAgent = $('#nextAgent');
$nextAgent.find('input[data-nextagent-relationship-index]').each(function (idx, elm) {
var $input = $(elm);
if ($input.val() === "900" && $input.prop('checked')) {
$('#nextAgentRelationshipOtherwiseText').prop('disabled', false);
}
});
// 次順位の代理人指定有無チェックボックス制御
$nextAgent.find('input[data-next-agent-flg-index]').each(function (idx, elm) {
var $input = $(elm);
var $lastName = $('#DSTNewAppAgentsList_1__CustomerLastName');
var $fistName = $('#DSTNewAppAgentsList_1__CustomerFirstName');
var $lastNmKa = $('#DSTNewAppAgentsList_1__CustomerLastNameKana');
var $fistNmKa = $('#DSTNewAppAgentsList_1__CustomerFirstNameKana');
var $nextAgentChk1 = $('#is-same-address-nextAgent');
var $nextAgentChk2 = $('#is-same-agentAddress-nextAgent');
var $zipcode1 = $('#zipCode1NextAgent');
var $zipcode2 = $('#zipCode2NextAgent');
var $address1 = $('#address1NextAgent');
var $address2 = $('#address2NextAgent');
var $address3 = $('#address3NextAgent');
var $telNo1 = $('#DSTNewAppAgentsList_1__TelNo1');
var $telNo2 = $('#DSTNewAppAgentsList_1__TelNo2');
var $telNo3 = $('#DSTNewAppAgentsList_1__TelNo3');
var $year = $('#DSTNewAppAgentsList_1__BirthdayYear');
var $month = $('#DSTNewAppAgentsList_1__BirthdayMonth');
var $day = $('#DSTNewAppAgentsList_1__BirthdayDay');
var $other = $('#nextAgentRelationshipOtherwiseText');
var $serchBtn = $('#nextAgent-search-address-button')
if ($input.prop('checked')) {
$lastName.prop('readonly', false);
$lastName.prop('disabled', false);
$fistName.prop('readonly', false);
$fistName.prop('disabled', false);
$lastNmKa.prop('readonly', false);
$lastNmKa.prop('disabled', false);
$fistNmKa.prop('readonly', false);
$fistNmKa.prop('disabled', false);
$nextAgentChk1.prop('readonly', false);
$nextAgentChk1.prop('disabled', false);
$nextAgentChk2.prop('readonly', false);
$nextAgentChk2.prop('disabled', false);
$zipcode1.prop('readonly', false);
$zipcode1.prop('disabled', false);
$zipcode2.prop('readonly', false);
$zipcode2.prop('disabled', false);
$address1.prop('readonly', false);
$address1.prop('disabled', false);
$address2.prop('readonly', false);
$address2.prop('disabled', false);
$address3.prop('readonly', false);
$address3.prop('disabled', false);
$telNo1.prop('readonly', false);
$telNo1.prop('disabled', false);
$telNo2.prop('readonly', false);
$telNo2.prop('disabled', false);
$telNo3.prop('readonly', false);
$telNo3.prop('disabled', false);
$year.prop('readonly', false);
$year.prop('disabled', false);
$month.prop('readonly', false);
$month.prop('disabled', false);
$day.prop('readonly', false);
$day.prop('disabled', false);
$serchBtn.prop('hidden', false);
} else {
$lastName.prop('readonly', true);
$lastName.prop('disabled', true);
$lastName.val('');
$fistName.prop('readonly', true);
$fistName.prop('disabled', true);
$fistName.val('');
$lastNmKa.prop('readonly', true);
$lastNmKa.prop('disabled', true);
$lastNmKa.val('');
$fistNmKa.prop('readonly', true);
$fistNmKa.prop('disabled', true);
$fistNmKa.val('');
$nextAgentChk1.prop('readonly', true);
$nextAgentChk1.prop('disabled', true);
$nextAgentChk1.prop('checked', false);
$nextAgentChk2.prop('readonly', true);
$nextAgentChk2.prop('disabled', true);
$nextAgentChk2.prop('checked', false);
$zipcode1.prop('readonly', true);
$zipcode1.prop('disabled', true);
$zipcode1.val('');
$zipcode2.prop('readonly', true);
$zipcode2.prop('disabled', true);
$zipcode2.val('');
$address1.prop('readonly', true);
$address1.prop('disabled', true);
$address1.val('');
$address2.prop('readonly', true);
$address2.prop('disabled', true);
$address2.val('');
$address3.prop('readonly', true);
$address3.prop('disabled', true);
$address3.val('');
$telNo1.prop('readonly', true);
$telNo1.prop('disabled', true);
$telNo1.val('');
$telNo2.prop('readonly', true);
$telNo2.prop('disabled', true);
$telNo2.val('');
$telNo3.prop('readonly', true);
$telNo3.prop('disabled', true);
$telNo3.val('');
$year.prop('readonly', true);
$year.prop('disabled', true);
$month.prop('readonly', true);
$month.prop('disabled', true);
$day.prop('readonly', true);
$day.prop('disabled', true);
$other.prop('readonly', true);
$other.prop('disabled', true);
$other.val('');
$serchBtn.prop('hidden', true);
}
});
$nextAgent.find('input[data-nextagent-corppersdiv-index]').each(function (idx, elm) {
var $lastName = $('#DSTNewAppAgentsList_1__CustomerLastName');
if ($lastName.prop('disabled')) {
var $corpPersDiv = $(elm);
$corpPersDiv.prop('readonly', true);
$corpPersDiv.prop('disabled', true);
}
});
$nextAgent.find('input[data-nextagent-relationship-index]').each(function (idx, elm) {
var $lastName = $('#DSTNewAppAgentsList_1__CustomerLastName');
if ($lastName.prop('disabled')) {
var $relship = $(elm);
$relship.prop('readonly', true);
$relship.prop('disabled', true);
}
});
// ご家族連絡先-指定有無チェック、ご関係ラジオボタン制御
for (var index = 0; index < 3; index++) {
var contactNo = index + 1;
var $contact = $('#contact_' + contactNo);
var sum = 0;
// ご関係ラジオボタン
$contact.find('input[data-relationship-index]').each(function (idx, elm) {
var $input = $(elm);
// 初期で、全てチェックされない場合、INDEX追跡する
if ($input.prop('checked') === false) {
sum = sum + idx;
}
if (($input.val() === "900" && $input.prop('checked')) /*|| (sum === 15)*/) {
$('#relationshipOtherwiseText_' + index).prop('disabled', false);
}
});
// ご家族連絡先-指定有無チェックボックス
$contact.find('input[data-contact-useflg-index]').each(function (idx, elm) {
var $input = $(elm);
var $lastName = $('#DSTNewAppContactsList_' + index + '__CustomerLastName');
var $fistName = $('#DSTNewAppContactsList_' + index + '__CustomerFirstName');
var $lastNmKa = $('#DSTNewAppContactsList_' + index + '__CustomerLastNameKana');
var $fistNmKa = $('#DSTNewAppContactsList_' + index + '__CustomerFirstNameKana');
var $contChk1 = $('#is-same-address-contact_' + index);
var $contChk2 = $('#is-same-agentAddress-contact_' + index);
var $zipcode1 = $('#zipCode1Contact_' + index);
var $zipcode2 = $('#zipCode2Contact_' + index);
var $address1 = $('#address1Contact_' + index);
var $address2 = $('#address2Contact_' + index);
var $address3 = $('#address3Contact_' + index);
var $telNo1 = $('#DSTNewAppContactsList_' + index + '__TelNo1');
var $telNo2 = $('#DSTNewAppContactsList_' + index + '__TelNo2');
var $telNo3 = $('#DSTNewAppContactsList_' + index + '__TelNo3');
var $year = $('#DSTNewAppContactsList_' + index + '__BirthdayYear');
var $month = $('#DSTNewAppContactsList_' + index + '__BirthdayMonth');
var $day = $('#DSTNewAppContactsList_' + index + '__BirthdayDay');
var $other = $('#relationshipOtherwiseText_' + index);
var $serchBtn = $('#searchAddressForDST_' + index)
if ($input.prop('checked')) {
$lastName.prop('readonly', false);
$lastName.prop('disabled', false);
$fistName.prop('readonly', false);
$fistName.prop('disabled', false);
$lastNmKa.prop('readonly', false);
$lastNmKa.prop('disabled', false);
$fistNmKa.prop('readonly', false);
$fistNmKa.prop('disabled', false);
$contChk1.prop('readonly', false);
$contChk1.prop('disabled', false);
$contChk2.prop('readonly', false);
$contChk2.prop('disabled', false);
$zipcode1.prop('readonly', false);
$zipcode1.prop('disabled', false);
$zipcode2.prop('readonly', false);
$zipcode2.prop('disabled', false);
$address1.prop('readonly', false);
$address1.prop('disabled', false);
$address2.prop('readonly', false);
$address2.prop('disabled', false);
$address3.prop('readonly', false);
$address3.prop('disabled', false);
$telNo1.prop('readonly', false);
$telNo1.prop('disabled', false);
$telNo2.prop('readonly', false);
$telNo2.prop('disabled', false);
$telNo3.prop('readonly', false);
$telNo3.prop('disabled', false);
$year.prop('readonly', false);
$year.prop('disabled', false);
$month.prop('readonly', false);
$month.prop('disabled', false);
$day.prop('readonly', false);
$day.prop('disabled', false);
$serchBtn.prop('hidden', false);
} else {
$lastName.prop('readonly', true);
$lastName.prop('disabled', true);
$lastName.val('');
$fistName.prop('readonly', true);
$fistName.prop('disabled', true);
$fistName.val('');
$lastNmKa.prop('readonly', true);
$lastNmKa.prop('disabled', true);
$lastNmKa.val('');
$fistNmKa.prop('readonly', true);
$fistNmKa.prop('disabled', true);
$fistNmKa.val('');
$contChk1.prop('readonly', true);
$contChk1.prop('disabled', true);
$contChk1.prop('checked', false);
$contChk2.prop('readonly', true);
$contChk2.prop('disabled', true);
$contChk2.prop('checked', false);
$zipcode1.prop('readonly', true);
$zipcode1.prop('disabled', true);
$zipcode1.val('');
$zipcode2.prop('readonly', true);
$zipcode2.prop('disabled', true);
$zipcode2.val('');
$address1.prop('readonly', true);
$address1.prop('disabled', true);
$address1.val('');
$address2.prop('readonly', true);
$address2.prop('disabled', true);
$address2.val('');
$address3.prop('readonly', true);
$address3.prop('disabled', true);
$address3.val('');
$telNo1.prop('readonly', true);
$telNo1.prop('disabled', true);
$telNo1.val('');
$telNo2.prop('readonly', true);
$telNo2.prop('disabled', true);
$telNo2.val('');
$telNo3.prop('readonly', true);
$telNo3.prop('disabled', true);
$telNo3.val('');
$year.prop('readonly', true);
$year.prop('disabled', true);
$month.prop('readonly', true);
$month.prop('disabled', true);
$day.prop('readonly', true);
$day.prop('disabled', true);
$other.prop('readonly', true);
$other.prop('disabled', true);
$other.val('');
$serchBtn.prop('hidden', true);
}
});
$contact.find('input[data-relationship-index]').each(function (idx, elm) {
var $lastName = $('#DSTNewAppContactsList_' + index + '__CustomerLastName');
if ($lastName.prop('disabled')) {
var $relship = $(elm);
$relship.prop('readonly', true);
$relship.prop('disabled', true);
}
});
}
// 手続代理人同一住所
copyAddressForAgent();
// 次順位の手続代理人同一住所
if ($('#nextAgentFlg').prop('checked')) {
copyAddressForNextAgent();
}
// 連絡先同一住所
for (var index = 0; index < 3; index++) {
if ($('#contactUseFlg_' + index).prop('checked')) {
var $this = $('#is-same-address-contact_' + index)
var contactIndex = $this.data('customer-sameaddress-contact-index');
copyAddressForContact(contactIndex)
}
}
// 住所検索を利用する
g0084InitAddressSearch();
// お申込金額により、設定時信託報酬の自動計算を利用する
settingFeeAutoCalc();
// 支店検索を利用する
initBranchSearch();
var salesStatus = parseInt($('#inputStatus').val());
if (salesStatus === 1 || salesStatus === 2 || salesStatus === 3) {
$(":input").attr("readonly", "true");
$(":checkbox").attr("disabled", "true");
$(":radio").attr("disabled", "true");
$(".select-box").attr("disabled", "true");
$(".sales-info").attr("disabled", "true");
$(":button").attr("hidden", "true");
$('.not-hidden-button').removeAttr("hidden");
if (salesStatus === 1) {
// お客様モードチェックボックスは使用可能
$('#customerMode').removeAttr("disabled");
// 店番-CIFは入力可能
$('.settlement-info').removeAttr("readonly");
// 信託設定日
//$('.trust-creation-date').removeAttr("readonly");
} else if (salesStatus === 3) {
// お客様モードチェックボックスは使用可能
$('#customerMode').removeAttr("disabled");
// 店番-CIFは入力可能
$('.settlement-info').removeAttr("readonly");
// 販売担当者入力欄は入力可能
$('.sales-info').removeAttr("readonly");
$(".sales-info").removeAttr("disabled");
}
}
});
$(function () {
$('[customer-mode]').on('change', function (event) {
var $this = $(this);
if ($this.prop('checked') === true) {
showCustomerMode();
} else {
showNonCustomerMode();
}
});
});
// 手続代理人
$(function () {
// お客さま(委託者)と同一住所チェックボックス押下時
$('#is-same-address-agent').on('change', function (event) {
var $this = $(this);
copyAddressForAgent();
});
});
$(function () {
// お客さま(委託者)の住所変更時
$('.customer-address').on('change', function (event) {
copyAddressForAgent();
copyAddressForNextAgent();
for (var index = 0; index < 3; index++) {
var $this = $('#is-same-address-contact_' + index)
var contactIndex = $this.data('customer-sameaddress-contact-index');
if ($('#is-same-address-contact_' + index).prop('checked') === true) {
$('#is-same-agentAddress-contact_' + index).prop('checked', false);
} else {
$('#is-same-address-contact_' + index).prop('checked', false);
}
copyAddressForContact(contactIndex)
}
});
// 手続代理人の住所変更時
$('.agent-address').on('change', function (event) {
copyAddressForNextAgent();
for (var index = 0; index < 3; index++) {
var $this = $('#is-same-address-contact_' + index)
var contactIndex = $this.data('customer-sameaddress-contact-index');
if ($('#is-same-agentAddress-contact_' + index).prop('checked') === true) {
$('#is-same-address-contact_' + index).prop('checked', false);
} else {
$('#is-same-agentAddress-contact_' + index).prop('checked', false);
}
copyAddressForContact(contactIndex)
}
});
});
//次順位の手続代理人
$(function () {
// 指定同意チェックボックス押下時
$('#sameaddressCheck_400').on('change', function (event) {
var $this = $(this);
if ($('#sameaddressCheck_400').prop('checked') === true) {
$('#sameaddressCheck_300').prop('checked', false);
}
});
// 指定の同意を求めていないチェックボックス押下時
$('#sameaddressCheck_300').on('change', function (event) {
var $this = $(this);
if ($('#sameaddressCheck_300').prop('checked') === true) {
$('#sameaddressCheck_400').prop('checked', false);
}
});
// お客さま(委託者)と同一住所チェックボックス押下時
$('#is-same-address-nextAgent').on('change', function (event) {
var $this = $(this);
if ($('#is-same-address-nextAgent').prop('checked') === true) {
$('#is-same-agentAddress-nextAgent').prop('checked', false);
} else {
$('#is-same-address-nextAgent').prop('checked', false);
}
copyAddressForNextAgent();
});
// 手続代理人と同一住所チェックボックス押下時
$('#is-same-agentAddress-nextAgent').on('change', function (event) {
var $this = $(this);
if ($('#is-same-agentAddress-nextAgent').prop('checked') === true) {
$('#is-same-address-nextAgent').prop('checked', false);
} else {
$('#is-same-agentAddress-nextAgent').prop('checked', false);
}
copyAddressForNextAgent();
});
});
// 自動振替サービス-付加有無チェックボックス押下時
$(function () {
$('#autoTransferFlg').on('change', function (event) {
var $this = $(this);
var $recMoney = $('#RecieveMoney');
var $recText = $('#recieveCycleDivOtherwiseText');
var $recDayTx = $('#recieveDayText');
var $agRecMoy = $('#AgentRecieveMoney');
if ($this.prop('checked')) {
$recMoney.prop('readonly', false);
$recMoney.prop('disabled', false);
$agRecMoy.prop('readonly', false);
$agRecMoy.prop('disabled', false);
if ($recMoney.val() === "0" || $recMoney.val() === "") {
var $autoTransfer = $('#autoTransfer');
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
$recieveCycleDiv.prop('readonly', true);
$recieveCycleDiv.prop('disabled', true);
$recieveCycleDiv.prop('checked', false);
});
} else {
var $autoTransfer = $('#autoTransfer');
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
$recieveCycleDiv.prop('readonly', false);
$recieveCycleDiv.prop('disabled', false);
});
}
} else {
$recMoney.prop('readonly', true);
$recMoney.prop('disabled', true);
$recMoney.val('');
$recText.prop('readonly', true);
$recText.prop('disabled', true);
$recText.val('');
$recDayTx.prop('readonly', true);
$recDayTx.prop('disabled', true);
$recDayTx.val('');
$agRecMoy.prop('readonly', true);
$agRecMoy.prop('disabled', true);
$agRecMoy.val('');
var $autoTransfer = $('#autoTransfer');
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
$recieveCycleDiv.prop('readonly', true);
$recieveCycleDiv.prop('disabled', true);
$recieveCycleDiv.prop('checked', false);
});
}
});
});
// 自動振替サービス-委託者-受取金額変更時
$(function () {
var $recMoney = $('#RecieveMoney');
var $recText = $('#recieveCycleDivOtherwiseText');
var $recDayTx = $('#recieveDayText');
$recMoney.on('focusout', function () {
// 前ゼロ削除
var re = /^[0-9]+.?[0-9]*/; // 数字か判断
var money = $recMoney.val().replace(/,/g, '');
if (re.test(money)) {
// 整数以外の文字列を削除
var recMoneyNum = Number($recMoney.val().replace(/[^0-9]/g, ''));
$recMoney.val(recMoneyNum.toLocaleString());
if ($recMoney.val() === '0' || $recMoney.val() === "") {
$recMoney.val('');
}
}
// 受取金額による制御
if ($recMoney.val() === "0" || $recMoney.val() === "") {
var $autoTransfer = $('#autoTransfer');
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
$recieveCycleDiv.prop('readonly', true);
$recieveCycleDiv.prop('disabled', true);
$recieveCycleDiv.prop('checked', false);
});
$recText.prop('readonly', true);
$recText.prop('disabled', true);
$recText.val('');
$recDayTx.prop('readonly', true);
$recDayTx.prop('disabled', true);
$recDayTx.val('');
} else {
var $autoTransfer = $('#autoTransfer');
$autoTransfer.find('input[data-recieve-cycle-div-index]').each(function (idx, elm) {
var $recieveCycleDiv = $(elm);
var $recText = $('#recieveCycleDivOtherwiseText');
$recieveCycleDiv.prop('readonly', false);
$recieveCycleDiv.prop('disabled', false);
var radioval = $recieveCycleDiv.val();
if ((radioval === "4" && $recieveCycleDiv.prop('checked'))) {
$recText.prop('readonly', false);
$recText.prop('disabled', false);
}
});
$recDayTx.prop('readonly', false);
$recDayTx.prop('disabled', false);
}
});
});
// 自動振替サービス-手続代理人-受取金額変更時
$(function () {
var $agRecMoy = $('#AgentRecieveMoney');
$agRecMoy.on('focusout', function () {
// 前ゼロ削除
var re = /^[0-9]+.?[0-9]*/; // 数字か判断
var money = $agRecMoy.val().replace(/,/g, '');
if (re.test(money)) {
// 整数以外の文字列を削除
var recMoneyNum = Number($agRecMoy.val().replace(/[^0-9]/g, ''));
$agRecMoy.val(recMoneyNum.toLocaleString());
if ($agRecMoy.val() === '0' || $agRecMoy.val() === "") {
$agRecMoy.val('');
}
}
});
});
// 次順位の代理人指定有無チェックボックス押下時
$(function () {
$('#nextAgentFlg').on('change', function (event) {
var $this = $(this);
var $lastName = $('#DSTNewAppAgentsList_1__CustomerLastName');
var $fistName = $('#DSTNewAppAgentsList_1__CustomerFirstName');
var $lastNmKa = $('#DSTNewAppAgentsList_1__CustomerLastNameKana');
var $fistNmKa = $('#DSTNewAppAgentsList_1__CustomerFirstNameKana');
var $nextAgentChk1 = $('#is-same-address-nextAgent');
var $nextAgentChk2 = $('#is-same-agentAddress-nextAgent');
var $zipcode1 = $('#zipCode1NextAgent');
var $zipcode2 = $('#zipCode2NextAgent');
var $address1 = $('#address1NextAgent');
var $address2 = $('#address2NextAgent');
var $address3 = $('#address3NextAgent');
var $telNo1 = $('#DSTNewAppAgentsList_1__TelNo1');
var $telNo2 = $('#DSTNewAppAgentsList_1__TelNo2');
var $telNo3 = $('#DSTNewAppAgentsList_1__TelNo3');
var $year = $('#DSTNewAppAgentsList_1__BirthdayYear');
var $month = $('#DSTNewAppAgentsList_1__BirthdayMonth');
var $day = $('#DSTNewAppAgentsList_1__BirthdayDay');
var $other = $('#nextAgentRelationshipOtherwiseText');
var $serchBtn = $('#nextAgent-search-address-button')
if ($this.prop('checked') === true) {
$lastName.prop('readonly', false);
$lastName.prop('disabled', false);
$fistName.prop('readonly', false);
$fistName.prop('disabled', false);
$lastNmKa.prop('readonly', false);
$lastNmKa.prop('disabled', false);
$fistNmKa.prop('readonly', false);
$fistNmKa.prop('disabled', false);
$nextAgentChk1.prop('readonly', false);
$nextAgentChk1.prop('disabled', false);
$nextAgentChk2.prop('readonly', false);
$nextAgentChk2.prop('disabled', false);
$zipcode1.prop('readonly', false);
$zipcode1.prop('disabled', false);
$zipcode2.prop('readonly', false);
$zipcode2.prop('disabled', false);
$address1.prop('readonly', false);
$address1.prop('disabled', false);
$address2.prop('readonly', false);
$address2.prop('disabled', false);
$address3.prop('readonly', false);
$address3.prop('disabled', false);
$telNo1.prop('readonly', false);
$telNo1.prop('disabled', false);
$telNo2.prop('readonly', false);
$telNo2.prop('disabled', false);
$telNo3.prop('readonly', false);
$telNo3.prop('disabled', false);
$year.prop('readonly', false);
$year.prop('disabled', false);
$month.prop('readonly', false);
$month.prop('disabled', false);
$day.prop('readonly', false);
$day.prop('disabled', false);
$other.prop('readonly', false);
$serchBtn.prop('hidden', false);
} else {
$lastName.prop('readonly', true);
$lastName.prop('disabled', true);
$lastName.val('');
$fistName.prop('readonly', true);
$fistName.prop('disabled', true);
$fistName.val('');
$lastNmKa.prop('readonly', true);
$lastNmKa.prop('disabled', true);
$lastNmKa.val('');
$fistNmKa.prop('readonly', true);
$fistNmKa.prop('disabled', true);
$fistNmKa.val('');
$nextAgentChk1.prop('readonly', true);
$nextAgentChk1.prop('disabled', true);
$nextAgentChk1.prop('checked', false);
$nextAgentChk2.prop('readonly', true);
$nextAgentChk2.prop('disabled', true);
$nextAgentChk2.prop('checked', false);
$zipcode1.prop('readonly', true);
$zipcode1.prop('disabled', true);
$zipcode1.val('');
$zipcode2.prop('readonly', true);
$zipcode2.prop('disabled', true);
$zipcode2.val('');
$address1.prop('readonly', true);
$address1.prop('disabled', true);
$address1.val('');
$address2.prop('readonly', true);
$address2.prop('disabled', true);
$address2.val('');
$address3.prop('readonly', true);
$address3.prop('disabled', true);
$address3.val('');
$telNo1.prop('readonly', true);
$telNo1.prop('disabled', true);
$telNo1.val('');
$telNo2.prop('readonly', true);
$telNo2.prop('disabled', true);
$telNo2.val('');
$telNo3.prop('readonly', true);
$telNo3.prop('disabled', true);
$telNo3.val('');
$year.prop('readonly', true);
$year.prop('disabled', true);
$month.prop('readonly', true);
$month.prop('disabled', true);
$day.prop('readonly', true);
$day.prop('disabled', true);
$other.prop('readonly', true);
$other.prop('disabled', true);
$other.val('');
$serchBtn.prop('hidden', true);
}
});
// 次順位の代理人指定有無チェックボックス押下時、個人/法人ラジオ制御
$('#nextAgentFlg').on('change', function (event) {
var $this = $(this);
if ($this.prop('checked') === true) {
var $nextAgent = $('#nextAgent');
$nextAgent.find('input[data-nextagent-corppersdiv-index]').each(function (idx, elm) {
var $corpPersDiv = $(elm);
$corpPersDiv.prop('readonly', false);
$corpPersDiv.prop('disabled', false);
});
} else {
var $nextAgent = $('#nextAgent');
$nextAgent.find('input[data-nextagent-corppersdiv-index]').each(function (idx, elm) {
var $corpPersDiv = $(elm);
$corpPersDiv.prop('readonly', true);
$corpPersDiv.prop('disabled', true);
});
}
});
// 次順位の代理人指定有無チェックボックス押下時、関係ラジオ制御
$('#nextAgentFlg').on('change', function (event) {
var $this = $(this);
if ($this.prop('checked') === true) {
var $nextAgent = $('#nextAgent');
$nextAgent.find('input[data-nextagent-relationship-index]').each(function (idx, elm) {
var $relship = $(elm);
var $other = $('#nextAgentRelationshipOtherwiseText');
$relship.prop('readonly', false);
$relship.prop('disabled', false);
var radioval = $relship.val();
if ((radioval === "900" && $relship.prop('checked')) /*|| $relship.prop('checked') === false*/) {
$other.prop('readonly', false);
$other.prop('disabled', false);
}
});
} else {
var $nextAgent = $('#nextAgent');
$nextAgent.find('input[data-nextagent-relationship-index]').each(function (idx, elm) {
var $relship = $(elm);
$relship.prop('readonly', true);
$relship.prop('disabled', true);
});
}
});
});
//家族連絡先
$(function () {
for (var index = 0; index < 3; index++) {
// 指定有無チェックボックス押下時
$('#contactUseFlg_' + index).on('change', function (event) {
var $this = $(this);
var contactIndex = $this.data('contact-useflg-index');
var $lastName = $('#DSTNewAppContactsList_' + contactIndex + '__CustomerLastName');
var $fistName = $('#DSTNewAppContactsList_' + contactIndex + '__CustomerFirstName');
var $lastNmKa = $('#DSTNewAppContactsList_' + contactIndex + '__CustomerLastNameKana');
var $fistNmKa = $('#DSTNewAppContactsList_' + contactIndex + '__CustomerFirstNameKana');
var $contChk1 = $('#is-same-address-contact_' + contactIndex);
var $contChk2 = $('#is-same-agentAddress-contact_' + contactIndex);
var $zipcode1 = $('#zipCode1Contact_' + contactIndex);
var $zipcode2 = $('#zipCode2Contact_' + contactIndex);
var $address1 = $('#address1Contact_' + contactIndex);
var $address2 = $('#address2Contact_' + contactIndex);
var $address3 = $('#address3Contact_' + contactIndex);
var $telNo1 = $('#DSTNewAppContactsList_' + contactIndex + '__TelNo1');
var $telNo2 = $('#DSTNewAppContactsList_' + contactIndex + '__TelNo2');
var $telNo3 = $('#DSTNewAppContactsList_' + contactIndex + '__TelNo3');
var $year = $('#DSTNewAppContactsList_' + contactIndex + '__BirthdayYear');
var $month = $('#DSTNewAppContactsList_' + contactIndex + '__BirthdayMonth');
var $day = $('#DSTNewAppContactsList_' + contactIndex + '__BirthdayDay');
var $other = $('#relationshipOtherwiseText_' + contactIndex);
var $serchBtn = $('#searchAddressForDST_' + contactIndex)
if ($this.prop('checked') === true) {
$lastName.prop('readonly', false);
$lastName.prop('disabled', false);
$fistName.prop('readonly', false);
$fistName.prop('disabled', false);
$lastNmKa.prop('readonly', false);
$lastNmKa.prop('disabled', false);
$fistNmKa.prop('readonly', false);
$fistNmKa.prop('disabled', false);
$contChk1.prop('readonly', false);
$contChk1.prop('disabled', false);
$contChk2.prop('readonly', false);
$contChk2.prop('disabled', false);
$zipcode1.prop('readonly', false);
$zipcode1.prop('disabled', false);
$zipcode2.prop('readonly', false);
$zipcode2.prop('disabled', false);
$address1.prop('readonly', false);
$address1.prop('disabled', false);
$address2.prop('readonly', false);
$address2.prop('disabled', false);
$address3.prop('readonly', false);
$address3.prop('disabled', false);
$telNo1.prop('readonly', false);
$telNo1.prop('disabled', false);
$telNo2.prop('readonly', false);
$telNo2.prop('disabled', false);
$telNo3.prop('readonly', false);
$telNo3.prop('disabled', false);
$year.prop('readonly', false);
$year.prop('disabled', false);
$month.prop('readonly', false);
$month.prop('disabled', false);
$day.prop('readonly', false);
$day.prop('disabled', false);
$other.prop('readonly', false);
$serchBtn.prop('hidden', false);
} else {
$lastName.prop('readonly', true);
$lastName.prop('disabled', true);
$lastName.val('');
$fistName.prop('readonly', true);
$fistName.prop('disabled', true);
$fistName.val('');
$lastNmKa.prop('readonly', true);
$lastNmKa.prop('disabled', true);
$lastNmKa.val('');
$fistNmKa.prop('readonly', true);
$fistNmKa.prop('disabled', true);
$fistNmKa.val('');
$contChk1.prop('readonly', true);
$contChk1.prop('disabled', true);
$contChk1.prop('checked', false);
$contChk2.prop('readonly', true);
$contChk2.prop('disabled', true);
$contChk2.prop('checked', false);
$zipcode1.prop('readonly', true);
$zipcode1.prop('disabled', true);
$zipcode1.val('');
$zipcode2.prop('readonly', true);
$zipcode2.prop('disabled', true);
$zipcode2.val('');
$address1.prop('readonly', true);
$address1.prop('disabled', true);
$address1.val('');
$address2.prop('readonly', true);
$address2.prop('disabled', true);
$address2.val('');
$address3.prop('readonly', true);
$address3.prop('disabled', true);
$address3.val('');
$telNo1.prop('readonly', true);
$telNo1.prop('disabled', true);
$telNo1.val('');
$telNo2.prop('readonly', true);
$telNo2.prop('disabled', true);
$telNo2.val('');
$telNo3.prop('readonly', true);
$telNo3.prop('disabled', true);
$telNo3.val('');
$year.prop('readonly', true);
$year.prop('disabled', true);
$month.prop('readonly', true);
$month.prop('disabled', true);
$day.prop('readonly', true);
$day.prop('disabled', true);
$other.prop('readonly', true);
$other.prop('disabled', true);
$other.val('');
$serchBtn.prop('hidden', true);
}
});
// 指定有無チェックボックス押下時、関係ラジオ制御
$('#contactUseFlg_' + index).on('change', function (event) {
var $this = $(this);
var contactIndex = $this.data('contact-useflg-index');
if ($this.prop('checked') === true) {
var contactNo = contactIndex + 1;
var $contact = $('#contact_' + contactNo);
var $other = $('#relationshipOtherwiseText_' + contactIndex);
$contact.find('input[data-relationship-index]').each(function (idx, elm) {
var $relship = $(elm);
$relship.prop('readonly', false);
$relship.prop('disabled', false);
var radioval = $relship.val();
if ((radioval === "900" && $relship.prop('checked')) /*|| $relship.prop('checked') === false*/) {
$other.prop('readonly', false);
$other.prop('disabled', false);
}
});
} else {
var contactNo = contactIndex + 1;
var $contact = $('#contact_' + contactNo);
$contact.find('input[data-relationship-index]').each(function (idx, elm) {
var $relship = $(elm);
$relship.prop('readonly', true);
$relship.prop('disabled', true);
});
}
});
// お客さま(委託者)と同一住所チェックボックス押下時
$('#is-same-address-contact_' + index).on('change', function (event) {
var $this = $(this);
var contactIndex = $this.data('customer-sameaddress-contact-index');
if ($('#is-same-address-contact_' + contactIndex).prop('checked') === true) {
$('#is-same-agentAddress-contact_' + contactIndex).prop('checked', false);
} else {
$('#is-same-address-contact_' + contactIndex).prop('checked', false);
}
copyAddressForContact(contactIndex);
});
// 手続代理人と同一住所チェックボックス押下時
$('#is-same-agentAddress-contact_' + index).on('change', function (event) {
var $this = $(this);
var contactIndex = $this.data('customer-sameaddress-agent-contact-index');
if ($('#is-same-agentAddress-contact_' + contactIndex).prop('checked') === true) {
$('#is-same-address-contact_' + contactIndex).prop('checked', false);
} else {
$('#is-same-agentAddress-contact_' + contactIndex).prop('checked', false);
}
copyAddressForContact(contactIndex);
});
}
});
$(function () {
// 税法上の居住地国チェックボックス制御
$('#CheckTaxCountry3').on('change', function () {
var $this = $(this);
if ($this.prop('checked') === true) {
$(".tax-country-3").prop('disabled', false);
} else {
$(".tax-country-3").prop('value', '');
$(".tax-country-3").prop('disabled', true);
}
});
$('#CheckResidentDiffReason').on('change', function () {
var $this = $(this);
if ($this.prop('checked') === true) {
$(".resident-diff-reason").prop('disabled', false);
} else {
$(".resident-diff-reason").prop('value', '');
$(".resident-diff-reason").prop('disabled', true);
}
});
});
$(function () {
// 手続代理人-ご関係ラジオボタン制御
$('input[data-account-subject-index]:radio').change(function () {
var $this = $(this);
var radioval = $this.val();
if (radioval === "900") {
$('#agentRelationshipOtherwiseText').prop('disabled', false);
} else {
$('#agentRelationshipOtherwiseText').prop('value', '');
$('#agentRelationshipOtherwiseText').prop('disabled', true);
}
});
});
$(function () {
// 次順位手続代理人-ご関係ラジオボタン制御
$('input[data-nextagent-relationship-index]:radio').change(function () {
var $this = $(this);
var radioval = $this.val();
if (radioval === "900") {
$('#nextAgentRelationshipOtherwiseText').prop('disabled', false);
} else {
$('#nextAgentRelationshipOtherwiseText').prop('value', '');
$('#nextAgentRelationshipOtherwiseText').prop('disabled', true);
}
});
});
//自動振替サービス
$(function () {
// 委託者-お受取サイクルラジオボタン制御
$('input[data-recieve-cycle-div-index]:radio').change(function () {
var $this = $(this);
var radioval = $this.val();
if (radioval === "4") {
$('#recieveCycleDivOtherwiseText').prop('disabled', false);
$('#recieveCycleDivOtherwiseText').prop('readonly', false);
} else {
$('#recieveCycleDivOtherwiseText').prop('value', '');
$('#recieveCycleDivOtherwiseText').prop('disabled', true);
$('#recieveCycleDivOtherwiseText').prop('readonly', true);
}
});
});
$(function () {
// ご家族連絡先-ご関係ラジオボタン制御
$('input[data-relationship-index]:radio').change(function () {
var $this = $(this);
var radioval = $this.val();
var index = $this.data('relationship-index');
if (radioval === "900") {
$('#relationshipOtherwiseText_' + index).prop('disabled', false);
} else {
$('#relationshipOtherwiseText_' + index).prop('value', '');
$('#relationshipOtherwiseText_' + index).prop('disabled', true);
}
});
});
function showCustomerMode() {
// 非表示
$(".not-customer-input").hide();
// 表示
$(".customer-input").show();
}
function showNonCustomerMode() {
// 非表示
$(".customer-input").hide();
// 表示
$(".not-customer-input").show();
}
function copyAddressForAgent() {
var $zipcode1 = $('#zipCode1Agent');
var $zipcode2 = $('#zipCode2Agent');
var $address1 = $('#address1Agent');
var $address2 = $('#address2Agent');
var $address3 = $('#address3Agent');
if ($('#is-same-address-agent').prop('checked') === true) {
$zipcode1.val($('#zipCode1Settlement').val());
$zipcode1.prop('readonly', true);
$zipcode2.val($('#zipCode2Settlement').val());
$zipcode2.prop('readonly', true);
$address1.val($('#address1Settlement').val());
$address1.prop('readonly', true);
$address2.val($('#address2Settlement').val());
$address2.prop('readonly', true);
$address3.val($('#address3Settlement').val());
$address3.prop('readonly', true);
$('#searchAddressForDST_3').prop('hidden', true);
} else {
$zipcode1.prop('readonly', false);
$zipcode2.prop('readonly', false);
$address1.prop('readonly', false);
$address2.prop('readonly', false);
$address3.prop('readonly', false);
$('#searchAddressForDST_3').prop('hidden', false);
}
}
function copyAddressForNextAgent() {
var $zipcode1 = $('#zipCode1NextAgent');
var $zipcode2 = $('#zipCode2NextAgent');
var $address1 = $('#address1NextAgent');
var $address2 = $('#address2NextAgent');
var $address3 = $('#address3NextAgent');
if ($('#is-same-address-nextAgent').prop('checked') === true) {
$zipcode1.val($('#zipCode1Settlement').val());
$zipcode1.prop('readonly', true);
$zipcode2.val($('#zipCode2Settlement').val());
$zipcode2.prop('readonly', true);
$address1.val($('#address1Settlement').val());
$address1.prop('readonly', true);
$address2.val($('#address2Settlement').val());
$address2.prop('readonly', true);
$address3.val($('#address3Settlement').val());
$address3.prop('readonly', true);
$('#nextAgent-search-address-button').prop('hidden', true);
} else if ($('#is-same-agentAddress-nextAgent').prop('checked') === true) {
$zipcode1.val($('#zipCode1Agent').val());
$zipcode1.prop('readonly', true);
$zipcode2.val($('#zipCode2Agent').val());
$zipcode2.prop('readonly', true);
$address1.val($('#address1Agent').val());
$address1.prop('readonly', true);
$address2.val($('#address2Agent').val());
$address2.prop('readonly', true);
$address3.val($('#address3Agent').val());
$address3.prop('readonly', true);
$('#nextAgent-search-address-button').prop('hidden', true);
} else {
$zipcode1.prop('readonly', false);
$zipcode2.prop('readonly', false);
$address1.prop('readonly', false);
$address2.prop('readonly', false);
$address3.prop('readonly', false);
$('#nextAgent-search-address-button').prop('hidden', false);
}
}
//家族連絡先
function copyAddressForContact(index) {
var $zipcode1 = $('#zipCode1Contact_' + index);
var $zipcode2 = $('#zipCode2Contact_' + index);
var $address1 = $('#address1Contact_' + index);
var $address2 = $('#address2Contact_' + index);
var $address3 = $('#address3Contact_' + index);
if ($('#is-same-address-contact_' + index).prop('checked') === true) {
$zipcode1.val($('#zipCode1Settlement').val());
$zipcode1.prop('readonly', true);
$zipcode2.val($('#zipCode2Settlement').val());
$zipcode2.prop('readonly', true);
$address1.val($('#address1Settlement').val());
$address1.prop('readonly', true);
$address2.val($('#address2Settlement').val());
$address2.prop('readonly', true);
$address3.val($('#address3Settlement').val());
$address3.prop('readonly', true);
$('#searchAddressForDST_' + index).prop('hidden', true);
} else if ($('#is-same-agentAddress-contact_' + index).prop('checked') === true) {
$zipcode1.val($('#zipCode1Agent').val());
$zipcode1.prop('readonly', true);
$zipcode2.val($('#zipCode2Agent').val());
$zipcode2.prop('readonly', true);
$address1.val($('#address1Agent').val());
$address1.prop('readonly', true);
$address2.val($('#address2Agent').val());
$address2.prop('readonly', true);
$address3.val($('#address3Agent').val());
$address3.prop('readonly', true);
$('#searchAddressForDST_' + index).prop('hidden', true);
} else {
$zipcode1.prop('readonly', false);
$zipcode2.prop('readonly', false);
$address1.prop('readonly', false);
$address2.prop('readonly', false);
$address3.prop('readonly', false);
$('#searchAddressForDST_' + index).prop('hidden', false);
}
}
function g0084InitAddressSearch() {
$('.searchAddressForDST').on('click', function () {
var $this = $(this);
var idSuffix = $this.attr('data-id-suffix');
var zipCode1Label = $this.attr('data-zip-code1-label');
var zipCode2Label = $this.attr('data-zip-code2-label');
var addressLabel = $this.attr('data-address-label');
var errorMessage = $this.data('error-message');
var actionUrl = $this.attr('data-action-url');
var zipCode1 = $('#zipCode1' + idSuffix).val();
var zipCode2 = $('#zipCode2' + idSuffix).val();
$.ajax({
type: 'POST',
url: actionUrl,
cache: false,
data: {
__RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
zipCode1: zipCode1,
zipCode2: zipCode2,
zipCode1Label: zipCode1Label,
zipCode2Label: zipCode2Label,
addressLabel: addressLabel
}
}).done(function (response, textStatus, jqXHR) {
if (response.Success) {
$('#address1' + idSuffix).val(response.Data.Address1);
$('#address2' + idSuffix).val(response.Data.Address2);
$('#address3' + idSuffix).val(response.Data.Address3).trigger('change');
} else {
$('#address1' + idSuffix).val('');
$('#address2' + idSuffix).val('');
$('#address3' + idSuffix).val('').trigger('change');
}
showMessageDialog(response.Messages, null);
}).fail(function (jqXHR, textStatus, errorThrown) {
$('#address1' + idSuffix).val('');
$('#address2' + idSuffix).val('');
$('#address3' + idSuffix).val('').trigger('change');
showAlertDialog(errorMessage, null);
});
});
}
/**
* 画面上、お申込金額の変更伴って、設定時信託報酬の自動計算機能を利用する場合に呼び出します。
* ボタンに settingFeeAutoCalc クラスを設定し、下記の属性を設定することで利用できます。
* 設定時信託報酬 = お申込金額 × 手数料率(%)の結果を切り捨て
*/
function settingFeeAutoCalc() {
$('.settingFeeAutoCalc').on('focusout', function () {
var $this = $(this);
// お申込金額
var trustMoney = $this.val();
// 手数料率(%)
var compoundingFeeRate = $('#compoundingFeeRate').text();
// 上限値
var feeMax = $('#feeMax').text();
// 前ゼロ削除
var re = /^[0-9]+.?[0-9]*/; // 数字か判断
var mony = trustMoney.replace(/,/g, '');
if (re.test(mony)) {
// 整数以外の文字列を削除
var trustMoyNum = Number(trustMoney.replace(/[^0-9]/g, ''));
$this.val(trustMoyNum.toLocaleString());
}
// 整数以外の文字列を削除
var trustMoneyNum = Number(trustMoney.replace(/[^0-9]/g, ''));
var feeMaxNum = Number(feeMax.replace(/[^0-9]/g, ''));
// 計算式(切り捨てを含まれる)
var settingFeeAutoCalcNum = Number(Math.floor(trustMoneyNum * compoundingFeeRate / 100));
// 上限値より大きい時
if (settingFeeAutoCalcNum >= feeMaxNum) {
settingFeeAutoCalcNum = feeMaxNum;
}
var settingFeeAutoCalc = settingFeeAutoCalcNum.toLocaleString();
$('#settingFeelabel').text(settingFeeAutoCalc);
$('#SettingFee').val(settingFeeAutoCalc);
});
}