fmt:formatDate失效

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>--错误包
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>--正确包
<fmt:parseDate value="${abc}" pattern="yyyy-MM-dd HH:mm" var="change"/>

<fmt:formatDate value="${change}" pattern="yyyy-MM-dd HH:mm"/>
<div id="basicInfo"> <table style="width:90%;margin-top:-10px;" border="0" align="center" id="bt"> <tr> <td align="right" colspan="2"> <font style="font:normal normal normal 33pt C39P36DlTt"><img src="brandCode!create1w.do?barcode=${bean.lccb_jybh }" style="width:180px;height:100%" /> </font> </td> </tr> <tr> <td align="center" colspan="2"> <font style="letter-spacing:1px;font-family:宋体;font-size:24px;font-weight: bold;; ">呼和浩特市检验检测中心检验报告</font> </td> </tr> <tr> <td style="height:13px;" colspan="2"></td> </tr> <tr> <td align="right" colspan="2"> <font style="letter-spacing:3px;font-family:宋体;font-size:16px;font-weight: bold;; ">${map.skh }</font> </td> </tr> <tr> <td style="font-family:宋体;font-size:14px"> 报告书编号: <font style="font-size: 14px;"></font>HJZX-${bean.lccb_jybh } </td> <td colspan="1" class=" pageNum" style="border:none;text-align:right;padding-right: 40px;font-size: 11pt;padding-top: 10px;padding-bottom: 5px"></td> </tr> </table> </div> <table id="t1" height="200px" style="width:92%;margin-top:1px; font-size: 14px;border-bottom: 0px;" border="1" bordercolor="#000"> <tr style="visibility:hidden;height:0px;line-height:0;"> <td width="16.8%" style="height:0px;line-height:0;"></td> <td width="46.5%" style="height:0px;line-height:0;"></td> <td width="14.8%" style="height:0px;line-height:0;"></td> <td width="16.7%" style="height:0px;line-height:0;"></td> </tr> <tr> <td align="center" width="16.8%" height="25px">检品名称</td> <td width="46.5%" style="padding-left:5px;">${bean.lccb_jpmc}</td> <td align="center" height="25px">检品编号</td> <td id="gg" style="padding-left:5px;">${bean.lccb_jybh}</td> </tr> <tr> <td align="center" height="25px">批        号</td> <td style="padding-left:5px;">${bean.lccb_ph }</td> <td align="center" height="25px">规        格</td> <td id="gg" style="padding-left:5px;">${bean.lccb_gg}</td> </tr> <tr> <td align="center" height="25px">标示生产单位<br>或产地</td> <td style="padding-left:5px;">${bean.lccb_scdw}</td> <td align="center" height="25px">包装规格</td> <td style="padding-left:5px;">${bean.lccb_baozfl }</td> <%-- <td align="center" height="25px">包装材料</td> <td style="padding-left:5px;">${bean.lccb_chouyypbz }</td> --%> </tr> <tr> <td align="center" height="25px">生产日期</td> <td style="padding-left:5px;">${bean.lccb_scrq }</td> <td align="center" height="25px">有效期至</td> <td style="padding-left:5px;">${bean.lccb_yxq }</td> </tr> <tr> <td align="center" height="25px">供样单位名称<br>及地址</td> <td style="padding-left:5px;"> <c:choose> <c:when test="${bean.lccb_gydw eq '/' && bean.lccb_gydwdz eq '/'}"> / </c:when> <c:otherwise> ${bean.lccb_gydw}${bean.lccb_gydwdz} </c:otherwise> </c:choose> <%-- ${bean.lccb_gydw}${bean.lccb_gydwdz } --%> </td> <td align="center">检品数量</td> <td style="padding-left:5px;">${bean.lccb_jpsl}</td> </tr> <tr> <td align="center" height="25px">委托单位名称<br>及地址</td> <td style="padding-left:5px;"> <c:choose> <c:when test="${bean.lccb_wtdw eq '/' && bean.lccb_wtdwdz eq '/'}"> / </c:when> <c:otherwise> ${bean.lccb_wtdw}${bean.lccb_wtdwdz} </c:otherwise> </c:choose> <%-- ${bean.lccb_wtdw }${bean.lccb_wtdwdz } --%> </td> <td align="center" height="35px">样品状态</td> <td style="padding-left:5px;">${bean.lccb_chouyfyzt}</td> </tr> <tr> <td align="center" height="25px">被抽样单位</td> <td style="padding-left:5px;">${bean.lccb_bcydw}</td> <td align="center" height="25px">留样数量</td> <td style="padding-left:5px;">${bean.lccb_lysl}</td> </tr> <tr> <td align="center" height="25px">检验目的</td> <td style="padding-left:5px;"> ${bean.lccb_jymddl }<c:if test="${not empty bean.lccb_jymdxl }"> (${bean.lccb_jymdxl }) </c:if></td> <%-- <td align="center" height="25px">收样日期</td> <td style="padding-left:5px;"> <fmt:formatDate pattern="yyyy-MM-dd" value="${bean.lccb_sjrq}" /> </td> --%> <td align="center" height="25px">留样签收</td> <td style="padding-left:5px;">${bean.lccb_lyqs}</td> </tr> <tr> <td align="center" height="25px">检验项目</td> <td style="padding-left:5px;"><c:choose> <c:when test="${ not empty bean.lccb_jyxmqt }"> ${bean.lccb_jyxmqt } </c:when> <c:otherwise> ${bean.lccb_jyxm } </c:otherwise> </c:choose></td> <%-- <td align="center" height="25px">签发日期</td> <td style="padding-left:5px;"><fmt:formatDate pattern="yyyy年MM月dd日" value="${bean.lccb_qianfsj}"/></td> --%> <td align="center" height="25px">经办人</td> <td style="padding-left:5px;">${bean.lccb_jbr}</td> </tr> <tr> <td style="border-bottom: 0px;" align="center" height="25px">检验依据</td> <td style="border-bottom: 0px;padding-left:5px;" colspan="3">${bean.lccb_jyyj2 }</td> </tr> </table> <table id="tabContent" height="475px" style="width:92%;margin-top:0px; font-size: 14px;border-bottom: 0px;" border="1" bordercolor="#000"> <thead> <tr> <td width="1.5%" style="border:0;"></td> <td width="18%" align="left" style="border:0;padding-left:15px;" height="25px">检验项目</td> <td width="36%" align="left" style="border:0;padding-left:30px;">标准规定</td> <td width="26%" align="left" style="border:0;padding-left:25px;">检验结果</td> <td width="1.5%" style="border:0;"></td> </tr> </thead> <tbody> <c:forEach items="${map.list }" var="subject" varStatus="status0"> <c:choose> <c:when test="${subject.lcs_jydl=='000'||subject.lcs_jydl=='/'}"> <tr> <td style="border:0;"></td> <td align="left" valign="top" class="td1" style="border:0;padding-left:13px;">    ${subject.lcs_jyxm }</td> <td align="left" valign="top" class="td1" style="border:0;padding-left:30px;word-break:break-all;">${subject.lcs_bzgd }</td> <td align="left" valign="top" class="td1" style="border:0;padding-left:25px;height:20px;">${subject.lcs_jyjg }<c:if test="${fn:contains(subject.lcs_jyjl ,'') }">(符合规定)</c:if></td> <td style="border:0;"></td> </tr> </c:when> <c:otherwise> <tr> <td style="border:0;"></td> <td align="left" class="td1" style="border:0;height:20px;padding-left:13px;">【${subject.lcs_jydl }】</td> <td align="left" class="td1" style="border:0;"></td> <td align="left" class="td1" style="border:0;"></td> <td style="border:0;"></td> </tr> <tr> <td style="border:0;"></td> <td align="left" class="td1" valign="top" style="border:0;padding-left:13px;">    ${subject.lcs_jyxm }</td> <td align="left" class="td1" valign="top" style="border:0;padding-left:30px;word-break:break-all;">${subject.lcs_bzgd }</td> <td align="left" class="td1" valign="top" style="border:0;padding-left:25px;height:20px;">${subject.lcs_jyjg } <c:if test="${fn:contains(subject.lcs_jyjl ,'') }">(符合规定)</c:if> </td> <td style="border:0;"></td> </tr> </c:otherwise> </c:choose> </c:forEach> </tbody> </table> <script type="text/javascript" src="js/custom/ylqxbgsPrintTable.js?v=<%=System.currentTimeMillis()%>"></script> <script type="text/javascript"> function fillPageNumbers() { const $elems = $('.pageNum').filter(function () { return $(this).css('display') !== 'none'; }); const total = $elems.length; $elems.each(function (idx) { const $el = $(this); if (!$el.text().trim()) { $el.text("第 " + (idx + 1) + " 页 共 " + total + " 页"); } }); } $(function() { // 1. 填充空单元格 /* $("#tabContent td,#basicInfo td").not(".notDef").each(function(){ var val = $(this).text().trim(); if (!val) $(this).text("-"); }); */ // 2. 获取 headerInfo 内容用于插入 // var $headerTemplate = $(document.getElementById('headerInfo').innerHTML); // 插入到指定位置(如 basicInfo1 前) // $("#basicInfo1").before($headerTemplate.clone()); // 要 remove("#headerInfo"),留给 printTable 使用 // $(".headerInfo:visible").eq(0).remove(); // ❌ 注释掉这一行! // 3. 执行分页 rowHeight(); // 4. 填写页码(只填空的,避免重复) $(".pageNum:visible:empty").each(function(index){ $(this).text("第 " + (index+1) + " 页 共 " + $(".pageNum:visible").length + " 页"); }); // 5. 打印 window.print(); // ✅ 可选:打印后隐藏原始 headerInfo(防止干扰 UI) // setTimeout(() => $("#headerInfo").hide(), 100); }); function rowHeight() { var pageHeight = 1175 - 50; var basicHeight = $("#basicInfo").outerHeight(true); var headerHeight = $("#headerInfo").outerHeight(true); $("#tabContent").printTable({ mode: "rowHeight", header: "#headerInfo", // 必须存在! footer: "#footerInfo", firstPageHeight: pageHeight - basicHeight + headerHeight, pageHeight: pageHeight, lastPageFill: '<tr style="height:40px"><td colspan="5" class="A" style="vertical-align:top">以下空白</td></tr>', endPageFill: '<tr style="height:40px"><td colspan="5" class="A">接下一页</td></tr>', startPage: 1, // ✅ 添加完成回调 complete: function () { fillPageNumbers(); } }); } </script>上述代码我希望生成两页该怎么修改
最新发布
12-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值