| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>新增/编辑报表推送页面</title>
- <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/json2.js" type="text/javascript"></script>
- <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
- <script type="text/javascript" src="/shares/datePicker/WdatePicker.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript">
- var isTreeLoad = false;
- $(document).ready(function(){
- // $("#assetBean\\.asset_number").val(1);
- // $("#assetBean\\.asset_unit_price").val(0);
- var report_id=$("#report_id").val();
- typeTree1 = $("#report_name").ligerComboBox({
- width : 180,
- selectBoxWidth: 220,
- selectBoxHeight: 230,
- valueField: 'text',
- treeLeafOnly: false,
- tree: { url: 'jReprotTypeAction.do?method=selectJReportType&old_report_id='+report_id+'&time='+new Date().getTime(),
- checkbox : true,
- folderCheckbox : false,
- single : true,
- childIcon : '',
- parentIcon : '',
- idFieldName : 'universalid',
- parentIDFieldName : 'parent_id',
- onClick : function(node) {
- if(isTreeLoad){
- // var id = node.data.universalid;
- var ids = node.data.universalid;
- var report_name=node.data.text;
- var type=node.data.ty;
- // var asset_expected_life = node.data.asset_dep_year;
- // var asset_salvage_rate = node.data.asset_salvage_rate;
- if(type!='3'){
-
- }else{
- $("#report_id").val(ids);
- $("#report_name").val(report_name);
- getReportParam(ids);
- }
- // $("#assetBean\\.asset_dep_year").val(asset_expected_life);
- // $("#assetBean\\.asset_salvage_rate").val(asset_salvage_rate);
- }
- },
- onSuccess : function() {
- this.expandAll();
- isTreeLoad = true;
- }
- }
- });
- });
- var grid = null;
- var reportParamData = ${requestScope.pushParam};
- var reportParam = null;
- var paramValueData = [ {
- param_value : 'currYear',
- param_text : '当前年(yyyy)'
- }, {
- param_value : 'currYearMonth',
- param_text : '当前年月(yyyy-MM)'
- }, {
- param_value : 'currYearMonthDay',
- param_text : '当前年月日(yyyy-MM-dd)'
- } ];
- $(function() {
- var report_push_id = "${reportPush.universalid }";
- if (report_push_id && report_push_id != "") {
- getReportParam("${reportPush.report_id }");
- initgrid();
- }
- });
- function initgrid() {
- grid = $("#maingrid")
- .ligerGrid(
- {
- columns : [
- {
- display : "参数名称",
- name : "param_name",
- align : 'center',
- editor : {
- type : 'select',
- data : reportParam,
- valueField : 'key',
- textField : 'title'
- },
- render : function(item, rowindex, value) {
- // if (reportParam) {
- // for (var i = 0; i < reportParam.length; i++) {
- // if (reportParam[i]['key'] == item.param_name) {
- // return reportParam[i]['title'];
- // }
- // }
- // }
- return item.param_text;
- }
- },
- {
- display : '值',
- name : 'param_value',
- align : 'center',
- width : 200,
- editor : {
- type : 'select',
- data : paramValueData,
- valueField : 'param_value',
- textField : 'param_text',
- width : 200
- },
- render : function(item, rowindex, value) {
- for (var i = 0; i < paramValueData.length; i++) {
- if (paramValueData[i]['param_value'] == item.param_value) {
- return paramValueData[i]['param_text'];
- }
- }
- return item.param_value;
- }
- },
- {
- display : '操作',
- isSort : false,
- render : function(rowdata, rowindex,
- value) {
- var h = "";
- if (!rowdata.universalid) {
- h += "<a href='javascript:beginEdit("
- + rowindex
- + ")'>修改</a> ";
- h += "<a href='javascript:cancelEdit("
- + rowindex
- + ",1)'>删除</a> ";
- } else if (!rowdata._editing) {
- h += "<a href='javascript:beginEdit("
- + rowindex
- + ")'>修改</a> ";
- h += "<a href='javascript:cancelEdit("
- + rowindex
- + ","
- + rowdata.universalid
- + ")'>删除</a> ";
- } else {
- h += "<a href='javascript:cancelEdit("
- + rowindex
- + ")'>取消</a> ";
- }
- return h;
- }
- } ],
- // url : "reportPushAction.do?method=querryPushReportParams&push_id=${reportPush.universalid }&time="
- // + new Date().getTime(),
- data : {
- Rows : reportParamData
- },
- width : '99%',
- // height : '99%',
- rowDraggable : true,
- usePager : false,
- enabledEdit : true,
- clickToEdit : false,
- rownumbers : true
- });
- }
- function addPushParamtRow() {
- var report_id = $("#report_id").val();
- if (report_id == "") {
- $.ligerDialog.alert('请先选择报表!', '提示', "warn");
- return;
- }
- grid.addEditRow();
- }
- function beginEdit(rowid) {
- grid.beginEdit(rowid);
- }
- function cancelEdit(rowid, isDelete) {
- grid.cancelEdit(rowid);
- if (isDelete) {
- grid.deleteRow(rowid);
- }
- }
- function endEdit() {
- if (grid) {
- grid.endEdit();
- var paramsData = JSON.stringify(grid.getData());
- // alert(paramsData);
- var msg = "";
- var arrays = [];
- $.each(grid.getData(), function(index, obj) {
- var param_name = obj.param_name;
- var param_value = obj.param_value;
- var html = "第" + (parseInt(index) + 1) + "行:";
- var content = "";
- arrays.push(param_name);
- if (param_name == null || param_name == "") {
- content += "参数名称不能为空;";
- }
- if (param_value == null || param_value == "") {
- content += "值不能为空;";
- }
- if (content != "") {
- html += content;
- msg += html + "<br/>";
- }
- });
- if (msg != "") {
- $.ligerDialog.error(msg);
- return;
- } else {
- arrays.sort();
- var content = "";
- for (var i = 1; i < arrays.length; i++) {
- if (arrays[i - 1] == arrays[i]) {
- content += arrays[i - 1] + ";";
- }
- }
- if (content != "") {
- $.ligerDialog.error("参数名称存在重复值,如下:<br/>" + content);
- return;
- }
- }
- $("#params_data").val(paramsData);
- }
- // $("#addproject").submit();
- saveReportPush();
- }
- function getReportParam(report_id) {
- var old_report_id = "${reportPush.report_id}";
- if (old_report_id == report_id) {
- reportParamData = ${requestScope.pushParam};
- } else {
- reportParamData = [];
- }
- if (report_id && report_id != "") {
- $.ajax({
- type : "POST",
- dataType : "json",
- timeout : 10000,
- cache : false,
- url : "reportPushAction.do?method=getReprotParam&report_id="
- + report_id + "&time=" + new Date().getTime(),
- success : function(data) {
- if (data) {
- reportParam = data;
- initgrid();
- }
- },
- error : showAjaxError
- });
- }
- }
- function checkForm() {
- var rs = $.validate({
- name : "report_id",
- model : [ {
- type : "require",
- msg : "报表不能为空!"
- } ]
- });
- rs = $.validate({
- name : "start_date",
- model : [ {
- type : "require",
- msg : "开始时间不能为空!"
- } ]
- }) && rs;
- if (rs) {
- return true;
- }
- return false;
- }
- //保存
- function saveReportPush() {
- //表单提交
- if (checkForm()) {
- $("#btnSave").attr({
- "disabled" : "disabled"
- });
- $("#reportPushForm").submit();
- }
- }
- </script>
- <style type="text/css">
- .file-style {
- width: 550px;
- }
- .file-style input[type='file'] {
- width: 300px;
- height: 24px;
- line-height: 22px;
- vertical-align: bottom;
- background-color: #fff;
- border: 1px solid #cccccc;
- margin-top: 2px;
- margin-bottom: 2px;
- }
- </style>
- </head>
- <body>
- <form id="reportPushForm" action="reportPushAction.do?method=doEditReportPush" method="post">
- <div id="title" class="form-button">
- <input id="btnSave" type="button" class="l-button" value="保存" onclick="endEdit()" />
- <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
- </div>
- <div class="container-layout">
- <div class="forum-container">
- <center>
- <table class="l-table-edit line">
- <tr>
- <td class="l-table-edit-text">报表<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td">
- <input type="hidden" id="old_report_id" name="old_report_id" value="${reportPush.report_id}" />
- <input type="hidden" id="report_id" name="reportPush.report_id" value="${reportPush.report_id}"/>
- <input id="report_name" name="reportPush.report_name" value="${report_name}"/>
- </td>
- <!-- <td class="l-table-edit-td"> -->
- <%-- <input type="hidden" id="old_report_id" name="old_report_id" value="${reportPush.report_id}" /> --%>
- <!-- <select id="report_id" name="reportPush.report_id" onchange="getReportParam(this.value)"> -->
- <!-- <option value="">请选择</option> -->
- <%-- <c:forEach items="${jlist }" var="jreport"> --%>
- <%-- <option value="${jreport.universalid }" <c:if test="${jreport.universalid == reportPush.report_id }">selected="selected"</c:if>>${jreport.report_name }</option> --%>
- <%-- </c:forEach> --%>
- <!-- </select> -->
- <!-- </td> -->
- </tr>
- <tr>
- <td class="l-table-edit-text" valign="top">参数设置:</td>
- <td class="l-table-edit-td">
- <div style="padding-top: 5px;">
- <input type="button" onClick="addPushParamtRow();" value="新增" />
- </div>
- <div class="l-clear"></div>
- <div id="maingrid" class="l-panel" style="margin-top: 5px"></div>
- <div style="height: 10px;"></div>
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">开始时间<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td"><input type="text" class="Wdate" name="reportPush.start_date" id="start_date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-%d'})" value="${reportPush.start_date }"></td>
- <tr>
- <td class="l-table-edit-text">执行日<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td"><input type="radio" name="reportPush.execute_day_type" id="execute_day" value="1" <c:if test="${reportPush.execute_day_type == 1 }">checked="checked"</c:if> />每天 <br /> <input type="radio" name="reportPush.execute_day_type" value="2"
- <c:if test="${reportPush.execute_day_type == 2 }">checked="checked"</c:if>
- />每周 <select id="execute_week_day" name="reportPush.execute_week_day" style="width: 128px;">
- <option value="1" <c:if test="${reportPush.execute_week_day == 1 }">selected="selected"</c:if>>一</option>
- <option value="2" <c:if test="${reportPush.execute_week_day == 2 }">selected="selected"</c:if>>二</option>
- <option value="3" <c:if test="${reportPush.execute_week_day == 3 }">selected="selected"</c:if>>三</option>
- <option value="4" <c:if test="${reportPush.execute_week_day == 4 }">selected="selected"</c:if>>四</option>
- <option value="5" <c:if test="${reportPush.execute_week_day == 5 }">selected="selected"</c:if>>五</option>
- <option value="6" <c:if test="${reportPush.execute_week_day == 6 }">selected="selected"</c:if>>六</option>
- <option value="7" <c:if test="${reportPush.execute_week_day == 7 }">selected="selected"</c:if>>七</option>
- </select> <br /> <input type="radio" name="reportPush.execute_day_type" value="3" <c:if test="${reportPush.execute_day_type == 3 }">checked="checked"</c:if> />每月 <input type="text" class="Wdate" name="reportPush.execute_month_day" id="execute_month_day"
- onclick="WdatePicker({dateFmt:'dd'})" value="${reportPush.execute_month_day }"
- /></td>
- </tr>
- <tr>
- <td class="l-table-edit-text">执行状态<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td">
- <select id="execute_state" name="reportPush.execute_state" style="width: 128px;">
- <option value="1" <c:if test="${reportPush.execute_state == 1 }">selected="selected"</c:if>>运行</option>
- <option value="0" <c:if test="${reportPush.execute_state == 0 }">selected="selected"</c:if>>停止</option>
- </select>
- </td>
- </tr>
- </table>
- <input type="hidden" id="params_data" name="params_data" value="" />
- <input type="hidden" id="universalid" name="universalid" value="${reportPush.universalid }" />
- <input type="hidden" id="tabid" name="tabid" value="${param.tabid }" />
- </center>
- </div>
- </div>
- </form>
- </body>
- </html>
|