clearingpoint.jsp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: Future
  4. Date: 2021/8/9
  5. Time: 6:51
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  9. <%@include file="/context/mytags.jsp" %>
  10. <t:base type="jquery,easyui,tools"></t:base>
  11. <style>
  12. #clearingpointForm > span:nth-child(3) > span{
  13. width: 100px !important;
  14. }
  15. #clearingpointForm > span:nth-child(4) > span{
  16. width: 100px !important;
  17. }
  18. #clearingpointForm > span:nth-child(5) > span:nth-child(1){
  19. width: 110px !important;
  20. }
  21. #clearingpointForm > span:nth-child(6) > span:nth-child(1){
  22. width: 110px !important;
  23. }
  24. #clearingpointForm > span:nth-child(7) > span{
  25. width: 70px !important;
  26. }
  27. </style>
  28. <div class="easyui-layout" fit="true" >
  29. <div region="center" style="padding:0px;border:0px">
  30. <t:datagrid name="clearingpoint" fitColumns="true" checkbox="false" pageSize="20"
  31. title="清运点入场时限管理" actionUrl="ClearingPointController.do?datagrid"
  32. sortName="createDate" sortOrder="desc" idField="id" queryMode="group">
  33. <t:dgCol title="主键" field="id" hidden="true" width="120"></t:dgCol>
  34. <t:dgCol title="清运点编码" field="code" query="true" queryMode="single" width="100"></t:dgCol>
  35. <t:dgCol title="清运点名称" field="name" query="true" queryMode="single" width="100"></t:dgCol>
  36. <t:dgCol title="最早入场时间" field="prepTime" query="true" queryMode="single" width="110"></t:dgCol>
  37. <t:dgCol title="最晚入场时间" field="lateTime" query="true" queryMode="single" width="110"></t:dgCol>
  38. <t:dgCol title="状态" field="timeStatus" query="true" dictionary="clearing_point" queryMode="single"
  39. width="60"></t:dgCol>
  40. <t:dgToolBar title="录入" icon="icon-add" operationCode="add" url="ClearingPointController.do?goAdd" funname="add"></t:dgToolBar>
  41. <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit" url="ClearingPointController.do?goUpdate"
  42. funname="update"></t:dgToolBar>
  43. <t:dgToolBar title="删除" icon="icon-remove" operationCode="remove" funname="delete_clean"></t:dgToolBar>
  44. </t:datagrid>
  45. </div>
  46. </div>
  47. <script>
  48. // 解决 小时分钟问题
  49. $(function () {
  50. $('input[name=\'prepTime\']').timespinner({
  51. required: false,
  52. showSeconds: false
  53. });
  54. $('input[name=\'lateTime\']').timespinner({
  55. required: false,
  56. showSeconds: false
  57. });
  58. });
  59. // 格式化 状态
  60. statusFormatter = (value, row, index) => {return value === 1 ? '启用' : '停用'}
  61. //清运点 删除 逻辑
  62. delete_clean = () => {
  63. let id = "";
  64. const rows = $("#clearingpoint").datagrid('getSelections');
  65. rows.length > 0 ? $.messager.confirm("确认", "确定要删除这条数据?", function (r) {
  66. if (r) {
  67. for (let i = 0; i < rows.length; i++) {
  68. id = rows[i].id;
  69. }
  70. $.ajax({
  71. url: "ClearingPointController.do?logicDel",
  72. type: 'post',
  73. data: JSON.stringify({id: id}),
  74. cache: false,
  75. contentType: "application/json;charset=utf-8",
  76. success: function (data) {
  77. const d = data;
  78. if (d.success) {
  79. const msg = d.msg;
  80. tip(msg);
  81. $("#clearingpoint").datagrid('reload');
  82. clearData();
  83. id = '';
  84. } else {
  85. layer.alert(d.msg);
  86. }
  87. }
  88. });
  89. }
  90. }) : layer.alert("请选择需要删除的数据")
  91. }
  92. </script>