首页 > 代码库 > ajax提交

ajax提交

ajax提交


 
 //初始化加载档案列表信息
   $(function(){
	  loadAccount();
  }); 
 
   function loadAccount(){
	   var account = {};
	   account.accountName = $("#queryEmpCode").val();
	   account.name = $("#queryName").val();
	    	 $.ajax({
	             type: "post",
	             url: "<%=context%>/rest/account/accountManage",
	             data: account,
	             dataType: "json",
	             success: function(result){
	            	 $("#tb_account").bootstrapTable("destroy");
	            	 $("#tb_account").bootstrapTable({
	            			data:result,
	            			idField: "accountId",
	            			pagination: true,
	            	        pageSize: 15,
	            	        checkboxHeader:true,
	            			columns:[
	            			    {
	            			        field: "accountId",
	            			        title: "主键",
	            			        class: "col-sm-3",
	            			        visible: false
	            			    },
	            			    {
	            	              field: "empId",
	            	              title: "员工ID",
	            	              class: "col-sm-2",
	            	              visible: false
	            	          },
	            	          {
	            				    field: "accountName",
	            					title: "工号",
	            					class: "col-sm-2"
	            				},
	            	          {
	            	              field: "name",
	            	              title: "姓名",
	            	              class: "col-sm-2",
	            	          },
	            	          {
	            	              field: "accountStatus",
	            	              title: "账户状态",
	            	              class: "col-sm-3",
	            	              formatter: function(value) {
	            	           	   return accountStatus[value];
	            	             	}
	            	          },
	            	          {
	            	              field: "isWechartPucn",
	            	              title: "是否开启微信打卡",
	            	              class: "col-sm-3",
	            	              formatter: function(value) {
	            	           	    return isWechartPunch[value];
	            	              }
	            	          },
	            			   {
	            			    	field: "createTimeStr",
	            			    	title: "创建时间",
	            			    	class: "col-sm-2",
	            			   },
	            	          {
	            	          	title: "操作",
	            	          	class: "col-sm-1",
	            	          	formatter: function(value, row, index) {
	            	          		return ‘<button data-bindfunction="resetPassword" class="btn btn-primary btn-xs" data-rowid="‘ + row.empId +‘">重置密码</button>‘
	            	          		    +‘&nbsp;<button data-bindfunction="modifyStatus" class="btn btn-danger btn-xs"  data-rowid="‘ + row.empId +‘" data-status="‘+row.accountStatus+‘" data-isWechartPucn="‘+row.isWechartPucn+‘">修改</button>‘;
	            	          	}
	            	          }
	            			]
	            		});
	            	 
	                }
	          });
	     }







本文出自 “JianBo” 博客,转载请与作者联系!

ajax提交