Blame view

src/main/resources/templates/receipt/receiptHeader/receiptHeader.html 46.5 KB
tangying authored
1
2
3
4
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
mahuandong authored
5
<style>
6
    #toolbar1 {
mahuandong authored
7
8
9
10
11
        display: inline-block;
        /*position: absolute;
        margin: 10px auto;*/
        line-height: 34px;
    }
12
mahuandong authored
13
14
15
16
17
    .btn-default {
        color: #333;
        background-color: #fff;
        border-color: #ccc
    }
18
19

    .isShow {
mahuandong authored
20
21
22
        display: none;
    }
</style>
tangying authored
23
<body class="gray-bg">
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-info">
            <ul id="myTab" class="nav nav-tabs">
                <li class="active"><a href="#tabHeader" data-toggle="tab">主表</a></li>
                <li><a href="#tabDetail" data-toggle="tab">明细</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="tabHeader">
                    <div class="col-sm-12 select-info">
                        <form id="receiptHeader-form">
                            <div class="select-list">
                                <ul>
                                    <li>
                                        入库单号:<input type="text" name="code"/>
                                    </li>
                                    <li>
41
42
43
                                        入库类型:<select name="receiptType"
                                                     th:with="type=${@receiptTypeService.getHideType()}"
                                                     id="receiptType">
肖超群 authored
44
                                        <option value="">所有</option>
45
46
47
                                        <option th:each="e : ${type}" th:text="${e['name']}"
                                                th:value="${e['code']}"></option>
                                    </select>
mahuandong authored
48
49
                                    </li>
                                    <li>
50
51
                                        货主:<select id="companyCode" name="companyCode"
                                                   th:with="list=${@companyService.getCode()}">
52
                                        <option value="">所有</option>
53
54
                                        <option th:each="item : ${list}" th:text="${item['name']}"
                                                th:value="${item['code']}" th:attr=" code = ${item['code']}"></option>
mahuandong authored
55
56
57
                                    </select>
                                    </li>
                                    <li>
58
59
                                        U8仓库:<select name="uWarehouseCode"
                                                     th:with="warehouse=${@warehouseWu.selectList()}">
60
                                        <option value="">所有</option>
61
62
63
                                        <option th:each="e : ${warehouse}" th:text="${e['uWarehouseName']}"
                                                th:value="${e['uWarehouseCode']}"></option>
                                    </select>
64
65
                                    </li>
                                    <li>
66
                                        上游单号:<input type="text" name="referCode"/>
67
68
                                    </li>
                                    <li>
肖超群 authored
69
                                        供应商:<input type="text" name="supplierCode"/>
mahuandong authored
70
71
                                    </li>
                                    <li>
72
                                        <!--头 状 态:<input type="text" name="firstStatus"/>-->
73
74
                                        头状态:<select name="firstStatus"
                                                    th:with="firstStatus=${@dict.getType('receiptHeaderStatus')}">
75
                                        <option value="">所有</option>
76
77
78
                                        <option th:each="e : ${firstStatus}" th:text="${e['dictLabel']}"
                                                th:value="${e['dictValue']}"></option>
                                    </select>
79
80
81
                                    </li>
                                    <li>
                                        <!--尾 状 态:<input type="text" name="lastStatus"/>-->
82
83
                                        尾状态:<select name="lastStatus"
                                                    th:with="lastStatus=${@dict.getType('receiptHeaderStatus')}">
84
                                        <option value="">所有</option>
85
86
87
                                        <option th:each="e : ${lastStatus}" th:text="${e['dictLabel']}"
                                                th:value="${e['dictValue']}"></option>
                                    </select>
88
89
90
                                    </li>
                                    <li class="time">
                                        <label>创建时间: </label>
91
92
                                        <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                               name="createdBegin"/>
93
                                        <span>-</span>
94
95
                                        <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                               name="createdEnd"/>
96
97
                                    </li>
                                    <li>
周鸿 authored
98
99
100
                                        创建者:<input type="text" name="createdBy"/>
                                    </li>
                                    <li>
101
102
                                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                                class="fa fa-search"></i>&nbsp;搜索</a>
mahuandong authored
103
104
105
                                        <a class="btn btn-warning btn-rounded btn-sm"
                                           onclick="$.form.reset('receiptHeader-form')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
106
107
108
109
110
111
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>
                    <div class="btn-group hidden-xs" id="toolbar" role="group">
112
113
                        <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"
                           shiro:hasPermission="receipt:receiptHeader:add">
114
115
                            <i class="fa fa-plus"></i> 新增
                        </a>
116
                        <!--<a class="btn btn-outline btn-default btn-rounded" onclick="submitReview()" shiro:hasPermission="receipt:receiptHeader:approval">
117
118
                            <i class="fa fa-fighter-jet"></i> 提交审核
                        </a>
119
                        <a class="btn btn-outline btn-primary btn-rounded" onclick="approval()" shiro:hasPermission="receipt:receiptHeader:review">
120
                            <i class="fa fa-level-up"></i> 审核通过
121
                        </a>-->
122
123
124
                        <!--                        <a class="btn btn-outline btn-primary btn-rounded" onclick="addPool()" shiro:hasPermission="receipt:receiptHeader:addPool">-->
                        <!--                            <i class="fa fa-check-circle"></i> 加入订单池-->
                        <!--                        </a>-->
