Browse Source

반품 요청

marseyes 2 years ago
parent
commit
1f0bd273b7
1 changed files with 49 additions and 10 deletions
  1. 49 10
      src/main/webapp/js/app/rtnmng/ITP_RTNMNG01010.js

+ 49 - 10
src/main/webapp/js/app/rtnmng/ITP_RTNMNG01010.js

@@ -84,7 +84,7 @@ const gridColModel = {
84 84
 		{
85 85
 			index: 'RTN_QTY', name: 'rtnQty',
86 86
 			label: '반품수량', //수량
87
-			width: '10', fixed: false, align: 'right',
87
+			width: '10', fixed: false, align: 'center',
88 88
 			sortable: false, editable: true, edittype: 'text',
89 89
 			editrules: { number:true }, 
90 90
 			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
@@ -92,7 +92,7 @@ const gridColModel = {
92 92
 		{
93 93
 			index: 'RTN_AMT', name: 'rtnAmt',
94 94
 			label: '반품예상금액',
95
-			width: '10', fixed: false, align: 'right',
95
+			width: '10', fixed: false, align: 'center',
96 96
 			sortable: false, editable: false, edittype: 'text', hidden: false, 
97 97
 			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
98 98
 		},		
@@ -115,7 +115,7 @@ const gridColModel = {
115 115
 		{
116 116
 			index: 'RTN_RSN', name: 'rtnRsn',
117 117
 			label: '반품사유', 
118
-			width: '15', fixed: false, align: 'right',
118
+			width: '15', fixed: false, align: 'left',
119 119
 			sortable: false, editable: true, edittype: 'text'
120 120
 		},
121 121
 		{
@@ -332,10 +332,10 @@ let pageObj = {
332 332
 				
333 333
 				var viewCd = jQuery(RTNMNG01010_DETAIL_GRID_ID).jqGrid('getCell', rowId, 'viewCd');
334 334
 				var unitAmt = jQuery(RTNMNG01010_DETAIL_GRID_ID).jqGrid('getCell', rowId, 'unitAmt');
335
-				var pchReqQty = jQuery(RTNMNG01010_DETAIL_GRID_ID).jqGrid('getCell', rowId, 'pchReqQty');
335
+				var rtnQty = jQuery(RTNMNG01010_DETAIL_GRID_ID).jqGrid('getCell', rowId, 'rtnQty');
336 336
 				
337
-				if(viewCd != 'D' && unitAmt != null && unitAmt != '' && pchReqQty != null && pchReqQty != '') {		
338
-					jQuery(RTNMNG01010_DETAIL_GRID_ID).jqGrid('setRowData',rowId,{pchReqAmt: parseInt(unitAmt)*parseInt(pchReqQty)});
337
+				if(viewCd != 'D' && unitAmt != null && unitAmt != '' && rtnQty != null && rtnQty != '') {		
338
+					jQuery(RTNMNG01010_DETAIL_GRID_ID).jqGrid('setRowData',rowId,{rtnAmt: parseInt(unitAmt)*parseInt(rtnQty)});
339 339
 				}
340 340
 			});
341 341
 			
@@ -388,9 +388,48 @@ let createObj = {
388 388
 				// 품목대상 정보 확인 필요
389 389
 				var records = $(RTNMNG01010_DETAIL_GRID_ID).getGridParam('reccount');
390 390
 				if (records == 0) {
391
-					alert( "요청할 품목내역이 없습니다.");
391
+					itp_fn_modal_alert( "요청할 품목내역이 없습니다.");
392 392
 					return ;
393
-				}				
393
+				}		
394
+				
395
+				const rowData = $(RTNMNG01010_DETAIL_GRID_ID).getRowData();
396
+				
397
+				var rtnQtyCheck = true;
398
+				var rtnDvsnCheck = true;
399
+				var rtnRsnDvsnCheck = true;
400
+				var rtnRsnCheck = true;
401
+				
402
+				$.each(rowData, function(key, value) {					
403
+					if(value.rtnQty == '') {
404
+						rtnQtyCheck = false;
405
+					}
406
+					if(value.rtnDvsn == '') {
407
+						rtnDvsnCheck = false;
408
+					}
409
+					if(value.rtnRsnDvsn == '') {
410
+						rtnRsnDvsnCheck = false;
411
+					}
412
+					if(value.rtnRsn == '') {
413
+						rtnRsnCheck = false;
414
+					}
415
+				});
416
+				
417
+				if(rtnQtyCheck == false) {
418
+					itp_fn_modal_alert( "반품수량을 입력하세요.");
419
+					return;
420
+				}		
421
+				if(rtnDvsnCheck == false) {
422
+					itp_fn_modal_alert( "반품구분을 입력하세요.");
423
+					return;
424
+				}
425
+				if(rtnRsnDvsnCheck == false) {
426
+					itp_fn_modal_alert( "사유구분을 입력하세요.");
427
+					return;
428
+				}
429
+				if(rtnRsnCheck == false) {
430
+					itp_fn_modal_alert( "반품사유를 입력하세요.");
431
+					return;
432
+				}
394 433
 				
395 434
 				var saveReq = {
396 435
 				callBack: function(args) {
@@ -425,8 +464,8 @@ let createObj = {
425 464
 						fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');				
426 465
 					}
427 466
 				};
428
-				if (arg == 'PR20') {
429
-					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.reqSave, saveReq, null);
467
+				if (arg == 'RR20') {
468
+					itp_fn_modal_confirm('반품 요청하시겠습니까?', saveReq, null);
430 469
 				} else {
431 470
 					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, saveReq, null);
432 471
 				}