在公司平台快速开发单据总结1

1.关键点

1.1 导入数据库表,注释的字段名称,在视图导入时,可作为栏位的列标题


1.2 模组绑定视图


1.3 视图绑定表单


1.4 调整列表栏位顺序,系统设置无法调整顺序,可通过修改数据库的方式修改

update XT_viewColumn
set ColSN='0001'
where tablename='SH_CP_TERM'
and ColName='CP_NO'

1.5 开发表单编辑界面


1.6 表单绑定数据表和实体


1.7 设置数据关键字段FILEID,区分大小写


1.8 标签的文件信息设置


1.9 列表界面字段名需与实体get、set后部分保存一致



2.编辑界面jsp,绘制控件,绑定数据,jsp与js尽量分离

<%@page import="java.util.*"%>
<%@page import="com.costech.module.mw.sh.charter.util.CpUnit"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="com.costech.module.mw.sh.charter.bean.CpTerm"%>
<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%><!-- *定义编码 -->
<%@page import="com.costech.common.service.ICommonService" %>
<%@page import="com.costech.common.constants.CommonConstants" %>
<%@ include file="/scripts/common/file/File_Info_Data.jsp" %><!-- *编辑界面基类 -->
<%
request.setCharacterEncoding("utf-8");
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ICommonService	gd = (ICommonService)ServiceHelper.getService(CommonConstants.COMMON_SERVICE);
//String company = session.getAttribute("company").toString();
CpTerm oFile = (CpTerm)voFile;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<script src='<%=request.getContextPath()%>/include/exttree/ext/adapter/ext/ext-base.js'></script>
	<script src='<%=request.getContextPath()%>/include/exttree/ext/ext-all.js'></script>
	<script src='<%=request.getContextPath()%>/include/edittable.js'></script>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/include/tip/tip-yellowsimple/tip-yellowsimple.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/style/blue/form.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/include/F7Select/jquery.autocomplete.css" />
	<script type="text/javascript" src="<%=request.getContextPath()%>/include/jquery-1.6.4.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/include/F7Select/jquery.autocomplete.min.js"></script>
	<script src="<%=request.getContextPath()%>/include/AutoComplete.js"></script>
	<script src="<%=request.getContextPath()%>/include/function.js"></script>
	<SCRIPT language="JavaScript" src="<%=request.getContextPath()%>/include/tip/jquery.poshytip.js"></SCRIPT>
	<SCRIPT language="JavaScript" src="<%=request.getContextPath()%>/include/jquery.i18n.properties-min-1.0.9.js"></SCRIPT>
	<SCRIPT language="JavaScript" src="<%=request.getContextPath()%>/include/mwi18n.js"></SCRIPT>
	<script src="<%=request.getContextPath()%>/costech/mw/sh/charter/CpTermVCOUTMore.js"></script>

  </head>
  
  <body bgcolor="#FFFFFF" text="#000000">
    <input type="hidden" name=FILEID id="FILEID" value="<%=oFile.getFILEID()%>"/>
	<fieldset style="padding-bottom:10px;width:98%">
		<legend><font class="text"><b>合同基本信息</b></font></legend>
		<table id="tab0" width="95%" align="center" cellpadding="0" cellspacing="0" border="0" bordercolorlight="gray" bordercolordark="#ffffff">
	         <tr>
	            <td height="35px" width="10%" align="left" class="text_label">合同类型:</td>
	            <td height="35px" width="23%" align="left" class="text_label" >
				   <input name="CP_TYP" type="text" id="CP_TYP" value="VC-OUT" class="text_readonly" readonly="readonly" style="width:80%;"/>           
			    </td>
			   <td height="35px" width="10%" align="left" class="text_label">合同编号:</td>
	           <td height="35px" width="23%" align="left" class="text_label" >
			       <input name="CP_NO" type="text" id="CP_NO" value="<%=oFile.getCP_NO()%>" class="text_readonly" readonly="readonly" style="width:80%;"/>
				   <label><font color="red">*</font></label>
			   </td>
			   <td height="35px" width="10%" align="left" class="text_label">合同日期:</td>
	           <td height="35px" width="23%" align="left" class="text_label">
				   <script>writeSelectDateTextBox("FormTemplate", "CP_DT", "<%=oFile.getCP_DT()==null ? "" : DateUtility.format(oFile.getCP_DT(),"yyyy-MM-dd")%>", 14, 16, "class='text_datetimeinput'","2","readonly","","","","","","1","onTimeChange(this.value)")</script>
				   <label><font color="red">*</font></label>
			  </td>
	         </tr>
	         
	         <tr>
	            <td height="35px" align="left" class="text_label">状态:</td>
	            <td height="35px" align="left" class="text_label" >
					<select id="CP_STATE" name="CP_STATE" style="width:80%;vertical-align: middle;" οnfοcus="this.defaultIndex=this.selectedIndex;" οnchange="this.selectedIndex=this.defaultIndex;"> 
					<%
						HashMap<String, String> stateMap = CpUnit.CpState();
						for(String key:stateMap.keySet())
						{
					%>
						<option value="<%=key%>" <%=key.equals(StringUtils.isNotEmpty(oFile.getFILEID())?oFile.getCP_STATE():"1")?"selected=\"selected\"":""%>><%=stateMap.get(key)%></option>
					<%
						}
					%>
					</select>     
					<label><font color="red">*</font></label>
			   </td>
			   <td height="35px" align="left" class="text_label">船舶:</td>
	           <td height="35px" align="left" class="text_label" >
					<script>
						var _vslFilter = "   REGEXP_LIKE(ex.COMPANY,'<%=""%>') and VALID_FLAG ='0' ";
						writeAutoBox("local-states1","VESSEL_CD","<%=oFile.getVESSEL_CD()%>","vessel",_vslFilter,"width=60%;","getVesselName();getCpNoNew();","250");
					</script>
					<script>writeF7ImgBox("local-states1","VESSEL_CD","   REGEXP_LIKE(COMPANY,$<%=""%>$)","vessel_cp","vertical-align:middle;","getVesselName();getCpNoNew();");</script>
				   <label><font color="red">*</font></label>
			   </td>
			   <td height="35px" align="left" class="text_label"></td>
	           <td height="35px" align="left" class="text_label">
					<input type="checkbox"  id="LD_IS_TOTAL" οnclick="setIsTotalFT()" name="LD_IS_TOTAL" value="1" 
					<%
						if(oFile.getLD_IS_TOTAL().equals("1"))
						{
					%>
						checked="checked"
					<%
						}
					%>
					    style="vertical-align: middle;">
					<label style="width: 63px;">合计装卸</label>
			  </td>
	         </tr>
	         
	         <tr>
	            <td height="35px" align="left" class="text_label">状态:</td>
	            <td height="35px" align="left" class="text_label" colspan="3">
						<label><input type="radio" name="FRT_TYP" value="1" οnclick="ftrChoose(this.value)" 
						<%
							if(oFile.getFRT_TYP().equals("1"))
							{
						%>
							checked="checked"
						<%
							}
						%>
						/>WS</label>
						<label style="margin-left: 10px;"><input type="radio"  name="FRT_TYP" value="2" οnclick="ftrChoose(this.value)"  
						<%
							if(oFile.getFRT_TYP().equals("2"))
							{
						%>
							checked="checked"
						<%
							}
						%>
						/>包干</label>
						<script>writeTextBox("FRT", "<%=oFile.getFRT_TYP().equals("2")?MathUtility.format(oFile.getFRT(),"###,###,##0.00000"):MathUtility.format(0,"###,###,##0.00000")%>", "8", "18", "id='frtlump' class='inputbox_num' <%=oFile.getFRT_TYP().equals("2")?"":"disabled"%>  style='width:80' οnblur=formatObjectNumber(this,\"###,###,###.00000\")", "write")</script>
			   </td>
			   <td height="35px" align="left" class="text_label"></td>
	           <td height="35px" align="left" class="text_label">
			  </td>
	         </tr>
	         
	         <tr>
	            <td height="35px" align="left" class="text_label">船舶描述:</td>
	            <td height="35px" align="left" class="text_label" colspan="5">
	         		<script>writeTextArea("VESSEL_DESC", "<%=StringUtility.toHtmlString(oFile.getVESSEL_DESC())%>", "50", "6", "id='VESSEL_DESC' class='textareabox' style='width:100%;overflow-x:no;overflow-y:visible;'", "write")</script>
			   </td>
	         </tr>
		</table>
	</fieldset>	
  </body>
</html>

3.编辑界面js,实现各类功能

function onTimeChange(value)
{
	alert(1);
}

function setIsTotalFT()
{
	
}

function ftrChoose(value)
{
	
}

到此,一个单据的基本功能已开发完成。换行列表界面和编辑界面,增删改查刷新等基本功能。

列表界面:


编辑界面:


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值