czt
2025-12-03 53fab3f56e8335fbf39fc07c4e10f6abdb0505bb
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
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
//当前节点 入库质检
var layer;
var form;
var table;
var page = 1;
var limit = 15;
var recordData = null;
var selectData = null;  //单选的信息
var snapData;//系统抓拍对象信息
var timerWeight;
var img1, img2, img3;// 页面中的图片上传名称
 
$(function () {
    layui.use(['layer', 'laydate', 'form', 'table'], function () {
        layer = layui.layer;
        form = layui.form;
        table = layui.table;
        var laydate = layui.laydate;
 
        laydate.render({
            elem: '#start',
            theme: '#7b8e9f',
            value: startTime
        });
 
        laydate.render({
            elem: '#end',
            theme: '#7b8e9f',
            value: endTime
        });
 
        laydate.render({
            elem: '#foodYear',
            theme: '#7b8e9f',
            type: 'year'
        });
 
        // 监听行工具事件
        table.on('tool(tableData)', function (obj) {
            if (obj.event === 'edit') {
                //展示弹窗
                afreshGetData(obj);
            }
        });
 
        // 监听仓库选择,选择后自动调用仓库的粮品种和产地信息
        form.on('select(select_depotId)', function (obj) {
            updateFoodVarietyByDepot(obj.value);
        });
        // 初始化表单数据
        renderTable();
    });
 
    //显示称重弹窗流程
    showProgress();
 
    // 监听比例值填写
    $(".per").blur(function () {
        deAutoByPer();
    });
 
    // 监听比例值填写
    $(".weight").blur(function () {
        deAutoByWeight();
    });
    //初始化WebSocket
    // initWS(deptId, bizType, progress, userId);
});
 
window.onload = function () {
    //自动连接地磅信息,2.5秒获取一次地磅重量信息
    clearInterval(timerWeight);
    timerWeight = setInterval(function () {
        flushWeight();
    }, 2500);
 
    // 加载视频
    initVideo(lprDto, snapDto1, snapDto2);
 
    //设置地磅
    $("#scaleName").val(weightDto.sort);
 
    //监听地磅选择
    $("#scaleName").change(function () {
        layer.confirm('调整地磅需重新加载页面,确定调整?', {
            btn: ['确定', '取消']
        }, function () {
            updateWeight();
        });
    });
};
 
//根据条件查询数据
function flushData() {
    var index = layer.load();
    var param = form.val("form-param");
    table.reload('tableData', {
        url: "/basic/inout/page-inout-data",
        where: param
    });
    $("thead tr").css({
        "border-bottom": "2px solid #53adce",
        "background": "#eff4f6"
    });
    layer.close(index);
}
 
// 渲染表单数据
function renderTable() {
    var param = form.val("form-param");
    // 清空数据
    $("#tableData").empty();
    table.render({
        elem: '#tableData',
        url: '/basic/inout/page-inout-data',
        page: true,
        limit: limit,
        even: true,
        method: 'POST',
        contentType: "application/json;charset=UTF-8",
        cols: [[{
            type: 'numbers',
            title: '序号'
        }, {
            field: 'id',
            title: '单据号',
            width: '13%',
            style: 'color: #f67d06;font-weight: bold'
        }, {
            field: 'plateNum',
            title: '车牌',
            width: '11%',
            style: 'font-weight: bold'
        }, {
            field: 'type',
            title: '类型',
            templet: function (item) {
                var result = item.type;
                return result == "IN" ? "入库" : "出库";
            }
        }, {
            field: 'customerName',
            title: '往来单位'
        }, {
            field: 'depotId',
            title: '装卸仓库',
            width: '10%',
            templet: function (item) {
                var result = item.depotId;
                $.each(listDepot, function (index, data) {
                    if (item.depotId == data.id) {
                        result = data.name;
                        return true;
                    }
                });
                return result == null ? "" : result;
            }
        }, {
            field: 'foodVariety',
            title: '品种',
            width: '10%',
            templet: function (item) {
                var result = item.foodVariety;
                $.each(listFoodVariety, function (index, data) {
                    if (item.foodVariety == data.code) {
                        result = data.name;
                        return true;
                    }
                });
                return result == null ? "" : result;
            }
        }, {
            field: 'progress',
            title: '流程进度',
            width: '10%',
            style: 'font-weight: bold',
            templet: function (item) {
                return INOUT_PROGRESS_MSG(item.progress);
            }
        }, {
            field: '',
            title: '操作',
            width: '9%',
            toolbar: "#barControl"
        }]],
        where: param,
        parseData: function (res) {
            if ("0000" === res.code) {
                return {
                    "code": "0",
                    "msg": res.msg,
                    "count": res.data.total,
                    "data": res.data.records
                }
            } else {
                return {
                    "code": "1",
                    "msg": res.msg
                }
            }
        }
    });
    $("thead tr").css({
        "border-bottom": "2px solid #53adce",
        "background": "#eff4f6"
    });
}
 
