qytzxxadd.jsp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <script type="text/javascript">
  4. function checkedAllqytz(){
  5. if($('#checkAllqytz').prop("checked")){
  6. $("input[name='qytzid']").each(function() {
  7. $(this).prop("checked", true);
  8. });
  9. }else{
  10. $("input[name='qytzid']").each(function() {
  11. $(this).prop("checked", false);
  12. });
  13. }
  14. clickqytz();
  15. }
  16. function clickqytz(){
  17. var objName= document.getElementsByName("qytzid");
  18. var qytzids = [];
  19. for (i=0; i<objName.length; i++){
  20. if (objName[i].type=="checkbox" && objName[i].checked){
  21. qytzids.push(objName[i].value)
  22. }
  23. }
  24. $('#qytzids').val(qytzids);
  25. if(isEmpty($('#qytzids').val())){
  26. $('#qytzids').val(1);
  27. }
  28. }
  29. function qytzxxadd(){
  30. var path="/xkzsq/addmain?path=10:id="+$('#jyrid').val()+"";
  31. location.href=$.app+'/qytz/add?path='+path;
  32. }
  33. function qytzxxview(qytzid){
  34. var path="/xkzsq/addmain?path=10:id="+$('#jyrid').val()+"";
  35. location.href=$.app+'/qytz/view?id='+qytzid+'&path='+path;
  36. }
  37. function qytzxxedit(qytzid){
  38. var path="/xkzsq/addmain?path=10:id="+$('#jyrid').val()+"";
  39. location.href=$.app+'/qytz/edit?id='+qytzid+'&path='+path;
  40. }
  41. function qytzxxdelete(qytzid){
  42. $.confirm({
  43. title: '确认框',
  44. content: '确认删除吗',
  45. confirm: function(){
  46. $.post($.app + "/qytz/delete", {
  47. id : qytzid,
  48. czid:$('#id').val()
  49. }, function(data) {
  50. if (data.success) {
  51. $.alert({
  52. title: '提示',
  53. content: '操作成功',
  54. confirm: function(){
  55. $('#qytzids').val('');
  56. initqytzxx();
  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 initqytzxx(){
  74. $.post($.app + "/gkjyr/qytzxx", {
  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 qytz = data[i];
  82. str+="<tr class='tr_bg'>";
  83. var qytzids = $('#qytzids').val();
  84. if(isEmpty(qytzids)){
  85. if(qytz.isTrue){
  86. str+="<td><input type='checkbox' checked name='qytzid' onclick='clickqytz()' value='"+qytz.id+"'/></td>";
  87. }else{
  88. str+="<td><input type='checkbox' checked name='qytzid' onclick='clickqytz()' value='"+qytz.id+"'/></td>";
  89. }
  90. }else{
  91. if(qytzids == 1){
  92. str+="<td><input type='checkbox' checked name='qytzid' onclick='clickqytz()' value='"+qytz.id+"'/></td>";
  93. }else{
  94. var qytzid = qytzids.spilt(",");
  95. var flag = 1;
  96. for(var i = 0;i<qytzid.length;i++){
  97. if(qytz.id == qytzid){
  98. flag = 0 ;
  99. break;
  100. }
  101. }
  102. if(flag == 0){
  103. str+="<td><input type='checkbox' checked onclick='clickqytz()' name='qytzid' value='"+qytz.id+"'/></td>";
  104. }else{
  105. str+="<td><input type='checkbox' checked name='qytzid' onclick='clickqytz()' value='"+qytz.id+"'/></td>";
  106. }
  107. }
  108. }
  109. str+="<td>"+qytz.tzrmc+"</td>";
  110. str+="<td>"+(qytz.je==null?"":qytz.je)+"</td>";
  111. str+="<td>"+(qytz.jedw==null?"":qytz.jedw)+"</td>";
  112. str+="<td>"+qytz.ssjyrzw+"</td>";
  113. str+="<td>"+(qytz.tzzje==null?'':qytz.tzzje)+"</td>";
  114. str+="<td>"+(qytz.tzje==null?'':qytz.tzje)+"</td>";
  115. str+="<td>"+qytz.sfwszw+"</td>";
  116. str+="<td>";
  117. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"qytzxxview('"+qytz.id+"')\"> <i class='glyphicon glyphicon-search'></i> 查看</a>";
  118. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"qytzxxedit('"+qytz.id+"')\"> <i class='glyphicon glyphicon-wrench'></i> 修改</a>";
  119. str+="<a class='btn btn-default btn-xs' href='#' onclick=\"qytzxxdelete('"+qytz.id+"')\"> <i class='glyphicon glyphicon-trash'></i> 删除</a>";
  120. str+="</td>";
  121. str+="</tr>";
  122. }
  123. $('#qytzxxdiv').empty();
  124. $('#qytzxxdiv').append(str);
  125. } else {
  126. }
  127. }, "json");
  128. }
  129. </script>
  130. <a class="btn btn-default btn-sm" href="#"
  131. onclick="qytzxxadd()" 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="5%"><input id="checkAllqytz" name="checkAllqytz" type="checkbox" onclick='checkedAllqytz()' /></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="10%">是否外商</th>
  143. <th width="25%">操作</th>
  144. </tr>
  145. <tbody id="qytzxxdiv"></tbody>
  146. </table>