yhl88 лет назад: 2
Родитель
Сommit
63dd3d4374

+ 6 - 4
src/main/webapp/app/ordmng/ORDMNG02010.html

@@ -70,7 +70,9 @@
70 70
 											<label class="col-xs-2 itp_lb">브랜드 *</label>
71 71
 											<div class="col-xs-4 itp_ip fnBrandNm"></div>
72 72
 											<label class="col-xs-2 itp_lb">발주번호</label>
73
-											<div class="col-xs-4 itp_ip fnPchPodrUnqNo"></div>
73
+											<div class="col-xs-4 itp_ip fnPchPodrUnqNo">
74
+												<input type="hidden" id="ITP_FORM_ORDMNG02010_DETAIL_PCH_PODR_UNQ_NO" name="pchPodrUnqNo" value=""/>
75
+											</div>
74 76
 										</div>
75 77
 									</div>
76 78
 									<div class="itp_form_in">	
@@ -95,7 +97,7 @@
95 97
 											<div class="input-daterange input-group date">
96 98
 												<div class="col-xs-4 itp_ip">
97 99
 													<div class="col-xs-7 itp_in">
98
-														<input type="text" id="ITP_FORM_ORDMNG02010_DETAIL_DLV_SCH_DT" class="form-control itp_input" name="dlvSchDt" value="">
100
+														<input type="text" id="ITP_FORM_ORDMNG02010_DETAIL_DLV_SCH_DT" data-check-required="empty" class="form-control itp_input" name="dlvSchDt" value="">
99 101
 													</div>
100 102
 												</div>
101 103
 											</div>											
@@ -108,13 +110,13 @@
108 110
 											<label class="col-xs-2 itp_lb">납품담당자 *</label>
109 111
 											<div class="col-xs-4 itp_ip">
110 112
 												<div class="col-xs-7 itp_in">
111
-													<input type="text" id="ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_NM" class="form-control itp_input" name="dlvMgrNm" />
113
+													<input type="text" id="ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_NM" data-check-required="empty" class="form-control itp_input" name="dlvMgrNm" />
112 114
 												</div>
113 115
 											</div>
114 116
 											<label class="col-xs-2 itp_lb">납품담당자연락처 *</label>
115 117
 											<div class="col-xs-4 itp_ip">
116 118
 												<div class="col-xs-7 itp_in">
117
-													<input type="text" id="ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_TEL_NO" data-key-up="tel" class="form-control itp_input" name="dlvMgrTelNo" value=""/>
119
+													<input type="text" id="ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_TEL_NO" data-check-required="empty" data-key-up="tel" class="form-control itp_input" name="dlvMgrTelNo" value=""/>
118 120
 												</div>
119 121
 											</div>
120 122
 										</div>

+ 28 - 72
src/main/webapp/js/app/ordmng/ITP_ORDMNG02010.js

