一、页面表格字段隐藏、页面新增字段、字段自查并存储


页面字段隐藏

style="display:none"

页面表格字段居中,但个别居右

头:

<style>
	#contentTable tr th{
		text-align:center;
	}
	#contentTable tr td{
		text-align:center;
	}
	</style>

个别:

<td style="line-height: 38.8px;text-align: right">

显示投保年度

只需jsp页面改动:

<td class="control-group">
    <label class="control-label"><span class="help-inline required"><font color="red">*</font> </span>投保申请年度:</label>
	<div class="controls">
	    <fmt:formatDate value="${now}" type="both" dateStyle="long" pattern="yyyy" var="currentdate" />
	    <input id="insStartYear" name="insStartYear" type="text"   maxlength="20"  value="${currentdate}" readOnly="readonly" />
	</div>
</td>

页面新增字段

需求:页面添加“审核批次”,显示出用户登录所在公司共被审批几次。

思路:根据登录用户的id,查询出所在的公司,此为主表。从表中增加批次字段,在点击添加申请表单的同时,显示出共提交过多少批次,批次则为从表的总条数。再在从表中添加一个批次字段,在提交表单的时候,将当前显示的批次保存到数据库中,以供展示。

页面

<form:input path="batch" id="batch" htmlEscape="false" maxlength="50" readOnly="readOnly" value="${kInsRequirement.batch}" class="input-xlarge required"/>

这里要注意

springMvc<form:form>标签<form:input>标签需要注意的问题

    在Controller层中要添加model.addAttribute("  ",   ),或者是public String test(Student stu,Model,model){},再或者public String test(@modelAttribute("stu")Student stu,Model model){}

    在页面上<form:form action="/web/.." method="post" modelAttribute="stu">

    如果用普通的<form>表单,会获取不到path的值,也无法上传


Controller

kInsRequirement.setBatch(tCompanyClient.getBatch());

Dao.xml

在主表include sql语句中增加

(SELECT max(batch)+1 FROM k_ins_requirement kir WHERE kir.company=a.id) AS batch

注:此处防止一个bug,若用count查询条数,在保存时易出现相同批次,故改成max

    “+1”是因为投保需求添加时读取的是当前最大批次,而要提交的应+1.

在子表include sql语句中增加

a.batch as "batch",
a.unit as "unit",

在<insert>中也要添加字段

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Eevee_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值