Browse Source

창고관리

marseyes 2 years ago
parent
commit
6ce84f48bf

+ 29 - 0
src/main/webapp/js/app/config.js

@@ -870,6 +870,35 @@ function fn_make_input_common_cd(options, code, input_id, all_show_yn) { //HIDDE
870
 	});
870
 	});
871
 };
871
 };
872
 
872
 
873
+function fn_make_common_cd_list(options, code, all_show_yn) { // 공통코드 리스트 만들기
874
+	// $input_id = $('#' + input_id);
875
+	// $input_id.val('');
876
+	var return_val;
877
+	$.each(options, function(key, value) {
878
+		if (value.codeCd == code) {
879
+			//예제) :;BN:읽기버튼;BNW:쓰기버튼;LK:링크;MU:메뉴
880
+			let code_list = '';
881
+			if(all_show_yn == true) {
882
+				code_list = code_list + ':';
883
+			}
884
+			$.each(value.codeDtlList, function(k, val) {
885
+				if(k > 0) {
886
+					code_list = code_list + ';';
887
+				} else if(k == 0 && all_show_yn == true) {
888
+					code_list = code_list + ';';
889
+				}
890
+				code_list = code_list + val.codeDtlCd;
891
+				code_list = code_list + ':';
892
+				code_list = code_list + val.codeDtlNm;
893
+			});
894
+			// $input_id.val(code_list);
895
+			// return code_list;
896
+			return_val = code_list;
897
+		}
898
+	});
899
+	return return_val;
900
+};
901
+
873
 function fn_make_input_store_print(options, input_id, all_show_yn) { //HIDDEN 매장프린터 리스트 만들기
902
 function fn_make_input_store_print(options, input_id, all_show_yn) { //HIDDEN 매장프린터 리스트 만들기
874
 	$input_id = $('#' + input_id);
903
 	$input_id = $('#' + input_id);
875
 	$input_id.val('');
904
 	$input_id.val('');

+ 26 - 41
src/main/webapp/js/app/stockmng/ITP_STOCKMNG04010.js

@@ -8,7 +8,7 @@
8
  * let viewObj = {}			: 상세화면 Object			*
8
  * let viewObj = {}			: 상세화면 Object			*
9
  * let modifyObj = {}		: 수정화면 Object			*
9
  * let modifyObj = {}		: 수정화면 Object			*
10
  * let createObj = {}		: 신규화면 Object			*
10
  * let createObj = {}		: 신규화면 Object			*
11
- * let afflShopObj = {}		: 가맹점 Object				*
11
+ * let locInfoObj = {}		: 로케이션정보 Object				*
12
  *******************************************************/
12
  *******************************************************/
13
 
13
 
14
 /*화면 변수*/
14
 /*화면 변수*/
@@ -29,6 +29,11 @@ const STOCKMNG04010_DETAIL_GRID_EMPTY = '#ITP_STOCKMNG04010_DETAIL_jqGridEmpty';
29
 
29
 
30
 let ITP_FORM_STOCKMNG04010_DETAIL_IS_DUPLICATE = false;
30
 let ITP_FORM_STOCKMNG04010_DETAIL_IS_DUPLICATE = false;
31
 let ITP_FORM_STOCKMNG04010_DETAIL_IS_WRITING = false;
31
 let ITP_FORM_STOCKMNG04010_DETAIL_IS_WRITING = false;
32
+let STOCKMNG04010_DETAIL_GRID_LAST_ROW_ID;
33
+
34
+/* 공통코드 리스트 */
35
+let ITP_COMMON_CD_STCK_DVSN = fn_make_common_cd_list(CODE_LIST, 'STCK_DVSN', true);
36
+let ITP_COMMON_CD_LOC_ST_CD = fn_make_common_cd_list(CODE_LIST, 'LOC_ST_CD', true);
32
 
37
 
33
 /*API URL*/
38
 /*API URL*/
34
 let WHS_MNG_DETAIL_GRID_LIST = '/api/whs/mng/detail-grid-list';
39
 let WHS_MNG_DETAIL_GRID_LIST = '/api/whs/mng/detail-grid-list';
@@ -152,16 +157,20 @@ const gridColModel = {
152
 			editrules: {required: true}
157
 			editrules: {required: true}
153
 		},
158
 		},
154
 		{
159
 		{
155
-			index: 'STCK_DVSN_NM', name: 'stckDvsnNm',
160
+			index: 'STCK_DVSN', name: 'stckDvsn',
156
 			label: "관리등록",
161
 			label: "관리등록",
157
 			width: '10', fixed: false, align: 'center',
162
 			width: '10', fixed: false, align: 'center',
158
-			sortable: false, editable: true, edittype: 'text'
163
+			sortable: false, editable: true, formatter: 'select', edittype: 'select',
164
+			editoptions: {value: ITP_COMMON_CD_STCK_DVSN},
165
+			editrules: {required: true}
159
 		},
166
 		},
160
 		{
167
 		{
161
-			index: 'LOC_ST_NM', name: 'locStNm',
168
+			index: 'LOC_ST_CD', name: 'locStCd',
162
 			label: "상태",
169
 			label: "상태",
163
 			width: '10', fixed: false, align: 'center',
170
 			width: '10', fixed: false, align: 'center',
164
-			sortable: false, editable: true, edittype: 'text'
171
+			sortable: false, editable: true, formatter: 'select', edittype: 'select',
172
+			editoptions: {value: ITP_COMMON_CD_LOC_ST_CD},
173
+			editrules: {required: true}
165
 		}
174
 		}
166
 	]
