fs-danaus
2023-03-30 665b0603d09890014f982fdfbd6ec47938f504b0
自动编号更新及一些问题的修正
4个文件已删除
10个文件已修改
8243 ■■■■■ 已修改文件
Grid/Cell.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/Data.js.bak 903 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/DataIn.js 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/DataIn.js.bak 238 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/DataOut.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/Export.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/RowAdd.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/RowCopy.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/UpdateValues.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lib/Format.js.bak 676 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Words/EAPIGlobals.txt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Words/EAPIProperties.txt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
core.js 534 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
core.js.bak 5835 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Grid/Cell.js
@@ -420,10 +420,12 @@
         if(v===o) continue;
         if(v==null) v = val; else val = v;
         }
         this.isFillCell=true;//***增加标记当前操作是shift+drop填充列
      chg += this.SetEditAttrs(R[ri],C[ci],val,A,clr||!AV[ri]?[]:AV[ri][ci],E,null,null,"FillCells");
      }
   if(chg) this.UpdateRowHeight(R[ri],1);
   } 
   this.isFillCell=false;//****
this.EndUpdate();
if(Grids.OnAutoFillFinish) Grids.OnAutoFillFinish(this,r1,c1,r2,c2,rdir,cdir,ro,co);
if(!EE) this.ProcessErrors(E);
Grid/Data.js.bak
File was deleted
Grid/DataIn.js
@@ -59,8 +59,20 @@
                             pageUrl[i]="index.jsp?"+(new Base64().encode("where=doccode='"+formInfo[2]+"'"));
                         }
                    }
                   parent.jQuery(parent.jQuery("#home-tabs").find("li.tabs-selected > a > span.tabs-title")).html(formInfo[3]+"-"+formInfo[0]+"-"+formInfo[2]);
                  location.href=pageUrl.join("/");
                   //parent.jQuery(parent.jQuery("#home-tabs").find("li.tabs-selected > a > span.tabs-title")).html(formInfo[3]+"-"+formInfo[0]+"-"+formInfo[2]);
                  if(top.approvedDoc!=null&&top.approvedDoc.index!=null&&top.approvedDoc.nextDoc!=null
                     &&top.approvedDoc.nextDoc!=""){
                   var tab= parent.jQuery('#home-tabs').tabs('getTab',top.approvedDoc.index);
                  //console.log("get-index:"+top.approvedDoc.index);
                  parent.jQuery('#home-tabs').tabs('update', {
                     tab: tab,
                     type:'header',
                     options: {
                        title: formInfo[3]+"-"+formInfo[0]+"-"+formInfo[2]
                     }
                  });
               }
                   location.href=pageUrl.join("/");
                    return;
                     }catch(e){
                      console.log("e:"+e)
@@ -132,8 +144,11 @@
                        this.callback(Xml.replace("datacheckError#|#",""),check);
                        return null;
                    }else if(Xml.indexOf("pushError#|#")==0){//推送出错返回
                        this.showMsgAlert(Xml.split("#|#")[1]);
                        var str=Xml.split("#|#");
                        this.showMsgAlert(str[1]);
                        if(str.length==3){//有单号才能刷新,新单确认时刷新会清空页面数据
                      location.href=document.URL;
                      }
                        }else{
                    this.showMsgAlert(Xml);
                    this.callback(false,false);//去掉加载层
Grid/DataIn.js.bak
File was deleted
Grid/DataOut.js
@@ -467,8 +467,9 @@
   }
if(this.SaveOrder) return (type?"":gridstart+chgstart) + this.GetChangesOrder() + (type?"":chgend+gridend);
var A = [], p = 0;
var R = this.GetFixedRows();
for(var i=0;i<R.length;i++) if(R[i].Kind!="Filter"){ A[p] = this.GetRowChanges(R[i],F,type,alldef,attrs); if(A[p]) p++;}
//***去掉统计列的提交
//var R = this.GetFixedRows();
//for(var i=0;i<R.length;i++) if(R[i].Kind!="Filter"){ A[p] = this.GetRowChanges(R[i],F,type,alldef,attrs); if(A[p]) p++;}
for(var r=this.XS.firstChild;r;r=r.nextSibling){ A[p] = this.GetRowChanges(r,F,type,alldef,attrs); if(A[p]) p++; }
for(var b=this.XB.firstChild;b;b=b.nextSibling){ A[p] = this.GetChildrenChanges(b,F,type,alldef,attrs); if(A[p]) p++;}
if(F.Json && p && A[p-1].slice(-1)==',') A[p-1] = A[p-1].slice(0,-1); 
Grid/Export.js
@@ -70,7 +70,7 @@
      var has = this.HasSelected();
      O["Options"].push(
         {Name:"ExportSelected",Text:this.GetText("ExportSelected"+(has&5?(has&6?"Cells":"Rows"):"Cols"),L),Bool:1,Value:et["selected"],Hidden:!has,NoAll:1},
         {Name:"ExportFixedRows",Text:this.GetText("ExportFixedRows",L),Bool:1,Value:et["fixedrows"],Hidden:this.GetFirstVisible(this.XH)?0:1,NoAll:1},
         {Name:"ExportFixedRows",Text:this.GetText("ExportFixedRows",L),Bool:1,Value:1,Hidden:this.GetFirstVisible(this.XH)?0:1,NoAll:1},//***导出execl设置成固定标题,et["fixedrows"]
         {Name:"ExportFixedCols",Text:this.GetText("ExportFixedCols",L),Bool:1,Value:et["fixedcols"],Hidden:this.GetFirstCol(0)?0:1,NoAll:1},
         {Name:"ExportEmpty",Text:this.GetText("ExportEmpty",L),Bool:1,Value:et["empty"],Hidden:0,NoAll:1}
         );