/*-----------------------弹窗显示渲染-开始------------------------------*/
 
//操作前,重新流水数据当前信息
function afreshGetData(obj) {
    var index = layer.load();
    recordData = null;
    var data = obj.data;
    var param = {
        userId: data.userId,
        plateNum: data.plateNum,
        id: data.id
    };
    $.ajax({
        type: "POST",
        url: "/basic/inout/inout-query",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(param),
        success: function (result) {
            if (result.code != "0000") {
                layer.alert("请刷新页面后,重新操作!!");
            } else {
                recordData = result.data;
                showWindows(recordData.progress);
            }
            layer.close(index);
        },
        error: function () {
            layer.close(index);
            layer.alert("请刷新页面后,重新操作!!");
        }
    });
}
 
//显示流程操作弹窗
function quickRegister() {
    //登记按钮放开
    $("#btn_register").css("display", "block");
    $("#text-info").removeClass("text-info");
    //称重操作弹窗
    var pro = '登记';
    updateEditAndProgress();
    flushPage();
    layer.open({
        type: 1,
        title: pro,
        area: ['1283px', '815px'],
        cancel: function (index, layero) {
            $("#weightDetail").css("display", "none");
        },
        shade: 0,
        scrollbar: 0,
        content: $('#weightDetail'),
        offset: ['16px', '16px']
    });
}
 
//显示流程操作弹窗
function showWindows(progress) {
 
    //登记按钮放开
    $("#btn_register").css("display", "none");
    $("#text-info").addClass("text-info");
    //称重操作弹窗
    var pro = '空车称重';
    if (progress == 'WEIGHT_FULL') {
        pro = '满车称重';
    }
    updateEditAndProgress();
    flushPage();
    layer.open({
        type: 1,
        title: "称重" + pro + " - 单号:" + recordData.id,
        area: ['1283px', '815px'],
        cancel: function (index, layero) {
            $("#weightDetail").css("display", "none");
        },
        shade: 0,
        scrollbar: 0,
        content: $('#weightDetail'),
        offset: ['16px', '16px']
    });
}
 
//称重弹窗中流程环节显示
function showProgress() {
    if (!inoutProgress) {
        return;
    }
    if (inoutProgress.indexOf("REGISTER") == -1) {
        $("#progress-register").css("display", "none");
    }
    if (inoutProgress.indexOf("WEIGHT_FULL") == -1) {
        $("#progress-fullWeight").css("display", "none");
    }
    if (inoutProgress.indexOf("HANDLE") == -1) {
        $("#progress-hand").css("display", "none");
    }
    if (inoutProgress.indexOf("WEIGHT_EMPTY") == -1) {
        $("#progress-emptyWeight").css("display", "none");
    }
    if (inoutProgress.indexOf("CARD_BACK") == -1) {
        $("#progress-cardBack").css("display", "none");
    }
}
 
//称重弹窗中更新流程节点
function updateEditAndProgress() {
    if (recordData) {
        if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
            $("#emptyWeight").removeClass("rkbk-search-input");
            $("#emptyWeight").attr("disabled", false);
 
            $("#progress-hand").removeClass("active");
            $("#progress-fullWeight").removeClass("active");
 
            $("#fullWeight").addClass("rkbk-search-input");
            $("#fullWeight").attr("disabled", true);
        }
 
        if (InoutProgress.WEIGHT_FULL == recordData.progress) {
            $("#fullWeight").removeClass("rkbk-search-input");
            $("#fullWeight").attr("disabled", false);
 
            $("#progress-hand").addClass("active");
            $("#progress-fullWeight").addClass("active");
 
            $("#emptyWeight").addClass("rkbk-search-input");
            $("#emptyWeight").attr("disabled", true);
        }
    } else {
        $("#fullWeight").addClass("rkbk-search-input");
        $("#fullWeight").attr("disabled", true);
 
        $("#emptyWeight").addClass("rkbk-search-input");
        $("#emptyWeight").attr("disabled", true);
 
        $("#progress-hand").removeClass("active");
        $("#progress-fullWeight").removeClass("active");
    }
}
 
