|
@@ -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
|
+};
|