signup.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. $(function(){
  2. signupVM.activityid = getQueryString("id");
  3. signupVM.getDataList();
  4. });
  5. signupVM = new Vue({
  6. el: "html",
  7. data: {
  8. loading: true,
  9. dataList: "",
  10. pageSize: "",
  11. pageNumber: "",
  12. pageCount: "",
  13. rowCount: "",
  14. activityid: ""
  15. },
  16. computed: {
  17. },
  18. ready: function () {
  19. this.pageNumber = 1;
  20. this.pageSize = 10;
  21. },
  22. methods: {
  23. getDataList: function(){
  24. var _self = this;
  25. $.ajax({
  26. url: baseConfig.URL.signupList,
  27. type: "get",
  28. data:{
  29. "activityid": _self.activityid,
  30. "selectName": $.trim($("#selectName").val()),
  31. "pageSize": _self.pageSize,
  32. "pageNo": _self.pageNumber
  33. },
  34. cache: false,
  35. success:function (res) {
  36. console.log(res);
  37. _self.dataList = res.info;
  38. _self.pageCount = res.pageCount;
  39. _self.rowCount = res.count;
  40. FenYe(_self.rowCount, _self.pageNumber, _self.pageSize, "pageList", "page");
  41. },
  42. complete:function (XHR, TS) {
  43. },
  44. error:function (XMLHttpRequest, textStatus, errorThrown) {
  45. alert(textStatus);
  46. }
  47. });
  48. }
  49. }
  50. });
  51. function pageOnKeydown(obj, event){
  52. $(obj).val($(obj).val().replace(/\D/g, ''));
  53. if(event.keyCode == "13"){
  54. pageList($(obj).val());
  55. }
  56. }
  57. function pageList(objPage){
  58. if(objPage > signupVM.pageCount){
  59. signupVM.pageNumber = signupVM.pageCount;
  60. } else{
  61. signupVM.pageNumber = objPage;
  62. }
  63. $("#pageShowNumber").val(signupVM.pageNumber);
  64. signupVM.getDataList();
  65. }
  66. function toDetail(id){
  67. window.open("detail.html?id=" + id + "&activityId=" + signupVM.activityid);
  68. }
  69. function toDownloadFile(id){
  70. window.location = baseConfig.URL.signupDownload + "?id=" + id;
  71. }
  72. function getQueryString(name) {
  73. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  74. var r = window.location.search.substr(1).match(reg);
  75. if (r != null) return unescape(r[2]); return null;
  76. }