require(['config'], function() {
	require([
		'kakao.map.util'
	], function($) {
		pageObj.init();
	});
});

/********************************************************
 --------------------------------------------------------
 - Object 목록								            -
 --------------------------------------------------------
 * const gridColModel = {}	: 화면 Grid Object			*
 * let pageObj = {}			: 화면공통 Object			*
 * let listObj = {}			: 목록화면 Object			*
 * let viewObj = {}			: 상세화면 Object			*
 * let modifyObj = {}		: 수정화면 Object			*
 * let createObj = {}		: 신규화면 Object			*
 *******************************************************/

/*화면 변수*/
const STINFO02011_GRID_ID = '#ITP_STINFO02011_jqGrid';
const STINFO02011_GRID_LIST = '#ITP_STINFO02011_jqGrid_list';
const STINFO02011_GRID_PAGER = '#ITP_STINFO02011_jqGridPager';
const STINFO02011_GRID_EMPTY = '#ITP_STINFO02011_jqGridEmpty';

const STINFO02011_VIEW_GRID_ID = '#ITP_STINFO02011_VIEW_jqGrid';
const STINFO02011_VIEW_GRID_LIST = '#ITP_STINFO02011_VIEW_jqGrid_list';
const STINFO02011_VIEW_GRID_PAGER = '#ITP_STINFO02011_VIEW_jqGridPager';
const STINFO02011_VIEW_GRID_EMPTY = '#ITP_STINFO02011_VIEW_jqGridEmpty';

const STINFO02011_DETAIL_GRID_ID = '#ITP_STINFO02011_DETAIL_jqGrid';
const STINFO02011_DETAIL_GRID_LIST = '#ITP_STINFO02011_DETAIL_jqGrid_list';
const STINFO02011_DETAIL_GRID_PAGER = '#ITP_STINFO02011_DETAIL_jqGridPager';
const STINFO02011_DETAIL_GRID_EMPTY = '#ITP_STINFO02011_DETAIL_jqGridEmpty';

let ITP_FORM_STINFO02011_DETAIL_IS_WRITING = false;

/*API URL*/
let API_DETAIL_GRID_LIST 	= '/api/store/detail-grid-list';	// 목록
let API_DETAIL_INFO 		= '/api/store/info-store';			// 상세
let API_DETAIL_SAVE 		= '/api/store/save-store';			// 저장
let API_INTI_PW				= '/api/store/inti-storePw';		// 패스워드 초기화

