123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <script type="text/javascript">
- function checkedAllzxjx(){
- if($('#checkAllzxjx').prop("checked")){
- $("input[name='zxjxid']").each(function() {
- $(this).prop("checked", true);
- });
- }else{
- $("input[name='zxjxid']").each(function() {
- $(this).prop("checked", false);
- });
- }
- clickzxjx();
- }
- function clickzxjx(){
- var objName= document.getElementsByName("zxjxid");
- var zxjxids = [];
- for (i=0; i<objName.length; i++){
- if (objName[i].type=="checkbox" && objName[i].checked){
- zxjxids.push(objName[i].value)
- }
- }
- $('#zxjxids').val(zxjxids);
- if(isEmpty($('#zxjxids').val())){
- $('#zxjxids').val(1);
- }
- }
- function zxjxxxadd(){
- var path="/xkzsq/addmain?path=11:id="+$('#jyrid').val()+"";
- location.href=$.app+'/zxjx/add?path='+path;
- }
- function zxjxxxview(zxjxid){
- var path="/xkzsq/addmain?path=11:id="+$('#jyrid').val()+"";
- location.href=$.app+'/zxjx/view?id='+zxjxid+'&path='+path;
- }
- function zxjxxxedit(zxjxid){
- var path="/xkzsq/addmain?path=11:id="+$('#jyrid').val()+"";
- location.href=$.app+'/zxjx/edit?id='+zxjxid+'&path='+path;
- }
- function zxjxxxdelete(zxjxid){
- $.confirm({
- title: '确认框',
- content: '确认删除吗',
- confirm: function(){
- $.post($.app + "/zxjx/delete", {
- id : zxjxid,
- czid:$('#id').val()
- }, function(data) {
- if (data.success) {
- $.alert({
- title: '提示',
- content: '操作成功',
- confirm: function(){
- $('#zxjxids').val('');
- initzxjxxx();
- }
- });
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }, "json");
- },
- cancel: function(){
-
- }
- });
- }
- function initzxjxxx(){
- $.post($.app + "/gkjyr/zxjxxx", {
- id : $('#jyrid').val()
- }, function(data) {
- if (data) {
- var str =""
- for(var i=0;i<data.length;i++){
- var zxjx = data[i];
- str+="<tr class='tr_bg'>";
- var zxjxids = $('#zxjxids').val();
- if(isEmpty(zxjxids)){
- if(zxjx.isTrue){
- str+="<td><input type='checkbox' checked name='zxjxid' value='"+zxjx.id+"'/></td>";
- }else{
- str+="<td><input type='checkbox' checked name='zxjxid' value='"+zxjx.id+"'/></td>";
- }
- }else{
- if(zxjxids == 1){
- str+="<td><input type='checkbox' checked name='zxjxid' onclick='clickzxjx()' value='"+zxjx.id+"'/></td>";
- }else{
- var zxjxid = zxjxids.spilt(",");
- var flag = 1;
- for(var i = 0;i<zxjxid.length;i++){
- if(zxjx.id == zxjxid){
- flag = 0 ;
- break;
- }
- }
- if(flag == 0){
- str+="<td><input type='checkbox' checked name='zxjxid' value='"+zxjx.id+"'/></td>";
- }else{
- str+="<td><input type='checkbox' checked name='zxjxid' value='"+zxjx.id+"'/></td>";
- }
- }
- }
- str+="<td>"+zxjx.jxlbmczw+"</td>";
- str+="<td>"+zxjx.ssjyrzw+"</td>";
- str+="<td>"+zxjx.xhhgg+"</td>";
- str+="<td>"+zxjx.jxsl+"</td>";
- str+="<td>"+zxjx.syqzw+"</td>";
- str+="<td>";
- str+="<a class='btn btn-default btn-xs' href='#' onclick=\"zxjxxxview('"+zxjx.id+"')\"> <i class='glyphicon glyphicon-search'></i> 查看</a>";
- str+="<a class='btn btn-default btn-xs' href='#' onclick=\"zxjxxxedit('"+zxjx.id+"')\"> <i class='glyphicon glyphicon-wrench'></i> 修改</a>";
- str+="<a class='btn btn-default btn-xs' href='#' onclick=\"zxjxxxdelete('"+zxjx.id+"')\"> <i class='glyphicon glyphicon-trash'></i> 删除</a>";
- str+="</td>";
- str+="</tr>";
- }
- $('#zxjxxxdiv').empty();
- $('#zxjxxxdiv').append(str);
- } else {
-
- }
- }, "json");
- }
- </script>
- <a class="btn btn-default btn-sm" href="#"
- onclick="zxjxxxadd()" style="float:right;"> <i class="glyphicon glyphicon-plus"></i> 新增
- </a>
- <table class="main_table" cellpadding="0" cellspacing="0">
-
- <tr>
- <th width="10%"><input id="checkAllzxjx" name="checkAllzxjx" type="checkbox" onclick='checkedAllzxjx()' /></th>
- <th width="15%">机械类别名称</th>
- <th width="15%">港口经营人</th>
- <th width="15%">型号或规格</th>
- <th width="15%">机械数量</th>
- <th width="15%">所有权</th>
- <th width="20%">操作</th>
- </tr>
- <tbody id="zxjxxxdiv"></tbody>
- </table>
|