clearPointScheduleList-add.jsp 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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" beforeSubmit="formatDate" usePlugin="password" layout="table" action="clearPointScheduleController.do?doUpdate">
  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" type="hidden"/>
  38. <tr>
  39. <td align="right">
  40. <label class="Validform_label">
  41. <input type="radio" name="scheduleArrangeType" value="1">*作业周期(按周):
  42. </label>
  43. </td>
  44. <td class="value">
  45. <input id="scheduleDate1" name="scheduleDate1">
  46. <span id="scheduleArrangeType1wrong" class="Validform_checktip Validform_wrong" style="display: none;">请选择作业周期类型</span>
  47. <span id="scheduleDate1wrong" class="Validform_checktip Validform_wrong" style="display: none;">请选择作业周期类型</span>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td align="right">
  52. <label class="Validform_label">
  53. <input type="radio" name="scheduleArrangeType" value="2">*作业周期(按月):
  54. </label>
  55. </td>
  56. <td class="value">
  57. <input id="scheduleDate2" name="scheduleDate2">
  58. <span id="scheduleArrangeType2wrong" class="Validform_checktip Validform_wrong" style="display: none;">请选择作业周期类型</span>
  59. <span id="scheduleDate2wrong" class="Validform_checktip Validform_wrong" style="display: none;">请选择作业周期类型</span>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td align="right">
  64. <label class="Validform_label">
  65. <span color="red" class="requiredIcon">*</span>状态:
  66. </label>
  67. </td>
  68. <td class="value">
  69. <t:dictSelect field="scheduleStatus" type="list" typeGroupCode="workStatus"
  70. dictField="code"
  71. dictText="name"
  72. defaultVal="1" hasLabel="false" title="状态"></t:dictSelect>
  73. <span class="Validform_checktip"></span>
  74. <label class="Validform_label" style="display: none;">状态</label>
  75. </td>
  76. </tr>
  77. </table>
  78. </t:formvalid>
  79. </body>
  80. <script>
  81. $(function () {
  82. let combo1 = [
  83. {"NAME":"周一","CODE":"1"},
  84. {"NAME":"周二","CODE":"2"},
  85. {"NAME":"周三","CODE":"3"},
  86. {"NAME":"周四","CODE":"4"},
  87. {"NAME":"周五","CODE":"5"},
  88. {"NAME":"周六","CODE":"6"},
  89. {"NAME":"周日","CODE":"7"}
  90. ]
  91. $('#scheduleDate1').combobox({
  92. valueField:'CODE',
  93. textField:'NAME',
  94. multiple:true,
  95. data: combo1
  96. });
  97. let combo2 = new Array();
  98. for(var x=1;x<=31;x++){
  99. combo2.push({
  100. "NAME":x+"号","CODE":x
  101. });
  102. }
  103. $('#scheduleDate2').combobox({
  104. valueField:'CODE',
  105. textField:'NAME',
  106. multiple:true,
  107. data: combo2
  108. });
  109. });
  110. function formatDate() {
  111. var val= $("input[name='scheduleArrangeType']:checked").val();
  112. var result = new Array();
  113. if(val == "1"){
  114. var list = $("input[name='scheduleDate1']");
  115. if(list.length == 0){
  116. $("#scheduleArrangeType1wrong").css("display", "none");
  117. $("#scheduleDate1wrong").css("display", "initial");
  118. return false;
  119. }
  120. for(var x = 0; x < list.length; x ++){
  121. result.push(list[x].value);
  122. }
  123. }else if(val == "2"){
  124. var list = $("input[name='scheduleDate2']");
  125. if(list.length == 0){
  126. $("#scheduleArrangeType2wrong").css("display", "none");
  127. $("#scheduleDate2wrong").css("display", "initial");
  128. return false;
  129. }
  130. for(var x = 0; x < list.length; x ++){
  131. result.push(list[x].value);
  132. }
  133. }else {
  134. $("#scheduleArrangeType1wrong").css("display", "initial");
  135. $("#scheduleArrangeType2wrong").css("display", "initial");
  136. return false;
  137. }
  138. var str = JSON.stringify(result);
  139. $("input[name='scheduleDate']").val(str.replaceAll("\"","").replaceAll("[","").replaceAll("]",""));
  140. return true;
  141. }
  142. function openUserSelect() {
  143. $.dialog({
  144. content: 'url:clearPointScheduleController.do?select',
  145. zIndex: getzIndex(),
  146. title: '清运点选择',
  147. lock: true,
  148. width: '850px',
  149. height: '650px',
  150. opacity: 0.4,
  151. button: [
  152. {
  153. name: '确定', callback: function () {
  154. const iframe = this.iframe.contentWindow;
  155. if (iframe.getReason().length > 0) {
  156. const strData = eval(iframe.getReason());
  157. for (const key in strData[0]) {
  158. if (key === "strId") {
  159. $("#id").val(strData[0][key]);
  160. } else if (key === "strName") {
  161. $("#name").val(strData[0][key]);
  162. }
  163. }
  164. $("#name").focus();
  165. }
  166. }, focus: true
  167. },
  168. {
  169. name: '取消', callback: function () {
  170. }
  171. }
  172. ]
  173. }).zindex();
  174. }
  175. function callbackCleanUser() {
  176. $('#name').val('');
  177. $('#id').val('');
  178. }
  179. </script>