/*화면 Grid ColModel*/
const gridColModel = {
	list: [
		{
			index: 'STORE_ID', name: 'storeId',
			label: ITP_MSG_LOCALE.label.storeId, //매장번호
			width: '10', fixed: false, align: 'center',
			sortable: false, hidden: false
		},
		{
			index: 'STORE_NM', name: 'storeNm',
			label: ITP_MSG_LOCALE.label.storeNm, //매장명
			width: '13', fixed: false, align: 'center',
			sortable: false, hidden: false
		},
		{
			index: 'BRAND_ID', name: 'brandId',
			label: ITP_MSG_LOCALE.label.brandId, //브랜드ID
			width: '10', fixed: false, align: 'center',
			sortable: false, hidden: true
		},
		{
			index: 'BRAND_NM', name: 'brandNm',
			label: ITP_MSG_LOCALE.label.brandNm, //브랜드명
			width: '10', fixed: false, align: 'center',
			sortable: false, hidden: false
		},
		{
			index: 'BSNS_REG_NO', name: 'bsnsRegNo',
			label: ITP_MSG_LOCALE.label.bsnsRegNo, //사업자등록번호
			width: '13', fixed: false, align: 'center',
			sortable: false, hidden: false
		},
		{
			index: 'STORE_DVSN', name: 'storeDvsn',
			label: ITP_MSG_LOCALE.label.storeDvsn, //매장구분
			width: '15', fixed: false, align: 'center',
			sortable: false, hidden: true
		},
		{
			index: 'STORE_DVSN_NM', name: 'storeDvsnNm',
			label: ITP_MSG_LOCALE.label.storeDvsn, //매장구분명
			width: '15', fixed: false, align: 'center',
			sortable: false, hidden: false
		},
		{
			index: 'STORE_ST_NM', name: 'storeStNm',
			label: ITP_MSG_LOCALE.label.stNm, //상태
			width: '6', fixed: false, align: 'center',
			sortable: false, hidden: false
		},
		{
			index: 'SYS_REG_DTTM', name: 'sysRegDttm',
			label: ITP_MSG_LOCALE.label.sysRegDttm, //최초등록일
			width: '10', fixed: false, align: 'center',
			sortable: false, hidden: false
		},
	],
	detail: [
		{
			index: 'VIEW_CD', name: 'viewCd',
			label: ITP_MSG_LOCALE.label.viewCd,
			width: '10', fixed: false, align: 'center',
			sortable: false, hidden: true
		},
		{
			index: 'AUTH_NO', name: 'authNo',
			label: ITP_MSG_LOCALE.label.permitCd,
			width: '20', fixed: false, align: 'center',
			sortable: false, editable: false, edittype: 'text',
			editrules: {required: true}
		},
		{
			index: 'AUTH_NM', name: 'authNm',
			label: ITP_MSG_LOCALE.label.permitName,
			width: '30', fixed: false, align: 'center',
			sortable: true, editable: false, edittype: 'text',
			editrules: {required: true}
		},
		{
			index: 'USE_YN_NM', name: 'useYnNm',
			label: ITP_MSG_LOCALE.label.status,
			width: '10', fixed: false, align: 'center',
			sortable: false, editable: false, edittype: 'text'
		},
		{
			index: 'ADD_DT', name: 'addDt',
			label: ITP_MSG_LOCALE.label.regDt,
			width: '10', fixed: false, align: 'center',
			sortable: false, editable: false, edittype: 'text'
		}
	]
};