@@ -191,23 +191,7 @@ let pageObj = {
191 191
             $('#ITP_FORM_ORDMNG02010_SEARCH #ITP_FORM_ORDMNG02010_SEARCH_SPPLY_ID').val(fn_make_user_info.get('spplyId'));
192 192
             $('#ITP_BTN_ORDMNG02010_SEARCH_WHS_ID').show();
193 193
             $('#ITP_BTN_ORDMNG02010_DELETE_WHS_ID').show();
194
-		}/* else if(mode == 'ADD') { // 등록
195
-			$('#ITP_AJAX_ORDMNG02010_DETAIL_CONTAINER').show();
196
-			fn_show_btn_auth_array(['#ITP_BTN_ORDMNG02010_CANCELLIST', '#ITP_BTN_ORDMNG02010_SAVE']);
197
-
198
-			$('#ITP_FORM_ORDMNG02010_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
199
-				$(this).attr('id') === 'ITP_FORM_ORDMNG02010_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
200
-				if(elem.type === 'select') {
201
-					$(this).val('').prop('selected', true);
202
-				}
203
-			});
204
-
205
-			$('#ITP_FORM_ORDMNG02010_DETAIL_USER_ID').removeAttr('readonly');
206
-			$('#ITP_FORM_ORDMNG02010_DETAIL_DUP').removeAttr('disabled');
207
-			$('#ITP_FORM_ORDMNG02010_DETAIL_SEARCH_BRAND_ID option').remove();
208
-			$('#ITP_FORM_ORDMNG02010_DETAIL_SEARCH_AFFL_SHOP').show();
209
-			$('#ITP_FORM_ORDMNG02010_DETAIL_DELETE_AFFL_SHOP').show();
210
-		}*/ else if(mode === 'MODIFY') { // 수정
194
+		} else if(mode === 'MODIFY') { // 수정
211 195
 			$('#ITP_AJAX_ORDMNG02010_DETAIL_CONTAINER').show();
212 196
 			fn_show_btn_auth_array(['#ITP_BTN_ORDMNG02010_CANCELLIST', '#ITP_BTN_ORDMNG02010_SAVE', '#ITP_BTN_ORDMNG02010_RESET_PW']);
213 197
 			$('#ITP_FORM_ORDMNG02010_DETAIL #ITP_FORM_ORDMNG02010_DETAIL_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
@@ -220,10 +204,7 @@ let pageObj = {
220 204
 			$('#ITP_FORM_ORDMNG02010_DETAIL_DELETE_AFFL_SHOP').hide();
221 205
 			$('#ITP_BTN_ORDMNG02010_CANCELLIST').show();
222 206
             $('#ITP_BTN_ORDMNG02010_SAVE').show();
223
-		} /*else if(mode === 'VIEW') { // 보기
224
-			$('#ITP_AJAX_ORDMNG02010_VIEW_CONTAINER').show();
225
-			fn_show_btn_auth_array(['#ITP_BTN_ORDMNG02010_MODIFY', '#ITP_BTN_ORDMNG02010_CANCELLIST']);
226
-		}*/
207
+		}
227 208
 	}
228 209
 };
229 210
 
