123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- /**
- *港区
- *
- */
- $.namespace("gq.main");
- gq.main.init=function(){
- //把form传入,构造翻页控件
- pageinfo($("#gqform"));
- }
- function initSzdSelect(divid,existVal,changefunc,width){
- $.post($.app + "/selectSzd", {
-
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='szdselectpicker' name='szd' onchange='"+changefunc+"()' id='szd'>";
- }else{
- str+="<select class='szdselectpicker' name='szd' id='szd'>";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var szd = data[i];
- if(szd.val==existVal){
- str+=" <option selected='selected' value='"+szd.id+"' >"+szd.text+"</option>";
- }else{
- str+=" <option value='"+szd.id+"' >"+szd.text+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
-
- $('.szdselectpicker').selectpicker({
- width:width
- });
-
- }, "json");
- }
- function initGlbmSelect(divid,existVal,szd,changefunc,width){
- $.post($.app + "/xzglbm/selectGlbm", {
- szd:szd
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='Glbmselectpicker' name='ssgkglbm' onchange='"+changefunc+"()' id='ssgkglbm'>";
- }else{
- str+="<select class='Glbmselectpicker' name='ssgkglbm' id='ssgkglbm'>";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var szgkglbm = data[i];
- if(szgkglbm.id==existVal){
- str+=" <option selected='selected' value='"+szgkglbm.id+"' >"+szgkglbm.gkglbmqc+"</option>";
- }else{
- str+=" <option value='"+szgkglbm.id+"' >"+szgkglbm.gkglbmqc+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.Glbmselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- gq.main.search=function(){
- $('#pagejump').val(1);
- $("#gqform").submit();
- }
- gq.main.del=function(data){
- $.confirm({
- title: '确认框',
- content: '确认删除吗',
- confirm: function(){
- $.post($.app + "/gq/delete", {
- id : data
- }, function(data) {
- if (data.success) {
- $.alert({
- title: '提示',
- content: '操作成功',
- confirm: function(){
- $("#gqform").submit();
- }
- });
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }, "json");
- },
- cancel: function(){
-
- }
- });
- }
- gq.main.edit=function(data){
- location.href=$.app+"/gq/edit?id="+data;
- }
- gq.main.view=function(data){
- location.href=$.app+"/gq/view?id="+data;
- }
- /**
- * 弹出新增页面
- * */
- gq.main.add=function(){
- location.href=$.app+"/gq/add";
- }
|