ITP_INOUTMNG02010.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. require(['config'], function() {
  2. require([
  3. ], function($) {
  4. pageObj.init();
  5. });
  6. });
  7. //화면변수
  8. const INOUTMNG02010_GRID_ID = '#ITP_INOUTMNG02010_jqGrid';
  9. const INOUTMNG02010_GRID_LIST = '#ITP_INOUTMNG02010_jqGrid_list';
  10. const INOUTMNG02010_GRID_PAGER = '#ITP_INOUTMNG02010_jqGridPager';
  11. const INOUTMNG02010_GRID_EMPTY = '#ITP_INOUTMNG02010_jqGridEmpty';
  12. let ITP_PODR_DTL_ST_CD = fn_make_common_cd_list(CODE_LIST, 'SHMT_REQ_ST_CD', true, '출하요청상태코드');
  13. //API URL
  14. let API_POMNG_INOUTMNG_OUTSEARCH_GRID_LIST = '/api/pomng/inoutmng/outsearch-grid-list';
  15. let API_POMNG_INOUTMNG_INFO_INV = '/api/pomng/inoutmng/info-inv';
  16. //화면 grid ColModel
  17. const gridColModel = {
  18. list:[
  19. {
  20. index: 'VIEW_CD', name: 'viewCd',
  21. label: ITP_MSG_LOCALE.label.viewCd,
  22. width: '10', fixed: false, align: 'center',
  23. sortable: false, hidden: true
  24. },
  25. {
  26. index: 'SHMT_REQ_UNQ_NO', name: 'shmtReqUnqNo',
  27. label: ITP_MSG_LOCALE.label.shmtReqUnqNo, // 출하지시번호
  28. minwidth: 170,
  29. width: '9', fixed: false, align: 'center',
  30. sortable: false, hidden: false
  31. },
  32. {
  33. index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
  34. label: ITP_MSG_LOCALE.label.pchPodrUnqNo, // 발주번호
  35. minwidth: 170,
  36. width: '9', fixed: false, align: 'center',
  37. sortable: false, hidden: false
  38. },
  39. {
  40. index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
  41. label: '항번', // 발주항번
  42. width: '6', fixed: false, align: 'center',
  43. sortable: false, hidden: false
  44. },
  45. {
  46. index: 'SHMT_REQ_ST_CD', name: 'shmtReqStCd',
  47. label: ITP_MSG_LOCALE.label.shmtReqStCd, // 출하상태코드
  48. minwidth: 100,
  49. width: '7', fixed: false, align: 'center',
  50. sortable: false, hidden: false, formatter: 'select', edittype: 'select',
  51. editoptions: {value: ITP_PODR_DTL_ST_CD}
  52. },
  53. {
  54. index: 'ITEM_ID', name: 'itemId',
  55. label: ITP_MSG_LOCALE.label.itemId, // 품목번호
  56. minwidth: 170,
  57. width: '10', fixed: false, align: 'center',
  58. sortable: false, hidden: false
  59. },
  60. {
  61. index: 'ITEM_NM', name: 'itemNm',
  62. label: ITP_MSG_LOCALE.label.itemNm, // 품목명
  63. width: '10', fixed: false, align: 'left',
  64. minwidth: 200,
  65. sortable: false, hidden: false, classes: 'ui-ellipsis'
  66. },
  67. {
  68. index: 'WHS_NM', name: 'whsNm',
  69. label: ITP_MSG_LOCALE.label.whsNm, // 납품장소
  70. width: '10', fixed: false, align: 'left',
  71. minwidth: 200,
  72. sortable: false, hidden: false, classes: 'ui-ellipsis'
  73. },
  74. {
  75. index: 'SHMT_QTY', name: 'shmtQty',
  76. label: ITP_MSG_LOCALE.label.shmtQty, // 출하수량
  77. width: '13', fixed: false, align: 'right',
  78. sortable: false, hidden: false,
  79. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  80. },
  81. {
  82. index: 'SHMT_AMT', name: 'shmtAmt',
  83. label: ITP_MSG_LOCALE.label.shmtAmt, // 출하금액
  84. width: '13', fixed: false, align: 'right',
  85. minwidth: 80,
  86. sortable: false, hidden: false,
  87. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  88. },
  89. {
  90. index: 'WHS_QTY', name: 'whsQty',
  91. label: ITP_MSG_LOCALE.label.whsQty, // 입고수량
  92. width: '13', fixed: false, align: 'right',
  93. sortable: false, hidden: false,
  94. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  95. },
  96. {
  97. index: 'WHS_AMT', name: 'whsAmt',
  98. label: ITP_MSG_LOCALE.label.whsAmt, // 입고금액
  99. width: '13', fixed: false, align: 'right',
  100. sortable: false, hidden: false,
  101. formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
  102. },
  103. {
  104. index: 'WHS_CNFM_NM', name: 'whsCnfmNm',
  105. label: ITP_MSG_LOCALE.label.whsCnfmNm, // 입고확인자
  106. width: '13', fixed: false, align: 'center',
  107. minwidth: 100,
  108. sortable: false, hidden: false
  109. },
  110. {
  111. index: 'WHS_DT', name: 'whsDt',
  112. label: ITP_MSG_LOCALE.label.whsDt, // 입고일
  113. width: '9', fixed: false, align: 'center',
  114. minwidth: 110,
  115. sortable: false, hidden: false
  116. },
  117. {
  118. index: 'DLV_STTMT_UNQ_NO', name: 'dlvSttmtUnqNo',
  119. label: ITP_MSG_LOCALE.label.dlvSttmtUnqNo, // 납품번호
  120. width: '10', fixed: false, align: 'center',
  121. sortable: false, hidden: true
  122. },
  123. {
  124. index: 'BRAND_NM', name: 'brandNm',
  125. label: ITP_MSG_LOCALE.label.brandNm, // 브랜드명
  126. minwidth: 200,
  127. width: '10', fixed: false, align: 'left',
  128. sortable: false, hidden: false, classes: 'ui-ellipsis'
  129. }
  130. ],
  131. view: [],
  132. detail: []
  133. }
  134. /*화면공통 Object*/
  135. let pageObj = {
  136. init: function() {
  137. this.ui.init();
  138. this.event.init();
  139. this.action();
  140. },
  141. ui: {
  142. init: function() {
  143. this.view();
  144. this.grid();
  145. this.ready();
  146. },
  147. view: function() {
  148. // 버튼 권한설정
  149. fn_proc_btn_auth('INOUTMNG02010');
  150. // 공통코드 표시
  151. $('select').each(function() {
  152. if($(this).data('select-code')) {
  153. fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
  154. }
  155. });
  156. // 조회일자 지정
  157. var now = new Date();
  158. var fromDate = new Date(now);
  159. fromDate.setDate(now.getDate() - 7);
  160. var toDate = new Date(now);
  161. $('#ITP_FORM_INOUTMNG02010_SEARCH_FROM_DT').val(itp_fn_get_before_month() );
  162. $('#ITP_FORM_INOUTMNG02010_SEARCH_TO_DT').val(itp_fn_get_today_ko() );
  163. $('#ITP_TAB_INOUTMNG02010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
  164. $('#ITP_FORM_INOUTMNG02010_SEARCH_FROM_DT').datepicker();
  165. $('#ITP_FORM_INOUTMNG02010_SEARCH_TO_DT').datepicker();
  166. },
  167. grid: function() {
  168. itp_fn_jqgrid_resize(INOUTMNG02010_GRID_ID, INOUTMNG02010_GRID_LIST, 'lg');
  169. //listObj.empty.init();
  170. },
  171. ready: function() {
  172. listObj.init();
  173. }
  174. },
  175. event: {
  176. init: function() {
  177. this.button();
  178. },
  179. button: function() {
  180. // 버튼 클릭 이벤트
  181. $('button').each(function() {
  182. var id = $(this).attr('id');
  183. $(this).on('click', function() {
  184. switch (id) {
  185. case 'ITP_BTN_INOUTMNG02010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
  186. case 'ITP_BTN_INOUTMNG02010_NEWREG' : listObj.button.create(); break; // 신규등록 버튼
  187. case 'ITP_BTN_INOUTMNG02010_MODIFY' : modifyObj.button.modify(); break; // 수정 버튼
  188. case 'ITP_BTN_INOUTMNG02010_CANCELLIST' : modifyObj.button.cancel(); break; // 취소/목록 버튼
  189. case 'ITP_BTN_INOUTMNG02010_DELETE' : modifyObj.button.del(); break; // 발주 취소 버튼(예정)
  190. case 'ITP_BTN_INOUTMNG02010_EXCEL' : listObj.excelDown(); break; // 엑셀다운로드
  191. }
  192. });
  193. });
  194. }
  195. },
  196. switchScreen: function(mode) {
  197. $('.itp_det_head').find('button[id^="ITP_BTN_INOUTMNG02010_"]').each(function(i) {
  198. $(this).hide();
  199. });
  200. $('#ITP_TAB_INOUTMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
  201. $(this).hide();
  202. });
  203. if(mode == 'LIST') { // 목록
  204. itp_fn_fire_window_resize();
  205. fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG02010_SRH', '#ITP_BTN_INOUTMNG02010_NEWREG']);
  206. $('#ITP_AJAX_INOUTMNG02010_LIST_CONTAINER').show();
  207. $('#ITP_FORM_INOUTMNG02010_SEARCH #ITP_FORM_INOUTMNG02010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
  208. $('#ITP_BTN_INOUTMNG02010_PRINT').show();
  209. $('#ITP_BTN_INOUTMNG02010_SRH').show();
  210. $('#ITP_BTN_INOUTMNG02010_SEARCH_SHMT_WHS_ID').show();
  211. $('#ITP_BTN_INOUTMNG02010_DELETE_SHMT_WHS_NM').show();
  212. $('#ITP_BTN_INOUTMNG02010_SEARCH_WHS_ID').show();
  213. $('#ITP_BTN_INOUTMNG02010_DELETE_WHS_ID').show();
  214. $('#ITP_BTN_INOUTMNG02010_EXCEL').show();
  215. } /*else if(mode == 'ADD') { // 등록
  216. $('#ITP_AJAX_INOUTMNG02010_DETAIL_CONTAINER').show();
  217. fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG02010_CANCELLIST', '#ITP_BTN_INOUTMNG02010_SAVE']);
  218. $('#ITP_FORM_INOUTMNG02010_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
  219. $(this).attr('id') === 'ITP_FORM_INOUTMNG02010_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
  220. if(elem.type === 'select') {
  221. $(this).val('').prop('selected', true);
  222. }
  223. });
  224. $('#ITP_FORM_INOUTMNG02010_DETAIL #ITP_FORM_INOUTMNG02010_DETAIL_FILE_NO').val('');
  225. $('#ITP_FORM_INOUTMNG02010_DETAIL_BRAND_ID').removeAttr('readonly');
  226. $('#ITP_FORM_INOUTMNG02010_DETAIL_BRAND_NM').removeAttr('readonly');
  227. $('#ITP_FORM_INOUTMNG02010_DETAIL_BSNS_REG_NO').removeAttr('readonly');
  228. $('#ITP_FORM_INOUTMNG02010_DETAIL_CORP_REG_NO').removeAttr('readonly');
  229. // $('#ITP_FORM_INOUTMNG02010_DETAIL_SEARCH_AFFL_SHOP').removeAttr('disabled');
  230. // $('#ITP_FORM_INOUTMNG02010_DETAIL_DELETE_AFFL_SHOP').removeAttr('disabled');
  231. $('#ITP_FORM_INOUTMNG02010_DETAIL_SEARCH_AFFL_SHOP').show();
  232. $('#ITP_FORM_INOUTMNG02010_DETAIL_DELETE_AFFL_SHOP').show();
  233. $('#ITP_FORM_INOUTMNG02010_DETAIL .itp_form_info').hide();
  234. $('#ITP_FORM_INOUTMNG02010_DETAIL .itp_form_change').show();
  235. $('#ITP_FORM_INOUTMNG02010_DETAIL #ITP_FORM_INOUTMNG02010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
  236. $('#ITP_FORM_INOUTMNG02010_DETAIL #ITP_FORM_INOUTMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
  237. $('.fnBrandId').text('(자동부여)');
  238. } else if(mode == 'MODIFY') { // 수정
  239. $('#ITP_AJAX_INOUTMNG02010_DETAIL_CONTAINER').show();
  240. fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG02010_CANCELLIST', '#ITP_BTN_INOUTMNG02010_SAVE']);
  241. $('#ITP_BTN_INOUTMNG02010_CANCELLIST').show();
  242. $('#ITP_BTN_INOUTMNG02010_DELETE').show();
  243. $('#ITP_FORM_INOUTMNG02010_DETAIL_BRAND_ID').attr('readonly', true);
  244. $('#ITP_FORM_INOUTMNG02010_DETAIL_BRAND_NM').attr('readonly', true);
  245. $('#ITP_FORM_INOUTMNG02010_DETAIL_BSNS_REG_NO').attr('readonly', true);
  246. $('#ITP_FORM_INOUTMNG02010_DETAIL_CORP_REG_NO').attr('readonly', true);
  247. // $('#ITP_FORM_INOUTMNG02010_DETAIL_SEARCH_AFFL_SHOP').attr('disabled', true);
  248. // $('#ITP_FORM_INOUTMNG02010_DETAIL_DELETE_AFFL_SHOP').attr('disabled', true);
  249. $('#ITP_FORM_INOUTMNG02010_DETAIL_SEARCH_AFFL_SHOP').hide();
  250. $('#ITP_FORM_INOUTMNG02010_DETAIL_DELETE_AFFL_SHOP').hide();
  251. $('#ITP_FORM_INOUTMNG02010_DETAIL .itp_form_info').show();
  252. $('#ITP_FORM_INOUTMNG02010_DETAIL .itp_form_change').hide();
  253. $('#ITP_FORM_INOUTMNG02010_DETAIL #ITP_FORM_INOUTMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
  254. } else if(mode == 'VIEW') { // 보기
  255. $('#ITP_AJAX_INOUTMNG02010_VIEW_CONTAINER').show();
  256. fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG02010_MODIFY', '#ITP_BTN_INOUTMNG02010_CANCELLIST']);
  257. }*/
  258. },
  259. action: function() {
  260. var _this = this;
  261. // 출하창고 조회 버튼 클릭
  262. $('#ITP_BTN_INOUTMNG02010_PRINT').on('click', function() {
  263. _this.popup();
  264. });
  265. },
  266. popup: function() {
  267. var selectedIds = $(INOUTMNG02010_GRID_ID).getGridParam('selarrrow');
  268. if(selectedIds.length > 1) { // 1이상 선택시
  269. alert("납품서 하나만 선택해주세요 (대표 납품서번호)") ;//출력
  270. return; //리턴
  271. }
  272. var selRowData ; //변수선언
  273. for (var i=selectedIds.length-1; i>=0; i--) { //1개만 선택시
  274. selRowData = $(INOUTMNG02010_GRID_ID).jqGrid('getRowData', selectedIds[i]); //cell 선택
  275. }
  276. const key = {brandId: fn_make_user_info.get('brandId'), dlvSttmtUnqNo: selRowData.dlvSttmtUnqNo}; // popup key 값 설정
  277. fn_call_popup('biz', 'BIZPOP_DLV_STTMT_PRN', '#ITP_ASIDE', null, key, 'S');
  278. }
  279. };
  280. /*목록화면 Object*/
  281. let listObj = {
  282. init: function() {
  283. this.grid.init();
  284. this.action();
  285. },
  286. itp_INOUTMNG02010_param: {},
  287. itp_INOUTMNG02010_search: false,
  288. button: {
  289. search: function() {
  290. listObj.itp_INOUTMNG02010_search = true;
  291. let param = $('#ITP_FORM_INOUTMNG02010_SEARCH').serializeObject();
  292. param.gridSize = $.jgrid.defaults.rowNum;
  293. param.gridPage = $.jgrid.defaults.page;
  294. param.sidx = '';
  295. $(INOUTMNG02010_GRID_ID).data('grid-param',param);
  296. $(INOUTMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
  297. }
  298. },
  299. empty: {
  300. init: function() {
  301. /*
  302. var _this = this;
  303. this.push();
  304. $(INOUTMNG02010_GRID_EMPTY).on('click', function() {
  305. _this.back();
  306. listObj.itp_INOUTMNG02010_param.gridSize = $.jgrid.defaults.rowNum;
  307. $(INOUTMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(listObj.itp_INOUTMNG02010_param)}).trigger('reloadGrid');
  308. });
  309. */
  310. },
  311. push: function() {
  312. /*
  313. let param = $('#ITP_FORM_INOUTMNG02010_SEARCH').serializeObject();
  314. listObj.itp_INOUTMNG02010_param = param;
  315. param.sidx = '';
  316. */
  317. },
  318. back: function() {
  319. /*
  320. $('#ITP_FORM_INOUTMNG02010_SERVICE_BRAND_TYPE').val(listObj.itp_INOUTMNG02010_param.brandType);
  321. $('#ITP_FORM_INOUTMNG02010_SERVICE_ST_CD').val(listObj.itp_INOUTMNG02010_param.stCd);
  322. $('#ITP_FORM_INOUTMNG02010_SEARCH_BRAND_NM').val(listObj.itp_INOUTMNG02010_param.brandNm);
  323. */
  324. }
  325. },
  326. grid: {
  327. init: function() {
  328. // 데이터 없을때
  329. listObj.empty.push();
  330. this.search();
  331. },
  332. colModel: gridColModel.list,
  333. search: function() {
  334. pageObj.switchScreen('LIST');
  335. this.unload();
  336. this.load();
  337. },
  338. load: function() {
  339. let param = $('#ITP_FORM_INOUTMNG02010_SEARCH').serializeObject();
  340. param.gridSize = $.jgrid.defaults.rowNum;
  341. param.sidx = '';
  342. var option = {
  343. gridId: INOUTMNG02010_GRID_ID,
  344. colModel: gridColModel.list,
  345. param: param,
  346. url: DOMAIN + API_POMNG_INOUTMNG_OUTSEARCH_GRID_LIST,
  347. pager: INOUTMNG02010_GRID_PAGER,
  348. multiselect: true,
  349. rownumbers: false,/*
  350. onCellSelect: function(rowId, cellIdx, cellValue) {
  351. var cm = $(this).jqGrid('getGridParam', 'colModel');
  352. var colNm = cm[cellIdx].name;
  353. if (colNm === 'pchPodrUnqNo') {
  354. const dlvSttmtUnqNoVal = $(this).jqGrid('getCell', rowId, 'dlvSttmtUnqNo');
  355. const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
  356. const key = {dlvSttmtUnqNo: dlvSttmtUnqNoVal, brandId: brandIdVal};
  357. var param = $.param(key);
  358. //modifyObj.init(param);
  359. }
  360. },*/
  361. loadComplete: function(data) {
  362. itp_fn_grid_load_complete(data, INOUTMNG02010_GRID_ID, true, 'number', 'INOUTMNG02010', listObj.itp_INOUTMNG02010_search, listObj.empty, true, data.gridRecords, true);
  363. $('#cb_ITP_INOUTMNG02010_jqGrid').hide();
  364. const self=this;
  365. if(self.sortUse) return;
  366. self.sortUse=true;
  367. //$(INOUTMNG02010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
  368. $(INOUTMNG02010_GRID_LIST).find('th').eq(7).css({cursor:'pointer',background:'#FFEBCD'});
  369. $(INOUTMNG02010_GRID_LIST).find('th').eq(14).css({cursor:'pointer',background:'#FFEBCD'});
  370. $(INOUTMNG02010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
  371. const idx=$(this).index();
  372. console.log("xxxx grid header click xxxxxxx index=="+idx, param );
  373. if(idx==7 || idx==14) {
  374. var field='',sort=self['sort'+idx];
  375. if(sort ) {
  376. sort=sort=='asc'?'desc':'asc';
  377. } else {
  378. // 등록일 내림차순, 제목 오름차순
  379. sort=idx==7? 'asc':idx==14? 'desc': 'asc';
  380. }
  381. const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top';
  382. self['sort'+idx]=sort;
  383. if(idx==7) {
  384. field='itemNm';
  385. } else if(idx==14) {
  386. field='whsDt';
  387. }
  388. param.page=1;
  389. param.sidx=field;
  390. param.sord=sort;
  391. $(INOUTMNG02010_GRID_ID).jqGrid('setGridParam',{
  392. postData:JSON.stringify(param)
  393. }).trigger('reloadGrid');
  394. $(this).find('.s-ico').show();
  395. $(this).find('.ui-grid-ico-sort').hide();
  396. $(this).find(icon).show();
  397. }
  398. });
  399. },
  400. onCellSelect: function(rowId, cellIdx, cellValue) {
  401. $(this).resetSelection();
  402. },
  403. onPaging: function(action) {
  404. itp_fn_grid_paging(INOUTMNG02010_GRID_ID, action, param);
  405. }
  406. };
  407. itp_fn_grid_make_remote(option);
  408. },
  409. clearData: function() {
  410. $(INOUTMNG02010_GRID_ID).jqGrid('clearGridData', true);
  411. $(INOUTMNG02010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
  412. $(INOUTMNG02010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
  413. $(INOUTMNG02010_GRID_EMPTY).show();
  414. },
  415. unload: function() {
  416. $.jgrid.gridUnload(INOUTMNG02010_GRID_ID);
  417. }
  418. },
  419. action: function() {
  420. var _this = this;
  421. // 출하창고 조회 버튼 클릭
  422. $('#ITP_BTN_INOUTMNG02010_SEARCH_SHMT_WHS_ID').on('click', function() {
  423. _this.popup('shmtWhs');
  424. });
  425. // 출하창고 텍스트 삭제 버튼 클릭
  426. $('#ITP_BTN_INOUTMNG02010_DELETE_SHMT_WHS_NM').on('click', function() {
  427. $('#ITP_FORM_INOUTMNG02010_DETAIL_SHMT_WHS_ID').val('');
  428. $('#ITP_FORM_INOUTMNG02010_DETAIL_SHMT_WHS_NM').val('');
  429. });
  430. // 매장/창고 조회 버튼 클릭
  431. $('#ITP_BTN_INOUTMNG02010_SEARCH_WHS_ID').on('click', function() {
  432. _this.popup('whs');
  433. });
  434. // 매장/창고 텍스트 삭제 버튼 클릭
  435. $('#ITP_BTN_INOUTMNG02010_DELETE_WHS_ID').on('click', function() {
  436. $('#ITP_FORM_INOUTMNG02010_DETAIL_WHS_NM').val('');
  437. $('#ITP_FORM_INOUTMNG02010_DETAIL_WHS_ID').val('');
  438. });
  439. },
  440. popup: function(keyword) {
  441. var popFn ;
  442. if(keyword == 'shmtWhs') {
  443. popFn = this.callback.shmtWhs;
  444. } else if(keyword == 'whs'){
  445. popFn = this.callback.whs;
  446. }
  447. var whsDvsn = "";
  448. if(keyword == 'shmtWhs') {
  449. whsDvsn = "W01";
  450. } else if(keyword == 'whs'){
  451. whsDvsn = "W02";
  452. }
  453. const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'),whsDvsn: whsDvsn};
  454. fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
  455. },
  456. callback: {
  457. shmtWhs: function(rowDataPop) {
  458. $('#ITP_FORM_INOUTMNG02010_DETAIL_SHMT_WHS_ID').val(rowDataPop.whsId);
  459. $('#ITP_FORM_INOUTMNG02010_DETAIL_SHMT_WHS_NM').val(rowDataPop.whsNm);
  460. },
  461. whs: function(rowDataPop) {
  462. $('#ITP_FORM_INOUTMNG02010_DETAIL_WHS_ID').val(rowDataPop.whsId);
  463. $('#ITP_FORM_INOUTMNG02010_DETAIL_WHS_NM').val(rowDataPop.whsNm);
  464. }
  465. },
  466. excelDown: function() {
  467. var param = {
  468. 'url': API_POMNG_INOUTMNG_OUTSEARCH_GRID_LIST,
  469. 'param': $('#ITP_FORM_INOUTMNG02010_SEARCH').serializeObject(),
  470. 'gridColumns': $(INOUTMNG02010_GRID_ID).jqGrid('getGridParam', 'colModel'),
  471. 'fileName': '출하지시현황.xlsx',
  472. 'sheetName': '출하지시현황리스트'
  473. };
  474. itp_fn_remote_to_excel(param);
  475. }
  476. }