reportPushEdit.jsp 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <%@ page contentType="text/html;charset=UTF-8"%>
  2. <%@ include file="/WEB-INF/include/taglibs.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title></title>
  7. <%@ include file="/WEB-INF/include/common.jsp"%>
  8. <script type="text/javascript">
  9. var timeType = 0;
  10. $(function() {
  11. //定义页面元素
  12. var operate = '${requestScope.operate}';
  13. var $tabs = $("#tabs");
  14. $tabs.tabs('select', "基本信息");
  15. if ("edit" == operate){
  16. $('#warehouseId').combogrid({
  17. disabled : true
  18. });
  19. $('#customerId').combogrid({
  20. disabled : true
  21. });
  22. $('#queryId').combobox({
  23. disabled : true
  24. });
  25. }
  26. var reportPushData = ${requestScope.reportPushData};
  27. $.ReportPushEdit = new $.AbstractEdit({
  28. entity : "ReportPush",
  29. formId : "reportPushForm",
  30. operate : operate,
  31. id : "id"
  32. });
  33. //扩展或重写方法
  34. $.fn.extend($.ReportPushEdit, {
  35. });
  36. $('#warehouseId').combogrid({// 仓库
  37. url : WEBROOT + "/loadData.action?entity=warehouse",
  38. idField : 'warehouseId',
  39. textField : 'warehouseName',
  40. delay : 500,
  41. showHeader : false,
  42. mode : 'remote',
  43. columns : [ [ {
  44. field : 'warehouseName',
  45. title : '仓库名称',
  46. width : 155
  47. } ] ],
  48. onSelectAfter : function(rowIndex, record) {
  49. $("#warehouseName").val(record.warehouseName);
  50. },
  51. onBeforeLoad : function(param) { // 此设置使控件不会自动加载数据 这里不能使用this
  52. if (!$('#warehouseId').combogrid('getText')) {
  53. return false;
  54. } else {
  55. return true;
  56. }
  57. },
  58. onShowPanel : function() { // 在第一次触发下拉框事件是加载数据
  59. if (!$(this).combogrid('getText')) {
  60. $(this).combogrid({
  61. onBeforeLoad : function(param) {
  62. return true;
  63. }
  64. });
  65. }
  66. }
  67. });
  68. $('#customerId').combogrid({
  69. panelWidth : 150,
  70. url : WEBROOT + "/loadData.action?entity=customer",
  71. idField : 'customerId',
  72. textField : 'customerName',
  73. showHeader : false,
  74. delay : 500,
  75. mode : 'remote',
  76. columns : [ [
  77. { field : 'customerId', hidden : true },
  78. { field : 'customerName', title : '', width : 150 }
  79. ] ],
  80. onSelectAfter : function(rowIndex, record) {
  81. $("#customerName").val(record.customerName);
  82. $("#customerCode").val(record.customerCode);
  83. }, onBeforeLoad : function(param) {
  84. if (!$('#customerId').combogrid('getText')) {
  85. return false;
  86. } else {
  87. return true;
  88. }
  89. }, onShowPanel : function() {
  90. if (!$(this).combogrid('getText')) {
  91. $(this).combogrid({ onBeforeLoad : function(param) {
  92. return true;
  93. } });
  94. }
  95. }
  96. });
  97. $.ReportPushEdit.init();
  98. if (!$.isEmpty(reportPushData)) {
  99. $.ReportPushEdit.fillData(reportPushData);
  100. };
  101. $("#saveReportPushBtn").click(
  102. $.proxy($.ReportPushEdit.save, $.ReportPushEdit));
  103. $('#timeType').combobox({
  104. onSelect: function(param){
  105. timeType = $("#reportPushForm").find("input[name='timeType']").val();
  106. if(11701 == timeType){
  107. $('#pushDate').combobox({
  108. valueField: 'label',
  109. textField: 'value',
  110. data : [{label:'1',value:'1'},{label:'2',value:'2'},{label:'3',value:'3'},{label:'4',value:'4'},{label:'5',value:'5'},
  111. {label:'6',value:'6'},{label:'7',value:'7'},{label:'8',value:'8'},{label:'9',value:'9'},{label:'10',value:'10'},
  112. {label:'11',value:'11'},{label:'12',value:'12'}
  113. ]
  114. });
  115. }else if(11702 == timeType){
  116. $('#pushDate').combobox({
  117. valueField: 'label',
  118. textField: 'value',
  119. data : [{label:'1',value:'1'},{label:'2',value:'2'},{label:'3',value:'3'},{label:'4',value:'4'},{label:'5',value:'5'},
  120. {label:'6',value:'6'},{label:'7',value:'7'},{label:'8',value:'8'},{label:'9',value:'9'},{label:'10',value:'10'},
  121. {label:'11',value:'11'},{label:'12',value:'12'},{label:'13',value:'13'},{label:'14',value:'14'},{label:'15',value:'15'},
  122. {label:'16',value:'16'},{label:'17',value:'17'},{label:'18',value:'18'},{label:'19',value:'19'},{label:'20',value:'20'},
  123. {label:'21',value:'21'},{label:'22',value:'22'},{label:'23',value:'23'},{label:'24',value:'24'},{label:'25',value:'25'},
  124. {label:'26',value:'26'},{label:'27',value:'27'},{label:'28',value:'28'},{label:'29',value:'29'},{label:'30',value:'30'},
  125. {label:'31',value:'31'}
  126. ]
  127. });
  128. }else if(11703 == timeType){
  129. $('#pushDate').combobox({
  130. valueField: 'label',
  131. textField: 'value',
  132. data : [{label:'星期一',value:'星期一'},{label:'星期二',value:'星期二'},{label:'星期三',value:'星期三'},{label:'星期四',value:'星期四'},
  133. {label:'星期五',value:'星期五'},{label:'星期六',value:'星期六'},{label:'星期日',value:'星期日'}
  134. ]
  135. });
  136. }else{
  137. }
  138. }
  139. });
  140. });
  141. </script>
  142. </head>
  143. <body style="overflow-y:hidden" fit="true" scroll="no">
  144. <div id="tabs" class="easyui-tabs" fit="true">
  145. <div title="基本信息">
  146. <form id="reportPushForm" method="post">
  147. <input type="hidden" name="id"></input>
  148. <table style="width:100%">
  149. <tr>
  150. <td class="title">仓库:</td>
  151. <td>
  152. <input id="warehouseId" name="warehouseId" myType="easyui-combogrid" style="width:155px" />
  153. <input id="warehouseName" name="warehouseName" hidden="true" />
  154. </td>
  155. <td class="title"><div class="star">*</div>货主:</td>
  156. <td>
  157. <input id="customerId" name="customerId" myType="easyui-combogrid" style="width:155px" data-options="required:true"/>
  158. <input id="customerName" name="customerName" hidden="true" />
  159. <input id="customerCode" name="customerCode" hidden="true" />
  160. </td>
  161. <td class="title"><div class="star">*</div>数据来源:</td>
  162. <td>
  163. <select id="queryId" class="easyui-combobox" size="8" name="queryId" style="width:155px" data-options="required:true">
  164. <option value="" selected="selected"></option>
  165. <c:forEach var="item" items="${queryMainList}">
  166. <option value="${item.id}">${item.queryName}</option>
  167. </c:forEach>
  168. </select>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td class="title">时间类型:</td>
  173. <td>
  174. <select id="timeType" class="easyui-combobox" size="8" name="timeType" style="width:155px">
  175. <option value="" selected="selected"></option>
  176. <c:forEach var="item" items="${timeTypeList}">
  177. <option value="${item.id}">${item.dictionaryName}</option>
  178. </c:forEach>
  179. </select>
  180. </td>
  181. <td class="title">推送日期:</td>
  182. <td>
  183. <select id="pushDate" class="easyui-combobox" size="8" name="pushDate" style="width:155px">
  184. </select>
  185. </td>
  186. <td class="title">时分秒:</td>
  187. <td>
  188. <input class="easyui-validatebox" name="pushTime" style="width:150px">(以英文冒号分割)</input>
  189. </td>
  190. </tr>
  191. <tr>
  192. <td class="title">邮件主题:</td>
  193. <td>
  194. <input class="easyui-validatebox" name="emailTitle" style="width:150px"></input>
  195. </td>
  196. <td class="title">邮件地址:</td>
  197. <td colspan="3">
  198. <input class="easyui-validatebox" name="emailAddress" style="width:500px">(以英文逗号分割)</input>
  199. </td>
  200. </tr>
  201. <tr>
  202. <td colspan="6" align="right"><a href="#" icon="icon-save"
  203. id="saveReportPushBtn" class="easyui-linkbutton">保存</a></td>
  204. </tr>
  205. </table>
  206. </form>
  207. </div>
  208. </div>
  209. </body>
  210. </html>