dcxxadd.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 checkedAlldc(){
  5. if($('#checkAlldc').prop("checked")){
  6. $("input[name='dcid']").each(function() {
  7. $(this).prop("checked", true);
  8. });
  9. }else{
  10. $("input[name='dcid']").each(function() {
  11. $(this).prop("checked", false);
  12. });
  13. }
  14. clickdc();
  15. }
  16. function clickdc(){
  17. var objName= document.getElementsByName("dcid");
  18. var dcids = [];
  19. for (i=0; i<objName.length; i++){
  20. if (objName[i].type=="checkbox" && objName[i].checked){
  21. dcids.push(objName[i].value)
  22. }
  23. }
  24. $('#dcids').val(dcids);
  25. if(isEmpty($('#dcids').val())){
  26. $('#dcids').val(1);
  27. }
  28. }
  29. function dcxxadd(){
  30. var path="/xkzbg/addmain?path=7:id="+$('#jyrid').val()+"";
  31. location.href=$.app+'/dc/add?path='+path;
  32. }
  33. function dcxxview(dcid){
  34. var path="/xkzbg/addmain?path=7:id="+$('#jyrid').val()+"";
  35. location.href=$.app+'/dc/view?id='+dcid+'&path='+path;
  36. }
  37. function dcxxedit(dcid){
  38. var path="/xkzbg/addmain?path=7:id="+$('#jyrid').val()+"";
  39. location.href=$.app+'/dc/edit?id='+dcid+'&path='+path;
  40. }
  41. function dcxxdelete(dcid){
  42. $.confirm({
  43. title: '确认框',
  44. content: '确认删除吗',
  45. confirm: function(){
  46. $.post($.app + "/dc/delete", {
  47. id : dcid,
  48. czid:$('#id').val()
  49. }, function(data) {
  50. if (data.success) {
  51. $.alert({
  52. title: '提示',
  53. content: '操作成功',
  54. confirm: function(){
  55. $('#dcids').val('');
  56. initdcxx();
  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 initdcxx(){
  74. $.post($.app + "/gkjyr/dcxx", {
  75. id : $('#jyrid').val(),
  76. recordStatus:0
  77. }, function(data) {
  78. if (data) {
  79. var str =""
  80. for(var i=0;i<data.length;i++){
  81. var dc = data[i];
  82. str+="<tr class='tr_bg'>";
  83. var dcids = $('#dcids').val();
  84. if(isEmpty(dcids)){
  85. if(dc.isTrue || !isEmpty(dc.xkzid)){
  86. str+="<td><input type='checkbox' checked name='dcid' onclick='clickdc()' value='"+dc.id+"'/></td>";
  87. }else{
  88. str+="<td><input type='checkbox' checked name='dcid' onclick='clickdc()' value='"+dc.id+"'/></td>";
  89. }
  90. }else{
  91. if(dcids == 1){
  92. str+="<td><input type='checkbox' checked name='dcid' onclick='clickdc()' value='"+dc.id+"'/></td>";
  93. }else{
  94. var dcid = dcids.spilt(",");
  95. var flag = 1;
  96. for(var i = 0;i<dcid.length;i++){
  97. if(dc.id == dcid){
  98. flag = 0 ;
  99. break;
  100. }
  101. }
  102. if(flag == 0){
  103. str+="<td><input type='checkbox' checked onclick='clickdc()' name='dcid' value='"+dc.id+"'/></td>";
  104. }else{
  105. str+="<td><input type='checkbox' checked name='dcid' onclick='clickdc()' value='"+dc.id+"'/></td>";
  106. }
  107. }
  108. }
  109. str+="<td>"+dc.dcmc+"</td>";
  110. str+="<td>"+dc.ssjyrzw+"</td>";
  111. str+="<td>"+dc.szgkzw+"</td>";
  112. str+="<td>"+dc.szgqzw+"</td>";
  113. str+="<td>"+dc.zwdcyt+"</td>";
  114. str+="<td>"+dc.dczmj+"</td>";
  115. str+="<td>"+(dc.dczrl==null ? "":dc.dczrl)+"</td>";
  116. str+="<td>"+dc.wxpdczw+"</td>";
  117. str+="<td>";
  118. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"dcxxview('"+dc.id+"')\"> <i class='glyphicon glyphicon-search'></i> 查看</a>";
  119. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"dcxxedit('"+dc.id+"')\"> <i class='glyphicon glyphicon-wrench'></i> 修改</a>";
  120. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"dcxxdelete('"+dc.id+"')\"> <i class='glyphicon glyphicon-trash'></i> 删除</a>";
  121. str+="</td>";
  122. str+="</tr>";
  123. }
  124. $('#dcxxdiv').empty();
  125. $('#dcxxdiv').append(str);
  126. } else {
  127. }
  128. }, "json");
  129. }
  130. </script>
  131. <a class="btn btn-default btn-sm" href="#"
  132. onclick="dcxxadd()" style="float:right;"> <i class="glyphicon glyphicon-plus"></i> 新增
  133. </a>
  134. <table class="main_table" cellpadding="0" cellspacing="0">
  135. <tr>
  136. <th width="5%"><input id="checkAlldc" name="checkAlldc" type="checkbox" onclick='checkedAlldc()' /> </th>
  137. <th width="10%">堆场名称</th>
  138. <th width="15%">港口经营人</th>
  139. <th width="5%">所在<br>港口</th>
  140. <th width="5%">所在<br>港区</th>
  141. <th width="10%">堆场用途</th>
  142. <th width="10%">堆场总面积<br>(平方米)</th>
  143. <th width="10%">堆场总容量<br>(吨)</th>
  144. <th width="10%">是否危险品堆场</th>
  145. <th width="20%">操作</th>
  146. </tr>
  147. <tbody id="dcxxdiv"></tbody>
  148. </table>