@@ -242,7 +223,6 @@ let listObj = {
242 223
 			let param = $('#ITP_FORM_ORDMNG02010_SEARCH').serializeObject();
243 224
 			param.gridSize = $.jgrid.defaults.rowNum;
244 225
             param.gridPage = $.jgrid.defaults.page;
245
-            console.log(1234);
246 226
             console.log(JSON.stringify(param));
247 227
             $(ORDMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
248 228
         },
@@ -307,18 +287,7 @@ let listObj = {
307 287
             	pager: ORDMNG02010_GRID_PAGER,
308 288
             	multiselect: true,
309 289
 				multiboxonly : false,
310
-				rownumbers: false,/*
311
-            	onCellSelect: function(rowId, cellIdx, cellValue) {
312
-                    var cm = $(this).jqGrid('getGridParam', 'colModel');
313
-                    var colNm = cm[cellIdx].name;
314
-                    if (colNm === 'pchPodrUnqNo') {
315
-                        const pchPodrUnqNoVal = $(this).jqGrid('getCell', rowId, 'pchPodrUnqNo');
316
-                        const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
317
-                        const key = {pchPodrUnqNo: pchPodrUnqNoVal, brandId: brandIdVal};
318
-                        var param = $.param(key);
319
-                        modifyObj.init(param);
320
-                    }
321
-				},*/
290
+				rownumbers: false,
322 291
 				loadComplete: function(data) {
323 292
 					console.log(data);
324 293
                     itp_fn_grid_load_complete(data, ORDMNG02010_GRID_ID, true, 'number', 'ORDMNG02010', listObj.itp_ORDMNG02010_search, listObj.empty, true, data.gridRecords, true);
@@ -370,7 +339,6 @@ let listObj = {
370 339
 /*수정화면 Object*/
371 340
 let modifyObj = {
372 341
 	init: function(param) {
373
-		console.log(param);
374 342
 		this.load(param);
375 343
 	},
376 344
 	itp_ORDMNG02010_param: {},
@@ -380,38 +348,29 @@ let modifyObj = {
380 348
 			listObj.grid.search();
381 349
 		},
382 350
 		save: function() {
383
-			console.log(111111);
384 351
 			const formId = '#ITP_FORM_ORDMNG02010_DETAIL';
385 352
 			itp_fn_form_clear_validate(null, formId);
386
-			console.log(22222);
387 353
 			itp_fn_grid_save_rows(ORDMNG02010_DETAIL_GRID_ID);
388 354
 			let gridInsertData = [];
389 355
 			for(var i=0; i<$(ORDMNG02010_DETAIL_GRID_ID).getGridParam('reccount'); i++) {
390 356
 				$(ORDMNG02010_DETAIL_GRID_ID).jqGrid('saveCell', i+1, 2)
391 357
 			}
358
+			let param = $(formId).serializeObject();
392 359
 			const rowData = $(ORDMNG02010_DETAIL_GRID_ID).getRowData();
393
-			console.log(rowData);
394
-			const keyValue = $(formId + '_BRAND_ID').val();
395
-			$.each(rowData, function(key, value) {
396
-				if (value.viewCd != 'R') {
397
-						value.userId = keyValue;
398
-					if (value.viewCd == 'C') {
399
-						gridInsertData.push(value);
400
-					}
401
-				}
402
-			});
360
+			for (var i = 0; i < rowData.length; i++) {
361
+				rowData[i].podrQty = Number(rowData[i].podrQty);
362
+				rowData[i].shmtQty = Number(rowData[i].shmtQty);
363
+			}
364
+			
403 365
 			var modalFn = {
404 366
 				callBack: (args) => {
405
-					console.log(444444444);
406
-					let param = $(formId).serializeObject();
407
-					param.gridInsertData = gridInsertData;
408
-					console.log(5555);
367
+					param.gridInsertData = rowData;
409 368
 					console.log(param);
410 369
 					var searhFn = function () {
411 370
 						ITP_FORM_OPER03010_DETAIL_IS_WRITING = false;
412 371
 						listObj.grid.search();
413 372
 					}
414
-					//fn_ajax_call(API_POMNG_INOUTMNG_SAVE_SPPLY_INV, JSON.stringify(param), searhFn, 'POST');
373
+					fn_ajax_call(API_POMNG_INOUTMNG_SAVE_SPPLY_INV, JSON.stringify(param), searhFn, 'POST');
415 374
 				}
416 375
 			};
417 376
 			itp_fn_modal_confirm('저장 하시겠습니까?', modalFn);
@@ -444,13 +403,13 @@ let modifyObj = {
444 403
 		console.log(result);
445 404
 		pageObj.switchScreen('MODIFY');
446 405
 		$('#ITP_FORM_ORDMNG02010_DETAIL .fnBrandNm').text(result.brandNm);										// 브랜드
447
-		$('#ITP_FORM_ORDMNG02010_DETAIL .fnPchPodrUnqNo').text(result.invPoInfoList[0].pchPodrUnqNo);			// 발주번호
448
-		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDlvRegDt').text(result.dlvRegDt);									// 납품서생성일자
406
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnPchPodrUnqNo').text(result.invPoInfoList[0].pchPodrUnqNo);			// 발주번호		
407
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDlvRegDt').text(result.dlvReqDt);									// 납품서생성일자
449 408
 		$('#ITP_FORM_ORDMNG02010_DETAIL .fnPodrTotalAmt').text(result.podrTotalAmt);							// 발주총금액
450 409
 		$('#ITP_FORM_ORDMNG02010_DETAIL .fnWhsNm').text(result.whsNm);											// 발주총금액
451 410
 		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDeliTelNo').text(result.deliTelNo);									// 납품장소연락처
452 411
 		$('#ITP_FORM_ORDMNG02010_DETAIL #ITP_FORM_ORDMNG02010_DETAIL_DLV_SCH_DT').val(result.dlvSchDt);			// 납품예정일
453
-		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDlvRegDt').text(result.dlvRegDt);									// 납품요청일
412
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDlvRegDt').text(result.dlvReqDt);									// 납품요청일
454 413
 		$('#ITP_FORM_ORDMNG02010_DETAIL #ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_NM').val(result.dlvMgrNm);			// 납품담당자
455 414
 		$('#ITP_FORM_ORDMNG02010_DETAIL #ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_TEL_NO').val(result.dlvMgrTelNo);	// 납품담당자연락처
456 415
 
@@ -462,11 +421,11 @@ let modifyObj = {
462 421
     			selRowData = $(ORDMNG02010_DETAIL_GRID_ID).jqGrid('getRowData', selectedIds[i]);		//cell 선택
463 422
     		}
464 423
     		let podrQty = selRowData.podrQty;
465
-    		if(value > podrQty) {
466
-    			console.log(podrQty);
424
+    		if(Number(value) > Number(podrQty)) {
467 425
 				return [false, '발주수량 이하 값 입력'];
426
+			} else if (Number(value) < 0) {
427
+				return [false, '음수 입력 불가'];
468 428
 			} else {
469
-				console.log(podrQty);
470 429
 				return [true, ''];
471 430
 			}
472 431
 		};		
@@ -479,13 +438,11 @@ let modifyObj = {
479 438
     		}
480 439
     		let expryYn = selRowData.expryYn;
481 440
     		if (expryYn !== 'Y' && value.length > 0) {
482
-				console.log(expryYn);
483 441
 				return [false, '유통기한여부 N'];
484 442
 			} else {
485
-				console.log(expryYn);0
486 443
 				return [true, ''];
487 444
 			}
488
-		}		
445
+		};
489 446
 		modifyObj.grid.init('MODIFY', result.invPoInfoList);		
490 447
 	},
491 448
 	grid: {
@@ -504,6 +461,12 @@ let modifyObj = {
504 461
 			var option = {
505 462
 				gridId: _this.gridId,
506 463
 				colModel: [
464
+					{
465
+						index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
466
+						label: ITP_MSG_LOCALE.label.pchPodrUnqNo,
467
+						width: '10', fixed: false, align: 'center',
468
+						sortable: false, hidden: true
469
+					},
507 470
 					{
508 471
 						index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
509 472
 						label: ITP_MSG_LOCALE.label.pchPodrDtlNo,  		//발주항번
@@ -557,14 +520,14 @@ let modifyObj = {
557 520
 						index: 'EXPRY_DATE', name: 'expryDate',
558 521
 						label: ITP_MSG_LOCALE.label.expryDate,  		//유통기한일자
559 522
 						width: '20', fixed: false, align: 'center',
560
-						sortable: false, hidden: false, /*edittype: 'text',*/
523
+						sortable: false, hidden: false, 
561 524
 						editable: true, sorttype: 'date',
562 525
 				        editoptions: {dataInit: function(e) {$(e).datepicker(ITP_DATE_LANGUAGE);}},
563 526
 				        editrules: {custom: true, custom_func: isExpryDate}
564 527
 					},
565 528
 					{
566
-						index: 'REMARK', name: 'remark',
567
-						label: ITP_MSG_LOCALE.label.remark,  			//비고
529
+						index: 'REMARK', name: 'deliDesc',				//API 비고 키
530
+						label: ITP_MSG_LOCALE.label.remark,  			//locale-ko 비고
568 531
 						width: '20', fixed: false, align: 'center',
569 532
 						sortable: false, hidden: false, edittype: 'text',
570 533
 						editable: true
@@ -586,12 +549,5 @@ let modifyObj = {
586 549
 		unload: function() {
587 550
 			$.jgrid.gridUnload(this.gridId);
588 551
 		}
589
-	}/*,
590
-	changeRows: function(gridRows) {
591
-		var modifyRows = [];
592
-		var chkColums = ['podrQty', 'expryDate', 'remark'];
593
-		$.each(this.rows, function(index, item) {
594
-			var row = gridRows[index];
595
-		});
596
-	}*/
552
+	}
597 553
 };