ITP_MLOANMNG02010.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. require(['config'], function() {
  2. require([
  3. ], function($) {
  4. mobPageObj.init();
  5. });
  6. });
  7. /*API URL*/
  8. const API_MOBILE_GRID_LIST = '/api/dspt/mng/detail-grid-list'; // 목록
  9. const API_MOBILE_INFO = '/api/dspt/mng/info-dspt'; // 상세
  10. const API_MOBILE_DSPT_REQ = '/api/dspt/mng/request-dspt'; // 신규/승인
  11. const API_MOBILE_DSPT_REJ = '/api/dspt/mng/remove-dspt'; // 삭제/반려
  12. const API_MOBILE_APPROVE = '/api/dspt/mng/approve-dspt'; // 승인
  13. const API_MOBILE_REJECT = '/api/dspt/mng/reject-dspt'; // 반려
  14. const API_POP_SEARCH_LIST = '/api/store/pop-grid-list';
  15. // 이지페이 결제 생성
  16. let EASYPAY_PAYMENT_CREATE = '/api/easypay/payment/create';
  17. const PAGE_MODE_LIST = "LIST";
  18. const PAGE_MODE_VIEW = "VIEW";
  19. let mobPageObj = {
  20. viewMode: PAGE_MODE_LIST,
  21. init: function () {
  22. this.ui.init();
  23. this.event.init();
  24. this.ready();
  25. },
  26. ui: {
  27. init: function () {
  28. this.view();
  29. this.info();
  30. },
  31. view: function() {
  32. // 공통코드 표시
  33. $('select').each(function() {
  34. if($(this).data('select-code')) {
  35. fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
  36. }
  37. });
  38. // 조회일자 지정
  39. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_FROM_DT').val(itp_fn_date_add('M', -1));
  40. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_TO_DT').val(itp_fn_date_add('M', 0));
  41. if(fn_make_user_info.get('authTpCd') === '50') {
  42. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val(fn_make_user_info.get('storeNm'));
  43. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_BTN_MLOANMNG02010_LIST_SEARCH_RTN_PLACE').hide();
  44. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_BTN_MLOANMNG02010_LIST_DELETE_RTN_PLACE').hide();
  45. }
  46. itp_fn_form_event.onKeyup('#ITP_FORM_MLOANMNG02010_PAY');
  47. },
  48. info: function() {
  49. $('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
  50. $('input:hidden[id$="_STORE_ID"]').val(fn_make_user_info.get('storeId'));
  51. }
  52. },
  53. event: {
  54. init: function() {
  55. this.action();
  56. },
  57. action: function() {
  58. $('button[id^="ITP_BTN_MLOANMNG02010_LIST"]').on('click', function() {
  59. var id = $(this).attr('id');
  60. switch (id) {
  61. case 'ITP_BTN_MLOANMNG02010_LIST_SEARCH_RTN_PLACE' : mobPopObj.popStoreNm.init(); break;
  62. case 'ITP_BTN_MLOANMNG02010_LIST_DELETE_RTN_PLACE' : mobPopObj.popStoreNm.delete(); break;
  63. case 'ITP_BTN_MLOANMNG02010_LIST_PAY' : mobContentObj.list.payment.view(); break;
  64. case 'ITP_BTN_MLOANMNG02010_LIST_ADD' : mobContentObj.list.add(); break;
  65. case 'ITP_BTN_MLOANMNG02010_LIST_SEARCH' : mobContentObj.list.search(); break;
  66. }
  67. return false;
  68. });
  69. $('button[id^="ITP_BTN_MLOANMNG02010_PAY"]').on('click', function() {
  70. var id = $(this).attr('id');
  71. switch (id) {
  72. case 'ITP_BTN_MLOANMNG02010_PAY_REQ' : mobContentObj.list.payment.request(); break;
  73. case 'ITP_BTN_MLOANMNG02010_PAY_CANCEL' : mobContentObj.list.payment.cancel(); break;
  74. }
  75. return false;
  76. });
  77. $(document).on('click', '#ITP_LIST_MLOANMNG02010_LIST_ITEM_ROWS li', function(e) {
  78. var index = $(this).index();
  79. if($(e.target).hasClass('AGR')) {
  80. mobContentObj.list.agree(index);
  81. } else if($(e.target).hasClass('RJT')) {
  82. mobContentObj.list.reject(index);
  83. } else {
  84. }
  85. });
  86. $('select[id^="ITP_FORM_MLOANMNG02010_VIEW_EMAIL_CD"]').on('change', function() {
  87. var val = $(this).val();
  88. var emailId = '#ITP_FORM_MLOANMNG02010_VIEW_PAY_EMAIL_NM';
  89. if(val === '') {
  90. $(emailId).val('');
  91. $(emailId).attr('readonly', false);
  92. } else {
  93. $(emailId).val($(this).val());
  94. $(emailId).attr('readonly', true);
  95. }
  96. });
  97. $(document).on('click', '#ITP_LIST_MLOANMNG02010_POP_STORE_ROWS li button', function() {
  98. mobPopObj.popWhsNm.choice($(this));
  99. });
  100. }
  101. },
  102. switchScreen: function(mode) {
  103. this.viewMode = mode;
  104. $('#ITP_MOBILE_MLOANMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
  105. $(this).hide();
  106. });
  107. if(mode === PAGE_MODE_LIST) {
  108. $('#ITP_AJAX_MLOANMNG02010_LIST_CONTAINER').show();
  109. this.moreView(true);
  110. } else if(mode === PAGE_MODE_VIEW) {
  111. $('#ITP_AJAX_MLOANMNG02010_VIEW_CONTAINER').show();
  112. this.moreView(false);
  113. }
  114. },
  115. moreView: function(isScroll) {
  116. var _this = this;
  117. if(isScroll) {
  118. $('#ITP_LIST_MLOANMNG02010_LIST_ITEM_AREA').on('scroll', function () {
  119. if($(this).scrollTop() + $(this).innerHeight() + 1 >= $(this)[0].scrollHeight) {
  120. if(mobContentObj.list.totPage > mobContentObj.list.listPage) {
  121. if(!mobContentObj.list.isSearch) {
  122. mobContentObj.list.load();
  123. }
  124. }
  125. }
  126. });
  127. } else {
  128. $('#ITP_LIST_MLOANMNG02010_LIST_AREA').off('scroll');
  129. }
  130. },
  131. ready: function() {
  132. mobContentObj.list.init();
  133. }
  134. };
  135. let mobContentObj = {
  136. list: {
  137. listSize: 10,
  138. listPage: 0,
  139. totPage: 0,
  140. isSearch: false,
  141. rows: [],
  142. init: function() {
  143. mobPageObj.switchScreen(PAGE_MODE_LIST);
  144. this.search();
  145. },
  146. search: function() {
  147. this.listPage = 0;
  148. this.totPage = 0;
  149. this.rows.length = 0;
  150. $('#ITP_LIST_MLOANMNG02010_LIST_ITEM_ROWS').empty();
  151. this.load();
  152. },
  153. load: function() {
  154. var _this = this;
  155. this.isSearch = true;
  156. var callbackFn = function(result) {
  157. console.log(result);
  158. _this.isSearch = false;
  159. _this.totPage = result.gridTotal;
  160. $.each(result.gridRows, function (i, item) {
  161. $('#ITP_LIST_MLOANMNG02010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MLOANMNG02010_LIST_ITEM_ROWCOPY').html());
  162. var $li = $('#ITP_LIST_MLOANMNG02010_LIST_ITEM_AREA .panel-group > .list-row:last');
  163. $li.find('.fnStoreNm').text(item.storeNm);
  164. $li.find('.fnDpstDt').text(item.dpstDt);
  165. $li.find('.fnDpstAmt').text(CommonObj.currency.add(item.dpstAmt));
  166. $li.find('.fnDpstNm').text(item.dpstNm);
  167. $li.find('.fnRcvAcctNo').text(item.rcvAcctNo);
  168. $li.find('.fnDpstBnkNm').text(item.dpstBnkNm);
  169. $li.find('.fnDpstStNm').text(item.dpstStNm);
  170. var dpstDt = '';
  171. if(item.dpstStCd === 'DP01') {
  172. dpstDt = item.reqDt;
  173. if(fn_make_user_info.get('authTpCd') === '40') {
  174. $li.find('.btn-dpst').show();
  175. }
  176. } else if(item.dpstStCd === 'DP02') {
  177. dpstDt = item.dpstDt;
  178. } else if(item.dpstStCd === 'DP03') {
  179. dpstDt = item.dsptRjctDt;
  180. } else if(item.dpstStCd === 'DP04') {
  181. dpstDt = item.dpstAuthDt;
  182. }
  183. $li.find('.fnDpstDt').text(dpstDt);
  184. _this.rows.push(item);
  185. });
  186. };
  187. var errFn = function() { _this.isSearch = false;};
  188. const param = $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH').serializeObject();
  189. param.gridPage = ++this.listPage;
  190. param.gridSize = this.listSize
  191. param.fromDt = CommonObj.onlyNumber(param.fromDt);
  192. param.toDt = CommonObj.onlyNumber(param.toDt);
  193. console.log(JSON.stringify(param));
  194. fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST', errFn);
  195. },
  196. payment: {
  197. view: function() {
  198. var storeId = $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val();
  199. if(storeId.length < 1) {
  200. alert('신규입금 처리를 위한 매장을 선택하세요.');
  201. return;
  202. }
  203. this.popup();
  204. },
  205. popup: function() {
  206. // 결제 팝업 결과
  207. var popFn = function(rowDataPop) {
  208. console.log(JSON.stringify(rowDataPop));
  209. listObj.grid.search();
  210. };
  211. // 결제 팝업
  212. // 결제타입코드 : 10(선불(충전)), 20(후불(결제)), 30(후불(선결제)), 30(후불(선결제))
  213. var loanDvsn = $('#ITP_FORM_LOANMNG02010_SEARCH_STORE_LOAN_DVSN').val();
  214. var args = {
  215. 'payTpCd': loanDvsn === 'LD01' ? '10' : '30',
  216. 'brandId': $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_BRAND_ID').val(),
  217. 'storeId': $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val()
  218. };
  219. fn_call_popup('biz', 'BIZPOP_PO_PAYMENT', '#ITP_ASIDE', popFn, args, 'M');
  220. },
  221. },
  222. add: function() {
  223. var storeId = $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val();
  224. if(storeId.length < 1) {
  225. alert('신규입금 처리를 위한 매장을 선택하세요.');
  226. return;
  227. }
  228. mobPopObj.popDpstReq.init();
  229. },
  230. agree: function(index) {
  231. var item = this.rows[index];
  232. console.log(item);
  233. if(item.dpstStCd !== 'DP01') {
  234. alert('입금요청 건만 승인처리를 할 수 있습니다.');
  235. return;
  236. }
  237. if(confirm(ITP_MSG_LOCALE.message.form.procData)) {
  238. var param = {"dsptMgntNoList": [item.dsptMgntNo]};
  239. fn_ajax_call(API_MOBILE_APPROVE, JSON.stringify(param), function() { mobContentObj.list.search(); }, 'POST');
  240. }
  241. },
  242. reject: function(index) {
  243. var item = this.rows[index];
  244. console.log(item);
  245. if(item.dpstStCd !== 'DP01') {
  246. alert('입금요청 건만 반려처리를 할 수 있습니다.');
  247. return;
  248. }
  249. mobPopObj.popDpstRjct.init(item.dsptMgntNo);
  250. }
  251. },
  252. view: {
  253. init: function(item) {
  254. mobPageObj.switchScreen(PAGE_MODE_VIEW);
  255. this.search(item);
  256. },
  257. search: function(item) {
  258. var _this = this;
  259. var callbackFn = function(result) {
  260. console.log(result);
  261. _this.view(result);
  262. };
  263. const param = {
  264. 'brandId': fn_make_user_info.get('brandId'),
  265. 'spplyId': fn_make_user_info.get('spplyId'),
  266. 'loanMgntUnqNo': item.loanMgntUnqNo
  267. };
  268. fn_ajax_call(API_MOBILE_INFO, param, callbackFn, 'GET');
  269. },
  270. view: function(result) {
  271. var _this = this;
  272. var id = '#ITP_AJAX_MLOANMNG02010_VIEW_CONTAINER';
  273. $(id).find('.fnStoreNm').text(result.storeNm);
  274. $(id).find('.fnLoanDvsnNm').text(result.loanDvsnNm);
  275. var limitAmt;
  276. if(result.loanDvsn == 'LD01') { // 선불(충전)
  277. limitAmt = result.chrgeLimitAmt;
  278. } else if(result.loanDvsn == 'LD02') { // 후불(신용)
  279. limitAmt = result.credtLimitAmt;
  280. }
  281. $(id).find('.fnLimitAmt').text(CommonObj.currency.add(limitAmt));
  282. $(id).find('.fnUseYnNm').text(result.useYnNm);
  283. $(id).find('.fnPosbLimitAmt').text(CommonObj.currency.add(limitAmt - result.useAmtTotal));
  284. $(id).find('.fnTmpRcvAcctTotal').text(CommonObj.currency.add(result.tmpRcvAcctTotal));
  285. $(id).find('.fnUseAmtTotal').text(CommonObj.currency.add(result.useAmtTotal));
  286. _this.history.init(result.loanMgntUnqNo);
  287. },
  288. payment:function() {
  289. location.replace('app:payment');
  290. },
  291. cancel: function () {
  292. var id = '#ITP_AJAX_MLOANMNG02010_VIEW_CONTAINER';
  293. $(id).find('.fnItemid').text('');
  294. $(id).find('.fnItemNm').text('');
  295. $(id).find('.fnUPodrQty').text('');
  296. $(id).find('#ITP_FORM_MLOANMNG02010_VIEW_TRSC_AMT').val('');
  297. $(id).find('#ITP_FORM_MLOANMNG02010_VIEW_MBL_NO').val('');
  298. $(id).find('#ITP_FORM_MLOANMNG02010_VIEW_PAY_EMAIL_ID').val('');
  299. $(id).find('#ITP_FORM_MLOANMNG02010_VIEW_PAY_EMAIL_NM').val('');
  300. $(id).find('#ITP_FORM_MLOANMNG02010_VIEW_EMAIL_CD').val('');
  301. mobPageObj.switchScreen(PAGE_MODE_LIST);
  302. }
  303. }
  304. };
  305. let mobPopObj = {
  306. popStoreNm: {
  307. popId: 'ITP_POP_MLOANMNG02010_STORE_AREA',
  308. rows: [],
  309. init: function () {
  310. this.rows.length = 0;
  311. mobPopObj.show(this.popId);
  312. this.search();
  313. this.action();
  314. },
  315. search: function () {
  316. var _this = this;
  317. $('#ITP_LIST_MLOANMNG02010_POP_STORE_AREA .panel-group').empty();
  318. var callbackFn = function(result) {
  319. console.log(result);
  320. _this.view(result.gridRows);
  321. };
  322. const param = $('#ITP_FORM_MLOANMNG02010_POP_STORE').serializeObject();
  323. fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
  324. },
  325. view: function(gridRows) {
  326. this.rows = gridRows;
  327. $.each(gridRows, function (i, item) {
  328. $('#ITP_LIST_MLOANMNG02010_POP_STORE_AREA .panel-group').append($('#ITP_LIST_MLOANMNG02010_POP_STORE_ROWCOPY').html());
  329. var $li = $('#ITP_LIST_MLOANMNG02010_POP_STORE_AREA .panel-group > .list-row:last');
  330. $li.find('.fnStoreNm').text(item.storeNm);
  331. $li.find('.fnStoreStNm').text(item.storeStNm);
  332. $li.find('.fnStoreId').data('store-id', item.storeId);
  333. });
  334. },
  335. choice: function(elem) {
  336. var _this = this;
  337. var storeId = $(elem).data('store-id');
  338. $.each(this.rows, function (i, item) {
  339. if(storeId === item.storeId) {
  340. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val(item.storeId);
  341. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val(item.storeNm);
  342. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_LOANMNG02010_SEARCH_STORE_LOAN_DVSN').val(item.loanDvsn);
  343. _this.close();
  344. return false;
  345. }
  346. });
  347. },
  348. action: function() {
  349. var _this = this;
  350. $('button[id^="ITP_BTN_MLOANMNG02010_POP_STORE"]').off('click').on('click', function() {
  351. var id = $(this).attr('id');
  352. switch (id) {
  353. case 'ITP_BTN_MLOANMNG02010_POP_STORE_SEARCH' : _this.search(); break;
  354. case 'ITP_BTN_MLOANMNG02010_POP_STORE_CHOICE' : _this.choice($(this)); break;
  355. case 'ITP_BTN_MLOANMNG02010_POP_STORE_CLOSE' : _this.close(); break;
  356. }
  357. return false;
  358. });
  359. },
  360. delete: function() {
  361. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val('');
  362. $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val('');
  363. },
  364. close: function() {
  365. this.rows.length = 0;
  366. $('#ITP_POP_MLOANMNG02010_LIST_WHS_AREA .panel-group').empty();
  367. $('#ITP_FORM_MLOANMNG02010_POP_STORE #ITP_FORM_MLOANMNG02010_POP_STORE_KEYWORD').val('');
  368. mobPopObj.hide(this.popId);
  369. }
  370. },
  371. popDpstReq: {
  372. popId: 'ITP_POP_MLOANMNG02010_DPST_REQ_AREA',
  373. init: function() {
  374. this.reset();
  375. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_BRAND_NM').val(fn_make_user_info.get('brandNm'));
  376. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_POP_FORM_MLOANMNG02010_DPST_REQ_STORE_ID').val($('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val());
  377. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_STORE_NM').val($('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val());
  378. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_DT').val(itp_fn_date_add('M', 0));
  379. mobPopObj.show(this.popId);
  380. this.action();
  381. },
  382. action: function() {
  383. var _this = this;
  384. $('button[id="ITP_BTN_MLOANMNG02010_POP_DPST_ADD"]').off('click').on('click', function() {
  385. _this.save();
  386. });
  387. $('button[id="ITP_BTN_MLOANMNG02010_POP_DPST_CANCEL"]').off('click').on('click', function() {
  388. _this.cancel();
  389. });
  390. },
  391. save: function() {
  392. var _this = this;
  393. const formId = '#ITP_POP_FORM_MLOANMNG02010_DPST_REQ';
  394. if (itp_fn_form_event.isValid(formId)) {
  395. if(confirm(ITP_MSG_LOCALE.message.form.procData)) {
  396. var saveFn = function() {
  397. _this.cancel();
  398. mobContentObj.list.search();
  399. };
  400. var param = $(formId).serializeObject();
  401. param.dpstDt = param.dpstDt.replace(/-/g, ".");
  402. console.log(JSON.stringify(param));
  403. fn_ajax_call(API_MOBILE_DSPT_REQ, JSON.stringify(param), saveFn, 'POST');
  404. }
  405. }
  406. },
  407. reset: function() {
  408. itp_fn_form_clear_validate(null, '#ITP_POP_FORM_MLOANMNG02010_DPST_REQ');
  409. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_STORE_ID').val('');
  410. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_BRAND_NM').val('');
  411. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_STORE_NM').val('');
  412. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_AMT').val('');
  413. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_DT').val('');
  414. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_NM').val('');
  415. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_BNK').val('');
  416. $('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_ACCT_NO').val('');
  417. },
  418. cancel: function() {
  419. mobPopObj.hide(this.popId);
  420. }
  421. },
  422. popDpstRjct: {
  423. popId: 'ITP_POP_MLOANMNG02010_DPST_RJCT_AREA',
  424. init: function(dsptMgntNo) {
  425. this.reset();
  426. this.action();
  427. this.dsptMgntNo = dsptMgntNo;
  428. mobPopObj.show(this.popId);
  429. },
  430. action: function() {
  431. var _this = this;
  432. $('button[id="ITP_BTN_MLOANMNG02010_POP_DPST_RJCT"]').off('click').on('click', function() {
  433. _this.save();
  434. });
  435. },
  436. save: function() {
  437. var _this = this;
  438. var reason = $('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT #ITP_POP_FORM_MLOANMNG02010_DPST_RJCT_REASON').val();
  439. if(reason.length < 1) {
  440. alert('반려 사유를 입력해 주세요.');
  441. return;
  442. }
  443. if(confirm(ITP_MSG_LOCALE.message.form.procData)) {
  444. var saveFn = function() {
  445. _this.cancel();
  446. mobContentObj.list.search();
  447. };
  448. var param = {'dsptMgntNoList': [_this.dsptMgntNo], 'dsptRjctRsn': reason};
  449. fn_ajax_call(API_MOBILE_REJECT, JSON.stringify(param), saveFn, 'POST');
  450. }
  451. },
  452. reset: function() {
  453. itp_fn_form_clear_validate(null, '#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT');
  454. $('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT #ITP_POP_FORM_MLOANMNG02010_DPST_RJCT_REASON').val('');
  455. },
  456. cancel: function() {
  457. mobPopObj.hide(this.popId);
  458. }
  459. },
  460. show: function(popId) {
  461. $('button[id$="_CLOSE"]').off('click').on('click', function() {
  462. console.log($(this).attr('id'));
  463. if($(this).hasClass('btn-pop-close')) {
  464. mobPopObj.hide(popId);
  465. }
  466. });
  467. $('#' + popId).show();
  468. },
  469. hide: function(popId) {
  470. $('#' + popId).closest('.mobile-pop-close').hide();
  471. }
  472. };
  473. var paymentObj = {
  474. };