PageSourceSearch

https://myportal.joes.or.jp/js/common/common-2f74789be86ac5298e1294503df0c412.js

js joes.or.jp collected 2026-09-24 09:36:56 UTC 43,354 bytes, 1,264 lines download raw bytes

1var joesFamilyMemberValidator = null;
2
3$.ajaxSetup({
4	complete: function(xhr, status) {
5		var REDIRECT = xhr.getResponseHeader("REDIRECT");
6		if (REDIRECT === "REDIRECT") {
7			var win = window;
8			while(win != win.top) {
9				win = win.top;
10			}
11			win.location.href = xhr.getResponseHeader("CONTEXTPATH");
12		}
13	}
14});
15
16$(function() {
17	joesFamilyMemberFormValidate();
18	// ページトップへの移動ボタン(↑)
19	$(window).scroll(function() {
20		var linkToTop = $(document).scrollTop();
21		if (linkToTop > 0) {
22			$(".link-to-top").attr("style", "display:block;");
23		} else {
24			$(".link-to-top").attr("style", "display:none");
25		}
26	});
27
28	// bootstrap tooptip (サーブIDのアイコン)
29	var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
30	var tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) {
31		return new bootstrap.Tooltip(tooltipTriggerEl)
32	});
33	
34	// 2023/08/22 デザイン会社様指摘対応
35	// ウィンドウサイズによるフォント調整
36	var fontForPC = document.querySelectorAll(".pc-font");
37	var fontForSP = document.querySelectorAll(".sp-font");
38	if (screen.width > 950) {
39		if ($(fontForPC[0]).hasClass("d-none")) {
40			$(fontForPC[0]).removeClass("d-none")
41		}
42		if (!$(fontForSP[0]).hasClass("d-none")) {
43			$(fontForSP[0]).addClass("d-none")
44		}
45	}else {
46		if ($(fontForSP[0]).hasClass("d-none")) {
47			$(fontForSP[0]).removeClass("d-none")
48		}
49		if (!$(fontForPC[0]).hasClass("d-none")) {
50			$(fontForPC[0]).addClass("d-none")
51		}
52	}
53})
54
55$("#modal-announce-joesFamilyMember").on("show.bs.modal", function(event) {
56	$("#joesFamilyMemberForm")[0].reset();
57	$("#joesFamilyMemberForm input:radio[name='joesFamilyMember'][value='" + $("#userJoesFamilyMember").val() + "']").prop("checked", "checked");
58});
59
60// JOESファミリーメンバーを更新
61function updateJoesFamilyMember() {
62	/*SHDB-JFM-0004対応:入力チェック start*/
63	if (!$("#joesFamilyMemberForm").valid()) {
64		joesFamilyMemberValidator.focusInvalid();
65		return;
66	}
67	/*SHDB-JFM-0004対応:入力チェック end*/
68	var formData = new FormData($("#joesFamilyMemberForm")[0]);
69	var joesFamilyMember = formData.get("joesFamilyMember");
70	$("#modal-announce-joesFamilyMember").modal("hide");
71	dispLoading("通信中です。しばらくお待ちください。");
72	$.when.apply($, $("").map(waitForLoading)).then(function() {
73		$.ajax({
74			type: "POST",
75			url: basePath() + "user/updateJoesFamilyMember",
76			data: {
77				joesFamilyMember: function() {
78					return joesFamilyMember;
79				},
80			},
81			async: false,
82			success: function(data) {
83				removeLoading();
84				if (data.code !== "200") {
85					if (data.code === "999") {
86						modalMessage = data.message;
87						$("#modal-message").modal("show");
88					}
89					isSucceed = false;
90				}
91			},
92			error: function(jqXHR, textStatus, errorThrown) {
93				console.log(errorThrown);
94				removeLoading();
95				if (textStatus !== "") {
96					modalMessage = "システムエラーになります。管理者に連絡してください。";
97					$("#modal-message").modal("show");
98					isSucceed = false;
99				}
100			}
101		});
102	});
103}
104
105/*SHDB-JFM-0004対応:入力チェック start*/
106function joesFamilyMemberFormValidate() {
107	joesFamilyMemberValidator = $("#joesFamilyMemberForm").validate({
108		onfocusout: false,
109		focusInvalid: true,
110		errorPlacement: function(error, element) {
111			if (element.attr("name") == "joesFamilyMember") {
112				error.appendTo(".joesFamilyMember-invalid-feedback");
113				$(".joesFamilyMember-invalid-feedback").attr("style", "display:block");
114			}
115		},
116		highlight: function(element) {
117			if (!$(element).hasClass("is-invalid")) {
118				$(element).addClass("is-invalid");
119			}
120		},
121		unhighlight: function(element) {
122			if ($(element).hasClass("is-invalid")) {
123				$(element).removeClass("is-invalid");
124			}
125		},
126		rules: {
127			joesFamilyMember: {
128				required: true,
129			}
130		},
131	});
132
133}
134/*SHDB-JFM-0004対応:入力チェック end*/
135
136$("#modal-calender-tooltip").on("show.bs.modal", function(event) {
137	var backModal = event.relatedTarget.getAttribute("data-back-modal");
138	if (backModal !== null && backModal !== "") {
139		event.currentTarget.setAttribute("data-back-modal", backModal);
140	}
141});
142
143$("#modal-calender-tooltip").on("hide.bs.modal", function(event) {
144	var backModal = event.currentTarget.getAttribute("data-back-modal");
145	if (backModal !== null && backModal !== "") {
146		$("#addressItemModal").modal("show");
147	}
148});
149
150var str2array = function(str) {
151	var array = [],i,il=str.length;
152	for(i=0;i<il;i++) array.push(str.charCodeAt(i));
153	return array;
154};
155
156var basePath = function() {
157	//アクセス中URI
158	var accessPath = window.document.location.href;
159	// root address
160	var rootPath = window.document.location.pathname;
161	var rootIndex = accessPath.indexOf(rootPath);
162	// localhost - 使用禁止
163	//var localhostPath = accessPath.substring(0, rootIndex);
164	//var baseURL = localhostPath + rootPath.substring(0, rootPath.substr(1).indexOf('/') + 1) + "/";
165	//return baseURL;
166	// 本番、検証、ローカル
167	var localhostPath = accessPath.substring(0, rootIndex) + "/";
168	return localhostPath;
169}
170
171/*
172 利用者中分類リストを取得
173 lcategoryTypeId:利用者大分類テキストボックスID
174 mcategoryTypeId:利用者中分類テキストボックスID
175 scategoryTypeId:利用者小分類テキストボックスID
176*/
177// SHDB-UT-0010
178function getMUserMcategoryList(lcategoryTypeId, mcategoryTypeId, scategoryTypeId, memberType) {
179	// 利用者大分類値を取得
180	var userLcategoryType = $("#" + lcategoryTypeId).val();
181
182	// 利用者種別1が「500:企業・団体」の場合、役職名入力エリアを表示する
183	if (userLcategoryType === '500') {
184		if ($("#tmpPositionName").length > 0) {
185			$("#tmpPositionName").parent().parent().parent().removeClass("display-none-ham");
186		}
187		// 企業カルテの実装START------------------------------------------------------------------------
188		if ($("#searchDepartmentName").length > 0) {
189			$("#searchDepartmentName").parent().parent().removeClass("display-none-ham");
190		}
191		if ($("#addDepartmentName").length > 0) {
192			$("#addDepartmentName").parent().parent().removeClass("display-none-ham");
193		}
194		if ($("#editDepartmentName").length > 0) {
195			$("#editDepartmentName").parent().parent().removeClass("display-none-ham");
196			$("#editDepartmentName").val($("#userDepartmentName").val());
197		}
198		// 企業カルテの実装END------------------------------------------------------------------------
199		if ($("#searchPositionName").length > 0) {
200			$("#searchPositionName").parent().parent().removeClass("display-none-ham");
201		}
202		if ($("#addPositionName").length > 0) {
203			$("#addPositionName").parent().parent().removeClass("display-none-ham");
204		}
205		if ($("#editPositionName").length > 0) {
206			$("#editPositionName").parent().parent().removeClass("display-none-ham");
207			$("#editPositionName").val($("#userPositionName").val());
208		}
209	} else {
210		if ($("#tmpPositionName").length > 0) {
211			$("#tmpPositionName").parent().parent().parent().addClass("display-none-ham");
212			$("#tmpPositionName").val("");
213		}
214		// 企業カルテの実装START------------------------------------------------------------------------
215		if ($("#searchDepartmentName").length > 0) {
216			$("#searchDepartmentName").parent().parent().addClass("display-none-ham");
217			$("#searchDepartmentName").val("");
218		}
219		if ($("#addDepartmentName").length > 0) {
220			$("#addDepartmentName").parent().parent().addClass("display-none-ham");
221			$("#addDepartmentName").val("");
222		}
223		if ($("#editDepartmentName").length > 0) {
224			$("#editDepartmentName").parent().parent().addClass("display-none-ham");
225			$("#editDepartmentName").val("");
226		}
227		// 企業カルテの実装END------------------------------------------------------------------------
228		if ($("#searchPositionName").length > 0) {
229			$("#searchPositionName").parent().parent().addClass("display-none-ham");
230			$("#searchPositionName").val("");
231		}
232		if ($("#addPositionName").length > 0) {
233			$("#addPositionName").parent().parent().addClass("display-none-ham");
234			$("#addPositionName").val("");
235		}
236		if ($("#editPositionName").length > 0) {
237			$("#editPositionName").parent().parent().addClass("display-none-ham");
238			$("#editPositionName").val("");
239		}
240		$("#positionName").val("");
241	}
242
243	// 利用者大分類値がブランクの場合、又は利用者大分類値がnullの場合、
244	if (userLcategoryType === "" || userLcategoryType === null) {
245		// 利用者中分類オプションが空白になる
246		$("#" + mcategoryTypeId).empty();
247		// 利用者中分類選択不可
248		$("#" + mcategoryTypeId).attr("disabled", true);
249		// 利用者小分類オプションが空白になる
250		$("#" + scategoryTypeId).empty();
251		// 利用者小分類選択不可
252		$("#" + scategoryTypeId).attr("disabled", true);
253		return;
254	}
255
256	var url = "";
257	// ログインしてない場合、
258	if ($("#loginStatus").val() === "0") {
259		url = basePath() + "master/getMUserMcategoryListByUnlogin";
260	} else {// ログインしている場合、
261		url = basePath() + "master/getMUserMcategoryList";
262	}
263	$.ajax({
264		type: "POST",
265		url: url,
266		data: {
267			userLcategoryType: userLcategoryType
268		},
269		success: function(data) {
270
271			// 利用者中分類オプションが空白になる
272			$("#" + mcategoryTypeId).empty();
273			// 利用者中分類選択可
274			$("#" + mcategoryTypeId).attr("disabled", false);
275			// 利用者小分類オプションが空白になる
276			$("#" + scategoryTypeId).empty();
277			// 利用者小分類選択不可
278			$("#" + scategoryTypeId).attr("disabled", true);
279			// 利用者中分類のオプションを作成
280			var optionInnerHtml = "";
281			optionInnerHtml = optionInnerHtml + "<option value=''></option>";
282			for (var i = 0; i < data.length; i++) {
283				// 利用者大分類が家族の場合
284				if (userLcategoryType === "200") {
285					// 選択された所属の維持会員区分が会員の場合
286					if ($("#"+ memberType).val() === '001') {
287						if (data[i].userMcategoryType === '210') {
288							optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userMcategoryType + "'>" + data[i].userMcategoryName + "</option>";
289						}
290					} else if ($("#"+ memberType).val() === '000') {
291						if (data[i].userMcategoryType === '220') {
292							optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userMcategoryType + "'>" + data[i].userMcategoryName + "</option>";
293						}
294					} else {
295						optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userMcategoryType + "'>" + data[i].userMcategoryName + "</option>";
296					}
297				} else if (userLcategoryType === "900") {
298					// 選択された所属の維持会員区分が会員の場合
299					if ($("#"+ memberType).val() === '001') {
300						if (data[i].userMcategoryType === '910') {
301							optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userMcategoryType + "'>" + data[i].userMcategoryName + "</option>";
302						}
303					} else if ($("#"+ memberType).val() === '000') {
304						if (data[i].userMcategoryType === '920') {
305							optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userMcategoryType + "'>" + data[i].userMcategoryName + "</option>";
306						}
307					} else {
308						optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userMcategoryType + "'>" + data[i].userMcategoryName + "</option>";
309					}
310				} else {
311					optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userMcategoryType + "'>" + data[i].userMcategoryName + "</option>";
312				}
313			}
314			$("#" + mcategoryTypeId).append(optionInnerHtml);
315		},
316		error: function(jqXHR, textStatus, errorThrown) {
317			console.log(errorThrown);
318		}
319	});
320}
321
322/*
323 利用者小分類リストを取得
324 lcategoryTypeId:利用者大分類テキストボックスID
325 mcategoryTypeId:利用者中分類テキストボックスID
326 scategoryTypeId:利用者小分類テキストボックスID
327*/
328// SHDB-UT-0010
329function getMUserScategoryList(lcategoryTypeId, mcategoryTypeId, scategoryTypeId) {
330	// 利用者中分類値を取得
331	var userLcategoryType = $("#" + lcategoryTypeId).val();
332	// 利用者中分類値がブランクの場合、又は利用者中分類値がnullの場合、
333	if (userLcategoryType === "" || userLcategoryType === null) {
334		// 利用者小分類オプションが空白になる
335		userLcategoryType = "100";
336
337		// 利用者中分類値を取得
338		var userMcategoryType = $("#" + mcategoryTypeId).val();
339		// 利用者中分類値がブランクの場合、又は利用者中分類値がnullの場合、
340		if (userMcategoryType === "" || userMcategoryType === null) {
341			// 利用者小分類オプションが空白になる
342			$("#" + scategoryTypeId).empty();
343			// 利用者小分類選択不可
344			$("#" + scategoryTypeId).attr("disabled", true);
345			return;
346		}
347		var url = "";
348		// ログインしてない場合、
349		if ($("#loginStatus").val() === "0") {
350			url = basePath() + "master/getMUserScategoryListByUnlogin";
351		} else {// ログインしている場合、
352			url = basePath() + "master/getMUserScategoryList";
353		}
354
355		$.ajax({
356			type: "POST",
357			url: url,
358			data: {
359				userLcategoryType: userLcategoryType,
360				userMcategoryType: userMcategoryType
361			},
362			success: function(data) {
363				// 利用者小分類オプションが空白になる
364				$("#" + scategoryTypeId).empty();
365				// 利用者小分類選択可
366				$("#" + scategoryTypeId).attr("disabled", false);
367
368				// 利用者小分類のオプションを作成
369				var optionInnerHtml = "";
370				// 利用者小分類がReservedのみの場合は選択不可状態でReservedを表示
371				if (data[0].userScategoryName === "Reserved") {
372					// 利用者小分類選択不可
373					$("#" + scategoryTypeId).attr("disabled", true);
374					for (var i = 0; i < data.length; i++) {
375						optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userScategoryType + "'>" + data[i].userScategoryName + "</option>";
376					}
377				} else {
378					// 最初の選択肢に空白を格納
379					optionInnerHtml = optionInnerHtml + "<option value=''></option>";
380					for (var i = 0; i < data.length; i++) {
381						optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userScategoryType + "'>" + data[i].userScategoryName + "</option>";
382					}
383				}
384				$("#" + scategoryTypeId).append(optionInnerHtml);
385			},
386			error: function(jqXHR, textStatus, errorThrown) {
387				console.log(errorThrown);
388			}
389		});
390	} else {
391		// 利用者中分類値を取得
392		var userMcategoryType = $("#" + mcategoryTypeId).val();
393		// 利用者中分類値がブランクの場合、又は利用者中分類値がnullの場合、
394		if (userMcategoryType === "" || userMcategoryType === null) {
395			// 利用者小分類オプションが空白になる
396			$("#" + scategoryTypeId).empty();
397			// 利用者小分類選択不可
398			$("#" + scategoryTypeId).attr("disabled", true);
399			return;
400		}
401		var url = "";
402		// ログインしてない場合、
403		if ($("#loginStatus").val() === "0") {
404			url = basePath() + "master/getMUserScategoryListByUnlogin";
405		} else {// ログインしている場合、
406			url = basePath() + "master/getMUserScategoryList";
407		}
408
409		$.ajax({
410			type: "POST",
411			url: url,
412			data: {
413				userLcategoryType: $("#" + lcategoryTypeId).val(),
414				userMcategoryType: userMcategoryType
415			},
416			async: false,
417			success: function(data) {
418				// 利用者小分類オプションが空白になる
419				$("#" + scategoryTypeId).empty();
420				// 利用者小分類選択可
421				$("#" + scategoryTypeId).attr("disabled", false);
422
423				// 利用者小分類のオプションを作成
424				var optionInnerHtml = "";
425				// 利用者小分類のオプションを作成
426				var optionInnerHtml = "";
427				// 利用者小分類がReservedのみの場合は選択不可状態でReservedを表示
428				if (data[0].userScategoryName === "Reserved") {
429					// 利用者小分類選択不可
430					$("#" + scategoryTypeId).attr("disabled", true);
431					for (var i = 0; i < data.length; i++) {
432						optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userScategoryType + "'>" + data[i].userScategoryName + "</option>";
433					}
434				} else {
435					// 最初の選択肢に空白を格納
436					optionInnerHtml = optionInnerHtml + "<option value=''></option>";
437					for (var i = 0; i < data.length; i++) {
438						// メールからの利用者情報登録画面の場合又はプロフィール編集画面の場合
439						if ($("#pageName").val() === 'register' || $("#pageName").val() === 'profile') {
440							optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userScategoryType + "'>" + data[i].userScategoryName + "</option>";
441						} else if ($("#pageName").val() === 'subuser') {
442							// 利用者情報登録画面の場合
443							var houseHoldUserSCtgTypeArr = ["211000", "221000", "911100", "912100", "921100", "922100"];
444							if (houseHoldUserSCtgTypeArr.indexOf(data[i].userScategoryType) != -1) {
445								continue;
446							}
447							optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userScategoryType + "'>" + data[i].userScategoryName + "</option>";
448						} else {
449							optionInnerHtml = optionInnerHtml + "<option value='" + data[i].userScategoryType + "'>" + data[i].userScategoryName + "</option>";
450						}
451					}
452				}
453				$("#" + scategoryTypeId).append(optionInnerHtml);
454			},
455			error: function(jqXHR, textStatus, errorThrown) {
456				console.log(errorThrown);
457			}
458		});
459	}
460}
461
462function setButtonAvailable(scategoryTypeId , buttonDisabled, buttonEnabled) {
463
464	if ("212000,222000,213000,223000,910200,920200,910300,920300".indexOf($("#" + scategoryTypeId).val()) >= 0) {
465		$(buttonDisabled).hide();
466		$(buttonEnabled).show();
467	} else {
468		$(buttonDisabled).show();
469		$(buttonEnabled).hide();
470	}
471}
472
473var DatetimepickerOption = {
474	autoclose: true,
475	locale: 'ja',
476	dayViewHeaderFormat: 'YYYYå¹´ MMMM',
477	focusOnShow: false,
478	/*sideBySide: true,*/
479	viewMode: "days",
480	icons: {
481		time: 'bi-clock',
482		date: 'bi-calendar3',
483		up: 'bi-caret-up-fill',
484		down: 'bi-caret-down-fill',
485		previous: 'bi-caret-left-fill',
486		next: 'bi-caret-right-fill',
487		today: 'bi-calendar-check',
488		clear: 'bi-trash',
489		close: 'bi-x-lg',
490	},
491	buttons: {
492		showToday: true,
493		showClear: true,
494		showClose: true,
495	},
496	tooltips: {
497		today: '今日',
498		clear: 'クリア',
499		close: '閉じる',
500		selectMonth: '月を選択',
501		prevMonth: '前月',
502		nextMonth: '次月',
503		selectYear: '年を選択',
504		prevYear: '前年',
505		nextYear: '次年',
506		selectTime: '時間を選択',
507		selectDate: '日付を選択',
508		prevDecade: '前期間',
509		nextDecade: '次期間',
510		selectDecade: '期間を選択',
511		prevCentury: '前世紀',
512		nextCentury: '次世紀',
513		pickHour: '時間を取得',
514		incrementHour: '時間を増加',
515		decrementHour: '時間を減少',
516		pickMinute: '分を取得',
517		incrementMinute: '分を増加',
518		decrementMinute: '分を減少',
519		pickSecond: '秒を取得',
520		incrementSecond: '秒を増加',
521		decrementSecond: '秒を減少',
522		togglePeriod: '午前/午後切替',
523		selectTime: '時間を選択'
524	}
525}
526
527function showDatetimepicker(obj, className, target) {
528	var self = $(obj);
529	var dateFormat = self[0].dataset.dateFormat;
530	var dateType = "";
531	if (self[0].dataset.dateType) {
532		dateType = self[0].dataset.dateType;
533	}
534
535	var inputedDate = $("#" + target).val();
536
537	var dateFormatOption = { format: dateFormat };
538	if (dateFormat === "YYYY-MM-DD") {
539		var defaultDateTime = { date: moment(inputedDate)._isValid ? inputedDate : moment().format("YYYY-MM-DD") };
540		$.extend(dateFormatOption, defaultDateTime)
541	}
542
543	if (dateFormat === "YYYY-MM-DD HH:mm:ss" && dateType === "start") {
544		var defaultDateTime = { date: moment(inputedDate)._isValid ? inputedDate : moment().format("YYYY-MM-DD") + " 00:00:00" };
545		$.extend(dateFormatOption, defaultDateTime)
546	}
547	if (dateFormat === "YYYY-MM-DD HH:mm:ss" && dateType === "end") {
548		var defaultDateTime = { date: moment(inputedDate)._isValid ? inputedDate : moment().format("YYYY-MM-DD") + " 23:59:59" };
549		$.extend(dateFormatOption, defaultDateTime)
550	}
551	if (self[0].dataset.minDate) {
552		if (self[0].dataset.minDate === "1900-01-01") {
553			$.extend(dateFormatOption, { minDate: moment(self[0].dataset.minDate).format("YYYY-MM-DD") });
554			//$.extend(dateFormatOption, { maxDate: moment(new Date()).format("YYYY-MM-DD") });
555		}
556	}
557	$(self).attr("data-toggle", "datetimepicker");
558	$(self).attr("data-target", "#" + target);
559	$("." + className).datetimepicker('destroy');
560	$("." + className).datetimepicker(
561		$.extend(DatetimepickerOption, dateFormatOption)
562	)
563}
564
565function initSyozokuTable(event) {
566	var tableId = event.data.tableId;
567	var syozokuCdInputTmp = event.data.syozokuCdInputTmp;
568	var syozokuNameInputTmp = event.data.syozokuNameInputTmp;
569	var memberTypeInputTmp = event.data.memberTypeInputTmp;
570	var syozokuTypeInputTmp = event.data.syozokuTypeInputTmp;
571	var syozokuCdInput = event.data.syozokuCdInput;
572	var syozokuNameInput = event.data.syozokuNameInput;
573	var modalSyozokuNameInput = event.data.modalSyozokuNameInput;
574	var modalId = event.data.modalId;
575	$("#" + tableId).bootstrapTable('destroy');
576	$("#" + tableId).bootstrapTable({
577		locale: 'ja-JP',
578		url: basePath() + 'master/getMSyozokuList',
579		method: 'post',
580		contentType: "application/x-www-form-urlencoded",
581		striped: true,
582		cache: false,
583		pagination: true,
584		sortable: true,
585		sortOrder: "asc",
586		sidePagination: "server",
587		pageNumber: 1,
588		pageSize: 10,
589		pageList: [10, 25, 50, 100],
590		search: false,
591		strictSearch: true,
592		showColumns: false,
593		showRefresh: false,
594		minimumCountColumns: 2,
595		clickToSelect: true,
596		singleSelect: true,
597		checkboxHeader: false,
598		uniqueId: "syozokuCd",
599		showToggle: false,
600		cardView: false,
601		detailView: false,
602		queryParams: function(params) {
603			var temp = {
604				pageSize: params.limit,
605				pageNum: params.offset / params.limit + 1,
606				modalSyozokuName: $("#" + modalSyozokuNameInput).val()
607			};
608			return temp;
609		},
610		//寄附金専用項目排除
611		responseHandler: function (res) {
612			if (res && Array.isArray(res.rows)) {
613			  const filtered = res.rows.filter(r => r.syozokuName !== '未登録企業(寄附金)');
614			  return {
615			    ...res,
616			    rows: filtered,
617			    total: res.total - (res.rows.length - filtered.length)
618			  };
619			}
620			return res;
621		},
622		columns: [{
623			checkbox: true,
624			visible: true
625		}, {
626			field: 'syozokuName',
627			title: '所属先名',
628			sortable: true,
629			visible: true
630		}, {
631			field: 'memberType',
632			title: '維持会員区分',
633			visible: false
634		}],
635		onCheck: function(row) {
636			/*所属先名をここに入力してください*/
637			if (row.syozokuCd === "001000000200") {
638				$("#" + syozokuCdInput).val("");
639				$("#" + syozokuNameInput).val("");
640				$("#" + syozokuCdInputTmp).val(row.syozokuCd);
641				$("#" + syozokuNameInputTmp).val("");
642				$("#" + syozokuNameInput).attr("placeholder", "所属先名をここに入力してください");
643				$("#" + syozokuNameInput).removeAttr("readonly");
644			} else {
645				// SHDB-UT-0003 修正-----------------------------------------start
646				$("#" + syozokuNameInput).rules("remove");
647				$(".syozokuName-invalid-feedback").empty();
648				if ($("#" + syozokuNameInput).hasClass("is-invalid")) {
649					$("#" + syozokuNameInput).removeClass("is-invalid");
650				}
651				$("#" + syozokuNameInput).rules("add", { required: true });
652				// SHDB-UT-0003 修正-------------------------------------------end
653
654				$("#" + syozokuCdInputTmp).val(row.syozokuCd);
655				$("#" + syozokuNameInputTmp).val(row.syozokuName);
656				$("#" + syozokuNameInput).attr("readonly", "readonly");
657			}
658
659			$("#" + memberTypeInputTmp).val(row.memberType);
660			$("#" + syozokuTypeInputTmp).val(row.syozokuType);
661
662			if (modalId !== "") {
663				$("#" + modalId).modal("show");
664			}
665		},
666		onUncheck: function(row) {
667			$("#" + syozokuCdInputTmp).val("");
668			$("#" + syozokuNameInputTmp).val("");
669			$("#" + memberTypeInputTmp).val("");
670		},
671	});
672}
673
674function closeSearchDialog(){
675	var syozokuCdInput = $("#syozokuCdTmp").val();
676	var syozokuNameInput = $("#syozokuNameTmp").val();
677	var syozokuTypeInput = $("#syozokuTypeTmp").val();
678	$("#syozokuCd").val(syozokuCdInput);
679	$("#syozokuName").val(syozokuNameInput);
680	if (syozokuCdInput === '001000000200') {
681		$("#szkNmNotInput").removeClass("d-none");
682	} else {
683		$("#szkNmNotInput").addClass("d-none");
684	}
685	displayHondaSyozoku(syozokuCdInput, false);
686
687	var array = $("#syozokuDataTable").bootstrapTable('getSelections');
688	if (array.length <= 0) {
689		$("#userLcategoryType").attr("disabled", true);
690		$("#userLcategoryType").val("");
691		$("#userMcategoryType").attr("disabled", true);
692		$("#userMcategoryType").val("");
693		$("#userScategoryType").attr("disabled", true);
694		$("#userScategoryType").val("");
695	} else {
696
697		setuserLcategoryTypeOption(syozokuCdInput, syozokuTypeInput, "userLcategoryType");
698
699		var accountCreateKbn = $("#accountCreateKbn").val();
700		if (accountCreateKbn === '009' || $("#pageName").val() ==='register') {
701			$("#userLcategoryType").attr("disabled", false);
702			$("#userLcategoryType").val("");
703			$("#userMcategoryType").attr("disabled", true);
704			$("#userMcategoryType").val("");
705			$("#userScategoryType").attr("disabled", true);
706			$("#userScategoryType").val("");
707		}
708
709		if ($("#accountCreateKbn").val() === '004') {
710			setUserCategoryTypeForFamily();
711		}
712	}
713
714	$("#modal-search-syozoku").modal("hide");
715}
716
717// Top画面の「アカウント作成」ボタンを押下
718function moveToSubUser(userScategoryType) {
719	var householdLordArray = ["211000", "221000", "911100", "912100", "921100", "922100"];
720	// 世帯主以外の場合、チェック実行無し
721	if (householdLordArray.indexOf(userScategoryType) === -1) {
722		window.location.href = basePath() + "index/subUser";
723	} else {
724		$.ajax({
725			type: "POST",
726			data: {
727				contentsCd: "000000000001",
728			},
729			url: basePath() + "index/existsSSOAccount",
730			async: false,
731			success: function(data) {
732				// true:t_ssoに登録されている
733				// false: t_ssoに登録されてない
734				result = data;
735				if (data) {
736					window.location.href = basePath() + "index/subUser";
737				} else {
738					modalMessage = "マイポータルトップ画面のWebサービス申込サイトボタンを押下し、" + "<br>\n\r" + "Webサービス申込サイトへの登録を行ってから再操作ください。";
739					$("#modal-message").modal("show");
740				}
741			},
742			error: function(jqXHR, textStatus, errorThrown) {
743				error = errorThrown;
744			}
745		});
746	}
747}
748
749// 家族成員一覧エリアで「もっと表示する」を押下する時、
750function showMoreFamilyMember() {
751	$(".moreFamilyMember").each(function() {
752		if ($(this).hasClass("display-none")) {
753			$(this).removeClass("display-none");
754		} else {
755			$(this).addClass("display-none");
756		}
757	});
758}
759
760function showFamilyMemberDetail(target) {
761	var familyMemberUserCd = $(target).attr("data-userCd");
762
763	$("#familyMemberForm").attr("method", "post");
764	$("#familyMemberForm").attr("action", basePath() + "index/showFamilyMemberDetail");
765	$("#familyMemberForm #familyMemberUserCd").val(familyMemberUserCd);
766	$("#familyMemberForm").submit();
767}
768
769function displayHondaSyozoku(syozokuCdInput, isChild) {
770
771	if (syozokuCdInput.startsWith($("#hondaSyozokuCd").val()) && !isChild) {
772		$(".isHondaSyozoku").removeClass("display-none-ham");
773		displayOverseasOfficeName();
774	} else {
775		$(".isHondaSyozoku").addClass("display-none-ham");
776		$("#tmpOverseasOfficeName").parents(".isHondaSyozoku").addClass("display-none-ham");
777
778		$(".isHondaSyozoku #jobNumber").val("");
779		$(".isHondaSyozoku #domesticOfficeCd").val("");
780		$(".isHondaSyozoku #overseasOfficeCd").val("");
781		$(".isHondaSyozoku #tmpOverseasOfficeName").val("");
782		$(".isHondaSyozoku #overseasOfficeName").val("");
783	}
784}
785
786// 所属種別紐づく利用者種別を設定
787function setuserLcategoryTypeOption(syozokuCdInput, syozokuTypeInput, elementId) {
788
789	$("#"+ elementId +" option").each(function() {
790		$(this).removeClass("d-none");
791		$(this).attr("disabled", false);
792	})
793
794	if (syozokuCdInput === '001000000200') {return;}
795
796	// 企業
797	if (syozokuTypeInput == 1) {
798		$("#"+ elementId +" option").each(function() {
799			if (["", "100", "200", "300", "500", "900", "A00"]. indexOf($(this).val()) === -1 ) {
800				$(this).addClass("d-none");
801				$(this).attr("disabled", true);
802			}
803		})
804		return;
805	}
806
807	// 国内学校
808	if (syozokuTypeInput == 2) {
809		$("#"+ elementId +" option").each(function() {
810			if (["", "100", "200", "300", "600", "900"]. indexOf($(this).val()) === -1 ) {
811				$(this).addClass("d-none");
812				$(this).attr("disabled", true);
813			}
814		})
815		return;
816	}
817
818	// 海外学校
819	if (syozokuTypeInput == 3) {
820		$("#"+ elementId +" option").each(function() {
821			if (["", "100", "200", "300", "700", "900"]. indexOf($(this).val()) === -1 ) {
822				$(this).addClass("d-none");
823				$(this).attr("disabled", true);
824			}
825		})
826		return;
827	}
828
829	// 業者など
830	if (syozokuTypeInput == 4) {
831		$("#"+ elementId +" option").each(function() {
832			if (["", "100", "800"]. indexOf($(this).val()) === -1 ) {
833				$(this).addClass("d-none");
834				$(this).attr("disabled", true);
835			}
836		})
837		return;
838	}
839
840}
841
842// 家族の場合、維持会員(維持非会員)は選択された所属と紐づく
843	// 利用者種別1が家族の場合、
844function setUserCategoryTypeForFamily() {
845	if ($("#userLcategoryType").val() === "200") {
846		// 選択された所属は維持会員の場合、
847		if ($("#memberTypeTmp").val() === "001") {
848			$("#userMcategoryType").val("210");
849			$("#userMcategoryTypeName").val("維持会員");
850		} else {
851			$("#userMcategoryType").val("220");
852			$("#userMcategoryTypeName").val("維持非会員");
853		}
854	}
855	// 利用者種別1が学校採用教員採用支援管理システムの場合、
856	if ($("#userLcategoryType").val() === "900") {
857		// 選択された所属は維持会員の場合、
858		if ($("#memberTypeTmp").val() === "001") {
859			$("#userMcategoryType").val("910");
860			$("#userMcategoryTypeName").val("維持会員");
861		} else {
862			$("#userMcategoryType").val("920");
863			$("#userMcategoryTypeName").val("維持非会員");
864		}
865	}
866
867	getMUserScategoryList("userLcategoryType","userMcategoryType","userScategoryType");
868}
869
870
871// 海外事業所変更する場合
872function displayOverseasOfficeName() {
873	if ($("#overseasOfficeCd").val() === "000000000000") {
874		$("#tmpOverseasOfficeName").attr("disabled", false);
875		$("#tmpOverseasOfficeName").parents(".isHondaSyozoku").removeClass("display-none-ham");
876		$("#overseasOfficeName").val($("#tmpOverseasOfficeName").val());
877	} else {
878		$("#tmpOverseasOfficeName").attr("disabled", true);
879		$("#tmpOverseasOfficeName").parents(".isHondaSyozoku").addClass("display-none-ham");
880		$("#overseasOfficeName").val($("#overseasOfficeCd").find("option:selected").text());
881	}
882}
883
884function getMCountryList(areaTarget, countryTarget, cityTarget) {
885	var mAreaCd = $("#" + areaTarget).val();
886	if (mAreaCd === "") {
887		$("#" + countryTarget).empty();
888		$("#" + countryTarget).attr("disabled", true);
889		$("#" + cityTarget).empty();
890		$("#" + cityTarget).attr("disabled", true);
891		return;
892	}
893	$.ajax({
894		type: "POST",
895		url: basePath() + "master/getMCountryList",
896		data: { areaCd: mAreaCd },
897		success: function(data) {
898			$("#" + countryTarget).empty();
899			$("#" + countryTarget).attr("disabled", false);
900			$("#" + cityTarget).empty();
901			$("#" + cityTarget).attr("disabled", true);
902			var optionInnerHtml = "";
903			optionInnerHtml = optionInnerHtml + "<option value=''></option>";
904			for (var i = 0; i < data.length; i++) {
905				optionInnerHtml = optionInnerHtml + "<option value='" + data[i].countryCd + "'>" + data[i].countryName + "</option>";
906			}
907			$("#" + countryTarget).append(optionInnerHtml);
908		},
909		error: function(jqXHR, textStatus, errorThrown) {
910			console.log(errorThrown);
911		}
912	});
913}
914
915function getMCityList(areaTarget, countryTarget, cityTarget) {
916	var mAreaCd = $("#" + areaTarget).val();
917	var mCountryCd = $("#" + countryTarget).val();
918	if (mCountryCd === "") {
919		$("#" + cityTarget).empty();
920		$("#" + cityTarget).attr("disabled", true);
921		return;
922	}
923	$.ajax({
924		type: "POST",
925		url: basePath() + "master/getMCityList",
926		data: {
927			areaCd: mAreaCd,
928			countryCd: mCountryCd
929		},
930		success: function(data) {
931			$("#" + cityTarget).empty();
932			$("#" + cityTarget).attr("disabled", false);
933			var optionInnerHtml = "";
934			optionInnerHtml = optionInnerHtml + "<option value=''></option>";
935			for (var i = 0; i < data.length; i++) {
936				optionInnerHtml = optionInnerHtml + "<option value='" + data[i].cityCd + "'>" + data[i].cityName + "</option>";
937			}
938			$("#" + cityTarget).append(optionInnerHtml);
939		},
940		error: function(jqXHR, textStatus, errorThrown) {
941			console.log(errorThrown);
942		}
943	});
944}
945
946/** 写真変更時のイベント */
947function changepic(obj, id) {
948	const imageFile = obj.files[0];
949	const fileNameOrigin = obj.files[0].name;
950	const lastModifiedOrigin = obj.files[0].lastModified;
951	
952	// 圧縮時の設定
953	const options = {
954		maxSizeMB: 1,
955		maxWidthOrHeight: 150
956	}
957
958	// 画像圧縮
959	imageCompression(imageFile, options)
960	.then(function (compressedFile) {
961		const img = getObjectURL(compressedFile);
962		
963		// 画像データをセット
964		document.getElementById(id).src = img;
965		
966		const myFile = new File(
967			[compressedFile],
968			fileNameOrigin, {
969				type: 'image/png',
970				lastModified: lastModifiedOrigin,
971			}
972		);
973		
974		const dataTransfer = new DataTransfer();
975		dataTransfer.items.add(myFile);
976		// アップロード用ファイルをセット
977		obj.files = dataTransfer.files;
978	})
979	.catch(function (error) {
980		console.log(error.message);
981	});
982}
983
984function changeImg(obj, imgId, imgBackgroundArea, imgArea) {
985	var newsrc = getObjectURL(obj.files[0]);
986	document.getElementById(imgId).src = newsrc;
987	if ($($(imgBackgroundArea)[0]).hasClass("d-flex justify-content-center align-items-center")) {
988		$($(imgBackgroundArea)[0]).removeClass("d-flex justify-content-center align-items-center")
989	}
990	$($(imgBackgroundArea)[0]).attr("style", "display:none");
991	$($(imgArea)[0]).attr("style", "display");
992}
993
994function getObjectURL(file) {
995	var url = null;
996	if (window.createObjectURL != undefined) { // basic
997		url = window.createObjectURL(file);
998	} else if (window.URL != undefined) { // mozilla(firefox)
999		url = window.URL.createObjectURL(file);
1000	} else if (window.webkitURL != undefined) { // webkit or chrome
1001		url = window.webkitURL.createObjectURL(file);
1002	}
1003	return url;
1004}
1005
1006function downloadBase64(base64, fileName) {
1007	base64 = base64.replace(/.+;base64,/, '');
1008	var byteCharacters = atob(base64);
1009	var byteNumbers = new Array(byteCharacters.length);
1010	for (var i = 0; i < byteCharacters.length; i++) {
1011		byteNumbers[i] = byteCharacters.charCodeAt(i);
1012	}
1013	var byteArray = new Uint8Array(byteNumbers);
1014	var blob = new Blob([byteArray], { type: 'application/octet-stream' });
1015	if (navigator.msSaveOrOpenBlob) { // if IE
1016		navigator.msSaveBlob(blob, fileName);
1017	} else { //if not IE
1018		var link = document.createElement('a');
1019		link.href = window.URL.createObjectURL(blob);
1020		link.download = fileName;
1021		link.click();
1022		window.URL.revokeObjectURL(link.href);
1023	}
1024}
1025
1026function downloadBase64Pdf(base64, fileName) {
1027	var byteCharacters = atob(base64);
1028	var byteNumbers = new Array(byteCharacters.length);
1029	for (var i = 0; i < byteCharacters.length; i++) {
1030		byteNumbers[i] = byteCharacters.charCodeAt(i);
1031	}
1032	var byteArray = new Uint8Array(byteNumbers);
1033	var blob = new Blob([byteArray], { type: 'application/pdf' });
1034	if (navigator.msSaveOrOpenBlob) { // if IE
1035		navigator.msSaveBlob(blob, fileName);
1036	} else { //if not IE
1037		var link = document.createElement('a');
1038		link.href = window.URL.createObjectURL(blob);
1039		link.download = fileName;
1040		link.click();
1041		window.URL.revokeObjectURL(link.href);
1042	}
1043}
1044
1045function changePasswordType(self, target) {
1046	if ($(self)[0].className.indexOf("bi-eye-slash") != -1) {
1047		var openEyeClass = $(self)[0].className.replace("bi-eye-slash", "bi-eye");
1048		$(self).attr("class", openEyeClass);
1049		$("#" + target).attr("type", "password");
1050	} else {
1051		var closeEyeClass = $(self)[0].className.replace("bi-eye", "bi-eye-slash");
1052		$(self).attr("class", closeEyeClass);
1053		$("#" + target).attr("type", "text");
1054	}
1055}
1056
1057
1058function clearValidateAlert(tarId) {
1059	var errorList = $("#" + tarId).validate().errorList;
1060	for (var i = 0; i < errorList.length; i++) {
1061		var element = errorList[i].element;
1062		if ($(element).hasClass("is-invalid")) {
1063			$(element).removeClass("is-invalid");
1064		}
1065	}
1066	var invalidList = $("#" + tarId + " .invalid-feedback");
1067	for (var i = 0; i < invalidList.length; i++) {
1068		var id = $(invalidList[i])[0].className.match(/.*(?=-invalid-feedback)/)[0];
1069		if ($("#" + id).hasClass("is-invalid")) {
1070			$("#" + id).removeClass("is-invalid");
1071		}
1072	}
1073	$("#" + tarId).validate().resetForm();
1074}
1075
1076// 金額フォーマット(#########⇒###,###,###)
1077function formatMoney(amount) {
1078
1079	var checkInt = /^[+-]?[0-9]+$/;
1080
1081	if (!checkInt.test(amount)) {
1082		return amount;
1083	} else {
1084		return String(amount).replace( /(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
1085	}
1086
1087}
1088
1089// Loading イメージ表示関数
1090function dispLoading(msg) {
1091	// 引数なし(メッセージなし)を許容
1092	if (msg == undefined) {
1093		msg = "";
1094	}
1095	// 画面表示メッセージ
1096	var dispMsg = "<div class='loadingMsg'>" + msg + "</div>";
1097	// ローディング画像が表示されていない場合のみ出力
1098	if ($("#loading").length == 0) {
1099		$("body").append("<div id='loading'>" + dispMsg + "</div>");
1100	}
1101}
1102
1103// Loading イメージ削除関数
1104function removeLoading() {
1105	$("#loading").remove();
1106}
1107
1108function waitForLoading(index, img) {
1109	var dfd = $.Deferred()
1110	// img要素のロード完了はimg.completeで取得できます。
1111	if (img.complete) {
1112		// すでにロードが完了していれば即時resolve。
1113		dfd.resolve()
1114	} else {
1115		// ロードが完了していなかった場合、イベントリスナー登録しロードの完了を待つ
1116		$(img).on('load', function() {
1117			resolve()
1118		})
1119	}
1120	return dfd;
1121}
1122
1123function toggleNav() {
1124  var body = document.body;
1125  var hamburger = document.getElementById('js-hamburger');
1126  var blackBg = document.getElementById('js-black-bg');
1127
1128  //管理メニュー表示時警告対策
1129  if(hamburger){
1130  	hamburger.addEventListener('click', function() {
1131  		body.classList.toggle('nav-open');
1132  		document.body.style.overflow = 'hidden';
1133  	});
1134  }
1135  if(blackBg){
1136  	blackBg.addEventListener('click', function() {
1137    	body.classList.remove('nav-open');
1138    	document.body.style.overflow = 'auto';
1139    });
1140  }
1141}
1142toggleNav();
1143
1144//エスケープ文字変換
1145function escapeStringForJSON(value) {
1146    return value
1147        .replace(/\\/g, '\\\\')  // バックスラッシュのエスケープ
1148        .replace(/"/g, '\\"')    // ダブルクォートのエスケープ
1149        .replace(/\n/g, '\\n')   // 改行のエスケープ
1150        .replace(/\r/g, '\\r')   // キャリッジリターンのエスケープ
1151        .replace(/\t/g, '\\t');  // タブのエスケープ
1152}
1153
1154// 改行コードを<br>タグに変換
1155function convertNewlinesToBreaks(str) {
1156    return str.replace(/\n/g, '<br>');
1157}
1158
1159/* 教育相談 START*/
1160function createFormattedString(consultationType, availableSlot) {
1161	var title
1162	if (availableSlot < 1) {
1163		title = `${consultationType}【満員】`;
1164	} else {
1165		title = `${consultationType}【残${availableSlot}枠】`;
1166	}
1167    return title;
1168}
1169
1170function convertConsultationType(type) {
1171    const consultationTypes = {
1172        0: "一般相談(東京面談、オンライン、メール)",
1173        1: "一般相談(オンライン)",
1174        2: "一般相談(大阪面談)",
1175        3: "一般相談(名古屋面談)",
1176        4: "英語相談",
1177        5: "コラボ相談",
1178        6: "こころの相談"
1179    };
1180    return consultationTypes[type] || "不明な相談種別";
1181}
1182
1183function setBorderColor(consultationType) {
1184	var borderColor
1185    switch (consultationType) {
1186	    case 0:
1187	        borderColor = "#4a90e2"; // 青色(明るめ)
1188	        break;
1189	    case 1:
1190	        borderColor = "#66bb6a"; // 緑色(明るめ)
1191	        break;
1192	    case 2:
1193	        borderColor = "#ffeb3b"; // 黄色(明るめ)
1194	        break;
1195	    case 3:
1196	        borderColor = "#ff7043"; // オレンジ色(明るめ)
1197	        break;
1198	    case 4:
1199	        borderColor = "#ba68c8"; // 紫色(明るめ)
1200	        break;
1201	    case 5:
1202	        borderColor = "#26c6da"; // ティール色(明るめ)
1203	        break;
1204	    case 6:
1205	        borderColor = "#ec407a"; // ピンク色(明るめ)
1206	        break;
1207	    default:
1208	        borderColor = "#9e9e9e"; // デフォルトの灰色(明るめ)
1209	        break;
1210	}
1211	return borderColor;
1212}
1213
1214function setEventBackgroundColor(availableSlot) {
1215	var backgroundColor
1216	if (availableSlot === 0) {
1217		backgroundColor = "#D3D3D3"; // ライトグレー
1218	} else {
1219		backgroundColor = "#f0f8ff"; // ライトブルー
1220	}
1221	return backgroundColor;
1222}
1223
1224//数字以外の文字を削除し、最大2桁までの入力を許可
1225//先頭の0は削除。ただし、0単体入力はOK
1226function formatInput(input) {
1227	// 入力値が空の場合はそのままにする
1228    if (input.value === "") {
1229        return;
1230    }
1231	
1232    input.value = input.value.replace(/[^0-9]+/i, '').replace(/^0+/, '') || '0';
1233}
1234
1235function getNextSetCalendar() {
1236    // スマホ(750px以下)の場合のURL
1237    var mobileURL = "https://calendar.nextset.jp/joesjapan/mobile/index.html?hl=ja";
1238    // PCの場合のURL
1239    var desktopURL = "https://calendar.nextset.jp/joesjapan/gp/calendar.html";
1240
1241    // 画面幅をチェック
1242    var baseURL = window.innerWidth <= 750 ? mobileURL : desktopURL;
1243
1244    // 別タブで表示
1245    window.open(baseURL, '_blank');
1246}
1247/* 教育相談 END*/
1248
1249/** 選択されたアイテムのテキストを返すメソッド(ドロップダウンリスト用) */
1250function getDropdownTitle(obj){
1251	if(obj.selectedIndex < 1){
1252		// 未選択の場合は空白を返す
1253		return "";
1254	} else {
1255		return obj.options[obj.selectedIndex].text
1256	}
1257}
1258
1259/** 受け取った要素の子要素を全て削除するメソッド */
1260function clearAllChildObject(parentObj){
1261	while(parentObj.firstChild){
1262		parentObj.removeChild(parentObj.firstChild);
1263	}
1264}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.