1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
| <!DOCTYPE html>
| <html>
| <head>
| <meta charset="utf-8">
| <title>出入库年报</title>
| <meta name="renderer" content="webkit">
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
| <meta name="viewport"
| content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
| <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
| <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
| </head>
| <body>
| <div class="layui-fluid" style="padding-bottom: 0;">
| <div class="layui-card">
| <div class="layui-form layui-card-header layuiadmin-card-header-auto">
| <div class="layui-form-item">
| <div class="layui-inline">
| <label class="layui-form-label">统计时间</label>
| <div class="layui-input-inline">
| <input type="text" class="layui-input" id="startDate" name="startDate"
| autocomplete="off" placeholder="yyyy">
| </div>
| </div>
| <div class="layui-inline">
| <label class="layui-form-label">物品编码</label>
| <div class="layui-input-inline">
| <input type="text" id="GoodId" name="GoodId" placeholder="物品编码" autocomplete="off"
| class="layui-input">
| </div>
| </div>
| <div class="layui-inline">
| <label class="layui-form-label">物品名称</label>
| <div class="layui-input-inline">
| <input type="text" id="GoodsName" name="GoodsName" placeholder="物品名称" autocomplete="off"
| class="layui-input">
| </div>
| </div>
| <div class="layui-inline">
| <label class="layui-form-label">物品规格</label>
| <div class="layui-input-inline">
| <input type="text" id="GoodsStandard" name="GoodsStandard" placeholder="物品规格" autocomplete="off"
| class="layui-input">
| </div>
| </div>
| <div class="layui-inline">
| <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
| lay-filter="LAY-app-contlist-search">
| <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
| </button>
| </div>
| </div>
| </div>
| <div class="layui-card-body">
| <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
| <script type="text/html" id="table-toolbar1"></script>
| </div>
| </div>
| </div>
|
| <script src="../../layuiadmin/layui/layui.js"></script>
| <script src="../../js/public.js"></script>
| <script src="../../js/jquery-3.5.1.min.js"></script>
| <script src="../../js/jquery.cookie.js"></script>
| <script>
| var uid = $.cookie('userId');
| layui.config({
| base: '../../layuiadmin/' //静态资源所在路径
| }).extend({
| index: 'lib/index' //主入口模块
| }).use(['index', 'table', 'laypage', 'layer', 'laydate'], function() {
| var table = layui.table,
| form = layui.form,
| laypage = layui.laypage,
| layer = layui.layer;
| var d = new Date();
| var yy = d.getFullYear();
| var date1 = yy;
| var tableIns;
| var laydate = layui.laydate;
| //常规用法
| laydate.render({
| elem: '#startDate',
| type: 'year',
| value: date1
| });
|
| function refreshTable(GoodId, start, GoodsName,GoodsStandard) {
| var param = {
| StartDate: start + "-01-01",
| GoodId:GoodId,
| GoodsName:GoodsName,
| GoodsStandard:GoodsStandard,
| Type: 3
| };
| sendData(IP + "/ReportYear/GetReportYearList", param, 'post', function(res) {
| console.log(res);
| if (res.code == 1) { //成功
| var list = res.data;
| $.extend(infoOptions, {
| data: list
| });
| infoOptions.page = {
| curr: 1
| }
| tableIns = table.render(infoOptions);
| } else { //不成功
| layer.msg('获取信息失败!', {
| icon: 2,
| time: 2000 //2秒关闭(如果不配置,默认是3秒)
| }, function() {});
| }
| });
| }
| // table.reload()
| // 表单需要的变量
| var infoOptions = {
| elem: '#LAY-app-content-list',
| height: 'full-95',
| id: 'LAY-app-content-list',
| // toolbar: 'true',
| // defaultToolbar: ['filter', 'exports'],
| page: true,
| limit: pageCnt,
| limits: pageLimits,
| cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
| cols: [
| [
| // {
| // field: 'WarehouseName',
| // title: '所属库房',
| // align: 'center',
| // width: 150,
| // fixed: 'left'
| // },
| {
| field: 'GoodId',
| title: '物品编码',
| align: 'center',
|
|
| }, {
| field: 'GoodsName',
| title: '物品名称',
| align: 'center',
|
| }, {
| field: 'GoodsStandard',
| title: '物品规格',
| align: 'center',
|
| }
| // , {
| // field: 'StockLotNo',
| // title: '批次',
| // align: 'center',
| // width: 100,
| // }
| , {
| field: 'UnitName',
| title: '计量单位',
| align: 'center',
|
| },
| // {
| // field: 'StockQuantityOld',
| // title: '期初库存',
| // align: 'center',
| // width: 100,
| // },
| {
| field: 'ImportQuantity',
| title: '入库数量',
| align: 'center',
|
| }, {
| field: 'ExportQuantity',
| title: '出库数量',
| align: 'center',
|
| }
| //, {
| // field: 'StockQuantityNow',
| // title: '当期库存',
| // align: 'center',
| // width: 100,
| // },
| // {
| // field: 'ReportDateStringEx',
| // title: '统计周期',
| // align: 'center',
| // }, {
| // field: 'ReportDate',
| // title: '统计时间',
| // align: 'center',
| // fixed: 'right',
| // width: 180,
| // },
| ]
| ],
| };
| var $ = layui.$;
| form.on('submit(LAY-app-contlist-search)', function(data) {
| var GoodId =$("#GoodId").val();
| var start = data.field.startDate;
| var GoodsName =$("#GoodsName").val();
| var GoodsStandard =$("#GoodsStandard").val();
| refreshTable(GoodId, start, GoodsName,GoodsStandard);
| });
|
| refreshTable("", date1, "","");
| });
| </script>
| </body>
| </html>
|
|