| | |
| | | TGP.filters = '';//三表的过滤条件 |
| | | TGP.excelTitle = '';//excel动态标题 |
| | | TGP.gridTitle = "";//格线的动态标题 |
| | | TGP.gridTitleMap =null;//格线的动态标题Map |
| | | //------------三点弹出需要用到 |
| | | TGP.formP = '';//外表字段 |
| | | TGP.toP = '';//自表字段 |
| | |
| | | TGP.newRow = null;//当前新增行 |
| | | TGP.treeParentRowid = "";//保存点击增加子节点时的上级节点rowid给当前节点的parentrowid,以便识别关系 |
| | | TGP.uuid=""; |
| | | ///------------------------------------------------------------------------------------------------------相关事件处理--------------------------------------- |
| | | TGP.isFillCell=false; |
| | | //---------------------------------------------------------------------------------------------相关事件处理--------------------------------------- |
| | | var GT_tranCode = function (s, flag) { |
| | | try { |
| | | if (s === "" || s == undefined) return s; |
| | |
| | | return s; |
| | | } |
| | | }; |
| | | |
| | | Grids.OnExportStart=function(grid,flag){ |
| | | //console.log("grid.NewExportName="+grid.NewExportName); |
| | | grid.ExportName=excel9687.title; |
| | | return false; |
| | | }; |
| | | Grids.OnSelect = function (grid, row, deselect) { |
| | | if (typeof inChangFrame != "undefined") { |
| | | var p_frame = parent.frames[inChangFrame]; |
| | |
| | | } |
| | | //---根据主表过滤当前表格数据 |
| | | grid.processFilter(); |
| | | GT.rowIDp=null;//刷新格线后需要清除选中行状态 |
| | | }; |
| | | Grids.OnFilterFinish = function (grid,type) { |
| | | //console.log("OnFilterFinish>>>>"+grid.id); |
| | | //---根据主表过滤当前表格数据 |
| | | grid.processFilter(); |
| | | |
| | | }; |
| | | Grids.OnStartEdit = function (grid, row, col) { |
| | |
| | | if (g != undefined) { |
| | | var B = g.keyid.split(";"); |
| | | g.SetAttribute(D, null, "Color", "yellow", 1); |
| | | this.filters = " " + B[0].toLowerCase() + "='" + D[B[1]] + "'"; |
| | | this.SetFilter("filter497", " " + B[0] + "=='" + D[B[1]] + "'", "rowid"); |
| | | this.filters = " " + B[0].toLowerCase() + "='" + D[B[1].toLowerCase()] + "'"; |
| | | this.SetFilter("filter497", " " + B[0].toLowerCase() + "=='" + D[B[1].toLowerCase()] + "'", "rowid"); |
| | | this.setTotalCols(); |
| | | break; |
| | | } |
| | |
| | | this.Cols[col].Enum=newValues; |
| | | } |
| | | }; |
| | | TGP.initDysql = function (y, x, val, flg) { |
| | | TGP.initDysql = function (row, colName, defalutValue, flg) { |
| | | var g = this; |
| | | if (g.Cols[x].dySql == undefined) return; |
| | | var dysql = g.Cols[x].dySql; |
| | | if (g.Cols[x].CanEdit == 1) {//可编辑状态时加上sqlWhere条件 |
| | | if (g.Cols[x].sqlWhere != undefined) {//存在sqlWhere |
| | | dysql = processDysqlV2(dysql, g.Cols[x].sqlWhere); |
| | | var notTrue=true; |
| | | if (g.Cols[colName].dySql == undefined) return notTrue; |
| | | var dysql = g.Cols[colName].dySql; |
| | | if (g.Cols[colName].CanEdit == 1) {//可编辑状态时加上sqlWhere条件 |
| | | if (g.Cols[colName].sqlWhere != undefined) {//存在sqlWhere |
| | | dysql = processDysqlV2(dysql, g.Cols[colName].sqlWhere); |
| | | } |
| | | } |
| | | var Cd = g.replaceSql(dysql, y, g.Data.seInfo); |
| | | var Cd = g.replaceSql(dysql, row, g.Data.seInfo); |
| | | //增加变量保存当前动态sql,免除每次都查询相同数据,减轻服务器负担,key为sql查询语句 |
| | | if (g.dyarryValue == undefined) g.dyarryValue = []; |
| | | if (g.dyarryValue[Cd] != undefined) { |
| | | var P; |
| | | try { |
| | | P = g.dyarryValue[Cd].split("'"); |
| | | if (g.Cols[x].Button == 'Defaults') { |
| | | g.Cols[x].Defaults = P[1]; |
| | | y[x + "Defaults"] = P[1]; |
| | | if (g.Cols[colName].Button == 'Defaults') { |
| | | g.Cols[colName].Defaults = P[1]; |
| | | row[colName + "Defaults"] = P[1]; |
| | | } else { |
| | | g.Cols[x].EnumKeys = P[0]; |
| | | y[x + "EnumKeys"] = P[0]; |
| | | g.Cols[x].Enum = P[1]; |
| | | y[x + "Enum"] = P[1]; |
| | | if(g.Cols[x].colType==46){ |
| | | this.processType46(y,x); |
| | | g.Cols[colName].EnumKeys = P[0]; |
| | | row[colName + "EnumKeys"] = P[0]; |
| | | g.Cols[colName].Enum = P[1]; |
| | | row[colName + "Enum"] = P[1]; |
| | | if(g.Cols[colName].colType==46){ |
| | | this.processType46(row,colName); |
| | | } |
| | | if (flg == undefined && val != undefined) y[x] = val; |
| | | if (flg == undefined && defalutValue != undefined){ |
| | | //处理初始值是否存在于下拉列表中,存在才给值 |
| | | if(P[0]!=undefined&&P[0]!=""){//处理实际值 |
| | | var arry=P[0].split("|"); |
| | | for(var i=0;i<arry.length;i++){ |
| | | if((arry[i]+"").toLowerCase()==(defalutValue+"").toLowerCase()){ |
| | | row[colName] = arry[i]; |
| | | notTrue=true; |
| | | break; |
| | | } |
| | | notTrue=false; |
| | | } |
| | | } |
| | | if(!notTrue){ |
| | | if(P[1]!=undefined&&P[1]!=""){//处理显示值 |
| | | var arry=P[1].split("|");//显示值 |
| | | var arry2=P[0].split("|");//实际值 |
| | | for(var i=0;i<arry.length;i++){ |
| | | if((arry[i]+"").toLowerCase()==(defalutValue+"").toLowerCase()){ |
| | | row[colName] = arry2[i]; |
| | | notTrue=true; |
| | | break; |
| | | } |
| | | notTrue=false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | g.RefreshCell(y, x); |
| | | g.RefreshCell(row, colName); |
| | | } catch (e) { } |
| | | |
| | | } else { |
| | |
| | | E.isGt = 1; |
| | | E.Sync = true; |
| | | E.Method = "post"; |
| | | var L = "{'type':'" + ((g.Cols[x].Type == "Radio" || (g.Cols[x].Button != undefined && g.Cols[x].Button == "Defaults")) ? 1 : 0) + "','formID':'" + (g.Cols[x].formid == undefined ? 0 : g.Cols[x].formid) + "' ,'value':\"" + Cd + "\"}"; |
| | | var L = "{'type':'" + ((g.Cols[colName].Type == "Radio" || (g.Cols[colName].Button != undefined && g.Cols[colName].Button == "Defaults")) ? 1 : 0) + "','formID':'" + (g.Cols[colName].formid == undefined ? 0 : g.Cols[colName].formid) + "' ,'value':\"" + Cd + "\"}"; |
| | | var K = g; |
| | | g.AjaxCall(E, L, function (N, O) { |
| | | var P; |
| | |
| | | alert(O.replace("error;", Cd + ":")); |
| | | return; |
| | | } |
| | | var isDropDownValue=0;//因为有空白项,下拉列表的第一项是1 |
| | | if(g.Cols[colName].isSuppressBlankLineForDropDown!=undefined |
| | | &&g.Cols[colName].isSuppressBlankLineForDropDown==1){ |
| | | //去除下拉列表空白列 |
| | | isDropDownValue=1; |
| | | O=O.replace(/\|\s+/g,""); |
| | | } |
| | | P = O.split("'"); |
| | | if (K.Cols[x].Button == 'Defaults') { |
| | | y[x + "Defaults"] = P[1]; |
| | | K.Cols[x].Defaults = P[1]; |
| | | if (K.Cols[colName].Button == 'Defaults') { |
| | | row[colName + "Defaults"] = P[1]; |
| | | K.Cols[colName].Defaults = P[1]; |
| | | } else { |
| | | K.Cols[x].EnumKeys = P[0]; |
| | | K.Cols[x].Enum = P[1]; |
| | | y[x + "EnumKeys"] = P[0]; |
| | | y[x + "Enum"] = P[1]; |
| | | // if(val!=undefined) y[x]=val; |
| | | if(K.Cols[x].colType==46){ |
| | | K.processType46(y,x); |
| | | K.Cols[colName].EnumKeys = P[0]; |
| | | K.Cols[colName].Enum = P[1]; |
| | | row[colName + "EnumKeys"] = P[0]; |
| | | row[colName + "Enum"] = P[1]; |
| | | if(row[colName]!=undefined&&row[colName]=="" |
| | | &&isDropDownValue==1){ |
| | | var v=P[0].split("|")[1]; |
| | | row[colName]=v; |
| | | } |
| | | if(K.Cols[colName].colType==46){ |
| | | K.processType46(row,colName); |
| | | } |
| | | } |
| | | g.dyarryValue[Cd] = O;//保存当前的数据,以便查询相同的时候直接返回 |
| | | K.RefreshCell(y, x); |
| | | K.RefreshCell(row, colName); |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return notTrue; |
| | | }; |
| | | TGP.getRowcopyfields = function () { |
| | | return this.rowcopyfields; |
| | |
| | | } else if (A[J[i]] != undefined && isNaN(A[J[i]]) && A[J[i]].indexOf("!") == 0) { |
| | | var B = {}; |
| | | |
| | | var s = GT.filterStr(A[J[i]].slice(1), this.Data.seInfo, A, this); |
| | | var s = GT.filterStr(A[J[i]].slice(1), this.Data.seInfo, A, this,true); |
| | | B.Url = "/gtGrid.do?m=heand"; |
| | | var D = "{"; |
| | | D += "'parm':\"" + encodeText(s.replace(/\\/g, "")); |
| | |
| | | this.AjaxCall(B, D, function (H, I) { |
| | | if (I != undefined) { |
| | | A[J[i]] = I; |
| | | if (g.gridTitle != "") { |
| | | g.gridTitle += "'" + J[i] + "(" + I; |
| | | } |
| | | else { |
| | | g.gridTitle += J[i] + "(" + I; |
| | | var valueMap=g.gridTitleMap.get(J[i]); |
| | | if(valueMap!=null&&valueMap!=undefined){ |
| | | g.gridTitleMap.set(J[i],valueMap+"|"+I); |
| | | }else{ |
| | | g.gridTitleMap.set(J[i],I); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | TGP.gridTitlefun = function (){ |
| | | this.gridTitle="";//先清空 |
| | | if(this.gridTitleMap!=null){ |
| | | this.gridTitleMap.forEach((value,key) => { |
| | | if(this.gridTitle!=""){ |
| | | this.gridTitle+="'" + key + "(" + value; |
| | | }else{ |
| | | this.gridTitle=key + "(" + value; |
| | | } |
| | | }); |
| | | } |
| | | return this.gridTitle; |
| | | } |
| | | TGP.ActionTran = function ()//增加确定功能 by 11-4-25 |
| | | { |
| | | if (!this.tX()) { return false; } |
| | |
| | | alert(R.replace("error;", Cd + ":")); |
| | | return; |
| | | } |
| | | var isDropDownValue=2;//因为有空白项,下拉列表的第一项是2 |
| | | if(this.Cols[x].isSuppressBlankLineForDropDown!=undefined |
| | | &&this.Cols[x].isSuppressBlankLineForDropDown==1){ |
| | | //去除下拉列表空白列 |
| | | isDropDownValue=1; |
| | | R=R.replace(/\|\s+/g,""); |
| | | } |
| | | var s = R.split("'"); |
| | | if (T.Cols[x].Button == 'Defaults') {//35类型 |
| | | if (T.Cols[x].Button == 'Defaults') {// |
| | | T.Cols[x].Defaults = s[1]; |
| | | row[x + "Defaults"] = s[1]; |
| | | } else {//31类型 |
| | |
| | | T.Cols[x].Enum = s[1]; |
| | | row[x + "EnumKeys"] = s[0];//"|a|b|c"; |
| | | row[x + "Enum"] = s[1];//"|a|b|c"; |
| | | //把第一个选项作为选中显示 |
| | | //var v=s[0].split("|")[isDropDownValue]; |
| | | //row[x]=v; |
| | | if(T.Cols[x].colType==46){ |
| | | T.processType46(row,x); |
| | | } |
| | |
| | | obj.refkeyValue = row[rowid]; |
| | | obj.refkeyDelValue = row[rowid];//删除关联的第二表里,如果全选删除,需要过滤,只选择属于上面格线当前选中 |
| | | obj.SetFilter("filter15", " " + rowid + "=='" + row[rowid] + "'", "rowid");//通过调用过滤方法实现, by12-11-08 |
| | | obj.setTotalCols(1); |
| | | obj.setTotalCols(); |
| | | obj.filters = ""; |
| | | } |
| | | } |
| | |
| | | obj.refkeyDelValue = row[rowid]; |
| | | //obj.refkeyValue=rowid+";"+row[rowid]; |
| | | //console.log(obj.filters); |
| | | //console.log(">>>>"+(rowid+"=='"+row[rowid2]+"'")); |
| | | //console.log(obj.id+">>>>"+(rowid+"=='"+row[rowid2]+"'")); |
| | | obj.SetFilter("filter497", " " + rowid + "=='" + row[rowid2] + "'", "rowid");////通过调用过滤方法实现, by12-11-08 |
| | | obj.setTotalCols(); |
| | | } |
| | |
| | | }; |
| | | TGP.processFilter = function () { |
| | | //加载完执行过滤操作,适用于8,496的关联表 |
| | | var masterGrid = null; |
| | | for (var F = 0; F < Grids.length; F++) { |
| | | if (Grids[F] != undefined && Grids[F].keyid != undefined) { |
| | | var keyid = Grids[F].keyid; |
| | | if (keyid != undefined && keyid != "") { |
| | | masterGrid = Grids[F]; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (masterGrid != null && masterGrid.keyid != "") { |
| | | var ref = masterGrid.keyid.split(",");//2|doccode;doccode,3|doccode;doccode,5|doccode;doccode |
| | | //var masterGrid = null; |
| | | // for (var F = 0; F < Grids.length; F++) { |
| | | // if (Grids[F] != undefined && Grids[F].keyid != undefined) { |
| | | // var keyid = Grids[F].keyid; |
| | | // if (keyid != undefined && keyid != "") { |
| | | // masterGrid = Grids[F]; |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | //console.log(this.id+">>>>this.keyid:"+this.keyid); |
| | | //直接取当前格线的keyid,上面写法也是一样的效果 by 2022-8-4 |
| | | if (this.keyid!= undefined && this.keyid != "") { |
| | | var ref = this.keyid.split(",");//2|doccode;doccode,3|doccode;doccode,5|doccode;doccode |
| | | for (var i = 0; i < ref.length; i++) { |
| | | var obt = ref[i].split("|");//每个关联表格 |
| | | var obj = Grids[obt[0]]; |
| | | //--是当前表格 |
| | | if (obj != null && obj.id == this.id) { |
| | | var rowid = obt[1].split(";")[1].toLowerCase();//自身字段 |
| | | var rowid2 = obt[1].split(";")[0].toLowerCase();//外表字段 |
| | | var row = masterGrid.getFristRow(); |
| | | masterGrid.setRowColor(row); |
| | | //--关联的表格 |
| | | if (obj != null) {//T_121211|RowId;DetailRowId |
| | | var rowid = obt[1].split(";")[0].toLowerCase();//自身字段, DetailRowId |
| | | var rowid2 = obt[1].split(";")[1].toLowerCase();//外表字段, RowId |
| | | var row = this.getFristRow(1);//传1表示取第一个可见行 |
| | | try{ |
| | | this.setRowColor(row); |
| | | obj.filters = " " + rowid + "='" + row[rowid2] + "'"; |
| | | //obj.refkeyValue=rowid+";"+row[rowid]; |
| | | //console.log(obj.filters); |
| | | //console.log(this.id+">>>>"+(rowid+"=='"+row[rowid2]+"'")); |
| | | //console.log(obj.id+">>>>"+(rowid+"=='"+row[rowid2]+"'")); |
| | | obj.SetFilter("filter497", " " + rowid + "=='" + row[rowid2] + "'", "rowid");////通过调用过滤方法实现, by12-11-08 |
| | | //console.log(this.id+"SetFilter>>>>"+(rowid+"=='"+row[rowid2]+"'")); |
| | | obj.setTotalCols(); |
| | | }catch(e){} |
| | | } |
| | | } |
| | | } |
| | |
| | | } catch (e) { } |
| | | } |
| | | } else { |
| | | if (this.gType == 15 || (tcFlg == 1 && this.getFristRow(1) != undefined && this.getFristRow(1)["_rowno"] != undefined && this.getFristRow(1)["_rowno"] != "")) { |
| | | //t15表示是3表中的第二表 |
| | | if ((this.gType == 15 &&this.t15==true)|| (tcFlg == 1 && this.getFristRow(1) != undefined && this.getFristRow(1)["_rowno"] != undefined && this.getFristRow(1)["_rowno"] != "")) { |
| | | var row = this.getFristRow(1)["_rowno"]; |
| | | try { |
| | | var rw = row + ""; |
| | |
| | | //tabindex为当前页卡索引,每次切换回来都会取到当前的索引 |
| | | var p_frame= parent.frames[parent.jQuery(parent.jQuery(parent.jQuery('#home-tabs').tabs('getSelected')).find('iframe')[0]).attr("pframe")]; |
| | | var Cl_Grid=parent.jQuery(parent.jQuery(parent.jQuery('#home-tabs').tabs('getSelected')).find('iframe')[0]).attr("t_grid"); |
| | | var panelToPost_org=parent.jQuery(parent.jQuery(parent.jQuery('#home-tabs').tabs('getSelected')).find('iframe')[0]).attr("paneltopost"); |
| | | var posttothis_org=parent.jQuery(parent.jQuery(parent.jQuery('#home-tabs').tabs('getSelected')).find('iframe')[0]).attr("posttothis"); |
| | | //var p_frame = parent.frames[inThisFrame];//inChangFrame |
| | | if (this.isNine != 'null' && p_frame == null) {//单据类型窗体表头弹出新页面 |
| | | if (!top.addTab) { |
| | |
| | | //console.log("rows[i][col_Img]>>"+rows[i][col+"_Img"]); |
| | | if (rows[i][col + "_Img"] != undefined && rows[i][col + "_Img"] != "") { |
| | | val = rows[i][col + "_Img"]+"@T@"+rows[i][col]; |
| | | console.log("val:"+val); |
| | | //console.log("val:"+val); |
| | | } |
| | | kk.push(val); |
| | | } |
| | |
| | | parent.closeTab(); |
| | | } |
| | | } |
| | | else if (p_frame && panelToPost && panelToPost != "") {//面板需要用 |
| | | else if (p_frame && panelToPost_org && panelToPost_org != "") {//面板需要用 |
| | | if (this.checkData()) { |
| | | alert(this.GetText("isSave")); |
| | | return; |
| | | } |
| | | var ss = null; |
| | | panelToPost_org=panelToPost_org.split(";"); |
| | | posttothis_org=posttothis_org.split(";"); |
| | | if (record == null) { |
| | | ss = this.getSelectRows_One()[0]; |
| | | if(ss==null){ |
| | | for (var r in this.Rows) { |
| | | var ro = this.Rows[r]; |
| | | if (ro.Kind == "Data" && ro.id != "Fix1") { |
| | | ss=ro; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | record = ss; |
| | | } |
| | | var temp = []; |
| | | var rows = this.getSelectRows();//取得选择行 |
| | | if (rows.length == 0) { rows[0] = this.filerRow(record); }//当是直接双击时没有选择行 |
| | | for (var i = 0; i < panelToPost.length; i++) { |
| | | for (var i = 0; i < panelToPost_org.length; i++) { |
| | | var s = ""; |
| | | for (var j = 0; j < rows.length; j++) { |
| | | if (j > 0) { s += ","; } |
| | | var col = panelToPost[i].replace(/\s+/, "").toLowerCase(); |
| | | var col = panelToPost_org[i].replace(/\s+/, "").toLowerCase(); |
| | | if (this.Cols[col] != undefined && this.Cols[col].Type == "Date") {//处理日期数值返回给面板时候,需要格式化成日期显示,因为格线内部是用毫秒表示 by2014-6-24 |
| | | s += DateToString(rows[j][col], this.Cols[col].Format); |
| | | } else { |
| | |
| | | } |
| | | temp[i] = s; |
| | | } |
| | | p_frame.openSetValue(temp, postToThis, true); |
| | | p_frame.openSetValue(temp, posttothis_org, true); |
| | | parent.closeTab(); |
| | | } |
| | | } |
| | |
| | | this.threePop(value, id, row, 1); |
| | | } |
| | | }; |
| | | TGP.threePop = function (st, to, row, index, fl, c, flag, orgCol) { |
| | | //重新拉取31下拉数据,只刷新与当前更新字段相关的31下拉数据,其他的31暂不处理,避免死循环 |
| | | TGP.completeType31List=function(row,colName){ |
| | | if(colName==null||colName==undefined) return; |
| | | for (var i in this.Cols) { |
| | | var col=this.Cols[i]; |
| | | if(col.dySql!=undefined&&col.dySql!=null |
| | | &&col.dySql!=""&&col.dySql.toLowerCase().indexOf('&'+colName.toLowerCase()+'&')>0){ |
| | | //where条件有参数替换的情况才需要重新执行: |
| | | //SELECT cv12code,cv12name from t110588 where cv12code in (select * from getcv12('&matcode&')) |
| | | this.initDysql(row,col.Name); |
| | | } |
| | | } |
| | | }; |
| | | TGP.threePop = function (value, to, row, index, fl, c, flag, orgCol) { |
| | | //c表示当前字段,给公式调用,以便确定调用哪一个公式 |
| | | //orgCol表示当前修改的字段 |
| | | if (index == 1) {//单个更新 |
| | | if (typeof (st) != 'undefined') { |
| | | if (typeof (value) != 'undefined') { |
| | | //增加处理当前行是加载页面时就有了,所以不存在Changed,Added的标记, |
| | | //当二个都不存在,而又是通过三点返回数据,可以认为是对当前行进行修改操作,应增加Changed标记,以便能正常处理 |
| | | if (row["Changed"] == undefined && row["Added"] == undefined) row["Changed"] = 1; |
| | | var s = to; |
| | | var colName = to; |
| | | try { |
| | | s = to.toLowerCase().replace(/(^\s*)|(\s*$)/g, ""); |
| | | colName = to.toLowerCase().replace(/(^\s*)|(\s*$)/g, ""); |
| | | } catch (e) { } |
| | | if (row[s] == undefined && row.Def[s] == undefined) { return; } |
| | | if (st == "null" || st == null || st == NaN) st = ""; |
| | | if (row[colName] == undefined && row.Def[colName] == undefined) { return; } |
| | | if (value == "null" || value == null || value == NaN) value = ""; |
| | | //判断当前字段是否是时间类型,需要做转换才能正确显示在单元格中 |
| | | if (this.Cols[s].Type == "Date") { |
| | | st = new Date(st).getTime(); |
| | | if (this.Cols[colName].Type == "Date") { |
| | | value = new Date(value).getTime(); |
| | | } |
| | | if (this.Cols[s].Type == "Img") {//图片或附件在只读的时候,不是图片的可以下载 |
| | | var picArry=st.split("@T@"); |
| | | if (this.Cols[colName].Type == "Img") {//图片或附件在只读的时候,不是图片的可以下载 |
| | | var picArry=value.split("@T@"); |
| | | //row[s + '_Img'] = st; |
| | | this.Cols[s].couter = "Img"; |
| | | this.Cols[colName].couter = "Img"; |
| | | var str = new RegExp(/uuid=.*\|/i).exec(picArry[0]); |
| | | var unidList = null; |
| | | if (str != null) { |
| | | unidList = str[0]; |
| | | } else if (st.indexOf(";") > 0) { |
| | | unidList = st; |
| | | } else if (value.indexOf(";") > 0) { |
| | | unidList = value; |
| | | } |
| | | if (unidList != null) { |
| | | // var strUnid=unidList.split(";"); |
| | | st = this.createPicPath(unidList); |
| | | value = this.createPicPath(unidList); |
| | | } |
| | | if(picArry.length==2&&picArry[1]!=""){ |
| | | //表示有需要的值写回数据库 |
| | | row[s + '_Img'] = picArry[1].replace("|48|48|",""); |
| | | row[colName + '_Img'] = picArry[1].replace("|48|48|",""); |
| | | //console.log("row[s + '_Img']:"+row[s + '_Img']); |
| | | st=picArry[0]; |
| | | value=picArry[0]; |
| | | } |
| | | } |
| | | if (this.Cols[s] != undefined && (this.Cols[s].Type == "Enum" || this.Cols[s].Type == "Radio") && st != undefined && st != "") {//31,43类型 |
| | | var id = s; |
| | | var vl = st; |
| | | if (this.Cols[colName] != undefined && (this.Cols[colName].Type == "Enum" || this.Cols[colName].Type == "Radio") && value != undefined && value != "") {//31,43类型 |
| | | var id = colName; |
| | | var vl = value; |
| | | var V = row; |
| | | if (this.Cols[id].dySql == undefined) {//下拉列表2,31控件,解决后台取不到实际值问题,且当前不是实际值 by 13-5-27 |
| | | var keys = this.Cols[id].EnumKeys.split("|"); |
| | |
| | | |
| | | } |
| | | |
| | | if ((row[s + "_expr"] != undefined && st == "******")) { |
| | | row[s + "Type"] = "Text"; |
| | | row[s + "_expr"] = 0; |
| | | if ((row[colName + "_expr"] != undefined && value == "******")) { |
| | | row[colName + "Type"] = "Text"; |
| | | row[colName + "_expr"] = 0; |
| | | } |
| | | //this.EndEdit(true); |
| | | //if(this.Cols[s].Type=="Float"||this.Cols[s].Type=="Int"){ |
| | | // st[i]=isNaN(st[i])?"0":st[i]; |
| | | // } |
| | | try { |
| | | if (isNaN(st) && st != "") st = st.replace(/\t|\n|\r|\r\n|\n\r/g, ""); |
| | | if (isNaN(value) && value != "") value = value.replace(/\t|\n|\r|\r\n|\n\r/g, ""); |
| | | } catch (e) { } |
| | | this.SetValue(row, s, st, 0); |
| | | var ss = s; |
| | | this.SetValue(row, colName, value, 0); |
| | | var ss = colName; |
| | | try { |
| | | ss = s.toLowerCase(); |
| | | ss = colName.toLowerCase(); |
| | | } catch (e) { } |
| | | if ((row[s + "_expr"] != undefined && row[s + "_expr"] !== "" && row[s + "_expr"] == 0) || this.expr_obj[ss] == 0) {//处理和权限有关 |
| | | row[s + "_expr_val"] = st; |
| | | row[s + "CanEdit"] = 0; |
| | | row[s + "Type"] = "Text"; |
| | | row[s] = "******"; |
| | | if ((row[colName + "_expr"] != undefined && row[colName + "_expr"] !== "" && row[colName + "_expr"] == 0) || this.expr_obj[ss] == 0) {//处理和权限有关 |
| | | row[colName + "_expr_val"] = value; |
| | | row[colName + "CanEdit"] = 0; |
| | | row[colName + "Type"] = "Text"; |
| | | row[colName] = "******"; |
| | | } |
| | | if (row[s + "_Link"] != undefined) { |
| | | if (row[colName + "_Link"] != undefined) { |
| | | //console.log(s+"="+row[s]); |
| | | row[s + "_Link"] = row[s]; |
| | | row[colName + "_Link"] = row[colName]; |
| | | |
| | | } |
| | | this.RefreshCell(row, to); |
| | | |
| | | if (flag == undefined || flag == true) { |
| | | //s!=c表示不需要重新计算当前字段所触发的公式,c为当前字段 |
| | | if (this.Cols[s] != undefined && this.Cols[s].calcuField != undefined && s != c) {//需要重新计算公式 |
| | | if (this.Cols[colName] != undefined && this.Cols[colName].calcuField != undefined && colName != c) {//需要重新计算公式 |
| | | |
| | | GT.formula.completeFormula(this, row, orgCol, false); |
| | | } |
| | | } |
| | | //--重新加载以当前字段作为参数的相关31下拉数据 |
| | | this.completeType31List(row,c||orgCol); |
| | | } |
| | | } else {//数组更新多用于三点弹出 |
| | | if (typeof (st) != 'undefined') {//st表示返回的值 |
| | | if (typeof (value) != 'undefined') {//st表示返回的值 |
| | | //增加处理当前行是加载页面时就有了,所以不存在Changed,Added的标记, |
| | | //当二个都不存在,而又是通过三点返回数据,可以认为是对当前行进行修改操作,应增加Changed标记,以便能正常处理 |
| | | //if(row["Changed"]==undefined&&row["Added"]==undefined) row["Changed"]=1; |
| | | for (var i = 0; i < st.length; i++) { |
| | | var s = to[i]; |
| | | for (var i = 0; i < value.length; i++) { |
| | | var colName = to[i]; |
| | | try { |
| | | s = to[i].toLowerCase().replace(/(^\s*)|(\s*$)/g, ""); |
| | | colName = to[i].toLowerCase().replace(/(^\s*)|(\s*$)/g, ""); |
| | | } catch (e) { } |
| | | if (row[s] == undefined && row.Def[s] == undefined) { continue; } |
| | | if (st[i] == "null" || st[i] == null || st == NaN) st[i] = ""; |
| | | if (row[colName] == undefined && row.Def[colName] == undefined) { continue; } |
| | | if (value[i] == "null" || value[i] == null || value == NaN) value[i] = ""; |
| | | //判断当前字段是否是时间类型,需要做转换才能正确显示在单元格中 |
| | | if (this.Cols[s].Type == "Date") { |
| | | st[i] = new Date(st[i]).getTime(); |
| | | if (this.Cols[colName].Type == "Date") { |
| | | value[i] = new Date(value[i]).getTime(); |
| | | } |
| | | if (this.Cols[s].Type == "Img") { //图片或附件在只读的时候,不是图片的可以下载 |
| | | if (st[i] != undefined && st[i] != "") { |
| | | if (this.Cols[colName].Type == "Img") { //图片或附件在只读的时候,不是图片的可以下载 |
| | | if (value[i] != undefined && value[i] != "") { |
| | | //row[s+'_Img']=st[i]; |
| | | //返回的图片增加实体值,方便写到数据库 |
| | | var picArry=st[i].split("@T@"); |
| | | var picArry=value[i].split("@T@"); |
| | | //console.log("st[i]:"+st[i]); |
| | | var str = new RegExp(/uuid=.*\|/i).exec(picArry[0]); |
| | | var unidList = null; |
| | |
| | | if(strUnid.length==2){ |
| | | unid+=";jpg";//不存在图片类型,加一个默认 |
| | | } |
| | | row[s + '_Img'] = strUnid[0] + ";" + strUnid[1]; |
| | | st[i] = this.createPicPath(unid, null); |
| | | row[colName + '_Img'] = strUnid[0] + ";" + strUnid[1]; |
| | | value[i] = this.createPicPath(unid, null); |
| | | //console.log("st[i]111:"+st[i]); |
| | | } |
| | | if(picArry.length==2&&picArry[1]!=""){ |
| | | //表示有需要的值写回数据库 |
| | | |
| | | row[s + '_Img'] = picArry[1].replace("|48|48|",""); |
| | | row[colName + '_Img'] = picArry[1].replace("|48|48|",""); |
| | | //console.log("row[s + '_Img']:"+row[s + '_Img']); |
| | | st[i]=picArry[0]; |
| | | value[i]=picArry[0]; |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | } |
| | | } |
| | | if (this.Cols[s] != undefined && (this.Cols[s].Type == "Enum" || this.Cols[s].Type == "Radio") && st[i] != undefined && st[i] != "") {//31,43类型 |
| | | var id = s; |
| | | var vl = st[i]; |
| | | if (this.Cols[colName] != undefined && (this.Cols[colName].Type == "Enum" || this.Cols[colName].Type == "Radio") && value[i] != undefined && value[i] != "") {//31,43类型 |
| | | var id = colName; |
| | | var vl = value[i]; |
| | | var V = row; |
| | | if (this.Cols[id].dySql == undefined) {//下拉列表2,31控件,解决后台取不到实际值问题,且当前不是实际值 by 13-5-27 |
| | | var keys = this.Cols[id].EnumKeys.split("|");//实际值 |
| | |
| | | if (indexd) { |
| | | //V[id] = keys[indexd]; |
| | | //直接给值会造成修改状态不会变化,所以换成SetValue方法,会增加Orig标记 |
| | | this.SetValue(V, s, keys[indexd], flg); |
| | | this.SetValue(V, colName, keys[indexd], flg); |
| | | } else {//什么都不是,则把这个值作为下拉的实际值和显示值 |
| | | var ss = this.getGoalValue(vl); |
| | | var temp = ((ss == 'null' || ss == undefined) ? vl : ss); |
| | |
| | | } |
| | | |
| | | } |
| | | if ((row[s + "_expr"] != undefined && st[i] == "******")) { |
| | | if ((row[colName + "_expr"] != undefined && value[i] == "******")) { |
| | | // st[i]="******"; |
| | | row[s + "Type"] = "Text"; |
| | | row[colName + "Type"] = "Text"; |
| | | |
| | | row[s + "_expr"] = 0; |
| | | row[colName + "_expr"] = 0; |
| | | } |
| | | |
| | | //if(this.Cols[s].Type=="Float"||this.Cols[s].Type=="Int"){ |
| | |
| | | var flg = 0; |
| | | if (index = -1) flg = -1 |
| | | |
| | | if (isNaN(st[i])) { |
| | | if (isNaN(value[i])) { |
| | | try { |
| | | //console.log("11>>"+st[i]); |
| | | st[i] = st[i].replace(/\t|\n|\r|\r\n|\n\r/g, ""); |
| | | value[i] = value[i].replace(/\t|\n|\r|\r\n|\n\r/g, ""); |
| | | } catch (e) { } |
| | | } |
| | | //console.log(">>"+st[i].length); |
| | | this.SetValue(row, s, st[i], flg); |
| | | var ss = s; |
| | | this.SetValue(row, colName, value[i], flg); |
| | | var ss = colName; |
| | | try { |
| | | ss = s.toLowerCase(); |
| | | ss = colName.toLowerCase(); |
| | | |
| | | } catch (e) { } |
| | | //处理有权限的情况,取出来保存到特定地方,再用星号替换 |
| | | if ((row[s + "_expr"] != undefined && row[s + "_expr"] !== "" && row[s + "_expr"] == 0) || this.expr_obj[ss] == 0) { |
| | | if (row[s + "_expr"] == 0) { |
| | | if ((row[colName + "_expr"] != undefined && row[colName + "_expr"] !== "" && row[colName + "_expr"] == 0) || this.expr_obj[ss] == 0) { |
| | | if (row[colName + "_expr"] == 0) { |
| | | //console.log(s+":"+st[i]); |
| | | |
| | | row[s + "_expr_val"] = st[i]; |
| | | row[s + "CanEdit"] = 0; |
| | | row[s + "Type"] = "Text"; |
| | | row[s] = "******"; |
| | | row[colName + "_expr_val"] = value[i]; |
| | | row[colName + "CanEdit"] = 0; |
| | | row[colName + "Type"] = "Text"; |
| | | row[colName] = "******"; |
| | | } |
| | | } |
| | | if (row[s + "_Link"] != undefined) { |
| | | if (row[colName + "_Link"] != undefined) { |
| | | //console.log(s+"="+row[s]); |
| | | row[s + "_Link"] = row[s]; |
| | | row[colName + "_Link"] = row[colName]; |
| | | |
| | | } |
| | | //console.log("RefreshCell="+s+","+row[s]); |
| | | this.RefreshCell(row, s); |
| | | this.RefreshCell(row, colName); |
| | | //console.log("RefreshCell2="+s+","+row[s]); |
| | | } |
| | | if (flag == undefined || flag == true) { |
| | |
| | | } |
| | | |
| | | } |
| | | //--重新加载以当前字段作为参数的相关31下拉数据 |
| | | this.completeType31List(row,c||orgCol); |
| | | } |
| | | } |
| | | this.setTotalCols();//更新统计列 |
| | |
| | | var strUnid = unidList.split(";"); |
| | | var lastVal = ""; |
| | | if (strUnid.length > 2) { |
| | | lastVal = strUnid[strUnid.length - 1].toLowerCase();//最后一个是图片格式 |
| | | lastVal = strUnid[strUnid.length - 1];//最后一个是图片格式 |
| | | } |
| | | if (lastVal != "jpg" |
| | | && lastVal != "png" |
| | | && lastVal != "gif" |
| | | && lastVal != "bmp" |
| | | && lastVal != "ico" |
| | | && lastVal != "jpeg") {//非图片 |
| | | if (lastVal.toLowerCase() != "jpg" |
| | | && lastVal.toLowerCase() != "png" |
| | | && lastVal.toLowerCase() != "gif" |
| | | && lastVal.toLowerCase() != "bmp" |
| | | && lastVal.toLowerCase() != "ico" |
| | | && lastVal.toLowerCase() != "jpeg") {//非图片 |
| | | return "|" + getAttachmentUrl(this.getPicExtV2(lastVal), this.formid, strUnid[0] + "@p@" + strUnid[1], |
| | | this.Data.attachment_server, this.Data.dbid, true, 80, 80, lastVal) + "|48|48"; |
| | | } else { |
| | |
| | | } |
| | | } else { |
| | | strType = "&ishd=" + hd; |
| | | } |
| | | if(row["detailrowid"]!=undefined&&row["detailrowid"]!=""){ |
| | | strType=strType+"&detailrowid="+row["detailrowid"]; |
| | | } |
| | | var sta = window.document.getElementById("docstatus") == undefined ? 0 : window.document.getElementById("docstatus").value; |
| | | url += "?rowid=" + row["rowid"] + strType + "&fieldid=" + col + "&formid=" + formid + "&doccode=" + doccode + m + "&status=" + sta + ">id=" + this.Index;//增加在多表情况下指定是哪一个grid; |
| | |
| | | var obj = this.getRefGrid496(); |
| | | if (obj != undefined && obj != null && obj.rowIDp != null && obj.rowIDp != undefined&&V["rowid"]=="") {//表明当前格线的rowid要取和它关联的格线rowid |
| | | //console.log("obj.rowIDp="+obj.id+">>"+obj.rowIDp["rowid"]); |
| | | |
| | | V["rowid"] = obj.rowIDp["rowid"];//rowIDp这行表示上一个关联格线点击行 |
| | | //判断上一个是不是主功能号格线,如果是第一个格线,rowid赋值给rowid,不然取detailrowid赋值给关联的rowid |
| | | if(obj.rowIDp["detailrowid"]!=undefined&&obj.rowIDp["detailrowid"]!=""){ |
| | | V["rowid"] = obj.rowIDp["detailrowid"];//rowIDp这行表示上一个关联格线点击行 |
| | | }else{ |
| | | V["rowid"] = obj.rowIDp["rowid"];//rowIDp这行表示上一个关联格线点击行 |
| | | } |
| | | } |
| | | if (this.keyid != undefined && this.keyid != "") {//判断当前格线有没和下面格线有关联,有关联则需要生成rowid。以便给下面格线用,没关联则后台生成rowid |
| | | //this.keyid有值表示有关联,V["rowid"]有值表示通过上级关联给值,没值则表示它是第一级,需要从后台生成 |
| | |
| | | }); |
| | | } |
| | | } else { |
| | | if (typeof (V["rowid"]) != "undefined") { V["rowid"] = ""; } |
| | | //树形节点rowid不能清除,因为是从后端生成返回的值 |
| | | if (typeof (V["rowid"]) != "undefined"&&this.isTree!=1) { V["rowid"] = ""; } |
| | | } |
| | | if (V["docitem"] != null) { V["docitem"] = this.docitem; } |
| | | |
| | |
| | | if (foum[i].indexOf("autocode") > 0) { |
| | | temp = foum[i].split(/#\b/); |
| | | } else { |
| | | temp = foum[i].split(/#/); |
| | | temp = foum[i].split(/\b#/);//存在初始值以#开头的情况,所以这里要处理下,用\b#分割 |
| | | } |
| | | valuelist[i] = temp[1]; |
| | | valueID[i] = temp[0]; |
| | |
| | | V[id] = da.getFullYear() + "-" + (da.getMonth() + 1) + |
| | | "-" + da.getDate() + " " + da.getHours() + |
| | | ":" + da.getMinutes() + ":" + da.getSeconds(); |
| | | } |
| | | else {//字段名称的情况 |
| | | }else {//字段名称的情况 |
| | | if (vl.toLowerCase().match("autocode")) {//自增编号 |
| | | var E = {}; |
| | | E.Url = "/gtGrid.do?m=auto"; |
| | |
| | | E.Sync = 1; |
| | | E.isGt = 1; |
| | | E.Method = "post"; |
| | | var x = "{ "; |
| | | var ti = vl.split("|")[1]; |
| | | if (ti == 1) { |
| | | x += "'autoCode':\"" + vl.split("|")[2] + "\""; |
| | | } |
| | | else { |
| | | var tid = ""; |
| | | var temp = this.treeid.split(";"); |
| | | tid = temp[0]; |
| | | x += "'autoCode':\"" + vl.split("|")[2].replace("~", this.treeRowid).replace("#", tid) + "\""; |
| | | } |
| | | x += ",'flag':" + ti; |
| | | x += "}" |
| | | var x = "{ 'autoCode':\"" + vl.split("|")[1].replace("~", this.treeid.split(";")[0]) + "\"}"; |
| | | this.AjaxCall(E, x, |
| | | function ($, req) { |
| | | if (req.indexOf("error;") > -1) {//出错了,弹出来 |
| | |
| | | vl=V[id]; |
| | | } else { |
| | | var s = this.getGoalValue(vl); |
| | | var notTrue=true;//表示2,31,46等控件设置的初始值不存在下拉列表中,需要设置为空串 |
| | | if (this.Cols[id].Type == "Enum" || this.Cols[id].Type == "Radio")//增加取页面下拉值,需要生成下拉数据 |
| | | { |
| | | this.initDysql(V, id, vl); |
| | | notTrue=this.initDysql(V, id, vl); |
| | | } |
| | | |
| | | if (s == 'null' || s == undefined) { |
| | |
| | | //针对日期进行处理 |
| | | V[id]=StringToDate(vl,(this.Cols[id].Format!=""?this.Cols[id].Format:"yyyy-MM-dd")); |
| | | }else{ |
| | | V[id] = vl; |
| | | if(notTrue){ V[id] = vl;} |
| | | } |
| | | } |
| | | } else { |
| | |
| | | if (this.isTree == 1) {//有树设置时候需要设置parentrowid等于上级的rowid |
| | | V["parentrowid"] = this.treeParentRowid || ""; |
| | | this.treeParentRowid = ""; |
| | | if (V["rowid"] != undefined && V["rowid"]== "") {//增加在树形节点时,新增节点都需要从后台取到rowid,以便到时和子节点做关联 |
| | | var rec = V; |
| | | var E = {}; |
| | | E.Url = "/gtGrid.do?m=rowids"; |
| | | E.Format = "JSON"; |
| | | E.Data = "_pop_json"; |
| | | E.Sync = 1; |
| | | E.isGt = 1; |
| | | E.Method = "post"; |
| | | var x = "{'parm':'2'}"; |
| | | this.AjaxCall(E, x, |
| | | function (req, $) { |
| | | v = $.split(";"); |
| | | if (rec["rowid"] === "") { |
| | | rec["rowid"] = v[0]; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | //增加46控件的显示 |
| | | for (var c in this.Cols) { |
| | | if(this.Cols[c].colType==46){ |
| | | if(this.Cols[c].Enum==undefined&&this.Cols[c].dysql==undefined){//弹出颜色拾取器 |
| | | V[c+"CanEdit"]=0; |
| | | V[c+"HtmlPrefix"]="<div style=\"background:#cccccc\"><input title=\"双击选取颜色\" type=\"color\" style=\"width: 100%;height:25;border: none;\" value=\"#cccccc\" id=\""+c+"_color\" onchange=\"Grids["+this.Index+"].setcolorby46(this);\"/>"; |
| | | V[c+"HtmlPrefix"]="<div style=\"background:#cccccc\"><input title=\"双击选取颜色\" type=\"color\" style=\"width: 100%;height:25px;border: none;\" value=\"#cccccc\" id=\""+c+"_color\" onchange=\"Grids["+this.Index+"].setcolorby46(this);\"/>"; |
| | | V[c+"HtmlPostfix"]="</div>"; |
| | | } |
| | | } |
| | |
| | | } |
| | | this.RefreshRow(V); |
| | | }; |
| | | TGP.getGoalValue = function (A) {//从页面第一个格线向下查找,找到就返回 |
| | | TGP.getGoalValue = function (A,row) {//从,row第一个格线向下查找,找到就返回 |
| | | var rst = 'null'; |
| | | for (var g = 0; g < Grids.length; g++) { |
| | | var grid = Grids[g]; |
| | | try { |
| | | rst = grid.getField(A.toLowerCase()); |
| | | } catch (e) { |
| | | rst = grid.getField(A); |
| | | rst = grid.getField(A,row); |
| | | } |
| | | if (rst != 'null' && rst != undefined) { |
| | | if(rst != 'null' && rst != undefined) { |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | }; |
| | | TGP.getField = function (id) {//取得当前集合的字段值 if(ro[c+"_Link"]!==undefined){tem[c]=ro[c+"_Link"];} |
| | | TGP.getField = function (id,row) {//取行的字段值 if(ro[c+"_Link"]!==undefined){tem[c]=ro[c+"_Link"];} |
| | | |
| | | if (this.gType == 3 || this.gType == 30 || this.gType == 301 || this.gType == 303 || this.gType == 304) {//处理由于这些特殊窗体的打开更多的实现与其他的不一样,所以这里特定取点中的那行的值 |
| | | if (GT.rowIDp) { |
| | |
| | | } |
| | | |
| | | } |
| | | if(this.isFillCell){ |
| | | var val = (row[id + "_Link"] !== undefined) ? row[id + "_Link"] : row[id]; |
| | | if (row[id + "_expr_val"] !== undefined) val = row[id + "_expr_val"]; |
| | | if (row[id + "_Img"] !== undefined) val = row[id + "_Img"]; |
| | | return val; |
| | | }else{ |
| | | if (this.ARow || this.FRow) { |
| | | if (this.FRow) { |
| | | var val = (this.FRow[id + "_Link"] !== undefined) ? this.FRow[id + "_Link"] : this.FRow[id]; |
| | |
| | | } else { |
| | | return "null" |
| | | } |
| | | } |
| | | }; |
| | | TGP.getFieldForNew = function () {//增加功能链接可以选多行记录作为参数来执行。 by 2013-12-13 |
| | | var mygrid=this; |
| | | var row = []; |
| | | if(this.gType==15||this.gType==497||this.gType==499){ |
| | | //多表的情况下需要获取到点中的那个表格 |
| | | mygrid=Grids.Focused==undefined?null:Grids.Focused; |
| | | } |
| | | if(mygrid!=null){ |
| | | //取选中行 |
| | | row = this.getSelectRows_One(); |
| | | row = mygrid.getSelectRows_One(); |
| | | //没有,取鼠标点中 |
| | | if (row.length == 0) { |
| | | if (this.ARow || this.FRow) { |
| | | if (this.ARow) { |
| | | row.push(this.ARow); |
| | | if (mygrid.ARow || mygrid.FRow) { |
| | | if (mygrid.ARow) { |
| | | row.push(mygrid.ARow); |
| | | } else { |
| | | row.push(this.FRow); |
| | | row.push(mygrid.FRow); |
| | | } |
| | | } |
| | | } |
| | | //再没有,取第一行 |
| | | //再没有,取第一行,去掉下面代码。因为新需求是不选择则提示先选择才能执行下去 |
| | | if (row.length == 0) { |
| | | row.push(this.getFristRow()); |
| | | //但如果只有一行的情况,也需要返回这一行 |
| | | if(mygrid.GetDataRows().length==1){ |
| | | row.push(mygrid.getFristRow()); |
| | | } |
| | | } |
| | | } |
| | | return row; |
| | | }; |
| | | TGP.getFristRow = function (v) {//取得第一个行 |
| | |
| | | //if(cl.Name=="") |
| | | //console.log(cl.Name+">>"+cl.CanEdit+","+cl.Fformid+","+cl.Fwtype+","+A.Kind); |
| | | if (A[cl.Name] == "null") { A[cl.Name] = ""; } |
| | | if(cl.colType==47){ |
| | | if(cl.colType==47&&(A[cl.Name+"hidden47"]==undefined||A[cl.Name+"hidden47"]==null)){ |
| | | var progress=0; |
| | | var tempValue=null; |
| | | if(A[cl.Name]!=""){ |
| | | progress=A[cl.Name]; |
| | | tempValue=A[cl.Name]; |
| | | if(isNaN(parseFloat(progress))){//不是数值的情况 |
| | | progress=0; |
| | | } |
| | |
| | | htmlperfix+="<div style=\"color:#fff;line-height: 18px;position: absolute;float: left;left: 50%;transform: translateX(-50%);\">"+progress+"%</div>"; |
| | | A[cl.Name + "HtmlPrefix"]=htmlperfix; |
| | | A[cl.Name+"HtmlPostfix"]="</div>"; |
| | | A[cl.Name+"hidden47"]=tempValue;//避免第二次生成时清空了之前的值,因为在有树节点的情况会处理二次的情况 |
| | | if(cl.Fformid && cl.Fformid !== "" && cl.Fwtype && cl.Fwtype !== "" && A.Kind == "Data"){ |
| | | A[cl.Name+"HtmlBy47"]=htmlperfix+"</div>";//保存47的内容,如果设置了超链接需要用到 |
| | | A[cl.Name + "HtmlPrefix"]=null; |
| | |
| | | //console.log(">>>3"+A[cl.Name+'_Img']); |
| | | //console.log(">>>4"+A[cl.Name]); |
| | | if (A[cl.Name] != undefined && A[cl.Name] != "" && A[cl.Name].indexOf("|/") == 0) {//以|/开始,则处理成url输出 |
| | | if(A[cl.Name].match(/\.jpg|\.gif|\.bmp|\.png|\.ico|;jpg|;gif|;bmp|;png|;ico/i) == null){ |
| | | //表示不是图片,需要用默认图片显示 |
| | | A[cl.Name]="|"+this.Data.attachment_server+this.getPicExtV2(A[cl.Name]); |
| | | } |
| | | if (this.Data.attachment_server != undefined && this.Data.attachment_server != "") { |
| | | var str = new RegExp(/uuid=.*\|/i).exec(A[cl.Name]); |
| | | if (str != null) { |
| | |
| | | A[cl.Name+"CanEdit"]=0;//不管有没设置只读也要设置为只读 |
| | | if(cl.is46OnlyRead==1){ |
| | | //只读情况 |
| | | A[cl.Name+"HtmlPrefix"]="<div style=\"background:"+color+";width: 100%;height:25;border: none;\">"; |
| | | A[cl.Name+"HtmlPrefix"]="<div style=\"background:"+color+";width: 100%;height:25px;border: none;\">"; |
| | | A[cl.Name+"HtmlPostfix"]="</div>"; |
| | | |
| | | }else{ |
| | | A[cl.Name + "HtmlPrefix"]="<div style=\"height:25;background:"+color+"\"><input title=\"双击选取颜色\" type=\"color\" style=\"width: 100%;height:25;border: none;\" value=\""+color+"\" id=\""+cl.Name+"_color\" onchange=\"Grids["+this.Index+"].setcolorby46(this);\"/>"; |
| | | A[cl.Name + "HtmlPrefix"]="<div style=\"height:25px;background:"+color+"\"><input title=\"双击选取颜色\" type=\"color\" style=\"width: 100%;height:25px;border: none;\" value=\""+color+"\" id=\""+cl.Name+"_color\" onchange=\"Grids["+this.Index+"].setcolorby46(this);\"/>"; |
| | | A[cl.Name+"HtmlPostfix"]="</div>"; |
| | | } |
| | | } |
| | |
| | | var C, A; |
| | | var max = 0;//最大值 |
| | | var min = 0;//最小值 |
| | | //console.log("------id:"+$.id); |
| | | for (var r in $.Rows) {//检查所有行 |
| | | var _ = $.Rows[r]; |
| | | //console.log("row_Filtered:"+_.Filtered+"|"+id+":"+_[id]); |
| | | if (_.Filtered == 1) continue;//去掉过滤的行 |
| | | |
| | | |
| | |
| | | } |
| | | temp = isNaN(temp) ? temp.replace(/'/g, "''") : temp; |
| | | } else { |
| | | temp = gt.getGoalValue(t); |
| | | if (temp != undefined && temp != "null") { |
| | | temp = gt.getGoalValue(t,record); |
| | | if(temp != undefined && temp != "null") { |
| | | //temp=record[t] |
| | | if (gt.Cols[t] != undefined && gt.Cols[t].Type == "Date") {//by2014-9-24 增加对时间的处理,转成日期格式,默认是毫秒数 |
| | | if (temp != "") { |
| | |
| | | } |
| | | _ += "'funName':\"" + ss[0].replace(/\(.*\)/g, "").replace(/(^\s*)|(\s*$)/g, "");//函数名 |
| | | _ += "\",'fields':\"" + ss[1];//.replace(";",",");//字段列名,返回的值需要填回哪些字段 |
| | | _ += "\",'parm':\"" + ppo + "\"}";//值 |
| | | _ += "\",'parm':\"" + ppo.replace(/\"/g,'_@dou@_') + "\"}";//值,处理内容有双引号的情况【"】,在后端再处理 |
| | | var cal = $.calcuField; |
| | | gt.AjaxCall(E, _, |
| | | function (req, $) { |
| | |
| | | if (row[id + "_expr_val"] != undefined) ln = row[id + "_expr_val"]; |
| | | if (grid == undefined) return ln; |
| | | var cl = grid.Cols[id]; |
| | | if(cl!=undefined){ |
| | | if (cl.Type == "Date" && cl.Format != "") {//内容为日期,需要格式化 |
| | | //console.log(cl.Name+">>1>"+row[cl.Name]); |
| | | if (ln != null && ln != "") { |
| | |
| | | } else if (cl.Type == "Text" && cl.Format != null && cl.Format != "") { |
| | | return GT.formatDate(ln, cl.Format); |
| | | } else { |
| | | return ln; |
| | | return ln==undefined?"":ln; |
| | | } |
| | | |
| | | }else{ |
| | | alert(id+"\u5B57\u6BB5\u5728\u5F53\u524D\u9875\u9762\u4E0D\u5B58\u5728\uFF0C\u68C0\u67E5\u0039\u0038\u0030\u0032\u76F8\u5173\u53C2\u6570\u66FF\u6362\u8BBE\u7F6E\u0028\u521D\u59CB\u503C\uFF0C\u516C\u5F0F\u0029[call by formatDateBy5]"); |
| | | } |
| | | }; |
| | | GT.getElementByIdValue = function (el,id){ |
| | | if(el){ |
| | |
| | | return value; |
| | | } |
| | | }; |
| | | GT.filterStr = function (filter, info, rec, grid) { |
| | | GT.filterStr = function (filter, info, rec, grid,isHeader) { |
| | | var flg = false; |
| | | if (filter instanceof Array) { flg = true; filter = filter.join(";"); }//因为有存在是数组的情况,转为字符串 |
| | | if (filter != "" && filter.match(/&.*?&/)) {//存在&...&的字段才需要查找 |
| | |
| | | } |
| | | } |
| | | var str = (flg ? filter.replace(/(.)(?=[^$])/g, "$1,").split(";") : filter); |
| | | if(isHeader){ |
| | | return str === "" ? "" : str.replace("'null'", null); |
| | | }else{ |
| | | return str === "" ? "" : "(" + str.replace("'null'", null) + ")"; |
| | | } |
| | | }; |
| | | GT.threePop = {//3类型窗体代码 |
| | | row: null, |
| | |
| | | } |
| | | if (!GT.threePop.oneGrid) { |
| | | var f = document; |
| | | var v =f.getElementById(vts); 因为面板存在多选控件,原方法只会取到第一个值,而不是全部值 |
| | | var v =f.getElementById(vts); //因为面板存在多选控件,原方法只会取到第一个值,而不是全部值 |
| | | if (v) {//从上面开始向下查找,如果没这个字段定义才需要向格线找,不然是什么值就传什么,去掉&&v.value&&v.value!=''&&v.value!=='0' |
| | | if (m != 0) sf += "@P@" + eqs + "@P@"; |
| | | var vt =v.value; |