ITP_MPOMNG01010.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. require(['config'], function() {
  2. require([
  3. ], function($) {
  4. mobPageObj.init();
  5. });
  6. });
  7. /*API URL*/
  8. const API_MOBILE_INIT_INFO = '/api/pomng/init-pchReq';
  9. const API_MOBILE_SAVE = '/api/pomng/save-pchReq';
  10. const API_POP_SEARCH_LIST = '/api/whs/mng/pop-whs-search';
  11. const API_POP_ITEM_LIST = '/api/item/pop-grid-list';
  12. const ID_ITP_POP_MPOMNG01010_REQ_AREA = "ITP_POP_MPOMNG01010_REQ_AREA";
  13. const ID_ITP_POP_MPOMNG01010_WHS_AREA = "ITP_POP_MPOMNG01010_WHS_AREA";
  14. const ID_ITP_POP_MPOMNG01010_ITEM_AREA = "ITP_POP_MPOMNG01010_ITEM_AREA";
  15. const PCH_REQ_ST_CD_TEMP_SAVE ="PR00";
  16. const PCH_REQ_ST_CD_REQUEST_SAVE ="PR20";
  17. let mobPageObj = {
  18. isPrevPage: false,
  19. pageParam: null,
  20. init: function () {
  21. this.ui.init();
  22. this.event.init();
  23. this.ready();
  24. },
  25. ui: {
  26. init: function () {
  27. this.info();
  28. },
  29. info: function() {
  30. $('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
  31. $('input:hidden[id$="_STORE_ID"]').val(fn_make_user_info.get('storeId'));
  32. $('#ITP_FORM_MPOMNG01010_DETAIL_DLV_REQ_DT').val(itp_fn_date_add('M', 0));
  33. if(fn_make_user_info.get('authTpCd') === '50') {
  34. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_NM').attr('readonly', true);
  35. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM').attr('disabled', true);
  36. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_BTN_MPOMNG01010_DETAIL_DELETE_WHS_NM').attr('disabled', true);
  37. }
  38. }
  39. },
  40. event: {
  41. init: function() {
  42. this.button();
  43. },
  44. button: function() {
  45. $('button[id^="ITP_BTN_MPOMNG01010_DETAIL"]').on('click', function() {
  46. if($(this).is('[data-call-popup]')) {
  47. mobPopObj.show($(this).data('call-popup'), $(this).attr('id'));
  48. } else {
  49. var id = $(this).attr('id');
  50. switch (id) {
  51. case 'ITP_BTN_MPOMNG01010_DETAIL_DELROW' : mobContObj.list.delRow(); break;
  52. case 'ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM' : mobPopObj.popWhsNm.init(); break;
  53. case 'ITP_BTN_MPOMNG01010_DETAIL_DELETE_WHS_NM' : mobPopObj.popWhsNm.delete(); break;
  54. case 'ITP_BTN_MPOMNG01010_DETAIL_CANCEL' : mobContObj.cancel(); break;
  55. }
  56. }
  57. return false;
  58. });
  59. }
  60. },
  61. ready: function() {
  62. mobContObj.init();
  63. }
  64. };
  65. let mobContObj = {
  66. init: function() {
  67. this.button();
  68. this.data.load();
  69. },
  70. button: function() {
  71. var _this = this;
  72. $(document).on('click', '.DETAIL_ITEM_PLUS', function() {
  73. _this.list.actPlus($(this));
  74. });
  75. $(document).on('click', '.DETAIL_ITEM_MINUS', function() {
  76. _this.list.actMinus($(this));
  77. });
  78. },
  79. data: {
  80. initPchReq: null,
  81. load: function() {
  82. var _this = this;
  83. var callbackFn = function(result) {
  84. console.log(result);
  85. _this.initPchReq = result;
  86. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_BRAND_ID').val(result.brandId);
  87. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_STORE_ID').val(result.storeId);
  88. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_LOAN_DVSN').val(result.loanDvsn);
  89. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_LOAN_MGNT_UNQ_NO').val(result.loanMgntUnqNo);
  90. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PCH_REQ_DVSN').val(result.pchReqDvsn);
  91. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PG_AFFL_ID').val(result.pgAfflId);
  92. $('#ITP_FORM_MPOMNG01010_DETAIL .fnOrdUseAmt').text(CommonObj.currency.add(result.ordUseAmt));
  93. if(result.whsId !== '' && result.location !== '') {
  94. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_ID').val(result.whsId);
  95. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_NM').val(result.whsNm);
  96. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_LOCATION').val(result.location);
  97. }
  98. };
  99. const param = {brandId:fn_make_user_info.get('brandId'), storeId:fn_make_user_info.get('storeId')};
  100. fn_ajax_call(API_MOBILE_INIT_INFO, param, callbackFn, 'GET');
  101. }
  102. },
  103. list: {
  104. rows: [],
  105. addRow: function() {
  106. },
  107. delRow: function() {
  108. this.detachRow();
  109. },
  110. attachRow: function (item) {
  111. console.log(item);
  112. var fnIsExist = function(rows) {
  113. var isExist = false;
  114. $.each(rows, function(i, row) {
  115. if(row.brandUnitUnqNo === item.brandUnitUnqNo) {
  116. isExist = true;
  117. return false;
  118. }
  119. });
  120. return isExist;
  121. };
  122. if(!fnIsExist(this.rows)) {
  123. this.rows.push(item);
  124. $('#ITP_LIST_MPOMNG01010_ITEM_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_DETAIL_ROWCOPY').html());
  125. var $li = $('#ITP_LIST_MPOMNG01010_ITEM_AREA .panel-group > .row_2:last');
  126. $li.find('.fnBrandUnitUnqNo').val(item.brandUnitUnqNo);
  127. $li.find('.fnItemNm').text(item.itemNm);
  128. $li.find('.fnPchReqQty').text(item.pchReqQty);
  129. $li.find('.fnUnitAmt').text(CommonObj.currency.add(item.unitAmt));
  130. this.pchReqAmtTot();
  131. }
  132. },
  133. detachRow: function () {
  134. if($('#ITP_LIST_MPOMNG01010_ITEM_AREA input:checkbox[name=brandUnitUnqNo]:checked').length > 0) {
  135. var _this = this;
  136. $('#ITP_LIST_MPOMNG01010_DETAIL_ROWS li').each(function(index, elem) {
  137. var isChecked = $(this).find('input[type="checkbox"]').is(':checked');
  138. if(isChecked) {
  139. $(this).remove();_this.rows.splice(index, 1);
  140. }
  141. });
  142. this.pchReqAmtTot();
  143. }
  144. },
  145. actPlus: function(elem) {
  146. var $div = $(elem).siblings('div');
  147. var num = Number($div.text());
  148. $($div).text((num + 1).toString());
  149. this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
  150. this.pchReqAmtTot();
  151. },
  152. actMinus: function(elem) {
  153. var $div = $(elem).siblings('div');
  154. var num = Number($div.text());
  155. if(num <= 1) {
  156. alert('주문수량을 확인하세요.');
  157. } else {
  158. $($div).text((num - 1).toString());
  159. this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
  160. this.pchReqAmtTot();
  161. }
  162. },
  163. pchReqAmtTot: function() {
  164. var reqAmt = 0;
  165. $.each(this.rows, function(index, item) {
  166. var qty = item.pchReqQty;
  167. var amt = item.unitAmt;
  168. reqAmt += Number(qty) * amt;
  169. });
  170. $('#ITP_AJAX_MPOMNG01010_VIEW_CONTAINER').find('.fnPchReqAmtTot').text(CommonObj.currency.add(reqAmt));
  171. }
  172. },
  173. cancel: function () {
  174. $(location).attr('href', MOBILE_CONTEXTPATH + '/app/main.html');
  175. }
  176. };
  177. let mobPopObj = {
  178. init: function(popId, parentId) {
  179. switch (popId) {
  180. case 'ITP_POP_MPOMNG01010_REQ_AREA' : this.popReqConfirm.init(parentId); break;
  181. case 'ITP_POP_MPOMNG01010_WHS_AREA' : this.popWhsNm.init(); break;
  182. case 'ITP_POP_MPOMNG01010_ITEM_AREA' : this.popItem.init(); break;
  183. }
  184. },
  185. popItem: {
  186. // rows: null,
  187. init: function() {
  188. this.search();
  189. },
  190. search: function() {
  191. $('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group').empty();
  192. var callbackFn = function(result) {
  193. console.log(result);
  194. mobPopObj.popItem.rows = result.gridRows;
  195. $.each(mobPopObj.popItem.rows, function (i, item) {
  196. $('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWCOPY').html());
  197. var $li = $('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group > .row_2:last');
  198. $li.find('#ITP_FORM_MPOMNG01010_POP_ITEM_CHECKBOX').val(item.itemId);
  199. $li.find('.fnItemNm').text(item.itemNm);
  200. $li.find('.fnUnitAmt').text(CommonObj.currency.add(item.unitAmt));
  201. });
  202. mobPopObj.popItem.addRow.init();
  203. };
  204. let param = $('#ITP_FORM_MPOMNG01010_POPUP_ITEM').serializeObject();
  205. fn_ajax_call(API_POP_ITEM_LIST, JSON.stringify(param), callbackFn, 'POST');
  206. },
  207. addRow: {
  208. init: function() {
  209. this.button.init();
  210. },
  211. button: {
  212. init: function() {
  213. var _this = this;
  214. $('button[id^="ITP_BTN_MPOMNG01010_POP_ITEM_"]').off('click').on('click', function() {
  215. var id = $(this).attr('id');
  216. switch (id) {
  217. case 'ITP_BTN_MPOMNG01010_POP_ITEM_PLUS' : _this.actPlus($(this)); break;
  218. case 'ITP_BTN_MPOMNG01010_POP_ITEM_MINUS' : _this.actMinus($(this)); break;
  219. case 'ITP_BTN_MPOMNG01010_POP_ITEM_ADD' : _this.actItemAdd($(this)); break;
  220. case 'ITP_BTN_MPOMNG01010_POP_ITEM_SEARCH' : mobPopObj.popItem.search(); break;
  221. case 'ITP_BTN_MPOMNG01010_POP_ITEM_CLOSE' : mobPopObj.hide(id); break;
  222. }
  223. return false;
  224. });
  225. },
  226. actPlus: function(elem) {
  227. var $div = $(elem).siblings('div');
  228. var num = Number($div.text());
  229. $($div).text((num + 1).toString());
  230. },
  231. actMinus: function(elem) {
  232. var $div = $(elem).siblings('div');
  233. var num = Number($div.text());
  234. if(num <= 1) {
  235. alert('주문수량을 확인하세요.');
  236. } else {
  237. $($div).text((num - 1).toString());
  238. }
  239. },
  240. actItemAdd: function(elem) {
  241. var index = $(elem).closest('li').index();
  242. var item = mobPopObj.popItem.rows[index];
  243. item['pchReqQty'] = $(elem).closest('li').find('.fnPchReqQty').html();
  244. mobContObj.list.attachRow(item);
  245. }
  246. }
  247. },
  248. delRow: function() {
  249. }
  250. },
  251. popWhsNm: {
  252. init: function () {
  253. this.rows.length = 0;
  254. this.search();
  255. this.action();
  256. },
  257. rows: [],
  258. search: function () {
  259. var _this = this;
  260. $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .panel-group').empty();
  261. var callbackFn = function(result) {
  262. console.log(result);
  263. _this.view(result.gridRows);
  264. };
  265. const param = $('#ITP_FORM_MPOMNG01010_POP_WHS').serializeObject();
  266. fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
  267. },
  268. view: function(gridRows) {
  269. this.rows = gridRows;
  270. $.each(gridRows, function (i, item) {
  271. $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_POP_WHS_ROWCOPY').html());
  272. var $li = $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .panel-group > .row_2:last');
  273. $li.find('.fnWhsNm').text(item.whsNm);
  274. $li.find('.fnLocationNm').text(item.locationNm);
  275. $li.find('.fnWhsId').data('whs-id', item.whsId);
  276. });
  277. },
  278. action: function() {
  279. var _this = this;
  280. $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA button[id$="POP_WHS_CHOICE"]').off('click').on('click', function() {
  281. var whsId = $(this).data('whs-id');
  282. $.each(_this.rows, function (i, item) {
  283. if(whsId === item.whsId) {
  284. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_ID').val(item.whsId);
  285. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_NM').val(item.whsNm);
  286. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_LOCATION').val(item.location);
  287. mobPopObj.hide(ID_ITP_POP_MPOMNG01010_WHS_AREA);
  288. itp_fn_form_clear_validate(null, '#ITP_FORM_MPOMNG01010_DETAIL');
  289. return false;
  290. }
  291. });
  292. });
  293. $('#ITP_FORM_MPOMNG01010_POP_WHS button[id="ITP_BTN_MPOMNG01010_POP_WHS_SEARCH"]').off('click').on('click', function() {
  294. _this.search();
  295. });
  296. },
  297. delete: function() {
  298. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_ID').val('');
  299. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_NM').val('');
  300. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_LOCATION').val('');
  301. }
  302. },
  303. popReqConfirm: {
  304. saveMode: 1, // 1 : 임시저장, 2 : 구매요청, 요청금액이 가능금액보다 클 경우 (3 : PG 정보 없음, 4 : 선불매장, 5 : 후불매장)
  305. init: function (parentId) {
  306. this.formId = '#ITP_FORM_MPOMNG01010_DETAIL';
  307. this.pchReqStCd = (parentId === 'ITP_BTN_MPOMNG01010_DETAIL_REQ_ORDER') ? PCH_REQ_ST_CD_REQUEST_SAVE : PCH_REQ_ST_CD_TEMP_SAVE;
  308. this.view();
  309. this.action();
  310. },
  311. view: function() {
  312. var popMsg = '';
  313. var loanDvsn = $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_LOAN_DVSN').val();
  314. var ordUseAmt = CommonObj.onlyNumber($('#ITP_FORM_MPOMNG01010_DETAIL .fnOrdUseAmt').text());
  315. var pchReqAmtTot = CommonObj.onlyNumber($('#ITP_FORM_MPOMNG01010_DETAIL .fnPchReqAmtTot').text());
  316. if(this.pchReqStCd === PCH_REQ_ST_CD_REQUEST_SAVE) { // 구매요청
  317. if(loanDvsn === 'LD03') { // 무정산
  318. this.saveMode = 2;
  319. popMsg = '구매요청 하시겠습니까?';
  320. $('#ITP_POP_MPOMNG01010_REQ_AREA #ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM').text('확인');
  321. } else {
  322. if (ordUseAmt < pchReqAmtTot) { // 요청금액이 가능금액보다 클 경우
  323. if($('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PG_AFFL_ID').val() === '') { // PG 정보 없음
  324. this.saveMode = 3;
  325. popMsg = '무통장 입금 후 구매요청해 주세요.<br>' +
  326. '임시저장 하시겠습니까?';
  327. $('#ITP_POP_MPOMNG01010_REQ_AREA #ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM').text('확인');
  328. } else {
  329. if(loanDvsn === 'LD01') { // 선불매장
  330. this.saveMode = 4;
  331. popMsg = '선불매장이므로 결재를 하셔야 구매요청이 진행이 됩니다.<br>' +
  332. '결재를 하시겠습니까?';
  333. $('#ITP_POP_MPOMNG01010_REQ_AREA #ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM').text('결제');
  334. } else if(loanDvsn === 'LD02') { // 후불매장
  335. this.saveMode = 5;
  336. popMsg = '구매한도가 부족합니다.<br>' +
  337. '선결재를 하신 후에 구매요청을 하시기 바랍니다.<br>' +
  338. '결재를 하시겠습니까?';
  339. $('#ITP_POP_MPOMNG01010_REQ_AREA #ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM').text('결제');
  340. }
  341. }
  342. } else {
  343. this.saveMode = 2;
  344. popMsg = '구매요청 하시겠습니까?';
  345. $('#ITP_POP_MPOMNG01010_REQ_AREA #ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM').text('확인');
  346. }
  347. }
  348. } else { // 임시저장
  349. this.saveMode = 1;
  350. popMsg = '임시저장 하시겠습니까?';
  351. $('#ITP_POP_MPOMNG01010_REQ_AREA #ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM').text('확인');
  352. }
  353. $('#ITP_POP_MPOMNG01010_REQ_AREA .fnPopDlvReqDt').text($('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_DLV_REQ_DT').val());
  354. $('#ITP_POP_MPOMNG01010_REQ_AREA .fnItemQty').text(CommonObj.currency.add(mobContObj.list.rows.length, '개'));
  355. $('#ITP_POP_MPOMNG01010_REQ_AREA .fnOrdAmt').text(CommonObj.currency.add(pchReqAmtTot));
  356. $('#ITP_POP_MPOMNG01010_REQ_AREA .pop_msg').html(popMsg);
  357. },
  358. action: function() {
  359. var _this = this;
  360. $('#ITP_POP_MPOMNG01010_REQ_AREA button[id="ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM"]').off('click').on('click', function() {
  361. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PCH_REQ_ST_CD').val(_this.pchReqStCd);
  362. _this.save();
  363. });
  364. },
  365. save: function() {
  366. var procSave = function (rtnFn) {
  367. let param = $('#ITP_FORM_MPOMNG01010_DETAIL').serializeObject();
  368. $.each(mobContObj.list.rows, function(index, item) {
  369. item['viewCd'] = 'C';
  370. });
  371. param.gridInsertData = mobContObj.list.rows;
  372. param['dlvReqDt'] = param.dlvReqDt.replace(/[^0-9]/g, "");
  373. var saveFn = function (result) {
  374. console.log(result);
  375. mobPopObj.hide('ITP_POP_MPOMNG01010_REQ_AREA');
  376. if(typeof rtnFn === 'function') rtnFn();
  377. };
  378. fn_ajax_call(API_MOBILE_SAVE, JSON.stringify(param), saveFn, 'POST');
  379. };
  380. if (this.saveMode === 1 || this.saveMode === 2 || this.saveMode === 3) {
  381. if(this.saveMode === 3)
  382. $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PCH_REQ_ST_CD').val(PCH_REQ_ST_CD_TEMP_SAVE);
  383. procSave();
  384. } else if (this.saveMode === 4 || this.saveMode === 5) {
  385. // 결제 팝업 결과
  386. var popFn = function(rowDataPop) {
  387. console.log(JSON.stringify(rowDataPop));
  388. procSave(function(result) { mobContObj.data.load(); });
  389. };
  390. // 결제 팝업
  391. var ordUseAmt = CommonObj.onlyNumber($('#ITP_FORM_MPOMNG01010_DETAIL .fnOrdUseAmt').text());
  392. var pchReqAmtTot = CommonObj.onlyNumber($('#ITP_FORM_MPOMNG01010_DETAIL .fnPchReqAmtTot').text());
  393. var args = {
  394. 'payTpCd' : '40',
  395. 'brandId' : $('#ITP_FORM_MPOMNG01010_DETAIL_BRAND_ID').val(),
  396. 'storeId' : $('#ITP_FORM_MPOMNG01010_DETAIL_STORE_ID').val(),
  397. 'goodsAmt' : Number(pchReqAmtTot - ordUseAmt)
  398. };
  399. fn_call_popup('biz', 'BIZPOP_PO_PAYMENT', '#ITP_ASIDE', popFn, args, 'M');
  400. // var procPay = function() {
  401. // var payFn = function(result) {
  402. // console.log(result);
  403. // mobContObj.data.load();
  404. // };
  405. // var args = {
  406. // 'payTpCd': this.saveMode === 4 ? '10' : '30',
  407. // 'brandId': $('#ITP_FORM_MPOMNG01010_DETAIL_BRAND_ID').val(),
  408. // 'storeId': $('#ITP_FORM_MPOMNG01010_DETAIL_STORE_ID').val()
  409. // };
  410. // itp_fn_payment.call(args, payFn);
  411. // };
  412. // if(this.saveMode === 5) {
  413. // $('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PCH_REQ_ST_CD').val(PCH_REQ_ST_CD_TEMP_SAVE);
  414. // procSave(procPay);
  415. // } else {
  416. // mobPopObj.hide('ITP_POP_MPOMNG01010_REQ_AREA');
  417. // }
  418. }
  419. }
  420. },
  421. show: function(popId, parentId) {
  422. var _this = this;
  423. $('button[id$="CLOSE"]').off('click').on('click', function() {
  424. var id = $(this).attr('id');
  425. if($(this).hasClass('btn-pop-close')) {
  426. _this.hide(id);
  427. }
  428. });
  429. if(parentId === 'ITP_BTN_MPOMNG01010_DETAIL_REQ_ORDER' || parentId === 'ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE') {
  430. var formId = '#ITP_FORM_MPOMNG01010_DETAIL';
  431. itp_fn_form_clear_validate(null, formId);
  432. if (itp_fn_form_event.isValid(formId)) {
  433. if($('#ITP_LIST_MPOMNG01010_DETAIL_ROWS > li').size() < 1) {
  434. alert('품목추가 버튼을 이용하여 품목을 추가해 주세요.');
  435. return false;
  436. } else {
  437. $('#' + popId).show();
  438. mobPopObj.init(popId, parentId);
  439. }
  440. }
  441. } else {
  442. $('#' + popId).show();
  443. mobPopObj.init(popId, parentId);
  444. }
  445. },
  446. hide: function(id) {
  447. $('#' + id).closest('.mobile-pop-close').hide();
  448. }
  449. };