xinyb
2022-09-13 faf4ababded41c4653010482b601f44cac2dd461
WebRoot/js/index/funcLink.js
@@ -107,6 +107,7 @@
            uploadAsync: false,   // bool是否多文件批量上传将并行异步/。默认为true
            showCaption: false,//是否显示被选文件的简介
            showBrowse: false,//是否显示文件浏览按钮
            showBatchDownload:true,//显示批量下载按钮
            showUpload: false,//是否显示上传按钮
            showCancel: false,//是否显示取消按钮
            showRemove: false,//是否显示移除按钮
@@ -453,9 +454,10 @@
                            '&curUsername=' + encodeURIComponent(encrypt.encrypt(jsons[i].userName)) + '&curUsercode=' +
                            encodeURIComponent(encrypt.encrypt(jsons[i].userCode));
                    }
                    if (jsons[i].fileType.toLowerCase() == 'pdf') {//pdf格式调用插件
                        fileURL = jsons[i].domain + '/general/pdf/web/viewer.jsp?file=' + fileURL;
                    }
                    //注释,不用viewer.jsp打开pdf文件,因为用这个打开有印章的pdf,印章会被屏蔽 xin 2022-6-23 09:44:07
                    // if (jsons[i].fileType.toLowerCase() == 'pdf') {//pdf格式调用插件
                    //     fileURL = jsons[i].domain + '/general/pdf/web/viewer.jsp?file=' + fileURL;
                    // }
                    if (jsons[i].orgFileType == 'doc' || jsons[i].orgFileType == 'docx' || jsons[i].orgFileType == 'xls'
                        || jsons[i].orgFileType == 'xlsx' || jsons[i].orgFileType == 'ppt' || jsons[i].orgFileType == 'pptx') {
                        jsons[i].fileType = 'office';
@@ -1347,7 +1349,11 @@
    var num=0;
    if (typeof (mygrid) != "undefined") {
        rows=mygrid.getFieldForNew();
        num=rows.length;
        if(rows.length==0){
            num=1;
        }else {
            num = rows.length;
        }
    }else{ // 没格线则取0;
        num=1;
    }
@@ -1370,6 +1376,10 @@
                    prossDate(key, mygrid, rows, k);
                }
                temp = getValue(key, null, rows[k]);
                if(typeof temp!="string"&&typeof temp!="number"&& temp==false){
                    closeLoading();
                    return;
                }
                if(typeof panMain !="undefined") {
                    let info = panMain[panIndex].panInfo;
                    if (info != null) {
@@ -1428,7 +1438,11 @@
    var num = 0;
    if (typeof (mygrid) != "undefined") {
        rows = mygrid.getFieldForNew();
        num = rows.length;
        if(rows.length==0){
            num=1;
        }else {
            num = rows.length;
        }
    } else { // 没格线则取0;
        num = 1;
    }
@@ -1458,6 +1472,11 @@
                }
            }catch(e){}
            t = getValue(key,null,rows[k]);
            if(typeof t!="string"&&typeof t!="number"&&t==false){
                //没选中格线行数据,返回不执行
                closeLoading();
                return;
            }
            if (t==null||t=="null")
                t = sfs[i];
            if(isNaN(t)&&t.indexOf(";")>0){ // 当内容存在;情况,需要替换 by danaus
@@ -1487,7 +1506,7 @@
    paramVa=st;
    if (lk == "1") { // 直接执行存储过程
        //注释,执行自定义.do在后台执行,不需要在这里处理 xin 2020-5-14 11:01:40
        exec = ((exec != undefined && exec.indexOf(".do") != -1) ? exec : "/execProc.do");
        exec = ((exec != undefined && exec.indexOf(".do") != -1) ? exec : "/execProcV2.do");///execProc.do
        /*
                $.post(exec, {
                    "formid" :f,
@@ -1528,6 +1547,9 @@
            },
            error: function () {
                //请求出错处理
                if (mes != null && mes != "") {
                    $.messager.progress('close');
                }
            }
        });
@@ -1565,68 +1587,144 @@
    closeLoading();
}
function procCallBack(data, ref, clo) {
    if (data == null || data == "") {// 什么也没返回
        $.messager.alert('提示', "进程处理完毕.", "info", function()
            {
    if (data.state != null && data.state == 0) {
        refreshOrClose(ref, clo);
        let info = data.data;
        if (info == null) {
            $.messager.alert('提示', '返回错误:' + info, "info");
            return;
        }
        let doc = info.linkdocinfo;
        let msg = info.memo;
        if (doc == null || doc == '') {
            $.messager.alert('提示', msg || '进程处理完毕', "info", function () {
                if (typeof (savedExecFunclink) == "function") {
                    location.reload();
                }
                refreshOrClose(ref, clo);
            }
        );
            });
            return;
        }
        if (msg != null && msg != '') {
            $.messager.alert('提示', msg, "info", function () {
                redirect(doc);
            });
            return;
        }
        redirect(doc);
    } else if (data.state != null && data.state == -1) {
        let msg = data.error || data.msg;
        if (data.data != null && data.data.isuuid) {
            $.messager.show({
                title: '提示',
                msg: msg,
                showType: 'show',
                //timeout:3,
                style: {
                    right: '',
                    top: document.body.scrollTop + document.documentElement.scrollTop,
                    bottom: ''
                }
            });
            return;
        }
        $.messager.alert('提示', msg || '出现错误', "info");
    } else {
        try {
            if(data.replace(/\s+/g,"")==="(null)"){
                $.messager.alert('提示', data, "info");
                return;
            }else{
                data = JSON.parse(data);
            if((data.msg!=undefined&&data.msg=="")&&(data.data==undefined||data.data=="")){
                $.messager.alert('提示', "进程处理完毕.", "info", function()
                    {
                        if (typeof (savedExecFunclink) == "function") {
                            location.reload();
                        }
                        refreshOrClose(ref, clo);
                    }
                );
            }
            }
        } catch (e) {
           alert(data.msg!=undefined?data.msg:data);
            refreshOrClose(ref, clo);
            return;
        }
        try {//by danaus 2019/11/22 17:42
            if (data.state=-1&&JSON.parse(data.data).isuuid) {
                $.messager.show({
                    title: '提示',
                    msg: data.msg,
                    showType: 'show',
                    //timeout:3,
                    style: {
                        right: '',
                        top: document.body.scrollTop + document.documentElement.scrollTop,
                        bottom: ''
                    }
                });
                return;
            }
        }catch (e) {}
        if (data.msg!=undefined&&data.msg != ""&&data.msg!=null&&data.msg!="null"){
            alert(data.msg);
            refreshOrClose(ref, clo);
           // return;
        }
        if (data.data!=undefined&&data.data!=null&&data.data !=""&&data.data !="null") {
            redirect(data.data);
            return;
        }
        $.messager.alert('提示', data.msg || '状态无法识别:' + data.state, "info");
    }
    // if(data.state!=null && data.state==0){
    //
    //
    // }else if(data.state!=null && data.state==-1){
    //
    // }else{
    //
    // }
    // if (data == null || data == "") {// 什么也没返回
    //     $.messager.alert('提示', "进程处理完毕.", "info", function () {
    //             if (typeof (savedExecFunclink) == "function") {
    //                 location.reload();
    //             }
    //             refreshOrClose(ref, clo);
    //         }
    //     );
    // } else {
    //     try {
    //         if (data.error != null && data.error != '') {
    //             $.messager.alert('提示', data.error, "info");
    //             return;
    //         }
    //         // if (data.replace(/\s+/g, "") === "(null)") {
    //         //     $.messager.alert('提示', data, "info");
    //         //     return;
    //         // }
    //         // data = JSON.parse(data);
    //         // if ((data.msg != undefined && data.msg == "") && (data.data == undefined || data.data == "")) {
    //         if (data.data == null || data.data == "") {
    //             $.messager.alert('提示', "进程处理完毕.", "info", function () {
    //                     if (typeof (savedExecFunclink) == "function") {
    //                         location.reload();
    //                     }
    //                     refreshOrClose(ref, clo);
    //                 }
    //             );
    //         }
    //     } catch (e) {
    //         alert(data.data.memo || data);
    //         refreshOrClose(ref, clo);
    //         return;
    //     }
    //     try {//by danaus 2019/11/22 17:42
    //         if (data.state = -1 && JSON.parse(data.data).isuuid) {
    //             $.messager.show({
    //                 title: '提示',
    //                 msg: data.msg,
    //                 showType: 'show',
    //                 //timeout:3,
    //                 style: {
    //                     right: '',
    //                     top: document.body.scrollTop + document.documentElement.scrollTop,
    //                     bottom: ''
    //                 }
    //             });
    //
    //             return;
    //         }
    //     } catch (e) {
    //     }
    //     // let memo=data.data.memo;
    //     // if (memo!=null && memo!="") {
    //     //     alert(memo);
    //     //     if (data.state != null && data.state == 0) {
    //     //         refreshOrClose(ref, clo);
    //     //     }
    //     // }
    //     // if (data.msg!=undefined&&data.msg != ""&&data.msg!=null&&data.msg!="null"){
    //     //     alert(data.msg);
    //     //     if(data.state!=undefined&&data.state==0) {
    //     //         refreshOrClose(ref, clo);
    //     //     }
    //     // return;
    //     // }
    //     // if (data.msg!=undefined&&data.msg != ""&&data.msg!=null&&data.msg!="null"){
    //     //     alert(data.msg);
    //     //     if(data.state!=undefined&&data.state==0) {
    //     //         refreshOrClose(ref, clo);
    //     //     }
    //     //    // return;
    //     // }
    //     if (data.state == 0 && data.data != null) {
    //         refreshOrClose(ref, clo);
    //         let msg = data.data.memo;
    //         $.messager.alert('提示', msg, "info", function () {
    //             redirect(data.data.linkdocinfo);
    //         });
    //         return;
    //     }
    //     // if (data.data!=undefined&&data.data!=null&&data.data !=""&&data.data !="null") {
    //     //     redirect(data.data);
    //     //     return;
    //     // }
    // }
}
function redirect(info) {
    if(info.indexOf("buildv2.do") > -1){ // 生成页面 by danaus 13-6-28 增加返回生成页面和打开多个功能号多张单的功能
@@ -1904,6 +2002,13 @@
        if (typeof (mygrid) != "undefined") {
            try {
                if(row==undefined){
                    var tempRow=mygrid.getFristRow(1);//再判断一次,以确定这个字段是否存在于表格,存在才需要提示
                    if(tempRow!=null&&tempRow[str.toLowerCase()]!=undefined) {
                        alert("请从表格选中需要执行的行");
                        return false;
                    }
                }
                var d=t; // 保存原值
                if(row!=undefined){
                    t = (row[str.toLowerCase()+"Link"]!==undefined)?row[str.toLowerCase()+"Link"]:((row[str.toLowerCase()]==undefined)?null:row[str.toLowerCase()]);
@@ -1996,7 +2101,11 @@
                var num=0;
                if (typeof (mygrid) != "undefined") {
                    rows=mygrid.getFieldForNew();
                    num=rows.length;
                    if(rows.length==0){
                        num=1;
                    }else {
                        num = rows.length;
                    }
                }else{ // 没格线则取0;
                    num=1;
                }
@@ -2019,7 +2128,7 @@
        }
//        var servlet = "/" + format.toLowerCase() + ".do?"
        var servlet="/printReport.do?m="+format.toLowerCase()
        var doccode = getValue('doccode');
        var doccode = getDoc("doccode", ".value");//只取表头 by danaus 2022/8/17 11:10 getValue('doccode');
        var url = "formId=" + formid + "&reportId=" + reportid + "&parameter=" + proParam+";"
            + "&p=" + Math.round(Math.random() * 100000);
        //html方法打印
@@ -2159,7 +2268,7 @@
        postToThis = parent.getIframeAttr("posttothis")!=undefined?parent.getIframeAttr("posttothis").split(";"):"";
        C_Grid = parent.getIframeAttr("t_grid");
    }
    recentFilesTo();
  //recentFilesTo();
});
// 【帮助】按钮事件函数,点击打开该功能的帮助页面