follow-up.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. new Vue({
  2. el: '#app',
  3. data: {
  4. total:'',//总页数
  5. currentPage:1,//当前页数
  6. list:[],//列表集合
  7. patient:null,
  8. teamCode:null
  9. },
  10. methods:{
  11. msgListView: function(page){
  12. var vm=this;
  13. if(page){
  14. vm.currentPage=page;
  15. var data = {
  16. patient:vm.patient,
  17. teamCode:vm.teamCode,
  18. page:page,
  19. pagesize:10}
  20. recordAPI.followUpList(data).then(function(res){
  21. if(res.status==200){
  22. if(res.data.length>0){
  23. vm.list=res.data;
  24. //初始赋总数
  25. if(page == 1){
  26. vm.total = Math.ceil(res.data[0].total/10);
  27. }
  28. $(".followup-list").animate({scrollTop:0},0);//滚回顶部
  29. $(".slimScrollBar").css('top',0);
  30. }else{
  31. top.toastr.info("没有更多内容了");
  32. }
  33. }else{
  34. top.toastr.error(res.msg);
  35. }
  36. })
  37. }
  38. }
  39. },
  40. mounted: function (){
  41. this.patient = localStorage.getItem("severPatientCode");
  42. this.teamCode = JSON.parse(localStorage.getItem("severPatientTeam")).id;
  43. this.msgListView(this.currentPage);
  44. },
  45. })