123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- /**
- * 字典数据维护
- *
- */
- $.namespace("code.main");
- code.main.init=function(){
- //把form传入,构造翻页控件
- pageinfo($("#codeform"));
- }
- code.main.search=function(){
- $("#codeform").submit();
- }
- code.main.del=function(data){
- $.confirm({
- title: '确认框',
- content: '删除会导致子类一同被删除,确认删除吗',
- confirm: function(){
- $.post($.app + "/code/delete", {
- id : data
- }, function(data) {
- if (data.success) {
- $.alert({
- title: '提示',
- content: '删除成功',
- confirm: function(){
- $("#codeform").submit();
- }
- });
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }, "json");
- },
- cancel: function(){
-
- }
- });
- }
- code.main.showChild=function(data,pcode){
- location.href=$.app+"/codeChild/main?pid="+data+"&pcode="+pcode;
- }
- code.main.edit=function(data){
- $.post($.app + "/code/edit", {
- id : data
- }, function(data) {
- if(data){
- for(var a in data){
- if($("#edit"+a)){
- $("#edit"+a).val(data[a]);
- }
- }
- }
- }, "json");
- }
- code.main.save=function(){
- $.ajax({
- url:$.app+"/code/save",
- data:$("#addform").serialize(),
- type:"post",
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data.success) {
- $.alert({
- title: '提示',
- content: '保存成功',
- confirm: function(){
- $("#codeform").submit();
- }
- });
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
- code.main.clear=function(){
- $("#editid").val("");
- $("#editcodeName").val("");
- $("#editcodeValue").val("");
- $("#editsortno").val("");
- }
|