<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ include file="sessionInfo2.jsp"%>
<%
  String strLevel = "../../";
%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<style type="text/css">
  .readClass {
      background:#D4D0C8;
      readonly;
  }
  .selectClass {
      width:70;
  }  
</style>
</head>
<%
	String fieldName = SzConvert.toZeroStr(request.getParameter("fieldName"));
	String moduleName = SzConvert.strWriteData(request.getParameter("moduleName"));
	String formName = SzConvert.strWriteData(request.getParameter("formName"));
		
    BdForm bdForm = new BdForm();
    BdFormFieldInfo bdFormFieldInfo = bdForm.getFieldInfo(moduleName, formName, fieldName);
    int fieldState = bdFormFieldInfo.getZDZT();
%>
<body>

<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="OPERATOR" value="FieldFormula">
  <input type="hidden" name="moduleName" value="<%=moduleName%>">
  <input type="hidden" name="formName" value="<%=formName%>">  
  <input type="hidden" name="fieldName" value="<%=fieldName%>">  
<%@ include file="title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.saveButton()%>
      <%=SzPageHelp.backButton()%>
      <%
        //删除字段
        if (fieldState != 2 && fieldState != 4) {
        	out.println(SzPageHelp.button("删除字段","javascript:DeleteField();"));	
        }
      %>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle" style="width:200;">字段名称</td>
    <td colspan="3"><input type="text" name="fieldName" class="txtClass1" value="<%=fieldName%>" readonly ></td>
  </tr>
  <tr>
    <td class="tdClassTitle" style="width:200;">字段说明</td>
    <td colspan="3"><input type="text" name="fieldDesc" class="txtClass1" value="<%=bdFormFieldInfo.getZDSM()%>"  readonly ></td>
  </tr>  
  <tr>
    <td class="tdClassTitle" style="width:200;">公式</td>
    <td colspan="3">
      <textarea name="formula" class="areaClass2"><%=bdFormFieldInfo.getZDBY() %></textarea>
    </td>
  </tr>
  <!-- -------- 
  <tr>
    <td class="tdClassTitle" style="width:200;">外部扩展方法</td>
    <td colspan="3">
      <input type="text" name="append" class="txtClass2" value="<%=bdFormFieldInfo.getZDKZ()%>" >
    </td>
  </tr> 

  <tr>
    <td class="tdClassTitle" style="width:200;">触发关联    
    </td>
    <td colspan="3">
      <input type="text" name="relate" class="txtClass2" value="<%=bdFormFieldInfo.getZDGLMC()%>" >
    </td>
  </tr>    
  <tr>
    <td class="tdClassTitle" style="width:200;">关联的模板标签
      <input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:OpenIdSingleWin('bookmarks', '','formUpdate.bookmark');">
    </td>
    <td colspan="3">
      <input type="text" name="bookmark" class="txtClass2" value="<%=bdFormFieldInfo.getZDBQ()%>" >      
    </td>
  </tr>  
   --> 
</table>
</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  function FormSave(formName, url) {
    //检查是否可以保存
    /*
    if (!notSpace(formName.fieldName, "字段名称不能为空")) {
      return false;
    } 
    */
    formName.action = "formControl.jsp";
    formName.submit();
  }
  
  function DeleteField() {
		if (confirm("删除后该字段将不能使用，是否继续？")) {
			formUpdate.OPERATOR.value = "DeleteField";
    		formUpdate.action = "formControl.jsp";
    		formUpdate.submit();
    	}
  }
</script>
</body>
