Quellcode durchsuchen

구매요청현황 개선

dwkim vor 2 Jahren
Ursprung
Commit
54baf77a96

+ 1 - 1
src/main/webapp/js/app/config.js

@@ -945,7 +945,7 @@ function fn_ajax_call(href, param, fn, type) {
945 945
 			$('#ITP_OVERLAY').hide();
946 946
 		},
947 947
 		success: function(result) {
948
-			if (result.code !== undefined) { //성공시에도 메세지가 있으면 얼럿 예)저장되었습니다.
948
+			if (result.code !== undefined && result.message !="") { //성공시에도 메세지가 있으면 얼럿 예)저장되었습니다.
949 949
 				itp_fn_modal_alert_ajax(result.message);
950 950
 			}
951 951
 			if (fn !== undefined || typeof fn !== 'undefined') fn(result);

+ 4 - 1
src/main/webapp/js/app/locales/locale-ko.js

@@ -195,7 +195,10 @@ const ITP_MSG_LOCALE = (function() {
195 195
 			"whsLocationNm": "납품창고",
196 196
 			"pchReqStNm": "요청상태명",
197 197
 			"pchReqUnqNo": "구매요청번호",
198
-			"viewNm": "신규여부"
198
+			"viewNm": "신규여부",
199
+			"pchOrdAmt": "발주금액",
200
+			"pchOrdSpplyAmt": "본사납품금액",
201
+			"whsPassQty": "발주가능수량"
199 202
 		},
200 203
 		"table": {
201 204
 			"brandId": "브랜드ID",

+ 1 - 1
src/main/webapp/js/app/pomng/ITP_POMNG01010.js

@@ -85,7 +85,7 @@ const gridColModel = {
85 85
 		},
86 86
 		{
87 87
 			index: 'PCH_REQ_QTY', name: 'pchReqQty',
88
-			label: ITP_MSG_LOCALE.label.pchReqQty, //단가
88
+			label: ITP_MSG_LOCALE.label.pchReqQty, //수량
89 89
 			width: '10', fixed: false, align: 'right',
90 90
 			sortable: true, editable: true, edittype: 'text',
91 91
 			editrules: { number:true}

+ 73 - 60
src/main/webapp/js/app/pomng/ITP_POMNG02010.js

@@ -232,9 +232,12 @@ let pageObj = {
232 232
 		this.event.init();
233 233
 		this.action();
234 234
 	},
235
+	itp_POMNG02010_param: {},
236
+	itp_POMNG02010_search: false,
235 237
 	ui: {
236 238
 		init: function () {
237 239
 			this.view();
240
+			this.form();
238 241
 			this.grid();
239 242
 			this.ready();
240 243
 		},
@@ -255,6 +258,9 @@ let pageObj = {
255 258
 			$('#ITP_FORM_POMNG02010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate()+30)));
256 259
 			
257 260
 			
261
+		},
262
+		form: function() {
263
+			itp_fn_form_event.onKeyup('#ITP_FORM_POMNG02010_DETAIL');
258 264
 		},
259 265
 		grid: function() {
260 266
 			itp_fn_jqgrid_resize(POMNG02010_GRID_ID, POMNG02010_GRID_LIST, 'lg');
@@ -382,34 +388,11 @@ let pageObj = {
382 388
 					$(this).val('').prop('selected', true);
383 389
 				}
384 390
 			});
385
-			/*
386
-			// 가맹점 정보 설정
387
-			$('#ITP_FORM_POMNG02010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
388
-			$('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
389
-			$('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));
390
-			$('#ITP_FORM_POMNG02010_DETAIL .fnSpplyId').text('(자동부여) (비밀번호는 사업자번호로 초기화 됩니다.)');
391
-			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_info').hide();
392
-			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_change').show();
393
-
394
-			$('#ITP_BTN_POMNG02010_RESET_PW').hide();
395
-			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_ACCT_FILE_UPLOAD");
396
-			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_CORP_FILE_UPLOAD");
397
-			*/
391
+			
398 392
 		} else if(mode == 'MODIFY') { // 수정
399 393
 			fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_CANCELLIST', '#ITP_BTN_POMNG02010_SAVE', '#ITP_BTN_POMNG02010_REQ']);
400 394
 			
401 395
 			$('#ITP_AJAX_POMNG02010_DETAIL_CONTAINER').show();
402
-			/*
403
-			$('#ITP_BTN_POMNG02010_RESET_PW').show();
404
-			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_info').show();
405
-			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_change').hide();
406
-
407
-			$('#ITP_FORM_POMNG02010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
408
-			$('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
409
-			$('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));
410
-			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_ACCT_FILE_UPLOAD");
411
-			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_CORP_FILE_UPLOAD");
412
-			*/
413 396
 		} else if(mode == 'VIEW') { // 보기
414 397
 			fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_MODIFY', '#ITP_BTN_POMNG02010_CANCELLIST']);
415 398
 			$('#ITP_AJAX_POMNG02010_VIEW_CONTAINER').show();
@@ -421,6 +404,7 @@ let pageObj = {
421 404
 			this.gridList = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_LIST : POMNG02010_DETAIL_GRID_LIST;
422 405
 			this.gridEmpty = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_EMPTY : POMNG02010_DETAIL_GRID_EMPTY;
423 406
 			this.gridRows = gridRows;
407
+			this.unload();
424 408
 			this.load(mode, gridRows);
425 409
 		},
426 410
 		gridId: '',
@@ -466,12 +450,14 @@ let pageObj = {
466 450
 				colModel: gridColModel.detail,
467 451
 				data: gridRows,
468 452
 				cellEdit: true,
469
-				multiselect: (mode !== 'VIEW'),
453
+				multiselect: true,
470 454
 				// cellEdit: (mode !== 'VIEW'),
471 455
 				loadComplete: function(data) {
472 456
 					console.log(data);
473
-					$(_this.gridList).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
474
-					(Array.isArray(data.rows) && data.rows.length === 0) ? $(_this.gridEmpty).show() : $(_this.gridEmpty).hide();
457
+					//$(_this.gridList).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
458
+					//(Array.isArray(data.rows) && data.rows.length === 0) ? $(_this.gridEmpty).show() : $(_this.gridEmpty).hide();
459
+					$(_this.mode === 'VIEW' ? POMNG02010_VIEW_GRID_LIST : POMNG02010_DETAIL_GRID_LIST).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
460
+					data.records === 0 ? _this.clearData() : $(this.mode === 'VIEW' ? POMNG02010_VIEW_GRID_EMPTY : POMNG02010_DETAIL_GRID_EMPTY).hide();
475 461
 				},
476 462
 				onCellSelect: function(rowid, cellIdx, cellValue) {
477 463
 					console.log('mode ===> ' + mode);
@@ -503,7 +489,17 @@ let pageObj = {
503 489
 				
504 490
 			});
505 491
 			$('#ITP_FORM_POMNG02010_DETAIL .fnPchReqTotalAmt').text(pchReqAmt);
492
+		},
493
+		clearData : function() {
494
+			$(this.gridId).jqGrid('clearGridData', true);
495
+			$(this.mode === 'VIEW' ? POMNG02010_VIEW_GRID_LIST : POMNG02010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
496
+			$(this.mode === 'VIEW' ? POMNG02010_VIEW_GRID_EMPTY : POMNG02010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
497
+			$(this.mode === 'VIEW' ? POMNG02010_VIEW_GRID_EMPTY : POMNG02010_DETAIL_GRID_EMPTY).show();
498
+		},
499
+		unload : function() {
500
+			$.jgrid.gridUnload(this.gridId);
506 501
 		}
502
+		
507 503
 	}
508 504
 };
509 505
 
@@ -544,15 +540,20 @@ let listObj = {
544 540
 			listObj.itp_POMNG02010_param = param;
545 541
 		},
546 542
 		back: function() {
547
-			$('#ITP_FORM_POMNG02010_SERVICE_ST_DT').val(this.itp_POMNG02010_param.serviceStDt);
548
-			$('#ITP_FORM_POMNG02010_SEARCH_BSNS_REG_NO').val(this.itp_POMNG02010_param.sbsnsRegNo);
549
-			$('#ITP_FORM_POMNG02010_SEARCH_SPPLY_NM').val(this.itp_POMNG02010_param.sspplyNm);
543
+			$('#ITP_FORM_POMNG02010_SEARCH_FROM_DT').val(this.itp_POMNG02010_param.fromDt);
544
+			$('#ITP_FORM_POMNG02010_SEARCH_TO_DT').val(this.itp_POMNG02010_param.toDt);
545
+			$('#ITP_FORM_POMNG02010_SEARCH_SWHS_ID').val(this.itp_POMNG02010_param.swhsId);
546
+			$('#ITP_FORM_POMNG02010_SEARCH_SPCH_REQ_ST_CD').val(this.itp_POMNG02010_param.spchReqStCd);
547
+			$('#ITP_FORM_POMNG02010_SEARCH_ITEM_NM').val(this.itp_POMNG02010_param.sItemNm);
550 548
 		}
551 549
 	},
552 550
 	grid: {
553 551
 		init: function () {
554 552
 			// 데이터 없을때
555 553
 			listObj.empty.push();
554
+			itp_fn_jqgrid_resize(POMNG02010_GRID_ID, POMNG02010_GRID_LIST, 'lg');
555
+			itp_fn_fire_window_resize();
556
+			this.reload();
556 557
 			this.search();
557 558
 		},
558 559
 		colModel: gridColModel.list,
@@ -598,6 +599,13 @@ let listObj = {
598 599
 			
599 600
 			itp_fn_grid_make_remote(option);
600 601
 		},
602
+		reload : function() {
603
+			var _this = this;
604
+			$(POMNG02010_GRID_EMPTY).off('click').on('click', function() {
605
+				pageObj.itp_OPER03010_param.gridSize = $.jgrid.defaults.rowNum;
606
+				$(POMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(pageObj.itp_POMNG02010_param)}).trigger('reloadGrid');
607
+			});
608
+		},
601 609
 		clearData : function() {
602 610
 			$(POMNG02010_GRID_ID).jqGrid('clearGridData', true);
603 611
 			$(POMNG02010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
@@ -644,13 +652,13 @@ let viewObj = {
644 652
 		
645 653
 		// 품목  리스트 조회
646 654
 		pageObj.grid.init('VIEW', result.pchReqDtlList);
647
-		// viewObj.grid.load(result.spplyMgrList);
648 655
 	}
649 656
 };
650 657
 
651 658
 /*수정화면 Object*/
652 659
 let modifyObj = {
653 660
 	init: function (param) {
661
+		pageObj.grid.init('DETAIL', []);
654 662
 		this.load(param);
655 663
 	},
656 664
 	button: {
@@ -700,36 +708,37 @@ let modifyObj = {
700 708
 
701 709
 			if (itp_fn_form_event.isValid(formId)) {
702 710
 				var saveReq = {
703
-				callBack: function(args) {
704
-						$(formId).val(arg);
705
-						let gridInsertData = [];
706
-						let gridUpdateData = [];
707
-						let gridDeleteData = [];
708
-						const rowData = $(POMNG02010_DETAIL_GRID_ID).getRowData();
709
-						
710
-						$.each(rowData, function(key, value) {
711
-							if (value.viewCd !== 'R') {
712
-								if (value.viewCd === 'C') {
713
-									gridInsertData.push(value);
714
-								} else if (value.viewCd === 'U') {
715
-									gridUpdateData.push(value);
716
-								} else if (value.viewCd === 'D') {
717
-									gridDeleteData.push(value);
711
+					callBack: function(args) {
712
+							$(formId).val(arg);
713
+							let gridInsertData = [];
714
+							let gridUpdateData = [];
715
+							let gridDeleteData = [];
716
+							const rowData = $(POMNG02010_DETAIL_GRID_ID).getRowData();
717
+							
718
+							$.each(rowData, function(key, value) {
719
+								if (value.viewCd !== 'R') {
720
+									if (value.viewCd === 'C') {
721
+										gridInsertData.push(value);
722
+									} else if (value.viewCd === 'U') {
723
+										gridUpdateData.push(value);
724
+									} else if (value.viewCd === 'D') {
725
+										gridDeleteData.push(value);
726
+									}
718 727
 								}
719
-							}
720
-						});
721
-		
722
-						let param = $(formId).serializeObject();
723
-						param.gridInsertData = gridInsertData;
724
-						param.gridUpdateData = gridUpdateData;
725
-						param.gridDeleteData = gridDeleteData;
726
-						console.log(JSON.stringify(param));
727
-						var searhFn = function() {
728
-							ITP_FORM_POMNG02010_DETAIL_IS_WRITING = false;
729
-							listObj.grid.search();
730
-						};
731
-						fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');				
732
-					}
728
+							});
729
+			
730
+							let param = $(formId).serializeObject();
731
+							param.gridInsertData = gridInsertData;
732
+							param.gridUpdateData = gridUpdateData;
733
+							param.gridDeleteData = gridDeleteData;
734
+							console.log(JSON.stringify(param));
735
+							var searhFn = function() {
736
+								ITP_FORM_POMNG02010_DETAIL_IS_WRITING = false;
737
+								modifyObj.button.clear();
738
+								//listObj.grid.search();
739
+							};
740
+							fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');				
741
+						}
733 742
 				};
734 743
 				if (arg == 'PR20') {
735 744
 					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.reqSave, saveReq, null);
@@ -738,6 +747,10 @@ let modifyObj = {
738 747
 				}
739 748
 			}
740 749
 		},
750
+		clear: function () {
751
+			document.getElementById('ITP_FORM_POMNG02010_DETAIL').reset();
752
+			listObj.grid.search();
753
+        },
741 754
 		cancel: function () {
742 755
             listObj.grid.search();
743 756
        }