clearPointScheduleList-update.jsp 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  2. <%@include file="/context/mytags.jsp" %>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>清理点</title>
  7. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  8. <script type="text/javascript">
  9. //编写自定义JS代码
  10. </script>
  11. <style>
  12. .combo{
  13. height: 20px !important;
  14. width: 145px !important;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="clearPointScheduleController.do?doAdd">
  20. <table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
  21. <tr>
  22. <td align="right">
  23. <label class="Validform_label">
  24. 清运点名称:
  25. </label>
  26. </td>
  27. <td class="value">
  28. <input id="id" name="id" value="${common.id}" type="hidden"/>
  29. <input id="name" name="name" value="${common.name}" type="text" style="width: 150px" class="inputxt" readonly="readonly" placeholder="请选择清运点名称"
  30. datatype="*" ignore="checked" onclick="openUserSelect()"/>
  31. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="userSearch" onclick="openUserSelect()">选择</a>
  32. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="userRedo" onclick="callbackCleanUser()">清除</a>
  33. <span class="Validform_checktip"></span>
  34. <label class="Validform_label" style="display: none;">清运点名称</label>
  35. </td>
  36. </tr>
  37. <input id="scheduleDate" name="scheduleDate" value="${common.scheduleDate}" type="hidden"/>
  38. <tr>
  39. <td align="right">
  40. <label class="Validform_label">
  41. <c:if test="${common.scheduleArrangeType == '1'}">
  42. <input type="radio" name="scheduleArrangeType" value="1" checked>*作业周期(按周):
  43. </c:if>
  44. <c:if test="${common.scheduleArrangeType == '2'}">
  45. <input type="radio" name="scheduleArrangeType" value="1">*作业周期(按周):
  46. </c:if>
  47. </label>
  48. </td>
  49. <td class="value">
  50. <input id="scheduleDate1" name="scheduleDate1">
  51. <span id="scheduleArrangeType1wrong" class="Validform_checktip" style="display: none;">请选择作业周期类型</span>
  52. <span id="scheduleDate1wrong" class="Validform_checktip" style="display: none;">请选择作业周期类型</span>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td align="right">
  57. <label class="Validform_label">
  58. <c:if test="${common.scheduleArrangeType == '2'}">
  59. <input type="radio" name="scheduleArrangeType" value="2" checked>*作业周期(按月):
  60. </c:if>
  61. <c:if test="${common.scheduleArrangeType == '1'}">
  62. <input type="radio" name="scheduleArrangeType" value="2">*作业周期(按月):
  63. </c:if>
  64. </label>
  65. </td>
  66. <td class="value">
  67. <input id="scheduleDate2" name="scheduleDate2">
  68. <span id="scheduleArrangeType2wrong" class="Validform_checktip" style="display: none;">请选择作业周期类型</span>
  69. <span id="scheduleDate2wrong" class="Validform_checktip" style="display: none;">请选择作业周期类型</span>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td align="right">
  74. <label class="Validform_label">
  75. <span color="red" class="requiredIcon">*</span>状态:
  76. </label>
  77. </td>
  78. <td class="value">
  79. <t:dictSelect field="scheduleStatus" type="list" typeGroupCode="workStatus"
  80. dictField="code"
  81. dictText="name"
  82. defaultVal="${common.scheduleStatus}" hasLabel="false" title="状态"></t:dictSelect>
  83. <span class="Validform_checktip"></span>
  84. <label class="Validform_label" style="display: none;">状态</label>
  85. </td>
  86. </tr>
  87. </table>
  88. </t:formvalid>
  89. </body>
  90. <script>
  91. $(function () {
  92. let combo1 = [
  93. {"NAME":"周一","CODE":"1"},
  94. {"NAME":"周二","CODE":"2"},
  95. {"NAME":"周三","CODE":"3"},
  96. {"NAME":"周四","CODE":"4"},
  97. {"NAME":"周五","CODE":"5"},
  98. {"NAME":"周六","CODE":"6"},
  99. {"NAME":"周日","CODE":"7"}
  100. ]
  101. $('#scheduleDate1').combobox({
  102. valueField:'CODE',
  103. textField:'NAME',
  104. multiple:true,
  105. data: combo1
  106. });
  107. let combo2 = new Array();
  108. for(var x=1;x<=31;x++){
  109. combo2.push({
  110. "NAME":x+"号","CODE":x
  111. });
  112. }
  113. $('#scheduleDate2').combobox({
  114. valueField:'CODE',
  115. textField:'NAME',
  116. multiple:true,
  117. data: combo2
  118. });
  119. var val= $("input[name='scheduleArrangeType']:checked").val();
  120. var scheduleDate = $("#scheduleDate").val();
  121. scheduleDate = scheduleDate.split(",");
  122. debugger
  123. for(var x=0;x<scheduleDate.length;x++){
  124. if(val == "1"){
  125. $('#scheduleDate1').combobox('select', scheduleDate[x]);
  126. }else if(val == "2"){
  127. $('#scheduleDate2').combobox('select', scheduleDate[x]);
  128. }
  129. }
  130. });
  131. function formatDate() {
  132. var val= $("input[name='scheduleArrangeType']:checked").val();
  133. var result = new Array();
  134. if(val == "1"){
  135. var list = $("input[name='scheduleDate1']");
  136. if(list.length == 0){
  137. $("#scheduleArrangeType1wrong").css("display", "none");
  138. $("#scheduleDate1wrong").css("display", "initial");
  139. return false;
  140. }
  141. for(var x = 0; x < list.length; x ++){
  142. result.push(list[x].value);
  143. }
  144. }else if(val == "2"){
  145. var list = $("input[name='scheduleDate2']");
  146. if(list.length == 0){
  147. $("#scheduleArrangeType2wrong").css("display", "none");
  148. $("#scheduleDate2wrong").css("display", "initial");
  149. return false;
  150. }
  151. for(var x = 0; x < list.length; x ++){
  152. result.push(list[x].value);
  153. }
  154. }else {
  155. $("#scheduleArrangeType1wrong").css("display", "initial");
  156. $("#scheduleArrangeType2wrong").css("display", "initial");
  157. return false;
  158. }
  159. var str = JSON.stringify(result);
  160. $("input[name='scheduleDate']").val(str.replaceAll("\"","").replaceAll("[","").replaceAll("]",""));
  161. return true;
  162. }
  163. function openUserSelect() {
  164. $.dialog({
  165. content: 'url:clearPointScheduleController.do?select',
  166. zIndex: getzIndex(),
  167. title: '清运点选择',
  168. lock: true,
  169. width: '850px',
  170. height: '650px',
  171. opacity: 0.4,
  172. button: [
  173. {
  174. name: '确定', callback: function () {
  175. const iframe = this.iframe.contentWindow;
  176. if (iframe.getReason().length > 0) {
  177. const strData = eval(iframe.getReason());
  178. for (const key in strData[0]) {
  179. if (key === "strId") {
  180. $("#id").val(strData[0][key]);
  181. } else if (key === "strName") {
  182. $("#name").val(strData[0][key]);
  183. }
  184. }
  185. $("#name").focus();
  186. }
  187. }, focus: true
  188. },
  189. {
  190. name: '取消', callback: function () {
  191. }
  192. }
  193. ]
  194. }).zindex();
  195. }
  196. function callbackCleanUser() {
  197. $('#name').val('');
  198. $('#id').val('');
  199. }
  200. </script>