ITP_LOANMNG03010.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. /********************************************************
  2. --------------------------------------------------------
  3. - Object 목록 -
  4. --------------------------------------------------------
  5. * const gridColModel = {} : 화면 Grid Object *
  6. * let pageObj = {} : 화면공통 Object *
  7. * let listObj = {} : 목록화면 Object *
  8. * let viewObj = {} : 상세화면 Object *
  9. * let modifyObj = {} : 수정화면 Object *
  10. * let createObj = {} : 신규화면 Object *
  11. *******************************************************/
  12. /*화면 변수*/
  13. const LOANMNG03010_GRID_ID = '#ITP_LOANMNG03010_jqGrid';
  14. const LOANMNG03010_GRID_LIST = '#ITP_LOANMNG03010_jqGrid_list';
  15. const LOANMNG03010_GRID_PAGER = '#ITP_LOANMNG03010_jqGridPager';
  16. const LOANMNG03010_GRID_EMPTY = '#ITP_LOANMNG03010_jqGridEmpty';
  17. const LOANMNG03010_VIEW_GRID_ID = '#ITP_LOANMNG03010_VIEW_jqGrid';
  18. const LOANMNG03010_VIEW_GRID_LIST = '#ITP_LOANMNG03010_VIEW_jqGrid_list';
  19. const LOANMNG03010_VIEW_GRID_PAGER = '#ITP_LOANMNG03010_VIEW_jqGridPager';
  20. const LOANMNG03010_VIEW_GRID_EMPTY = '#ITP_LOANMNG03010_VIEW_jqGridEmpty';
  21. const LOANMNG03010_DETAIL_GRID_ID = '#ITP_LOANMNG03010_DETAIL_jqGrid';
  22. const LOANMNG03010_DETAIL_GRID_LIST = '#ITP_LOANMNG03010_DETAIL_jqGrid_list';
  23. const LOANMNG03010_DETAIL_GRID_PAGER = '#ITP_LOANMNG03010_DETAIL_jqGridPager';
  24. const LOANMNG03010_DETAIL_GRID_EMPTY = '#ITP_LOANMNG03010_DETAIL_jqGridEmpty';
  25. let ITP_FORM_LOANMNG03010_DETAIL_IS_DUPLICATE = false;
  26. let ITP_FORM_LOANMNG03010_DETAIL_IS_WRITING = false;
  27. let LOANMNG03010_DETAIL_GRID_LAST_ROW_ID;
  28. /*API URL*/
  29. let UNPAID_MNG_DETAIL_GRID_LIST = '/api/unpaid/mng/detail-grid-list';
  30. let UNPAID_MNG_STL_GRID_LIST = '/api/unpaid/mng/stl-grid-list';
  31. let UNPAID_MNG_INFO_UNPAID = '/api/unpaid/mng/info-unpaid';
  32. let WHS_MNG_ADD_WHS = '/api/whs/mng/add-whs';
  33. let WHS_MNG_MIDIFY_WHS = '/api/whs/mng/modify-whs';
  34. let WHS_MNG_REMOVE_WHS = '/api/whs/mng/remove-whs';
  35. let LOGIN_AUTH_TYPE_CD;
  36. /*화면 Grid ColModel*/
  37. const gridColModel = {
  38. list: [
  39. {
  40. index: 'BRAND_ID', name: 'brandId',
  41. label: "브랜드ID",
  42. width: '0', fixed: false, align: 'center',
  43. sortable: false, hidden: true
  44. },
  45. {
  46. index: 'STORE_ID', name: 'storeId',
  47. label: "매장ID",
  48. width: '0', fixed: false, align: 'center',
  49. sortable: false, hidden: true
  50. },
  51. {
  52. index: 'BRAND_NM', name: 'brandNm',
  53. label: ITP_MSG_LOCALE.label.brandNm, //브랜드
  54. width: '13', fixed: false, align: 'center',
  55. sortable: false, hidden: true
  56. },
  57. {
  58. index: 'STORE_NM', name: 'storeNm',
  59. label: "매장명",
  60. width: '13', fixed: false, align: 'center',
  61. sortable: false, hidden: false
  62. },
  63. {
  64. index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
  65. label: "정산타입",
  66. width: '10', fixed: false, align: 'center',
  67. sortable: false, hidden: false
  68. },
  69. {
  70. index: 'STTL_MGNT_UNQ_NO', name: 'sttlMgntUnqNo',
  71. label: "정산번호",
  72. width: '10', fixed: false, align: 'center',
  73. sortable: false, hidden: false
  74. },
  75. {
  76. index: 'STTL_ST_NM', name: 'sttlStNm',
  77. label: "상태",
  78. width: '8', fixed: false, align: 'center',
  79. sortable: false, hidden: false
  80. },
  81. {
  82. index: 'STTL_REQ_DT', name: 'sttlReqDt',
  83. label: "정산요청일",
  84. width: '10', fixed: false, align: 'center',
  85. sortable: false, hidden: false
  86. },
  87. {
  88. index: 'STTL_REQ_AMT', name: 'sttlReqAmt',
  89. label: '정산요청금액',
  90. width: '10', fixed: false, align: 'center',
  91. sortable: false, hidden: false,
  92. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  93. },
  94. {
  95. index: 'STTL_DT', name: 'sttlDt',
  96. label: "정산확정일",
  97. width: '10', fixed: false, align: 'center',
  98. sortable: false, hidden: false
  99. },
  100. {
  101. index: 'UNPAId_AMT', name: 'unpaidAmt',
  102. label: '미납금액',
  103. width: '10', fixed: false, align: 'center',
  104. sortable: false, hidden: false,
  105. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  106. },
  107. {
  108. index: 'USE_AMT_TOTAL', name: 'useAmtTotal',
  109. label: '사용가능한도',
  110. width: '10', fixed: false, align: 'center',
  111. sortable: false, hidden: false,
  112. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  113. }
  114. ],
  115. view: [
  116. {
  117. index: 'VIEW_CD', name: 'viewCd',
  118. label: ITP_MSG_LOCALE.label.viewCd,
  119. width: '10', fixed: false, align: 'center',
  120. sortable: false, hidden: true
  121. },
  122. {
  123. index: 'STTL_MGNT_DTL_NO', name: 'sttlMgntDtlNo',
  124. label: '정산관리상세번호',
  125. width: '10', fixed: false, align: 'center',
  126. sortable: false, hidden: true
  127. },
  128. {
  129. index: 'BRAND_NM', name: 'brandNm',
  130. label: "브랜드",
  131. width: '10', fixed: false, align: 'center',
  132. sortable: false, hidden: true
  133. },
  134. {
  135. index: 'STORE_NM', name: 'storeNm',
  136. label: "매장명",
  137. width: '10', fixed: false, align: 'center',
  138. sortable: false, hidden: true
  139. },
  140. {
  141. index: 'ITEM_ID', name: 'itemId',
  142. label: "품목코드",
  143. width: '10', fixed: false, align: 'center',
  144. sortable: false, editable: false, edittype: 'text'
  145. },
  146. {
  147. index: 'ITEM_NM', name: 'itemNm',
  148. label: "품목명",
  149. width: '10', fixed: false, align: 'center',
  150. sortable: false, editable: false, edittype: 'text'
  151. },
  152. {
  153. index: 'UNIT', name: 'unit',
  154. label: "단위",
  155. width: '8', fixed: false, align: 'center',
  156. sortable: false, editable: false, edittype: 'text'
  157. },
  158. {
  159. index: 'UNIT_AMT', name: 'unitAmt',
  160. label: "단가",
  161. width: '8', fixed: false, align: 'center',
  162. sortable: false, editable: false, edittype: 'text',
  163. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  164. },
  165. {
  166. index: 'PODR_QTY', name: 'podrQty',
  167. label: "발주수량",
  168. width: '8', fixed: false, align: 'center',
  169. sortable: false, editable: false, edittype: 'text',
  170. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  171. },
  172. {
  173. index: 'DLV_QTY', name: 'dlvQty',
  174. label: "납품수량",
  175. width: '8', fixed: false, align: 'center',
  176. sortable: false, editable: false, edittype: 'text',
  177. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  178. },
  179. {
  180. index: 'WHS_COL_QTY', name: 'whsColQty',
  181. label: "입고/수거수량",
  182. width: '8', fixed: false, align: 'center',
  183. sortable: false, editable: false, edittype: 'text',
  184. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  185. },
  186. {
  187. index: 'WHS_COL_DT', name: 'whsColDt',
  188. label: "입고/수거일자",
  189. width: '8', fixed: false, align: 'center',
  190. sortable: false, editable: false, edittype: 'text'
  191. },
  192. {
  193. index: 'WHS_COL_AMT', name: 'whsColAmt',
  194. label: "입고/수거금액",
  195. width: '8', fixed: false, align: 'center',
  196. sortable: false, editable: false, edittype: 'text',
  197. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  198. },
  199. {
  200. index: 'STTL_DVSN_NM', name: 'sttlDvsnNm',
  201. label: "정산구분",
  202. width: '8', fixed: false, align: 'center',
  203. sortable: false, editable: false, edittype: 'text'
  204. },
  205. {
  206. index: 'PODR_UNQ_NO', name: 'podrUnqNo',
  207. label: "발주번호",
  208. width: '8', fixed: false, align: 'center',
  209. sortable: false, editable: false, edittype: 'text'
  210. },
  211. {
  212. index: 'PODR_DTL_NO', name: 'podrDtlNo',
  213. label: "발주항번",
  214. width: '8', fixed: false, align: 'center',
  215. sortable: false, editable: false, edittype: 'text'
  216. }
  217. ]
  218. };
  219. require(['config'], function() {
  220. require([
  221. 'kakao.map.util'
  222. ], function($) {
  223. pageObj.init();
  224. });
  225. });
  226. /*화면공통 Object*/
  227. let pageObj = {
  228. init: function () {
  229. this.ui.init();
  230. this.event.init();
  231. },
  232. ui: {
  233. init: function () {
  234. this.view();
  235. this.grid();
  236. this.ready();
  237. },
  238. view: function() {
  239. // 버튼 권한설정
  240. fn_proc_btn_auth('LOANMNG03010');
  241. // 공통코드 표시
  242. $('select').each(function() {
  243. if($(this).data('select-code')) {
  244. fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
  245. }
  246. });
  247. // 조회일자 지정
  248. var now = new Date();
  249. $('#ITP_TAB_LOANMNG03010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
  250. $('#ITP_FORM_LOANMNG03010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
  251. $('#ITP_FORM_LOANMNG03010_SEARCH_TO_DT').datepicker('setDate', new Date());
  252. // 권한에 따라 매장값 설정
  253. $('#ITP_FORM_LOANMNG03010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
  254. LOGIN_AUTH_TYPE_CD = fn_make_user_info.get('authTpCd'); // 권한타입
  255. if(LOGIN_AUTH_TYPE_CD == '50') {
  256. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_ID').val(fn_make_user_info.get('storeId'));
  257. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_NM').val(fn_make_user_info.get('storeNm'));
  258. }
  259. },
  260. grid: function() {
  261. itp_fn_jqgrid_resize(LOANMNG03010_GRID_ID, LOANMNG03010_GRID_LIST, 'lg');
  262. listObj.empty.init();
  263. itp_fn_fire_window_resize();
  264. },
  265. ready: function() {
  266. listObj.init();
  267. }
  268. },
  269. event: {
  270. init: function () {
  271. this.button();
  272. },
  273. button: function () {
  274. // 버튼 클릭 이벤트
  275. $('button').each(function() {
  276. var id = $(this).attr('id');
  277. $(this).on('click', function() {
  278. switch (id) {
  279. case 'ITP_BTN_LOANMNG03010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
  280. case 'ITP_BTN_LOANMNG03010_CANCELLIST' : viewObj.button.cancel(); break; // 취소/목록 버튼
  281. case 'ITP_BTN_LOANMNG03010_PAYMENT' : viewObj.button.payment(); break; // 결제 버튼
  282. case 'ITP_BTN_LOANMNG03010_STORE_SEARCH' : listObj.button.storePop(); break; // 매장검색 팝업
  283. case 'ITP_BTN_LOANMNG03010_STORE_ERASE' : listObj.button.storeErase(); break; // 매장 지움
  284. }
  285. });
  286. });
  287. $('body').on('click', function(e) {
  288. var gridId = LOANMNG03010_DETAIL_GRID_ID.replace('#', '');
  289. var rids = $(LOANMNG03010_DETAIL_GRID_ID).jqGrid('getDataIDs');
  290. var last_row_id = rids[rids.length - 1];
  291. itp_fn_grid_reset_selection(e, last_row_id, gridId, 'LOANMNG03010_DETAIL');
  292. });
  293. }
  294. },
  295. switchScreen: function(mode) {
  296. if(mode == 'LIST') { // 목록
  297. $('#ITP_BTN_LOANMNG03010_MODIFY').hide();
  298. $('#ITP_BTN_LOANMNG03010_CANCELLIST').hide();
  299. $('#ITP_BTN_LOANMNG03010_DELETE').hide();
  300. $('#ITP_BTN_LOANMNG03010_PAYMENT').hide();
  301. if(LOGIN_AUTH_TYPE_CD == '50') { // 매장관리자
  302. $('#ITP_BTN_LOANMNG03010_STORE_SEARCH').hide();
  303. $('#ITP_BTN_LOANMNG03010_STORE_ERASE').hide();
  304. } else {
  305. $('#ITP_BTN_LOANMNG03010_STORE_SEARCH').show();
  306. $('#ITP_BTN_LOANMNG03010_STORE_ERASE').show();
  307. }
  308. fn_show_btn_auth('#ITP_BTN_LOANMNG03010_SRH');
  309. fn_show_btn_auth('#ITP_BTN_LOANMNG03010_NEWREG');
  310. $('#ITP_AJAX_LOANMNG03010_LIST_CONTAINER').show();
  311. $('#ITP_AJAX_LOANMNG03010_DETAIL_CONTAINER').hide();
  312. $('#ITP_AJAX_LOANMNG03010_VIEW_CONTAINER').hide();
  313. } else if(mode == 'VIEW') { // 보기
  314. $('#ITP_BTN_LOANMNG03010_SRH').hide();
  315. $('#ITP_BTN_LOANMNG03010_NEWREG').hide();
  316. $('#ITP_BTN_LOANMNG03010_DELETE').hide();
  317. fn_show_btn_auth('#ITP_BTN_LOANMNG03010_PAYMENT');
  318. fn_show_btn_auth('#ITP_BTN_LOANMNG03010_CANCELLIST');
  319. $('#ITP_AJAX_LOANMNG03010_LIST_CONTAINER').hide();
  320. $('#ITP_AJAX_LOANMNG03010_DETAIL_CONTAINER').hide();
  321. $('#ITP_AJAX_LOANMNG03010_VIEW_CONTAINER').show();
  322. }
  323. }
  324. };
  325. /*목록화면 Object*/
  326. let listObj = {
  327. init: function () {
  328. this.grid.init();
  329. },
  330. itp_LOANMNG03010_search: false,
  331. button: {
  332. search: function() {
  333. listObj.itp_LOANMNG03010_search = true;
  334. let param = $('#ITP_FORM_LOANMNG03010_SEARCH').serializeObject();
  335. param.gridSize = $.jgrid.defaults.rowNum;
  336. param.gridPage = $.jgrid.defaults.page;
  337. $(LOANMNG03010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
  338. },
  339. create: function() {
  340. pageObj.switchScreen('ADD');
  341. itp_fn_form_clear_validate(null, '#ITP_FORM_LOANMNG03010_DETAIL');
  342. // 로케이션 리스트 조회
  343. createObj.init();
  344. },
  345. storePop: function() {
  346. fn_call_popup('biz', 'BIZPOP_BRAND_STORE', '#ITP_ASIDE', function(result) {
  347. // alert(JSON.stringify(result));
  348. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_ID').val(result[0].storeId);
  349. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_NM').val(result[0].storeNm);
  350. listObj.button.search();
  351. }, null, 'S');
  352. },
  353. storeErase: function() {
  354. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_ID').val('');
  355. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_NM').val('');
  356. listObj.button.search();
  357. }
  358. },
  359. empty: {
  360. init: function() {
  361. var _this = this;
  362. this.push();
  363. $(LOANMNG03010_GRID_EMPTY).on('click', function() {
  364. _this.back();
  365. _this.itp_LOANMNG03010_param.gridSize = $.jgrid.defaults.rowNum;
  366. $(LOANMNG03010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_LOANMNG03010_param)}).trigger('reloadGrid');
  367. });
  368. },
  369. itp_LOANMNG03010_param: {},
  370. push: function() {
  371. let param = $('#ITP_FORM_LOANMNG03010_SEARCH').serializeObject();
  372. listObj.itp_LOANMNG03010_param = param;
  373. },
  374. back: function() {
  375. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_ID').val(listObj.itp_LOANMNG03010_param.sstoreId);
  376. $('#ITP_FORM_LOANMNG03010_SEARCH_STORE_NM').val(listObj.itp_LOANMNG03010_param.sstoreNm);
  377. $('#ITP_FORM_LOANMNG03010_SEARCH_FROM_DT').val(listObj.itp_LOANMNG03010_param.fromDt);
  378. $('#ITP_FORM_LOANMNG03010_SEARCH_TO_DT').val(listObj.itp_LOANMNG03010_param.toDt);
  379. }
  380. },
  381. grid: {
  382. init: function () {
  383. // 데이터 없을때
  384. listObj.empty.push();
  385. this.search();
  386. },
  387. colModel: gridColModel.list,
  388. search: function() {
  389. pageObj.switchScreen('LIST');
  390. this.unload();
  391. this.load();
  392. },
  393. load: function() {
  394. let param = $('#ITP_FORM_LOANMNG03010_SEARCH').serializeObject();
  395. param.gridSize = $.jgrid.defaults.rowNum;
  396. var option = {
  397. gridId: LOANMNG03010_GRID_ID,
  398. colModel: gridColModel.list,
  399. param: param,
  400. url: DOMAIN + UNPAID_MNG_DETAIL_GRID_LIST,
  401. pager: LOANMNG03010_GRID_PAGER,
  402. onCellSelect: function(rowId, cellIdx, cellValue) {
  403. var cm = $(this).jqGrid('getGridParam', 'colModel');
  404. var colNm = cm[cellIdx].name;
  405. if (colNm == 'sttlMgntUnqNo') {
  406. const sttlMgntUnqNoVal = $(this).jqGrid('getCell', rowId, 'sttlMgntUnqNo');
  407. const key = {sttlMgntUnqNo: sttlMgntUnqNoVal, viewCd: 'R'};
  408. var param = $.param(key);
  409. viewObj.init(param);
  410. }
  411. },
  412. loadComplete: function(data) {
  413. console.log(data);
  414. itp_fn_grid_load_complete(data, LOANMNG03010_GRID_ID, true, 'number', 'LOANMNG03010', listObj.itp_LOANMNG03010_search, listObj.empty, true, data.gridRecords, true);
  415. var ids = $(LOANMNG03010_GRID_ID).getDataIDs();
  416. $.each(ids, function(idx, rowId) {
  417. $(LOANMNG03010_GRID_ID).jqGrid('setCell', rowId, 'sttlMgntUnqNo', '', ITP_GRID_COL_STYLE.link);
  418. });
  419. },
  420. onPaging: function(action) {
  421. itp_fn_grid_paging(LOANMNG03010_GRID_ID, action, param);
  422. }
  423. };
  424. itp_fn_grid_make_remote(option);
  425. },
  426. clearData : function() {
  427. $(LOANMNG03010_GRID_ID).jqGrid('clearGridData', true);
  428. $(LOANMNG03010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
  429. $(LOANMNG03010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
  430. $(LOANMNG03010_GRID_EMPTY).show();
  431. },
  432. unload : function() {
  433. $.jgrid.gridUnload(LOANMNG03010_GRID_ID);
  434. }
  435. }
  436. };
  437. /*상세화면 Object*/
  438. let viewObj = {
  439. init: function (param) {
  440. this.load(param);
  441. },
  442. button: {
  443. cancel: function() {
  444. listObj.grid.search();
  445. },
  446. payment: function() {
  447. // 결제 팝업 결과
  448. var popFn = function(rowDataPop) {
  449. console.log(JSON.stringify(rowDataPop));
  450. listObj.grid.search();
  451. };
  452. // 결제 팝업
  453. // 결제타입코드 : 10(선불(충전)), 20(후불(결제)), 30(후불(선결제))
  454. var args = {'payTpCd': '20',
  455. 'brandId': $('#ITP_FORM_LOANMNG03010_VIEW_BRAND_ID').val(),
  456. 'storeId': $('#ITP_FORM_LOANMNG03010_VIEW_STORE_ID').val(),
  457. 'sttlMgntUnqNo': $('#ITP_FORM_LOANMNG03010_VIEW_STTL_MGNT_UNQ_NO').val(),
  458. 'goodsAmt': $('#ITP_FORM_LOANMNG03010_VIEW_UNPAID_AMT').val() };
  459. fn_call_popup('biz', 'BIZPOP_PO_PAYMENT', '#ITP_ASIDE', popFn, args, 'S');
  460. }
  461. },
  462. load: function(param) {
  463. fn_ajax_call(UNPAID_MNG_INFO_UNPAID, param, this.callback, 'GET');
  464. },
  465. callback: function (result) {
  466. // console.log(result);
  467. pageObj.switchScreen('VIEW');
  468. $('#ITP_FORM_LOANMNG03010_VIEW #ITP_FORM_LOANMNG03010_VIEW_BRAND_ID').val(result.brandId);
  469. $('#ITP_FORM_LOANMNG03010_VIEW #ITP_FORM_LOANMNG03010_VIEW_STORE_ID').val(result.storeId);
  470. $('#ITP_FORM_LOANMNG03010_VIEW #ITP_FORM_LOANMNG03010_VIEW_STTL_MGNT_UNQ_NO').val(result.sttlMgntUnqNo);
  471. $('#ITP_FORM_LOANMNG03010_VIEW #ITP_FORM_LOANMNG03010_VIEW_RCPT_YN').val(result.rcptYn);
  472. $('#ITP_FORM_LOANMNG03010_VIEW #ITP_FORM_LOANMNG03010_VIEW_UNPAID_AMT').val(result.unpaidAmt);
  473. $('#ITP_FORM_LOANMNG03010_VIEW .fnBrandNm').text(result.brandNm);
  474. $('#ITP_FORM_LOANMNG03010_VIEW .fnStoreNm').text(result.storeNm);
  475. $('#ITP_FORM_LOANMNG03010_VIEW .fnSttlReqDt').text(result.sttlReqDt);
  476. $('#ITP_FORM_LOANMNG03010_VIEW .fnSttlDt').text(result.sttlDt == null ? '' : result.sttlDt);
  477. $('#ITP_FORM_LOANMNG03010_VIEW .fnSttlStNm').text(result.sttlStNm);
  478. // $('#ITP_FORM_LOANMNG03010_VIEW .fnSysRegDttm').text(result.sysRegDttm);
  479. $('#ITP_FORM_LOANMNG03010_VIEW .fnSysRegNm').text(result.sysRegNm + ' (' + result.sysRegDttm + ')');
  480. $('#ITP_FORM_LOANMNG03010_VIEW .fnSttlReqAmt').text(itp_fn_number_comma(result.sttlReqAmt));
  481. $('#ITP_FORM_LOANMNG03010_VIEW .fnUseAmtTotal').text(itp_fn_number_comma(result.useAmtTotal));
  482. $('#ITP_FORM_LOANMNG03010_VIEW .fnAcctBal').text(itp_fn_number_comma(result.acctBal));
  483. $('#ITP_FORM_LOANMNG03010_VIEW .fnUnpaidAmt').text(itp_fn_number_comma(result.unpaidAmt));
  484. if(result.rcptYn == 'Y') { // 수납여부
  485. $('#ITP_BTN_LOANMNG03010_PAYMENT').hide();
  486. } else {
  487. $('#ITP_BTN_LOANMNG03010_PAYMENT').show();
  488. }
  489. // 리스트 조회
  490. viewObj.grid.init();
  491. },
  492. grid: {
  493. init: function() {
  494. this.unload();
  495. this.load();
  496. },
  497. load : function() {
  498. let param = $('#ITP_FORM_LOANMNG03010_VIEW').serializeObject();
  499. param.gridSize = $.jgrid.defaults.rowNum;
  500. param.pagingYn = false; // 페이징안함
  501. var option = {
  502. gridId: LOANMNG03010_VIEW_GRID_ID,
  503. colModel: gridColModel.view,
  504. param: param,
  505. url: DOMAIN + UNPAID_MNG_STL_GRID_LIST,
  506. pager: LOANMNG03010_VIEW_GRID_PAGER,
  507. loadComplete: function(data) {
  508. itp_fn_grid_load_complete(data, LOANMNG03010_VIEW_GRID_ID, true, undefined, 'LOANMNG03010_VIEW');
  509. },
  510. onPaging: function(action) {
  511. var pagingFn = {
  512. callBack: function(args) {
  513. $(args).trigger('reloadGrid');
  514. }
  515. };
  516. if (itp_fn_check_grid_is_writing(LOANMNG03010_VIEW_GRID_ID)) {
  517. itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, LOANMNG03010_VIEW_GRID_ID);
  518. return 'stop';
  519. } else {
  520. itp_fn_grid_paging(LOANMNG03010_VIEW_GRID_ID, action, param);
  521. }
  522. },
  523. onSortCol: function(index, columnIndex, sortOrder) {
  524. var sortingFn = {
  525. callBack: function(args) {
  526. $(args).trigger('reloadGrid');
  527. }
  528. };
  529. if (itp_fn_check_grid_is_writing(LOANMNG03010_VIEW_GRID_ID)) {
  530. itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, LOANMNG03010_VIEW_GRID_ID);
  531. return 'stop';
  532. } else {
  533. itp_fn_grid_sorting(LOANMNG03010_VIEW_GRID_ID, index, sortOrder);
  534. }
  535. }
  536. };
  537. itp_fn_grid_make_remote(option);
  538. },
  539. clearData : function() {
  540. $(LOANMNG03010_VIEW_GRID_ID).jqGrid('clearGridData', true);
  541. $(LOANMNG03010_VIEW_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
  542. $(LOANMNG03010_VIEW_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
  543. $(LOANMNG03010_VIEW_GRID_EMPTY).show();
  544. },
  545. unload : function() {
  546. $.jgrid.gridUnload(LOANMNG03010_VIEW_GRID_ID);
  547. }
  548. }
  549. };