12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- $.namespace("ax.main");
- ax.main.lyztDate = null;
- ax.main.lyzt = null;
- ax.main.init=function(){
- //把form传入,构造翻页控件
- pageinfo($("#axform"));
- };
- ax.main.search=function(){
- $('#pagejump').val(1);
- $("#axform").submit();
- };
- ax.main.del=function(data){
- $.confirm({
- title: '确认框',
- content: '确认删除吗',
- confirm: function(){
- $.post($.app + "/ax/delete", {
- id : data
- }, function(data) {
- if (data.success) {
- $.alert({
- title: '提示',
- content: '删除成功',
- confirm: function(){
- $("#axform").submit();
- }
- });
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }, "json");
- },
- cancel: function(){
-
- }
- });
- }
- ax.main.edit=function(data){
- location.href=$.app+"/ax/edit?id="+data;
- }
- ax.main.view=function(data){
- location.href=$.app+"/ax/view?id="+data;
- }
- /**
- * 弹出新增页面
- * */
- ax.main.add=function(){
- location.href=$.app+"/ax/add";
- }
- ax.main.initLyztSel=function(width){
- var str = "";
- str+="<select class='selectpicker' name='lyztid' id='lyztid' >";
- str+="<option></option>";
- if(ax.main.lyztDate){
- var x=$.parseJSON(ax.main.lyztDate);
- for(var i=0;i<x.length;i++){
- var select = x[i];
- if(ax.main.lyzt == select.id){
- str+=" <option selected value='"+select.id+"' >"+select.text+"</option>";
- }else{
- str+=" <option value='"+select.id+"' >"+select.text+"</option>";
- }
-
- }
- }
- str+="</select>";
- $("#lyztDiv").empty();
- $("#lyztDiv").append(str);
- $('.selectpicker').selectpicker({
- width:width
- });
- };
|