1
duhe
2024-03-15 be7d738131c8cf9c8e00c6abfde469f2d82cbfb0
WebTM/views/ÖÊÁ¿¹ÜÀí/À´ÁϼìÑéµ¥/Kf_QCStockInCheckBill_Fast.html
@@ -31,27 +31,28 @@
                            <li lay-id="1" style="padding:1px;" class="layui-this">源单信息</li>
                            <li lay-id="2" style="padding:1px;">物料清单</li>
                            <li lay-id="3" style="padding:1px;">明细清单</li>
                            <li lay-id="4" style="padding:1px;">附件信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--源单信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item">
                                    <!--<div class="layui-row">
                <div class="layui-col-xs3">
                    <label class="layui-form-label" style="width:60px;padding-left:0px;">单据类型</label>
                </div>
                <div class="layui-col-xs8">
                    <select name="HBillType" id="HBillType">
                        <option value="1103">收料通知单</option>
                    </select>
                </div>
            </div>-->
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">单据类型</label>
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">物料条码</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <select name="HBillType" id="HBillType">
                                                <option value="1103">收料通知单</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单号</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input">
                                            <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
@@ -77,12 +78,24 @@
                                            </div>
                                            <div class="layui-col-xs6">
                                                <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" disabled="disabled" autocomplete="off" class="layui-input mobile">
                                            </div>
                                            <div class="layui-col-xs3">
                                                <input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" disabled="disabled" autocomplete="off" class="layui-input mobile">
                                            </div>
                                        </div>
                                    </div>
                                    <!--<input id="upload" type="file" accept="image/*"  @change="changePic" />-->
                                    <!--<input id="takepicture" type="file" accept="image/*">
            <div>
                <img id="blah" src="#" alt="显示您上传的商品图片" />
            </div>-->
                                </div>
                            </div>
                            <!--物料清单-->
@@ -231,7 +244,7 @@
                                            <label class="layui-form-label" style="width:40px;padding-left:0px;">批号</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HBarchNo" id="HBarchNo" lay-verify="HBarchNo" autocomplete="off" class="layui-input">
                                            <input type="text" name="HBatchNo" id="HBatchNo" lay-verify="HBatchNo" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
@@ -322,23 +335,46 @@
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="Saver">提交</button>
                        <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">退出</button>
                    </div>
                    <div id="" style="display:none;">
                        <audio id="cs" hidden controls>
                            <source src="../../video/jingbao.wav" type="audio/ogg">
                        </audio>
                    </div>
                    <div id="" style="display:none;">
                        <audio id="cs2" hidden controls>
                            <source src="../../video/success.wav" type="audio/ogg">
                        </audio>
                    </div>
                </form>
                            <!--附件信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item" style="padding-top: 10px;">
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn" id="testList">选择文件</button>
                                        <!--<input class="layui-upload-file" type="file" accept="" name="file" multiple="">-->
                                        <button type="button" class="layui-btn" id="camera" capture="user"><i class="layui-icon"></i>拍照上传</button>
                                        <div class="layui-upload-list">
                                            <table class="layui-table">
                                                <thead>
                                                    <tr>
                                                        <th>文件名</th>
                                                        <th>大小</th>
                                                        <th>状态</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tbody id="ProImgByList">
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="Saver">提交</button>
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">退出</button>
                                <!-- <button id="capture">拍照</button>-->
                            </div>
                            <div id="" style="display:none;">
                                <audio id="cs" hidden controls>
                                    <source src="../../video/jingbao.wav" type="audio/ogg">
                                </audio>
                            </div>
                            <div id="" style="display:none;">
                                <audio id="cs2" hidden controls>
                                    <source src="../../video/success.wav" type="audio/ogg">
                                </audio>
                            </div>
</form>
            </div>
        </div>
    </div>
@@ -347,7 +383,6 @@
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="JY">检验</a>
    </script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