125
126
127
                        <!--                        <a class="btn btn-outline btn-info btn-rounded" onclick="crossLocation()" shiro:hasPermission="receipt:receiptHeader:cross">-->
                        <!--                            <i class="fa fa-random"></i> 越库-->
                        <!--                        </a>-->
xumiao authored
128
                        <a class="btn btn-outline btn-info btn-rounded" onclick="yueku()">
DESKTOP-AO0VKC8\mahua authored
129
130
                            <i class="fa fa-random"></i> 越库
                        </a>
131
132
133
134
135
                        <!--                        <a class="btn btn-outline btn-success btn-rounded" onclick="getReceiptSI()" shiro:hasPermission="receipt:receiptHeader:remove">-->
                        <!--                            <i class="fa fa-plus"></i> 产成品入库扫描-->
                        <!--                        </a>-->
                        <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
                           shiro:hasPermission="receipt:receiptHeader:remove">
136
137
                            <i class="fa fa-trash-o"></i> 删除
                        </a>
周鸿 authored
138
139
140
                        <a class="btn btn-info" onclick="$.table.importExcel()">
                            <i class="fa fa-upload"></i>导入
                        </a>
141
                    </div>
142
143
                    <table id="bootstrap-table" data-mobile-responsive="true"
                           class="table table-bordered table-hover text-nowrap"></table>
144
145
                </div>
                <div class="tab-pane fade" id="tabDetail">
mahuandong authored
146
                    <div class="col-sm-12 select-info">
147
                        <form id="receiptDetail">
148
149
                            <ul id="tabHead" class="nav nav-tabs">
                                <li class="active"><a href="#tabBase" data-toggle="tab">基础数据</a></li>
150
                                <li role="presentation"><a href="#tabSupplierCode" data-toggle="tab">供应商信息</a></li>
151
152
153
154
                                <li><a href="#tabExcute" data-toggle="tab">执行信息</a></li>
                                <li><a href="#tabOther" data-toggle="tab">其他信息</a></li>
                                <li><a href="#tabSystem" data-toggle="tab">系统信息</a></li>
                            </ul>
mahuandong authored
155
156
157
158
                            <div class="tab-content">
                                <div class="tab-pane in active" id="tabBase">
                                    <div class="select-list">
                                        <ul>
159
160
                                            <li>入库单ID:<input type="text" name="receiptId" id="receiptId"></li>
                                            <li>入库单号:<input type="text" name="receiptCode" id="receiptCode"></li>
161
                                            <li>
162
163
                                                货主编码:<select id="receiptCompanyCode" name="receiptCompanyCode"
                                                             th:with="list=${@companyService.getCode()}">
164
                                                <option value="">所有</option>
165
166
167
                                                <option th:each="item : ${list}" th:text="${item['name']}"
                                                        th:value="${item['code']}"
                                                        th:attr=" code = ${item['code']}"></option>
168
                                            </select>
mahuandong authored
169
                                            </li>
周鸿 authored
170
                                            <!--<li>上游系统单号:<input type="text" name="referCode" id="referCode"></li>-->
171
                                            <li>上游订单类型:<input type="text" name="referType" id="referType"></li>
mahuandong authored
172
                                            <li>总数量:<input type="text" name="receiptTotalQty" id="receiptTotalQty"></li>
173
174
175
176
177
178
                                            <li>总行数:<input type="text" name="receiptTotalLines" id="receiptTotalLines">
                                            </li>
                                            <li>单据头状态:<input type="text" name="receiptFirstStatus"
                                                             id="receiptFirstStatus"></li>
                                            <li>单据尾状态:<input type="text" name="receiptLastStatus"
                                                             id="receiptLastStatus"></li>
179
180
181
182
183
184
                                        </ul>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="tabCustomer">
                                    <div class="select-list">
                                        <ul>
185
186
187
188
                                            <li>供应商编码:<input type="text" name="receiptSupplierCode"
                                                             id="receiptSupplierCode"></li>
                                            <li>入库预约时间:<input type="text" name="receiptAppointmentTime"
                                                              id="receiptAppointmentTime"></li>
189
190
191
192
193
194
195
                                        </ul>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="tabExcute">
                                    <div class="select-list">
                                        <ul>
                                            <li>优先级:<input type="text" name="receiptPriority" id="receiptPriority"></li>
huhai authored
196
                                            <li>收货站台:<input type="text" name="receiptStation" id="receiptStation"></li>
197
198
199
200
201
202
203
                                        </ul>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="tabOther">
                                    <div class="select-list">
                                        <ul>
                                            <li>备注:<input type="text" name="receiptNote" id="receiptNote"></li>
204
205
206
207
208
209
                                            <li>扩展属性1:<input type="text" name="receiptUserDef1" id="receiptUserDef1">
                                            </li>
                                            <li>扩展属性2:<input type="text" name="receiptUserDef2" id="receiptUserDef2">
                                            </li>
                                            <li>扩展属性3:<input type="text" name="receiptUserDef3" id="receiptUserDef3">
                                            </li>
210
211
212
213
214
215
                                        </ul>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="tabSystem">
                                    <div class="select-list">
                                        <ul>
