index.js 6.1 KB

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