当前位置 : 主页 > 编程语言 > java >

【弹窗】之间的数据传送

来源:互联网 收集:自由互联 发布时间:2021-06-28
页面点击进入弹窗 页面弹窗进入.png js事件处理 function btnSet_Click(){ if ($("#ddlZBWFlowType").val() == "") { showInfo(0); return alertMsg("请选择采购流程类型。", $("#ddlZBWFlowType")); } openModalWindow("VNewZBW
页面点击进入弹窗
                                            
 
                                            
 
                                            
 
                                            
 
                                            
 
                                        
页面弹窗进入.png js事件处理
function btnSet_Click()
{
    if ($("#ddlZBWFlowType").val() == "")
    {
        showInfo(0);
        return alertMsg("请选择采购流程类型。", $("#ddlZBWFlowType"));
    }
    openModalWindow("VNewZBWorkFlowModelListSet.aspx?ZBWFlowType=" + $("#ddlZBWFlowType").val(), 800, 600);
}
后台js开弹窗处理.png 弹窗显示内容
 
        
   
    
     
      
     
     
      
     
    
    
    
      <%# Eval("TreeImg")%> <%# Eval("ZBWFName")%> 
     
    
    
    
      <%# Eval("SetCheck").ToString() == "Y" ? "可以" : "不可以"%> 
     
    
    
     
     " /> 
     ">
      --
      
     
    
    
     
      
      
     
    
    
     
      
     
    
    
     
      
     
    
  
    
 
     
 


 
    
   
  
    
   
  

 
弹窗提交.png 弹窗后台js对提交的处理,获取信息并往主窗口增加数据显示
function setZBWorkFlow() {
    // 插入数据
    var tbList = window.dialogArguments._tblist
    var row;

    var cnt = tbList.rows.length - 1;
    for (j = cnt; j > 0; j--) {
        tbList.deleteRow(j);
    }

    for (var i = 1; i < dgData.rows.length; i++) {
        var objSelect = dgData.rows[i].getElementsByTagName("input");
        var objText = dgData.rows[i].getElementsByTagName("textarea");
        if (!dgData.rows[i].disabled && objSelect[0].checked) {
            row = tbList.insertRow();

            var cell = row.insertCell(0);
            cell.innerHTML = dgData.rows[i].cells[1].innerHTML;

            var setCheck = objSelect[0].setcheck;
            var isNeedCheck = "N";
            var setCheckName = "";
            if (setCheck == "N") {
                setCheckName = "--";
            }
            else {
                isNeedCheck = objSelect[1].checked ? "Y" : "N";
                if (objSelect[1].checked) {
                    setCheckName = "需要";
                }
                else {
                    setCheckName = "不需要";
                }
            }

            //“是否可以停用环节”改为产品需求,不针对宝能 edit by linshuling 2015/5/25 
            //是否可以停用环节,add by liubh,20140820
            //var IsSetNodeAllow = $("#HidIsSetNodeAllow").val();
            var isAllow = "Y";
            var setAllowName = "允许停用";
            //if (IsSetNodeAllow != undefined && IsSetNodeAllow == "Y") {
                if (setCheck == "N") {
                    isAllow = objSelect[1].checked ? "Y" : "N";
                }
                else {
                    isAllow = objSelect[2].checked ? "Y" : "N";
                }
                if (isAllow == "N") {
                    setAllowName = "不允许停用";
                }

                cell = row.insertCell(1);
                cell.align = "center";
                cell.innerHTML = objText[1].value
                    + getHiddenHtml('hidDaysNumber', objText[1].value)

                cell = row.insertCell(2);
                cell.align = "center";
                cell.innerHTML = setCheckName
                        + ''
                        + getHiddenHtml('hidZBWFID', objSelect[0].value)
                        + getHiddenHtml('hidZBWFName', objSelect[0].zbwfname)
                        + getHiddenHtml('hidZBWFMLName', objSelect[0].zbwfname)
                        + getHiddenHtml('hidSetCheck', setCheck)
                        + getHiddenHtml('hidIsNeedCheck', isNeedCheck);


                cell = row.insertCell(3);
                cell.innerHTML = setAllowName + getHiddenHtml('hidIsAllow', isAllow);

                cell = row.insertCell(4);
                cell.innerHTML = objText[0].value
                    + getHiddenHtml('hidRemark', objText[0].value)
                    + getHiddenHtml('hidZBFCTID', objSelect[0].zbfctid);            
        }
    }

    for (var i = 1; i < tbList.rows.length; i++) {
        tbList.rows(i).className = tbList.rows(i).rowIndex % 2 == 1 ? "dg_row" : "dg_alternaterow";
    }

    alertMsg('设置成功。');

    window.close();
}
主窗口的提交.png 主窗口提交先执行的js方法validateSize
function validateSize() {
    handleBtn(false);
    if (trim(getObj("txtZBWFMName").value) == "") {
        handleBtn(true);
        return alertMsg("招投标方式名称不能为空。", getObj("txtZBWFMName"));
    }

    if (getObj("txtRowNo").value == "") {
        handleBtn(true);
        return alertMsg("行号不能为空。", getObj("txtRowNo"));
    }

    if (!isPositiveInt(getObj("txtRowNo").value)) {
        handleBtn(true);
        return alertMsg("行号必须为正整数。", getObj("txtRowNo"));
    }
    hidZBWFMList.value = "";

    for (var i = 1; i < _tblist.rows.length; i++) {
        var objInput = _tblist.rows[i].getElementsByTagName("input");

        // ID|ParentZBWFID|ZBWFID|ZBWFName
        // |ZBWFMLName|SetCheck|IsNeedCheck|Remark|ZBFCTID|IsAllow
        hidZBWFMList.value += "^" + objInput[1].value + "|" + objInput[1].parentid + "|" + objInput[2].value + "|" + objInput[3].value
             + "|" + objInput[4].value + "|" + objInput[5].value + "|" + objInput[6].value + "|" + objInput[8].value + "|" + objInput[9].value
             + "|" + objInput[7].value + "|" + objInput[0].value;
    }

    if (hidZBWFMList.value != "") {
        hidZBWFMList.value = hidZBWFMList.value.substr(1);
    } else {
        handleBtn(true);
        return alertMsg("招投标方式明细不能为空。", getObj("hidZBWFMList"));
    }

    return true;
}
主窗口提交先执行的js方法validateSize.png 主窗口cs文件提交方法
protected void btnSaveClose_Click(object sender, EventArgs e)
    {
        CTNewZBWorkFlowModelView ctNewZBWorkFlowModelView = new CTNewZBWorkFlowModelView();
        CTNewZBWorkFlowModelListView zbwfmlView = new CTNewZBWorkFlowModelListView();
        CTNewZBWorkFlowModel ctZBWorkFlowMode = new CTNewZBWorkFlowModel();
        DbTransaction trans = ctNewZBWorkFlowModelView.BeginTransaction();
        ctZBWorkFlowMode.ZBWFMID = strID;
        ctNewZBWorkFlowModelView.StartPartUpdate(ctZBWorkFlowMode);
        ctZBWorkFlowMode.ZBWFMName = txtZBWFMName.Text;
        ctZBWorkFlowMode.RowNo = int.Parse(txtRowNo.Text);
        ctZBWorkFlowMode.Remark = txtRemark.Text;
        ctZBWorkFlowMode.IsBiding = rdoIsBidding.SelectedValue;
        ctZBWorkFlowMode.ZBWFlowType = Convert.ToInt32(ddlZBWFlowType.SelectedValue);
        bool vbool=ctNewZBWorkFlowModelView.IsRepName(ctZBWorkFlowMode);
        zbwfmlView.Delete(CTNewZBWorkFlowModelList._.ZBWFMID == strID, trans);
        ctNewZBWorkFlowModelView.EditNewZBWorkFlowModel(hidZBWFMList.Value, ctZBWorkFlowMode, trans);
        ctNewZBWorkFlowModelView.UpdatePart(ctZBWorkFlowMode, trans);
        if (vbool && ctNewZBWorkFlowModelView.CommitTransaction(trans))
        {
            // 执行成功,写操作日志,并提示消息
            CGeneral.WriteTraceLog(Page, "TZBWorkFlowMode", IDMsg.Log_Update, ctZBWorkFlowMode.ZBWFMID, ctZBWorkFlowMode.ZBWFMName);
            this.Master.ShowAlertMsg(MyMsg.ShowMyMessageRefreshOpenerGrid(IDMsg.UpdateSuccess, this.strJQGridID, true));
        }
        else
        {
            this.Master.ShowAlertMsg(MyMsg.ShowMyMessage(ctNewZBWorkFlowModelView.IDHelper.ExceptionMsg));
        }
    }
主窗口cs文件提交方法.png 主窗口cs文件提交方法中的EditNewZBWorkFlowModel方法.png
网友评论