index.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. var template = ''
  2. $.ajax('../../../component/statistics/XiaoXiMx/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('xx-situation', {
  14. template: template,
  15. props: [],
  16. data: function() {
  17. return {
  18. years: [],
  19. yearType: '1',
  20. chooseYear: null,
  21. chooseTime: null,
  22. rangeOptions: [{ label: '区', value: 'town' }, { label: '医院', value: 'hospital' }, { label: '团队', value: 'team' }],
  23. areaOptions: [
  24. { label: '思明区', value: '350203' },
  25. { label: '海沧区', value: '350205' },
  26. { label: '湖里区', value: '350206' },
  27. { label: '集美区', value: '350211' },
  28. { label: '同安区', value: '350212' },
  29. { label: '翔安区', value: '350213' }
  30. ],
  31. hospitalOptions: [],
  32. teamOptions: [],
  33. form: {
  34. range: 'town'
  35. },
  36. loading: false,
  37. exportLoading: false,
  38. tableData: [],
  39. tableHeader: [
  40. { label: '患者姓名', prop: 'patientName', width: '110' },
  41. { label: '身份证号', prop: 'idcard', width: '110' },
  42. { label: '签约医院', prop: 'hospitalName', width: '180' },
  43. { label: '签约医生', prop: 'doctorName', width: '110' },
  44. { label: '提醒类型', prop: 'typeName', width: '110' },
  45. { label: '消息推送时间', prop: 'createTime', width: '110' },
  46. { label: '出院下转时间', prop: 'turnTime', width: '110' },
  47. { label: '消息推送人', prop: 'senderName', width: '110' }
  48. ],
  49. page: 1,
  50. size: 10,
  51. total: 0,
  52. level: 0,
  53. messageVisible: false,
  54. messTxt: '',
  55. paramsObj: {
  56. name: '',
  57. type: '',
  58. signDoctorName: '',
  59. hospitalName: ''
  60. }
  61. }
  62. },
  63. methods: {
  64. closeMessageDialog() {
  65. this.messageVisible = false
  66. },
  67. init() {
  68. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  69. if (selectedRole.code.indexOf('350200') > -1) {
  70. this.level = 1 // 市卫健委
  71. this.areaOptions = [
  72. { label: '思明区', value: '350203' },
  73. { label: '海沧区', value: '350205' },
  74. { label: '湖里区', value: '350206' },
  75. { label: '集美区', value: '350211' },
  76. { label: '同安区', value: '350212' },
  77. { label: '翔安区', value: '350213' }
  78. ]
  79. } else if (selectedRole.code.length == 6) {
  80. this.level = 2 // 区管理
  81. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  82. this.form = {
  83. range: 'town',
  84. area: selectedRole.code
  85. }
  86. this.getHospital(selectedRole.code)
  87. } else {
  88. this.level = 3 // 社区管理
  89. this.rangeOptions = [{ label: '医院', value: 'hospital' }, { label: '团队', value: 'team' }]
  90. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  91. this.hospital = [{ label: selectedRole.name, value: selectedRole.code }]
  92. this.form = {
  93. range: 'hospital',
  94. area: selectedRole.code.substring(0, 6),
  95. hospital: selectedRole.code
  96. }
  97. this.getTeam(selectedRole.code)
  98. }
  99. this.initTime()
  100. this.getList()
  101. },
  102. initTime() {
  103. var vm = this
  104. var now = new Date()
  105. vm.nowyear = vm.chooseYear = now.getFullYear()
  106. vm.years = []
  107. for (i = vm.nowyear; i >= 2013; i--) {
  108. vm.years.push(i)
  109. }
  110. },
  111. resetArea() {
  112. if (this.level == 1) {
  113. delete this.form.area
  114. delete this.form.hospital
  115. delete this.form.team
  116. } else if (this.level == 2) {
  117. delete this.form.hospital
  118. delete this.form.team
  119. } else {
  120. delete this.form.team
  121. }
  122. },
  123. getList() {
  124. var vm = this
  125. this.loading = true
  126. var params = {
  127. ...this.paramsObj,
  128. page: this.page,
  129. size: this.size
  130. }
  131. if (this.yearType == '1') {
  132. params.startTime = this.chooseYear + '-01-01' + ' 00:00:00'
  133. params.endTime = this.chooseYear + '-12-31' + ' 11:59:59'
  134. } else {
  135. if (this.chooseTime) {
  136. params.startTime = this.chooseTime[0] + ' 00:00:00'
  137. params.endTime = this.chooseTime[1] + ' 11:59:59'
  138. }
  139. }
  140. httpRequest.get('statistics/collaborate/selectSmsInfoList', { data: params }).then(function(res) {
  141. if (res.status == 200) {
  142. vm.tableData = res.detailModelList
  143. vm.total = res.totalCount
  144. }
  145. vm.loading = false
  146. })
  147. },
  148. queryDate() {
  149. this.page = 1
  150. this.getList()
  151. },
  152. exportTable() {
  153. var vm = this
  154. var params = {
  155. ...this.paramsObj
  156. }
  157. if (this.yearType == '1') {
  158. params.startDate = this.chooseYear + '-01-01 00:00'
  159. params.endDate = this.chooseYear + '-12-31 23:59'
  160. } else {
  161. if (this.chooseTime) {
  162. params.startDate = this.chooseTime[0] + ' 00:00'
  163. params.endDate = this.chooseTime[1] + ' 23:59'
  164. }
  165. }
  166. this.exportLoading = true
  167. var fileName = `消息推送明细.xls`
  168. httpRequest.downLoadFileForAjax('statistics/collaborate/exportSelectSmsInfoList', fileName, params).then(function() {
  169. vm.exportLoading = false
  170. })
  171. },
  172. showInfo(item) {
  173. this.messTxt = item.content
  174. this.messageVisible = true
  175. },
  176. eliminateClick() {
  177. this.resetArea()
  178. this.yearType = '1'
  179. this.paramsObj = {
  180. name: '',
  181. type: '',
  182. signDoctorName: '',
  183. hospitalName: ''
  184. }
  185. this.chooseYear = new Date().getFullYear()
  186. this.chooseTime = null
  187. this.$forceUpdate()
  188. },
  189. getHospital(code) {
  190. var vm = this
  191. delete this.form.hospital
  192. delete this.form.team
  193. var params = {
  194. type: 5,
  195. code: code
  196. }
  197. httpRequest.post('common/district', { data: params }).then(function(res) {
  198. vm.hospitalOptions = res.list
  199. })
  200. },
  201. getTeam(code) {
  202. var vm = this
  203. delete this.form.team
  204. var params = {
  205. hospital: code
  206. }
  207. httpRequest.get('statisticsExport/teamList', { data: params }).then(function(res) {
  208. vm.teamOptions = res.data
  209. })
  210. },
  211. handleCurrentChange(val) {
  212. this.page = val
  213. this.getList()
  214. },
  215. handleSizeChange(val) {
  216. this.size = val
  217. this.getList()
  218. }
  219. },
  220. mounted() {
  221. this.init()
  222. }
  223. })