/*화면공통 Object*/
let pageObj = {
	init: function () {
		this.ui.init();
		this.event.init();
	},
	ui: {
		init: function () {
			this.view();
			this.form();
			this.grid();
			this.ready();
		},
		view: function() {
			// 버튼 권한설정
			fn_proc_btn_auth('STINFO02011');

			// 공통코드 표시
			$('select').each(function() {
				if($(this).data('select-code')) {
					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
				}
			});

			// 조회일자 지정
			var now = new Date();
			$('#ITP_TAB_STINFO02011 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
			$('#ITP_FORM_STINFO02011_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
			$('#ITP_FORM_STINFO02011_SEARCH_TO_DT').datepicker('setDate', new Date());

			// form alert message 주입
			$('input[data-alert-required="ONLYCHK"]').each(function() {
				if($(this).data('alert-msg') === 'address') {
					$(this).data('alert-msg', ITP_MSG_LOCALE.message.form.emptyAddr);
				}
			});
		},
		form: function() {
			itp_fn_form_event.onKeyup('#ITP_FORM_STINFO02011_DETAIL');
		},
		grid: function() {
			// itp_fn_jqgrid_resize(STINFO02011_GRID_ID, STINFO02011_GRID_LIST, 'lg');
			// listObj.empty.init();
			// itp_fn_fire_window_resize();
		},
		ready: function() {
			viewObj.init();
		}
	},
	event: {
		init: function () {
			this.button();
		},
		button: function () {
			// 버튼 클릭 이벤트
			$('button').each(function() {
				var id = $(this).attr('id');
				$(this).on('click', function() {
					switch (id) {
						case 'ITP_BTN_STINFO02011_MODIFY'				: modifyObj.button.modify();	break;	// 수정 버튼
						case 'ITP_BTN_STINFO02011_CANCELLIST'			: modifyObj.button.cancel(); 	break;	// 취소/목록 버튼
						case 'ITP_BTN_STINFO02011_SAVE'					: modifyObj.button.save(); 		break;	// 저장 버튼
						case 'ITP_FORM_STINFO02011_DETAIL_ADRES_SCH'	: modifyObj.button.address();	break;	// 신규등록 주소 찾기
					}
				});
			});

		}
	},
	switchScreen: function(mode) {
		$('.itp_det_head').find('button[id^="ITP_BTN_STINFO02011_"]').each(function(i) {
			$(this).hide();
		});
		$('#ITP_TAB_STINFO02011').find('div[id$="_CONTAINER"]').each(function(i) {
			$(this).hide();
		});
		if(mode == 'LIST') { // 목록
			$('#ITP_AJAX_STINFO02011_LIST_CONTAINER').show();
			fn_show_btn_auth_array(['#ITP_BTN_STINFO02011_SRH', '#ITP_BTN_STINFO02011_NEWREG']);
		} else if(mode == 'ADD') { // 등록
			$('#ITP_AJAX_STINFO02011_DETAIL_CONTAINER').show();
			fn_show_btn_auth_array(['#ITP_BTN_STINFO02011_CANCELLIST', '#ITP_BTN_STINFO02011_SAVE']);

			$('#ITP_FORM_STINFO02011_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
				$(this).attr('id') === 'ITP_FORM_STINFO02011_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
				if(elem.type === 'select') {
					$(this).val('').prop('selected', true);
				}
			});


			// 가맹점 정보 설정
			$('#ITP_FORM_STINFO02011_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
			$('#ITP_FORM_STINFO02011_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
			$('#ITP_FORM_STINFO02011_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));

			$('#ITP_FORM_STINFO02011_DETAIL .fnStoreNm').text('(자동부여)');
			$('#ITP_FORM_STINFO02011_DETAIL_STORE_ID').removeAttr('readonly');
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_info').hide();
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_info').find('input, select').each(function(i, elem) {
				if($(this).data('check-required')) $(this).data('check-required', '');
				$(this).attr('disabled', true);
			});
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_change').show();
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_change').find('input, select').each(function(i, elem) {
				if($(this).data('check-required')) $(this).data('check-required', 'empty');
				$(this).attr('disabled', false);
			});
		} else if(mode == 'MODIFY') { // 수정
			$('#ITP_AJAX_STINFO02011_DETAIL_CONTAINER').show();
			fn_show_btn_auth_array(['#ITP_BTN_STINFO02011_CANCELLIST', '#ITP_BTN_STINFO02011_SAVE', '#ITP_BTN_STINFO02011_RESET_PW']);

			$('#ITP_FORM_STINFO02011_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
			$('#ITP_FORM_STINFO02011_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
			$('#ITP_FORM_STINFO02011_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));

			$('#ITP_FORM_STINFO02011_DETAIL_STORE_ID').attr('readonly', true);
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_info').show();
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_info').find('input, select').each(function(i, elem) {
				if($(this).data('check-required')) $(this).data('check-required', 'empty');
				$(this).attr('disabled', false);
			});
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_change').hide();
			$('#ITP_FORM_STINFO02011_DETAIL .itp_form_change').find('input, select').each(function(i, elem) {
				if($(this).data('check-required')) $(this).data('check-required', '');
				$(this).attr('disabled', true);
			});
		} else if(mode == 'VIEW') { // 보기
			$('#ITP_AJAX_STINFO02011_VIEW_CONTAINER').show();
			fn_show_btn_auth_array(['#ITP_BTN_STINFO02011_MODIFY', '#ITP_BTN_STINFO02011_CANCELLIST']);
		}
	}
};

/*목록화면 Object*/
let listObj = {
	init: function () {
		this.grid.init();
	},
	itp_STINFO02011_search: false,
	button: {
		search: function() {
			listObj.itp_STINFO02011_search = true;
			let param = $('#ITP_FORM_STINFO02011_SEARCH').serializeObject();
			param.gridSize = $.jgrid.defaults.rowNum;
			param.gridPage = $.jgrid.defaults.page;
			$(STINFO02011_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
		},
		create: function() {
			pageObj.switchScreen('ADD');
			itp_fn_form_clear_validate(null, '#ITP_FORM_STINFO02011_DETAIL');
			createObj.init();
		}
	},
	empty: {
		init: function() {
			var _this = this;
			this.push();
			$(STINFO02011_GRID_EMPTY).on('click', function() {
				_this.back();
				_this.itp_STINFO02011_param.gridSize = $.jgrid.defaults.rowNum;
				$(STINFO02011_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_STINFO02011_param)}).trigger('reloadGrid');
			});
		},
		itp_STINFO02011_param: {},
		push: function() {
			let param = $('#ITP_FORM_STINFO02011_SEARCH').serializeObject();
			listObj.itp_STINFO02011_param = param;
		},
		back: function() {
			$('#ITP_FORM_STINFO02011_SERVICE_ST_DT').val(this.itp_STINFO02011_param.searchDateType);
			$('#ITP_FORM_STINFO02011_SEARCH_FROM_DT').val(this.itp_STINFO02011_param.fromDt);
			$('#ITP_FORM_STINFO02011_SEARCH_TO_DT').val(this.itp_STINFO02011_param.toDt);
			$('#ITP_FORM_STINFO02011_SEARCH_STORE_DVSN').val(this.itp_STINFO02011_param.sstoreDvsn);
			$('#ITP_FORM_STINFO02011_SEARCH_STORE_ST_CD').val(this.itp_STINFO02011_param.sstoreStCd);
			$('#ITP_FORM_STINFO02011_SEARCH_LOAN_DVSN').val(this.itp_STINFO02011_param.sloanDvsn);
			$('#ITP_FORM_STINFO02011_SEARCH_STORE_NM').val(this.itp_STINFO02011_param.sstoreMm);
		}
	},
	grid: {
		init: function () {
			// 데이터 없을때
			listObj.empty.push();
			this.search();
		},
		colModel: gridColModel.list,
		search: function() {
			pageObj.switchScreen('LIST');
			this.unload();
			this.load();
		},
		load: function() {
			let param = $('#ITP_FORM_STINFO02011_SEARCH').serializeObject();
			param.gridSize = $.jgrid.defaults.rowNum;
			param.sbrandId = fn_make_user_info.get('brandId');
			// param.sbrandId = sessionStorage.getItem('itp_brand_id') !== null ? sessionStorage.getItem('itp_brand_id') : 'BRD221000001';

			var option = {
				gridId: STINFO02011_GRID_ID,
				colModel: gridColModel.list,
				param: param,
				url: DOMAIN + API_DETAIL_GRID_LIST,
				pager: STINFO02011_GRID_PAGER,
				onCellSelect: function(rowId, cellIdx, cellValue) {
					var cm = $(this).jqGrid('getGridParam', 'colModel');
					var colNm = cm[cellIdx].name;
					if (colNm == 'storeNm') {
						const selectVal = $(this).jqGrid('getCell', rowId, 'storeId');
						const key = {brandId:fn_make_user_info.get('brandId'), storeId: selectVal, viewCd: 'R'};
						var param = $.param(key);
						viewObj.init(param);
					}
				},
				loadComplete: function(data) {
					console.log(data);
					itp_fn_grid_load_complete(data, STINFO02011_GRID_ID, true, 'number', 'STINFO02011', listObj.itp_STINFO02011_search, listObj.empty, true, data.gridRecords, true);
					var ids = $(STINFO02011_GRID_ID).getDataIDs();
					$.each(ids, function(idx, rowId) {
						$(STINFO02011_GRID_ID).jqGrid('setCell', rowId, 'storeNm', '', ITP_GRID_COL_STYLE.link);
					});
				},
				onPaging: function(action) {
					itp_fn_grid_paging(STINFO02011_GRID_ID, action, param);
				}
			};
			itp_fn_grid_make_remote(option);
		},
		clearData : function() {
			$(STINFO02011_GRID_ID).jqGrid('clearGridData', true);
			$(STINFO02011_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
			$(STINFO02011_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
			$(STINFO02011_GRID_EMPTY).show();
		},
		unload : function() {
			$.jgrid.gridUnload(STINFO02011_GRID_ID);
		}
	}
};

/*상세화면 Object*/
let viewObj = {
	init: function () {
		const key = {brandId:fn_make_user_info.get('brandId'), storeId: fn_make_user_info.get('storeId'), viewCd: 'R'};
		var param = $.param(key);
		this.load(param);
	},
	load: function(param) {
		fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
	},
	callback: function (result) {
		console.log(result);
		pageObj.switchScreen('VIEW');
		$('#ITP_FORM_STINFO02011_VIEW #ITP_FORM_STINFO02011_VIEW_STORE_ID').val(result.storeId);
		$('#ITP_FORM_STINFO02011_VIEW .fnBrandNm').text(result.brandNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnStCd').text(result.storeStNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnStoreId').text(result.storeId);
		$('#ITP_FORM_STINFO02011_VIEW .fnStoreDvsn').text(result.storeDvsnNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnStoreNm').text(result.storeNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnBsnsCndt').text(result.bsnsCndt);
		$('#ITP_FORM_STINFO02011_VIEW .fnBsnsRegNo').text(result.bsnsRegNo);
		$('#ITP_FORM_STINFO02011_VIEW .fnCtgrBsns').text(result.ctgrBsns);
		$('#ITP_FORM_STINFO02011_VIEW .fnCorpRegNo').text(result.corpRegNo);
		$('#ITP_FORM_STINFO02011_VIEW .fnTelNo').text(result.telNo);
		$('#ITP_FORM_STINFO02011_VIEW .fnOwnerNm').text(result.ownerNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnFaxNo').text(result.faxNo);
		$('#ITP_FORM_STINFO02011_VIEW .fnMblNo').text(result.telNo);
		$('#ITP_FORM_STINFO02011_VIEW .fnEmalAddr').text(result.emalAddr);
		$('#ITP_FORM_STINFO02011_VIEW .fnAreaCd').text(result.areaNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnFromDt').text(result.openDt);
		$('#ITP_FORM_STINFO02011_VIEW .fnZipNo').text(result.zipNo);
		$('#ITP_FORM_STINFO02011_VIEW .fnLoadAddr').text(result.addr1);
		$('#ITP_FORM_STINFO02011_VIEW .fnDtlAddr').text(result.addr2);

		var cmpyAdres = result.addr1/* + ' ' + result.addr*/;
		kakaoMap.init('ITP_FORM_STINFO02011_VIEW', cmpyAdres);

		$('#ITP_FORM_STINFO02011_VIEW .fnStoreAcctInfo').text(result.storeBnkNm + ' ' + result.storeAcctNo + ' ' + result.storeOwacNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnLoanDvsn').text(result.loanDvsnNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnBrandAcctInfo').text(result.brandBnkNm + ' ' + result.brandAcctNo + ' ' + result.brandOwacNm);
		$('#ITP_FORM_STINFO02011_VIEW .fnAcctBal').text(result.acctBal);
		$('#ITP_FORM_STINFO02011_VIEW .fnWhsUseYn').text(result.whsUseYn);
		$('#ITP_FORM_STINFO02011_VIEW .fnLimitAmt').text(result.limitAmt);
		$('#ITP_FORM_STINFO02011_VIEW .fnSysRegDttm').text(result.sysRegDttm);
		$('#ITP_FORM_STINFO02011_VIEW .fnCloseDt').text(result.closeDt);
	}
};

/*수정화면 Object*/
let modifyObj = {
	init: function () {
	},
	button: {
		modify: function (param) {
			itp_fn_form_clear_validate(null, '#ITP_FORM_STINFO02011_DETAIL');
			const selectVal = $('#ITP_FORM_STINFO02011_VIEW_STORE_ID').val();
			const key = {brandId:fn_make_user_info.get('brandId'), storeId: selectVal, viewCd: 'R'};
			var param = $.param(key);
			modifyObj.load(param);
		},
		address: function() {
			kakaoMap.address('ITP_FORM_STINFO02011_DETAIL');
		},
		cancel: function() {
			viewObj.init();
		},
		save: function() {
			const formId = '#ITP_FORM_STINFO02011_DETAIL';
			itp_fn_form_event.removeChar('#ITP_FORM_OPER03010_DETAIL');
			itp_fn_form_clear_validate(null, formId);

			if (itp_fn_form_event.isValid(formId)) {
				let param = $(formId).serializeObject();
				console.log(JSON.stringify(param));
				var searhFn = function() {
					ITP_FORM_STINFO02011_DETAIL_IS_WRITING = false;
					viewObj.init();
				};
				fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
			}
		}
	},
	load: function(param) {
		fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
	},
	callback: function (result) {
		console.log(result);
		pageObj.switchScreen('MODIFY');

		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_VIEW_CD').val('U');
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_STORE_ID').val(result.storeId);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
		$('#ITP_FORM_STINFO02011_DETAIL .fnBrandNm').text(result.brandNm);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_STORE_ST_CD').val(result.storeStCd);
		$('#ITP_FORM_STINFO02011_DETAIL .fnStoreNm').text(result.storeId);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_STORE_DVSN').val(result.storeDvsn);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_STORE_NM').val(result.storeNm);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_BSNS_CNDT').val(result.bsnsCndt);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_BSNS_REG_NO').val(result.bsnsRegNo);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_CTGR_BSNS').val(result.ctgrBsns);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_CORP_REG_NO').val(result.bsnsRegNo);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_TEL_NO').val(result.telNo);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_OWNER_NM').val(result.ownerNm);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_FAX_NO').val(result.faxNo);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_MBL_NO').val(result.telNo);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_EMAL_ADDR').val(result.emalAddr);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_AREA_CD').val(result.areaCd);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_FROM_DT').val(result.openDt);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_ZIPNO').val(result.zipNo);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_ADRES').val(result.addr1);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_ADRES_DTL').val(result.addr2);

		var cmpyAdres = result.addr1/* + ' ' + result.addr*/;
		kakaoMap.init('ITP_FORM_STINFO02011_DETAIL', cmpyAdres);

		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_DPST_BNK_CD').val(result.storeBnkCd);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_ACCT_NO').val(result.storeAcctNo);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_OWAC_NM').val(result.storeOwacNm);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_LOAN_DVSN').val(result.loanDvsn);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_LIMIT_AMT').val(result.limitAmt);
		$('#ITP_FORM_STINFO02011_DETAIL #ITP_FORM_STINFO02011_DETAIL_WHS_USE_YN').val(result.whsUseYn);
		$('#ITP_FORM_STINFO02011_DETAIL .fnBrandAcctInfo').text(result.brandBnkNm + ' ' + result.brandAcctNo + ' ' + result.brandOwacNm);
		$('#ITP_FORM_STINFO02011_DETAIL .fnAcctBal').text(result.acctBal);
		$('#ITP_FORM_STINFO02011_DETAIL .fnTmpRcvAcctTotal').text(result.tmpRcvAcctTotal);
		$('#ITP_FORM_STINFO02011_DETAIL .fnSysChgDttm').text(result.sysChgDttm);
	}
};

/*신규화면 Object*/
let createObj = {
	init: function () {
		$('#ITP_FORM_STINFO02011_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
		kakaoMap.init('ITP_FORM_STINFO02011_DETAIL', '');
	},
	button: {
	}
};