175
 	]
167
 };
176
 };
@@ -178,7 +187,7 @@ let pageObj = {
178
 	init: function () {
187
 	init: function () {
179
 		this.ui.init();
188
 		this.ui.init();
180
 		this.event.init();
189
 		this.event.init();
181
-		afflShopObj.init();
190
+		locInfoObj.init();
182
 	},
191
 	},
183
 	ui: {
192
 	ui: {
184
 		init: function () {
193
 		init: function () {
@@ -224,8 +233,8 @@ let pageObj = {
224
 						case 'ITP_BTN_STOCKMNG04010_SAVE'				: createObj.button.save(); 		break;	// 저장 버튼
233
 						case 'ITP_BTN_STOCKMNG04010_SAVE'				: createObj.button.save(); 		break;	// 저장 버튼
225
 						case 'ITP_FORM_STOCKMNG04010_DETAIL_DUP'		: createObj.button.duplicate();	break;	// 중복체크
234
 						case 'ITP_FORM_STOCKMNG04010_DETAIL_DUP'		: createObj.button.duplicate();	break;	// 중복체크
226
 						case 'ITP_BTN_STOCKMNG04010_RESET_PW'			: createObj.button.resetPass();	break;	// 상세:비밀번호 초기화
235
 						case 'ITP_BTN_STOCKMNG04010_RESET_PW'			: createObj.button.resetPass();	break;	// 상세:비밀번호 초기화
227
-						case 'ITP_BTN_STOCKMNG04010_DETAIL_ADDROW'		: afflShopObj.button.addRow();	break;	// 상세:추가버튼
228
-						case 'ITP_BTN_STOCKMNG04010_DETAIL_DELROW'		: afflShopObj.button.delRow();	break;	// 상세:삭제버튼
236
+						case 'ITP_BTN_STOCKMNG04010_DETAIL_ADDROW'		: locInfoObj.button.addRow();	break;	// 상세:추가버튼
237
+						case 'ITP_BTN_STOCKMNG04010_DETAIL_DELROW'		: locInfoObj.button.delRow();	break;	// 상세:삭제버튼
229
 					}
238
 					}
230
 				});
239
 				});
231
 			});
240
 			});
@@ -574,6 +583,9 @@ let modifyObj = {
574
 				url: DOMAIN + WHS_MNG_LOCATION_GRID_LIST,
583
 				url: DOMAIN + WHS_MNG_LOCATION_GRID_LIST,
575
 				pager: STOCKMNG04010_DETAIL_GRID_PAGER,
584
 				pager: STOCKMNG04010_DETAIL_GRID_PAGER,
576
 				multiselect: true,
585
 				multiselect: true,
586
+				onCellSelect: function(rowId, cellIdx, cellValue) {
587
+					STOCKMNG04010_DETAIL_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowId, cellIdx, STOCKMNG04010_DETAIL_GRID_LAST_ROW_ID, STOCKMNG04010_DETAIL_GRID_ID, ['location']);
588
+		   		},
577
 				loadComplete: function(data) {
589
 				loadComplete: function(data) {
578
 					itp_fn_grid_load_complete(data, STOCKMNG04010_DETAIL_GRID_ID, true, undefined, 'STOCKMNG04010_DETAIL');
590
 					itp_fn_grid_load_complete(data, STOCKMNG04010_DETAIL_GRID_ID, true, undefined, 'STOCKMNG04010_DETAIL');
579
 				},
591
 				},
@@ -675,33 +687,6 @@ let createObj = {
675
 					fn_ajax_call(WHS_MNG_MIDIFY_WHS, JSON.stringify(param), searhFn, 'POST');
687
 					fn_ajax_call(WHS_MNG_MIDIFY_WHS, JSON.stringify(param), searhFn, 'POST');
676
 				}
688
 				}
677
 			}
689
 			}
