123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- /**
- *角色管理
- *
- */
- $.namespace("ggxx.main");
- ggxx.main.init=function(){
- //把form传入,构造翻页控件
- pageinfo($("#ggxxform"));
- }
- ggxx.main.search=function(){
- $('#pagejump').val(1);
- $("#ggxxform").submit();
- }
- ggxx.main.del=function(data){
- $.confirm({
- title: '确认框',
- content: '确认删除吗',
- confirm: function(){
- $.post($.app + "/ggxx/delete", {
- id : data
- }, function(data) {
- if (data.success) {
- $.alert({
- title: '提示',
- content: '操作成功',
- confirm: function(){
- $("#ggxxform").submit();
- }
- });
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }, "json");
- },
- cancel: function(){
-
- }
- });
- }
- ggxx.main.edit=function(data){
- location.href=$.app+"/ggxx/edit?id="+data;
- }
- ggxx.main.view=function(data){
- location.href=$.app+"/ggxx/view?id="+data;
- }
- ggxx.main.detail = function(data){
- location.href=$.app+"/ggxx/ggxxDetail?id="+data;
- }
- /**
- * 弹出新增页面
- * */
- ggxx.main.add=function(){
- location.href=$.app+"/ggxx/add";
- }
- ggxx.main.initGglx=function(divid, existVal){
- $.post($.app + "/ggxx/selectGglx", {
-
- }, function(data) {
- if (data) {
- var str = "";
- str+="<select class='gglxselectpicker' name='gglxid' >";
- str+="<option selected='selected' value=''>全部</option>";
- for(var i=0;i<data.length;i++){
- var gglx = data[i];
- if(gglx.id==existVal){
- str+=" <option selected='selected' value='"+gglx.id+"' >"+gglx.text+"</option>";
- }else{
- str+=" <option value='"+gglx.id+"' >"+gglx.text+"</option>";
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
-
- $('.gglxselectpicker').selectpicker({
- width:'80%'
- });
- } else {
-
- }
- }, "json");
- }
|