216
217
218
219
220
221
                                            <li>上传备注:<input type="text" name="receiptUploadremark"
                                                            id="receiptUploadremark"></li>
                                            <li>上传时间:<input type="text" name="receiptUploadTime" id="receiptUploadTime">
                                            </li>
                                            <li>上传状态:<input type="text" name="receiptUploadStatus"
                                                            id="receiptUploadStatus"></li>
222
                                            <li>创建时间:<input type="text" name="receiptCreated" id="receiptCreated"></li>
223
224
225
226
227
228
                                            <li>创建用户:<input type="text" name="receiptCreatedBy" id="receiptCreatedBy">
                                            </li>
                                            <li>最后修改时间:<input type="text" name="receiptLastUpdated"
                                                              id="receiptLastUpdated"></li>
                                            <li>更新用户:<input type="text" name="receiptLastUpdatedBy"
                                                            id="receiptLastUpdatedBy"></li>
229
230
231
232


                                            <li>是否有效:<input type="text" name="receiptEnable" id="receiptEnable"></li>
                                            <li>是否删除:<input type="text" name="receiptDeleted" id="receiptDeleted"></li>
mahuandong authored
233
234
235
236
237
238
239
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="btn-group hidden-xs" id="toolbar1" role="group" style="position:relative;">
240
241
                        <a class="btn btn-outline btn-success btn-rounded" onclick="add()"
                           shiro:hasPermission="receipt:receiptDetail:add">
mahuandong authored
242
243
                            <i class="fa fa-plus"></i> 新增
                        </a>
244
245
                        <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()"
                           shiro:hasPermission="receipt:receiptDetail:remove">
mahuandong authored
246
247
                            <i class="fa fa-trash-o"></i> 删除
                        </a>
248
249
                        <a class="btn btn-outline btn-primary btn-rounded to-receive"
                           onclick="createStation(receiptCode)" shiro:hasPermission="receipt:receiving:add">
xumiao authored
250
251
                            <i class="fa fa-cart-plus"></i> 组盘信息
                        </a>
252
253
                        <a class="btn btn-outline btn-success btn-rounded" onclick="receiptDetailPrint()"
                           shiro:hasPermission="shipment:bill:report">
254
                            <i class="fa fa-print"></i> 打印
mahuandong authored
255
                        </a>
游杰 authored
256
257
258
                        <a class="btn btn-outline btn-primary btn-rounded" onclick="Toreceiving(receiptCode)">
                            <i class="fa fa-cart-plus"></i> 收货
                        </a>
周鸿 authored
259
mahuandong authored
260
                    </div>
261
262
                    <table id="bootstrap-table1" data-mobile-responsive="true"
                           class="table table-bordered table-hover text-nowrap"></table>
263
264
265
                </div>
            </div>
        </div>
tangying authored
266
    </div>
267
268
</div>
<div th:include="include :: footer"></div>
周鸿 authored
269
270
271
272
273
274
<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <input type="checkbox" id="updateSupport" name="updateSupport" title="如果数据已经存在,更新这条数据。"> 是否更新已经存在的数据
275
276
                &nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i
                    class="fa fa-file-excel-o"></i> 下载模板</a>
周鸿 authored
277
278
279
280
281
282
283
            </div>
            <font color="red" class="pull-left mt10">
                提示:仅允许导入“xls”或“xlsx”格式文件!
            </font>
        </div>
    </form>
</script>
284
<script th:inline="javascript">
285
    var printFlag = [[${@permission.hasPermi('receipt:receiptHeader:report')}]];
286
287
    var editFlag = [[${@permission.hasPermi('receipt:receiptHeader:edit')}]];
    var removeFlag = [[${@permission.hasPermi('receipt:receiptHeader:remove')}]];
mahuandong authored
288
    let receiveFlag = [[${@permission.hasPermi('receipt:receiptHeader:receive')}]];
289
    var addFlag = [[${@permission.hasPermi('receipt:receiptHeader:add')}]];
mahuandong authored
290
291
292
    var prefix = ctx + "receipt/receiptHeader";
    var detailPrefix = ctx + "receipt/receiptDetail";
    var datas = [[${@dict.getType('sys_normal_disable')}]];
293
    var receiptTypes = [[${@receiptTypeService.getHideType()}]];
mahuandong authored
294
295
    var receiptHeaderStatus = [[${@dict.getType('receiptHeaderStatus')}]];
    var uploadStatus = [[${@dict.getType('uploadStatus')}]];
296
297
298
    var company = [[${@companyService.getCode()}]];
    var supplier = [[${@SupplierService.getCode()}]];
    var detailCreateUrl = detailPrefix + "/add";
mahuandong authored
299
    var detailUpdateUrl = detailPrefix + "/edit/{id}";
300
    var detailRemoveUrl = detailPrefix + "/remove";
mahuandong authored
301
302
303
304
    var inventoryStatus = [[${@dict.getType('inventoryStatus')}]];
    var isVirtualBoms = [[${@dict.getType('isVirtualBom')}]];
    var receiptId = '';
    var receiptCode = '';
305
    let status = [[${status}]];
306
307
    var statusFirst = [[${statusFirst}]];
    var statusLast = [[${statusLast}]];
周鸿 authored
308
    var uWarehouseNames = [[${@warehouseWu.getName()}]];
tangying authored
309
310
    setInterval(refreshV, 1000 * 60);
