follow-up.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 userAgent = JSON.parse(localStorage.getItem(httpRequest.agentName))
  16. var data = {
  17. doctor: userAgent.uid,
  18. patient:vm.patient,
  19. teamCode:vm.teamCode,
  20. page:page,
  21. pagesize:10}
  22. recordAPI.followUpList(data).then(function(res){
  23. if(res.status==200){
  24. if(res.data.length>0){
  25. vm.list=res.data;
  26. //初始赋总数
  27. if(page == 1){
  28. vm.total = Math.ceil(res.data[0].total/10);
  29. }
  30. $(".followup-list").animate({scrollTop:0},0);//滚回顶部
  31. $(".slimScrollBar").css('top',0);
  32. }else{
  33. top.toastr.info("没有更多内容了");
  34. }
  35. }else{
  36. top.toastr.error(res.msg);
  37. }
  38. })
  39. }
  40. }
  41. },
  42. mounted: function (){
  43. this.patient = localStorage.getItem("severPatientCode");
  44. this.teamCode = JSON.parse(localStorage.getItem("severPatientTeam")).id;
  45. this.msgListView(this.currentPage);
  46. },
  47. })