678
-		},
679
-		duplicate: function() {
680
-			const formId = '#ITP_FORM_STOCKMNG04010_DETAIL';
681
-			itp_fn_form_clear_validate(null, formId + '_DETAIL');
682
-			var vali_userId = itp_fn_form_validate(formId + '_DETAIL', formId + '_USER_ID', ['empty'], undefined);
683
-			if (vali_userId) {
684
-				var dupFn = function(result) {
685
-					if (result.code == 'N') {
686
-						ITP_FORM_STOCKMNG04010_DETAIL_IS_DUPLICATE = false;
687
-					} else {
688
-						ITP_FORM_STOCKMNG04010_DETAIL_IS_DUPLICATE = true;
689
-					}
690
-				};
691
-				const key = {'userId':  $(formId + '_USER_ID').val()};
692
-				const param = $.param(key);
693
-				fn_ajax_call(USER_CHECK_DUPLICATE, param, dupFn, 'GET');
694
-			}
695
-		},
696
-		resetPass: function() {
697
-			var resetPwFn = {
698
-				callBack: function(args) {
699
-					const key = {'userId':  $('#ITP_FORM_STOCKMNG04010_DETAIL_USER_ID').val()};
700
-					const param = $.param(key);
701
-					fn_ajax_call(USER_INTI_USERPW, param, undefined, 'GET');
702
-				}
703
-			};
704
-			itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.askResetUserPw, resetPwFn, null);
705
 		}
690
 		}
706
 	},
691
 	},
707
 	load: function () {
692
 	load: function () {
@@ -759,8 +744,8 @@ let createObj = {
759
 	}
744
 	}
760
 };
745
 };
761
 
746
 
762
-/*가맹점 Object*/
763
-let afflShopObj = {
747
+/*로케이션정보 Object*/
748
+let locInfoObj = {
764
 	init: function () {
749
 	init: function () {
765
 		if(AUTH_TYPE_CD === '10' || AUTH_TYPE_CD === '20') {
750
 		if(AUTH_TYPE_CD === '10' || AUTH_TYPE_CD === '20') {
766
 			this.action();
751
 			this.action();
@@ -811,20 +796,20 @@ let afflShopObj = {
811
 	},
796
 	},
812
 	action: function () {
797
 	action: function () {
813
 		var _this = this;
798
 		var _this = this;
814
-		// 가맹점 조회 버튼 클릭
799
+		// 로케이션정보 조회 버튼 클릭
815
 		$('#ITP_FORM_STOCKMNG04010_SEARCH_AFFL_SHOP').on('click', function() {
800
 		$('#ITP_FORM_STOCKMNG04010_SEARCH_AFFL_SHOP').on('click', function() {
816
 			_this.popup('L');
801
 			_this.popup('L');
817
 		});
802
 		});
818
-		// 가맹점 텍스트 삭제 버튼 클릭
803
+		// 로케이션정보 텍스트 삭제 버튼 클릭
819
 		$('#ITP_FORM_STOCKMNG04010_DELETE_AFFL_SHOP').on('click', function() {
804
 		$('#ITP_FORM_STOCKMNG04010_DELETE_AFFL_SHOP').on('click', function() {
820
 			$('#ITP_FORM_STOCKMNG04010_SEARCH_AFFL_SHOP_NM').val('');
805
 			$('#ITP_FORM_STOCKMNG04010_SEARCH_AFFL_SHOP_NM').val('');
821
 			$('select#ITP_FORM_STOCKMNG04010_SEARCH_BRAND_ID option').remove();
806
 			$('select#ITP_FORM_STOCKMNG04010_SEARCH_BRAND_ID option').remove();
822
 		});
807
 		});
823
-		// 신규등록 가맹점 조회 버튼 클릭
808
+		// 신규등록 로케이션정보 조회 버튼 클릭
824
 		$('#ITP_FORM_STOCKMNG04010_DETAIL_SEARCH_AFFL_SHOP').on('click', function() {
809
 		$('#ITP_FORM_STOCKMNG04010_DETAIL_SEARCH_AFFL_SHOP').on('click', function() {
825
 			_this.popup('C');
810
 			_this.popup('C');
826
 		});
811
 		});
827
-		// 신규등록 가맹점 텍스트 삭제 버튼 클릭
812
+		// 신규등록 로케이션정보 텍스트 삭제 버튼 클릭
828
 		$('#ITP_FORM_STOCKMNG04010_DETAIL_DELETE_AFFL_SHOP').on('click', function() {
813
 		$('#ITP_FORM_STOCKMNG04010_DETAIL_DELETE_AFFL_SHOP').on('click', function() {
829
 			$('#ITP_FORM_STOCKMNG04010_DETAIL_SEARCH_AFFL_SHOP_NM').val('');
814
 			$('#ITP_FORM_STOCKMNG04010_DETAIL_SEARCH_AFFL_SHOP_NM').val('');
830
 			$('select#ITP_FORM_STOCKMNG04010_DETAIL_SEARCH_BRAND_ID option').remove();
815
 			$('select#ITP_FORM_STOCKMNG04010_DETAIL_SEARCH_BRAND_ID option').remove();