| | |
| | | if (jsonStr.indexOf("{") == 0) { |
| | | jsonStr = jsonStr.substring(1, jsonStr.length - 1); |
| | | } |
| | | var vsd = jsonStr.split(fen); |
| | | var map = {}; |
| | | var vsd = jsonStr.split(fen); |
| | | var vs = (":").split(":"); |
| | | for ( var i = 0; i < vsd.length; i++) { |
| | | vs[0] = vsd[i].substring(0, vsd[i].indexOf(":")); |
| | |
| | | } |
| | | field = (fieldtype == 35 ? field + '_35' : field); |
| | | var Evn = $doc(field);//获取控件对象 |
| | | if($(Evn.doc).attr('type')=="hidden"){//隐藏的执行返回 |
| | | return false; |
| | | } |
| | | // 原先的值 2019-4-2 14:50:53 |
| | | var original = $doc(field + 'text').val(); |
| | | if (original == '' || original == null) { |
| | |
| | | } |
| | | }) |
| | | } |
| | | // url = document.URL; |
| | | // url = url.substring(0, url.lastIndexOf("/") + 1); |
| | | // var params=panPar.getParameter()//获取面板控件所有值 |
| | | // var state=$doc(field).disabled();//当前控件的状态 如:1只读 ,0可编辑 |
| | | // let fieldName=''; |
| | | // let isSuppressBlankLineForDropDown=0; |
| | | // panIndex=pindex;//还原当前控件所在的索引 |
| | | // if(panMain[panIndex].panInfo[field]!=null){ |
| | | // fieldName=panMain[panIndex].panInfo[field].title; |
| | | // isSuppressBlankLineForDropDown=panMain[panIndex].panInfo[field].isSuppressBlankLineForDropDown; |
| | | // } |
| | | // // 执行返回31,2类型控件的数据集合 |
| | | // $.ajax({url:url + panMain[panIndex].controlUrl,// 跳转到对应功能号的panelControlxxxxxx.jsp |
| | | // data:{ |
| | | // 'field' :field,//控件ID |
| | | // 'fieldname':fieldName || '',//控件名称 |
| | | // 'fieldtype' :fieldtype,//控件类型 |
| | | // 'callback' :callback,//是否需要 <<新增>> 下拉进入((是31控件||2控件)&&不是空值&&不是1)添加 xin 2022-7-13 16:57:58 |
| | | // 'params' :params,//页面控件值(全部) |
| | | // 'state':state//当前状态值 |
| | | // }, |
| | | // type:"POST", |
| | | // async:false, |
| | | // dataType:'json', |
| | | // success:function(data) { |
| | | // if (data.status == 0) { |
| | | // var cols; |
| | | // var panl; |
| | | // var option=data.info; |
| | | // switch (fieldtype) { |
| | | // case 35: |
| | | // case 31: |
| | | // case 2: |
| | | // field=(fieldtype==35?field+'_35':field); |
| | | // var Evn=$doc(field);//获取控件对象 |
| | | // // 原先的值 2019-4-2 14:50:53 |
| | | // var original=$doc(field+'text').val(); |
| | | // if(original=='' || original==null){ |
| | | // //有值的情况赋值 |
| | | // original=$(Evn.doc).val(); |
| | | // //针对38特殊窗体 xin 2019-11-21 09:38:05 |
| | | // if(original=='' && formType==38){ |
| | | // original=panMain[panIndex].SpecialType[field]; |
| | | // } |
| | | // } |
| | | // Evn.doc.length=0; |
| | | // if(isSuppressBlankLineForDropDown != 1){ |
| | | // // 添加一个空值 |
| | | // Evn.optionsAdd('',''); |
| | | // } |
| | | // // 下拉控件赋值 xin 2019-5-24 17:55:31 |
| | | // var isEm=false; |
| | | // let isempty=true;//这属性用来判断是否匹配到下拉值,没有那个就清空 |
| | | // for(var o=0;o<option.length;o++){ |
| | | // Evn.optionsAdd(option[o].text, option[o].id); |
| | | // //匹配key 和value |
| | | // if (original == option[o].id ){//|| original == option[o].text) { |
| | | // original = option[o].id; |
| | | // $doc(field+'text').val(original); |
| | | // isempty=false;//匹配到时候改为false |
| | | // } |
| | | // if (option[o].id == '') { |
| | | // isEm = true; |
| | | // } |
| | | // } |
| | | // if (isEm && isSuppressBlankLineForDropDown != 1){ |
| | | // document.getElementById(field).options.remove(0); |
| | | // } |
| | | // if(option.length == 0 || isempty){//如果下拉都没有或匹配不到下拉值,那么field+'text'隐藏的字段值也清空去 xin 2022-11-29 10:17:16 |
| | | // $doc(field+'text').val(''); |
| | | // } |
| | | // //选中之前的值 |
| | | // $(Evn.doc).val(original); |
| | | // // 取得浏览器的userAgent字符串 xin 2018-12-18 09:49:53 |
| | | // var userAgent = navigator.userAgent; |
| | | // if (userAgent.indexOf("Chrome") > -1){// 针对谷歌浏览器 |
| | | // Evn.doc.blur(); |
| | | // } |
| | | // break; |
| | | // case 43://返回给43控件处理 |
| | | // select2Options=option; |
| | | // break; |
| | | // } |
| | | // } else if (data.status == 1) { |
| | | // if (data.info != "") { |
| | | // $.messager.alert("操作提示",data.info,"warning"); |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | if (fieldtype == 43) {//43控件特殊处理 |
| | | panPar.select2PostValue(field, fieldtype, "", pindex, true, function (json) { |
| | | let select2Evt=$("#"+field); |
| | | if (select2Evt) { |
| | | $(select2Evt).empty();//清空之前的option值 |
| | | for (var i = 0; i < json.length; i++) { |
| | | $(select2Evt).append('<option value="' + json[i].id + '">' + json[i].text + '</option>'); |
| | | } |
| | | //有值的情况赋值 |
| | | panIndex=pindex; |
| | | var valt = $doc(field + 'text').val(); |
| | | valt = (valt == null ? "" : valt); |
| | | if (valt == '' && formType == 38) { |
| | | valt = panMain[panIndex].SpecialType[field] != null ? panMain[panIndex].SpecialType[field] : ''; |
| | | } |
| | | if (valt != '') { |
| | | valt = valt.replace(/,/g, ";").split(';'); |
| | | } |
| | | $(select2Evt).val(valt).trigger('change'); |
| | | } |
| | | }); |
| | | } |
| | | }catch(e){ |
| | | $.messager.alert("操作提示","获取31控件下拉数据出错!"+e,"warning"); |
| | | } |
| | |
| | | $(select2Evt).val(original).trigger('change'); |
| | | }); |
| | | }).on("select2:select", function (evt) { |
| | | if (evt.params.data.id == -1) { //新增全部 xin 2023-6-2 14:29:54 |
| | | $("#" + field).select2("val", [-1]); //清空其他选项 |
| | | $("#" + field).val(allValue).trigger("change"); |
| | | var data =evt.params.data; |
| | | if (data.id == -1) { //新增全部 xin 2023-6-2 14:29:54 |
| | | $(this).select2("val", [-1]); //清空其他选项 |
| | | $(this).val(allValue).trigger("change"); |
| | | return; |
| | | } |
| | | var element = evt.params.data.element; |
| | | var $element = $(element); |
| | | $element.detach(); |
| | | $(this).append($element); |
| | | $(this).trigger("change"); |
| | | var original = $(this).select2('val') || [];//已经被选中的值.不存在就实例化 |
| | | original.push(data.id);//添加进去 |
| | | $(this).val(original).trigger("change"); |
| | | getSelect31(field);//43控件关联31控件 xin 2022-4-1 17:06:04 |
| | | panMain[panIndex].isChange = 1; |
| | | }).on("select2:unselect", function (evt) { |
| | | var element = evt.params.data.element; |
| | | var $element = $(element); |
| | | $element.remove(); |
| | | var original = $(this).select2('val');//已经被选中的值 |
| | | if (original == null) { |
| | | return; |
| | | } |
| | | var data =evt.params.data; |
| | | if (data.id == -1) { //新增全部 xin 2023-6-2 14:29:54 |
| | | $(this).select2("val", [-1]); //清空其他选项 |
| | | $(this).val([]).trigger("change"); |
| | | return; |
| | | } |
| | | original = $.grep(original, function (value) { |
| | | return value !== data.id; // 删除值为data.id的元素 |
| | | }) |
| | | $(this).val(original).trigger("change");// |
| | | panMain[panIndex].isChange = 1; |
| | | }); |
| | | //这里异步加载数据回来填充 xin 2023-7-18 15:41:13 |
| | | let async = (formType != 18 ? true : false);//默认是异步请求,18窗体特殊处理下 xin 2023-7-19 17:25:05 |
| | | let selectId = panMain[pindex].select;//存在级联问题 就同步加载 |
| | | async = selectId[field] != null ? false : async; |
| | | that.select2PostValue(field, fieldtype, "", pindex, async, function (json) { |
| | | if (select2Evt) { |
| | | $(select2Evt).empty();//清空之前的option值 |
| | | for (var i = 0; i < json.length; i++) { |
| | | $(select2Evt).append('<option value="' + json[i].id + '">' + json[i].text + '</option>'); |
| | | } |
| | | //有值的情况赋值 |
| | | panIndex=pindex; |
| | | var valt = $doc(field + 'text').val(); |
| | | if (valt == '' && formType == 38) { |
| | | valt = panMain[panIndex].SpecialType[field] != null ? panMain[panIndex].SpecialType[field] : ''; |
| | |
| | | } |
| | | if (qianzhi) { // 强制判断 |
| | | // if (id != col) { //注释 注释原因:在18窗体执行三点弹出过到另一个18窗体会导致获取字段在另一个18窗体查询不到 xin 2023-6-7 16:24:32 |
| | | if (value != "") { |
| | | where += wais[i] + " like '" + "@~"+ value + "@~'" |
| | | + addFuHao;// and |
| | | } else { |
| | | $.messager.alert("操作提示", this.panInfo[col].title + "没有录入!","warning"); |
| | | openTree = false; |
| | | break; |
| | | } |
| | | // if (value != "") {//注释原因:强制判断进入时候 值是空值也进行组装,空值不应该出现页面提示 xin 2024-7-2 14:52:27 |
| | | if (value != null) { |
| | | where += wais[i] + " like '" + "@~" + value + "@~'" |
| | | + addFuHao;// and |
| | | } else { |
| | | // $.messager.alert("操作提示", this.panInfo[col].title + "没有录入!", "warning"); |
| | | $.messager.alert("操作提示", this.panInfo[col].title + "控件不存在,请检查。", "warning"); |
| | | openTree = false; |
| | | break; |
| | | } |
| | | // } else { |
| | | // // by danaus 2017-7-21 替换^ |
| | | // colDan = "@G@" + wais[i] + " like '" + "@~"+ value + "@~'"; |
| | |
| | | var fieldId=null;//字段Id |
| | | var value = null;//字段值 |
| | | var fieldType=0;//控件类型 xin 2019-12-9 16:54:53 |
| | | let keyinput=0; |
| | | try{ |
| | | for (var i = 0; i < cols.length; i++) { |
| | | if (cols[i] != "") { |
| | | fieldId = cols[i]; |
| | | if (panMain[panIndex] != null && panMain[panIndex].panInfo[fieldId] != null) { |
| | | fieldType = panMain[panIndex].panInfo[fieldId].controltype;//获取类型 |
| | | keyinput=panMain[panIndex].panInfo[fieldId].keyinput; |
| | | } |
| | | value = doc(fieldId).value.Trim();//获取值 |
| | | |
| | |
| | | value = value.split(" ")[0] + " 00:00:00"; |
| | | } |
| | | } |
| | | //客户说看到很烦,暂时注释 xin 2023-11-24 17:25:49 |
| | | // if (value == "" && keyinput == 1) {//必录提示 xin 2023-9-18 16:52:21 |
| | | // let isHiden = $("#" + fieldId).prop("type"); |
| | | // if (isHiden && isHiden != "hidden") {//不是隐藏字段的必录就要提示出来 |
| | | // layer.msg('页面有必录字段没有录入,可能会导致数据出错。'); |
| | | // } |
| | | // } |
| | | where += colsInDate[i] + "='" + value + "' and "; |
| | | } |
| | | } |
| | |
| | | } |
| | | // 权限控制是否能修改 xin 2018-12-9 11:23:32 |
| | | if ($('#' + key + '_expr').length > 0 && $('#' + key + '_expr').val() == '0') { |
| | | delete item[key]; |
| | | if ($('#' + key + '_expr_val') != null) {//是加密的需要提交 |
| | | item[key] = $('#' + key + '_expr_val').val(); |
| | | item[key + '_expr'] = 0; |
| | | } else { |
| | | delete item[key]; |
| | | } |
| | | } |
| | | //是单据类型窗体进入(特殊字段处理)xin 2021-3-10 10:00:26 |
| | | if (';5;8;16;496;'.indexOf(';' + formType + ';') != -1) { |
| | |
| | | $.post(url, '', function(date) { |
| | | getBackElse = false; |
| | | callBack(col, date); |
| | | getSelect31(col);//关联有31需要执行 |
| | | }); |
| | | } |
| | | } |
| | |
| | | + replacePageValue(tiaojian); |
| | | if (openTree) { |
| | | url = encodeURI(encodeURI(url));// 必须两次 |
| | | $.ajaxSettings.async = false;//同步 |
| | | $.post(url, '', function(date) { |
| | | getBackElse = false; |
| | | callBack(col, date,waiziduan,benziduan); |
| | |
| | | getSelect31(id); |
| | | } |
| | | }); |
| | | $.ajaxSettings.async = true; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if (value == "") { |
| | | for ( var j = 0; j < szc.length; j++) { |
| | | if (szc[j].indexOf("#") == -1) {// 是3类型控件才执行 |
| | | no_load_first = false;// 不要让底下赋值再进入此方法,避免死循环 |
| | | if(formType != 496)// 这条件是如果496的其他页卡文本框填写信息后,光标离开导致主面板42类型控件的信息清空。 |
| | | setDoc(szc[j], ".value=''");// 解决三点弹出清空关联 |
| | | } else { |
| | | $.messager.alert("操作提示", cols[i] |
| | | + "字段的清空关联字段" |
| | | + szc[j] |
| | | .substring(0, szc[j].length - 1) |
| | | + "在页面上没有!","warning"); |
| | | } |
| | | } |
| | | if (szc[j].indexOf("#") == -1) {// 是3类型控件才执行 |
| | | no_load_first = false;// 不要让底下赋值再进入此方法,避免死循环 |
| | | // if (formType != 496)// 这条件是如果496的其他页卡文本框填写信息后,光标离开导致主面板42类型控件的信息清空。(已不需这样排除) |
| | | setDoc(szc[j], ".value=''");// 解决三点弹出清空关联 |
| | | } else { |
| | | $.messager.alert("操作提示", cols[i] |
| | | + "字段的清空关联字段" |
| | | + szc[j] |
| | | .substring(0, szc[j].length - 1) |
| | | + "在页面上没有!", "warning"); |
| | | } |
| | | } |
| | | no_load_first = true;// 但还是还原,以被后面程序使用 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | // 设置只读,加载用 |
| | | // 设置只读,加载用(加载9802设置的内容) |
| | | set_read_load : function(readList, docstatePan, isnew, db, info) { |
| | | // reads拆分0:【0不是只读;pb#用docstatus控制是否可编辑|多值用分号(;)隔开;pb#字段Id;pb#是否设置了按钮;pb#控件类型 |
| | | // 】 |
| | | // reads拆分0:【0不是只读;pb#用docstatus控制是否可编辑|多值用分号(;)隔开;pb#字段Id;pb#是否设置了按钮;pb#控件类型】 |
| | | // redds拆分1:【1是只读;pb#字段Id;pb#控件类型】 |
| | | // redds拆分2:【2是OA审核按钮;pb#有按钮的字段Id;pb#buttonID按钮的Id;pb#OA审核按钮设置用docstatus控制是否可显示|多值用分号(;)隔开】 |
| | | // var readList = reads;//reads.split(";fen#"); |
| | |
| | | no_load_first = false;// 只有加载时触发此事件,表明其为加载时,防止程序未知处把其值改了 |
| | | var filedIs = null; |
| | | var bzc = true; |
| | | var sto = true;// 检查用到 |
| | | var hasExpr = false;//表达式值 |
| | | //如果是496类型的话,docstatePan有可能在子表的时候获取不到值,导致状态值不对,所以在这样获取主表里的docstaePan值 xin 2021-12-20 10:22:33 |
| | | docstatePan=getDoc("docstatus",".value");// 获取单据的单据状态 |
| | | docstatePan=(docstatePan==""?0:docstatePan); |
| | | if (readList != null && readList.length > 0) { |
| | | for ( var i = 0; i < readList.length; i++) { |
| | | sto = true; |
| | | hasExpr = false; |
| | | if (readList[i] != "") { |
| | | readIs = readList[i];// .split(";pb#"); |
| | | // readIs[0]:0不是只读 ,1是只读,2有OA审核按钮设置 |
| | | // readIs[0]的值:0是可编辑 ,1是只读,2有OA审核按钮设置 |
| | | switch (parseInt(readIs[0])) { |
| | | case 0: |
| | | case 0://可编辑状态 |
| | | if (this.formtypeOne != 1) { |
| | | if (getDoc(readIs[2] + '_expr', '') != null |
| | | && getDoc(readIs[2] + '_expr', '.value') != ""// 少了==1会导致9902设置权限得不到控制。 |
| | | && (panMain[panIndex].bolCopy !=1 ||(getDoc(readIs[2] + '_expr', '.value') == 0))) {// panMain[panIndex].bolCopy检查是否是复单,是就不进入。 |
| | | sto = false; |
| | | let exprValue = getDoc(readIs[2] + '_expr', '.value');//权限表达式 0隐藏,1显示,2可编辑 |
| | | if (exprValue != null) {//有设置到表达式 |
| | | if (exprValue == "") { |
| | | hasExpr = true;//可编辑状态 |
| | | } else if (exprValue == 2) { |
| | | hasExpr = true;//可编辑状态 |
| | | } |
| | | } else { |
| | | hasExpr = true |
| | | } |
| | | if (getDoc(readIs[2] + '_expr', '') != null |
| | | && getDoc(readIs[2] + '_expr', '.value') != "" |
| | | && getDoc(readIs[2] + '_expr', '.value') == 2) { |
| | | break; |
| | | } |
| | | if (sto) { |
| | | this.setRead(readIs[1], docstatePan, isnew, |
| | | readIs[2], readIs[3], 'curchecker', db, |
| | | parseInt(readIs[4])); |
| | | }else{ |
| | | // if(getDoc(readIs[2] + '_expr', |
| | | // '.value') != 1){ |
| | | this.setReadOnly(readIs[2],parseInt(readIs[4]));// readIs[3] |
| | | // setDoc(readIs[2], |
| | | // ".disabled=disabled");// 不能进行操作 |
| | | // } |
| | | if (hasExpr) {//权限表达式 true可编辑状态 |
| | | //这个curchecker字段表示当前审核人字段 |
| | | this.setRead(readIs[1], docstatePan, isnew, readIs[2], readIs[3], 'curchecker', db, parseInt(readIs[4])); |
| | | } else {//false表示只读 |
| | | this.setReadOnly(readIs[2], parseInt(readIs[4]));// readIs[3] |
| | | } |
| | | this.hasStyleCss(readIs[2]);//stylecss处理 |
| | | } |
| | |
| | | this.setReadOnly(readIs[1],readIs[2]); |
| | | this.hasStyleCss(readIs[1]);//stylecss处理 |
| | | break; |
| | | case 2:// 逐一按钮设置 |
| | | case 2:// 逐一按钮设置(按钮) |
| | | // 增加info信息判断按钮,为1继续,否则隐藏跳开 |
| | | filedIs = readIs[2];// readIs[1]+readIs[2]+'Button'; |
| | | if (info != null && info.length > 0) { |
| | |
| | | no_load_first = getBool;// 当然事情完了,还是还原其本来值 |
| | | }, |
| | | hasStyleCss:function(id){//处理stylecss |
| | | let cssArray = ""; |
| | | let css = getDoc(id, ".style");// 控件样式 |
| | | if (getDoc(id + '_css', '') != null && getDoc(id + '_css', '.value') != "") {// css样式 |
| | | let css = getDoc(id, ".style");// 控件样式 |
| | | let cssz = ""; |
| | | for (var r = 0; r < css.length; r++) { |
| | | cssz += css[r] + ":" + css[css[r]] + ";";// 组装 |
| | | cssArray += css[r] + ":" + css[css[r]] + ";";// 组装 |
| | | } |
| | | cssz += getDoc(id + '_css', '.value');// 获取9802设置的控件样式 |
| | | setDoc(id, ".style='" + cssz + "'");// 赋值最新的控件样式css |
| | | cssArray += getDoc(id + '_css', '.value'); |
| | | setDoc(id, ".style='" + cssArray + "'");// 赋值最新的控件样式css |
| | | } else { |
| | | let cssm = panMain[panIndex].panInfo[id]; |
| | | if (cssm != null) { |
| | | cssm = cssm.stylecss; |
| | | } |
| | | if (cssm != null && cssm != '') { |
| | | for (var r = 0; r < css.length; r++) { |
| | | cssArray += css[r] + ":" + css[css[r]] + ";";// 组装 |
| | | } |
| | | cssArray += cssm; |
| | | setDoc(id, ".style='" + cssArray + "'");// 赋值最新的控件样式css |
| | | } |
| | | } |
| | | }, |
| | | hasIn : function(str, strs) { |
| | |
| | | } |
| | | return false; |
| | | }, |
| | | zhuYi : function(id, statepan, docstatePan, idpan, usercode) {// ,NeedRelease,CurChecked,CurChecker |
| | | zhuYi : function(id, statepan, docstatePan, curchecker, usercode) {// ,NeedRelease,CurChecked,CurChecker |
| | | var states = statepan.split(";"); |
| | | var may = true; |
| | | var mayHas = this.isHasTo(idpan, usercode, false);// 是否检查过 |
| | | var mayHas = this.isHasTo(curchecker, usercode, false);// 是否检查过 |
| | | var curHas = false;// 是否是检查人 |
| | | if (getDoc('curchecker', '.value') == "all") { |
| | | curHas = true; |
| | |
| | | return may; |
| | | }, |
| | | // 1,登陆人状态2为控件状态3是否新单4是否有按钮 |
| | | setRead : function(statepan, docstatePan, isNewOpen, id, hasbutton, idpan, |
| | | setRead : function(statepan, docstatePan, isNewOpen, id, hasbutton, curchecker, |
| | | usercode, type) {// 判断按钮以及是否可以输入状态(301101) |
| | | hasButton = hasbutton; |
| | | var states = statepan.split(";"); |
| | | var may = false;// false就执行匹配 |
| | | if (getDoc('curchecker', '.value') == "all") { |
| | | //获取当前审核人字段值 |
| | | if (getDoc(curchecker, '.value') == "all") { |
| | | may = true; |
| | | } else { |
| | | may = this.isHasTo(idpan, usercode, false);//审核填写审核信息。 |
| | | may = this.isHasTo(curchecker, usercode, false);//审核填写审核信息。 |
| | | } |
| | | // var creater = this.isHasTo('createusercode', usercode, false); |
| | | // false就执行匹配 //注释掉是因为已经没了那个字段。 |
| | |
| | | this.setReadOK(id, type, false) |
| | | }, |
| | | checkDocStatus : function(id,boo,type) { |
| | | if(formType&&(formType==5||formType==9 |
| | | ||formType==15||formType==8 |
| | | ||formType==496||formType==497 |
| | | ||formType==16||formType==17)){ |
| | | docstatePan=getDoc("docstatus",".value");// 获取单据的单据状态 |
| | | |
| | | if (formType && (formType == 5 || formType == 9 |
| | | || formType == 15 || formType == 8 |
| | | || formType == 496 || formType == 497 |
| | | || formType == 16 || formType == 17)) { |
| | | docstatePan = getDoc("docstatus", ".value");// 获取单据的单据状态 |
| | | var stats = panMain[panIndex].picState[id]; |
| | | if(stats) { |
| | | var temp=stats.split("pb#"); |
| | | if (stats) { |
| | | var temp = stats.split("pb#"); |
| | | |
| | | if ((";" + temp[1] + ";").indexOf(";" + docstatePan + ";") > -1) |
| | | boo = false; |
| | |
| | | boo = true; |
| | | } |
| | | } |
| | | if(boo){ |
| | | try{ |
| | | fileupload_config.browseOnZoneClick=false; // true为只读状态 |
| | | }catch(e){alert(e);} |
| | | $("#"+id).attr("data-readonly",boo);//是否只读 |
| | | if (boo) { |
| | | try { |
| | | fileupload_config.browseOnZoneClick = false; // true为只读状态 |
| | | } catch (e) { |
| | | alert(e); |
| | | } |
| | | $("#" + id).attr("data-readonly", boo);//是否只读 |
| | | } |
| | | if(type==19){ |
| | | var container = $("#"+id + "_dynamic"); // 隐藏上传浏览框 |
| | | if (type == 19) { |
| | | var container = $("#" + id + "_dynamic"); // 隐藏上传浏览框 |
| | | var uploadDiv = container.find(".file-caption-main"); |
| | | if (uploadDiv != null && uploadDiv != undefined){ |
| | | if (uploadDiv != null && uploadDiv != undefined) { |
| | | uploadDiv.hide(); |
| | | } |
| | | } |
| | |
| | | break; |
| | | case 9:// 图片类型 |
| | | seltboo=this.checkDocStatus(id,boo,9); |
| | | |
| | | break; |
| | | case 19:// 上传附件 |
| | | seltboo=this.checkDocStatus(id,boo,19); |
| | |
| | | } |
| | | if (isSuperUser!=null){//超级管理员 |
| | | mayOpen = (isSuperUser=='1'?true:mayOpen); |
| | | if(mayOpen){//是超级管理员但是readerusercodes没有值也不能查看 xin 2023-12-4 09:03:59 |
| | | mayOpen = this.isHasTo('readerusercodes', ReaderUsercodes, mayOpen); |
| | | } |
| | | } |
| | | if (!mayOpen) {// 没有权限看的人直接关闭当前页面,不再提示 |
| | | hasShezhiZiduan = true; |
| | |
| | | } |
| | | format = info[colid].format; |
| | | format = format == null ? "" : format; |
| | | if(initv.indexOf("!")!=-1){ |
| | | if(initv.indexOf("!") == 0){//出现在最开头0位置就执行查询 |
| | | dat[t]=colid; |
| | | typ[t]=type; |
| | | t++; |
| | |
| | | } |
| | | } |
| | | if(type==43){ |
| | | if($("#"+dat[d]+"text")){ |
| | | $("#"+dat[d]+"text").val(eval('('+data+')')); |
| | | } |
| | | $("#"+dat[d]).val(eval('('+data+')')).trigger('change'); |
| | | panMain[panIndex].panInfo[colid].initValue=eval('('+data+')'); |
| | | } |
| | |
| | | } |
| | | if($doc(colid+'text').val()==''){//多表 |
| | | $doc(colid+'text').val(initv); |
| | | } |
| | | break; |
| | | case 5: |
| | | if (format != "") { |
| | | if (initv != "" && format.split(' ').length == 1) { |
| | | $doc(colid).val(initv.split(' ')[0]); |
| | | } |
| | | } |
| | | break; |
| | | case 41: |
| | |
| | | bottom: '' |
| | | } |
| | | }); |
| | | return; |
| | | // return; |
| | | }else{ |
| | | $.messager.alert("操作提示", msg, "warning"); |
| | | } |
| | | $.messager.alert("操作提示", msg, "warning"); |
| | | }else if(data.state!=null && data.state==-1){ |
| | | let msg = data.error || data.msg; |
| | | $.messager.alert('提示', msg || '出现错误', "info"); |
| | |
| | | if (v != null && v.length > 0) { |
| | | let id = v[0].replaceAll("&", "").toLowerCase(); |
| | | let value = getDoc(id, ".value"); |
| | | if (value == null || value == "") { |
| | | let reg1 = "'" + v[0] + "'"; |
| | | let v1 = str.match(reg1); |
| | | if (v1 == null && value == "") { |
| | | value = "''"; |
| | | } |
| | | if (v1 != null && value == null) { |
| | | value = ""; |
| | | } |
| | | } |
| | | str = str.replaceAll(v[0], value); |
| | | str = this.regexp(str); |
| | | } |
| | |
| | | var mayOpen = toIs;// 要执行就传false,为true就没必要执行了 |
| | | if (!toIs) { |
| | | usercode = usercode.toLowerCase(); |
| | | var dbi = ""; |
| | | var dbi = "";//当前审核人值 |
| | | if (getDoc(id, '') != null) {// 确定有无此控件 |
| | | dbi = getDoc(id, ".value"); |
| | | } else { |
| | | if (hasShezhiZiduan && (id!="readerusercodes" && id!="readerroles" && id!="readerorganizations" && id!="curchecker")) {// 只弹出第一次筛选出的字段错误。部分字段已经不需要,在这里做判断处理。 |
| | | $.messager.alert("操作提示", "没有设置" + id + "这个字段!","warning"); |
| | | if (hasShezhiZiduan && (id != "readerusercodes" && id != "readerroles" && id != "readerorganizations" && id != "curchecker")) {// 只弹出第一次筛选出的字段错误。部分字段已经不需要,在这里做判断处理。 |
| | | $.messager.alert("操作提示", "没有设置" + id + "这个字段!", "warning"); |
| | | } |
| | | hasShezhiZiduan = false; |
| | | } |
| | |
| | | // 在编辑状态下必录 |
| | | if ((hasSta && isHasValue(col[1], "" + statu + "", ";")) || !hasSta) { |
| | | if (this.panInfo[col[0]] == null) {//没有检查到此字段的存在。 |
| | | layer.msg('页面存在必录字段没有录入,必录的字段是:' + col[0]); |
| | | $.messager.alert("操作提示",'页面存在必录字段没有录入,必录的字段是:' + col[0]); |
| | | return false; |
| | | } |
| | | try { |
| | | layer.msg(this.panInfo[col[0]].title + '--不能为空!'); |
| | | } catch (e) { |
| | | $.messager.alert(this.panInfo[col[0]].title + '--不能为空!'); |
| | | let title = this.panInfo[col[0]].title; |
| | | if (title.indexOf("!") != -1) { |
| | | title = col[0];//是动态的描述直接显示id好了。 |
| | | } |
| | | // try { |
| | | $.messager.alert("操作提示",'<div style="text-align: center">'+title + '-不能为空!</div>'); |
| | | // } catch (e) { |
| | | // $.messager.alert("操作提示",title + '--不能为空!'); |
| | | // } |
| | | // try{ |
| | | // $.messager.show({ |
| | | // height:50, |
| | |
| | | return boolreturn; |
| | | } |
| | | // 1.数组2.自身字段(数组值与自身字段一一匹配)3true替换,反之则为追加 |
| | | function openSetValue(st, get, boo) { |
| | | //newExpr是弹出页面返回的数据,表示里面的字段内容是密文,需要根据当前页面是否需要解密做相应的处理 |
| | | //格式:newExpr={"字段名称":"密文"} by danaus 2024-06-28 17:08 |
| | | function openSetValue(st, get, boo,newExpr) { |
| | | var col; |
| | | if (st != undefined && st != null) { |
| | | var encrypt = new JSEncrypt(); |
| | | encrypt.setPublicKey(rsakey.pubkey); |
| | | var dataJson=null; |
| | | if (newExpr != null && JSON.stringify(newExpr) !== "{}"){//&& typeof newExpr == 'object') {//有密文 |
| | | $.ajax({ |
| | | url: "/api/decrypt.do", |
| | | type: "POST", |
| | | data: JSON.stringify(newExpr), |
| | | async: false, |
| | | dataType: 'json', |
| | | contentType: 'application/json', |
| | | success: function (res) { |
| | | if (res.state == 0) { |
| | | //获取明文 |
| | | dataJson = res.data; |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | for ( var n = 0; n < st.length; n++) { |
| | | if (getDoc(get[n], "") == null) { |
| | | console.log("三点弹出设置的自身字段:" + get[n] + "在页面上不存在!"); |
| | |
| | | } |
| | | } |
| | | } |
| | | setDoc(get[n], ".value ='" +(st[n]=="undefined"?"":st[n])+ "'"); |
| | | var v = (st[n] == "undefined" ? "" : st[n]); |
| | | if (dataJson != null) {//有解密的明文值 |
| | | v = dataJson[get[n]]; |
| | | } |
| | | if (getDoc(n + "_expr", ".value") != "" && getDoc(n + "_expr", ".value") == 0) {//权限控制 显示星号 xin 2024-6-24 10:22:43 |
| | | setDoc(n + "_expr_val", ".value='" + encrypt.encrypt(v) + "'");//加密值 |
| | | v = "******"; |
| | | } |
| | | setDoc(get[n], ".value ='" + v + "'"); |
| | | } else { |
| | | col = getDoc(get[n], ".value"); |
| | | if (!isHasValue(col, st[n], ",")) {// 在有的情况下不追加 |
| | |
| | | } |
| | | panMain[panIndex].isChange=1; |
| | | top.myFresh.Type=panMain[panIndex].formtypeOne; |
| | | if(panMain[panIndex].formtypeOne==10){//10类型 |
| | | panMain[panIndex].keyDown('123','');//三点弹出返回后 再次出发回车事件 组装where条件。2014-11-14 |
| | | if(panMain[panIndex].formtypeOne==10 || panMain[panIndex].formtypeOne==20 || panMain[panIndex].formtypeOne==30){//10 20 30类型 |
| | | panMain[panIndex].keyDown('123','');//三点弹出返回后 再次触发回车事件 组装where条件。2014-11-14 |
| | | panMain[panIndex].isChange=0;//10窗体返回的值不在保存防范,所以isChange改为0 |
| | | } |
| | | } else { |
| | |
| | | function shenji(panIndex,plane,doc,type){// panindex为面板元素,plane为面板信息,doc为单号,type参数针对2类型考虑的(具体看2类型js里面的simple.tree.js) |
| | | var newValue = [];// 需要审计的字段 修改后的值 |
| | | var oldValue = panMain[panIndex].panelAuditValue;// 原始字段值(没改过前的字段值) |
| | | var auditFormId=formId;//审计的功能号 |
| | | var auditFormId = formId;//审计的功能号 |
| | | if (this.formType == 496) { |
| | | plane = $.isFunction(plane.getPanMap) ? plane.getPanMap(panIndex) : plane; |
| | | auditFormId = oldValue.formid; |
| | |
| | | var auditField = panMain[panIndex].auditFiled;// 9802设置需要审计的字段名 |
| | | try { |
| | | for (var i = 0; i < auditField.length; i++) { |
| | | var type = auditField[i][1];//类型(1:审计+查询。2:审计) |
| | | if (type == 1) {//单单是(审计+查询)不计算到表里面去 |
| | | continue; |
| | | } |
| | | var name = auditField[i][0];//字段名 |
| | | var old = (oldValue[name] != null ? oldValue[name] : '');//旧值 |
| | | var news = (plane[name] != null ? plane[name] : '');//新值 |
| | | if (old != news) { |
| | | if (type == 2 && (old != news)) { |
| | | var auditJson = {}; |
| | | var array = [];//添加(审计+查询) |
| | | for (var a = 0; a < auditField.length; a++) {//把是 1(审计+查询)类型的字段添加到集合里 |
| | | if (auditField[a][1] == 1) { |
| | | array.push((plane[auditField[a][0]] != null ? plane[auditField[a][0]] : '')); |
| | | } |
| | | } |
| | | auditJson.auditIndex = news + ',' + old + ',' + array.join(','); |
| | | let auditType="update"; |
| | | if (isNew == 1 && doc == "") { |
| | | auditType = 'add'; |
| | | } |
| | | if (typeof (type) != 'undefined' && type == '2add') { |
| | | auditType = "add"; |
| | | } |
| | | auditJson.auditType = auditType; |
| | | auditJson.usercode = ''; |
| | | auditJson.username = ''; |
| | | auditJson.fieldId = name; |
| | | auditJson.fieldname = auditField[i][2]; |
| | | auditJson.oldvalue = old; |
| | | auditJson.newvalue = news; |
| | | auditJson.usercode = ''; |
| | | auditJson.username = ''; |
| | | auditJson.auditType = (typeof (type) == 'undefined' ? ((isNew == 1 && doc == "") ? "add" : "update") : (type == "2add" ? "add" : "update")); |
| | | auditJson.formid = auditFormId; |
| | | auditJson.doccode = doc; |
| | | auditJson.auditIndex = ',' + news + ',' + old + ','; |
| | | auditJson.mainFormId=formId;//主功能号,在三表或多表时MainFormId取主功能号,其他情况取值和formid相同取当前功能号 |
| | | auditJson.headFlag=0;//主表为0 从表为1 |
| | | // auditJson.fielddescr = auditField[i][2];//这个不用了 |
| | | auditJson.mainFormId = formId;//主功能号,在三表或多表时MainFormId取主功能号,其他情况取值和formid相同取当前功能号 |
| | | auditJson.headFlag = 0;//主表为0 从表为1 |
| | | if ($doc(name + "_expr").val() != null && $doc(name + "_expr").val() == 0) { |
| | | var encrypt = new JSEncrypt(); |
| | | encrypt.setPublicKey(rsakey.pubkey); |
| | | news=encrypt.encrypt(news);//加密 |
| | | auditJson.oldvalue_expr = 0; |
| | | auditJson.newvalue_expr = 0; |
| | | auditJson.oldvalue = $doc(name + "_expr_val").val(); |
| | | auditJson.newvalue = news; |
| | | auditJson.auditIndex_expr = news;//处理加密 |
| | | } |
| | | newValue.push(auditJson); |
| | | } |
| | | } |
| | |
| | | panMain[panIndex].isChange=0; |
| | | } |
| | | } |
| | | function upSub(a) { |
| | | function upSub(a,set_panIndex) { |
| | | if (set_panIndex) { |
| | | set_panIndex = isNaN(set_panIndex) ? 0 : set_panIndex; |
| | | panIndex = set_panIndex; |
| | | } |
| | | panMain[panIndex].upSub(a); |
| | | if (doc(a+"-img44") != null) {//是44静态图标控件 xin 2022-1-24 15:32:21 |
| | | let path=getDoc(a,".value"); |
| | | setDoc(a+"-img44",".src='"+path+"'"); |
| | | if (doc(a + "-img44") != null) {//是44静态图标控件 xin 2022-1-24 15:32:21 |
| | | let path = getDoc(a, ".value"); |
| | | setDoc(a + "-img44", ".src='" + path + "'"); |
| | | } |
| | | } |
| | | function getBackAll(a, b) { |
| | |
| | | }); |
| | | } |
| | | |
| | | //获取自定义描述名称 |
| | | function getCustomName(){ |
| | | var json = {}; |
| | | let paninfo = panMain[panIndex].panInfo; |
| | | if (paninfo != null) { |
| | | for (let id in paninfo) { |
| | | let title = paninfo[id].title; |
| | | if (title != null && title != "" && title.indexOf("!") != -1) {//有自定义名称 |
| | | let dive = $("#"+id).closest(".panelControlTDDiv");//获取到id的祖元素 |
| | | if(dive!=null){ |
| | | let miao = dive.find(".miaoshu_pan").html(); |
| | | if (miao != null && miao != "") { |
| | | json[id] = miao; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return json; |
| | | } |
| | | |
| | | $(function(){ |
| | | // panPar.loadingSelect2Data().loading(); |
| | | if(panMain[panIndex]!=null) { |