cmInstrumentMaintenanceList.jsp 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>仪器维修管理</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. .table th{text-align: center;}
  9. .table td{text-align: center;}
  10. #cancelModal{display: none;}
  11. </style>
  12. <script type="text/javascript">
  13. $(document).ready(function() {
  14. $('.cancelModal').on('click',function () {
  15. $('#confirm').attr('data-id',$(this).attr('data-id'));
  16. $('#cancelModal').modal();
  17. })
  18. $('#confirm').on('click',function () {
  19. var params = {
  20. "id": $(this).attr('data-id'),
  21. "cancelReason": $("#cancelSelect").val()
  22. };
  23. $.ajax({
  24. type: "post",
  25. url: "${ctx}/newhome/cmInstrumentMaintenance/cancel",
  26. data: params,
  27. success : function (res) {
  28. if(res.errcode == '1') {
  29. alertx(res.errmsg);
  30. }
  31. if(res.errcode == '0') {
  32. console.log(res.data);
  33. window.location.href = "${ctx}/newhome/cmInstrumentMaintenance/";
  34. }
  35. },
  36. error : function (res) {
  37. }
  38. });
  39. })
  40. });
  41. function page(n,s){
  42. $("#pageNo").val(n);
  43. $("#pageSize").val(s);
  44. $("#searchForm").submit();
  45. return false;
  46. }
  47. function copyText(id) {
  48. var Url2 = document.getElementById(id);
  49. Url2.select(); // 选择对象
  50. document.execCommand("Copy"); // 执行浏览器复制命令
  51. alert("已复制好,可贴粘。");
  52. }
  53. function copyUrl(url) {
  54. window.clipboardData.setData("Text",url);
  55. alert("复制成功!");
  56. }
  57. </script>
  58. </head>
  59. <body>
  60. <ul class="nav nav-tabs">
  61. <li class="active"><a href="${ctx}/newhome/cmInstrumentMaintenance/">仪器维修列表</a></li>
  62. <shiro:hasPermission name="newhome:cmInstrumentMaintenance:edit"><li><a href="${ctx}/newhome/cmInstrumentMaintenance/form">仪器维修添加</a></li></shiro:hasPermission>
  63. </ul>
  64. <form:form id="searchForm" modelAttribute="cmInstrumentMaintenance" action="${ctx}/newhome/cmInstrumentMaintenance/" method="post" class="breadcrumb form-search">
  65. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  66. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  67. <div class="ul-form">
  68. <div class="flex-wrap">
  69. <div class="item">
  70. <label>维修订单号:</label>
  71. <form:input path="orderNo" htmlEscape="false" maxlength="100" class="input-medium"/>
  72. </div>
  73. <div class="item">
  74. <label>用户名称:</label>
  75. <form:input path="userName" htmlEscape="false" maxlength="100" class="input-medium"/>
  76. </div>
  77. <div class="item">
  78. <label>维修商名称:</label>
  79. <form:input path="maintainerName" htmlEscape="false" maxlength="100" class="input-medium"/>
  80. </div>
  81. <div class="item">
  82. <label>仪器名称:</label>
  83. <form:input path="instrumentName" htmlEscape="false" maxlength="100" class="input-medium"/>
  84. </div>
  85. <div class="item">
  86. <label>提交时间:</label>
  87. <form:input path="startTime" type="text" maxlength="20" class="input-mini Wdate" value="${startTime}"
  88. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
  89. -
  90. <form:input path="endTime" type="text" maxlength="20" class="input-mini Wdate" value="${endTime}"
  91. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
  92. </div>
  93. <div class="item">
  94. <label> 状态:</label>
  95. <form:select path="status" class="input-medium">
  96. <form:option value="" label=" "/>
  97. <form:options items="${fns:getDictList('maintenance_status')}" itemLabel="label" itemValue="value"
  98. htmlEscape="false"/>
  99. </form:select>
  100. </div>
  101. <div class="item">
  102. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
  103. </div>
  104. </div>
  105. </div>
  106. </form:form>
  107. <sys:message content="${message}"/>
  108. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  109. <thead>
  110. <tr>
  111. <th>序号</th>
  112. <th>维修订单号</th>
  113. <th>用户名称</th>
  114. <th>联系人</th>
  115. <th>手机号</th>
  116. <th>仪器名称</th>
  117. <th>提交时间</th>
  118. <th>进度</th>
  119. <shiro:hasPermission name="newhome:cmInstrumentMaintenance:edit"><th>操作</th></shiro:hasPermission>
  120. </tr>
  121. </thead>
  122. <tbody>
  123. <c:forEach items="${page.list}" var="cmInstrumentMaintenance">
  124. <tr>
  125. <td>${cmInstrumentMaintenance.id}</td>
  126. <td>${cmInstrumentMaintenance.orderNo}</td>
  127. <td>${cmInstrumentMaintenance.userName}</td>
  128. <td>${cmInstrumentMaintenance.userContact}</td>
  129. <td>${cmInstrumentMaintenance.userMobile}</td>
  130. <td>${cmInstrumentMaintenance.instrumentName}</td>
  131. <td><fmt:formatDate value="${cmInstrumentMaintenance.submitDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
  132. <td>${fns:getDictLabel(cmInstrumentMaintenance.status, 'maintenance_status', cmInstrumentMaintenance.status)}</td>
  133. <shiro:hasPermission name="newhome:cmInstrumentMaintenance:edit"><td>
  134. <a href="${ctx}/newhome/cmInstrumentMaintenance/form?id=${cmInstrumentMaintenance.id}">
  135. <c:if test="${cmInstrumentMaintenance.status eq 1 or cmInstrumentMaintenance.status eq 2}">
  136. 编辑
  137. </c:if>
  138. <c:if test="${cmInstrumentMaintenance.status eq 3 or cmInstrumentMaintenance.status eq 4}">
  139. 详情
  140. </c:if>
  141. </a>
  142. <c:if test="${empty cmInstrumentMaintenance.link}">
  143. 复制链接
  144. </c:if>
  145. <c:if test="${not empty cmInstrumentMaintenance.link}">
  146. <textarea id="${fns:appendLast("copy_", cmInstrumentMaintenance.id)}" rows="10" style="position: absolute; resize:none;opacity:0;width: 0;height: 0">${cmInstrumentMaintenance.link}</textarea>
  147. <a href="javascript:void(0);" onclick="copyText('${fns:appendLast("copy_", cmInstrumentMaintenance.id)}')">复制链接</a>
  148. </c:if>
  149. <shiro:hasPermission name="newhome:cmInstrumentMaintenance:delete">
  150. <c:if test="${cmInstrumentMaintenance.status eq 1}">
  151. <a href="javascript:void(0);" class="cancelModal" data-id="${cmInstrumentMaintenance.id}">取消</a>
  152. </c:if>
  153. <a href="${ctx}/newhome/cmInstrumentMaintenance/delete?id=${cmInstrumentMaintenance.id}" onclick="return confirmx('确定删除吗,删除后不可恢复?', this.href)">删除</a>
  154. </shiro:hasPermission>
  155. </td></shiro:hasPermission>
  156. </tr>
  157. </c:forEach>
  158. </tbody>
  159. </table>
  160. <div class="pagination">${page}</div>
  161. <div class="modal fade" id="cancelModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  162. <div class="modal-dialog">
  163. <div class="modal-content">
  164. <div class="modal-header">
  165. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  166. <h4 class="modal-title" id="myModalLabel">确定取消吗</h4>
  167. </div>
  168. <div class="modal-body">
  169. <div class="reg-row">
  170. <label>取消原因</label>
  171. <select class="select" id="cancelSelect">
  172. <option>无效错误信息</option>
  173. <option>重复提交</option>
  174. <option>无法维修</option>
  175. <option>其他原因</option>
  176. </select>
  177. </div>
  178. </div>
  179. <div class="modal-footer">
  180. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  181. <button type="button" class="btn btn-primary" id="confirm">确认</button>
  182. </div>
  183. </div><!-- /.modal-content -->
  184. </div><!-- /.modal -->
  185. </div>
  186. </body>
  187. </html>