bpmPrintTemplateEdit.jsp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <%@page language="java" pageEncoding="UTF-8"%>
  2. <%@include file="/commons/include/html_doctype.html"%>
  3. <html>
  4. <head>
  5. <%@include file="/commons/include/form.jsp" %>
  6. <title>编辑表单模板</title>
  7. <script type="text/javascript" src="${ctx}/js/hotent/platform/form/FormDef.js"></script>
  8. <script type="text/javascript" charset="utf-8" src="${ctx}/js/ueditor2/editor_config.js"></script>
  9. <script type="text/javascript" charset="utf-8" src="${ctx}/js/ueditor2/editor_api.js"></script>
  10. <link rel="stylesheet" type="text/css" href="${ctx}/js/ueditor2/themes/default/css/ueditor.css"/>
  11. <script type="text/javascript">
  12. var locale='zh_cn';
  13. var tableId='${bpmPrintTemplate.tableId}';
  14. $(function() {
  15. function showRequest(formData, jqForm, options) {
  16. return true;
  17. }
  18. $("a.save").click(save);
  19. FormDef.getEditor({
  20. height:200,
  21. width:10,
  22. lang:locale
  23. });
  24. //ueditor渲染textarea
  25. editor.render("html");
  26. editor.tableId = tableId;
  27. });
  28. function save() {
  29. if (FormDef.isSourceMode == 1) {
  30. $.ligerDialog.warn('不能在源代码模式下保存表单','提示');
  31. return;
  32. }
  33. var rtn = $("#bpmPrintTemplateForm").valid();
  34. if (!rtn)
  35. return;
  36. var data = {};
  37. var arr = $('#bpmPrintTemplateForm').serializeArray();
  38. $.each(arr, function(i, d) {
  39. data[d.name] = d.value;
  40. });
  41. var formData = editor.getContent();
  42. data['html'] = formData;
  43. var url="${ctx}/platform/form/bpmPrintTemplate/save.ht";
  44. $.post(url, {data : JSON2.stringify(data)}, showResponse);
  45. }
  46. function showResponse(data) {
  47. var obj = new com.hotent.form.ResultMessage(data);
  48. if (obj.isSuccess()) {// 成功
  49. $.ligerDialog.success('保存成功!','提示', function() {
  50. window.onbeforeunload = null;
  51. if(window.opener){
  52. var url='${ctx}/platform/form/bpmPrintTemplate/list.ht?formKey=${bpmPrintTemplate.formKey}';
  53. window.opener.location.href=url.getNewUrl();
  54. }
  55. window.close();
  56. });
  57. } else {// 失败
  58. $.ligerDialog.err("提示信息","打印模板保存失败!",obj.getMessage());
  59. }
  60. };
  61. </script>
  62. </head>
  63. <body>
  64. <div class="panel">
  65. <div class="panel-top">
  66. <div class="tbar-title">
  67. <c:choose>
  68. <c:when test="${bpmPrintTemplate.id !=null}">
  69. <span class="tbar-label">编辑打印模板</span>
  70. </c:when>
  71. <c:otherwise>
  72. <span class="tbar-label">添加打印模板</span>
  73. </c:otherwise>
  74. </c:choose>
  75. </div>
  76. <div class="panel-toolbar">
  77. <div class="toolBar">
  78. <div class="group"><a class="link save" id="dataFormSave" href="javascript:;"><span></span>保存</a></div>
  79. <div class="l-bar-separator"></div>
  80. <div class="group"><a class="link close" href="javascript:;" onclick="window.close()"><span></span>关闭</a></div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="panel-body">
  85. <form id="bpmPrintTemplateForm" method="post" action="save.ht">
  86. <table class="table-detail" cellpadding="0" cellspacing="0" border="0" type="main" >
  87. <tr>
  88. <th width="15">模板名: </th>
  89. <td width="35"><input type="text" id="temapalteName" name="temapalteName" value="${bpmPrintTemplate.temapalteName}" class="inputText" /></td>
  90. <th width="15">别名: </th>
  91. <td width="35"><input type="text" id="alias" name="alias" value="${bpmPrintTemplate.alias}" class="inputText" /></td>
  92. </tr>
  93. <tr>
  94. <th width="15">是否在流程结束后显示: </th>
  95. <td width="35">
  96. <label>
  97. <input type="radio" name="isPrintInFinish" value="0"
  98. <c:if test="${bpmPrintTemplate.isPrintInFinish eq 0}"> checked="checked" </c:if> /> 否
  99. </label>
  100. <label>
  101. <input type="radio" name="isPrintInFinish" value="1"
  102. <c:if test="${bpmPrintTemplate.isPrintInFinish eq 1}"> checked="checked" </c:if> /> 是
  103. </label>
  104. </td>
  105. <th width="15">是否显示普通表单: </th>
  106. <td width="35">
  107. <label>
  108. <input type="radio" name="isPrintInForm" value="0"
  109. <c:if test="${bpmPrintTemplate.isPrintInForm eq 0}"> checked="checked" </c:if> /> 否
  110. </label>
  111. <label>
  112. <input type="radio" name="isPrintInForm" value="1"
  113. <c:if test="${bpmPrintTemplate.isPrintInForm eq 1}"> checked="checked" </c:if> /> 是
  114. </label>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td colspan="4">
  119. <div id="editor" position="center" style="overflow:auto;height:100%;">
  120. <textarea id="html" name="html">${fn:escapeXml(bpmPrintTemplate.html)}</textarea>
  121. </div>
  122. </td>
  123. </tr>
  124. </table>
  125. <input type="hidden" name="isDefault" value="${bpmPrintTemplate.isDefault}">
  126. <input type="hidden" name="formKey" value="${bpmPrintTemplate.formKey}">
  127. <input type="hidden" name="tableId" value="${bpmPrintTemplate.tableId}">
  128. <input type="hidden" name="id" value="${bpmPrintTemplate.id}" />
  129. </form>
  130. </div>
  131. </div>
  132. </body>
  133. </html>