GroupMG.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /// <reference path="../../easyui/jquery.easyui.min.js" />
  2. jQuery.ajaxSetup({
  3. complete: function (data) {
  4. //对返回的数据data做判断,
  5. //session过期的话,就location到一个页面
  6. if (data.responseText == 'TimeOut') {
  7. //alert("登录超时,请重新登录!");
  8. top.location.href = '../Default.aspx';
  9. }
  10. }
  11. });
  12. function initAddGroup() {
  13. $("#hid_UserType").val("add");
  14. $("#txtGroupID").removeAttr("readonly");
  15. $('#txtGroupID').val("");
  16. $('#txtNames').val("");
  17. $("#lsIsLock").val("N");
  18. $("#labCreateUser2").html($("#hid_currUserNo").val());
  19. $("#labCreateDate2").html($("#hid_currTime").val());
  20. $("#txtRemark").val("");
  21. $('#winSetGroupInfo').window('open');
  22. }
  23. function myformatter(date) {
  24. var y = date.getFullYear();
  25. var m = date.getMonth() + 1;
  26. var d = date.getDate();
  27. return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
  28. }
  29. function initEditGroup(row) {
  30. $("#hid_UserType").val("modify");
  31. $("#txtGroupID").attr("readonly", "readonly");
  32. $("#txtGroupID").val(row.GroupID);
  33. $("#txtRemark").val(row.Remark);
  34. $("#txtNames").val(row.GroupNames);
  35. $("#lsIsLock").val(row.IsLock);
  36. $("#labCreateDate2").html(row.TimeCreated);
  37. $("#labCreateUser2").html(row.CreateMan);
  38. $('#winSetGroupInfo').window('open');
  39. }
  40. function submit() {
  41. if (!$('#txtGroupID').val().trim()) {
  42. $.messager.alert('提醒', '组编号不能为空', 'error');
  43. return;
  44. }
  45. if (!$('#txtNames').val().trim()) {
  46. $.messager.alert('提醒', '组名称不能为空', 'error');
  47. return;
  48. }
  49. $.post("../SystemModuleAjax/GroupEditAjax.aspx", { GroupID: $('#txtGroupID').val().trim(), type: $('#hid_UserType').val(), GroupNames: $('#txtNames').val(),
  50. remark: $('#txtRemark').val(), IsLock: $('#lsIsLock').val(), creatman: $("#labCreateUser2").html(),createTime:$("#labCreateDate2").html()
  51. }, function (msg) {
  52. if (msg == "true") {
  53. $.messager.alert('提示', '操作成功!');
  54. f_submit();
  55. $('#winSetGroupInfo').window('close');
  56. } else {
  57. $.messager.alert('提示', msg, 'error');
  58. }
  59. })
  60. }