ckxxedit.jsp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <script type="text/javascript">
  4. function checkedAllck(){
  5. if($('#checkAllck').prop("checked")){
  6. $("input[name='ckid']").each(function() {
  7. $(this).prop("checked", true);
  8. });
  9. }else{
  10. $("input[name='ckid']").each(function() {
  11. $(this).prop("checked", false);
  12. });
  13. }
  14. clickck();
  15. }
  16. function clickck(){
  17. var objName= document.getElementsByName("ckid");
  18. var ckids = [];
  19. for (i=0; i<objName.length; i++){
  20. if (objName[i].type=="checkbox" && objName[i].checked){
  21. ckids.push(objName[i].value)
  22. }
  23. }
  24. $('#ckids').val(ckids);
  25. if(isEmpty($('#ckids').val())){
  26. $('#ckids').val(1);
  27. }
  28. }
  29. function ckxxadd(){
  30. var path="/xkzsq/editmain?path=6:id="+$('#id').val()+":jyrid="+$('#jyrid').val()+"";
  31. location.href=$.app+'/ck/add?path='+path;
  32. }
  33. function ckxxview(ckid){
  34. var path="/xkzsq/editmain?path=6:id="+$('#id').val()+":jyrid="+$('#jyrid').val()+"";
  35. location.href=$.app+'/ck/view?id='+ckid+'&path='+path;
  36. }
  37. function ckxxedit(ckid){
  38. var path="/xkzsq/editmain?path=6:id="+$('#id').val()+":jyrid="+$('#jyrid').val()+"";
  39. location.href=$.app+'/ck/edit?id='+ckid+'&path='+path;
  40. }
  41. function ckxxdelete(ckid){
  42. $.confirm({
  43. title: '确认框',
  44. content: '确认删除吗',
  45. confirm: function(){
  46. $.post($.app + "/ck/delete", {
  47. id : ckid,
  48. czid:$('#id').val()
  49. }, function(data) {
  50. if (data.success) {
  51. $.alert({
  52. title: '提示',
  53. content: '操作成功',
  54. confirm: function(){
  55. $('#ckids').val('');
  56. initckxx();
  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 initckxx(){
  74. $.post($.app + "/gkjyr/ckxx", {
  75. id : $('#jyrid').val(),
  76. czid:$('#id').val()
  77. }, function(data) {
  78. if (data) {
  79. var str =""
  80. for(var i=0;i<data.length;i++){
  81. var ck = data[i];
  82. str+="<tr class='tr_bg'>";
  83. var ckids = $('#ckids').val();
  84. if(isEmpty(ckids)){
  85. if(ck.isTrue){
  86. str+="<td><input type='checkbox' checked name='ckid' onclick='clickck()' value='"+ck.id+"'/></td>";
  87. }else{
  88. str+="<td><input type='checkbox' name='ckid' onclick='clickck()' value='"+ck.id+"'/></td>";
  89. }
  90. }else{
  91. if(ckids == 1){
  92. str+="<td><input type='checkbox' name='ckid' onclick='clickck()' value='"+ck.id+"'/></td>";
  93. }else{
  94. var ckid = ckids.spilt(",");
  95. var flag = 1;
  96. for(var i = 0;i<ckid.length;i++){
  97. if(ck.id == ckid){
  98. flag = 0 ;
  99. break;
  100. }
  101. }
  102. if(flag == 0){
  103. str+="<td><input type='checkbox' checked onclick='clickck()' name='ckid' value='"+ck.id+"'/></td>";
  104. }else{
  105. str+="<td><input type='checkbox' name='ckid' onclick='clickck()' value='"+ck.id+"'/></td>";
  106. }
  107. }
  108. }
  109. str+="<td>"+ck.ckmc+"</td>";
  110. str+="<td>"+ck.ssjyrzw+"</td>";
  111. str+="<td>"+ck.ssmtzw+"</td>";
  112. str+="<td>"+ck.szgkzw+"</td>";
  113. str+="<td>"+ck.szgqzw+"</td>";
  114. str+="<td>"+ck.wxpckzw+"</td>";
  115. str+="<td>";
  116. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"ckxxview('"+ck.id+"')\"> <i class='glyphicon glyphicon-search'></i> 查看</a>";
  117. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"ckxxedit('"+ck.id+"')\"> <i class='glyphicon glyphicon-wrench'></i> 修改</a>";
  118. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"ckxxdelete('"+ck.id+"')\"> <i class='glyphicon glyphicon-trash'></i> 删除</a>";
  119. str+="</td>";
  120. str+="</tr>";
  121. }
  122. $('#ckxxdiv').empty();
  123. $('#ckxxdiv').append(str);
  124. } else {
  125. }
  126. }, "json");
  127. }
  128. </script>
  129. <a class="btn btn-default btn-sm" href="#"
  130. onclick="ckxxadd()" style="float:right;"> <i class="glyphicon glyphicon-plus"></i> 新增
  131. </a>
  132. <table class="main_table" cellpadding="0" cellspacing="0">
  133. <tr>
  134. <th width="5%"><input id="checkAllck" name="checkAllck" type="checkbox" onclick='checkedAllck()' /></th>
  135. <th width="10%">仓库名称</th>
  136. <th width="15%">港口经营人</th>
  137. <th width="15%">前沿码头名称</th>
  138. <th width="15%">所在港口</th>
  139. <th width="10%">所在港区</th>
  140. <th width="10%">是否危险品仓库</th>
  141. <th width="20%">操作</th>
  142. </tr>
  143. <tbody id="ckxxdiv"></tbody>
  144. </table>