Parcourir la source

재고 이력

marseyes il y a 2 ans
Parent
commit
723a7e9622

+ 47 - 0
src/main/webapp/app/popup/biz/BIZPOP_PO_STOCK_HIST.html

@@ -0,0 +1,47 @@
1
+<div id="ITP_BIZPOP_PO_STOCK_HIST" class="modal itp_modal">
2
+	<div class="modal-dialog">
3
+		<div class="modal-content">
4
+			<form id="ITP_FORM_BIZPOP_PO_STOCK_HIST">
5
+			<input type="hidden" id="ITP_FORM_BIZPOP_PO_STOCK_HIST_BRAND_ID" name="sbrandId" value="">
6
+			<input type="hidden" id="ITP_FORM_BIZPOP_PO_STOCK_HIST_WHS_ID" name="swhsId" value="">
7
+			<input type="hidden" id="ITP_FORM_BIZPOP_PO_STOCK_HIST_LOCATION" name="slocation" value="">
8
+			<input type="hidden" id="ITP_FORM_BIZPOP_PO_STOCK_HIST_ITEM_ID" name="sitemId" value="">
9
+			
10
+				<div class="modal-header">
11
+					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
12
+					<h5 class="modal-title">재고이력</h5>
13
+				</div>
14
+				<div class="modal-body">
15
+					<div class="itp_form fix">
16
+						<div class="col-xs-12 itp_form_inline">
17
+							<div class="form-horizontal fix">
18
+								<div class="col-xs-5 itp_ip">
19
+									<div class="input-daterange input-group date">
20
+										<input type="text" id="ITP_FORM_BIZPOP_PO_STOCK_HIST_FROM_DT" class="form-control itp_input" name="fromDt" value="" readonly>
21
+										<span class="input-group-addon itp_date_to">~</span>
22
+										<input type="text" id="ITP_FORM_BIZPOP_PO_STOCK_HIST_TO_DT" class="form-control itp_input" name="toDt" value="" readonly>
23
+									</div>
24
+								</div>
25
+							
26
+								<div class="col-xs-5 itp_ip itp_pr">
27
+									<select id="ITP_FORM_BIZPOP_PO_STOCK_HIST_INOUT_CD" class="form-control itp_input" name="sinoutCd"></select>	
28
+								</div>
29
+								<div class="pull-right itp_cicon">
30
+									<button type="button" class="btn btn-success btn-sm" id="ITP_BIZPOP_PO_STOCK_HIST_BTN_SEARCH" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i> 조회</button>
31
+								</div>
32
+							</div>
33
+						</div>
34
+					</div>
35
+					<div id="ITP_BIZPOP_PO_STOCK_HIST_jqGrid_list" class="itp_tb_list" data-total-cnt="">
36
+						<div id="ITP_BIZPOP_PO_STOCK_HIST_jqGridView" class="itp_views fix"></div>
37
+						<table id="ITP_BIZPOP_PO_STOCK_HIST_jqGrid"></table>
38
+						<div id="ITP_BIZPOP_PO_STOCK_HIST_jqGridPager"></div>
39
+						<div id="ITP_BIZPOP_PO_STOCK_HIST_jqGridEmpty" class="itp_no_data"></div>
40
+					</div>
41
+				</div>
42
+			</form>
43
+		</div>
44
+	</div>
45
+
46
+	<div id="ITP_POPUP_JS"></div>
47
+</div>

+ 122 - 0
src/main/webapp/js/app/popup/biz/ITP_BIZPOP_PO_STOCK_HIST.js

