jformunion.ftl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <#setting number_format="0.#####################">
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <base href="${basePath}/"/>
  6. <meta charset="utf-8">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <title>jeecg</title>
  9. <meta name="description" content="">
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/vendor.css">
  12. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/bootstrap-theme.css">
  13. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/bootstrap.css">
  14. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/app.css">
  15. <link rel="stylesheet" href="${basePath}/plug-in/Validform/css/metrole/style.css" type="text/css"/>
  16. <link rel="stylesheet" href="${basePath}/plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
  17. <script type="text/javascript" src="${basePath}/plug-in/jquery/jquery-1.9.0.js"></script>
  18. <script type="text/javascript" src="${basePath}/plug-in/tools/dataformat.js"></script>
  19. <script type="text/javascript" src="${basePath}/plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
  20. <script type="text/javascript" src="${basePath}/plug-in/easyui/locale/zh-cn.js"></script>
  21. <script type="text/javascript" src="${basePath}/plug-in/tools/syUtil.js"></script>
  22. <script type="text/javascript" src="${basePath}/plug-in/My97DatePicker/WdatePicker.js"></script>
  23. <script type="text/javascript" src="${basePath}/plug-in/lhgDialog/lhgdialog.min.js"></script>
  24. <#--update--begin--author:scott Date:20170304 for:替换layer风格提示框-->
  25. <script type="text/javascript" src="${basePath}/plug-in/layer/layer.js"></script>
  26. <#--update--end--author:scott Date:20170304 for:替换layer风格提示框-->
  27. <script type="text/javascript" src="${basePath}/plug-in/tools/curdtools_zh-cn.js"></script>
  28. <script type="text/javascript" src="${basePath}/plug-in/tools/easyuiextend.js"></script>
  29. <script type="text/javascript" src="${basePath}/plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
  30. <script type="text/javascript" src="${basePath}/plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
  31. <script type="text/javascript" src="${basePath}/plug-in/Validform/js/datatype_zh-cn.js"></script>
  32. <script type="text/javascript" src="${basePath}/plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
  33. <link rel="stylesheet" href="${basePath}/plug-in/uploadify/css/uploadify.css" type="text/css"></link>
  34. <script type="text/javascript" src="${basePath}/plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  35. <script type="text/javascript" charset="utf-8" src="${basePath}/plug-in/ueditor/ueditor.config.js"></script>
  36. <script type="text/javascript" charset="utf-8" src="${basePath}/plug-in/ueditor/ueditor.all.min.js"></script>
  37. </head>
  38. <script type="text/javascript">
  39. $(document).ready(function(){
  40. //$('#tt').tabs({
  41. // onSelect:function(title){
  42. // $('#tt .panel-body').css('width','auto');
  43. // }
  44. //});
  45. //$(".tabs-wrap").css('width','100%');
  46. $("#jform_tab .con-wrapper").hide(); //Hide all tab content
  47. $("#jform_tab li:first").addClass("active").show(); //Activate first tab
  48. $("#jform_tab .con-wrapper:first").show(); //Show first tab content
  49. //On Click Event
  50. $("#jform_tab li").click(function() {
  51. $("#jform_tab li").removeClass("active"); //Remove any "active" class
  52. $(this).addClass("active"); //Add "active" class to selected tab
  53. $("#jform_tab .con-wrapper").hide(); //Hide all tab content
  54. var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
  55. $(activeTab).fadeIn(); //Fade in the active content
  56. //$(""+activeTab).show();
  57. return false;
  58. });
  59. });
  60. //初始化下标
  61. function resetTrNum(tableId) {
  62. $tbody = $("#"+tableId+"");
  63. $tbody.find('>tr').each(function(i){
  64. <#-- update--begin--author:zhangjiaqiang date:20170607 for:修订初始化下标当中涉及的下标内容 -->
  65. $(':input, select, button, a', this).each(function(){
  66. var $this = $(this), name = $this.attr('name'),id=$this.attr('id'),onclick_str=$this.attr('onclick'), val = $this.val();
  67. if(name!=null){
  68. if (name.indexOf("#index#") >= 0){
  69. $this.attr("name",name.replace('#index#',i));
  70. }else{
  71. var s = name.indexOf("[");
  72. var e = name.indexOf("]");
  73. var new_name = name.substring(s+1,e);
  74. $this.attr("name",name.replace(new_name,i));
  75. }
  76. }
  77. if(id!=null){
  78. if (id.indexOf("#index#") >= 0){
  79. $this.attr("id",id.replace('#index#',i));
  80. }else{
  81. var s = id.indexOf("[");
  82. var e = id.indexOf("]");
  83. var new_id = id.substring(s+1,e);
  84. $this.attr("id",id.replace(new_id,i));
  85. }
  86. }
  87. if(onclick_str!=null){
  88. if (onclick_str.indexOf("#index#") >= 0){
  89. $this.attr("onclick",onclick_str.replace(/#index#/g,i));
  90. }else{
  91. }
  92. }
  93. <#-- update--end--author:zhangjiaqiang date:20170607 for:修订初始化下标当中涉及的下标内容 -->
  94. });
  95. $(this).find('div[name=\'xh\']').html(i+1);
  96. });
  97. }
  98. </script>
  99. <body>
  100. <form id="formobj" action="${basePath}/cgFormBuildController.do?saveOrUpdateMore" name="formobj" method="post"><input type="hidden" id="btn_sub" class="btn_sub"/>
  101. <#include "online/template/ledefault/html/jformhead.ftl">
  102. <script type="text/javascript">
  103. $(function(){
  104. //查看模式情况下,删除和上传附件功能禁止使用
  105. if(location.href.indexOf("goDetail.do")!=-1){
  106. $(".jeecgDetail").hide();
  107. }
  108. if(location.href.indexOf("goDetail.do")!=-1){
  109. //查看模式控件禁用
  110. $("#formobj").find(":input").attr("disabled","disabled");
  111. }
  112. if(location.href.indexOf("goAddButton.do")!=-1||location.href.indexOf("goUpdateButton.do")!=-1){
  113. //其他模式显示提交按钮
  114. $("#sub_tr").show();
  115. }
  116. });
  117. function upload() {
  118. <#list columns as po>
  119. <#-- update--begin--author:zhangjiaqiang date:20170608 for:增加对于图片文件的上传支持 -->
  120. <#if po.show_type=='file' || po.show_type == 'image'>
  121. <#-- update--end--author:zhangjiaqiang date:20170608 for:增加对于图片文件的上传支持 -->
  122. $('#${po.field_name}').uploadify('upload', '*');
  123. </#if>
  124. </#list>
  125. }
  126. var neibuClickFlag = false;
  127. function neibuClick() {
  128. neibuClickFlag = true;
  129. $('#btn_sub').trigger('click');
  130. }
  131. function cancel() {
  132. <#list columns as po>
  133. <#-- update--begin--author:zhangjiaqiang date:20170608 for:增加对于图片文件的上传支持 -->
  134. <#if po.show_type=='file' || po.show_type == 'image'>
  135. <#-- update--end--author:zhangjiaqiang date:20170608 for:增加对于图片文件的上传支持 -->
  136. $('#${po.field_name}').uploadify('cancel', '*');
  137. </#if>
  138. </#list>
  139. }
  140. function uploadFile(data){
  141. if(!$("input[name='id']").val()){
  142. <#--update-start--Author:luobaoli Date:20150614 for:需要判断data.obj存在,才能取id值-->
  143. if(data.obj!=null && data.obj!='undefined'){
  144. $("input[name='id']").val(data.obj.id);
  145. }
  146. <#--update-end--Author:luobaoli Date:20150614 for:需要判断data.obj存在,才能取id值-->
  147. }
  148. if($(".uploadify-queue-item").length>0){
  149. upload();
  150. }else{
  151. if (neibuClickFlag){
  152. alert(data.msg);
  153. neibuClickFlag = false;
  154. }else {
  155. var win = frameElement.api.opener;
  156. win.reloadTable();
  157. win.tip(data.msg);
  158. frameElement.api.close();
  159. }
  160. }
  161. }
  162. $.dialog.setting.zIndex = getzIndex();
  163. function del(url,obj){
  164. $.dialog.confirm("确认删除该条记录?", function(){
  165. $.ajax({
  166. async : false,
  167. cache : false,
  168. type : 'POST',
  169. url : url,// 请求的action路径
  170. error : function() {// 请求失败处理函数
  171. },
  172. success : function(data) {
  173. var d = $.parseJSON(data);
  174. if (d.success) {
  175. var msg = d.msg;
  176. tip(msg);
  177. $(obj).closest("tr").hide("slow");
  178. }
  179. }
  180. });
  181. }, function(){
  182. });
  183. }
  184. </script>
  185. <div id="jform_tab" class="tab-wrapper">
  186. <!-- tab -->
  187. <ul class="nav nav-tabs">
  188. <#assign subTableStr>${head.subTableStr?if_exists?html}</#assign>
  189. <#assign subtablelist=subTableStr?split(",")>
  190. <#list subtablelist as sub >
  191. <#if field['${sub}']?exists >
  192. <li role="presentation"><a href="#con-wrapper${sub_index}"><@mutiLang langKey="${field['${sub}'].head.content?if_exists?html}"/></a></li>
  193. </#if>
  194. </#list>
  195. </ul>
  196. <#assign subTableStr>${head.subTableStr?if_exists?html}</#assign>
  197. <#assign subtablelist=subTableStr?split(",")>
  198. <#list subtablelist as sub >
  199. <#if field['${sub}']?exists >
  200. <#if field['${sub}'].head.relationType==1 >
  201. <#include "online/template/ledefault/html/jformonetoone.ftl">
  202. <#else>
  203. <#include "online/template/ledefault/html/jformonetomany.ftl">
  204. </#if>
  205. </#if>
  206. </#list>
  207. </div>
  208. <div style="width: auto;height: 200px;">
  209. <div style="width:690px;height:1px;"></div>
  210. <div id="tt" tabPosition="top" border=flase style="margin:0px;padding:0px;overflow:hidden;width:auto;" class="easyui-tabs" fit="false">
  211. </div>
  212. </div>
  213. <div align="center" id = "sub_tr" style="display: none;" > <input type="button" value="提交" onclick="$('#btn_sub').trigger('click');" class="ui_state_highlight"></div>
  214. <#--update--begin--author:scott Date:20170304 for:替换layer风格提示框-->
  215. <script type="text/javascript">$(function(){$("#formobj").Validform({tiptype:function(msg,o,cssctl){if(o.type == 3){layer.open({title:'提示信息',content:msg,icon:5,shift:6,btn:false,shade:false,time:5000,cancel:function(index){o.obj.focus();layer.close(index);},yes:function(index){o.obj.focus();layer.close(index);},})}},btnSubmit:"#btn_sub",btnReset:"#btn_reset",ajaxPost:true,usePlugin:{passwordstrength:{minLen:6,maxLen:18,trigger:function(obj,error){if(error){obj.parent().next().find(".Validform_checktip").show();obj.find(".passwordStrength").hide();}else{$(".passwordStrength").show();obj.parent().next().find(".Validform_checktip").hide();}}}},callback:function(data){if(data.success==true){uploadFile(data);}else{if(data.responseText==''||data.responseText==undefined){$.messager.alert('错误', data.msg);$.Hidemsg();}else{try{var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'),data.responseText.indexOf('错误信息')); $.messager.alert('错误',emsg);$.Hidemsg();}catch(ex){$.messager.alert('错误',data.responseText+'');}} return false;}if(!neibuClickFlag){var win = frameElement.api.opener; win.reloadTable();}}});});</script></form>
  216. <#--update--end--author:scott Date:20170304 for:替换layer风格提示框-->
  217. <!-- 添加 产品明细 模版 -->
  218. <table style="display:none">
  219. <#assign subTableStr>${head.subTableStr?if_exists?html}</#assign>
  220. <#assign subtablelist=subTableStr?split(",")>
  221. <#list subtablelist as sub >
  222. <#if field['${sub}']?exists >
  223. <#if field['${sub}'].head.relationType!=1 >
  224. <#include "online/template/ledefault/html/jformonetomanytpl.ftl">
  225. </#if>
  226. </#if>
  227. </#list>
  228. </table>
  229. <script type="text/javascript">${js_plug_in?if_exists}</script>
  230. <#-- update--begin--author:zhangjiaqiang date:20170607 for:增加对于图片的支持 -->
  231. <script>
  232. //通用弹出式文件上传
  233. function commonUpload(callback,inputId){
  234. $.dialog({
  235. content: "url:systemController.do?commonUpload",
  236. lock : true,
  237. title:"文件上传",
  238. <#-- update--begin--author:zhangjiaqiang date:20170601 for:修订弹出框对应的index -->
  239. zIndex:getzIndex(),
  240. <#-- update--end--author:zhangjiaqiang date:20170601 for:修订弹出框对应的index -->
  241. width:700,
  242. height: 200,
  243. parent:windowapi,
  244. cache:false,
  245. ok: function(){
  246. var iframe = this.iframe.contentWindow;
  247. iframe.uploadCallback(callback,inputId);
  248. return true;
  249. },
  250. cancelVal: '关闭',
  251. cancel: function(){
  252. }
  253. });
  254. }
  255. //通用弹出式文件上传-回调
  256. function commonUploadDefaultCallBack(url,name,inputId){
  257. var linkElement = document.getElementById(inputId+"_href");
  258. var inputElement = document.getElementById(inputId);
  259. linkElement.setAttribute("href",url);
  260. linkElement.innerHTML="下载";
  261. inputElement.setAttribute("value",url);
  262. //$("#"+inputId+"_href").attr('href',url).html('下载');
  263. //$("#"+inputId).val(url);
  264. }
  265. </script>
  266. <#-- update--begin--author:zhangjiaqiang date:20170607 for:增加对于图片的支持 -->
  267. </body>
  268. </html>