xinyb
2022-05-13 5b18c27a3a4fda518dc43ba88c6f79df7d38527e
WebRoot/js/hotkey.js
@@ -217,6 +217,11 @@
    input9.attr('name', 'winType');
    input9.attr('value', obj.winType);
    form.append(input9);
    var input10 = $('<input>');
    input10.attr('type', 'hidden');
    input10.attr('name', 'isExportExcel');
    input10.attr('value', obj.isExportExcel);
    form.append(input10);
    var input11 = $('<input>');
    input11.attr('type', 'hidden');
    input11.attr('name', 'TGData');
@@ -525,6 +530,7 @@
        }
        return string;
    }
    return this;
}
function closeOther() {
@@ -1163,6 +1169,10 @@
//弹出层
        showLayer: function (str, flg, width, height) {
            this._flg_ = flg;
            if(flg==-1 && str.indexOf("warehousing")!=-1){//是序列号扫码界面 xin 2021-8-3 10:17:22
                openNewLayui.openWin(str);
                return;
            }
            this.layIndex = layer.open({
                type: 2,
                title: false,
@@ -1199,6 +1209,71 @@
    return lay;
}
function codeScanning(state,formid,formtype,type){
    var url = "/general/SerialNumber/" + (type == "out" ? "deliveryPage.jsp?" : "warehousing.jsp?");
    var parm = "formid=" + formid + "&formtype=" + formtype + "&doccode=" + getDoc("doccode", ".value");
    var isEdit = false;
    if (state != null) {
        var docstatePan = getDoc("docstatus", ".value");
        if (state.indexOf(";") != -1) {
            isEdit = ($.inArray(docstatePan, state.split(";")) != -1 ? true : isEdit);
        }
        if (state == "" || docstatePan == state) {
            isEdit = true;
        }
        if (docstatePan == '100') {//确定单不可编辑
            isEdit = false;
        }
    }
    url += encodeText(parm + "&isEdit=" + isEdit);
    openNewLayui.openWin(url);
}
var openNewLayui={
    layer: (typeof (layui) != 'undefined' ? layui.layer : null),
    openWin: function (url) {
        var that=this;
        this.layer.open({
            type: 2,
            area: ['800px', '550px'],
            title: false,
            content: url,
            cancel: function (index,layero) {
                var envt = $(layero).find("iframe")[0].contentWindow;
                if (envt != null) {
                    if(envt.isChang){
                        if(confirm("界面有修改,是否执行扫完了再关闭?")){
                            that.setGrid(envt.vm.okSubmit(),true);
                        }else{
                            layer.close(index);
                        }
                    }else{
                        layer.close(index);
                    }
                }
            }
        });
    },
    setGrid:function(value,isSave){
        // var envt = $(layero).find("iframe")[0].contentWindow;
        if (value != null) {
            // var value = envt.vm.okSubmit();
            if (Grids != null && value != null) {
                var gr = Grids[value.T_id];
                gr.EndEdit(true);
                var rowids = value.rowids;
                for (var r in rowids) {
                    gr.setSerialNumber("serialnumbers", (rowids[r] != "" ? rowids[r].join(";") : ""), r);
                }
                if(isSave){//有改动过是需要保存
                    //处理保存自动执行事件
                    $("#tpSave").trigger("click");
                    // save(2);//执行保存
                }
            }
        }
        layer.closeAll();
    }
}
//38类型用到的弹出窗体
var LayerObjs = null;
@@ -1326,7 +1401,7 @@
function isTopFixed() {
    var bol = false;
    if (";5;8;16;496;".indexOf(";" + top.myFresh.panel[top.tabindex] + ";") != -1) {
    if (top.myFresh!=null && ";5;8;16;496;".indexOf(";" + top.myFresh.panel[top.tabindex] + ";") != -1) {
        bol = true;
    }
    return bol;
@@ -1750,10 +1825,99 @@
            }
            get.timer = setTimeout(function () {
                get.ShowDivForPanel(elem, panInfo[elem.id], rod);
            }, 2000);
            }, 1000);
        });
    }
};
//执行收款显示二维码或退款
function OpenPayAndRefund(doccode,type,formid){
        if(type=="pay"){//显示二维码
            let doc=doccode;
            var url = "/general/onlinePayment/payment.jsp?orderNo=" + doc+"&formId="+formid;
            layui.layer.open({
                type: 2,
                area: ['700px', '500px'],
                title: false,
                content: url,
                cancel: function (index, layero) {
                    var envt = $(layero).find("iframe")[0].contentWindow;
                    if (envt != null) {
                        if (!envt.isChang) {
                            if (!confirm("还没有支付,确定关闭吗?")) {
                                return false;
                            }
                        }
                        if (envt.ws != null) {
                            envt.ws.close();
                        }
                    }
                    layer.closeAll();
                    getReductionURL(doc);
                }
            });
        }else{//确定
            $.ajax({
                url: "/gtGrid.do?m=newTran&formid="+formid+"&docCode="+doccode,
                type: "get",
                async: false,
                success: function (res) {
                    if(res.state==-1) {
                        layer.alert(res.msg,function (){location.reload();});
                    }
                }, error: function (e, h, a) {
                    layer.alert(e.responseText,function (){location.reload();} );
                }
            });
    }
}
//针对收款二维码界面关闭的处理 xin 2021-9-8 10:09:33
function getReductionURL(doc){
    var url = location.search;
    var parm = Base64().decode(url.substring(1, url.length));
    if (parm.indexOf("&onlinePay=1") != -1) {
        parm = parm.replace("&onlinePay=1", "");
        parm = "?" + encodeText(parm);
        location.replace(location.href.split("?")[0] + parm);
    } else {
        if (doc != null) {
            let docUrl = '?' + encodeText('doccode=' + doc);
            location.replace(location.href.split("?")[0]  + docUrl);
        } else {
            location.reload();
        }
    }
    layer.closeAll();
}
//批量上传物料主数据主图片 xin 2021-9-17 09:51:37
function Batchupload(){
    var url="/general/batchUpload/uploadIndex.jsp";
    layui.layer.open({
        type: 2,
        area: ['850px', '500px'],
        title: false,
        content: url,
        cancel: function (index, layero) {
            layer.closeAll();
        }
    });
}
function colorisLoading(e) {
    Coloris({
        el: e
    });
}
function progressBar(e,value){
    top.$(e).jQMeter({
        goal: '100',
        raised: value+'',
        height: '24px',
        barColor:'#6699cc',
        bgColor: '#CCC'
    });
}
$(function () {
    //单据窗体头部固定 xin 2020-10-26 17:23:58
    if (isTopFixed()) {
@@ -1769,4 +1933,28 @@
    //------下面的是关于42控件的处理------
    control42DivData.loading();
    //---end---关于42控件的处理结束------
    //--------46控件类型加载----------- xin 2022-4-26 15:51:38
    $(".coloris46").each(function () {
        colorisLoading('.coloris46');
    })
    //---------47控件类型加载---------- xin 2022-4-27 10:58:12
    $(".progressBar47").each(function () {
        let id = $(this).data("id");
        let value = $("#" + id).val();//获取控件Id的value值
        value = value != null ? value : 0;
        if (isNaN(value) || value == "") {//不全是数字
            value = 0;
        }
        if (value >= 1) {
            value = 100;
        }
        if (value > 0 && value < 1) {//这种情况是1表示100%的值,那么0.1*100=10
            value = value * 100;
        }
        progressBar(this, value);
    })
})