@@ -0,0 +1,122 @@
1
+require(['config'], function() {
2
+	require([
3
+		'jquery'
4
+	], function($) {
5
+
6
+	});
7
+});
8
+
9
+let STOCK_MNG_HIST_GRID_LIST = '/api/stock/mng/hist-grid-list';
10
+
11
+function itp_fn_BIZPOP_PO_STOCK_HIST(parentPopFn, args, returnType) {
12
+	
13
+	// console.log(JSON.stringify(args));
14
+	
15
+	let itp_BIZPOP_PO_STOCK_HIST_param = {};
16
+	let itp_BIZPOP_PO_STOCK_HIST_search = false;
17
+
18
+	const THIS_FORM_ID = '#ITP_FORM_BIZPOP_PO_STOCK_HIST';
19
+	const THIS_GIRD_ID = '#ITP_BIZPOP_PO_STOCK_HIST_jqGrid';
20
+	const THIS_GIRD_PAGER = '#ITP_BIZPOP_PO_STOCK_HIST_jqGridPager';
21
+	
22
+	$('#ITP_FORM_BIZPOP_PO_STOCK_HIST_BRAND_ID').val(args.brandId);
23
+	$('#ITP_FORM_BIZPOP_PO_STOCK_HIST_WHS_ID').val(args.whsId);
24
+	$('#ITP_FORM_BIZPOP_PO_STOCK_HIST_LOCATION').val(args.location);
25
+	$('#ITP_FORM_BIZPOP_PO_STOCK_HIST_ITEM_ID').val(args.itemId);
26
+	
27
+	var now = new Date();
28
+	$('#ITP_FORM_BIZPOP_PO_STOCK_HIST .input-group.date').datepicker(ITP_DATE_LANGUAGE);
29
+	$('#ITP_FORM_BIZPOP_PO_STOCK_HIST_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
30
+	$('#ITP_FORM_BIZPOP_PO_STOCK_HIST_TO_DT').datepicker('setDate', new Date());
31
+	
32
+	// 공통코드 표시
33
+	fn_make_select(CODE_LIST, 'INOUT_CD', 'ITP_FORM_BIZPOP_PO_STOCK_HIST_INOUT_CD');
34
+	
35
+	$('#ITP_BIZPOP_PO_STOCK_HIST').one('shown.bs.modal', function(e) {
36
+		itp_fn_jqgrid_resize(THIS_GIRD_ID, '#ITP_BIZPOP_PO_STOCK_HIST_jqGrid_list', '');
37
+		itp_fn_fire_window_resize();
38
+	}).one('hidden.bs.modal', function(e) {
39
+		$('#ITP_BIZPOP_PO_STOCK_HIST').remove();
40
+	}).modal('show');
41
+
42
+	$('#ITP_BIZPOP_PO_STOCK_HIST_BTN_SEARCH').on('click', function() {
43
+		itp_BIZPOP_PO_STOCK_HIST_search = true;
44
+		let param = $(THIS_FORM_ID).serializeObject();
45
+		param.gridSize = 10;
46
+		param.gridPage = $.jgrid.defaults.page;
47
+		$(THIS_GIRD_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
48
+	});
49
+
50
+	$('#ITP_BIZPOP_PO_STOCK_HIST_jqGridEmpty').on('click', function() {
51
+		itp_fn_BIZPOP_PO_STOCK_HIST_empty.back();
52
+		itp_BIZPOP_PO_STOCK_HIST_param.gridSize = 10;
53
+		$(THIS_GIRD_ID).setGridParam({'postData': JSON.stringify(itp_BIZPOP_PO_STOCK_HIST_param)}).trigger('reloadGrid');
54
+	});
55
+
56
+	var itp_fn_BIZPOP_PO_STOCK_HIST_empty = {
57
+		push: function() {
58
+			let param = $(THIS_FORM_ID).serializeObject();
59
+			itp_BIZPOP_PO_STOCK_HIST_param = param;
60
+		},
61
+		back: function() {
62
+			$(THIS_FORM_ID + '_CMPY_CD').val(itp_BIZPOP_PO_STOCK_HIST_param.scmpyCd);
63
+			$(THIS_FORM_ID + '_CMPY_NM').val(itp_BIZPOP_PO_STOCK_HIST_param.scmpyNm);
64
+			$(THIS_FORM_ID + '_CMPY_TYPE_CD').val(itp_BIZPOP_PO_STOCK_HIST_param.scmpyTypeCd);
65
+		}
66
+	};
67
+
68
+	itp_fn_BIZPOP_PO_STOCK_HIST_empty.push();
69
+	let param = $('#ITP_FORM_BIZPOP_PO_STOCK_HIST').serializeObject();
70
+	param.gridSize = 10;
71
+
72
+	$(THIS_GIRD_ID).jqGrid({
73
+		colModel: [
74
+			{
75
+				index: 'INOUT_NM', name: 'inoutNm',
76
+				label: '입출고구분', // 
77
+				width: '10', fixed: false, align: 'center',
78
+				sortable: false, hidden: false
79
+			},
80
+			{
81
+				index: 'SYS_REG_DTTM', name: 'sysRegDttm',
82
+				label: '발생일자', //
83
+				width: '12', fixed: false, align: 'center',
84
+				sortable: false, hidden: false
85
+			},
86
+			{
87
+				index: 'INOUT_QTY', name: 'inoutQty',
88
+				label: '입출고수량', //
89
+				width: '10', fixed: false, align: 'center',
90
+				sortable: false, hidden: false
91
+			},
92
+			{
93
+				index: 'CHG_DVSN_NM', name: 'chgDvsnNm',
94
+				label: '변경구분', //
95
+				width: '10', fixed: false, align: 'center',
96
+				sortable: false, hidden: false
97
+			},
98
+			{
99
+				index: 'RELATION_NO', name: 'relationNo',
100
+				label: '관련번호', //
101
+				width: '10', fixed: false, align: 'center',
102
+				sortable: false, hidden: false
103
+			}
104
+		],
105
+		loadBeforeSend: function(jqXHR) {
106
+		    jqXHR.setRequestHeader('X-AUTH-TOKEN', CONN_KEY);
107
+		},
108
+		postData: JSON.stringify(param),
109
+		url: DOMAIN + STOCK_MNG_HIST_GRID_LIST,
110
+		pager: THIS_GIRD_PAGER,
111
+		multiselect: false,
112
+		loadComplete: function(data) {
113
+			itp_fn_grid_load_complete(data, THIS_GIRD_ID, true, undefined, 'BIZPOP_PO_STOCK_HIST', itp_BIZPOP_PO_STOCK_HIST_search, itp_fn_BIZPOP_PO_STOCK_HIST_empty, true, data.gridRecords, false);
114
+	    },
115
+	    loadError: function(jqXHR, textStatus, errorThrown) {
116
+	    	itp_fn_grid_load_error(jqXHR, textStatus, errorThrown);
117
+	    },
118
+	    onPaging: function(action) {
119
+	    	itp_fn_grid_paging(THIS_GIRD_ID, action, param);
120
+	    }
121
+	}).navGrid(THIS_GIRD_PAGER, ITP_GRID_NAV_DEFAULTS.navGrid);
122
+};

+ 17 - 0
src/main/webapp/js/app/stockmng/ITP_STOCKMNG01010.js

@@ -265,7 +265,24 @@ let listObj = {
265 265
 			}, args, 'S');
266 266
 		}, 
