bwxxadd.jsp 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <script type="text/javascript">
  4. function checkedAllbw(){
  5. if($('#checkAllbw').prop("checked")){
  6. $("input[name='bwid']").each(function() {
  7. $(this).prop("checked", true);
  8. });
  9. }else{
  10. $("input[name='bwid']").each(function() {
  11. $(this).prop("checked", false);
  12. });
  13. }
  14. clickbw();
  15. }
  16. function clickbw(){
  17. var objName= document.getElementsByName("bwid");
  18. var bwids = [];
  19. for (i=0; i<objName.length; i++){
  20. if (objName[i].type=="checkbox" && objName[i].checked){
  21. bwids.push(objName[i].value)
  22. }
  23. }
  24. $('#bwids').val(bwids);
  25. if(isEmpty($('#bwids').val())){
  26. $('#bwids').val(1);
  27. }
  28. }
  29. function bwxxadd(){
  30. var path="/xkzsq/addmain?path=4:id="+$('#jyrid').val()+"";
  31. location.href=$.app+'/bw/add?path='+path;
  32. }
  33. function bwxxview(bwid){
  34. var path="/xkzsq/addmain?path=4:id="+$('#jyrid').val()+"";
  35. location.href=$.app+'/bw/view?id='+bwid+'&path='+path;
  36. }
  37. function bwxxedit(bwid){
  38. var path="/xkzsq/addmain?path=4:id="+$('#jyrid').val()+"";
  39. location.href=$.app+'/bw/edit?id='+bwid+'&path='+path;
  40. }
  41. function bwxxdelete(bwid){
  42. $.confirm({
  43. title: '确认框',
  44. content: '确认删除吗',
  45. confirm: function(){
  46. $.post($.app + "/bw/delete", {
  47. id : bwid,
  48. czid:$('#id').val()
  49. }, function(data) {
  50. if (data.success) {
  51. $.alert({
  52. title: '提示',
  53. content: '操作成功',
  54. confirm: function(){
  55. $('#bwids').val('');
  56. initbwxx();
  57. }
  58. });
  59. } else {
  60. $.alert({
  61. title: '提示',
  62. content: data.message,
  63. confirm: function(){
  64. }
  65. });
  66. }
  67. }, "json");
  68. },
  69. cancel: function(){
  70. }
  71. });
  72. }
  73. function initbwxx(){
  74. $.post($.app + "/gkjyr/bwxx2", {
  75. id : $('#jyrid').val()
  76. }, function(data) {
  77. if (data) {
  78. var str =""
  79. for(var i=0;i<data.length;i++){
  80. var bw = data[i];
  81. str+="<tr class='tr_bg'>";
  82. var bwids = $('#bwids').val();
  83. if(isEmpty(bwids)){
  84. if(bw.isTrue){
  85. str+="<td><input type='checkbox' checked name='bwid' value='"+bw.id+"'/></td>";
  86. }else{
  87. str+="<td><input type='checkbox' checked name='bwid' value='"+bw.id+"'/></td>";
  88. }
  89. }else{
  90. if(bwids == 1){
  91. str+="<td><input type='checkbox' checked name='bwid' onclick='clickbw()' value='"+bw.id+"'/></td>";
  92. }else{
  93. var bwid = bwids.spilt(",");
  94. var flag = 1;
  95. for(var i = 0;i<bwid.length;i++){
  96. if(bw.id == bwid){
  97. flag = 0 ;
  98. break;
  99. }
  100. }
  101. if(flag == 0){
  102. str+="<td><input type='checkbox' checked name='bwid' value='"+bw.id+"'/></td>";
  103. }else{
  104. str+="<td><input type='checkbox' checked name='bwid' value='"+bw.id+"'/></td>";
  105. }
  106. }
  107. }
  108. str+="<td>"+bw.bwmc+"</td>";
  109. str+="<td>"+(bw.ssjyrzw==null?"":bw.ssjyrzw)+"</td>";
  110. str+="<td>"+bw.ssmtzw+"</td>";
  111. str+="<td>"+bw.szgkzw+"</td>";
  112. str+="<td>"+bw.szgqzw+"</td>";
  113. str+="<td>"+(bw.bwytzw==null?"":bw.bwytzw)+"</td>";
  114. str+="<td>"+(bw.wxpbwzw==null?"":bw.wxpbwzw)+"</td>";
  115. str+="<td>"+(bw.sfdwkfzw==null?"":bw.sfdwkfzw)+"</td>";
  116. str+="<td>";
  117. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"bwxxview('"+bw.id+"')\"> <i class='glyphicon glyphicon-search'></i> 查看</a>";
  118. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"bwxxedit('"+bw.id+"')\"> <i class='glyphicon glyphicon-wrench'></i> 修改</a>";
  119. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"bwxxdelete('"+bw.id+"')\"> <i class='glyphicon glyphicon-trash'></i> 删除</a>";
  120. str+="</td>";
  121. str+="</tr>";
  122. }
  123. $('#bwxxdiv').empty();
  124. $('#bwxxdiv').append(str);
  125. } else {
  126. }
  127. }, "json");
  128. }
  129. </script>
  130. <a class="btn btn-default btn-sm" href="#"
  131. onclick="bwxxadd()" style="float:right;"> <i class="glyphicon glyphicon-plus"></i> 新增
  132. </a>
  133. <table class="main_table" cellpadding="0" cellspacing="0">
  134. <tr>
  135. <th width="10%"><input id="checkAllbw" name="checkAllbw" type="checkbox" onclick='checkedAllbw()' /></th>
  136. <th width="10%">泊位名称</th>
  137. <th width="10%">港口经营人</th>
  138. <th width="10%">码头名称</th>
  139. <th width="10%">所在港口</th>
  140. <th width="10%">所在港区</th>
  141. <!-- <th width="10%">泊位属性</th> -->
  142. <th width="15%">泊位用途</th>
  143. <th width="5%">是否<br>危险品泊位</th>
  144. <th width="5%">是否<br>对外开放泊位</th>
  145. <th width="20%">操作</th>
  146. </tr>
  147. <tbody id="bwxxdiv"></tbody>
  148. </table>