/*-----------------------弹窗显示渲染-结束------------------------------*/
 
/*-----------------------称重操作-开始------------------------------*/
 
//自动连接地磅信息,2.5秒获取一次地磅重量信息
function timerGetWeight() {
    clearInterval(timerWeight);
    timerWeight = setInterval(function () {
        flushWeight();
    }, 2500);
}
 
//发送请求获取称重数据
function flushWeight() {
    var ip = "127.0.0.1";
    if (weightDto.ip) {
        ip = weightDto.ip;
    }
    var port = "9111";
    if (weightDto.port) {
        port = weightDto.port;
    }
    var sn = "WEIGHT";
    if (weightDto.sn) {
        sn = weightDto.sn;
    }
    var url = "http://" + ip + ":" + port + "/" + sn;
    $.ajax({
        type: "GET",
        async: true,
        timeout: 2000,
        url: url,
        data: {},
        dataType: "json",
        success: function (json) {
            var data = json.content;
            if (!data) data = 0.0;
            weightDto.weight = data;
            $("#weightValue").text(data);
            $("#img_scale_statule").attr("src", "/img/web/inout/icon-gree.png");
        },
        error: function () {
            weightDto.weight = 0.0;
            $("#weightValue").text("0.0");
            $("#img_scale_statule").attr("src", "/img/web/inout/icon-red.png");
        }
    });
}
 
//点击称重
function weight() {
    // 没有业务数据不可执行
    if (!recordData) {
        layer.alert("没有查询到业务数据,执行被拒绝!!");
        return;
    }
    // 如果是空车称重
    if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
        form.val("form-weight", {
            emptyWeight: weightDto.weight
        });
    }
    // 如果是满车称重
    if (InoutProgress.WEIGHT_FULL == recordData.progress) {
        form.val("form-weight", {
            fullWeight: weightDto.weight
        });
    }
    form.render();
    snapData == null;
 
    //点击称重时候自动抓拍数据
    layer.msg("系统自动抓拍保留记录……");
    snapData = {
        companyId: companyId,
        deptId: deptId,
        bizTag: recordData.progress,
        bizType: bizType,
        plateNum: recordData.plateNum + "-" + recordData.carNum,
 
        id1: (null != lprDto) ? lprDto.id : null,
        id2: (null != snapDto1) ? snapDto1.id : null,
        id3: (null != snapDto2) ? snapDto2.id : null
    };
 
    console.log(snapData);
    //当前AJAX服务为同步服务,返回数据包装照片信息
    var index = layer.load();
    $.ajax({
        sync: false,
        type: "POST",
        url: "../../basic/inout/snap-img",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(snapData),
        success: function (result) {
            layer.close(index);
            if (result.code != "0000") {
                layer.alert(result.msg);
            } else {
                snapData = result.data;
            }
        },
        error: function () {
            layer.close(index);
            layer.msg("后台调用截图失败,请重新尝试!!");
        }
    });
    //二次称重后,自动调用下自动计算
    if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
        deAutoByPer();
    }
    flushBtn("btn-weight");
}
 
// 自动计算,注意:出库水分是 +,入库水分需要 -
function deAutoByPer() {
    var curData = form.val("form-weight");
 
    var netWeight = 0, deImpurity = 0, deWet = 0, deSum = 0, settleWeight = 0;
 
    if (curData.fullWeight == 0 || curData.emptyWeight == 0) {
        return;
    }
    // 计算净重
    netWeight = curData.fullWeight - curData.emptyWeight;
 
    if (netWeight <= 0) {
        layer.msg("净重小于等于0,当前计算不正确!");
        return;
    }
 
    // 杂质扣重
    if (curData.impurity > 0) {
        deImpurity = (netWeight * curData.impurity / 100.00).toFixed(0);
    }
    // 水分增重
    if (curData.wet > 0) {
        deWet = (netWeight * curData.wet / 100.00).toFixed(0);
    }
 
 
    // 总扣重
    deSum = Number(deImpurity) + Number(curData.deOther)
        + Number(curData.deHandle);
    deSum = deSum.toFixed(0);
 
    // 结算净重,把水分添加近来
    settleWeight = Number(netWeight) - Number(deSum) + Number(deWet);
    settleWeight = settleWeight.toFixed(0);
 
    form.val("form-weight", {
        netWeight: netWeight,
        deImpurity: deImpurity,
        deWet: deWet,
        deSum: deSum,
        settleWeight: settleWeight
    });
    form.render();
}
 