Grid/RowAdd.js
@@ -267,7 +267,10 @@
        }
    }
//*****
if(test) return this.AddRow(par,next,null,null,null,null,null,1) ? 1 : 0;
if(test){
    this.isCopy=false;
    return this.AddRow(par,next,null,null,null,null,null,1) ? 1 : 0;
}
MS.Animate; this.FinishAnimations(); ME.Animate; 
this.UndoStart();
this.StartUpdate();
Grid/RowCopy.js
@@ -132,6 +132,7 @@
MS.Select;
// -----------------------------------------------------------------------------------------------------------
TGP.CopySelectedRows = function(F,deep,empty,type,foc,test,noscroll){ 
    this.isCopy=true;//***复行排除处理
MS.Master; if(F&1&&this.FocusNested(test)&&this.LastFocus[0].Adding&&this.LastFocus[0].Copying&&!(this.LastFocus[0].Locked["addrow"])) return this.LastFocus[0].CopySelectedRows(F,deep,empty,type,foc,test,noscroll); ME.Master;
if(!this.Copying || !this.Adding || this.Locked["addrow"]) return false;
var par = null, next = null, prev = null, row = this.GetARow(F&5,type==0?1:type==1?2:0);
Grid/UpdateValues.js
@@ -481,7 +481,7 @@
TGP.UpdateValues = function(){
var C = this.Cols, CC = [], CCT = [], p = 0, R = this.Def["R"];
this.AutoId = 1; this.ChildAutoId = 1; this.Rows = { };
this.gridTitleMap=new Map();
for(var c in C) {
   if(C[c].Prepared) continue;
   CCT[p] = c+"Type";
@@ -520,7 +520,6 @@
MS.Calc;
if(this.Calculating==null) for(var c in C) if(C[c].Formula) { this.Calculating = 1; break; }
ME.Calc;
var R = this.GetFixedRows(), hc = this.XH.childNodes.length, dyb = this.DynamicBorder;
for(var i=0;i<R.length;i++){
   var r = R[i];
Lib/Format.js.bak
File was deleted
Words/EAPIGlobals.txt
@@ -1,4 +1,13 @@
; ======= Global properties =======
gridTitlefun
Map
get
gridTitleMap
index
isSuppressBlankLineForDropDown
excel9687
title
NewExportName
excludeDocs
title
href
Words/EAPIProperties.txt
@@ -1,4 +1,13 @@
; ======= Global properties =======
gridTitlefun
Map
get
gridTitleMap
index
isSuppressBlankLineForDropDown
excel9687
title
NewExportName
excludeDocs
title
href
core.js
@@ -34,6 +34,7 @@
TGP.filters = '';//三表的过滤条件
TGP.excelTitle = '';//excel动态标题
TGP.gridTitle = "";//格线的动态标题
TGP.gridTitleMap =null;//格线的动态标题Map
//------------三点弹出需要用到
TGP.formP = '';//外表字段
TGP.toP = '';//自表字段
@@ -74,7 +75,8 @@
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;
@@ -84,7 +86,11 @@
        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];
@@ -368,6 +374,12 @@
    }
    //---根据主表过滤当前表格数据
    grid.processFilter();
    GT.rowIDp=null;//刷新格线后需要清除选中行状态
};
Grids.OnFilterFinish = function (grid,type) {
    //console.log("OnFilterFinish>>>>"+grid.id);
    //---根据主表过滤当前表格数据
    grid.processFilter();
};
Grids.OnStartEdit = function (grid, row, col) {
@@ -470,8 +482,8 @@
                    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;
                    }
@@ -519,36 +531,64 @@
                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("&#039;");
            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 {
@@ -559,7 +599,7 @@
        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;
@@ -568,27 +608,38 @@
                    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("&#039;");
                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;
@@ -702,7 +753,7 @@
        } 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, ""));