267 267
 		clickStockHist: function() {
268
+			// 그리드에서 최소1개는 선택해야 함
269
+			const rowKey = $(STOCKMNG01010_GRID_ID).getGridParam('selrow');
270
+		    if (!rowKey) {
271
+				itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.noData);
272
+		    	return;
273
+		    }
274
+			var selectedIds = $(STOCKMNG01010_GRID_ID).getGridParam('selarrrow');
275
+			if (selectedIds.length > 1) {
276
+				itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.noSingleData);
277
+		    	return;
278
+			}
279
+			var brandId = $(STOCKMNG01010_GRID_ID).jqGrid('getRowData', selectedIds[0]).brandId;
280
+			var whsId = $(STOCKMNG01010_GRID_ID).jqGrid('getRowData', selectedIds[0]).whsId;
281
+			var location = $(STOCKMNG01010_GRID_ID).jqGrid('getRowData', selectedIds[0]).location;
282
+			var itemId = $(STOCKMNG01010_GRID_ID).jqGrid('getRowData', selectedIds[0]).itemId;
268 283
 			
284
+			var args = {'brandId': brandId, 'whsId': whsId, 'location': location, 'itemId': itemId};			
285
+			fn_call_popup('biz', 'BIZPOP_PO_STOCK_HIST', '#ITP_ASIDE', null, args, 'S');
269 286
 		}
270 287
 	},
271 288
 	empty: {