// 自动计算
function deAutoByWeight() {
    var curData = form.val("form-weight");
 
    var netWeight = 0, impurity = 0, wet = 0, deSum = 0, settleWeight = 0;
 
    if (curData.fullWeight == 0 || curData.emptyWeight == 0) {
        return;
    }
    // 净重
    netWeight = curData.fullWeight - curData.emptyWeight;
 
    if (netWeight <= 0) {
        layer.msg("净重小于等于0,当前计算不正确!");
        return;
    }
 
    // 杂质-百分比
    if (curData.deImpurity > 0) {
        impurity = (curData.deImpurity / netWeight * 100).toFixed(2);
    }
    // 水分 -百分比
    if (curData.deWet > 0) {
        wet = (curData.deWet / netWeight * 100).toFixed(2);
    }
 
    // 总扣重= 杂质扣重 + 不完善扣重 + 气体扣重 + 值仓扣重 + 包装扣重
    deSum = Number(curData.deImpurity)
        + Number(curData.deOther) + Number(curData.deHandle);
 
    deSum = deSum.toFixed(0);
 
    // 结算净重,把水分添加近来
    settleWeight = Number(netWeight) - Number(deSum) + Number(curData.deWet);
    settleWeight = settleWeight.toFixed(0);
 
    form.val("form-weight", {
        netWeight: netWeight,
        impurity: impurity,
        wet: wet,
        deSum: deSum,
        settleWeight: settleWeight
    });
    form.render();
}
 
//根据当前操作的按钮ID更新其他按钮状态
function flushBtn(btnId) {
    if ("btn-weight" == btnId) {// 称重后可以点击完成称重
        $("#btn-submit").removeClass("layui-btn-disabled");
        $("#btn-submit").attr("disabled", false);
    }
    if ("btn-submit" == btnId) {
        $("#btn-submit").addClass("layui-btn-disabled");
        $("#btn-submit").attr("disabled", true);
        flushData();
        if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {// 出库,如果是空车称重,完成收直接刷新页面
            layer.closeAll();
        } else {
            // 完成称重后控制按钮
            $("#btn-weight").addClass("layui-btn-disabled");
            $("#btn-weight").attr("disabled", true);
 
            $("#btn-printBill").removeClass("layui-btn-disabled");
            $("#btn-printBill").attr("disabled", false);
            addDisabled();
        }
    }
    if ("btn-printBill" == btnId) {// 打印过磅单,说明业务完成
        $("#btn-weight").removeClass("layui-btn-disabled");
        $("#btn-weight").attr("disabled", false);
 
        $("#btn-submit").addClass("layui-btn-disabled");
        $("#btn-submit").attr("disabled", true);
 
        $("#btn-printBill").addClass("layui-btn-disabled");
        $("#btn-printBill").attr("disabled", true);
        layer.closeAll();
        flushData();
    }
}
 
//更改扣重信息框不可编辑
function addDisabled() {
    //杂质
    $("#impurity").attr("disabled", true);
    $("#deImpurity").attr("disabled", true);
    //水分
    $("#wet").attr("disabled", true);
    $("#deWet").attr("disabled", true);
    //值仓
    $("#deHandle").attr("disabled", true);
    //其他
    $("#deOther").attr("disabled", true);
}
 
//恢复扣重信息框编辑状态
function delDisabled() {
    //杂质
    $("#impurity").attr("disabled", false);
    $("#deImpurity").attr("disabled", false);
    //水分
    $("#wet").attr("disabled", false);
    $("#deWet").attr("disabled", false);
    //值仓
    $("#deHandle").attr("disabled", false);
    //其他
    $("#deOther").attr("disabled", false);
}
 
// 点击打印,系统判断是否已经执行完成,如果已经完成,直接打印,如果未完成则先执行完成
function printBill() {
    if (!recordData) {
        layer.alert("没有获取到业务数据,不支持打印!");
        return;
    }
    // 从后台获取模版并打印
    var data = form.val("form-weight");
    // 合并更新當前编辑数据
    Object.assign(recordData, data);
 
    printBillStep2();
};
 