@@ -716,17 +767,30 @@
            this.AjaxCall(B, D, function (H, I) {
                if (I != undefined) {
                    A[J[i]] = I;
                    if (g.gridTitle != "") {
                        g.gridTitle += "&#039;" + J[i] + "&#040;" + I;
                    }
                    else {
                        g.gridTitle += J[i] + "&#040;" + 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+="&#039;" + key + "&#040;" + value;
    }else{
        this.gridTitle=key + "&#040;" + value;
    }
   });
   }
return this.gridTitle;
}
TGP.ActionTran = function ()//增加确定功能 by 11-4-25
{
    if (!this.tX()) { return false; }
@@ -1106,8 +1170,15 @@
                    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("&#039;");
                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类型  
@@ -1115,6 +1186,9 @@
                    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);
                    }
@@ -1143,7 +1217,7 @@
                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 = "";
            }
        }
@@ -1161,7 +1235,7 @@
                    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();
                }
@@ -1207,34 +1281,38 @@
};
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){}
            }
        }
    }
@@ -1285,7 +1363,8 @@
                } 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 + "";
@@ -1450,6 +1529,8 @@
    //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) {
@@ -1511,7 +1592,7 @@
                                //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);
                            }
@@ -1537,24 +1618,35 @@
                    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 {
@@ -1571,7 +1663,7 @@
                    }
                    temp[i] = s;
                }
                p_frame.openSetValue(temp, postToThis, true);
                p_frame.openSetValue(temp, posttothis_org, true);
                parent.closeTab();
            }
        }
@@ -1646,49 +1738,62 @@
        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("|");
@@ -1716,64 +1821,66 @@
            }
            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;
@@ -1790,16 +1897,16 @@
                            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];
                        }
                        
                        
@@ -1823,9 +1930,9 @@
                            */
                    }
                }
                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("|");//实际值
@@ -1848,7 +1955,7 @@
                        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);
@@ -1862,11 +1969,11 @@
                    }
                }
                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"){
@@ -1877,37 +1984,37 @@
                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) {
@@ -1917,6 +2024,8 @@
                }
            }
            //--重新加载以当前字段作为参数的相关31下拉数据
            this.completeType31List(row,c||orgCol);
        }
    }
    this.setTotalCols();//更新统计列
@@ -2230,14 +2339,14 @@
    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 {
@@ -2366,6 +2475,9 @@
            }
        } 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 + "&gtid=" + this.Index;//增加在多表情况下指定是哪一个grid;
@@ -2881,8 +2993,12 @@
        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"]有值表示通过上级关联给值,没值则表示它是第一级,需要从后台生成
@@ -2907,7 +3023,8 @@
                });
        }
    } 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; }
@@ -2978,7 +3095,7 @@
                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];
@@ -3022,8 +3139,7 @@
                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";
@@ -3032,19 +3148,7 @@
                    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) {//出错了,弹出来
@@ -3167,9 +3271,10 @@
                            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) {
@@ -3180,7 +3285,7 @@
                                        //针对日期进行处理
                                        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 {
@@ -3226,13 +3331,31 @@
    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=\"&#x53CC;&#x51FB;&#x9009;&#x53D6;&#x989C;&#x8272;\" 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=\"&#x53CC;&#x51FB;&#x9009;&#x53D6;&#x989C;&#x8272;\" type=\"color\"  style=\"width: 100%;height:25px;border: none;\" value=\"#cccccc\" id=\""+c+"_color\" onchange=\"Grids["+this.Index+"].setcolorby46(this);\"/>";
            V[c+"HtmlPostfix"]="</div>";
            }
        }
@@ -3244,16 +3367,16 @@
    }
    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;
        }
    }
@@ -3264,7 +3387,7 @@
    }
};
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) {
@@ -3275,6 +3398,12 @@
        }
    }
    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];
@@ -3307,25 +3436,36 @@
    } 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) {//取得第一个行
@@ -3719,10 +3859,12 @@
        //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;
                }
@@ -3739,6 +3881,7 @@
                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;
@@ -3917,6 +4060,10 @@
                    //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) {
@@ -4017,11 +4164,11 @@
            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=\"&#x53CC;&#x51FB;&#x9009;&#x53D6;&#x989C;&#x8272;\" 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=\"&#x53CC;&#x51FB;&#x9009;&#x53D6;&#x989C;&#x8272;\" 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>";
            }
        }
@@ -4995,8 +5142,10 @@
        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;//去掉过滤的行
@@ -5141,8 +5290,8 @@
                                }
                                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 != "") {
@@ -5219,7 +5368,7 @@
                    }
                    _ += "'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, $) {
@@ -5268,6 +5417,7 @@
    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 != "") {
@@ -5282,9 +5432,11 @@
    } 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){
@@ -5311,7 +5463,7 @@
    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(/&.*?&/)) {//存在&...&的字段才需要查找
@@ -5354,7 +5506,11 @@
        }
    }
    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,
@@ -5408,7 +5564,7 @@
                }
                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;
core.js.bak
File was deleted