1
wtt
2024-05-24 1d46d1f94851c843813961c0fc0ac61d60596e9c
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; 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, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/grwebapp.js"></script>
    <style>
        .layui-form-select .layui-input {
            padding-right: 0px;
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <div class="layui-card" style="padding: 1px">
                <div class="layui-card-body" style="padding: 1px;">
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">唯一条码</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBarCode_Pack" id="HBarCode_Pack">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="单据号" id="单据号">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">条码类型</label>
                                    <div class="layui-input-block">
                                        <!--<input type="text" class="layui-input" name="tmlx" id="tmlx">-->
                                        <select name=" tmlx" id="tmlx">
                                            <option value="">全部</option>
                                            <option value="流转卡号">流转卡号</option>
                                            <option value="镭雕条码">镭雕条码</option>
                                        </select>
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
 
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">生产任务单</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">制单人</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HMaker" id="HMaker">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">条码</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo">
                                        </div>
                                    </div>
                                    <div class="layui-row" style="padding: 10px 0; margin-left: 4%;">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 75px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">-</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="date" class="layui-input" lay-verify="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 75px;">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-row" style="margin-top: 5px; margin-left: 4%;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">过滤</label>
                                        <div class="layui-input-block">
                                            <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
                                            <option value="0" selected="selected"></option>
                                            <option value="=">=</option>
                                            <option value=">=">>=</option>
                                            <option value=">">></option>
                                            <option value="<="><=</option>
                                            <option value="<"><</option>
                                            <option value="<>"><></option>
                                            <option value="7">包含</option>
                                            <option value="8">左包含</option>
                                            <option value="9">右包含</option>
                                            <option value="10">不包含</option>
                                        </select>
                                    </div>
                                    <div class="layui-inline">
                                        <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
                                    </div>
                                </div>
                                <!--<div class="layui-colla-content">
        <div class="layui-inline">
            <div class="layui-inline">
                <span>其他条件></span>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">产品名称</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="hname" id="hname">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">产品代码</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="hnumber" id="hnumber">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">规格型号</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="hmodel" id="hmodel">
            </div>
        </div>
    </div>-->
                            </div>
                        </div>
                        <table class="layui-form-item" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container layui-form-item">
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="Print" id="Print">
                                    <i class="layui-icon layui-icon-file"></i>斯莫尔打印
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="Print1" id="Print1">
                                    <i class="layui-icon layui-icon-file"></i>普菲特打印
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="BtnDel" id="BtnDel">
                                    <i class="layui-icon layui-icon-file"></i>删除
                                </button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!--<script src="../../../layuiadmin/layui/layui.js"></script>-->
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig2.js"></script>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage','laydate'], function () {
            var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
            , element = layui.element
            , laypage = layui.laypage
            , laydate = layui.laydate
            , util = layui.util;
            //var sWhere = " 产品代码 = 'BX0002'";
            var sWhere = "";
 
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                ,height: 'full-50' 
                , page: true
                , limit: 50
                , limits: [50, 500, 5000, 20000]
                , cols: [[
                    {type:'radio'}
                    , { field: 'HInterID', title: 'ID', sort: true, width: 100 }
                    , { field: '项目号', title: '项目号', sort: true, width: 100 }
                    ,{ field: '唯一条码', title: '唯一条码', sort: true, width: 170 }
                    //, { field: '扫码日期', title: '扫码日期', sort: true, width: 200, templet: "<div>{{layui.util.toDateString(this.扫码日期, 'yyyy-MM-dd')}}</div> " }
                    , {
                        field: '扫码日期', title: '包装日期', sort: true, width: 110, templet: function (d) {
                            if (d.扫码日期 == null) {
                                return "";
                            }
                            return util.toDateString(d.扫码日期, "yyyy-MM-dd");
                        }
                    }
                    , { field: '条码', title: '条码', sort: true, width: 170 }
                    , { field: '条码类型', title: '条码类型', sort: true, width: 110 }
                    , { field: '单据号', title: '单据号', width: 140 }
                    , { field: '生产任务单单号', title: '生产任务单单号', width: 170 }
                    , { field: '白标号', title: '白标号', width: 90 }
                    , { field: '物料编码', title: '物料编码', width: 150 }
                    , { field: '打包数量', title: '打包数量', width: 90 }
                    , { field: '规格型号', title: '规格型号', width: 110 }
                    , { field: '物料名称', title: '物料名称', width: 150 }
                    , { field: '不满箱标识', title: '不满箱标识', width: 101 }
                    , { field: '数量制单人', title: '制单人', width: 110 }
                    , {
                        field: '制单日期', title: '制单日期', width: 110, templet: function (d) {
                            if (d.制单日期 == null) {
                                return "";
                            }
                            return util.toDateString(d.制单日期, "yyyy-MM-dd HH:mm:ss");
                        }
                    }
                ]], parseData: function (res) {
                    debugger;
                    var data = res.data;
                    for (index in data) {
                        var 扫码日期 = data[index].扫码日期;
                        var time = new Date(扫码日期);
                        data[index].扫码日期 = time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
                    }
                }
            };
 
 
            //进入页面显示的缓存列表
            layer.load(3);
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL1() + '/LEMS/MES_ProductionLinePackagingList_Json',
                type: "GET",
                data: { "sWhere": sWhere },
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
 
                        if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                            ColFilter();
                        }
                        layer.closeAll("loading");
                    } else {
                        layer.closeAll("loading");
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.alert("接口失效!", { icon: 5 });
                }
            }); 
 
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 1), "yyyy-MM-dd"));//开始日期
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));//结束日期
                $("#HBarCode_Pack").val("");//唯一条码
                $("#HICMOBillNo").val("");//条码
                $("#tmlx").val("");//条码类型
                $("#HBillNo").val("");//生产任务单单号
                $("#HMaker").val("");//数量制单人
                $("#单据号").val("");//单据号
                $("#ColContent").val("");
                $("#ColName").val("0");
                $("#Comparator").val("0");
                form.render('select');
                $("#btnSearch").click();
            });
 
            //查询按钮
            form.on('submit(btnSearch)', function (data) {//选择仓位
                var HBarCode_Pack = $("#HBarCode_Pack").val();//唯一条码
                var HICMOBillNo = $("#HICMOBillNo").val();//条码
                var tmlx = $("#tmlx").val();//条码类型
                var HBillNo = $("#HBillNo").val();//生产任务单单号
                var HMaker = $("#HMaker").val();//数量制单人
                var 单据号 = $("#单据号").val();//数量制单人
                var HBeginDate = $("#HBeginDate").val();//开始日期
                var HEndDate = $("#HEndDate").val();//结束日期
                var ColName = $("#ColName").val();//复选框
                var Comparator = $("#Comparator").val()
                var ColContent = $("#ColContent").val();
 
                if (ColName != 0 && Comparator != 0) {
                    var com = "";
                    switch (Comparator) {
                        case "7":
                            com = "like'%" + ColContent + "%'";
                            break;
                        case "8":
                            com = "like'%" + ColContent + "'";
                            break;
                        case "9":
                            com = "like'" + ColContent + "%'";
                            break;
                        case "10":
                            com = "not like'%" + ColContent + "%'";
                            break;
                        default:
                            com = "" + Comparator + "'" + ColContent + "'";
                            break;
                    }
                    sWhere += " and " + ColName + " " + com;
                }
 
                if (HBarCode_Pack) {
                    sWhere += " and 唯一条码 like '%" + HBarCode_Pack + "%'";
                }
                if (HICMOBillNo) {
                    sWhere += " and 条码 like '%" + HICMOBillNo + "%'";
                }
                if (tmlx) {
                    sWhere += " and 条码类型 like '%" + tmlx + "%'";
                }
                if (HBillNo) {
                    sWhere += " and 生产任务单单号 like '%" + HBillNo + "%'";
                }
                if (HMaker) {
                    sWhere += " and 数量制单人 like '%" + HMaker + "%'";
                }
                if (单据号) {
                    sWhere += " and 单据号 like '%" + 单据号 + "%'";
                }
                if (HBeginDate != "") {
                    sWhere += " and 制单日期 >= '" + HBeginDate + "'";
                }
                if (HEndDate != "") {
                    sWhere += " and 制单日期 <= '" + HEndDate + "'";
                }
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL1() + '/LEMS/MES_ProductionLinePackagingList_Json',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
 
                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                                ColFilter();
                            }
                            layer.alert("查询成功", { icon: 1 });
                        } else {
                            option.data = [];
                            table.render(option);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
                sWhere = "";//调用接口后清空sWhere缓存
            });
            //获取选中行数据
            table.on('row(mainTable)', function (obj) {
                //标注选中样式
                obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
            });
            //打印按钮
            //form.on('submit(Print)', function (obj) {//退出
            //    var checkStatus = table.checkStatus("mainTable"); //获取选中行状态
            //    var linterid = checkStatus.data[0].HInterID;
            //    ////打开打印模板
            //    ////var linterid = $("#HInterID").val();
            //    ////var linterid = "28973";
            //    //var Type = "HBarCodePrint";
            //    //var OpenTmp = "包装单物料标识卡(网页版)";
            //    ////var ReportViewer = document.getElementById("ReportViewer");
            //    //window.open("../../views/BaseSet/HBarPlanPrint.html?linterid=" + linterid.toString() + "&Type=" + Type.toString() + "&OpenTmp=" + OpenTmp.toString());
 
 
            //    var sWhere = "select * from h_v_SRM_BarCodeBillList where HItemID in(" + linterid + ") order by 物料代码";
 
            //    $.ajax({
            //        type: "GET",
            //        url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList", //方法所在页面和方法名
            //        async: true,
            //        data: { "sWhere": sWhere },
            //        success: function (data) {
            //            if (data.count == 1) { // 说明验证成功了,
 
            //                if (data.data.length != 0) {
            //                    var dataPrint = [];
            //                    dataPrint.push({ "产品名称": data.data[0]["产品名称"], "条码编号": data.data[0]["条码编号"], "数量": data.data[0]["数量"], "日期": data.data[0]["日期"], "生产任务单": data.data[0]["生产任务单"], "流转卡编号": data.data[0]["流转卡编号"], "自定义字段": data.data[0]["自定义字段"], "项目编号": data.data[0]["项目编号"] }
            //                    );
 
            //                    var Customer = {
            //                        "Table": dataPrint
            //                    }
 
            //                    var args = {
            //                        type: "print",
            //                        showOptionDlg: false, //如果不显示打印对话框而直接打印,将此行注释去掉即可
            //                        report: urlAddRandomNo("../../views/grf/包装单物料标识卡(网页版).grf"),
            //                        data: Customer
            //                    };
            //                    //var args = {
            //                    //    report: urlAddRandomNo("../../views/grf/包装单物料标识卡(网页版).grf"),
            //                    //    data: Customer
            //                    //};
            //                    webapp_ws_ajax_run(args);
            //                } else {
            //                    layer.msg("查无数据!");
            //                }
 
            //            }
            //            else {
            //                layer.msg(data.Message, { icon: 5 });
            //            }
            //            layer.closeAll("loading");
            //        },
            //        error: function (err) {
            //            layer.msg("错误:" + err, { icon: 5 });
            //        }
            //    })
              
            //});
 
            form.on('submit(Print)', function (obj) {//退出
                var checkStatus = table.checkStatus("mainTable"); //获取选中行状态
                var linterid = checkStatus.data[0].HInterID;
                ////打开打印模板
                ////var linterid = $("#HInterID").val();
                ////var linterid = "28973";
                //var Type = "HBarCodePrint";
                //var OpenTmp = "包装单物料标识卡(网页版)";
                ////var ReportViewer = document.getElementById("ReportViewer");
                //window.open("../../views/BaseSet/HBarPlanPrint.html?linterid=" + linterid.toString() + "&Type=" + Type.toString() + "&OpenTmp=" + OpenTmp.toString());
 
 
                var sWhere = "select  a.HBarCode_White HBarCode_White,temp.HSupPartName HSupPartName,temp.HSupBarCodeNumber MFGPartNumber,temp.HCountryType CountryofOrigin,(select REPLACE(item, 'Q', '') from split(a.HBarCode_White, ':') where id = 6) Quantity, temp.HGrossWeight GrossWeight, temp.HPARTNAME PartName , (select item from split(a.HBarCode_White, ':') where id = 2) ContentLabelID , temp.HSupNumber Supplier, REPLACE(convert(varchar(10), GETDATE(), 20), '-', '') + ' ' + convert(varchar(5), GETDATE(), 24) MFGDate , REPLACE(convert(varchar(10), GETDATE(), 20), '-', '') SupplierLotCode , (select REPLACE(item, 'P', '') from split(a.HBarCode_White, ':') where id = 4) BBM   from Sc_PackUnionBillMain a left join  Gy_Material m on a.HMaterID = m.HItemID left join Sc_PackUnionBillBarCode_temp temp on m.HNumber = temp.HMaterNumber where a.HInterID=" + linterid;
 
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList", //方法所在页面和方法名
                    async: true,
                    data: { "sWhere": sWhere },
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
 
                            if (data.data.length != 0) {
                                var dataPrint = [];
                                dataPrint.push(data.data[0]
                                    //{ "产品名称": data.data[0]["产品名称"], "条码编号": data.data[0]["条码编号"], "数量": data.data[0]["数量"], "日期": data.data[0]["日期"], "生产任务单": data.data[0]["生产任务单"], "流转卡编号": data.data[0]["流转卡编号"], "自定义字段": data.data[0]["自定义字段"], "项目编号": data.data[0]["项目编号"] }
                                );
 
                                var Customer = {
                                    "Table": dataPrint
                                }
 
                                var args = {
                                    type: "print",
                                    showOptionDlg: false, //如果不显示打印对话框而直接打印,将此行注释去掉即可
                                    report: urlAddRandomNo("../../views/grf/白标打印.grf"),
                                    data: Customer
                                };
                                //var args = {
                                //    report: urlAddRandomNo("../../views/grf/包装单物料标识卡(网页版).grf"),
                                //    data: Customer
                                //};
                                webapp_ws_ajax_run(args);
                            } else {
                                layer.msg("查无数据!");
                            }
 
                        }
                        else {
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        layer.msg("错误:" + err, { icon: 5 });
                    }
                })
 
            });
 
            //打印按钮
            form.on('submit(Print1)', function (obj) {//退出
                var checkStatus = table.checkStatus("mainTable"); //获取选中行状态
                var linterid = checkStatus.data[0].HInterID;
 
 
                var sWhere = "select * from h_v_SRM_BarCodeBillList where HItemID in(" + linterid + ") order by 物料代码";
 
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList", //方法所在页面和方法名
                    async: true,
                    data: { "sWhere": sWhere },
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
 
                            if (data.data.length != 0) {
                                var dataPrint = [];
                                dataPrint.push({ "产品名称": data.data[0]["产品名称"], "条码编号": data.data[0]["条码编号"], "数量": data.data[0]["数量"], "日期": data.data[0]["日期"], "生产任务单": data.data[0]["生产任务单"], "流转卡编号": data.data[0]["流转卡编号"], "自定义字段": data.data[0]["自定义字段"], "项目编号": data.data[0]["项目编号"] }
                                );
 
                                var Customer = {
                                    "Table": dataPrint
                                }
 
                                var args = {
                                    type: "print",
                                    showOptionDlg: false, //如果不显示打印对话框而直接打印,将此行注释去掉即可
                                    report: urlAddRandomNo("../../views/grf/包装单物料标识卡(网页版)2.grf"),
                                    data: Customer
                                };
                                //var args = {
                                //    report: urlAddRandomNo("../../views/grf/包装单物料标识卡(网页版).grf"),
                                //    data: Customer
                                //};
                                webapp_ws_ajax_run(args);
                            } else {
                                layer.msg("查无数据!");
                            }
 
                        }
                        else {
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        layer.msg("错误:" + err, { icon: 5 });
                    }
                })
 
            });
 
            //删除
            form.on('submit(BtnDel)', function (data) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var HInterID = data[0].HInterID.toString();
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                            url: GetWEBURL1() + '/LEMS/DelMES_ProductionLinePackagingList',
                            type: "GET",
                            data: { "HInterID": HInterID },
                            success: function (data1) {
                                if (data1.count == 1) {
                                    layer.msg(data1.Message);
                                } else {
                                    layer.alert(data1.code + data1.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口失效!", { icon: 5 });
                            }
                        });
                    })
                } else {
                    layer.msg('请选择一行数据删除!');
                }
            });
 
            //列明显示下拉框
            function ColFilter() {
                var Organization = '<option  value="0" selected="selected" ></option>';
                for (var i = 1; i < option.cols[0].length; i++) {
                    if (option.cols[0][i].hide != true) {
                        Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
                    }
                }
                $("#ColName").empty();
                $("#ColName").append(Organization);
                form.render('select');
            }
 
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
 
 
            //以上是layui模块
        });
 
        function Print(data) {
            console.log("data=", data);
        }
 
 
    </script>
 
</body>
</html>