周鸿 authored
311
312
    function refreshV() {
313
        //$.table.refresh();
周鸿 authored
314
315
    }
316
    $(function () {
317
        var options = {
318
            url: prefix + "/list",
319
320
321
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
322
            importUrl: detailPrefix + "/importData",
周鸿 authored
323
            importTemplateUrl: detailPrefix + "/importTemplate",
mahuandong authored
324
            modalName: "入库单",
325
            sidePagination: "server",
326
            queryParams: queryParams,
327
            search: false,
游杰 authored
328
            pageSize: 10,
mahuandong authored
329
330
331
            onDblClickRow: function (row, value, index) {
                detail(row.id, row.code);
            },
332
333
334
            columns: [{
                checkbox: true
            },
335
336
337
                {
                    title: '操作',
                    align: 'center',
338
                    formatter: function (value, row, index) {
339
                        var actions = [];
周鸿 authored
340
341
342
                        if (row.trackCode == "" && row.kuaidiCom == "") {
                            actions.push('<a class="btn btn-primary btn-xs ' + editFlag + ' href="#" onclick="eddit(\'' + row.id + '\')"><i class="fa fa-cart-plus"></i>导入</a> ');
                        }
343
                        /*if (row.trackCode != '' ) {
周鸿 authored
344
                            actions.push('<a class="btn btn-primary btn-xs ' + editFlag + ' href="#" onclick="eddit(\'' + row.id + '\')"><i class="fa fa-cart-plus"></i>分单</a> ');
345
                        }*/
346
                        actions.push('<a id="table_edit" class="btn btn-success btn-xs ' + printFlag + '" href="#" onclick="receiptPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
tongzhonghao authored
347
348
349
                        // if (row.firstStatus < 100){
                        actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> ');
                        // }
350
351
352
353
354
355
                        /* if (row.firstStatus ==150 || row.lastStatus == 150 ){
                             actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="arrivalNotice(\'' + row.id + '\')" ><i class="fa fa-edit"></i>到货通知</a> ');
                         }
                         if (row.firstStatus ==180 || row.lastStatus == 180 ){
                             actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="check(\'' + row.id + '\')" ><i class="fa fa-edit"></i>质检</a> ');
                         }*/
356
                        if (row.firstStatus == 200 && row.lastStatus == 200)
357
                            actions.push('<a class="btn btn-primary btn-xs to-receive" ' + addFlag + ' onclick="Toreceiving(\'' + row.code + '\')"><i class="fa fa-cart-plus"></i>收货</a> ');
358
359
360
361
                        if (row.firstStatus < 100) {
                            actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
                        }
362
                        /*if(row.firstStatus!=900){
363
364
                            actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="receive(\''+row.id+'\')"><i class="fa fa-upload"></i>确认回传</a>');
365
                        }*/
tongzhonghao authored
366
367
368
                        // if (row.firstStatus == 800 && row.lastStatus == 800) {
                        //     actions.push('<a class="btn btn-info btn-xs ' + receiveFlag + '" href="#" onclick="backERP(\''+row.id+'\')"><i class="fa fa-upload"></i>回传</a>');
                        // }
369
370
371
                        return actions.join('');
                    }
                },
mahuandong authored
372
                {
373
374
375
                    field: 'createdBy',
                    title: '创建用户',
                    sortable: true
376
377
                },
                {
378
379
380
381
                    field: 'id',
                    title: '入库单id',
                    sortable: true,
                    visible: false,
mahuandong authored
382
383
                },
                {
384
385
                    field: 'receiptType',
                    title: '入库类型',
肖超群 authored
386
                    align: 'center',
387
                    formatter: function (value, row, index) {
肖超群 authored
388
                        var actions = [];
389
                        $.each(receiptTypes, function (index, dict) {
肖超群 authored
390
391
392
393
394
395
396
                            if (dict.code == value) {
                                actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
                                return false;
                            }
                        });
                        return actions.join('');
                    }
mahuandong authored
397
398
                },
                {
399
400
                    field: 'code',
                    title: '入库单号',
mahuandong authored
401
402
                },
                {
pengcheng authored
403
404
405
                    field: 'companyCode',
                    title: '货主',
                    align: 'center',
406
407
                    sortable: true,
                    formatter: function (value, row, index) {
pengcheng authored
408
                        var actions = [];
409
                        $.each(company, function (index, dict) {
pengcheng authored
410
411
412
413
414
415
416
417
418
                            if (dict.code == value) {
                                actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
                                return false;
                            }
                        });
                        return actions.join('');
                    }
                },
                {
419
420
421
                    field: 'referCode',
                    title: '上游单号',
                    sortable: true
mahuandong authored
422
423
                },
                {
424
425
426
                    field: 'warehouseCode',
                    title: '仓库编码',
                    visible: false
mahuandong authored
427
428
                },
                {
429
430
                    field: 'uWarehouseName',
                    title: 'U8仓库',
431
432
433
434
                    sortable: true,
                    formatter: function (value, row, index) {
                        var actions = [];
                        if (value) {
435
436
                            actions.push("<span class='badge badge-info'>" + value + "</span>");
                        }
周鸿 authored
437
438
439
440
                        return actions.join('');
                    }
                },
                {
441
442
                    field: 'supplierCode',
                    title: '供应商',
pengcheng authored
443
                    align: 'center',
444
                    formatter: function (value, row, index) {
pengcheng authored
445
                        var actions = [];
446
                        $.each(supplier, function (index, dict) {
pengcheng authored
447
                            if (dict.code == value) {
tongzhonghao authored
448
                                actions.push("<span >" + dict.name + "</span>");
pengcheng authored
449
450
451
452
453
454
                                return false;
                            }
                        });
                        return actions.join('');
                    }
                },
周鸿 authored
455
mahuandong authored
456
                {
457
458
                    field: 'totalQty',
                    title: '总数量'
mahuandong authored
459
460
                },
                {
461
462
                    field: 'totalLines',
                    title: '总行数'
mahuandong authored
463
                },
464
                {
465
466
                    field: 'firstStatus',
                    title: '头状态',
mahuandong authored
467
                    align: 'center',
468
                    formatter: function (value, row, index) {
mahuandong authored
469
470
471
472
                        return $.table.selectDictLabel(receiptHeaderStatus, value);
                    }
                },
                {
473
474
                    field: 'lastStatus',
                    title: '尾状态',
mahuandong authored
475
                    align: 'center',
476
                    formatter: function (value, row, index) {
mahuandong authored
477
478
479
480
                        return $.table.selectDictLabel(receiptHeaderStatus, value);
                    }
                },
                {
481
482
483
                    field: 'created',
                    title: '创建时间',
                    sortable: true
mahuandong authored
484
                },
肖超群 authored
485
                {
486
487
488
489
                    field: 'lastUpdated',
                    title: '最后修改时间',
                    visible: false,
                    sortable: true
mahuandong authored
490
491
                },
                {
492
493
494
                    field: 'lastUpdatedBy',
                    title: '更新用户',
                    visible: false,
mahuandong authored
495
                },
xumiao authored
496
                {
497
498
                    field: 'backMsg',
                    title: '回传信息',
xumiao authored
499
                    align: 'center',
周鸿 authored
500
xumiao authored
501
                },
mahuandong authored
502
                {
503
504
                    field: 'userDef2',
                    title: '自定义字段2',
mahuandong authored
505
506
507
                    visible: false
                },
                {
508
509
                    field: 'userDef3',
                    title: '自定义字段3',
mahuandong authored
510
511
512
513
514
515
516
517
518
519
520
                    visible: false
                }]
        };
        $.table.init(options);
    });

    $("#bootstrap-table1").bootstrapTable({
        // url: detailPrefix + "/list",
        createUrl: detailPrefix + "/add",
        updateUrl: detailPrefix + "/edit/{id}",
        removeUrl: detailPrefix + "/remove",
周鸿 authored
521
mahuandong authored
522
523
524
        // search: true, //搜索
        sortable: true, //排序
        showRefresh: true, //刷新
525
        showToggle: true, //视图切换
mahuandong authored
526
        clickToSelect: true,
527
        showColumns: true, //列选择
mahuandong authored
528
529
530
531
532
533
534
535
536
537
538
        // detailView:true,
        showExport: true, //导出
        exportDataType: "all",  //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
        modalName: "入库明细",
        sortName: "lastUpdated",
        sortOrder: "desc",
        iconSize: "outline",
        toolbar: "#toolbar1",
        contentType: "application/x-www-form-urlencoded",
        pagination: true,   // 是否显示分页(*)
        pageNumber: 1,                                      // 初始化加载第一页,默认第一页
游杰 authored
539
        pageSize: 10,                                       // 每页的记录行数(*)
mahuandong authored
540
        pageList: [10, 25, 50, 100],                             // 可供选择的每页的行数(*)
541
        onRefresh: function () {
mahuandong authored
542
543
544
545
546
            loadDetail();
        },
        columns: [{
            checkbox: true
        },
tangying authored
547
            {
tongzhonghao authored
548
549
                title: '操作',
                align: 'center',
550
551
                events: 'operateEvents',
                formatter: function (value, row, index) {
tongzhonghao authored
552
553
554
555
556
557
558
559
560
                    var actions = [];
                    actions.push('<a id="table_edit" class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                    actions.push('<a id="table_edit" class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="editHeader(\'' + row.receiptId + '\')"><i class="fa fa-edit"></i>编辑主表</a> ');

                    actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
                    return actions.join('');
                }
            },
            {
561
562
                field: 'id',
                title: 'id',
xumiao authored
563
                visible: false
564
565
            },
            {
566
567
                field: 'receiptId',
                title: 'receiptId',
tongzhonghao authored
568
569
570
                visible: false
            },
            {
571
572
                field: 'receiptCode',
                title: '入库单编码',
xumiao authored
573
                visible: false
574
575
            },
            {
576
577
                field: 'materialCode',
                title: '物料编码'
578
579
            },
            {
580
581
                field: 'materialName',
                title: '物料名称'
582
583
            },
            {
584
585
                field: 'materialSpec',
                title: '物料规格'
tangying authored
586
587
            },
            {
588
589
                field: 'materialUnit',
                title: '物料单位'
tangying authored
590
591
            },
            {
592
593
594
                field: 'supplierCode',
                title: '供应商编码',
                visible: false
tangying authored
595
596
            },
            {
597
598
599
                field: 'batch',
                title: '批次',
                visible: false
tangying authored
600
601
            },
            {
602
603
604
                field: 'lot',
                title: '批号',
                visible: false
605
606
            },
            {
607
608
                field: 'projectNo',
                title: '项目号',
tangying authored
609
610
            },
            {
611
612
                field: 'moCode',
                title: '工作令号',
周鸿 authored
613
614
            },
            {
615
616
617
618
                field: 'qcCheck',
                title: '是否质检',
                align: "center",
                formatter: function (value, row, index) {
619
620
621
622
623
624
625
                    var actions = [];
                    if (value == 0) {
                        actions.push("<span class='badge badge-info'>是</span>");
                    } else {
                        actions.push("<span class='badge badge-info'>否</span>");
                    }
                    return actions.join('');
mahuandong authored
626
                },
627
                visible: false
tangying authored
628
629
            },
            {
630
631
632
                field: 'projectNo',
                title: '项目号',
                visible: false
tangying authored
633
634
            },
            {
635
636
637
                field: 'manufactureDate',
                title: '生产日期',
                visible: false
tangying authored
638
639
            },
            {
640
641
642
                field: 'expirationDate',
                title: '失效日期',
                visible: false
643
644
            },
            {
645
646
647
                field: 'agingDate',
                title: '入库日期',
                visible: false
648
649
            },
            {
650
651
                field: 'qty',
                title: '单据数量'
652
653
            },
            {
654
655
                field: 'taskQty',
                title: '已收数量'
656
657
            },
            {
658
659
                field: 'inventoryQty',
                title: '库存数量'
xumiao authored
660
661
            },
            {
662
663
664
                field: 'referCode',
                title: 'ERP单号',
                visible: false
665
666
            },
            {
667
668
669
                field: 'referId',
                title: 'ERP内部号',
                visible: false
tangying authored
670
671
            },
            {
672
673
674
                field: 'referLineNum',
                title: 'ERP行号',
                visible: false
tangying authored
675
676
            },
            {
677
678
679
                field: 'locatingRule',
                title: '定位规则',
                visible: false
tangying authored
680
681
            },
            {
682
683
684
                field: 'inventorySts',
                title: '库存状态',
                visible: false
tangying authored
685
686
            },
            {
687
688
689
                field: 'itemListPrice',
                title: '标价',
                visible: false
tangying authored
690
691
            },
            {
692
693
694
                field: 'itemNetPrice',
                title: '净价',
                visible: false
mahuandong authored
695
696
            },
            {
697
698
699
                field: 'price',
                title: '单价',
                visible: false
mahuandong authored
700
701
            },
            {
702
703
704
                field: 'statusFlowCode',
                title: '流程编码',
                visible: false
705
706
            },
            {
707
708
709
710
                field: 'isVirtualBom',
                title: '是否虚拟套件',
                align: "center",
                formatter: function (value, row, index) {
mahuandong authored
711
                    return $.table.selectDictLabel(isVirtualBoms, value);
mahuandong authored
712
                },
713
                visible: false
tangying authored
714
715
            },
            {
716
717
                field: 'created',
                title: '创建时间'
tangying authored
718
719
            },
            {
720
721
                field: 'color',
                title: '颜色'
tangying authored
722
723
            },
            {
724
725
726
                field: 'createdBy',
                title: '创建用户',
                visible: false
tangying authored
727
728
            },
            {
729
730
731
732
733
734
735
736
                field: 'lastUpdated',
                title: '最后修改时间',
                visible: false
            },
            {
                field: 'lastUpdatedBy',
                title: '更新用户',
                visible: false
737
738
            },
            {
739
740
741
                field: 'userDef1',
                title: '自定义字段1',
                visible: false
742
743
            },
            {
744
745
746
                field: 'userDef2',
                title: '自定义字段2',
                visible: false
747
748
            },
            {
749
750
751
                field: 'userDef3',
                title: '自定义字段3',
                visible: false
tongzhonghao authored
752
            }
753
        ]
754
    });
tangying authored
755
mahuandong authored
756
    /* 入库单列表-详细 */
757
    function detail(id, code) {
mahuandong authored
758
        receiptId = id;
759
        receiptCode = code;
760
        $("#myTab li").removeClass("active");
mahuandong authored
761
        $("#tabHeader").removeClass("in active");
762
763
        $("#myTab li:eq(1)").addClass("active");
        $("#tabDetail").addClass("in active");
mahuandong authored
764
765
766
        // $("#tabBase").addClass("in active");
        loadDetail();
    }
767
mahuandong authored
768
769
770
    /* 入库单列表-详细 */
    function loadDetail() {
        $.ajax({
771
772
773
774
            url: ctx + 'receipt/receiptDetail/list',
            type: "post",
            data: {
                receiptId: receiptId,
mahuandong authored
775
            },
776
777
            success: function (value) {
                $("#bootstrap-table1").bootstrapTable('load', value.data);
mahuandong authored
778
779
780
781
            }
        });
        $.ajax({
            url: ctx + "receipt/receiptHeader/getReceiptHeader",
782
783
784
            type: "post",
            data: {
                id: receiptId
mahuandong authored
785
            },
786
            success: function (value) {
mahuandong authored
787
788
                $('#receiptId').val(value.data.id);
                $('#receiptCode').val(value.data.code);
789
                receiptCode = value.data.code;
mahuandong authored
790
791
                $('#receiptCompanyId').val(value.data.companyId);
                $('#receiptCompanyCode').val(value.data.companyCode);
792
793
                $('#referCode').val(value.data.referCode);
                $('#referType').val(value.data.referType);
mahuandong authored
794
795
                $('#receiptTotalQty').val(value.data.totalQty);
                $('#receiptTotalLines').val(value.data.totalLines);
796
797
798
799
800
801
                $('#firstStatus').val(receiptHeaderStatus.filter(function (e) {
                    return e.dictValue == value.data.firstStatus
                })[0].dictLabel);
                $('#lastStatus').val(receiptHeaderStatus.filter(function (e) {
                    return e.dictValue == value.data.lastStatus
                })[0].dictLabel);
mahuandong authored
802
803
                $('#receiptSupplierCode').val(value.data.supplierCode);
                $('#receiptAppointmentTime').val(value.data.appointmentTime);
804
805
806
807
808
809
810
811
812
813
814
                $('#receiptStation').val(value.data.receiptStation);
                $('#receiptNote').val(value.data.receiptNote);
                $('#receiptUserDef1').val(value.data.userDef1);
                $('#receiptUserDef2').val(value.data.userDef2);
                $('#receiptUserDef13').val(value.data.userDef3);
                $('#receiptCreated').val(value.data.created);
                $('#receiptCreatedBy').val(value.data.createdBy);
                $('#receiptLastUpdated').val(value.data.lastUpdated);
                $('#receiptLastUpdatedBy').val(value.data.lastUpdatedBy);
                $('#receiptEnable').val(value.data.enable);
                $('#receiptDeleted').val(value.data.deleted);
mahuandong authored
815
816
            }
        })
817
    }
818
xumiao authored
819
820
821
822
    //组盘信息
    function createStation(receiptCode) {
        let code = receiptCode;
        let url = detailPrefix + "/receiptContainerDetails/" + code;
823
        $.modal.open("组盘信息", url);
xumiao authored
824
825
    }
mahuandong authored
826
827
828
    /* 打印 */
    function receiptPrint(id) {
        var url = prefix + "/report/" + id;
829
        $.modal.open("入库单打印", url);
mahuandong authored
830
831
832
833
834
    }

    /* 新增主表 */
    function add() {
        if (receiptId == '') {
835
836
            $.modal.open("未选择入库单", "error/404.html");
        } else {
mahuandong authored
837
            table.set("bootstrap-table1");
838
            var url = detailPrefix + "/add/" + receiptId + "/" + receiptCode;
mahuandong authored
839
            $.modal.open("添加" + table.options.modalName, url);
mahuandong authored
840
841
842
843
844
845
        }
    }

    /* 编辑主表 */
    function edit(id) {
        var url = detailUpdateUrl.replace("{id}", id);
846
        $.modal.open("修改入库单明细", url);
mahuandong authored
847
848
    }
tongzhonghao authored
849
850
    /* 编辑主表 */
    function editHeader(id) {
851
852
        var url = prefix + "/edit/" + id;
        $.modal.open("修改主表", url);
tongzhonghao authored
853
854
    }
mahuandong authored
855
856
    /* 单个删除主表 */
    function remove(id) {
857
        $.modal.confirm("确定删除该条入库单明细信息吗?", function () {
mahuandong authored
858
            var url = $.common.isEmpty(id) ? detailRemoveUrl : detailRemoveUrl.replace("{id}", id);
859
            var data = {"ids": id};
860
            $.operate.submit(url, "post", "json", data);
861
            setTimeout(gotoindex, 1000);//延时3秒执行页面跳转方法
862
863
864
865
            function gotoindex() {
                loadDetail();
            }
mahuandong authored
866
867
868
869
870
        });
    }

    /* 批量删除主表 */
    function batRemove() {
871
        var rows = $("#bootstrap-table1").bootstrapTable('getSelections');
mahuandong authored
872
873
874
875
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
876
        $.modal.confirm("确认要删除选中的" + rows.length + "条数据吗?", function () {
mahuandong authored
877
878
            var url = detailRemoveUrl;
            var ids = "";
879
            for (var i = 0; i < rows.length; i++) {
mahuandong authored
880
881
                ids = ids + rows[i].id + ","
            }
882
            var data = {"ids": ids.substring(0, ids.length - 1)};
883
            $.operate.submit(url, "post", "json", data);
884
            setTimeout(gotoindex, 1000);//延时3秒执行页面跳转方法
885
886
887
888
            function gotoindex() {
                loadDetail();

            }
mahuandong authored
889
890
891
892
893
894
895
896
897
898
899
        });
    }

    //提交
    function submit(url, type, dataType, data) {
        $.modal.loading("正在处理中,请稍后...");
        var config = {
            url: url,
            type: type,
            dataType: dataType,
            data: data,
900
            success: function (result) {
mahuandong authored
901
902
903
                if (result.code == web_status.SUCCESS) {
                    $.modal.msgSuccess(result.msg);
                    loadDetail();
904
                } else {
mahuandong authored
905
906
907
908
909
910
911
912
913
914
                    $.modal.alertError(result.msg);
                }
                $.modal.closeLoading();
            }
        };
        $.ajax(config)
    }

    /* 打印*/
    function receiptDetailPrint() {
915
        var rows = $("#bootstrap-table1").bootstrapTable('getSelections');
mahuandong authored
916
917
918
919
920
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
        var ids = "";
921
        for (var i = 0; i < rows.length; i++) {
mahuandong authored
922
923
924
925
            ids = ids + rows[i].id + ","
        }

        var url = detailPrefix + "/report/" + ids;
926
        $.modal.open("入库铭牌打印", url);
927
    }
928
929
930

    /* 收货 */
    function Toreceiving(code) {
931
932
933
        let storage = window.localStorage;
        storage.receiving_code = code;
        createMenuItem(ctx + "receipt/receiving", "收货");
934
935
        parent.$('.tabReload').click();
    }
936
mahuandong authored
937
938
939
940
    /* 点击明细面板 */
    $("#myTab li:eq(1)").click(function () {
        detail(receiptId, "");
    });
mahuandong authored
941
mahuandong authored
942
943
944
945
    /* 点击主表面板 */
    $("#myTab li:eq(0)").click(function () {
        $.ajax({
            url: prefix + "/list",
946
947
            type: "post",
            success: function (value) {
mahuandong authored
948
949
950
951
952
                $("#bootstrap-table").bootstrapTable('refresh', value.data);
            }
        })
    });
953
954
    function submitReview() {
        var rows = $("#bootstrap-table").bootstrapTable('getSelections');
955
956
957
958
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
mahuandong authored
959
960
        var url = prefix + "/submitReview";
961
        var ids = "";
962
        for (var i = 0; i < rows.length; i++) {
963
            ids = ids + rows[i].id + ","
mahuandong authored
964
        }
965
        var data = {"ids": ids.substring(0, ids.length - 1)};
966
967
968
        $.operate.submit(url, "post", "json", data);
    }
969
    //通过审核
970
    function approval() {
971
        var rows = $("#bootstrap-table").bootstrapTable('getSelections');
972
973
974
975
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
976
        var url = prefix + "/approval";
977
        var ids = "";
978
        for (var i = 0; i < rows.length; i++) {
979
            ids = ids + rows[i].id + ","
mahuandong authored
980
        }
981
        var data = {"ids": ids.substring(0, ids.length - 1), "approval": 100};
982
        $.operate.submit(url, "post", "json", data);
mahuandong authored
983
    }
984
985

    function arrival(id) {
986
        var url = prefix + "/arrival/" + id;
987
988
989
990
        $.modal.open("预约到货" + $.table._option.modalName, url);
    }

    function check(id) {
991
992
        var url = prefix + "/check";
        var data = {"id": id};
993
994
        $.operate.submit(url, "post", "json", data);
    }
huhai authored
995
996
    function arrivalNotice(id) {
997
998
        var url = prefix + "/arrivalNotice";
        var data = {"id": id};
999
1000
        $.operate.submit(url, "post", "json", data);
    }
huhai authored
1001
1002
    function addPool() {
1003
        var rows = $("#bootstrap-table").bootstrapTable('getSelections');
1004
1005
1006
1007
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
1008
        var url = prefix + "/addPool";
1009
        var ids = "";
1010
        for (var i = 0; i < rows.length; i++) {
1011
1012
            ids = ids + rows[i].id + ","
        }
1013
        var data = {"ids": ids.substring(0, ids.length - 1), "approval": 100};
1014
1015
        $.operate.submit(url, "post", "json", data);
    }
huhai authored
1016
肖超群 authored
1017
    function backERP(id) {
1018
1019
        var url = prefix + "/backERP";
        var data = {"id": id};
mahuandong authored
1020
1021
        $.operate.submit(url, "post", "json", data);
    }
1022
1023
1024
1025

    function queryParams(params) {
        var curParams = {
            // 传递参数查询参数
1026
1027
1028
1029
1030
1031
1032
1033
            pageSize: params.limit,
            pageNum: params.offset / params.limit + 1,
            searchValue: params.search,
            orderByColumn: params.sort,
            isAsc: params.order,
            status: status,
            statusFirst: statusFirst,
            statusLast: statusLast
1034
1035
1036
        };
        return curParams
    }
DESKTOP-AO0VKC8\mahua authored
1037
1038
1039

    function crossLocation() {
        let rows = $.table.selectColumns("id");
1040
1041
1042
1043
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
1044
1045
        let url = prefix + "/crossLocation";
        let data = {"ids": rows.join()};
DESKTOP-AO0VKC8\mahua authored
1046
1047
        $.operate.submit(url, "post", "json", data);
    }
1048
1049

    function receive(id) {
1050
        var url = prefix + "/huichuan";
1051
        var ids = id;
1052
        var data = {"ids": ids};
1053
1054
        $.operate.submit(url, "post", "json", data);
    }
1055
1056
    function getReceiptSI() {
1057
        $.modal.open("产成品入库扫描", prefix + "/getReceiptSI")
1058
    }
xumiao authored
1059
1060
1061
1062
1063
1064
1065

    function yueku() {
        let rows = $.table.selectColumns("id");
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
1066
1067
        let url = prefix + "/yueku";
        let data = {"ids": rows.join()};
xumiao authored
1068
1069
        $.operate.submit(url, "post", "json", data);
    }
1070
</script>
tangying authored
1071
</body>
1072
</html>