@@ -359,14 +394,28 @@
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
        }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , upload = layui.upload
                , form = layui.form
                , element = layui.element;
            //清空界面  new
            function readURL(input) {
                if (input.files && input.files[0]) {
                    var reader = new FileReader();
                    reader.onload = function (e) {
                        $('#blah').attr('src', e.target.result);
                    }
                    reader.readAsDataURL(input.files[0]);
                }
            }
            $("#takepicture").change(function () {
                readURL(this);
            });
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
@@ -399,6 +448,9 @@
            var params = getUrlVars();
            var linterid = params[params[0]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            //加载表头
            function RoadBillMain(linterid) {
@@ -497,6 +549,8 @@
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        PicUpload();
                        PicUploads();
                    }
                });
            }
@@ -637,7 +691,9 @@
            //退出
            form.on('submit(Cancel)', function () {
                parent.location.href = "../../../views/index.html"
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html";
                });
            })
            //编辑
            form.on('submit(cmdModify)', function () {
@@ -748,15 +804,35 @@
                var HSLEntryID = $("#HSLEntryID").val();     //收料通知单子ID
                var HSLBillNo = $("#HSLBillNo").val();     //收料通知单单号
                var HSLSeQ = $("#HSLSeQ").val();     //收料通知单行号
                var HBatchNo = $("#HBatchNo").val();     //批号
                var HBillNo = $("#HBillNo").val();     //来料检验单单号
                var HInterID = $("#HInterID").val();     //来料检验单主ID
                if (HBadQty == "") {
                    HBadQty = 0;
                }
                if (HRightQty == "") {
                    HRightQty = 0;
                }
                if (HSPID == "") {
                    HSPID = 0;
                }
                if (HWHID == "") {
                    HWHID = 0;
                }
                if (HSPNumber == "") {
                    HSPNumber = '';
                }
                if (HWHNumber == "") {
                    HWHNumber = '';
                }
                if (HBatchNo == "") {
                    HBatchNo = '';
                }
                if (HKeeperID == "") {
                    HKeeperID = 0;
                }
                //var sSourceType = $("#HBillType").val();
@@ -771,10 +847,10 @@
                            async: true,
                            data: {
                                "HZJOrgNumber": HZJOrgNumber, "HMaterNumber": HMaterNumber, "HUnitNumber": HUnitNumber, "HCheckQty": HCheckQty, "HRightQty": HRightQty
                                , "HBadQty": HBadQty, "HCheckResult": HCheckResult, "HSupNumber": HSupNumber, "HWHNumber": HWHNumber
                                , "HBadQty": HBadQty, "HCheckResult": HCheckResult, "HSupNumber": HSupNumber
                                , "HUseResult": HUseResult, "HSeQ": HSeQ, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo
                                , "user": sessionStorage["HUserName"], "HWHID": HWHID, "HSPID": HSPID, "HSupID": HSupID, "HKeeperID": HKeeperID
                                , "HMaterID": HMaterID, "HSourceBillType": HSourceBillType, "HSLInterID": HSLInterID, "HSLEntryID": HSLEntryID, "HSLBillNo": HSLBillNo, "HSLSeQ": HSLSeQ
                                , "HMaterID": HMaterID, "HSourceBillType": HSourceBillType, "HSLInterID": HSLInterID, "HSLEntryID": HSLEntryID, "HSLBillNo": HSLBillNo, "HSLSeQ": HSLSeQ, "HBillNo": HBillNo, "HInterID": HInterID, "HBatchNo": HBatchNo
                            },
                            dataType: "json",
                            success: function (data) {
@@ -950,7 +1026,7 @@
                    $.ajax({
                        url: GetWEBURL() + '/QCStockInCheckBill/DisBillEntryList_Webs_New_Json1',
                        type: "GET",
                        data: { HInterID: linterid, HEntryID: lentryid},
                        data: { HInterID: linterid, HEntryID: lentryid },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                listOption.data = result.data.list;
@@ -961,7 +1037,7 @@
                                $("#HUnitName").val(result.data[0].HUnitName);
                                $("#HWHName_B").val(result.data[0].HWHName_B);
                                $("#HSPName_B").val(result.data[0].HSPName_B);
                                $("#HBatchNo").val(result.data[0].HBatchNo);
                                $("#HBatchNo").val(result.data[0].HBatChNo);
                                $("#HZJOrgName").val(result.data[0].HZJOrgName);
                                $("#HZJOrgNumber").val(result.data[0].HZJOrgNumber);
                                $("#HSupName").val(result.data[0].HSupName);
@@ -982,6 +1058,7 @@
                                $("#HSLEntryID").val(result.data[0].HSLEntryID);
                                $("#HSLBillNo").val(result.data[0].HSLBillNo);
                                $("#HSLSeQ").val(result.data[0].HSLSeQ);
                                $("#HCheckQty").val(result.data[0].hqty);
                            }
                            else {
                                layer.msg(result.Message);
@@ -998,22 +1075,10 @@
            //扫条码
            function GetMeesageByBarCode(obj) {  //返回工作中心
                var sSubStr = table.cache['wl-table'];
                var sBarCode = $('#HBarCode').val()
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var sQty = $("#HQty").val()
                var sHBillType = $("#HBillType").val()  //源单类型
                var sBillType = '1201'
                var sHWHID = $("#HWHID").val()
                var sHSPID = $("#HStockPlaceID").val()
                var sSourceBillNo = $("#HSourceBillNo").val()
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                if (sQty == "") {
                    sQty = 0;
                }
                //判断条码是否为空  new
                if (sBarCode == '') {
@@ -1024,149 +1089,33 @@
                if (sBarCode != "") {
                    $('#HBarCode').val("");
                }
                if (sQty != "") {
                    $('#HQty').val("");
                }
                if (sHWHID == "184154") {
                    if (sHSPID == "0") {
                        playSound();
                        layer.msg("仓位为空,请选择仓位!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                }
                $.ajax({
                    url: GetWEBURL() + "/POStockInBill/get_CheckTypeByBarCode_Json",
                    type: "GET",
                    async: false,
                    data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            playSound1();
                            if (result.data.HBarType == '仓库条码') {
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
                                $("#HStockPlaceName").val("");
                                $("#HNote").val(";一键扫码仓库条码");
                                element.tabChange('tab-POStockInBill', '2');  //跳转页签
                            }
                            else if (result.data.HBarType == '仓位条码') {
                                $("#HStockPlaceName").val(result.data.HSPName);
                                $("#HStockPlaceID").val(result.data.HSPID);
                                $("#HWHNAME").val(result.data.HWhName);
                                $("#HWHID").val(result.data.HWhID);
                                $("#HNote").val(";一键扫码仓位条码");
                                element.tabChange('tab-POStockInBill', '2');//跳转页签
                            }
                            else if (result.data.HBarType == '部门条码') {
                                $("#HDeptName").val(result.data.HDeptName);
                                $("#HDeptID").val(result.data.HDeptID);
                                $("#HNote").val(";一键扫码部门条码");
                                element.tabChange('tab-POStockInBill', '2');//跳转页签
                            }
                            else if (result.data.HBarType == '源单条码') {
                                $("#HSupName").val(result.data.HSupName);
                                $("#HSupID").val(result.data.HSupID);
                                $("#HDeptName").val(result.data.HDeptName);
                                $("#HDeptID").val(result.data.HDeptID);
                                $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                $("#HBillType").val(result.data.hSourceBillTypeField)
                                sessionStorage["SourceFlag"] = true;
                                //获取源单类型、源单单号
                                if (result.data.HSourceBillType == "1102") {
                                    $("#HBillType").val("1102");
                                }
                                else if (result.data.HSourceBillType == "1103") {
                                    $("#HBillType").val("1103");
                                }
                                else {
                                    $("#HBillType").val("手工录入");
                                }
                                $("#HNote").val(";一键扫码源单条码");
                                element.tabChange('tab-POStockInBill', '3');
                            }
                            else {
                                if (HSourceFlag == true) {
                                    element.tabChange('tab-POStockInBill', '3');
                                }
                                else {
                                    $("#HSupName").val(result.data.hSupNameField);
                                    $("#HSupID").val(result.data.hSupIDField);
                                    //$("#HDeptName").val(result.data.HDept);
                                    //$("#HDeptID").val(result.data.HDeptID);
                                    //$("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    //$("#HBillType").val(result.data.hSourceBillTypeField)
                                    HSourceFlag = true;
                                    //获取源单类型、源单单号
                                    if (result.data.hSourceBillTypeField == "1102") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("1102");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '采购订单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    if (result.data.hSourceBillTypeField == "1103") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("1103");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '收料通知单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    else {
                                        //$("#HBillType").val("-1");
                                    }
                                    $("#HSourceBillNo").attr("readonly", "readonly");
                                    $("#HNote").val(";物料条码");
                                    element.tabChange('tab-POStockInBill', '3');
                                }
                            }
                            layer.load(3)
                            $.ajax({
                                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1201', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        $("#HBarCode_B").val(result.data.list2[0].HBarCode);
                                        $("#HMaterName_B").val(result.data.list2[0].HMaterName);
                                        $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
                                        $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
                                        $("#HUnitName_B").val(result.data.list2[0].HUnitName);
                                        $("#HQty_B").val(result.data.list2[0].HQty);
                                        $("#HTMQty_B").val(result.data.list2[0].HTMQty);
                                        $("#HWHName_B").val(result.data.list2[0].HWHName);
                                        $("#HSPName_B").val(result.data.list2[0].HSPName);
                                        var count = 0;
                                        var count1 = 0;
                                        for (var i = 0; i < result.data.list.length; i++) {
                                            count += result.data.list[i].HQty;
                                            count1 += result.data.list[i].HPieceQty;
                                        }
                                        $("#HSumQtys").val(count);
                                        $("#HBarCodeQtys").val(count1);
                                    }
                                    else {
                                        layer.msg(result.Message);
                                    }
                                    layer.closeAll("loading");
                                }
                            });
                        }
                        else {
                            playSound();
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                element.tabChange('tab-POStockInBill', '2');
                table.render({
                    elem: '#wl-table'
                    , cellMinWidth: 80
                    , totalRow: true
                    , url: GetWEBURL() + '/Kf_QCStockInCheckBill_Fast/BarCode_Json'
                    , where: { HBarCode: sBarCode, HOrgID: sessionStorage["OrganizationID"] }
                    , cols: [[
                        { type: 'radio' }
                        , { field: 'HQty', title: '数量', sort: true, width: 200 }
                        , { field: 'HMaterNumber', title: '物料代码', sort: true, width: 200 }
                        , { field: 'HMaterName', title: '物料名称', sort: true, width: 200 }
                        , { field: 'HMaterModel', title: '规格型号', sort: true, width: 200 }
                        , { field: 'HSourceInterID', title: '源单主内码', sort: true, width: 200 }
                        , { field: 'HSourceEntryID', title: '源单子内码', sort: true, width: 200 }
                        , { field: 'HSourceBillNo', title: '源单单号', sort: true, width: 200 }
                        , { field: 'HBatchNo', title: '批次' }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                    ]]
                    // , data: [linterid]
                    // , page: true
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
                    }
                });
            }
            var listOption = {
                elem: '#wl-table'
@@ -1200,6 +1149,136 @@
                var audio = document.getElementById("cs2");
                audio.play();
            }
            //拍照上传
            function PicUploads() {
                var ProImgByList = $('#ProImgByList')
                    , uploadListIns = upload.render({
                        elem: '#camera'
                        , url: GetWEBURL() + "/Cj_StationOutBill/UploadFile2"
                        , accept: 'file'
                        , multiple: true
                        , acceptMime: 'image/*'
                        , auto: false
                        //, bindAction: '#testListAction' //按扭绑定
                        , data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
                        , choose: function (obj) {
                            var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
                            //读取本地文件
                            obj.preview(function (index, file, result) {
                                var tr = $(['<tr id="upload-' + index + '">'
                                    , '<td>' + file.name + '</td>'
                                    , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
                                    , '<td>等待上传</td>'
                                    , '<td>'
                                    , '<button class="layui-btn layui-btn-xs demo-reload ">上传</button>'
                                    , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
                                    , '</td>'
                                    , '</tr>'].join(''));
                                //单个重传
                                tr.find('.demo-reload').on('click', function () {
                                    obj.upload(index, file);
                                    return false;
                                });
                                //删除
                                tr.find('.demo-delete').on('click', function () {
                                    delete files[index]; //删除对应的文件
                                    tr.remove();
                                    uploadListIns.config.elem.next()[0].value = ''; //清空 input file å€¼ï¼Œä»¥å…åˆ é™¤åŽå‡ºçŽ°åŒåæ–‡ä»¶ä¸å¯é€‰
                                });
                                ProImgByList.append(tr);
                            });
                        }
                        , done: function (res, index, upload) {
                            if (res.code == 1) { //上传成功
                                var tr = ProImgByList.find('tr#upload-' + index)
                                    , tds = tr.children();
                                tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
                                tds.eq(3).html(''); //清空操作
                                //tds.eq(3).find('.demo-reload').addClass('layui-hide'); //隐藏上传
                                return delete this.files[index]; //删除文件队列已经上传成功的文件
                            }
                            this.error(index, upload);
                        }
                        , error: function (index, upload) {
                            var tr = ProImgByList.find('tr#upload-' + index)
                                , tds = tr.children();
                            tds.eq(2).html('<span style="color: #FF5722;">上传失败[检查文件名及文件格式]</span>');
                            tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示上传
                        }
                    });
            }
            //文件上传
            function PicUpload() {
                //多图片上传
                //多文件列表示例
                var ProImgByList = $('#ProImgByList')
                    , uploadListIns = upload.render({
                        elem: '#testList'
                        , url: GetWEBURL() + "/Cj_StationOutBill/UploadFile2"
                        , accept: 'file'
                        , multiple: true
                        , auto: false
                        //, bindAction: '#testListAction' //按扭绑定
                        , data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
                        , choose: function (obj) {
                            var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
                            //读取本地文件
                            obj.preview(function (index, file, result) {
                                var tr = $(['<tr id="upload-' + index + '">'
                                    , '<td>' + file.name + '</td>'
                                    , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
                                    , '<td>等待上传</td>'
                                    , '<td>'
                                    , '<button class="layui-btn layui-btn-xs demo-reload ">上传</button>'
                                    , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
                                    , '</td>'
                                    , '</tr>'].join(''));
                                //单个重传
                                tr.find('.demo-reload').on('click', function () {
                                    obj.upload(index, file);
                                    return false;
                                });
                                //删除
                                tr.find('.demo-delete').on('click', function () {
                                    delete files[index]; //删除对应的文件
                                    tr.remove();
                                    uploadListIns.config.elem.next()[0].value = ''; //清空 input file å€¼ï¼Œä»¥å…åˆ é™¤åŽå‡ºçŽ°åŒåæ–‡ä»¶ä¸å¯é€‰
                                });
                                ProImgByList.append(tr);
                            });
                        }
                        , done: function (res, index, upload) {
                            if (res.code == 1) { //上传成功
                                var tr = ProImgByList.find('tr#upload-' + index)
                                    , tds = tr.children();
                                tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
                                tds.eq(3).html(''); //清空操作
                                //tds.eq(3).find('.demo-reload').addClass('layui-hide'); //隐藏上传
                                return delete this.files[index]; //删除文件队列已经上传成功的文件
                            }
                            this.error(index, upload);
                        }
                        , error: function (index, upload) {
                            var tr = ProImgByList.find('tr#upload-' + index)
                                , tds = tr.children();
                            tds.eq(2).html('<span style="color: #FF5722;">上传失败[检查文件名及文件格式]</span>');
                            tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示上传
                        }
                    });
            }
            //扫源单
            function GetMeesageBySourceBillNo(obj) {
                var HSourceBillNo = $('#HSourceBillNo').val()