// 点击打印,先执行系统默认执行完成卡回收
function printBillStep2() {
    var index = layer.load();
    $.ajax({
        type: "POST",
        url: "../../basic/inout-report/inout-bill-weight",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(recordData),
        success: function (result) {
            layer.close(index);
            if (result.code != "0000") {
                layer.msg(result.msg);
            } else {
                layer.msg("开始渲染打印单……");
                printWeight(result.data);
                // 刷新按钮
                flushBtn("btn-printBill");
            }
        },
        error: function () {
            layer.close(index);
            layer.msg("获取打印模版失败,请联系管理员查看原因!!");
        }
    });
};
 
//完成称重
function submitWeight() {
    if (null == recordData) {
        notify("没有数据可以提交", null);
        return;
    }
    var data = form.val("form-weight");
    if (!data.depotId) {
        notify("装卸仓库必须填写", null);
        return;
    }
    // 校验-出库空车
    if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
        if (data.emptyWeight <= 0.0) {
            notify("空车称重信息必填", null);
            return;
        }
        if (!data.customerName) {
            notify("往来单位信息必填", null);
            return;
        }
    } else {
        if (data.fullWeight <= 0.0) {
            notify("满车称重信息必填", null);
            return;
        }
        if (!data.foodVariety) {
            notify("粮食品种必填", null);
            return;
        }
        if (!data.foodLocation) {
            notify("粮食产地必填", null);
            return;
        }
        if (!data.settleWeight || data.settleWeight <= 0.0) {
            notify("扣重后净信息不正确,请核实计算", null);
            return;
        }
    }
    // 合并更新當前编辑数据
    Object.assign(recordData, data);
 
    // 获取照片
    var files = [{
        fileName: snapData.fileName1
    }, {
        fileName: snapData.fileName2
    }, {
        fileName: snapData.fileName3
    }];
    recordData.files = files;
 
    var index = layer.load();
    $.ajax({
        type: "POST",
        url: "../../basic/inout/inout-next-step",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: JSON.stringify(recordData),
        success: function (result) {
            if (result.code != "0000") {
                layer.alert("数据提交失败,请重试!!");
            } else {
                clearInterval(timerWeight);
                layer.alert("数据提交成功!!");
                // 更新按钮显示
                flushBtn("btn-submit");
            }
            layer.close(index);
        },
        error: function () {
            layer.close(index);
            layer.alert("提交失败,请重新尝试!!");
        }
    });
}
 
//重新称重时,表单不清空,按钮重置
function flushPage() {
 
    weightDto.weight = 0.0;
    $("#weightValue").text("0.0");
    $("#img_scale_statule").attr("src", "/img/web/inout/icon-red.png");
    timerGetWeight();
 
    //扣重信息框恢复为可编辑
    delDisabled();
    //表单数据重置
    form.val("form-weight", recordData);
    form.render();
}
 
//根据选择的仓库信息,更新粮食品种
function updateFoodVarietyByDepot(selectId) {
    var selectDepot;
    $.each(listDepot, function (index, data) {
        if (data.id === selectId) {
            selectDepot = data;
            return false;
        }
    });
 
    if (selectDepot) {
        form.val("form-weight", {
            foodVariety: selectDepot.foodVariety,
            foodLocation: selectDepot.foodLocation,
            foodLevel: selectDepot.foodLevel,
            noticeId: selectDepot.noticeId
        });
        form.render();
    }
}
 
/*-----------------------称重操作-结束------------------------------*/
 
/**
 * 弹出提醒框
 * @param msg 提醒信息
 * @param data 数据信息,可能为空
 */
function notify(msg, data) {
    if (data) {
        //赋值
        $("#resultMsg").text(msg);
        $("#resultUserName").text(data.userName);
        $("#resultPlateNum").text(data.plateNum);
        if ("IN" == data.type) {
            $("#resultType").text("入库-" + INOUT_PROGRESS_MSG(data.progress));
        } else {
            $("#resultType").text("出库-" + INOUT_PROGRESS_MSG(data.progress));
        }
        $("#resultIntelCard").text(data.intelCard);
 
        layer.open({
            type: 1,
            offset: ['150px', '200px'],
            area: '450px;',
            shade: 0.8,
            id: 'dialog_notify_info',
            btn: ['确定'],
            content: $('#dialog-from-notify'),
            yes: function (index) {
                layer.closeAll();
            }
        });
    } else {
        layer.alert(msg, {offset: ['300px', '300px']});
    }
};