| | |
| | | var version = 0;// 版本号 |
| | | var pwdCallBack = null;// 密码输入点击确定后回调函数 |
| | | var obj22 = null;// 22类型传值对象 |
| | | var shx=false; |
| | | var leftWidth="0"; |
| | | var gridId=[]; |
| | | var shx = false; |
| | | var leftWidth = "0"; |
| | | var gridId = []; |
| | | //var uploadObj = null; |
| | | //var edit=''; |
| | | var pic={};// 格线附件上传参数属性 |
| | | var rsakey={ |
| | | pubkey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkRupiYcKVGGUtDBDoR1t/1zm3ZtZgnte39iTJW6hlqjdY0UagKjpNiIv7J6XjtgfX7SgsR4AWnivqQHAICIvdPKfGZZzIs62OQ19MqrDTMoB/LvK5teNWhClv23WMUfRbP+EHgprT6hTw8U5apw1IB6i/y57NkLav792wiYBYRU4X45NoTaT+aiTSLFEflbfm94EXnhSS3vFkBmrZGy5BRNI8gmzafroslGx2Hk90CqlNdeKYxgZQ6xtvj+u33yrszWvPT6F9fsJT8aMjtvH050iYKRVct+x6Q7VRJgCI4MgvAexnTKdxW54YzvXCuO5bDiy5la7CgerWkTAq9dzXwIDAQAB" |
| | | var pic = {};// 格线附件上传参数属性 |
| | | var rsakey = { |
| | | pubkey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkRupiYcKVGGUtDBDoR1t/1zm3ZtZgnte39iTJW6hlqjdY0UagKjpNiIv7J6XjtgfX7SgsR4AWnivqQHAICIvdPKfGZZzIs62OQ19MqrDTMoB/LvK5teNWhClv23WMUfRbP+EHgprT6hTw8U5apw1IB6i/y57NkLav792wiYBYRU4X45NoTaT+aiTSLFEflbfm94EXnhSS3vFkBmrZGy5BRNI8gmzafroslGx2Hk90CqlNdeKYxgZQ6xtvj+u33yrszWvPT6F9fsJT8aMjtvH050iYKRVct+x6Q7VRJgCI4MgvAexnTKdxW54YzvXCuO5bDiy5la7CgerWkTAq9dzXwIDAQAB" |
| | | }; |
| | | let arrayFileType_Panel = {};//保存上传返回的附件uuid;seq及文件类型 |
| | | let arrayFileSeq_Panel = {};//保存上传返回的附件uuid;seq及文件名称,用于删除时根据文件名称匹配到seq |
| | | let fileUploadCount_Panel = 0;//保存附件总数 |
| | | let formid_Panel; |
| | | |
| | | function encryptFun(value) { |
| | | var encrypt = new JSEncrypt(); |
| | | encrypt.setPublicKey(rsakey.pubkey); |
| | | return encrypt.encrypt(value); |
| | | } |
| | | //拼接附件url |
| | | function getAttachmentUrl(staticUrl,formid,unid,domain,dbid,isShowOrgPic,width,height,fileExt,isDownLoad){ |
| | | function getAttachmentUrl(staticUrl, formid, unid, domain, dbid, isShowOrgPic, width, height, fileExt, isDownLoad) { |
| | | // if (staticUrl != null && staticUrl != "") { |
| | | // if (isDownLoad) { |
| | | // return unid + "_" + dbid + "_" + formid + "_" + fileExt; |
| | |
| | | e: $('#' + id + '_up'), |
| | | id:$('#'+id), |
| | | name:id, |
| | | NumberofSummary:[],//更新次数集合 |
| | | option: {//属性 |
| | | uploadUrl: '#', // String,用于上传处理操作的URL(通常是基于Ajax的处理) |
| | | uploadIdEvnt:$('#'+id), |
| | |
| | | uploadAsync: false, // bool是否多文件批量上传将并行异步/。默认为true |
| | | showCaption: false,//是否显示被选文件的简介 |
| | | showBrowse: false,//是否显示文件浏览按钮 |
| | | showBatchDownload:true,//显示批量下载按钮 |
| | | showBatchDownload: true,//显示批量下载按钮 |
| | | showUpload: false,//是否显示上传按钮 |
| | | showCancel: false,//是否显示取消按钮 |
| | | showRemove: false,//是否显示移除按钮 |
| | | showDrag:false,//是否显示拖动按钮 |
| | | showDrag: false,//是否显示拖动按钮 |
| | | showClose: false,//是否显示关闭按钮 |
| | | multiple: id.type == 9 ? false : true,//by danaus 2024-02-19 17:39 |
| | | dropZoneEnabled: true, //是否显示拖拽区域 |
| | | browseOnZoneClick: false, //布尔值,是否在点击预览区域时触发文件浏览/选择。默认为false |
| | | showUploadedThumbs: true, // 是否在预览窗口中持续显示已经上传的文件缩略图(用于ajax上传),直到按下删除/清除按钮 |
| | |
| | | isNine: false, // 19类型就为false,9类型就为true,下面有判断 |
| | | validateInitialCount: false, // 是否包括初始预览文件数(服务器上传文件)验证minfilecount和maxfilecount。默认为false. |
| | | overwriteInitial: true, // 是否要覆盖初始预览内容和标题设置 |
| | | initialPreviewAsData:true, |
| | | allowedFileExtensions:null,//允许上传的文件扩展名列表。默认情况下设置为 null |
| | | initialPreviewAsData: true, |
| | | allowedFileExtensions: null,//允许上传的文件扩展名列表。默认情况下设置为 null |
| | | dropZoneTitle:'点击或拖拽文件', |
| | | dropZoneClickTitle:'', |
| | | layoutTemplates : { |
| | |
| | | 'htm': '<i class="bi bi-filetype-html" style="color:#369584"></i>', |
| | | 'txt': '<i class="bi bi-filetype-txt" style="color: #5d5a5a"></i>', |
| | | 'mov': '<i class="bi bi-film"></i>', |
| | | 'mp3': '<i class="bi bi-filetype-mp3"></i>' |
| | | 'mp3': '<i class="bi bi-filetype-mp3"></i>', |
| | | 'jpg':'<i class="bi bi-file-image" style="color: #45b8ab"></i>', |
| | | 'key':'<i class="bi bi-filetype-key" style="color: #3fa2e3"></i>' |
| | | }, |
| | | previewFileExtSettings: { |
| | | 'doc': function(ext) { |
| | |
| | | }, |
| | | 'mp3': function(ext) { |
| | | return ext.match(/(mp3|wav)$/i); |
| | | }, |
| | | 'jpg':function (ext) { |
| | | return ext.match(/(jpg|png|jpeg|gif|ico|pic|bmp|tif)$/i); |
| | | } |
| | | }, |
| | | isNodragging:false,//自定义属性,在只读状态是否可以执行拖拽 |
| | |
| | | fileInputId.fileinput('upload'); |
| | | }).on('filebatchuploadsuccess', function(event, data) { |
| | | // 此事件仅在ajax上传且文件批量上传成功之后触发 |
| | | let tmp={}; |
| | | let oldKey=id.val();// 旧的值 |
| | | let newKey=data.response.uuid?data.response.uuid+";":""; // 新的值 |
| | | if(oldKey!=""){ |
| | | var keys=oldKey.split(";"); |
| | | for(var i=1;i<keys.length;i++){ |
| | | newKey=newKey.replace(";"+keys[i]+";",";"); |
| | | fileUploadCount_Panel += data.files.length; |
| | | arrayFileSeq_Panel = JSON.parse(data.response.seqMap); |
| | | arrayFileType_Panel = JSON.parse(data.response.fileExtMap); |
| | | let tmp = {}; |
| | | let oldKey = id.val();// 旧的值 |
| | | let newKey = data.response.uuid ? data.response.uuid + ";" : ""; // 新的值 |
| | | if (oldKey != "") { |
| | | var keys = oldKey.split(";"); |
| | | for (var i = 1; i < keys.length; i++) { |
| | | newKey = newKey.replace(";" + keys[i] + ";", ";"); |
| | | } |
| | | } |
| | | tmp.key=newKey; |
| | | tmp.key = newKey; |
| | | tmp.type=data.response.type; |
| | | tmp.filedId=name; |
| | | tmp.oldKey=oldKey; |
| | |
| | | data.thumbs.attr("data-key",JSON.stringify(tmp)); |
| | | } |
| | | // 格线调用 |
| | | if(g){ |
| | | let grid=g.id; |
| | | let obj=unid+";"+data.response.fileType;// by by danaus 2020/4/30 11:32 |
| | | grid.SetValue(g.row, g.col,obj,0); |
| | | if(g) { |
| | | let grid = g.id; |
| | | let obj = unid + ";" + data.response.fileType;// by danaus 2020/4/30 11:32 |
| | | grid.SetValue(g.row, g.col, obj, 0); |
| | | grid.RefreshCell(g.row, g.col); |
| | | } |
| | | }).on('filebeforedelete', function(event, params) { |
| | |
| | | }).on('filedeleted', function(event, key) { |
| | | // 在删除initialPreview内容集中的每个缩略图文件之后触发此事件 |
| | | // 格线调用 |
| | | debugger; |
| | | fileUploadCount_Panel--; |
| | | if (isGrid != null && isGrid == 'grid') { |
| | | if (g) { |
| | | let grid = g.id; |
| | |
| | | } else { // 面板 |
| | | let va = id.val(); |
| | | key = key.split(";")[1]; |
| | | delete arrayFileType_Panel[key]; |
| | | va = va.replace(";" + key, ""); |
| | | if (va.indexOf(";") < 0) { |
| | | va = ""; |
| | |
| | | } |
| | | }).on('filesuccessremove', function(event, val) { |
| | | // 使用缩略图删除按钮删除成功上传的缩略图后,会触发此事件 |
| | | if(val!=null && val.key!=null){ |
| | | let vals = val.key.split(";"); |
| | | let uuid; |
| | | let seq = 0; |
| | | if (vals.length > 1) { |
| | | uuid = val.key.split(";")[0]; |
| | | seq = val.key.split(";")[1]; |
| | | } |
| | | debugger; |
| | | if(val!=null && val.key!=null) { |
| | | let title = val.title;//文件名称,用于查找对应的seq |
| | | let delSeq = arrayFileSeq_Panel[title];//对应删除的seq |
| | | let uuid = val.key.split(";")[0]; |
| | | $.ajax({ |
| | | type: "POST", |
| | | dataType: 'json', |
| | | url: '/attachment/deleteOwnerAttachment.do?type=' + val.type + '&unid=' + uuid + '&seq=' + seq, // 删除路径 |
| | | url: '/attachment/deleteOwnerAttachment.do?formid=' + formid_Panel + '&fieldid=' + val.filedId + '&ishd=1&type=' + val.type + '&unid=' + uuid + '&seq=' + delSeq, // 删除路径 |
| | | success: function (data) { |
| | | let newUid = val.oldKey == "" ? "" : val.oldKey.replace(";" + seq, ""); |
| | | fileUploadCount_Panel--; |
| | | delete arrayFileSeq_Panel[title]; |
| | | delete arrayFileType_Panel[uuid + ";" + delSeq]; |
| | | // let newUid = val.oldKey == "" ? "" : val.oldKey.replace(";" + delSeq, ""); |
| | | let newUid = val.key == "" ? "" : val.key.replace(";" + delSeq, "");//by danaus 2024-02-21 16:56 |
| | | id.val(newUid); |
| | | } |
| | | }); |
| | | } |
| | | }).on('filezoomshown', function(event, params) { |
| | | //此事件在模态对用户可见后触发(将等待 CSS 转换完成) |
| | | Event.imageEvent(); |
| | | Event.NumberofSummary=params.NumberofSummary||[]; |
| | | Event.imageEvent(params); |
| | | }).on('filezoomprev', function(event, params) { |
| | | //事件在缩放预览模式下,当点击上一个导航按钮查看上一个文件时触发(也在缩放模式下按下键盘左箭头时触发) |
| | | Event.imageEvent(); |
| | | setTimeout(function(){//这个事件不是渲染完进入,导致提前渲染图片查看器。 没什么决绝办法用setTimeout吧 |
| | | Event.imageEvent(params) |
| | | },300); |
| | | }).on('filezoomnext', function(event, params) { |
| | | //该事件在缩放预览模式下,当点击下一个导航按钮查看下一个文件时触发(也在缩放模式下按下键盘右箭头时触发)。 |
| | | Event.imageEvent(); |
| | | setTimeout(function(){ |
| | | Event.imageEvent(params) |
| | | },300); |
| | | }); |
| | | },imageEvent:function () { |
| | | let kv = $('#kvFileinputModal .file-zoom-content img'); |
| | | if (kv.length > 0) { |
| | | try { |
| | | isFileInputImage = new Viewer(kv[0], { |
| | | title: false, viewed: function () { |
| | | if (isFileInputImage.imageCurrent != null) { |
| | | isFileInputImage.rotate(isFileInputImage.imageCurrent); |
| | | } |
| | | },imageEvent:function (param) { |
| | | try { |
| | | let that=this; |
| | | isFileInputImage = new Viewer(param.modal.find('ul')[0], { |
| | | title: true, inline: true, button: false, |
| | | viewed: function (e) {// 图片渲染完后进入,旋转大图片 |
| | | if(typeof isFileInputImage!='undefined' && isFileInputImage!=null){ |
| | | that.imageAjax(param.modal,isFileInputImage); |
| | | } |
| | | }); |
| | | isFileInputImage.imageCurrent = 0 |
| | | } catch (e) { |
| | | isFileInputImage = null; |
| | | } |
| | | }); |
| | | isFileInputImage.imageCurrent = 0 |
| | | isFileInputImage.view(param.viewerIndex || 0); |
| | | if(typeof isFileInputImage!='undefined' && isFileInputImage!=null){ |
| | | that.imageAjax(param.modal,isFileInputImage); |
| | | } |
| | | } catch (e) { |
| | | isFileInputImage = null; |
| | | } |
| | | },imageAjax:function (modal,isfile) { |
| | | let seq = 0; |
| | | let number = this.NumberofSummary; |
| | | let image = isfile.image.currentSrc; |
| | | let i = image.split("/"); |
| | | i = i[i.length - 1]; |
| | | let p = i.split('@p@'); |
| | | if (p.length == 2) { |
| | | seq = p[1].split('.')[0]; |
| | | } |
| | | if (number.length > 0) { |
| | | for (let s = 0; s < number.length; s++) { |
| | | if (seq == number[s].seq) { |
| | | if(number[s].state==-1){//没有查看次数后隐藏 |
| | | modal.find('.viewer-canvas').find('img').hide(); |
| | | modal.find('.viewer-canvas').html('<div style="visibility: visible;font-size: 30px;padding-top: 100px">'+number[s].describe+'</div>'); |
| | | } |
| | | modal.find('.kv-zoom-caption').html(number[s].fileName); |
| | | modal.find('.kv-zoom-caption').attr('title', number[s].fileName); |
| | | modal.find('.viewsNumber').html(number[s].totaViewNums); |
| | | modal.find('.downNumber').html(number[s].totaDownNums); |
| | | modal.find('.numberofviews').attr('title','总查看次数:'+number[s].totaViewNums); |
| | | modal.find('.amountofdownloads').attr('title','总下载次数:'+number[s].totaDownNums); |
| | | if(number[s].hasPermission){ |
| | | modal.find('.zoom-view').show(); |
| | | modal.find('.viewNums').html(number[s].viewNums); |
| | | modal.find('.zoom-view').attr('title','允许查看次数:'+number[s].allowViewNums+'\n您已查看:'+number[s].viewNums); |
| | | modal.find('.zoom-down').show(); |
| | | modal.find('.downNums').html(number[s].downNums); |
| | | modal.find('.zoom-down').attr('title','允许下载次数:'+number[s].allowDownNums+'\n您已下载:'+number[s].downNums); |
| | | }else{ |
| | | modal.find('.zoom-view').hide(); |
| | | modal.find('.zoom-down').hide(); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return o; |
| | | } |
| | | //附件权限控制设置 |
| | | // function readApproved(editstatus,docstatus,id,userCode,index){ |
| | | // let isReadOnly = true;//默认只读 |
| | | // //取SQL条件表达式结果 |
| | | // let expr = getDoc(id + "_expr", ".value"); |
| | | // let isEditUpload = ((expr != null && expr == 2) || expr == null) ? true : false; |
| | | // let readonly = panMain[index] != null ? panMain[index].panInfo[id].ReadOnly : 0;//是否只读 |
| | | // if (readonly != 1 && (isNew == 1 || (predocstatus == docstatus && isEditUpload))) { |
| | | // //可编辑附件 |
| | | // isReadOnly = false; |
| | | // } |
| | | // let editstatusArra = (editstatus != null && editstatus != "") ? editstatus.join(";") : []; |
| | | // let isEditstatus = $.inArray(docstatus, editstatusArra);//是否可以编辑 |
| | | // let curChecker = getDoc("curchecker", ".value");//当前审核人 |
| | | // let ApprovedUserCodes = getDoc("approvedusercodes", ".value");//用于记录已审核人列表 |
| | | // if (readonly != 1 && (predocstatus != docstatus && isEditUpload && isEditstatus) && |
| | | // ((curChecker != "" && curChecker.indexOf(userCode) != 1) || |
| | | // (curChecker == "" && ApprovedUserCodes.indexOf(userCode) != 1))) { |
| | | // //可编辑附件 |
| | | // isReadOnly = false; |
| | | // } |
| | | // return isReadOnly; |
| | | // } |
| | | /** |
| | | *-----end-----上面的方法是针对9/19附件控件类型 xin 2021-5-13 09:59:58 |
| | | */ |
| | |
| | | * @param usercode 账号 |
| | | * @param uuid uuId |
| | | * @param maxFileSize 上传附件大小限制值 |
| | | * @param index 面板元素(多个面板时候就是0,1,2) |
| | | */ |
| | | function onfileiput(formid,id,controlType,docstatus,rowid,usercode,uuid,maxFileSize){ |
| | | //获取到插件基本属性 |
| | |
| | | var isReadOnly = false; |
| | | try { |
| | | // 上传附件需要的参数 |
| | | formid_Panel = formid; |
| | | var param = {}; |
| | | var panelautoSave = "";//标记是否为单据 |
| | | var readerUserCodes = $('#readerusercodes').val(); |
| | |
| | | try { |
| | | param.doccode = $('#doccode').val(); |
| | | if (param.doccode == undefined) { |
| | | param.doccode = panMain[panIndex].panelAuditValue.doccode; |
| | | param.doccode = panMain[panIndex].panelAuditValue.doccode;//panMain[panIndex].panelAuditValue.doccode; |
| | | } |
| | | if (param.doccode && readerUserCodes != undefined && readerUserCodes != '') { |
| | | param.readerusercodes = readerUserCodes; |
| | | } |
| | | } catch (e) { |
| | | param.doccode = panMain[panIndex].panelAuditValue.doccode; |
| | | param.doccode = panMain[panIndex].panelAuditValue.doccode;//panMain[panIndex].panelAuditValue.doccode; |
| | | } |
| | | if (formType && (formType == 5 || formType == 9 |
| | | || formType == 15 || formType == 8 |
| | |
| | | var ed = panMain[i].picState[id].split(";pb#"); |
| | | param.headflag = ed[0]; |
| | | param.editstatus = (ed.length > 1 && ed[1] != null ? ed[1] : ed[0]); |
| | | // isReadOnly=readApproved(param.editstatus,docstatus,id,usercode,index); |
| | | if (param.editstatus != "") { |
| | | if ((";" + param.editstatus + ";").indexOf(";" + docstatus + ";") > -1) { |
| | | isReadOnly = false; |
| | | } else { |
| | | isReadOnly = true; |
| | | //ApprovedUserCodes //用于记录已审核人列表 |
| | | } |
| | | } |
| | | } |
| | |
| | | fileInput.option.otherActionButtons = '';//隐藏权限 |
| | | fileInput.option.isNodragging=true;//禁止拖拽(自定义) |
| | | } |
| | | fileInput.option.browseOnZoneClick = !isReadOnly;//是只读状态就禁用点击区域上传附件功能 |
| | | fileInput.option.browseOnZoneClick = !isReadOnly;//是只读状态就禁用点击区域上传附件功能(false表示禁用) |
| | | fileInput.option.maxFileSize = maxFileSize;//上传大小(kb) |
| | | var encrypt = new JSEncrypt(); |
| | | encrypt.setPublicKey(rsakey.pubkey); |
| | |
| | | jsons[i].unid + "@p@" + jsons[i].seq, jsons[i].domain, jsons[i].dbid, |
| | | false, 60, 60, jsons[i].orgFileType); |
| | | //文件显示信息 |
| | | let title = '文件名:' + jsons[i].originalFileName + |
| | | ' \n类型:' + jsons[i].fileType + |
| | | ' \n大小:' + jsons[i].fileSizeStr + |
| | | ' \n上传者:' + jsons[i].authorName + |
| | | ' \n上传时间:' + jsons[i].uploadTimeStr; |
| | | let title = '文件名:' + jsons[i].originalFileName + |
| | | ' \n类型:' + jsons[i].fileType + |
| | | ' \n大小:' + jsons[i].fileSizeStr + |
| | | ' \n上传者:' + jsons[i].authorName + |
| | | ' \n上传时间:' + jsons[i].uploadTimeStr + |
| | | ' \n\n总查看次数:' + jsons[i].totalViewNums + |
| | | ' \n总下载次数:' + jsons[i].totalDownNums; |
| | | if(jsons[i].hasPermission){ |
| | | title += ' \n\n上传者【' + jsons[i].authorName + '】授权您:' |
| | | title += ' \n允许查看次数:' + jsons[i].allowViewNums + |
| | | ' \n您已查看:' + jsons[i].viewNums + '\n'; |
| | | title += ' \n允许下载次数:' + jsons[i].allowDownNums + |
| | | ' \n您已下载:' + jsons[i].downNums; |
| | | let msg="无时间限制" |
| | | if(jsons[i].dateFlag==0){ |
| | | msg="允许访问:"+jsons[i].startTime.split(" ")[1]+" ~ "+jsons[i].endTime.split(" ")[1]; |
| | | } |
| | | if(jsons[i].dateFlag==1){ |
| | | msg="允许访问:"+jsons[i].startTime.substring(0,jsons[i].startTime.length-3)+" ~ "+jsons[i].endTime.substring(0,jsons[i].endTime.length-3); |
| | | } |
| | | title +='\n\n'+msg; |
| | | } |
| | | //下载地址 |
| | | let Down = jsons[i].domain + "/attachment/downLoadAttachment.do?filePath=" + |
| | | jsons[i].unid + "@p@" + jsons[i].seq + "_" + jsons[i].dbid + "_" + |
| | |
| | | // 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'; |
| | | if (jsons[i].fileType == 'office') {//office类型需要 |
| | | fileURL = encodeURIComponent(fileURL); |
| | | } |
| | | fileInput.option.initialPreview.push(fileURL); |
| | |
| | | 'time': jsons[i].uploadTimeStr, //上传开始时间 |
| | | 'name': jsons[i].authorName, //作者名称 |
| | | 'size': jsons[i].fileSizeStr, // 上传的图片大小 |
| | | 'type': jsons[i].fileType, // 上传的图片类型 |
| | | 'type': jsons[i].allowView?jsons[i].fileType:'lock', // 上传的图片类型 |
| | | 'filename': jsons[i].originalFileName,//jsons[i].physicalFile, //物理文件 |
| | | 'filetype': jsons[i].fileType + '/' + jsons[i].orgFileType, |
| | | 'title': title,//title |
| | | 'key': jsons[i].unid + ';' + jsons[i].seq,//key |
| | | 'seq':jsons[i].seq, |
| | | 'downloadUrl': jsons[i].allowDownload ? Down : false, // true值时候设置下载地址,否则设置false不显示下载按钮 |
| | | 'downClick':'downFile(this,\''+jsons[i].unid+'\',\''+jsons[i].seq+'\')',//下载按钮onclick事件 xin 2022-12-2 08:40:35 |
| | | 'url': deleURL,// 附件删除路径 |
| | | 'hasZoom': jsons[i].allowView,//是否能查看 |
| | | // 'hasDwn': jsons[i].allowDownload,//是否能下载 |
| | | 'hasDel': jsons[i].allowDelete,//是否能删除 |
| | | 'hasLock': jsons[i].authorCode != null && jsons[i].authorCode == param.usercode ? true : false//是否能显示权限 |
| | | 'hasPermission':jsons[i].hasPermission, |
| | | 'hasLock': jsons[i].authorCode != null && jsons[i].authorCode == param.usercode ? true : false,//是否能显示权限 |
| | | 'viewsNumber':jsons[i].viewNums,//查看次数 |
| | | 'downNumber':jsons[i].downNums//下载次数 |
| | | }); |
| | | } |
| | | // 附件上传路径(组装参数) |
| | |
| | | } |
| | | } |
| | | |
| | | /******图片在图片框内按宽高比例自动缩放!!!***/ |
| | | //更新下载次数 |
| | | function downFile(e,unid,seq) { |
| | | let json={}; |
| | | json.unid=unid; |
| | | json.seqArray=[]; |
| | | json.seqArray.push(seq); |
| | | json.type="down"; |
| | | $.ajax({ |
| | | url: '/attachmentOa/getAllowOa.do', |
| | | type: 'POST', |
| | | data: JSON.stringify(json), |
| | | dataType: 'json', |
| | | // async: false, |
| | | contentType: 'application/json', |
| | | success: function (res) { |
| | | if (res != null && res.code == 0) { |
| | | let dat=res.data; |
| | | if(dat[0]!=null){ |
| | | if((dat[0].state==-1 || dat[0].allowDownNums==dat[0].downNums) && dat[0].allowDownNums!=0){ |
| | | // layui.layer.msg("你在此附件允许下载的次数已经用完"); |
| | | $(e).hide(); |
| | | } |
| | | } |
| | | } |
| | | }, error: function (xmlHttpRequest, textStatus, errorThrown) { |
| | | layui.layer.alert(xmlHttpRequest.responseText); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 图片在图片框内按宽高比例自动缩放!!! |
| | | // Img:要放图片的img元素,onload时传参可用this |
| | | |
| | | // maxHeight :img元素的高度,像素(图片框 最大高度) |
| | |
| | | if (u != null) { |
| | | let s = u.split(";"); |
| | | if (s.length == 2) { |
| | | parent.addTab('', 9763, 10, 'wherePan=unid=\'' + s[0] + '\' and seq=' + s[1]); |
| | | layer.closeAll(); |
| | | layerIndex = layer.open({ |
| | | type: 2,//可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层)。 若你采用layer.open({type: 1})方式调用 |
| | | shade: 0.1, |
| | | title: "维护附件上传权限", //不显示标题 |
| | | area: ['1300px', '650px'], //宽高 |
| | | content: '/general/fileInputoa/uploadPromission.html?unid='+s[0]+'&seq='+s[1], |
| | | cancel: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | success: function(){ |
| | | } |
| | | }); |
| | | // parent.addTab('', 9763, 10, 'wherePan=unid=\'' + s[0] + '\' and seq=' + s[1]); |
| | | } |
| | | } |
| | | } |
| | |
| | | // f:功能号 t:功能类型 sf:自身字段 lf:外表字段 lk:为1时执行存储过程,0显示界面,3弹出层 |
| | | // sd:自表字段 ld:外表字段 isp: ef:where条件语句 mes:提示信息 |
| | | // clo:1表示关闭 |
| | | function funcLink(f, t, sf, lf, lk, sd, ld, isp, ef, mes, ref, clo, autoSave,sortid,messageTip) { |
| | | //rowid,表格当前行id |
| | | function funcLink(f, t, sf, lf, lk, sd, ld, isp, ef, mes, ref, clo, autoSave,sortid,messageTip,rowid) { |
| | | var flag = checkSession(); // session失效后弹出登录框,flag为true时表示已经失效 |
| | | if(flag){ |
| | | return; |
| | |
| | | lfs=lf.split(";"); // 字段分隔固定用; |
| | | sfs=sf.split(split); |
| | | if (sfs.length != lfs.length) { |
| | | $.messager.alert('警告', "请检查外表字段与自身字段是否设置正确!", 'error'); |
| | | $.messager.alert('警告', "外表字段与自身字段个数不一致,请检查外表字段与自身字段是否设置正确!", 'error'); |
| | | return; |
| | | } |
| | | if (mes&&mes.indexOf("&") != -1 && t == "22") { |
| | |
| | | $.messager.confirm('提示', mes, function(r) { |
| | | if (r) { |
| | | funcLink$(f, t, sfs, lfs, lk, sd, ld, isp, ef, ref, clo, |
| | | autoSave, sortid, messageTip, mes); |
| | | autoSave, sortid, messageTip, mes,rowid); |
| | | $('.panel-tool-close').show(); |
| | | }else { |
| | | closeLoading(); //更新客户状态的取消 |
| | |
| | | }, "warning"); |
| | | $('.panel-tool-close').hide(); //取消更新客户状态的弹出框红叉 yang 2020-04-26 |
| | | } else { |
| | | funcLink$(f, t, sfs, lfs, lk, sd, ld, isp, ef, ref, clo, autoSave,sortid,messageTip); |
| | | funcLink$(f, t, sfs, lfs, lk, sd, ld, isp, ef, ref, clo, autoSave,sortid,messageTip,"",rowid); |
| | | } |
| | | // 系统消息 |
| | | if(messageTip!=null && messageTip.indexOf(",")!=-1){ |
| | |
| | | //moreWindowClose(); // 2、3类型更多按钮的关闭事件 |
| | | } |
| | | |
| | | function funcLink$(f, t, sfs, lfs, lk, sd, ld, isp, ef, ref, clo, autoSave, sortid, messageTip, mes) { |
| | | function funcLink$(f, t, sfs, lfs, lk, sd, ld, isp, ef, ref, clo, autoSave, sortid, messageTip, mes,rowid) { |
| | | if (isp && isp == "1") { |
| | | showPwd(f, t, function () { |
| | | funcLink$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo, autoSave, sortid, messageTip, mes); |
| | | funcLink$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo, autoSave, sortid, messageTip, mes,rowid); |
| | | }); |
| | | } else { |
| | | funcLink$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo, autoSave, sortid, messageTip, mes); |
| | | funcLink$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo, autoSave, sortid, messageTip, mes,rowid); |
| | | } |
| | | } |
| | | var savedExecFunclink; |
| | | |
| | | function funcLink$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo, autoSave, sortid, messageTip, mes) { |
| | | function funcLink$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo, autoSave, sortid, messageTip, mes,rowid) { |
| | | savedExecFunclink = null; |
| | | if (t == "22") { |
| | | // autoSave=='1'是要先执行保存 |
| | |
| | | } else { |
| | | savedExecFunclink = $(function () { |
| | | execProc(param[0], param[1], param[2], param[3], param[4], |
| | | param[8], param[9], messageTip, mes); |
| | | param[8], param[9], messageTip, mes,rowid); |
| | | }); |
| | | } |
| | | } else { |
| | | execProc(f, t, sfs, lfs, lk, ref, clo, messageTip, mes); |
| | | execProc(f, t, sfs, lfs, lk, ref, clo, messageTip, mes,rowid); |
| | | } |
| | | } else { |
| | | // autoSave=='1'是要先执行保存 |
| | |
| | | var param = arguments; |
| | | savedExecFunclink = $(function(){ |
| | | funclink$$$(param[0], param[1], param[2], param[3], param[4], |
| | | param[5], param[6], param[7], param[8], param[9]); |
| | | param[5], param[6], param[7], param[8], param[9],rowid); |
| | | }); |
| | | } else { |
| | | var lfsStr=lfs.join(","); // 把传进来的外表字段(数组类型)跟自表字段(数组类型)转换成字符串 |
| | |
| | | |
| | | } |
| | | |
| | | funclink$$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo,messageTip); |
| | | funclink$$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo,messageTip,rowid); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | }catch(e){} |
| | | } |
| | | function funclink$$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo,messageTip) { |
| | | function funclink$$$(f, t, sfs, lfs, lk, sd, ld, ef, ref, clo,messageTip,rowid) { |
| | | |
| | | var rows=[]; |
| | | var num=0; |
| | | if (typeof (mygrid) != "undefined") { |
| | | rows=mygrid.getFieldForNew(); |
| | | if(rowid!=undefined&&rowid!=""){ |
| | | rows.push(mygrid.Rows[rowid]); |
| | | }else{ |
| | | rows=mygrid.getFieldForNew(); |
| | | } |
| | | if(rows.length==0){ |
| | | num=1; |
| | | }else { |
| | |
| | | prossDate(key, mygrid, rows, k); |
| | | } |
| | | temp = getValue(key, null, rows[k]); |
| | | if(typeof temp!="string"&& temp==false){ |
| | | if(typeof temp!="string"&&typeof temp!="number"&& temp==false){ |
| | | closeLoading(); |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | var execParams = []; // 22窗体传值 lk表示是否打开界面或弹出层 |
| | | function execProc(f, ft, sfs, lfs, lk, ref, clo, exec, mes) { // 储存过程 |
| | | function execProc(f, ft, sfs, lfs, lk, ref, clo, exec, mes,rowid) { // 储存过程 |
| | | var paramVa = ""; |
| | | var t = null; |
| | | var rows = []; |
| | | var num = 0; |
| | | if (typeof (mygrid) != "undefined") { |
| | | rows = mygrid.getFieldForNew(); |
| | | if(rowid!=undefined&&rowid!=""){ |
| | | rows.push(mygrid.Rows[rowid]); |
| | | }else { |
| | | rows = mygrid.getFieldForNew(); |
| | | } |
| | | if(rows.length==0){ |
| | | num=1; |
| | | }else { |
| | |
| | | } |
| | | }catch(e){} |
| | | t = getValue(key,null,rows[k]); |
| | | if(typeof t!="string"&&t==false){ |
| | | if(typeof t!="string"&&typeof t!="number"&&t==false){ |
| | | //没选中格线行数据,返回不执行 |
| | | closeLoading(); |
| | | return; |
| | |
| | | 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, |
| | |
| | | data: { |
| | | "formid": f, |
| | | "param": paramVa, |
| | | "paramFields": lfs.join(";"),//值对应该的字段列表 |
| | | "disableDuplicateSubmitUUID": systemUuid.uuid //by danaus 2019/11/22 11:12 |
| | | }, |
| | | beforeSend: function (XMLHttpRequest) { |
| | |
| | | }, |
| | | success: function (data, textStatus) { |
| | | procCallBack(data, ref, clo); |
| | | if (mes != null && mes != "") { |
| | | if (mes != null && mes != ""&& $.messager.progress != undefined) { |
| | | $.messager.progress('close'); |
| | | } |
| | | }, |
| | |
| | | }, |
| | | error: function () { |
| | | //请求出错处理 |
| | | if (mes != null && mes != "") { |
| | | if (mes != null && mes != ""&& $.messager.progress != undefined) { |
| | | $.messager.progress('close'); |
| | | } |
| | | } |
| | |
| | | closeLoading(); |
| | | } |
| | | function procCallBack(data, ref, clo) { |
| | | |
| | | if (data == null || data == "") {// 什么也没返回 |
| | | $.messager.alert('提示', "进程处理完毕.", "info", function() |
| | | { |
| | | if (data.state != null && data.state == 0) { |
| | | let info = data.data; |
| | | if (info == null) { |
| | | $.messager.alert('提示', '返回错误:' + info, "info"); |
| | | refreshOrClose(ref, clo); |
| | | return; |
| | | } |
| | | let doc = info.linkdocinfo; |
| | | let msg = info.memo; |
| | | if (doc == null || doc == '') { |
| | | var msgInfo = ""; |
| | | if(msg!=null) { |
| | | msgInfo = msg.split("@p@"); |
| | | if(msgInfo.length==2){ |
| | | //有跳转参数 |
| | | $.messager.alert('提示', msgInfo[0], "info", function () { |
| | | redirect( msgInfo[1]); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | $.messager.alert('提示', msg || '进程处理完毕', "info", function () { |
| | | if (typeof (savedExecFunclink) == "function") { |
| | | location.reload(); |
| | | } |
| | | refreshOrClose(ref, clo); |
| | | } |
| | | ); |
| | | } 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: '' |
| | | } |
| | | }); |
| | | }else { |
| | | if (msg != null && msg != '') { |
| | | $.messager.alert('提示', msg, "info", function () { |
| | | redirect(doc); |
| | | }); |
| | | |
| | | return; |
| | | }else { |
| | | redirect(doc); |
| | | } |
| | | }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); |
| | | } 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; |
| | | } |
| | | } |
| | | if(msg!=null) { |
| | | var msgInfo = msg.split("@p@"); |
| | | if(msgInfo.length==2){ |
| | | //有跳转参数 |
| | | $.messager.alert('提示', msgInfo[0], "info", function () { |
| | | redirect( msgInfo[1]); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | $.messager.alert('提示', msg || '出现错误', "info"); |
| | | }else if(data.state != null && data.state==-1007){// |
| | | //百望云平台账号已过期,重新登录 |
| | | $.messager.alert('提示', data.msg, "info", function () { |
| | | /*layer.open({ |
| | | type: 2, |
| | | title: '登录百望云平台', |
| | | maxmin: false, |
| | | skin: 'layui-layer-molv', |
| | | shadeClose: true, //点击遮罩关闭层 |
| | | area : ['1300px' , '800px'], |
| | | content: 'https://www.baiwang.com/mainsite/src/html/login/login.html' |
| | | });*/ |
| | | window.open(data.data.url,'',' width='+ (screen.availWidth - 10) +',height='+ (screen.availHeight-50) +',scrollbars,resizable=yes,toolbar=no'); |
| | | return; |
| | | }); |
| | | |
| | | }else if(data.state != null && data.state==-1008){ |
| | | //百望云平台刷脸验证 |
| | | layer.open({ |
| | | type: 2, |
| | | area: ['788px', '680px'], |
| | | title: ['风控检测', 'font-size:18px;text-align:center;font-weight:600;'], |
| | | resize: false, |
| | | fixed: false, |
| | | shade: 0, |
| | | content: '/js/faceswiping/faceswiping.html', |
| | | isOutAnim: false, |
| | | success: function (layero, index) { |
| | | // 获取弹出的 iframe 页面对象 |
| | | top.layIframeWindow = window[layero.find("iframe")[0]['name']]; |
| | | //obj={info:{taxNo:"xxxx",taxUserName:"张三",authId:"336363636"}} |
| | | // console.log("faceswip:"+JSON.stringify(obj)) |
| | | top.layIframeWindow.faceSwipingInit(data); |
| | | top.layeerFace=layero; |
| | | } |
| | | }); |
| | | }else { |
| | | try{ |
| | | var obj=JSON.parse(data); |
| | | $.messager.alert('提示', obj.msg, "info"); |
| | | }catch (e) { |
| | | $.messager.alert('提示', data || '状态无法识别:' + 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 增加返回生成页面和打开多个功能号多张单的功能 |
| | | $.get(info); |
| | | }else if(info.indexOf("open.callBack|") ==0){//处理第三方返回的数据,打开另一个页卡 |
| | | var url=info.replace("open.callBack|",""); |
| | | // showLayerGrid(url,1,'900px','600px'); |
| | | var perContent= layer.open({ |
| | | info=info.replace("open.callBack|","").split("|"); |
| | | var obj=JSON.parse(info[1]); |
| | | /* var perContent= layer.open({ |
| | | type: 2, |
| | | title: '德立测量单信息', |
| | | maxmin: false, |
| | | skin: 'layui-layer-molv', |
| | | shadeClose: true, //点击遮罩关闭层 |
| | | area : ['1300px' , '800px'], |
| | | content: url //'/app/67/0/cnzh/110502/1/index.jsp' |
| | | content: info[0]+obj.Url //'/app/67/0/cnzh/110502/1/index.jsp' |
| | | }); |
| | | layer.full(perContent); |
| | | layer.full(perContent);*/ |
| | | window.open(info[0]+obj.Url,'',' width='+ (screen.availWidth - 10) +',height='+ (screen.availHeight-50) +',scrollbars,resizable=yes,toolbar=no'); |
| | | }else{ // 打开页面 |
| | | var tt=info.split("|"); |
| | | for(var i=0;i<tt.length;i++){ |
| | |
| | | if (r == "1") { |
| | | if(location) location.reload(); |
| | | }else if(r=="2"){ |
| | | if(mygrid) mygrid.ReloadBody(); |
| | | if(mygrid){ |
| | | mygrid.ReloadBody(); |
| | | mygrid.AllSelected=0;//刷新表格时清除全选状态 by danaus 2023-08-26 15:14 |
| | | } |
| | | } |
| | | if (c == "1") { |
| | | if(parent) parent.closeTab(); |
| | |
| | | } |
| | | |
| | | } |
| | | //自定义控件布局的方法 |
| | | function editCustomControl(){ |
| | | let formid = formId; |
| | | let formtype = formType; |
| | | let docCode = getDoc("doccode", ".value"); |
| | | let queryString = ""; |
| | | let url = "/general/CustomControl/editLayout.html?formId=" + formid + "&formType=" + formtype + "&docCode=" + docCode; |
| | | top.addTab('自定义控件布局', '', '', '', url, '', ''); |
| | | } |
| | | /** |
| | | * top页面info按钮执行函数 |
| | | * @returns |
| | |
| | | function showLoading() { |
| | | $("#loading").show(); |
| | | } |
| | | function closeLoadingButton(){ |
| | | let close = $(".loadingClose"); |
| | | if (close) {close.remove();} |
| | | $(".loadingMsg").after("<p class=\"loadingClose\">" + |
| | | "<button class='easyui-linkbutton l-btn l-btn-small' onclick='javascript: closeLoading()'>关闭" + |
| | | "</button></p>"); |
| | | } |
| | | function closeLoading() { |
| | | $("#loading").hide(); |
| | | } |
| | | //错误异常的捕获 xin 2023-8-22 10:34:29 |
| | | window.onerror=function (message, source, lineno, colno, error) { |
| | | closeLoadingButton(); |
| | | console.log(message); |
| | | return true; // 防止异常的默认行为 |
| | | } |
| | | /** ***************************************** */ |
| | | Object.extend = function(destination, source) { |
| | |
| | | } |
| | | if (Warnnessage == "" || Warn()) { |
| | | var proParam = ""; |
| | | let doccodes=[];//多个单据打印的处理(更新打印次数用到) |
| | | if ($.trim(param) != "") { |
| | | if (param.indexOf("@formid") != -1) { |
| | | param = param.replaceAll("@formid", formId); |
| | |
| | | continue; |
| | | } |
| | | t = getValue(tempx.toLowerCase(),null,rows[k]); |
| | | if (t==null) |
| | | if (t==null){ |
| | | t = tempx; |
| | | }else{ |
| | | if (tempx.toLowerCase() == "doccode" && t != "") {//如果获取到的是单据固定字段名称进入处理 |
| | | doccodes.push(t); |
| | | } |
| | | } |
| | | //43控件处理 |
| | | let panM = panMain[panIndex]; |
| | | if (panM != null) { |
| | | if (panM.panInfo[tempx.toLowerCase()] != null) { |
| | | if (panM.panInfo[tempx.toLowerCase()].controltype == 43) { |
| | | t = $("#" + tempx.toLowerCase()).val(); |
| | | if (t != null && t != "") { |
| | | if (t instanceof Array) { |
| | | t = t.join("#p#");//用分号(;)做间隔的话再传参后台会被截断 |
| | | } |
| | | } else { |
| | | t = ""; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | proParam += t; // 组装值 |
| | | } |
| | | proParam +=";"; |
| | |
| | | // var servlet = "/" + format.toLowerCase() + ".do?" |
| | | var servlet="/printReport.do?m="+format.toLowerCase() |
| | | var doccode = getDoc("doccode", ".value");//只取表头 by danaus 2022/8/17 11:10 getValue('doccode'); |
| | | if (doccode == null && doccodes.length > 0) {//没找到这个单号,多个单号数组里有值的话就赋值 xin 2023-10-13 10:57:54 |
| | | doccode = doccodes.join(";"); |
| | | } |
| | | var url = "formId=" + formid + "&reportId=" + reportid + "¶meter=" + proParam+";" |
| | | + "&p=" + Math.round(Math.random() * 100000); |
| | | //html方法打印 |
| | |
| | | if ((C_Grid != undefined && C_Grid != "" && eval('(' + C_Grid + ')').toP != "" && eval('(' + C_Grid + ')').toP != "null") |
| | | || $.trim(postToThis).length > 0 || self_datafields != "") { |
| | | $("#tpselect").show(); |
| | | $(".selected-icon-container").show(); |
| | | } |
| | | parent.numId = ""; // 设置单号的值 |
| | | }) |
| | |
| | | },'json') |
| | | }) |
| | | |
| | | /** |
| | | * css样式编辑器 xin 2024-1-29 10:34:34 |
| | | * @param grid |
| | | * @param panel |
| | | */ |
| | | //getTextCssEdit(option)//option是格线当前行触发的对象可以获取值和返回 |
| | | var textCssOption={}; |
| | | function getTextCssEdit(option){ |
| | | if (option && option.close) {//关闭 |
| | | if (option.type == 1 && option.value != null) {//给面板赋值 |
| | | $doc(textCssOption.id).val(option.value); |
| | | } |
| | | layer.closeAll(); |
| | | return false; |
| | | } |
| | | let cssText = ""; |
| | | let type = 0; |
| | | let pindex = panIndex; |
| | | textCssOption = option; |
| | | if (option && option.id) {//获取值(面板) |
| | | if (option.index != null) {//取对应元素的控件值 |
| | | panIndex = option.index; |
| | | cssText = $doc(option.id).val(); |
| | | } else { |
| | | cssText = $("#" + option.id).val(); |
| | | } |
| | | type = 1;//面板控件 |
| | | } |
| | | if(option.grid || option.value){//获取值(格线) |
| | | cssText=option.value; |
| | | } |
| | | layer.open({ |
| | | type: 2, |
| | | area: ['400px', '780px'], |
| | | closeBtn: 0, |
| | | isOutAnim: false, |
| | | title: false, |
| | | resize: false, |
| | | fixed: false, |
| | | shade: 0.6, |
| | | skin: 'layui-layer-molv', |
| | | shadeClose: true, // 点击遮罩区域,关闭弹层, |
| | | content: encodeURL('/general/textCssEdit/textCssEdit.html?cssText=' + cssText + '&type=' + type),//cssText有值时候可以传过去 |
| | | move: false, |
| | | success: function (layero, index) { |
| | | // createFormElement(); |
| | | }, cancel: function (index, layero) { |
| | | panIndex = pindex; |
| | | }, end: function () { |
| | | panIndex = pindex; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function checkVersion(){ |
| | | setTimeout(checkVersion, 86400000); |
| | | setTimeout(checkVersion2, 86400000);//24小时调用一次 |