index.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. var template = ''
  2. $.ajax('../../../component/statistics/CallRecord/index.html', {
  3. data: {},
  4. dataType: 'html',
  5. cache: false,
  6. timeout: 60000,
  7. async: false,
  8. error: function (res) {},
  9. success: function (res) {
  10. template = res
  11. }
  12. })
  13. Vue.component('call-record', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. chooseTime: null,
  19. form: {},
  20. tableData: [],
  21. tableHeader: [
  22. { label: '报警人', prop: 'doctorName' },
  23. { label: '手机号码', prop: 'phone' },
  24. { label: '报警时间', prop: 'createTime' },
  25. { label: '业务来源', prop: 'typeName' },
  26. { label: '患者姓名', prop: 'patientName' },
  27. { label: '身份证号', prop: 'idcard' },
  28. { label: '联系电话', prop: 'mobile' },
  29. { label: '家庭住址', prop: 'address' }
  30. ],
  31. page: 1,
  32. size: 10,
  33. total: 0,
  34. loading: false,
  35. exportLoading: false
  36. }
  37. },
  38. methods: {
  39. queryDate() {
  40. this.page = 1
  41. this.getList()
  42. },
  43. exportTable() {
  44. var vm = this
  45. var params = {
  46. ...this.form,
  47. page: this.page,
  48. pageSize: this.size
  49. }
  50. if (this.chooseTime) {
  51. params.startDate = this.chooseTime[0]
  52. params.endDate = this.chooseTime[1]
  53. }
  54. this.exportLoading = true
  55. var fileName = `报警记录${new Date().getTime()}.xls`
  56. httpRequest.downLoadFileForAjax('doctor/familyBed/exportCallRecordPage', fileName, params).then(function(){
  57. vm.exportLoading = false
  58. })
  59. },
  60. eliminateClick() {
  61. this.form = {}
  62. this.chooseTime = null
  63. },
  64. getList() {
  65. var vm = this
  66. this.loading = true
  67. var params = {
  68. ...this.form,
  69. page: this.page,
  70. pageSize: this.size
  71. }
  72. if (this.chooseTime) {
  73. params.startDate = this.chooseTime[0]
  74. params.endDate = this.chooseTime[1]
  75. }
  76. httpRequest.get('doctor/familyBed/callRecordPage', { data: params }).then(function (res) {
  77. if(res.status == 200){
  78. vm.tableData = res.detailModelList
  79. vm.total = res.totalCount
  80. }
  81. vm.loading = false
  82. })
  83. },
  84. handleCurrentChange(val) {
  85. this.page = val
  86. this.getList()
  87. },
  88. handleSizeChange(val) {
  89. this.size = val
  90. this.getList()
  91. }
  92. },
  93. mounted() {
  94. this.getList()
  95. }
  96. })