1$(function(){ 2 var nowStep = 0; 3 var lastStep = 4; 4 5 // ãè«æ±å å®¹ã®æçµé¸æå¤ 6 var lastInsureKind = ""; 7 8 // ãå ±åè æ å ±ã®ãªã»ãããã©ã° 9 var reporterInfoReset = false; 10 // è£å対象è ãã¾(ã±ã¬)æ å ±ã®ãªã»ãããã©ã° 11 var injuredCompensationInfoReset = false; 12 // è£å対象è ãã¾(ç æ°)æ å ±ã®ãªã»ãããã©ã° 13 var illCompensationInfoReset = false; 14 // è£å対象è ãã¾(è¬ç¥è²»ç¨ã®ã¿)æ å ±ã®ãªã»ãããã©ã° 15 var funeralCompensationInfoReset = false; 16 // è¬åè²»ç¨ã®è² æ è (ã±ã¬)æ å ±ã®ãªã»ãããã©ã° 17 var injuredFuneralInfoReset = false; 18 // è¬åè²»ç¨ã®è² æ è (ç æ°)æ å ±ã®ãªã»ãããã©ã° 19 var illFuneralInfoReset = false; 20 // è¬åè²»ç¨ã®è² æ è (è¬ç¥è²»ç¨ã®ã¿)æ å ±ã®ãªã»ãããã©ã° 21 var funeralInfoReset = false; 22 // æ¸é¡ã®éä»å æ å ±ã®ãªã»ãããã©ã° 23 var destinationInfoReset = false; 24 // æ¥ä¸é£çµ¡å æ å ±ã®ãªã»ãããã©ã° 25 var contactInfoReset = false; 26 27 const buttonNameList = { 28 1:"åæãã¦é²ã", 29 2:"è«æ±å 容ã¸é²ã", 30 3:"使ã»é»è©±çªå·ã¸é²ã", 31 4:"é£çµ¡äºé ã¸é²ã", 32 5:"確èªã¸é²ã" 33 }; 34 35 // Ajaxã®å¦çä¸ãã©ã° 36 isProcessing = false; 37 38 // 対象éµä¾¿çªå·1 39 var targetZip1 = ""; 40 // 対象éµä¾¿çªå·2 41 var targetZip2 = ""; 42 // 対象é½éåºçãã£ã¼ã«ã 43 var targetPrefecture = ""; 44 // å¯¾è±¡ä½æãã£ã¼ã«ã 45 var targetAddDetail = ""; 46 47 // å種ãã£ã¼ã«ã ----start 48 // éå§stepæå® 49 const $startStep = $('input[name="startStep"]'); 50 51 // ãå¥ç´è æ§ã¨ã®ç¶æ 52 const $a_reporter_relationship = $('input[name="a_reporter_relationship"]'); 53 // ãå¥ç´è æ§ã¨ã®ç¶æ(詳細) 54 const $a_reporter_relationship_detail = $('input[name="a_reporter_relationship_detail"]'); 55 56 // ãå ±åè (å§å) 57 const $a_reporter_kjsei = $('input[name="a_reporter_kjsei"]'); 58 const $a_reporter_kjmei = $('input[name="a_reporter_kjmei"]'); 59 60 // ãå ±åè (ã»ã¤ã¡ã¤) 61 const $a_reporter_knsei = $('input[name="a_reporter_knsei"]'); 62 const $a_reporter_knmei = $('input[name="a_reporter_knmei"]'); 63 64 // ä¿éºéãè«æ±æ å ±ç»é²å®äºã¡ã¼ã« 65 const $a_reporter_reply_mail_confirm = $('input[name="a_reporter_reply_mail_confirm"]'); 66 67 // ãå¥ç´è ãã¾(å§å) 68 const $a_policy_info_kjsei = $('input[name="a_policy_info_kjsei"]'); 69 const $a_policy_info_kjmei = $('input[name="a_policy_info_kjmei"]'); 70 71 // ãå¥ç´è ãã¾(ã»ã¤ã¡ã¤) 72 const $a_policy_info_knsei = $('input[name="a_policy_info_knsei"]'); 73 const $a_policy_info_knmei = $('input[name="a_policy_info_knmei"]'); 74 75 // ãè«æ±å 容 76 const $insureKind = $('input[name="a_insure_kind"]'); 77 const $deadFlg = $('#dead_flg'); 78 79 // (ã±ã¬)è£å対象è 80 const $a_injured_compensation_person = $('input[name="a_injured_compensation_person"]'); 81 const $a_injured_relationship = $('input[name="a_injured_relationship"]'); 82 const $a_injured_kjsei = $('input[name="a_injured_kjsei"]'); 83 const $a_injured_kjmei = $('input[name="a_injured_kjmei"]'); 84 const $a_injured_knsei = $('input[name="a_injured_knsei"]'); 85 const $a_injured_knmei = $('input[name="a_injured_knmei"]'); 86 87 // (ã±ã¬)ä¿éºè«æ±ææ 88 const $a_injured_show_intention = $('input[name="a_injured_show_intention"]'); 89 90 // ã±ã¬ãããç¶æ³ 91 const $a_injured_vehicle = $('input[name="a_injured_vehicle"]'); 92 const $a_injured_vehicle_type = $('select[name="a_injured_vehicle_type"]'); 93 const $a_injured_vehicle_displacement = $('input[name="a_injured_vehicle_displacement"]'); 94 const $a_injured_vehicle_type_other = $('input[name="a_injured_vehicle_type_other"]'); 95 const $a_injured_drank = $('input[name="a_injured_drank"]'); 96 97 //(ã±ã¬)å ¥é¢ï¼/éé¢ï¼/æè¡ï¼ 98 const $a_injured_hospitalized_flg_01 = $('select[name="a_injured_hospitalized_flg_01"]'); 99 const $a_injured_outpatient_flg_01 = $('select[name="a_injured_outpatient_flg_01"]'); 100 const $a_injured_operation_flg_01 = $('select[name="a_injured_operation_flg_01"]');
101 const $a_injured_advanced_medical_care_flg_01 = $('select[name="a_injured_advanced_medical_care_flg_01"]'); 102 103 //(ã±ã¬)å ¥é¢ï¼/éé¢ï¼/æè¡ï¼ 104 const $a_injured_hospitalized_flg_02 = $('select[name="a_injured_hospitalized_flg_02"]'); 105 const $a_injured_outpatient_flg_02 = $('select[name="a_injured_outpatient_flg_02"]'); 106 const $a_injured_operation_flg_02 = $('select[name="a_injured_operation_flg_02"]'); 107 const $a_injured_advanced_medical_care_flg_02 = $('select[name="a_injured_advanced_medical_care_flg_02"]'); 108 109 //(ã±ã¬)è¬åè²»ç¨ãè² æ ãããæ¹ 110 const $a_injured_funeral_payer = $('select[name="a_injured_funeral_payer"]'); 111 const $a_injured_funeral_relation_deceased = $('input[name="a_injured_funeral_relation_deceased"]'); 112 const $a_injured_funeral_deceased_kjsei = $('input[name="a_injured_funeral_deceased_kjsei"]'); 113 const $a_injured_funeral_deceased_kjmei = $('input[name="a_injured_funeral_deceased_kjmei"]'); 114 const $a_injured_funeral_deceased_knsei = $('input[name="a_injured_funeral_deceased_knsei"]'); 115 const $a_injured_funeral_deceased_knmei = $('input[name="a_injured_funeral_deceased_knmei"]'); 116 117 // (ç æ°)è£å対象è 118 const $a_ill_compensation_person = $('input[name="a_ill_compensation_person"]'); 119 const $a_ill_relationship = $('input[name="a_ill_relationship"]'); 120 const $a_ill_kjsei = $('input[name="a_ill_kjsei"]'); 121 const $a_ill_kjmei = $('input[name="a_ill_kjmei"]'); 122 const $a_ill_knsei = $('input[name="a_ill_knsei"]'); 123 const $a_ill_knmei = $('input[name="a_ill_knmei"]'); 124 125 // (ç æ°)ä¿éºè«æ±ææ 126 const $a_ill_show_intention = $('input[name="a_ill_show_intention"]'); 127 128 //(ç æ°)å ¥é¢ï¼/æè¡ï¼ 129 const $a_ill_hospitalized_flg_01 = $('select[name="a_ill_hospitalized_flg_01"]'); 130 const $a_ill_operation_flg_01 = $('select[name="a_ill_operation_flg_01"]'); 131 const $a_ill_advanced_medical_care_flg_01 = $('select[name="a_ill_advanced_medical_care_flg_01"]'); 132 133 //(ç æ°)å ¥é¢ï¼/æè¡ï¼ 134 const $a_ill_hospitalized_flg_02 = $('select[name="a_ill_hospitalized_flg_02"]'); 135 const $a_ill_operation_flg_02 = $('select[name="a_ill_operation_flg_02"]'); 136 const $a_ill_advanced_medical_care_flg_02 = $('select[name="a_ill_advanced_medical_care_flg_02"]'); 137 138 //(ç æ°)è¬åè²»ç¨ãè² æ ãããæ¹ 139 const $a_ill_funeral_payer = $('select[name="a_ill_funeral_payer"]'); 140 const $a_ill_funeral_relation_deceased = $('input[name="a_ill_funeral_relation_deceased"]'); 141 const $a_ill_funeral_deceased_kjsei = $('input[name="a_ill_funeral_deceased_kjsei"]'); 142 const $a_ill_funeral_deceased_kjmei = $('input[name="a_ill_funeral_deceased_kjmei"]'); 143 const $a_ill_funeral_deceased_knsei = $('input[name="a_ill_funeral_deceased_knsei"]'); 144 const $a_ill_funeral_deceased_knmei = $('input[name="a_ill_funeral_deceased_knmei"]'); 145 146 // (è¬ç¥è²»ç¨)è£å対象è 147 const $a_funeral_compensation_person = $('input[name="a_funeral_compensation_person"]'); 148 const $a_funeral_relationship = $('input[name="a_funeral_relationship"]'); 149 const $a_funeral_kjsei = $('input[name="a_funeral_kjsei"]'); 150 const $a_funeral_kjmei = $('input[name="a_funeral_kjmei"]'); 151 const $a_funeral_knsei = $('input[name="a_funeral_knsei"]'); 152 const $a_funeral_knmei = $('input[name="a_funeral_knmei"]'); 153 154 //(è¬ç¥è²»ç¨)è¬åè²»ç¨ãè² æ ãããæ¹ 155 const $a_funeral_payer = $('select[name="a_funeral_payer"]'); 156 const $a_funeral_relation_deceased = $('input[name="a_funeral_relation_deceased"]'); 157 const $a_funeral_deceased_kjsei = $('input[name="a_funeral_deceased_kjsei"]'); 158 const $a_funeral_deceased_kjmei = $('input[name="a_funeral_deceased_kjmei"]'); 159 const $a_funeral_deceased_knsei = $('input[name="a_funeral_deceased_knsei"]'); 160 const $a_funeral_deceased_knmei = $('input[name="a_funeral_deceased_knmei"]'); 161 162 //éä»å 163 const $a_destination_person_type = $('input[name="a_destination_person_type"]'); 164 const $a_destination_kjsei = $('input[name="a_destination_kjsei"]'); 165 const $a_destination_kjmei = $('input[name="a_destination_kjmei"]'); 166 const $a_destination_knsei = $('input[name="a_destination_knsei"]'); 167 const $a_destination_knmei = $('input[name="a_destination_knmei"]'); 168 169 //æ¥ä¸é£çµ¡å 170 const $a_contact_person_type = $('input[name="a_contact_person_type"]'); 171 const $a_contact_relationship = $('input[name="a_contact_relationship"]'); 172 const $a_contact_kjsei = $('input[name="a_contact_kjsei"]'); 173 const $a_contact_kjmei = $('input[name="a_contact_kjmei"]'); 174 const $a_contact_knsei = $('input[name="a_contact_knsei"]'); 175 const $a_contact_knmei = $('input[name="a_contact_knmei"]'); 176 177 // ç é¢è¿½å ã®è¡¨ç¤ºå¶å¾¡ 178 const $a_injured_hospital_02 = $('[name="a_injured_hospital_02_display"]'); 179 const $a_ill_hospital_02 = $('[name="a_ill_hospital_02_display"]'); 180 181 // æ»äº¡æã®ç é¢è¿½å ã®è¡¨ç¤ºå¶å¾¡ 182 const $a_injured_funeral_hospital = $('[name="a_injured_funeral_hospital_display"]'); 183 const $a_ill_funeral_hospital = $('[name="a_ill_funeral_hospital_display"]'); 184 185 // è¬ç¥è²»ç¨ã®è¡¨ç¤ºå¶å¾¡ 186 const $a_injured_funeral = $('[name="a_injured_funeral_display"]'); 187 const $a_ill_funeral = $('[name="a_ill_funeral_display"]'); 188 189 // å種ãã£ã¼ã«ã ----end 190 191 /** åæå¦ç **/ 192 init();
193 function init() { 194 // 表示stepã®æå®ãããå ´åã¯ãç¹å®ã®stepããéå§ãã 195 var startStep = $startStep.val(); 196 if(startStep) { 197 nowStep = Number(startStep); 198 nowStep = isNaN(nowStep) ? 0 : nowStep; 199 objectCtl(); 200 } 201 sectionCtrol(); 202 } 203 204 /** 205 ** åã»ã¯ã·ã§ã³ã®è¡¨ç¤ºå¶å¾¡ 206 **/ 207 function sectionCtrol() { 208 // ã»ã¯ã·ã§ã³ã®è¡¨ç¤ºå¶å¾¡ 209 $('section').addClass("hide"); 210 $('section.step'+ nowStep).removeClass("hide"); 211 212 // ããã°ã¬ã¹ãã¼ã®é²è¡å¦ç 213 // 䏿¦ãã¹ã¦éactiveå 214 $('.progress .step').removeClass('active') 215 $('.progress .step').removeClass('completed') 216 217 $('.progress .step' + nowStep).addClass('active') 218 // ç¾å¨ã®ã¹ããããããåã®ã¹ãããã«completedãã¤ãã 219 for ( var i = 1; i < nowStep; i++ ) { 220 $('.progress .step' + i).addClass('completed') 221 } 222 223 // ã¯ããã«ç»é¢ã§ã¯æ»ããã¿ã³ãããã°ã¬ã¹ãã¼ã表示ããªãã 224 if(nowStep == 0) { 225 $('.back').addClass("hide"); 226 $('.progress').addClass("hide"); 227 } else { 228 $('.back').removeClass("hide"); 229 $('.progress').removeClass("hide"); 230 } 231 232 // ãã¿ã³ã®åç§°ã夿´ 233 var buttonName = buttonNameList[nowStep + 1]; 234 $('.nextBtn').text(buttonName); 235 236 // ãã©ã¼ã ã®å é ã«æ»ã 237 const position = $('form').offset().top; 238 $('html, body').animate({scrollTop: position}, 'slow'); 239 } 240 241 // åè§æåå¼·å¶ 242 $('.half').on('change',function() { 243 convertToHalf(this); 244 }); 245 246 // å ¨è§æåå¼·å¶ 247 $('.full').on('change',function() { 248 convertToFull(this); 249 }); 250 251 /** 252 ** å種ãã£ã¼ã«ãã®å¤ã夿´ãããå ´åã«ç»é¢è¡¨ç¤ºå¶å¾¡ãå®è¡ 253 **/ 254 $('input, select, textarea').on('change',function() { 255 objectCtl($(this)); 256 }); 257 258 /** 259 ** ç»é¢ãã¹ã¦ã®è¡¨ç¤º/é表示/éæ´»æ§ã®å¦ç 260 **/ 261 function objectCtl($ctlObject) { 262 // åvalueãåå¾ 263 var a_reporter_relationship = $a_reporter_relationship.filter(':checked').val(); 264 var a_reporter_relationship_detail = $a_reporter_relationship_detail.val(); 265 var a_reporter_kjsei = $a_reporter_kjsei.val(); 266 var a_reporter_kjmei = $a_reporter_kjmei.val(); 267 var a_reporter_knsei = $a_reporter_knsei.val(); 268 var a_reporter_knmei = $a_reporter_knmei.val(); 269 270 var a_reporter_reply_mail_confirm_val = $a_reporter_reply_mail_confirm.filter(':checked').val(); 271 272 var a_policy_info_kjsei = $a_policy_info_kjsei.val(); 273 var a_policy_info_kjmei = $a_policy_info_kjmei.val(); 274 var a_policy_info_knsei = $a_policy_info_knsei.val(); 275 var a_policy_info_knmei = $a_policy_info_knmei.val(); 276 277 var insureKind = $insureKind.filter(':checked').val(); 278 var deadFlg = $deadFlg.prop("checked"); 279 280 var a_injured_compensation_person = $a_injured_compensation_person.filter(':checked').val(); 281 var a_injured_relationship = $a_injured_relationship.val(); 282 var a_injured_kjsei = $a_injured_kjsei.val(); 283 var a_injured_kjmei = $a_injured_kjmei.val(); 284 var a_injured_knsei = $a_injured_knsei.val(); 285 var a_injured_knmei = $a_injured_knmei.val(); 286 287 var a_injured_vehicle = $a_injured_vehicle.filter(':checked').val(); 288 var a_injured_vehicle_type = $a_injured_vehicle_type.val(); 289 290 var a_injured_hospitalized_flg_01 = $a_injured_hospitalized_flg_01.val(); 291 var a_injured_outpatient_flg_01 = $a_injured_outpatient_flg_01.val(); 292 var a_injured_operation_flg_01 = $a_injured_operation_flg_01.val(); 293 var a_injured_advanced_medical_care_flg_01 = $a_injured_advanced_medical_care_flg_01.val(); 294 295 var a_injured_hospitalized_flg_02 = $a_injured_hospitalized_flg_02.val(); 296 var a_injured_outpatient_flg_02 = $a_injured_outpatient_flg_02.val(); 297 var a_injured_operation_flg_02 = $a_injured_operation_flg_02.val(); 298 var a_injured_advanced_medical_care_flg_02 = $a_injured_advanced_medical_care_flg_02.val(); 299 300 var a_injured_funeral_payer = $a_injured_funeral_payer.val(); 301 302 var a_ill_compensation_person = $a_ill_compensation_person.filter(':checked').val(); 303 var a_ill_relationship = $a_ill_relationship.val(); 304 var a_ill_kjsei = $a_ill_kjsei.val(); 305 var a_ill_kjmei = $a_ill_kjmei.val(); 306 var a_ill_knsei = $a_ill_knsei.val(); 307 var a_ill_knmei = $a_ill_knmei.val(); 308
309 var a_ill_hospitalized_flg_01 = $a_ill_hospitalized_flg_01.val(); 310 var a_ill_operation_flg_01 = $a_ill_operation_flg_01.val(); 311 var a_ill_advanced_medical_care_flg_01 = $a_ill_advanced_medical_care_flg_01.val(); 312 313 var a_ill_hospitalized_flg_02 = $a_ill_hospitalized_flg_02.val(); 314 var a_ill_operation_flg_02 = $a_ill_operation_flg_02.val(); 315 var a_ill_advanced_medical_care_flg_02 = $a_ill_advanced_medical_care_flg_02.val(); 316 317 var a_ill_funeral_payer = $a_ill_funeral_payer.val(); 318 319 var a_funeral_compensation_person = $a_funeral_compensation_person.filter(':checked').val(); 320 var a_funeral_relationship = $a_funeral_relationship.val(); 321 var a_funeral_kjsei = $a_funeral_kjsei.val(); 322 var a_funeral_kjmei = $a_funeral_kjmei.val(); 323 var a_funeral_knsei = $a_funeral_knsei.val(); 324 var a_funeral_knmei = $a_funeral_knmei.val(); 325 var a_funeral_payer = $a_funeral_payer.val(); 326 327 var a_destination_person_type = $a_destination_person_type.filter(':checked').val(); 328 var a_destination_kjsei = $a_destination_kjsei.val(); 329 var a_destination_kjmei = $a_destination_kjmei.val(); 330 var a_destination_knsei = $a_destination_knsei.val(); 331 var a_destination_knmei = $a_destination_knmei.val(); 332 333 var a_contact_person_type = $a_contact_person_type.filter(':checked').val(); 334 var a_contact_relationship = $a_contact_relationship.val(); 335 var a_contact_kjsei = $a_contact_kjsei.val(); 336 var a_contact_kjmei = $a_contact_kjmei.val(); 337 var a_contact_knsei = $a_contact_knsei.val(); 338 var a_contact_knmei = $a_contact_knmei.val(); 339 340 var a_injured_hospital_02 = $a_injured_hospital_02.val(); 341 var a_injured_funeral_hospital = $a_injured_funeral_hospital.val(); 342 var a_injured_funeral = $a_injured_funeral.val(); 343 344 var a_ill_hospital_02 = $a_ill_hospital_02.val(); 345 var a_ill_funeral_hospital = $a_ill_funeral_hospital.val(); 346 var a_ill_funeral = $a_ill_funeral.val(); 347 348 // ---------------------------------- 349 // STEP1å¦ç 350 // ---------------------------------- 351 352 // ç¶æã®è©³ç´°è¡¨ç¤º 353 // ã親æãã®ä»ã鏿ããå ´åã¯ãç¶æã®è©³ç´°ã表示 354 if(a_reporter_relationship == 3 || a_reporter_relationship == 4) { 355 $a_reporter_relationship_detail.closest('.td-inner-wrap').removeClass("hide"); 356 } else if ($a_reporter_relationship.is($ctlObject)){ 357 $a_reporter_relationship_detail.closest('.td-inner-wrap').addClass("hide"); 358 } 359 360 // ç¶æã®å¤åå¾ 361 var tsuzuki = '' 362 if(a_reporter_relationship == 1) { 363 // å¥ç´è æ¬äºº 364 tsuzuki = 'å¥ç´è æ¬äºº'; 365 } else if (a_reporter_relationship == 2) { 366 // é å¶è 367 tsuzuki = $a_reporter_relationship.filter(':checked').closest("label").text(); 368 } else { 369 //ãã以å¤ã®å ´åãç¶æã®è©³ç´°ãæ¬å¼§æ¸ãã§è¡¨ç¤º 370 tsuzuki = $a_reporter_relationship.filter(':checked').closest("label").text(); 371 tsuzuki += "ï¼" + a_reporter_relationship_detail + "ï¼"; 372 } 373 374 // ç¶æã§å¥ç´è æ¬äººã鏿ããå ´åã®å¶å¾¡ 375 if(a_reporter_relationship == 1) { 376 changeDisabled([$a_reporter_kjsei,$a_reporter_kjmei,$a_reporter_knsei,$a_reporter_knmei], true); 377 setValue([[$a_reporter_kjsei,a_policy_info_kjsei],[$a_reporter_kjmei,a_policy_info_kjmei],[$a_reporter_knsei,a_policy_info_knsei],[$a_reporter_knmei,a_policy_info_knmei]]); 378 } else if ($a_reporter_relationship.is($ctlObject) && reporterInfoReset){ 379 changeDisabled([$a_reporter_kjsei,$a_reporter_kjmei,$a_reporter_knsei,$a_reporter_knmei], false); 380 setValue([[$a_reporter_relationship_detail,''],[$a_reporter_kjsei,''],[$a_reporter_kjmei,''],[$a_reporter_knsei,''],[$a_reporter_knmei,'']]); 381 } 382 383 // ãå ±åè æ å ±ã®ãªã»ãããã©ã°è¨å® 384 if (!(a_reporter_relationship == '' || a_reporter_relationship == undefined)) { 385 reporterInfoReset = true; 386 } 387 388 // å ±åè ã®å¤ãè¨å®ãç´ã 389 a_reporter_kjsei = $a_reporter_kjsei.val(); 390 a_reporter_kjmei = $a_reporter_kjmei.val(); 391 a_reporter_knsei = $a_reporter_knsei.val(); 392 a_reporter_knmei = $a_reporter_knmei.val(); 393 394 // è«æ±å 容ã®é¸æ 395 if(insureKind == 4) { 396 // æ»äº¡ã»è¬ç¥è²»ç¨é¸ææã¯æ»äº¡ããã§ãã¯ãéæ´»æ§ 397 $deadFlg.prop("checked", true); 398 changeDisabled([$deadFlg], true); 399 } else if (insureKind == 3 || insureKind == 5) { 400 // è³ åäºæ /ãã®ä»(æºè¡åãªã©)ã鏿ããå ´åã¯æ»äº¡ãã§ãã¯ãå¤ãã¦éæ´»æ§ 401 $deadFlg.prop("checked", false); 402 changeDisabled([$deadFlg], true); 403 } else if (insureKind != 4 && lastInsureKind == 4) { 404 // æçµé¸æãæ»äº¡ã»è¬ç¥è²»ç¨ã§ããã以å¤ã«å¤æ´ããå ´åã¯ãã§ãã¯ãå¤ãæ´»æ§ 405 $deadFlg.prop("checked", false); 406 changeDisabled([$deadFlg], false); 407 } else { 408 // ä¸è¨ä»¥å¤ã¯æ´»æ§åã®ã¿è¡ã 409 changeDisabled([$deadFlg], false); 410 } 411 412 deadFlg = $deadFlg.prop("checked"); 413 lastInsureKind = insureKind 414 415 // ---------------------------------- 416 // STEP2å¦ç 417 // ---------------------------------- 418 419 // step2ç´ä¸ã®divããã¹ã¦é表示å 420 $('.step2 > div').addClass("hide"); 421 422 // 鏿å 容ã«å¿ãã¦è¡¨ç¤ºå 容ã夿´ 423 switch (insureKind){ 424 case '1': 425 $('#injuredInfo').removeClass("hide"); 426 break; 427 case '2': 428 $('#illInfo').removeClass("hide"); 429 break; 430 case '3': 431 $('#damagedInfo').removeClass("hide"); 432 break; 433 case '4': 434 $('#funeralExpensesInfo').removeClass("hide"); 435 break; 436 case '5': 437 $('#otherDamagedInfo').removeClass("hide"); 438 break; 439 } 440 441 if (deadFlg) { 442 //å ±éã®è¡¨ç¤º/é表示å¦ç 443 $('.dead_flg_hide').addClass("hide"); 444 $('.dead_flg_show').removeClass("hide"); 445 } else { 446 //å ±éã®è¡¨ç¤º/é表示å¦ç 447 $('.dead_flg_hide').removeClass("hide"); 448 $('.dead_flg_show').addClass("hide"); 449 } 450 451 // ã±ã¬ã®å ´å 452 if(insureKind == 1) { 453 // ãå ±åè =ãå¥ç´è ããã㯠æ»äº¡ã®å ´åããå ±åè ã¨åããé表示 454 if(a_reporter_relationship == 1 || deadFlg) { 455 // ãå ±åè ã¨åããé表示 456 $('label[for="a_injured_compensation_person_01"]').addClass("hide"); 457 458 // ãå ±åè ã¨åãã鏿ããã¦ããå ´åã«ã¯ãå¤ãåæå 459 if (a_injured_compensation_person == 1) { 460 changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], false); 461 setValue([[$a_injured_relationship,''],[$a_injured_kjsei,''],[$a_injured_kjmei,''],[$a_injured_knsei,''],[$a_injured_knmei,'']]); 462 $('#a_injured_compensation_person_01').prop('checked', false); 463 injuredCompensationInfoReset = false; 464 } 465 } else { 466 $('label[for="a_injured_compensation_person_01"]').removeClass("hide"); 467 } 468 469 // ãå ±åè =ãå¥ç´è ä¸ã¤ æ»äº¡ã®å ´åããå¥ç´è ãã¾ã¨åããé表示ã«ãããå¥ç´è ãã¾ä»¥å¤ãããã©ã«ããã§ã㯠470 if(a_reporter_relationship == 1 && deadFlg) { 471 // ãå¥ç´è ã¨åããé表示 472 $('label[for="a_injured_compensation_person_02"]').addClass("hide"); 473 474 // ãå¥ç´è ã¨åãã鏿ããã¦ããå ´åã«ã¯ãå¤ãåæå 475 if (a_injured_compensation_person == 2) { 476 changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], false); 477 setValue([[$a_injured_relationship,''],[$a_injured_kjsei,''],[$a_injured_kjmei,''],[$a_injured_knsei,''],[$a_injured_knmei,'']]); 478 $('#a_injured_compensation_person_02').prop('checked', false); 479 injuredCompensationInfoReset = false; 480 } 481 482 // å ±åè 以å¤ã®é ç®ã¯åå¨ããªãã®ã§ãããã©ã«ããã§ãã¯ãå ¥ãã 483 $('#a_injured_compensation_person_03').prop('checked', true); 484 } else { 485 $('label[for="a_injured_compensation_person_02"]').removeClass("hide"); 486 } 487 488 // ãã®ä»ã®é¸æè¢ã®å¶å¾¡ 489 // æ»äº¡ ã¾ãã¯ å ±åè = å¥ç´è ã®å ´åï¼ãå¥ç´è ãã¾ä»¥å¤ 490 // æ»äº¡ã§ã¯ãªãå ´åï¼ãå ±åè ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ 491 if(deadFlg || a_reporter_relationship == 1) { 492 // ãå¥ç´è ã¨åãã表示 493 $('label[for="a_injured_compensation_person_03"]').removeClass("hide"); 494 // ãå ±åè ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ãé表示 495 $('label[for="a_injured_compensation_person_04"]').addClass("hide"); 496 // ãå¥ç´è ãã¾ä»¥å¤ã鏿ããã¦ããå ´åã«ã¯ãåçã®é ç®ã«ãã§ãã¯ãæ¯ãå¤ãã 497 if (a_injured_compensation_person == 4) { 498 $('#a_injured_compensation_person_03').prop('checked', true); 499 } 500 } else { 501 // ãå¥ç´è ã¨åããé表示 502 $('label[for="a_injured_compensation_person_03"]').addClass("hide"); 503 // ãå ±åè ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ã表示 504 $('label[for="a_injured_compensation_person_04"]').removeClass("hide"); 505 // ãå¥ç´è ãã¾ä»¥å¤ã鏿ããã¦ããå ´åã«ã¯ãåçã®é ç®ã«ãã§ãã¯ãæ¯ãå¤ãã 506 if (a_injured_compensation_person == 3) { 507 $('#a_injured_compensation_person_04').prop('checked', true); 508 } 509 } 510 511 // å¤ãè¨å®ãç´ã
512 a_injured_compensation_person = $a_injured_compensation_person.filter(':checked').val(); 513 514 // è£åå¯¾è±¡è æ§æ å ± 515 if(a_injured_compensation_person == 1) { 516 // ãå ±åè ãã¾ã¨åã 517 changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], true); 518 setValue([[$a_injured_relationship,tsuzuki],[$a_injured_kjsei,a_reporter_kjsei],[$a_injured_kjmei,a_reporter_kjmei],[$a_injured_knsei,a_reporter_knsei],[$a_injured_knmei,a_reporter_knmei]]); 519 } else if(a_injured_compensation_person == 2) { 520 // ãå¥ç´è ãã¾ã¨åã 521 changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], true); 522 setValue([[$a_injured_relationship,'å¥ç´è æ¬äºº'],[$a_injured_kjsei,a_policy_info_kjsei],[$a_injured_kjmei,a_policy_info_kjmei],[$a_injured_knsei,a_policy_info_knsei],[$a_injured_knmei,a_policy_info_knmei]]); 523 } else if ($a_injured_compensation_person.is($ctlObject) && injuredCompensationInfoReset){ 524 // ãå¥ç´è ãã¾ã»ãå ±åè ãã¾ä»¥å¤ 525 changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], false); 526 setValue([[$a_injured_relationship,''],[$a_injured_kjsei,''],[$a_injured_kjmei,''],[$a_injured_knsei,''],[$a_injured_knmei,'']]); 527 } 528 529 // è£å対象è ã«ä½ãããã®å¤ãè¨å®ããã¦ããå ´åã«ã¯ããªã»ãããã©ã°ãç«ã¦ã 530 if (!(a_injured_compensation_person == '' || a_injured_compensation_person == undefined)) { 531 injuredCompensationInfoReset = true; 532 } 533 534 // å¤ãè¨å®ãç´ã 535 a_injured_relationship = $a_injured_relationship.val(); 536 a_injured_kjsei = $a_injured_kjsei.val(); 537 a_injured_kjmei = $a_injured_kjmei.val(); 538 a_injured_knsei = $a_injured_knsei.val(); 539 a_injured_knmei = $a_injured_knmei.val(); 540 541 // ä¿éºéè«æ±ã®ææã®è´åé ç®ã表示å¶å¾¡ 542 if (deadFlg || a_injured_compensation_person == 1 543 || (a_injured_compensation_person == 2 && a_reporter_relationship == 1)) { 544 $a_injured_show_intention.closest('tr').addClass("hide"); 545 $a_injured_show_intention.filter(':checked').prop('checked', false); 546 } else { 547 $a_injured_show_intention.closest('tr').removeClass("hide"); 548 } 549 550 // ã±ã¬ã®ç¶æ³ 551 // ä¹ãç©ã«ä¹ã£ã¦ãã鏿æã®å¦ç 552 if (a_injured_vehicle == 1) { 553 $a_injured_vehicle_type.closest('tr').removeClass("hide"); 554 $a_injured_drank.closest('tr').removeClass("hide"); 555 556 // ä¹ãç©ã®ç¨®é¡ã«å¿ãã表示å¶å¾¡ 557 switch (a_injured_vehicle_type){ 558 // èªåè» 559 case '1': 560 $a_injured_vehicle_displacement.closest('tr').addClass("hide"); 561 $a_injured_vehicle_type_other.closest('tr').addClass("hide"); 562 break; 563 // ãã¤ã¯ 564 case '2': 565 $a_injured_vehicle_displacement.closest('tr').removeClass("hide"); 566 $a_injured_vehicle_type_other.closest('tr').addClass("hide"); 567 break; 568 // èªè»¢è» 569 case '3': 570 $a_injured_vehicle_displacement.closest('tr').addClass("hide"); 571 $a_injured_vehicle_type_other.closest('tr').addClass("hide"); 572 break; 573 // ãã®ä» 574 case '4': 575 $a_injured_vehicle_displacement.closest('tr').addClass("hide"); 576 $a_injured_vehicle_type_other.closest('tr').removeClass("hide"); 577 break; 578 default: 579 $a_injured_vehicle_displacement.closest('tr').addClass("hide"); 580 $a_injured_vehicle_type_other.closest('tr').addClass("hide"); 581 break; 582 } 583 } else { 584 $a_injured_vehicle_type.closest('tr').addClass("hide"); 585 $a_injured_vehicle_displacement.closest('tr').addClass("hide"); 586 $a_injured_vehicle_type_other.closest('tr').addClass("hide"); 587 $a_injured_drank.closest('tr').addClass("hide"); 588 } 589 590 // ç é¢è¿½å ã®è¡¨ç¤ºå¶å¾¡ 591 if (a_injured_hospital_02 == 1) { 592 showExField($a_injured_hospital_02.attr('name')); 593 } else { 594 hideExField($a_injured_hospital_02.attr('name')); 595 } 596 597 if (deadFlg) { 598 //ç é¢2ã¯ããã©ã«ã表示ãªã®ã§è¡¨ç¤ºã«ãã 599 showExField($a_injured_hospital_02.attr('name')); 600 601 if (a_injured_funeral_hospital == 1) { 602 showExField($a_injured_funeral_hospital.attr('name')); 603 } else { 604 hideExField($a_injured_funeral_hospital.attr('name')); 605 } 606 607 // è¬ç¥è²»ç¨ã®è¡¨ç¤ºå¶å¾¡ 608 if (a_injured_funeral == 1) { 609 showExField($a_injured_funeral.attr('name')); 610 } 611 } else { 612 //å ¥é¢/æè¡/éé¢ã®wraperã表示 613 showExField($a_injured_funeral_hospital.attr('name')); 614 // æ»äº¡ä»¥å¤ã¯è¬ç¥è²»ç¨ã®è«æ±ãã¿ã³ãé表示 615 hideExField($a_injured_funeral.attr('name')); 616 } 617 618 // å ¥é¢/éé¢/æè¡ã®è¡¨ç¤ºå¶å¾¡ 619 // å ¥é¢ï¼ã®è¡¨ç¤ºå¶å¾¡
620 if(a_injured_hospitalized_flg_01 == 1) { 621 $('.injured_hospitalized_01').removeClass("hide"); 622 } else { 623 $('.injured_hospitalized_01').addClass("hide"); 624 } 625 626 // éé¢ï¼ã®è¡¨ç¤ºå¶å¾¡ 627 if(a_injured_outpatient_flg_01 == 1) { 628 $('.injured_outpatient_01').removeClass("hide"); 629 } else { 630 $('.injured_outpatient_01').addClass("hide"); 631 } 632 633 // æè¡ï¼ã®è¡¨ç¤ºå¶å¾¡ 634 if(a_injured_operation_flg_01 == 1) { 635 $('.injured_operation_01').removeClass("hide"); 636 } else { 637 $('.injured_operation_01').addClass("hide"); 638 } 639 640 // å é²å»çï¼ã®è¡¨ç¤ºå¶å¾¡ 641 if(a_injured_advanced_medical_care_flg_01 == 1) { 642 $('.injured_advanced_medical_care_01').removeClass("hide"); 643 } else { 644 $('.injured_advanced_medical_care_01').addClass("hide"); 645 } 646 647 // å ¥é¢ï¼ã®è¡¨ç¤ºå¶å¾¡ 648 if(a_injured_hospitalized_flg_02 == 1) { 649 $('.injured_hospitalized_02').removeClass("hide"); 650 } else { 651 $('.injured_hospitalized_02').addClass("hide"); 652 } 653 654 // éé¢ï¼ã®è¡¨ç¤ºå¶å¾¡ 655 if(a_injured_outpatient_flg_02 == 1) { 656 $('.injured_outpatient_02').removeClass("hide"); 657 } else { 658 $('.injured_outpatient_02').addClass("hide"); 659 } 660 661 // æè¡ï¼ã®è¡¨ç¤ºå¶å¾¡ 662 if(a_injured_operation_flg_02 == 1) { 663 $('.injured_operation_02').removeClass("hide"); 664 } else { 665 $('.injured_operation_02').addClass("hide"); 666 } 667 668 // å é²å»çï¼ã®è¡¨ç¤ºå¶å¾¡ 669 if(a_injured_advanced_medical_care_flg_02 == 1) { 670 $('.injured_advanced_medical_care_02').removeClass("hide"); 671 } else { 672 $('.injured_advanced_medical_care_02').addClass("hide"); 673 } 674 675 // æ»äº¡ã®å ´å 676 if(deadFlg) { 677 // è¬åè²»ç¨ãè² æ ãããæ¹ã®è¡¨ç¤ºå¶å¾¡ 678 // è£å対象è = å¥ç´è ã®å ´åãå¥ç´è æ¬äººã®é¸æè¢ãé表示ã«ãã 679 if ( a_injured_compensation_person == 2 ) { 680 $a_injured_funeral_payer.find('option[value="1"]').addClass('hide') 681 // å¥ç´è ãã¾é¸æä¸ã®å ´åã¯ãæªé¸æã«ãã 682 if($a_injured_funeral_payer.val() == 1){ 683 changeDisabled([$a_injured_funeral_deceased_kjsei,$a_injured_funeral_deceased_kjmei,$a_injured_funeral_deceased_knsei,$a_injured_funeral_deceased_knmei], false); 684 setValue([[$a_injured_funeral_payer,''],[$a_injured_funeral_relation_deceased,''],[$a_injured_funeral_deceased_kjsei,''],[$a_injured_funeral_deceased_kjmei,''],[$a_injured_funeral_deceased_knsei,''],[$a_injured_funeral_deceased_knmei,'']]); 685 $a_injured_funeral_relation_deceased.closest('tr').removeClass("hide"); 686 a_injured_funeral_payer = $a_injured_funeral_payer.val(); 687 injuredFuneralInfoReset = false; 688 } 689 } else { 690 $a_injured_funeral_payer.find('option[value="1"]').removeClass('hide') 691 } 692 693 // è¬åè²»ç¨ãè² æ ãããæ¹ã®ååã®è¡¨ç¤ºå¶å¾¡ 694 if(a_injured_funeral_payer == 1) { 695 changeDisabled([$a_injured_funeral_deceased_kjsei,$a_injured_funeral_deceased_kjmei,$a_injured_funeral_deceased_knsei,$a_injured_funeral_deceased_knmei], true); 696 setValue([[$a_injured_funeral_deceased_kjsei,a_policy_info_kjsei],[$a_injured_funeral_deceased_kjmei,a_policy_info_kjmei],[$a_injured_funeral_deceased_knsei,a_policy_info_knsei],[$a_injured_funeral_deceased_knmei,a_policy_info_knmei]]); 697 $a_injured_funeral_relation_deceased.closest('tr').addClass("hide"); 698 } else if ($a_injured_funeral_payer.is($ctlObject) && injuredFuneralInfoReset){ 699 changeDisabled([$a_injured_funeral_deceased_kjsei,$a_injured_funeral_deceased_kjmei,$a_injured_funeral_deceased_knsei,$a_injured_funeral_deceased_knmei], false); 700 setValue([[$a_injured_funeral_relation_deceased,''],[$a_injured_funeral_deceased_kjsei,''],[$a_injured_funeral_deceased_kjmei,''],[$a_injured_funeral_deceased_knsei,''],[$a_injured_funeral_deceased_knmei,'']]); 701 $a_injured_funeral_relation_deceased.closest('tr').removeClass("hide"); 702 } 703 704 // è¬ç¥è²»ç¨è² æ è ã«ä½ãããã®å¤ãè¨å®ããã¦ããå ´åã«ã¯ããªã»ãããã©ã°ãç«ã¦ã 705 if (!(a_injured_funeral_payer == '' || a_injured_funeral_payer == undefined)) { 706 injuredFuneralInfoReset = true; 707 } 708 709 // å¤ãè¨å®ãç´ã 710 a_injured_funeral_relation_deceased = $a_injured_funeral_relation_deceased.val(); 711 a_injured_funeral_deceased_kjsei = $a_injured_funeral_deceased_kjsei.val(); 712 a_injured_funeral_deceased_kjmei = $a_injured_funeral_deceased_kjmei.val(); 713 a_injured_funeral_deceased_knsei = $a_injured_funeral_deceased_knsei.val(); 714 a_injured_funeral_deceased_knmei = $a_injured_funeral_deceased_knmei.val(); 715 716 } 717 } 718 719 // ç æ°ã®å ´å 720 if(insureKind == 2) { 721 // ãå ±åè =ãå¥ç´è ããã㯠æ»äº¡ã®å ´åããå ±åè ã¨åããé表示 722 if(a_reporter_relationship == 1 || deadFlg) { 723 // ãå ±åè ã¨åããé表示 724 $('label[for="a_ill_compensation_person_01"]').addClass("hide"); 725 726 // ãå ±åè ã¨åãã鏿ããã¦ããå ´åã«ã¯ãå¤ãåæå 727 if (a_ill_compensation_person == 1) { 728 changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], false); 729 setValue([[$a_ill_relationship,''],[$a_ill_kjsei,''],[$a_ill_kjmei,''],[$a_ill_knsei,''],[$a_ill_knmei,'']]); 730 $('#a_ill_compensation_person_01').prop('checked', false); 731 illCompensationInfoReset = false; 732 } 733 } else { 734 $('label[for="a_ill_compensation_person_01"]').removeClass("hide"); 735 } 736 737 // ãå ±åè =ãå¥ç´è ä¸ã¤ æ»äº¡ã®å ´åããå¥ç´è ãã¾ã¨åããé表示ã«ãããå¥ç´è ãã¾ä»¥å¤ãããã©ã«ããã§ã㯠738 if(a_reporter_relationship == 1 && deadFlg) { 739 // ãå¥ç´è ã¨åããé表示 740 $('label[for="a_ill_compensation_person_02"]').addClass("hide"); 741 742 // ãå¥ç´è ã¨åãã鏿ããã¦ããå ´åã«ã¯ãå¤ãåæå 743 if (a_ill_compensation_person == 2) { 744 changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], false); 745 setValue([[$a_ill_relationship,''],[$a_ill_kjsei,''],[$a_ill_kjmei,''],[$a_ill_knsei,''],[$a_ill_knmei,'']]); 746 $('#a_ill_compensation_person_02').prop('checked', false); 747 illCompensationInfoReset = false; 748 } 749 750 // å ±åè 以å¤ã®é ç®ã¯åå¨ããªãã®ã§ãããã©ã«ããã§ãã¯ãå ¥ãã 751 $('#a_ill_compensation_person_03').prop('checked', true); 752 } else { 753 $('label[for="a_ill_compensation_person_02"]').removeClass("hide"); 754 } 755 756 // ãã®ä»ã®é¸æè¢ã®å¶å¾¡ 757 // æ»äº¡ ã¾ãã¯ å ±åè = å¥ç´è ã®å ´åï¼ãå¥ç´è ãã¾ä»¥å¤ 758 // æ»äº¡ã§ã¯ãªãå ´åï¼ãå ±åè ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ 759 if(deadFlg || a_reporter_relationship == 1) { 760 // ãå¥ç´è ãã¾ä»¥å¤ã表示 761 $('label[for="a_ill_compensation_person_03"]').removeClass("hide"); 762 // ãå ±åè ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ãé表示 763 $('label[for="a_ill_compensation_person_04"]').addClass("hide"); 764 // ãå¥ç´è ãã¾ä»¥å¤ã鏿ããã¦ããå ´åã«ã¯ãåçã®é ç®ã«ãã§ãã¯ãæ¯ãå¤ãã 765 if (a_ill_compensation_person == 4) { 766 $('#a_ill_compensation_person_03').prop('checked', true); 767 } 768 } else { 769 // ãå¥ç´è ãã¾ä»¥å¤ãé表示 770 $('label[for="a_ill_compensation_person_03"]').addClass("hide"); 771 // ãå ±åè ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ã表示 772 $('label[for="a_ill_compensation_person_04"]').removeClass("hide"); 773 // ãå¥ç´è ãã¾ä»¥å¤ã鏿ããã¦ããå ´åã«ã¯ãåçã®é ç®ã«ãã§ãã¯ãæ¯ãå¤ãã 774 if (a_ill_compensation_person == 3) { 775 $('#a_ill_compensation_person_04').prop('checked', true); 776 } 777 } 778 779 // å¤ãè¨å®ãç´ã
780 a_ill_compensation_person = $a_ill_compensation_person.filter(':checked').val(); 781 782 // è£åå¯¾è±¡è æ§æ å ± 783 if(a_ill_compensation_person == 1) { 784 // ãå ±åè ãã¾ã¨åã 785 changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], true); 786 setValue([[$a_ill_relationship,tsuzuki],[$a_ill_kjsei,a_reporter_kjsei],[$a_ill_kjmei,a_reporter_kjmei],[$a_ill_knsei,a_reporter_knsei],[$a_ill_knmei,a_reporter_knmei]]); 787 } else if(a_ill_compensation_person == 2) { 788 // ãå¥ç´è ãã¾ã¨åã 789 changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], true); 790 setValue([[$a_ill_relationship,'å¥ç´è æ¬äºº'],[$a_ill_kjsei,a_policy_info_kjsei],[$a_ill_kjmei,a_policy_info_kjmei],[$a_ill_knsei,a_policy_info_knsei],[$a_ill_knmei,a_policy_info_knmei]]); 791 } else if ($a_ill_compensation_person.is($ctlObject) && illCompensationInfoReset){ 792 // ãå¥ç´è ãã¾ã»ãå ±åè ãã¾ä»¥å¤ 793 changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], false); 794 setValue([[$a_ill_relationship,''],[$a_ill_kjsei,''],[$a_ill_kjmei,''],[$a_ill_knsei,''],[$a_ill_knmei,'']]); 795 } 796 797 // è£å対象è ã«ä½ãããã®å¤ãè¨å®ããã¦ããå ´åã«ã¯ããªã»ãããã©ã°ãç«ã¦ã 798 if (!(a_ill_compensation_person == '' || a_ill_compensation_person == undefined)) { 799 illCompensationInfoReset = true; 800 } 801 802 // å¤ãè¨å®ãç´ã 803 a_ill_relationship = $a_ill_relationship.val(); 804 a_ill_kjsei = $a_ill_kjsei.val(); 805 a_ill_kjmei = $a_ill_kjmei.val(); 806 a_ill_knsei = $a_ill_knsei.val(); 807 a_ill_knmei = $a_ill_knmei.val(); 808 809 // ä¿éºéè«æ±ã®ææã®è´åé ç®ã表示å¶å¾¡ 810 if (deadFlg || a_ill_compensation_person == 1 || (a_ill_compensation_person == 2 && a_reporter_relationship == 1)) { 811 $a_ill_show_intention.closest('tr').addClass("hide"); 812 $a_ill_show_intention.filter(':checked').prop('checked', false); 813 } else { 814 $a_ill_show_intention.closest('tr').removeClass("hide"); 815 } 816 817 // ç é¢è¿½å ã®è¡¨ç¤ºå¶å¾¡ 818 if (a_ill_hospital_02 == 1) { 819 showExField($a_ill_hospital_02.attr('name')); 820 } else { 821 hideExField($a_ill_hospital_02.attr('name')); 822 } 823 824 if (deadFlg) { 825 // è¬ç¥è²»ç¨ã®è¡¨ç¤ºå¶å¾¡ 826 if (a_ill_funeral == 1) { 827 showExField($a_ill_funeral.attr('name')); 828 } 829 } else { 830 // æ»äº¡ä»¥å¤ã®å ´åã¯è¬ç¥è²»ç¨ã®è«æ±ãé表示 831 hideExField($a_ill_funeral.attr('name')); 832 } 833 834 // å ¥é¢/æè¡ã®è¡¨ç¤ºå¶å¾¡ 835 // å ¥é¢ï¼ã®è¡¨ç¤ºå¶å¾¡ 836 if(a_ill_hospitalized_flg_01 == 1) { 837 $('.ill_hospitalized_01').removeClass("hide"); 838 } else { 839 $('.ill_hospitalized_01').addClass("hide"); 840 } 841 842 // æè¡ï¼ã®è¡¨ç¤ºå¶å¾¡ 843 if(a_ill_operation_flg_01 == 1) { 844 $('.ill_operation_01').removeClass("hide"); 845 } else { 846 $('.ill_operation_01').addClass("hide"); 847 } 848 849 // å é²å»çï¼ã®è¡¨ç¤ºå¶å¾¡ 850 if(a_ill_advanced_medical_care_flg_01 == 1) { 851 $('.ill_advanced_medical_care_01').removeClass("hide"); 852 } else { 853 $('.ill_advanced_medical_care_01').addClass("hide"); 854 } 855 856 // å ¥é¢ï¼ã®è¡¨ç¤ºå¶å¾¡ 857 if(a_ill_hospitalized_flg_02 == 1) { 858 $('.ill_hospitalized_02').removeClass("hide"); 859 } else { 860 $('.ill_hospitalized_02').addClass("hide"); 861 } 862 863 // æè¡ï¼ã®è¡¨ç¤ºå¶å¾¡ 864 if(a_ill_operation_flg_02 == 1) { 865 $('.ill_operation_02').removeClass("hide"); 866 } else { 867 $('.ill_operation_02').addClass("hide"); 868 } 869 870 // å é²å»çï¼ã®è¡¨ç¤ºå¶å¾¡ 871 if(a_ill_advanced_medical_care_flg_02 == 1) { 872 $('.ill_advanced_medical_care_02').removeClass("hide"); 873 } else { 874 $('.ill_advanced_medical_care_02').addClass("hide"); 875 } 876 877 // æ»äº¡ã®å ´å 878 if(deadFlg) { 879 // è¬åè²»ç¨ãè² æ ãããæ¹ã®è¡¨ç¤ºå¶å¾¡ 880 // ã亡ããªãã«ãªã£ãæ¹ãå¥ç´è æ¬äººã®å ´åããããã¯å ±åè = å¥ç´è ã®å ´åãå¥ç´è æ¬äººã®é¸æè¢ãé表示ã«ãã 881 if ( a_ill_compensation_person == 2 ) { 882 $a_ill_funeral_payer.find('option[value="1"]').addClass('hide') 883 // å¥ç´è ãã¾é¸æä¸ã®å ´åã¯ãæªé¸æã«ãã 884 if($a_ill_funeral_payer.val() == 1){ 885 changeDisabled([$a_ill_funeral_deceased_kjsei,$a_ill_funeral_deceased_kjmei,$a_ill_funeral_deceased_knsei,$a_ill_funeral_deceased_knmei], false); 886 setValue([[$a_ill_funeral_payer,''],[$a_ill_funeral_relation_deceased,''],[$a_ill_funeral_deceased_kjsei,''],[$a_ill_funeral_deceased_kjmei,''],[$a_ill_funeral_deceased_knsei,''],[$a_ill_funeral_deceased_knmei,'']]); 887 $a_ill_funeral_relation_deceased.closest('tr').removeClass("hide"); 888 a_ill_funeral_payer = $a_ill_funeral_payer.val(); 889 illFuneralInfoReset = false; 890 } 891 } else { 892 $a_ill_funeral_payer.find('option[value="1"]').removeClass('hide') 893 } 894 895 // è¬åè²»ç¨ãè² æ ãããæ¹ã®ååã®è¡¨ç¤ºå¶å¾¡ 896 if(a_ill_funeral_payer == 1) { 897 // ãå¥ç´è æ§ 898 changeDisabled([$a_ill_funeral_deceased_kjsei,$a_ill_funeral_deceased_kjmei,$a_ill_funeral_deceased_knsei,$a_ill_funeral_deceased_knmei], true); 899 setValue([[$a_ill_funeral_deceased_kjsei,a_policy_info_kjsei],[$a_ill_funeral_deceased_kjmei,a_policy_info_kjmei],[$a_ill_funeral_deceased_knsei,a_policy_info_knsei],[$a_ill_funeral_deceased_knmei,a_policy_info_knmei]]); 900 $a_ill_funeral_relation_deceased.closest('tr').addClass("hide"); 901 } else if ($a_ill_funeral_payer.is($ctlObject) && illFuneralInfoReset){ 902 changeDisabled([$a_ill_funeral_deceased_kjsei,$a_ill_funeral_deceased_kjmei,$a_ill_funeral_deceased_knsei,$a_ill_funeral_deceased_knmei], false); 903 setValue([[$a_ill_funeral_relation_deceased,''],[$a_ill_funeral_deceased_kjsei,''],[$a_ill_funeral_deceased_kjmei,''],[$a_ill_funeral_deceased_knsei,''],[$a_ill_funeral_deceased_knmei,'']]); 904 $a_ill_funeral_relation_deceased.closest('tr').removeClass("hide"); 905 } 906 907 // è¬ç¥è²»ç¨è² æ è ã«ä½ãããã®å¤ãè¨å®ããã¦ããå ´åã«ã¯ããªã»ãããã©ã°ãç«ã¦ã 908 if (!(a_ill_funeral_payer == '' || a_ill_funeral_payer == undefined)) { 909 illFuneralInfoReset = true; 910 } 911 912 // å¤ãè¨å®ãç´ã 913 a_ill_funeral_relation_deceased = $a_ill_funeral_relation_deceased.val(); 914 a_ill_funeral_deceased_kjsei = $a_ill_funeral_deceased_kjsei.val(); 915 a_ill_funeral_deceased_kjmei = $a_ill_funeral_deceased_kjmei.val(); 916 a_ill_funeral_deceased_knsei = $a_ill_funeral_deceased_knsei.val(); 917 a_ill_funeral_deceased_knmei = $a_ill_funeral_deceased_knmei.val(); 918 919 } 920 } 921 922 // è³ åäºæ ã®å ´å 923 if(insureKind == 3) { 924 } 925 926 // æ»äº¡ã»è¬ç¥è²»ç¨ã®å ´å 927 if(insureKind == 4) { 928 // è£å対象è 鏿ã®è¡¨ç¤ºå¶å¾¡ 929 // ãå ±åè ãã¾ã¨åããé表示 930 $('label[for="a_funeral_compensation_person_01"]').addClass("hide"); 931 // ãå ±åè ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ãé表示 932 $('label[for="a_funeral_compensation_person_04"]').addClass("hide"); 933 934 // ãå ±åè ããå¥ç´è ã®å ´åããå ±åè ã¨åããé表示 935 if(a_reporter_relationship == 1) { 936 $('label[for="a_funeral_compensation_person_02"]').addClass("hide"); 937 // ãå¥ç´è ã¨åãã鏿ããã¦ããå ´åã«ã¯ãå¤ãåæå 938 if (a_funeral_compensation_person == 2) { 939 changeDisabled([$a_funeral_relationship,$a_funeral_kjsei,$a_funeral_kjmei,$a_funeral_knsei,$a_funeral_knmei], false); 940 setValue([[$a_funeral_relationship,''],[$a_funeral_kjsei,''],[$a_funeral_kjmei,''],[$a_funeral_knsei,''],[$a_funeral_knmei,'']]); 941 // ãå¥ç´è ã¨åãã®ãã§ãã¯ãå¤ã 942 $('input[name="a_funeral_compensation_person"]').filter('[value="2"]').prop("checked",false); 943 } 944 945 // å¥ç´è 以å¤ãããã©ã«ããã§ã㯠946 $('input[name="a_funeral_compensation_person"]').filter('[value="3"]').prop("checked",true); 947 a_funeral_compensation_person = $a_funeral_compensation_person.filter(':checked').val(); 948 } else { 949 $('label[for="a_funeral_compensation_person_02"]').removeClass("hide"); 950 } 951 952 // è£åå¯¾è±¡è æ§æ å ± 953 if(a_funeral_compensation_person == 2) { 954 // ãå¥ç´è ãã¾ã¨åã 955 changeDisabled([$a_funeral_relationship,$a_funeral_kjsei,$a_funeral_kjmei,$a_funeral_knsei,$a_funeral_knmei], true); 956 setValue([[$a_funeral_relationship,'å¥ç´è æ¬äºº'],[$a_funeral_kjsei,a_policy_info_kjsei],[$a_funeral_kjmei,a_policy_info_kjmei],[$a_funeral_knsei,a_policy_info_knsei],[$a_funeral_knmei,a_policy_info_knmei]]); 957 } else if ($a_funeral_compensation_person.is($ctlObject) && funeralCompensationInfoReset){ 958 // ãå¥ç´è ãã¾ä»¥å¤ 959 changeDisabled([$a_funeral_relationship,$a_funeral_kjsei,$a_funeral_kjmei,$a_funeral_knsei,$a_funeral_knmei], false); 960 setValue([[$a_funeral_relationship,''],[$a_funeral_kjsei,''],[$a_funeral_kjmei,''],[$a_funeral_knsei,''],[$a_funeral_knmei,'']]); 961 } 962 963 // è£å対象è ã«ä½ãããã®å¤ãè¨å®ããã¦ããå ´åã«ã¯ããªã»ãããã©ã°ãç«ã¦ã 964 if (!(a_funeral_compensation_person == '' || a_funeral_compensation_person == undefined)) { 965 funeralCompensationInfoReset = true; 966 } 967 968 // å¤ãè¨å®ãç´ã 969 a_funeral_kjsei = $a_funeral_kjsei.val(); 970 a_funeral_kjmei = $a_funeral_kjmei.val(); 971 a_funeral_knsei = $a_funeral_knsei.val(); 972 a_funeral_knmei = $a_funeral_knmei.val(); 973 974 // è¬åè²»ç¨ãè² æ ãããæ¹ã®è¡¨ç¤ºå¶å¾¡ 975 // ã亡ããªãã«ãªã£ãæ¹ãå¥ç´è æ¬äººã®å ´åãå¥ç´è æ¬äººã®é¸æè¢ãé表示ã«ãã 976 if ( a_funeral_compensation_person == 2 ) { 977 $a_funeral_payer.find('option[value="1"]').addClass('hide') 978 // å¥ç´è ãã¾é¸æä¸ã®å ´åã¯ãæªé¸æã«ãã 979 if($a_funeral_payer.val() == 1){ 980 $a_funeral_payer.val(''); 981 changeDisabled([$a_funeral_deceased_kjsei,$a_funeral_deceased_kjmei,$a_funeral_deceased_knsei,$a_funeral_deceased_knmei], false); 982 setValue([[$a_funeral_relation_deceased,''],[$a_funeral_deceased_kjsei,''],[$a_funeral_deceased_kjmei,''],[$a_funeral_deceased_knsei,''],[$a_funeral_deceased_knmei,'']]); 983 a_funeral_payer = $a_funeral_payer.val(); 984 $a_funeral_relation_deceased.closest('tr').removeClass("hide"); 985 funeralInfoReset = false; 986 } 987 } else { 988 $a_funeral_payer.find('option[value="1"]').removeClass('hide') 989 } 990 991 // è¬åè²»ç¨ãè² æ ãããæ¹ã®ååã®è¡¨ç¤ºå¶å¾¡ 992 if(a_funeral_payer == 1) { 993 // ãå¥ç´è æ§ 994 changeDisabled([$a_funeral_deceased_kjsei,$a_funeral_deceased_kjmei,$a_funeral_deceased_knsei,$a_funeral_deceased_knmei], true); 995 setValue([[$a_funeral_deceased_kjsei,a_policy_info_kjsei],[$a_funeral_deceased_kjmei,a_policy_info_kjmei],[$a_funeral_deceased_knsei,a_policy_info_knsei],[$a_funeral_deceased_knmei,a_policy_info_knmei]]); 996 $a_funeral_relation_deceased.closest('tr').addClass("hide"); 997 } else if ($a_funeral_payer.is($ctlObject) && funeralInfoReset){ 998 changeDisabled([$a_funeral_deceased_kjsei,$a_funeral_deceased_kjmei,$a_funeral_deceased_knsei,$a_funeral_deceased_knmei], false); 999 setValue([[$a_funeral_relation_deceased,''],[$a_funeral_deceased_kjsei,''],[$a_funeral_deceased_kjmei,''],[$a_funeral_deceased_knsei,''],[$a_funeral_deceased_knmei,'']]); 1000 $a_funeral_relation_deceased.closest('tr').removeClass("hide"); 1001 } 1002 1003 // è¬ç¥è²»ç¨è² æ è ã«ä½ãããã®å¤ãè¨å®ããã¦ããå ´åã«ã¯ããªã»ãããã©ã°ãç«ã¦ã 1004 if (!(a_funeral_payer == '' || a_funeral_payer == undefined)) { 1005 funeralInfoReset = true; 1006 } 1007 1008 // å¤ãè¨å®ãç´ã 1009 a_funeral_relation_deceased = $a_funeral_relation_deceased.val(); 1010 a_funeral_deceased_kjsei = $a_funeral_deceased_kjsei.val(); 1011 a_funeral_deceased_kjmei = $a_funeral_deceased_kjmei.val(); 1012 a_funeral_deceased_knsei = $a_funeral_deceased_knsei.val(); 1013 a_funeral_deceased_knmei = $a_funeral_deceased_knmei.val(); 1014 1015 } 1016 1017 // ãã®ä»(æºè¡åãªã©)ã®å ´å 1018 if(insureKind == 5) { 1019 } 1020 1021 // ---------------------------------- 1022 // STEP3å¦ç 1023 // ---------------------------------- 1024 // æ¸é¡ã®éä»å 1025 // éä»å ã®é¸æå¶å¾¡ 1026 1027 // è£å対象è ã®æ å ±ãåå¾ 1028 var compensation_person = ""; 1029 1030 if(insureKind == 1) { 1031 //ã±ã¬ 1032 compensation_person = a_injured_compensation_person; 1033 } else if (insureKind == 2) { 1034 //ç æ° 1035 compensation_person = a_ill_compensation_person; 1036 } else if (insureKind == 4) { 1037 //æ»äº¡ 1038 compensation_person = a_funeral_compensation_person; 1039 } 1040 1041 // æ¸é¡ã®éä»å ã®è¡¨ç¤ºãåæå 1042 // è£å対象è ãã¾ï¼ã±ã¬ã»ç æ°çããããæ¹ï¼ 1043 $('label[for="a_destination_person_type_01"]').removeClass("hide"); 1044 // ãå¥ç´è ãã¾ 1045 $('label[for="a_destination_person_type_02"]').removeClass("hide"); 1046 // ãå ±åè ãã¾ 1047 $('label[for="a_destination_person_type_03"]').removeClass("hide"); 1048 1049 // ãã®ä»ã®é ç®ã¯ãã©ããä¸ã¤ã ãã®è¡¨ç¤ºãªã®ã§ä¸æ¦ãã¹ã¦æ¶ã 1050 // è£å対象è ãã¾ä»¥å¤ 1051 $('label[for="a_destination_person_type_04"]').addClass("hide"); 1052 // ãå¥ç´è ãã¾ä»¥å¤ 1053 $('label[for="a_destination_person_type_05"]').addClass("hide"); 1054 // ãå ±åè ãã¾ä»¥å¤ 1055 $('label[for="a_destination_person_type_06"]').addClass("hide"); 1056 // è£å対象è ãã¾ã»ãå¥ç´è ãã¾ä»¥å¤ 1057 $('label[for="a_destination_person_type_07"]').addClass("hide"); 1058 // è£å対象è ãã¾ã»ãå ±åè ãã¾ä»¥å¤ 1059 $('label[for="a_destination_person_type_08"]').addClass("hide"); 1060 // ãå¥ç´è ãã¾ã»ãå ±åè ãã¾ä»¥å¤ 1061 $('label[for="a_destination_person_type_09"]').addClass("hide"); 1062 // è£å対象è ãã¾ã»ãå¥ç´è ãã¾ã»ãå ±åè ãã¾ä»¥å¤ 1063 $('label[for="a_destination_person_type_10"]').addClass("hide"); 1064 var $ohterTarget = ""; 1065 1066 /** ãã®ä»ã®è¡¨ç¤ºå¶å¾¡ **/ 1067 // è«æ±å 容ããè³ åäºæ ã¾ã㯠ãã®ä»ã®å ´å 1068 if (insureKind == 3 || insureKind == 5) { 1069 // å ±åè = å¥ç´è ã®å ´åã¯ã¨ãã以å¤ã§åå² 1070 if (a_reporter_relationship == 1) { 1071 $('label[for="a_destination_person_type_05"]').removeClass("hide"); 1072 $ohterTarget = $('#a_destination_person_type_05'); 1073 } else { 1074 $('label[for="a_destination_person_type_09"]').removeClass("hide"); 1075 $ohterTarget = $('#a_destination_person_type_09'); 1076 } 1077 } else { 1078 // æ»äº¡ãã¦ãããã§åå² 1079 if (deadFlg) { 1080 // å ±åè = å¥ç´è ãã¾ã®å ´å 1081 if (a_reporter_relationship == 1) { 1082 $('label[for="a_destination_person_type_05"]').removeClass("hide"); 1083 $ohterTarget = $('#a_destination_person_type_05'); 1084 } else { 1085 // è£å対象è = ãå¥ç´è ãã¾ã®å ´å 1086 if (compensation_person == 2) { 1087 $('label[for="a_destination_person_type_06"]').removeClass("hide"); 1088 $ohterTarget = $('#a_destination_person_type_06'); 1089 } else { 1090 $('label[for="a_destination_person_type_09"]').removeClass("hide"); 1091 $ohterTarget = $('#a_destination_person_type_09'); 1092 } 1093 } 1094 } else { 1095 // å ±åè = å¥ç´è ãã¾ã®å ´å 1096 if (a_reporter_relationship == 1) { 1097 // è£å対象è = ãå¥ç´è ãã¾ã®å ´å 1098 if (compensation_person == 2) { 1099 $('label[for="a_destination_person_type_04"]').removeClass("hide"); 1100 $ohterTarget = $('#a_destination_person_type_04'); 1101 } else { 1102 $('label[for="a_destination_person_type_07"]').removeClass("hide"); 1103 $ohterTarget = $('#a_destination_person_type_07'); 1104 } 1105 } else { 1106 // è£å対象è = ãå ±åè ãã¾ã®å ´å 1107 if (compensation_person == 1) { 1108 $('label[for="a_destination_person_type_07"]').removeClass("hide"); 1109 $ohterTarget = $('#a_destination_person_type_07'); 1110 } else if (compensation_person == 2) { 1111 // è£å対象è = ãå¥ç´è ãã¾ã®å ´å 1112 $('label[for="a_destination_person_type_08"]').removeClass("hide"); 1113 $ohterTarget = $('#a_destination_person_type_08'); 1114 } else { 1115 $('label[for="a_destination_person_type_10"]').removeClass("hide"); 1116 $ohterTarget = $('#a_destination_person_type_10');
1116 1117 } 1118 } 1119 } 1120 } 1121 1122 // éä»å ã®é¸æå¤ããæªé¸æãè£å対象è ãã¾ããå¥ç´è ãã¾ããå ±åè ã㾠以å¤ã®å ´åã¯è¨å®å¤ãæ¯ãæ¿ãã 1123 if (a_destination_person_type != undefined && a_destination_person_type != 1 && 1124 a_destination_person_type != 2 && a_destination_person_type != 3) { 1125 $ohterTarget.prop('checked', true); 1126 } 1127 1128 /** ãã®ä»ä»¥å¤ã®é¸æè¢ã®è¡¨ç¤ºå¶å¾¡ **/ 1129 // æ»äº¡ãã¦ãã ã¾ãã¯ è«æ±å 容ããè³ åäºæ ã¾ã㯠ãã®ä»ã®å ´å 1130 if (deadFlg || insureKind == 3 || insureKind == 5 ) { 1131 // 鏿è¢ãé表示 1132 $('label[for="a_destination_person_type_01"]').addClass("hide"); 1133 // labelã¯01ã§ããvalueã¯3(è£å対象è ãã¾ï¼ã±ã¬ã»ç æ°çããããæ¹ï¼) 1134 if (a_destination_person_type == 3) { 1135 changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false); 1136 setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]); 1137 $('#a_destination_person_type_01').prop('checked', false); 1138 destinationInfoReset = false; 1139 } 1140 } 1141 1142 // è£å対象è = ãå¥ç´è ã®å ´å 1143 if (compensation_person == 2) { 1144 // 鏿è¢ãé表示 1145 $('label[for="a_destination_person_type_02"]').addClass("hide"); 1146 if (a_destination_person_type == 2) { 1147 changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false); 1148 setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]); 1149 $('#a_destination_person_type_02').prop('checked', false); 1150 destinationInfoReset = false; 1151 } 1152 } 1153 1154 // å ±åè = å¥ç´è ã¾ã㯠è£å対象è = ãå ±åè ã®å ´å 1155 if (a_reporter_relationship == 1 || compensation_person == 1) { 1156 // 鏿è¢ãé表示 1157 $('label[for="a_destination_person_type_03"]').addClass("hide"); 1158 // labelã¯03ã§ããvalueã¯1(ãå ±åè ãã¾) 1159 if (a_destination_person_type == 1) { 1160 changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false); 1161 setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]); 1162 $('#a_destination_person_type_03').prop('checked', false); 1163 destinationInfoReset = false; 1164 } 1165 } 1166 1167 // æ¸é¡ã®éä»å ã«é¸æã«ä¼´ãå¶å¾¡ 1168 a_destination_person_type = $a_destination_person_type.filter(':checked').val(); 1169 if(a_destination_person_type == 1) { 1170 // ãå ±åè ãã¾ 1171 changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], true); 1172 setValue([[$a_destination_kjsei,a_reporter_kjsei],[$a_destination_kjmei,a_reporter_kjmei],[$a_destination_knsei,a_reporter_knsei],[$a_destination_knmei,a_reporter_knmei]]); 1173 } else if (a_destination_person_type == 2) { 1174 // ãå¥ç´è ãã¾ 1175 changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], true); 1176 setValue([[$a_destination_kjsei,a_policy_info_kjsei],[$a_destination_kjmei,a_policy_info_kjmei],[$a_destination_knsei,a_policy_info_knsei],[$a_destination_knmei,a_policy_info_knmei]]); 1177 } else if (a_destination_person_type == 3){ 1178 //è£å対象è ãã¾ï¼ã±ã¬ã»ç æ°ãªã©ããããæ¹ï¼ 1179 changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], true); 1180 1181 var target_kjsei = ''; 1182 var target_kjmei = ''; 1183 var target_knsei = ''; 1184 var target_knmei = ''; 1185 1186 if(insureKind == 1) { 1187 //ã±ã¬ 1188 target_kjsei = a_injured_kjsei; 1189 target_kjmei = a_injured_kjmei; 1190 target_knsei = a_injured_knsei; 1191 target_knmei = a_injured_knmei; 1192 } else if (insureKind == 2) { 1193 //ç æ° 1194 target_kjsei = a_ill_kjsei; 1195 target_kjmei = a_ill_kjmei; 1196 target_knsei = a_ill_knsei; 1197 target_knmei = a_ill_knmei; 1198 1199 } else if (insureKind == 4) { 1200 //æ»äº¡ 1201 target_kjsei = a_funeral_kjsei; 1202 target_kjmei = a_funeral_kjmei; 1203 target_knsei = a_funeral_knsei; 1204 target_knmei = a_funeral_knmei; 1205 } 1206 1207 setValue([[$a_destination_kjsei,target_kjsei],[$a_destination_kjmei,target_kjmei],[$a_destination_knsei,target_knsei],[$a_destination_knmei,target_knmei]]); 1208 } else if ($a_destination_person_type.is($ctlObject) && destinationInfoReset){ 1209 changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false); 1210 setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]); 1211 } 1212 1213 // éä»å ã鏿ããã¦ãå ´åã¯ããªã»ãããã©ã°ãç«ã¦ã 1214 if (!(a_destination_person_type == '' || a_destination_person_type == undefined)) { 1215 destinationInfoReset = true; 1216 } 1217
1218 // æ¸é¡ã®éä»å ä¸ã®æ³¨éã®èª¿æ´ 1219 if(deadFlg || insureKind == 3 || insureKind == 5) { 1220 // è£å対象è ã®æè¨ãé表示 1221 $('.compensation_person').addClass("hide"); 1222 } else { 1223 // è£å対象è ã®æè¨ã表示 1224 $('.compensation_person').removeClass("hide"); 1225 } 1226 1227 // æ¥ä¸é£çµ¡å ã®è¡¨ç¤ºå¶å¾¡ 1228 $('label[for="a_contact_person_type_01"]').removeClass("hide"); 1229 $('label[for="a_contact_person_type_02"]').removeClass("hide"); 1230 1231 /** 3:ãå ±åè ãã¾ä»¥å¤ **/ 1232 $('label[for="a_contact_person_type_03"]').addClass("hide"); 1233 /** 4:ãå¥ç´è ãã¾ä»¥å¤ **/ 1234 $('label[for="a_contact_person_type_04"]').addClass("hide"); 1235 /** 5:ãå¥ç´è ãã¾ã»ãå ±åè ãã¾ä»¥å¤ **/ 1236 $('label[for="a_contact_person_type_05"]').addClass("hide"); 1237 var $contactOhterTarget = ""; 1238 1239 /** ãã®ä»ã®è¡¨ç¤ºå¶å¾¡ **/ 1240 if(a_reporter_relationship == 1) { 1241 // ãå¥ç´è ãã¾ä»¥å¤ã表示 1242 $('label[for="a_contact_person_type_04"]').removeClass("hide"); 1243 $contactOhterTarget = $('#a_contact_person_type_04'); 1244 } else { 1245 if (compensation_person == 2 && deadFlg) { 1246 // ãå ±åè ãã¾ä»¥å¤ã表示 1247 $('label[for="a_contact_person_type_03"]').removeClass("hide"); 1248 $contactOhterTarget = $('#a_contact_person_type_03'); 1249 } else { 1250 // ãå¥ç´è ãã¾ã»ãå ±åè ãã¾ä»¥å¤ã表示 1251 $('label[for="a_contact_person_type_05"]').removeClass("hide"); 1252 $contactOhterTarget = $('#a_contact_person_type_05'); 1253 } 1254 } 1255 1256 // é£çµ¡å ã®é¸æå¤ããæªé¸æããå¥ç´è ãã¾ããå ±åè ã㾠以å¤ã®å ´åã¯è¨å®å¤ãæ¯ãæ¿ãã 1257 if (a_contact_person_type != undefined && a_contact_person_type != 1 && a_contact_person_type != 2) { 1258 $contactOhterTarget.prop('checked', true); 1259 } 1260 1261 // å ±åè =å¥ç´è ã®å ´åãå ±åè ã®é¸æè¢ãé表示 1262 if(a_reporter_relationship == 1) { 1263 $('label[for="a_contact_person_type_01"]').addClass("hide"); 1264 1265 // å ±åè ã鏿ããã¦ããå ´åã«ã¯å¤ãã¯ãªã¢ãã 1266 if (a_contact_person_type == 1) { 1267 changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], false); 1268 setValue([[$a_contact_relationship,''],[$a_contact_kjsei,''],[$a_contact_kjmei,''],[$a_contact_knsei,''],[$a_contact_knmei,'']]); 1269 $('#a_contact_person_type_01').prop('checked', false); 1270 contactInfoReset = false; 1271 } 1272 } 1273 1274 // æ»äº¡ä¸ã¤ãè£å対象è ãã¾ãããå¥ç´è ãã®å ´åããå¥ç´è ãé表示 1275 if(deadFlg && compensation_person == 2) { 1276 $('label[for="a_contact_person_type_02"]').addClass("hide"); 1277 // å¥ç´è ã鏿ããã¦ããå ´åã«ã¯å¤ãã¯ãªã¢ãã 1278 if (a_contact_person_type == 2) { 1279 changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], false); 1280 setValue([[$a_contact_relationship,''],[$a_contact_kjsei,''],[$a_contact_kjmei,''],[$a_contact_knsei,''],[$a_contact_knmei,'']]); 1281 $('#a_contact_person_type_02').prop('checked', false); 1282 contactInfoReset = false; 1283 } 1284 } 1285 1286 // æ¥ä¸é£çµ¡å ã®é¸æã«ä¼´ãå¶å¾¡ 1287 a_contact_person_type = $a_contact_person_type.filter(':checked').val(); 1288 if(a_contact_person_type == 1) { 1289 // ãå ±åè ãã¾ 1290 changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], true); 1291 setValue([[$a_contact_relationship,tsuzuki],[$a_contact_kjsei,a_reporter_kjsei],[$a_contact_kjmei,a_reporter_kjmei],[$a_contact_knsei,a_reporter_knsei],[$a_contact_knmei,a_reporter_knmei]]); 1292 } else if (a_contact_person_type == 2) { 1293 // ãå¥ç´è ãã¾ 1294 changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], true); 1295 setValue([[$a_contact_relationship,'å¥ç´è æ¬äºº'],[$a_contact_kjsei,a_policy_info_kjsei],[$a_contact_kjmei,a_policy_info_kjmei],[$a_contact_knsei,a_policy_info_knsei],[$a_contact_knmei,a_policy_info_knmei]]); 1296 } else if ($a_contact_person_type.is($ctlObject) && contactInfoReset){ 1297 changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], false); 1298 setValue([[$a_contact_relationship,''],[$a_contact_kjsei,''],[$a_contact_kjmei,''],[$a_contact_knsei,''],[$a_contact_knmei,'']]); 1299 } 1300 1301 // æ¥ä¸é£çµ¡å ã鏿ããã¦ãå ´åã¯ããªã»ãããã©ã°ãç«ã¦ã 1302 if (!(a_contact_person_type == '' || a_contact_person_type == undefined)) { 1303 contactInfoReset = true; 1304 } 1305 1306 // ---------------------------------- 1307 // STEP4å¦ç 1308 // ---------------------------------- 1309 // ä¿éºéãè«æ±æ å ±ç»é²å®äºã¡ã¼ã« 1310 // 叿ããå ´åãã¡ã¼ã«ã¢ãã¬ã¹ã®å ¥åæ¬ã表示 1311 if(a_reporter_reply_mail_confirm_val == '1') { 1312 $('.mail').removeClass("hide"); 1313 } else { 1314 $('.mail').addClass("hide"); 1315 } 1316 } 1317 1318 // ãªãã¸ã§ã¯ãã¸ã®å¤è¨å® 1319 function setValue (pairs) {
1320 pairs.forEach(([obj,val]) => $(obj).val(val)); 1321 } 1322 1323 // å ¥åæ¬ã®æå¹/ç¡å¹åå¦ç 1324 function changeDisabled(objects, disabledFlg) { 1325 $.each(objects, function(index, object) { 1326 if(disabledFlg) { 1327 object.addClass('disabled'); 1328 object.attr('readonly',true); 1329 } else { 1330 object.removeClass('disabled'); 1331 object.attr('readonly',false); 1332 } 1333 }); 1334 } 1335 1336 // 次ã¸ãã¿ã³æ¼ä¸æã®å¦ç 1337 $('.nextBtn.step').on('click', function() { 1338 // äºåº¦æ¼ã鲿¢ 1339 if (isProcessing) { 1340 return false; 1341 } else { 1342 isProcessing = true; 1343 // ãã¼ãã£ã³ã°ã表示 1344 $('.loaderWrap').removeClass("hide"); 1345 $('body').addClass('modal-open'); 1346 } 1347 1348 // ajaxã«ã¦å ¥åå 容ãéä¿¡ãã¦ããªãã¼ã·ã§ã³ãè¡ãã 1349 document.OCAHIN01.submitButton.value='next_step'; 1350 // ç¾å¨ã®ã¹ãããã®inputæ å ±ãåé 1351 let formData = $('form').find('.step' + nowStep).find(':input'); 1352 // å ±éã®é表示é ç®ãåé 1353 let formHiddenData = $('form').find('input[type="hidden"]'); 1354 // éä¿¡ãããã¼ã¿ãæ´å½¢ 1355 let postData = formData.serialize() + '&' + formHiddenData.serialize() + '&step=' + nowStep; 1356 // ajaxã®éä¿¡å ã®URLãåå¾ 1357 let targetURL = $('form[name="OCAHIN01"]').attr('action') 1358
1359 // ã¨ã©ã¼æ å ±ã®ãªã»ãã 1360 $('.page-head .error-message').addClass("hide"); 1361 $('form').find('.step' + nowStep + ' .has-error').removeClass('has-error') 1362 $('form').find('.step' + nowStep + ' .error_message').text(''); 1363 1364 $.ajax({ 1365 beforeSend: function(xhr){ 1366 xhr.overrideMimeType("text/html; charset=UTF-8"); 1367 }, 1368 url: targetURL, 1369 type: 'POST', 1370 dataType: 'json', 1371 data: postData, 1372 timeout: 5000, 1373 success: function(response,xhr,jqXHR) { 1374 Object.keys(response).forEach(function (stepKey){ 1375 var items = response[stepKey] 1376 // ã¨ã©ã¼ãããå ´åã«ã¯ãã¹ãããé·ç§»ãããã¨ã©ã¼å 容ã対å¿ãããã£ã¼ã«ãã«è¡¨ç¤º 1377 if (items.length == 0) { 1378 // æçµã¹ãããã®å ´åã¯ããã©ã¼ã ãéä¿¡ãã 1379 if (nowStep == lastStep) { 1380 document.OCAHIN01.submitButton.value='b_next'; 1381 $('form[name="OCAHIN01"]').submit(); 1382 } else { 1383 nowStep++; 1384 sectionCtrol(); 1385 } 1386 } else { 1387 items.forEach(function (item){ 1388 // 対象ã®ãã£ã¼ã«ãã«ã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示 1389 $('.error_message.' + item.errorFieldName).append(item.errorMessage + '<br>') 1390 // ã¨ã©ã¼ã«å¯¾å¿ãããã£ã¼ã«ãã赤ããã 1391 item.fieldName.forEach(function (field){ 1392 var $ele = $('[name="' + field + '"]'); 1393 // ã©ã¸ãªãã¿ã³ã®å ´åã¯ãå ¥åãã£ã¼ã«ãã赤ããªããªãã®ã§ãtrãã¨èµ¤ãããã 1394 if($ele.is(":radio")) { 1395 $ele.closest("tr").addClass("has-error"); 1396 } else { 1397 $ele.addClass("has-error"); 1398 } 1399 }); 1400 }); 1401 // ç»é¢ã®ä¸é¨ã«æ»ã 1402 const position = $('.page-head .error-message').offset().top; 1403 $('html, body').animate({scrollTop: position}, 'slow'); 1404 // ç»é¢ã®ä¸é¨ã«å ±éã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示 1405 $('.page-head .error-message').removeClass("hide"); 1406 } 1407 // ãã©ã¼ã«ã¹ãã³ã³ãã³ãã®å é ã«æ»ã 1408 $('section.step'+ nowStep).focus(); 1409 }); 1410 }, 1411 error: function(xhr, status, error) { 1412 document.location.href = "/err_sys.html"; 1413 } 1414 }).always(function(){ 1415 // å¦çãã©ã°ãåã 1416 isProcessing = false; 1417 $('body').removeClass('modal-open'); 1418 $('.loaderWrap').addClass("hide"); 1419 }); 1420 1421 return false; 1422 }); 1423 1424 // æ»ããã¿ã³æ¼ä¸æã®å¦ç 1425 $('.prevBtn').on('click', function() { 1426 //ã¨ã©ã¼ã®ãªã»ãã 1427 $('.page-head .error-message').addClass("hide"); 1428 $('form').find('.step' + nowStep + ' .has-error').removeClass('has-error') 1429 $('form').find('.step' + nowStep + ' .error_message').text(''); 1430 1431 nowStep--; 1432 sectionCtrol(); 1433 // ãã©ã¼ã«ã¹ãã³ã³ãã³ãã®å é ã«æ»ã 1434 $('section.step'+ nowStep).focus(); 1435 return false; 1436 }); 1437 1438 /** æåã«ã¦ã³ãã®æ©è½ **/ 1439 function createCounterText($object) { 1440 var text = cssProtection($object.val()); 1441 var nowLength = text.length; 1442 var maxLength = $object.attr('maxlength'); 1443 var lengthText = maxLength + 'æå以å ï¼' + nowLength + ' / ' + maxLength + 'ï¼'; 1444 var $counter = $object.siblings('.text-counter'); 1445 $counter.text(lengthText); 1446 } 1447 1448 $('.count-target').each(function(index, element){ 1449 createCounterText($(element)); 1450 }); 1451 1452 $('.count-target').on('input',function() { 1453 createCounterText($(this)); 1454 }); 1455 1456 // ç é¢ãè¬ç¥è²»ç¨ã®è¿½å ãã£ã¼ã«ãã®é表示 1457 function hideExField(target) { 1458 $('[data-contents="' + target + '"]').addClass('off'); 1459 $('[data-contents="' + target + '"]').removeClass("on"); 1460 $('.' + target).addClass("hide"); 1461 } 1462 1463 // ç é¢ãè¬ç¥è²»ç¨ã®è¿½å ãã£ã¼ã«ãã®è¡¨ç¤º 1464 function showExField(target) { 1465 $('[data-contents="' + target + '"]').addClass('on'); 1466 $('[data-contents="' + target + '"]').removeClass("off"); 1467 $('.' + target).removeClass("hide"); 1468 } 1469 1470 // ç é¢è¿½å ãæ¼ä¸ãããå ´åã®å¦ç 1471 $('.add-button').on('click', function() { 1472 var contents = $(this).data('contents'); 1473 var display = $('[name="' + contents + '"]'); 1474 if(display.val() == 1) { 1475 // ç é¢2ãè¡¨ç¤ºç¶æ > é表示ã®å ´å 1476 hideExField(contents); 1477 $('[name="' + contents + '"]').val("0"); 1478 } else if (display.val() == 0) { 1479 // ç é¢2ãéè¡¨ç¤ºç¶æ > 表示ã®å ´å 1480 showExField(contents); 1481 $('[name="' + contents + '"]').val("1"); 1482 } 1483 return false; 1484 }); 1485 1486 // ã¤ã³ãã©ã¡ã¼ã·ã§ã³ã¢ã¤ã³ã³ã®ã¢ã¼ãã«è¡¨ç¤º 1487 $('.info-open').on('click', function() { 1488 $('body').addClass('modal-open'); 1489 $('.modal_bg').removeClass('hide'); 1490 $('.modal.infomation').removeClass('hide'); 1491 $('.modal.infomation .modal_body_inner').addClass('hide'); 1492 var info = $(this).data('info'); 1493 $('.' + info).removeClass('hide'); 1494 return false; 1495 }); 1496 1497 // 使æ¤ç´¢ãæ¼ä¸ãããéã®å¦ç 1498 $('.add-search').on('click', function() { 1499 // äºåº¦æ¼ã鲿¢ 1500 if (isProcessing) { 1501 return false; 1502 } else { 1503 isProcessing = true; 1504 // ãã¼ãã£ã³ã°ã表示 1505 $('.loaderWrap').removeClass("hide"); 1506 $('body').addClass('modal-open'); 1507 } 1508 1509 // 鏿å¤ã®åºåå ã®ãã£ã¼ã«ãæ å ±ãè¨å® 1510 var serachType = $(this).data('serach-type'); 1511 if (serachType == "1") { 1512 targetZip1 = a_damaged_zip1; 1513 targetZip2 = a_damaged_zip2; 1514 targetPrefecture = a_damaged_add_prefecture; 1515 targetAddDetail = a_damaged_add_detail; 1516 } else if (serachType == "2") { 1517 targetZip1 = a_destination_zip1; 1518 targetZip2 = a_destination_zip2; 1519 targetPrefecture = a_destination_add_prefecture;
1520 targetAddDetail = a_destination_add_detail; 1521 } else { 1522 return false; 1523 } 1524 1525 document.OCAHIN01.submitButton.value = 'add_search'; 1526 let formData = $('form').find('.step' + nowStep).find(':input'); 1527 let formHiddenData = $('form').find('input[type="hidden"]'); 1528 // éä¿¡ãããã¼ã¿ãæ´å½¢ 1529 let postData = formData.serialize() + '&' + formHiddenData.serialize() + '&step=' + nowStep; 1530 // ajaxã®éä¿¡å ã®URLãåå¾ 1531 let targetURL = $('form[name="OCAHIN01"]').attr('action') 1532 1533 // ç¾å¨æä½ãã¦ããéµä¾¿çªå·ãã£ã¼ã«ãã®æ å ±ãåå¾ 1534 var zipWrap = $(this).parents('td'); 1535 // ã¨ã©ã¼ã®åé¤ 1536 zipWrap.find('.has-error').removeClass('has-error') 1537 zipWrap.find('.error_message').text(''); 1538 1539 // ajaxã«ã¦è¡¨ç¤ºããæ å ±ãåå¾ 1540 $.ajax({ 1541 beforeSend: function(xhr){ 1542 xhr.overrideMimeType("text/html; charset=UTF-8"); 1543 }, 1544 url: targetURL, 1545 type: 'POST', 1546 dataType: 'json', 1547 data: postData, 1548 timeout: 5000, 1549 success: function(response,xhr,jqXHR) { 1550 // 使æ å ±ãããå ´åã¯ãåå¾ããæ å ±ãã¢ã¼ãã«ã«åãè¾¼ã 1551 // ãªãå ´åã¯ãã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示 1552 if (response.HTML != undefined) { 1553 // ã¢ã¼ãã«ã®éµä¾¿çªå·æ å ±è¨å® 1554 var zipCode = zipWrap.find("input")[0].value + "-" + zipWrap.find("input")[1].value; 1555 $('.modal.add-search-result .zip span.zip-code').text(zipCode); 1556 1557 // ã¢ã¼ãã«ã表示 1558 $('body').addClass('modal-open'); 1559 $('.modal_bg').removeClass('hide'); 1560 $('.modal.add-search-result').removeClass('hide'); 1561 1562 // ã¢ã¼ãã«ã®selectããã¯ã¹ã®é¸æè¢ã使 1563 $('select#kjad1').empty(); 1564 $('select#kjad1').append(response.HTML); 1565 1566 } else { 1567 // ã¨ã©ã¼ãããå ´åã«ã¯ãã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示 1568 var key = Object.keys(response)[0]; 1569 $(targetZip1).addClass('has-error') 1570 $(targetZip2).addClass('has-error') 1571 zipWrap.find('.error_message').text(response[key]); 1572 } 1573 }, 1574 error: function(xhr, status, error) { 1575 document.location.href = "/err_sys.html"; 1576 } 1577 }).always(function(){ 1578 // å¦çãã©ã°ãåã 1579 isProcessing = false; 1580 $('body').removeClass('modal-open'); 1581 $('.loaderWrap').addClass("hide"); 1582 }); 1583 1584 return false; 1585 }); 1586 1587 // 使æ¤ç´¢ã¢ã¼ãã«ã®closeãæ¼ä¸ãããéã®å¦ç 1588 $('.modal-close').on('click', function() { 1589 modalClose(); 1590 return false; 1591 }); 1592 1593 // 使æ¤ç´¢ã¢ã¼ãã«ã®close 1594 function modalClose() { 1595 $('body').removeClass('modal-open'); 1596 $('.modal_bg').addClass('hide'); 1597 $('.modal').addClass('hide'); 1598 } 1599 1600 // ãå ¥åæ¬ã«è¡¨ç¤ºããã¿ã³ã®å¶å¾¡ 1601 $('#kjad1').on('change', function() { 1602 var kjadval = $(this).val(); 1603 if (kjadval != "") { 1604 $('.modal .button .submit').addClass('active'); 1605 } else { 1606 $('.modal .button .submit').removeClass('active'); 1607 } 1608 }); 1609 1610 // ãå ¥åæ¬ã«è¡¨ç¤ºããæ¼ä¸ãããéã®å¦ç 1611 $('.modal .submit').on('click', function() { 1612 var selValue = $('select#kjad1').val(); 1613 if (selValue != "") { 1614 // éµä¾¿çªå·ã®åºå 1615 var selZip = $('select#kjad1 option:selected').data('zip'); 1616 var zip1 = selZip.toString().substring(0,3); 1617 var zip2 = selZip.toString().substring(3,7); 1618 $(targetZip1).val(zip1); 1619 $(targetZip2).val(zip2); 1620 // é½éåºçã®æ å ±ãåºå 1621 var add1 = $('select#kjad1 option:selected').data('add1'); 1622 $(targetPrefecture).val(add1); 1623 // ä½æã®æ å ±ãåºå 1624 var add2 = $('select#kjad1 option:selected').data('add2'); 1625 $(targetAddDetail).val(add2); 1626 1627 $(targetPrefecture).trigger('input'); 1628 $(targetAddDetail).trigger('input'); 1629 modalClose(); 1630 } 1631 return false; 1632 }); 1633 1634 /** 1635 ** æã«åããã¦ãæ¥ä»ã®è¡¨ç¤ºã夿´ 1636 **/ 1637 $('.year, .month').on('change',function() { 1638 var lastday = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); 1639 var year = $(this).siblings('.year').addBack('.year').val();
1640 var month = $(this).siblings('.month').addBack('.month').val(); 1641 var $dayObject = $(this).siblings('.day'); 1642 var day = $dayObject.val(); 1643 1644 if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)){ 1645 lastday[1] = 29; 1646 } 1647 1648 var lastday = lastday[month - 1]; 1649 1650 // ä¸è¦ãªé¸æè¢ãæ¶ã 1651 $dayObject.children('option:gt(' + lastday + ')').remove(); 1652 // ä¸è¶³ãã¦ãã鏿è¢ãè¶³ã 1653 for(let i = $dayObject.children('option').length; i <= lastday; i++) { 1654 $dayObject.append(`<option value="${i}">${i}</option>`); 1655 } 1656 1657 if( day != "" && day > lastday) { 1658 $dayObject.val(lastday); 1659 } 1660 }); 1661 1662 /** 1663 ** ã«ã¬ã³ãã¼æ©è½ 1664 **/ 1665 $( ".datepicker" ).click(function() { 1666 const $calendar = $(this).siblings('[name="calendar"]'); 1667 1668 var pastYear = $(this).data('pastYear'); 1669 1670 // æ»äº¡ã®å ´åã¯ãã¹ã¦ã®é ç®ã§æªæ¥æ¥å ¥åã¯ãªããªãã 1671 // ã¾ããç¾å¨ã®æã10æä»¥åã®å ´åã®å ´åãæªæ¥æ¥å ¥åä¸å¯ 1672 var futureYear = $(this).data('futureYear'); 1673 var deadFlg = $deadFlg.prop("checked"); 1674 var now = new Date(); 1675 var month = now.getMonth() + 1; 1676 if (deadFlg || month < 10) { 1677 futureYear = 0; 1678 } 1679 1680 var thisYear = new Date().getFullYear(); 1681 var minDate = new Date(thisYear - pastYear, 0, 1); 1682 var maxDate = new Date(thisYear + futureYear,11, 31); 1683 1684 $calendar.datepicker("option",{ 1685 minDate: minDate 1686 ,maxDate: maxDate 1687 }); 1688 $calendar.datepicker("show"); 1689 1690 return false; 1691 }); 1692 1693 $('[name="calendar"]').datepicker({ 1694 dateFormat : "yy/m/d" 1695 ,prevText:"åæ" 1696 ,nextText:"ç¿æ" 1697 ,monthNames:['1æ','2æ','3æ','4æ','5æ','6æ','7æ','8æ','9æ','10æ','11æ','12æ'] 1698 ,monthNamesShort:['1','2','3','4','5','6','7','8','9','10','11','12'] 1699 ,dayNamesMin: ['æ¥', 'æ', 'ç«', 'æ°´', 'æ¨', 'é', 'å'] 1700 ,yearSuffix:'å¹´' 1701 ,showOtherMonths:true 1702 ,selectOtherMonths:true 1703 ,showMonthAfterYear:true 1704 1705 ,onChangeMonthYear:function(year, month, inst) { 1706 setTimeout(function() { 1707 addYearButton(inst); 1708; }, 0); 1709 } 1710 ,beforeShow : function(input,inst){ 1711 //éãåã«æ¥ä»ã䏿¸ã 1712 var year = $(this).siblings('div.group.calender').children(".year").val(); 1713 var month = $(this).siblings('div.group.calender').children(".month").val(); 1714 var day = $(this).siblings('div.group.calender').children(".day").val(); 1715 1716 // ããããã«å ¥åãããå ´åãåæå¦çã 1717 if(!(year == "" && month == "" && day == "")) { 1718 // å¤è¨å®ãç¡ãå ´åã®åæå¤è¨å® 1719 if (year == "") { 1720 year = new Date().getFullYear(); 1721 } 1722 1723 if (month == "") { 1724 month = 1; 1725 } 1726 1727 if (day == "") { 1728 day = 1; 1729 } 1730 } 1731 1732 $(this).datepicker( "setDate" , year + "/" + month + "/" + day); 1733 1734 setTimeout(function() { 1735 addYearButton(inst); 1736; }, 0); 1737 }, 1738 onSelect: function(dateText, inst){ 1739 //ã«ã¬ã³ãã¼ç¢ºå®æã«ãã©ã¼ã ã«åæ 1740 var dates = dateText.split('/'); 1741 $(this).siblings('div.group.calender').children(".year").val(dates[0]); 1742 $(this).siblings('div.group.calender').children(".month").val(dates[1]); 1743 $(this).siblings('div.group.calender').children(".day").val(dates[2]); 1744 $(this).siblings('.datepicker').focus(); 1745 } 1746 }); 1747 1748 function addYearButton(inst) { 1749 var dpHeader = $(inst.dpDiv).find('.ui-datepicker-header'); 1750 var nextMonth = dpHeader.find('.ui-datepicker-next'); 1751 var prevMonth = dpHeader.find('.ui-datepicker-prev'); 1752 dpHeader.find('.prev-year, .next-year').remove(); 1753 var $yearSelect = $(inst.dpDiv).find(".ui-datepicker-year"); 1754 var currentYear = parseInt($yearSelect.text(), 10); 1755 var selectObj = document.createElement("select"); 1756 var optionObj = document.createElement("option"); 1757 var minDate = $.datepicker._getMinMaxDate(inst, 'min'); 1758 var maxDate = $.datepicker._getMinMaxDate(inst, 'max'); 1759 var selYear = inst.drawYear; 1760 var selMonth = inst.drawMonth; 1761 selMonth = ( '00' + selMonth ).slice( -2 ); 1762 1763 $('<a>', { 1764 'class':'prev-year ui-datepicker-prev ui-corner-all', 1765 'href': '#', 1766 'aria-label':'åå¹´' 1767 }).html('<span id="prev-year">åå¹´</span>
1767').prependTo(dpHeader).click(function(e) { 1768 e.preventDefault(); 1769 var prevYear = currentYear - 1; 1770 optionObj.value = prevYear; 1771 optionObj.selected = true; 1772 selectObj.appendChild(optionObj); 1773 $.datepicker._selectMonthYear(inst.input[0], selectObj, "Y") 1774 }); 1775 1776 $('<a>', { 1777 'class':'next-year ui-datepicker-next ui-corner-all', 1778 'href': '#', 1779 'aria-label':'ç¿å¹´' 1780 }).html('<span id="next-year">ç¿å¹´</span>').click(function(e) { 1781 e.preventDefault(); 1782 var nextYear = currentYear + 1; 1783 optionObj.value = nextYear; 1784 optionObj.selected = true; 1785 selectObj.appendChild(optionObj); 1786 $.datepicker._selectMonthYear(inst.input[0], selectObj, "Y") 1787 }).insertAfter(nextMonth); 1788 1789 /** ã«ã¬ã³ãã¼ã®ãç¿æããåæããEnterã§æä½å¯è½ã«ãã**/ 1790 nextMonth.attr({'tabindex': '0'}); 1791 nextMonth.on('keydown',function(e){ 1792 if(e.key==='Enter') { 1793 e.preventDefault(); 1794 $(this).trigger('click'); 1795 } 1796 }); 1797 1798 prevMonth.attr({'tabindex': '0'}); 1799 prevMonth.on('keydown',function(e){ 1800 if(e.key==='Enter') { 1801 e.preventDefault(); 1802 $(this).trigger('click'); 1803 } 1804 }); 1805 1806 // åå¹´ã®è¡¨ç¤ºå¶å¾¡ 1807 if (selYear + '' + selMonth <= minDate.getFullYear() + '00') { 1808 dpHeader.find('.prev-year').addClass('ui-state-disabled'); 1809 } else { 1810 dpHeader.find('.prev-year').removeClass('ui-state-disabled'); 1811 } 1812 1813 // ç¿å¹´ã®è¡¨ç¤ºå¶å¾¡ 1814 if (selYear + '' + selMonth >= maxDate.getFullYear() + '11') { 1815 dpHeader.find('.next-year').addClass('ui-state-disabled'); 1816 } else { 1817 dpHeader.find('.next-year').removeClass('ui-state-disabled'); 1818 } 1819 1820 // ã«ã¬ã³ãã¼å ã«ãã©ã¼ã«ã¹ãåããã 1821 $('.prev-year').focus(); 1822 } 1823 1824 /** 1825 ** ä¸é¨ã®ããã¹ãã¨ãªã¢ã§æ¹è¡ãç¦æ¢ 1826 **/ 1827 $("textarea.no-line-break").on("keydown", function(event) { 1828 // ã¨ã³ã¿ã¼ãã¼ãæ¼ãããå ´åã«ç¡å¹ã«ãã 1829 if (event.key === "Enter") { 1830 event.preventDefault(); 1831 } 1832 }); 1833 1834 /** 1835 ** ã¯ãã¹ãµã¤ãã¹ã¯ãªããã£ã³ã°ã®æãã®ããæåãã¨ã¹ã±ã¼ã 1836 **/ 1837 function cssProtection(val) { 1838 return val.replace(/[<>&"'ââ]/g, ''); 1839 } 1840 1841 $('input[type="text"], textarea, input[type="email"]').on("input", function(event) { 1842 var text = $(this).val(); 1843 $(this).val(cssProtection(text)); 1844 }); 1845})
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.