propertyfeelive.jsp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <!DOCTYPE html>
  5. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  6. <c:set var="ctx" value="<%=request.getContextPath()%>"/>
  7. <html xml:lang="en" lang="en">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title></title>
  11. <link rel="stylesheet" type="text/css" media="screen" href="plug-in/jqgrid/css/css/cupertino/jquery-ui-1.8.16.custom.css" />
  12. <link rel="stylesheet" type="text/css" media="screen" href="plug-in/ace/css/ui.jqgrid.css" />
  13. <!-- <link rel="stylesheet" type="text/css" media="screen" href="plug-in/jqgrid/js/src/css/jquery.searchFilter.css" /> -->
  14. <%--<script type="text/javascript" src="plug-in/jqgrid/js/jquery-1.7.1.js"></script> --%>
  15. <%--<script type="text/javascript" src="plug-in/jquery/jquery-1.9.0.min.js"></script>--%>
  16. <script type="text/javascript" src="${ctx}/plug-in/jquery/jquery-1.11.3.min.js"></script>
  17. <script type="text/javascript" src="plug-in/jquery/jquery.jqprint.js"></script>
  18. <script type="text/javascript" src="plug-in/jqgrid/js/jquery.jqGrid.src.js"></script>
  19. <script type="text/javascript" src="plug-in/jqgrid/js/i18n/grid.locale-cn.js"></script>
  20. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  21. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js?skin=metrole"></script>
  22. <script type="text/javascript" src="${ctx}/plug-in/tableExport/libs/FileSaver/FileSaver.min.js"></script>
  23. <script type="text/javascript" src="${ctx}/plug-in/tableExport/libs/js-xlsx/xlsx.core.min.js"></script>
  24. <script type="text/javascript" src="${ctx}/plug-in/tableExport/tableExport.min.js"></script>
  25. <script type="text/javascript" src="plug-in/tools/money.js"></script>
  26. <style>
  27. .ui-jqgrid {
  28. font-size: 14px;
  29. }
  30. .ui-jqgrid-view {
  31. font-size: 14px;
  32. }
  33. .ui-jqgrid .ui-jqgrid-htable th {
  34. height: 28px;
  35. font-size: 14px; /* 14 */
  36. }
  37. .ui-jqgrid .ui-jqgrid-btable {
  38. height: 28px;
  39. font-size: 12px;
  40. }
  41. .ui-jqgrid .ui-jqgrid-ftable {
  42. font-size: 13px;
  43. }
  44. .ui-jqgrid .ui-jqgrid-pager {
  45. height: 28px;
  46. font-size: 14px; /* 14 */
  47. }
  48. .ui-jqgrid .ui-pg-input {
  49. font-size: 1em;
  50. height: 20px;
  51. }
  52. .ui-jqgrid .i-pg-selbox {
  53. font-size: 0.9em;
  54. height: 20px;
  55. }
  56. .ui-jqgrid tr.ui-row-ltr td {
  57. text-align: center;
  58. }
  59. .ui-jqgrid tr.footrow-ltr td {
  60. text-align: center;
  61. }
  62. .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default
  63. {
  64. background: #5187c9 ;
  65. color: #fffbf8;
  66. }
  67. .ui-widget-content
  68. {
  69. background:#fff;
  70. }
  71. /*.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: 1; filter:Alpha(Opacity=100); font-weight: normal; background-color: #F5F5F5;}*/
  72. .ui-jqgrid tr.jqgrow td { white-space: normal !important; height:auto; } /**内容自动换行 */
  73. th.ui-th-column div{
  74. white-space: normal !important;
  75. height: auto !important;
  76. }
  77. </style>
  78. </head>
  79. <body style="background:#FFFFFF">
  80. <!-- <form id="form1" runat="server"> -->
  81. <div>
  82. <div id="div2">
  83. <%--查询框begin --%>
  84. <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;top:5px;"> <!-- bottom -->
  85. <tr >
  86. <%-- <td align="right" width="100px">
  87. <label class="Validform_label">领料点: </label>
  88. </td>
  89. <td class="value" nowrap>
  90. <input id="warehouseId" name="warehouseId" type="hidden" >
  91. <input name="warehouseName" type="text" class="inputxt" style="width: 150px" id="warehouseName" readonly="readonly" />
  92. <span class="Validform_checktip"></span>
  93. <label class="Validform_label" style="display: none;">领料点</label>
  94. <t:choose hiddenName="warehouseId" hiddenid="id" url="pOrdersController.do?selectReferWareHouse&classname=cn.com.lzt.warehouse.entity.WarehouseEntity&codefield=warehouseCode&namefield=warehouseName" name="list"
  95. left="40%" width="450px" height="700px" icon="icon-search" title="领料点" textname="warehouseName" isclear="true" isInit="true" ></t:choose>
  96. </td> --%>
  97. <td align="right">
  98. <label class="Validform_label"> 截止日期: </label>
  99. </td>
  100. <td class="value">
  101. <input id="period" name="period" type="text" style="width: 150px" class="Wdate" readonly="readonly" value="${period}"
  102. onClick='WdatePicker({readOnly:true,enableKeyboard:false,enableInputMask:false,dateFmt: "yyyy-MM-dd"})' datatype="*" ignore="ignore" />
  103. <%-- <t:dictSelect id="period" field="period" type="list" extendJson="{class:'form-control',style:'width:136px'}"
  104. typeGroupCode="busperiod" hasLabel="false" title="采购期间" ></t:dictSelect> --%>
  105. <label class="Validform_label" style="display: none;"> 截止日期: </label>
  106. </td>
  107. <td align="right">
  108. <label class="Validform_label"> 项目名称: </label>
  109. </td>
  110. <td class="value">
  111. <input id="projectname" name="projectname" type="text" style="width: 150px" class="text" >
  112. </td>
  113. <td width="200px"><label class="Validform_label" style="display: none;"> </label></td>
  114. <td height="50px" align="right" colspan="8">
  115. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-search" onclick="btn_query()">查询</a>
  116. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-putout" onclick="btn_output()">导出excel</a>
  117. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-print" onclick="btn_print()">打印</a>
  118. </td>
  119. </tr>
  120. <tr>
  121. <!-- <table id="jqGrid"></table>
  122. <div id="pager2"></div> -->
  123. </tr>
  124. </table>
  125. <%--查询框end --%>
  126. <form id="HideFrm" method="post" target="_blank" action="contractReportsController.do?expexcel">
  127. </div>
  128. <br/><br/><br/>
  129. <div id="divgrid">
  130. <!-- <div id="pager2"></div>
  131. --> <div id="div1">
  132. <table id="jqGrid"></table>
  133. <div id="pager2"></div>
  134. </div>
  135. </div>
  136. </iframe>
  137. <!-- </form>
  138. -->
  139. <script>
  140. $(function() {
  141. $('#projectname').bind('keyup', function(event) {
  142. if (event.keyCode == "13") {
  143.     //回车执行查询
  144. btn_query();
  145. }
  146. });
  147. });
  148. function btn_query()
  149. {
  150. showGridTable();
  151. $("#jqGrid").jqGrid('setGroupHeaders',{
  152. useColSpanStyle: true,
  153. groupHeaders:[
  154. {startColumnName : 'currentperiodinvoice',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内开票</span></div>'},
  155. {startColumnName : 'currentperiodincome',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内收款</span></div>'},
  156. {startColumnName : 'nowtolastincome',numberOfColumns : 2,titleText : '<div style="text-align:center;"><span>收款</span></div>'}
  157. ]
  158. });
  159. }
  160. var _hasSearch=false;
  161. function showGridTable() {
  162. var period = $("#period").val();
  163. var projectname = $("#projectname").val();
  164. // var warehouseid = $("#warehouseId").val();
  165. var requrl='contractReportsController.do?propertyfeeliveData';
  166. if(period != null)
  167. requrl+=('&period='+period);
  168. if(projectname != null)
  169. requrl+=('&projectname='+projectname);
  170. $("#div1").empty();
  171. $("#div1").html("<table class='jqgrid' id='jqGrid'></table><div class='jqgridpager' id='pager2'></div>");
  172. $("#jqGrid").jqGrid({
  173. url: requrl,
  174. datatype: "json",
  175. caption:'<div style="text-align:center;font-size: 14px;"><span>物业费实时进程表<br>统计截止日期:</span></div>',
  176. colModel: [
  177. /* { label: '编号', name: 'index', width: 160,sortable:false}, */
  178. { label: '项目', name: 'projectname', width: 130 ,sortable:false,align:'left'},
  179. { label: '支付方式', name: 'paytype', width: 60 ,sortable:false},
  180. { label: '物业合同应收<br>(大合同)', name: 'contractreceivable', width: 120 ,formatter:numFmatter ,sortable:false,align:'right'},
  181. { label: '上年开今年', name: 'lasttonow', width: 80 , formatter:numFmatter ,sortable:false,align:'right'},
  182. { label: '金额', name: 'currentperiodinvoice', width: 120,formatter:numFmatter ,sortable:false,align:'right'},
  183. { label: '开至日期', name: 'currentinvoiceEndDate', width: 80 ,formatter:nullFormatter, sortable:false},
  184. { label: '开票时间', name: 'currentinvoicedate', width: 80 ,formatter:nullFormatter, sortable:false},
  185. { label: '已收上年开今年', name: 'lasttonowincome', width: 80 ,formatter:numFmatter ,sortable:false,align:'right'},
  186. { label: '期内收款金额', name: 'currentperiodincome', width: 120 ,formatter:numFmatter ,sortable:false,align:'right'},
  187. { label: '收至日期', name: 'currentincomeEndDate', width: 80,formatter:nullFormatter, sortable:false},
  188. { label: '收到日期', name: 'currentincomedate', width: 80 ,formatter:nullFormatter, sortable:false},
  189. { label: '期内未开票', name: 'periodnoinvoice', width: 80 ,formatter:numFmatter ,sortable:false,align:'right'},
  190. { label: '期内未收款', name: 'periodnoincome', width: 80 ,formatter:numFmatter ,sortable:false,align:'right'},
  191. { label: '上年未开票', name: 'lastyearnoinvoice', width: 100 ,formatter:numFmatter ,sortable:false,align:'right'},
  192. { label: '今年开上年', name: 'nowtolastinvoice', width: 100 ,formatter:numFmatter ,sortable:false,align:'right'},
  193. { label: '上年开上年', name: 'lasttolastinvoice', width: 100 ,formatter:numFmatter ,sortable:false,align:'right'},
  194. { label: '今年开上年', name: 'nowtolastincome', width: 100 , formatter:numFmatter ,sortable:false,align:'right'},
  195. { label: '上年开上年', name: 'lasttolastincome', width: 100 , formatter:numFmatter ,sortable:false,align:'right'},
  196. { label: '未收上年', name: 'lastyearnoincome', width: 100 , formatter:numFmatter ,sortable:false,align:'right'}
  197. ],
  198. viewrecords: true,
  199. height: 500,
  200. rowNum: -1,
  201. rownumbers: true,
  202. rownumWidth: 25,
  203. autowidth:false,
  204. multiselect: false,
  205. frozen:true,
  206. /* autoScroll: true,//当autoScroll和shrinkToFit均为false时,会出现行滚动条
  207. shrinkToFit: false,//是否列宽度自适应。true=适应 false=不适应 */
  208. //分组
  209. /* viewrecords: true,
  210. sortname: 'projectName', //需要分组的列
  211. grouping:true,
  212. groupingView : {
  213. groupField : ['projectName'], //需要分组的列
  214. groupSummary : [true], //是否显示汇总 如果为true需要在colModel中进行配置 如: summaryType:'sum', summaryTpl:'<b>小计: {0}</b>''
  215. groupColumnShow : [true], //是否显示分组列
  216. groupText : ['<b>{0}</b>'], //在分组的头部显示的信息
  217. groupCollapse : false, //该属性表示在加载数据的时候是否只显示分组信息,false表示既显示分组信息也显示每个分组里面的详细信息,true则只显示分组信息
  218. }, */
  219. //统计
  220. footerrow:true, //开启统计
  221. userDataOnFooter : true, //在页脚显示统计
  222. altRows : true ,
  223. pager: "#jqGridPager",
  224. jsonReader : {
  225. root: "page.list",
  226. page: "page.currPage",
  227. total: "page.totalPage",
  228. records: "page.totalCount"
  229. },
  230. prmNames : {
  231. page:"page",
  232. rows:"limit",
  233. order: "order"
  234. },
  235. gridComplete:function(){
  236. var rowNum=parseInt($(this).getGridParam("records"),10);
  237. if(rowNum>0){
  238. $(".ui-jqgrid-sdiv").show();
  239. var sum_currentperiodinvoice = $(this).getCol("currentperiodinvoice",false,"sum");
  240. var sum_lasttonowincome = $(this).getCol("lasttonowincome",false,"sum");
  241. var sum_currentperiodincome = $(this).getCol("currentperiodincome",false,"sum");
  242. var sum_periodnoinvoice = $(this).getCol("periodnoinvoice",false,"sum");
  243. var sum_periodnoincome = $(this).getCol("periodnoincome",false,"sum");
  244. var sum_lastyearnoinvoice = $(this).getCol("lastyearnoinvoice",false,"sum");
  245. var sum_nowtolastinvoice = $(this).getCol("nowtolastinvoice",false,"sum");
  246. var sum_lasttolastinvoice = $(this).getCol("lasttolastinvoice",false,"sum");
  247. var sum_nowtolastincome = $(this).getCol("nowtolastincome",false,"sum");
  248. var sum_lasttolastincome = $(this).getCol("lasttolastincome",false,"sum");
  249. var sum_lastyearnoincome = $(this).getCol("lastyearnoincome",false,"sum");
  250. var sum_contractreceivable = $(this).getCol("contractreceivable",false,"sum");
  251. $(this).footerData("set",{"projectname" : "合计:",
  252. "contractreceivable" : formatterNum(sum_contractreceivable),
  253. "currentperiodinvoice" : formatterNum(sum_currentperiodinvoice),
  254. "lasttonowincome" : formatterNum(sum_lasttonowincome),
  255. "currentperiodincome" : formatterNum(sum_currentperiodincome),
  256. "periodnoinvoice" : formatterNum(sum_periodnoinvoice),
  257. "periodnoincome" : formatterNum(sum_periodnoincome),
  258. "lastyearnoinvoice" : formatterNum(sum_lastyearnoinvoice),
  259. "nowtolastinvoice" : formatterNum(sum_nowtolastinvoice),
  260. "lasttolastinvoice" : formatterNum(sum_lasttolastinvoice),
  261. "nowtolastincome" : formatterNum(sum_nowtolastincome),
  262. "lasttolastincome" : formatterNum(sum_lasttolastincome),
  263. "lastyearnoincome" : formatterNum(sum_lastyearnoincome)}); //将合计值显示出来
  264. }else{
  265. $(".ui-jqgrid-sdiv").hide();
  266. }
  267. $("#jqGrid").closest("div.ui-jqgrid-view")
  268. .children("div.ui-jqgrid-titlebar")
  269. .css("text-align", "center")
  270. .children("span.ui-jqgrid-title")
  271. .css("float", "none").css("font-size","14px");
  272. $(this).setCaption('物业费实时进程表 <br><span style="font-weight:normal;">统计截止日期:'+period+'</span>');
  273. _hasSearch = true;
  274. /* } */
  275. }
  276. });
  277. }
  278. $("#jqGrid").jqGrid({
  279. url :'contractReportsController.do?propertyfeeliveData&load=false',
  280. datatype: "json",
  281. caption:'物业费实时进程表<br><span style="font-weight:normal;">统计截止日期:</span>',
  282. colModel: [
  283. /* { label: '编号', name: 'index', width: 40,sortable:false}, */
  284. { label: '项目', name: 'projectname', width: 130 ,sortable:false,frozen: true},
  285. { label: '支付方式', name: 'paytype', width: 60 ,sortable:false},
  286. { label: '物业合同应收<br>(大合同)', name: 'contractreceivable', width: 80 ,sortable:false},
  287. { label: '上年开今年', name: 'lasttonow', width: 80 ,sortable:false},
  288. { label: '金额', name: 'currentperiodinvoice', width: 80,sortable:false},
  289. { label: '开至日期', name: 'currentinvoiceEndDate', width: 80 ,sortable:false},
  290. { label: '开票时间', name: 'currentinvoicedate', width: 80 ,sortable:false},
  291. { label: '已收上年开今年', name: 'lasttonowincome', width: 80 ,sortable:false},
  292. { label: '期内收款金额', name: 'currentperiodincome', width: 80 ,sortable:false},
  293. { label: '收至日期', name: 'currentincomeEndDate', width: 80,sortable:false},
  294. { label: '收到日期', name: 'currentincomedate', width: 80 ,sortable:false},
  295. { label: '期内未开票', name: 'periodnoinvoice', width: 80 ,sortable:false},
  296. { label: '期内未收款', name: 'periodnoincome', width: 80 ,sortable:false},
  297. { label: '上年未开票', name: 'lastyearnoinvoice', width: 80 ,sortable:false},
  298. { label: '今年开上年', name: 'nowtolastinvoice', width: 80 ,sortable:false},
  299. { label: '上年开上年', name: 'lasttolastinvoice', width: 80 ,sortable:false},
  300. { label: '今年开上年', name: 'nowtolastincome', width: 80 , sortable:false},
  301. { label: '上年开上年', name: 'lasttolastincome', width: 80 , sortable:false},
  302. { label: '未收上年', name: 'lastyearnoincome', width: 80 , sortable:false}
  303. ],
  304. viewrecords: true,
  305. height: 500,
  306. rowNum: -1,
  307. rownumbers: true,
  308. rownumWidth: 25,
  309. autowidth:false,
  310. multiselect: false,
  311. //统计
  312. footerrow:true, //开启统计
  313. userDataOnFooter : true, //在页脚显示统计
  314. altRows : true ,
  315. pager: "#jqGridPager",
  316. jsonReader : {
  317. root: "page.list",
  318. page: "page.currPage",
  319. total: "page.totalPage",
  320. records: "page.totalCount"
  321. },
  322. prmNames : {
  323. page:"page",
  324. rows:"limit",
  325. order: "order"
  326. },
  327. gridComplete:function(){
  328. //隐藏grid底部滚动条
  329. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  330. var rowNum=parseInt($(this).getGridParam("records"),10);
  331. if(rowNum>0){
  332. $(".ui-jqgrid-sdiv").show();
  333. var sum_inAmount = $(this).getCol("amount",false,"sum");
  334. var sum_balance = $(this).getCol("quantity",false,"sum");
  335. $(this).footerData("set",{"projectName" : "合计:",
  336. "amount" : sum_inAmount,
  337. "quantity" : sum_balance}); //将合计值显示出来
  338. }else{
  339. $(".ui-jqgrid-sdiv").hide();
  340. }
  341. $("#jqGrid").closest("div.ui-jqgrid-view")
  342. .children("div.ui-jqgrid-titlebar")
  343. .css("text-align", "center")
  344. .children("span.ui-jqgrid-title")
  345. .css("float", "none").css("font-size","14px");
  346. $("#jqGrid").jqGrid('setGroupHeaders',{
  347. useColSpanStyle: true,
  348. groupHeaders:[
  349. {startColumnName : 'currentperiodinvoice',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内开票</span></div>'},
  350. {startColumnName : 'currentperiodincome',numberOfColumns : 3,titleText : '<div style="text-align:center;"><span>期内收款</span></div>'},
  351. {startColumnName : 'nowtolastincome',numberOfColumns : 2,titleText : '<div style="text-align:center;"><span>收款</span></div>'}
  352. ]
  353. });
  354. }/*,
  355. autowidth:true,
  356. height: 500 ,
  357. datatype:"local" */
  358. });
  359. /* $("#jqGrid").jqGrid('setFrozenColumns');//设置冻结列生效 */
  360. function btn_output(){
  361. if(!_hasSearch){
  362. alert('请先查询数据');
  363. return;
  364. }
  365. var opt = {
  366. type:'excel'
  367. ,fileName:'物业费实时进程表'+$("#period").val()
  368. ,escape:'false'
  369. ,mso:{
  370. fileFormat: 'xlshtml'
  371. ,onMsoNumberFormat: null
  372. ,pageFormat: 'a4'
  373. ,pageOrientation: 'portrait'
  374. ,rtl: false
  375. ,styles: ['background-color',
  376. 'color',
  377. 'font-family',
  378. 'font-size',
  379. 'font-weight',
  380. 'text-align',
  381. 'height',
  382. 'padding',
  383. ,'border-bottom', 'border-top', 'border-left', 'border-right'
  384. ]
  385. // ,worksheetName: 'abc'
  386. }
  387. };
  388. // $('#jqGrid').tableExport(opt);
  389. var ex = $('#jqGrid').clone();
  390. var tbody = ex.find('tbody');
  391. var tds = tbody.find('tr:eq(0)').find('td');
  392. var thead = $("#gbox_jqGrid .ui-jqgrid-htable thead").clone();
  393. tbody.before(thead);
  394. var titleTr =$('<tr></tr>');
  395. var titleTh = $('<th></th>');
  396. titleTr.append(titleTh);
  397. titleTh.append($('.ui-jqgrid-title').clone());
  398. titleTh.attr('colspan',tds.length);
  399. thead.prepend(titleTr);
  400. thead.css('text-align','center');
  401. var footer = $('table.ui-jqgrid-ftable tbody tr');
  402. tbody.append(footer);
  403. // ex.hide();
  404. $('body').append(ex);
  405. ex.tableExport(opt);
  406. ex.remove();
  407. }
  408. function btn_print(){
  409. $("#divgrid").jqprint({
  410. debug: false,
  411. importCSS: true,
  412. printContainer: true,
  413. operaSupport: false
  414. });
  415. }
  416. function formatNumberNull(num, precision, separator) {
  417. var parts;
  418. // 判断是否为数字
  419. if (!isNaN(parseFloat(num)) && isFinite(num)) {
  420. // 把类似 .5, 5. 之类的数据转化成0.5, 5, 为数据精度处理做准, 至于为什么
  421. // 不在判断中直接写 if (!isNaN(num = parseFloat(num)) && isFinite(num))
  422. // 是因为parseFloat有一个奇怪的精度问题, 比如 parseFloat(12312312.1234567119)
  423. // 的值变成了 12312312.123456713
  424. num = Number(num);
  425. // 处理小数点位数
  426. num = (typeof precision !== 'undefined' ? (Math.round(num * Math.pow(10,precision)) / Math.pow(10,precision)).toFixed(precision) : num).toString();
  427. // 分离数字的小数部分和整数部分
  428. parts = num.split('.');
  429. // 整数部分加[separator]分隔, 借用一个著名的正则表达式
  430. // parts[0] = parts[0].toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + (separator || ','));
  431. return parts.join('.');
  432. }
  433. return '0.00';
  434. }
  435. function numFmatter(cellvalue, options, rowObject){
  436. return formatNumberNull(cellvalue,2);
  437. };
  438. function nullFormatter(cellvalue, options, rowObject){
  439. if(cellvalue == null || cellvalue.trim() == '')
  440. return '--';
  441. else
  442. return cellvalue;
  443. }
  444. </script>
  445. </body>
  446. </html>