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