index.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascProgress/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('lasc-progress', {
  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: '1' },
  24. { label: '社区', value: '2' },
  25. { label: '居住地', value: '3' }
  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: '1'
  39. },
  40. loading: false,
  41. exportLoading: false,
  42. tableData: [],
  43. tableHeader: [
  44. { label: '机构', prop: 'gynOrg' },
  45. { label: '筛查总人数', prop: 'total' },
  46. { label: '待评估人数', prop: 'status0' },
  47. { label: '已评估人数', prop: 'status1' },
  48. { label: '已评估且管理人数', prop: 'status2' },
  49. { label: '宫颈待完善乳腺待完善人数', prop: 'status3' },
  50. { label: '宫颈待完善乳腺完成筛查人数', prop: 'status4' },
  51. { label: '宫颈完成筛查乳腺待完善人数', prop: 'status5' }
  52. ],
  53. level: 0,
  54. visible: false,
  55. query: {},
  56. page: 1,
  57. size: 10,
  58. total: 0,
  59. messageVisible: false,
  60. messInfo: null,
  61. remind: '',
  62. dialogLoading: false,
  63. dialogExportLoading: false,
  64. statusOptions: [],
  65. rehabilitationHospital: [],
  66. archiveList: [],
  67. inviteStatus: [
  68. { value: '', label: '全部' },
  69. { value: '1', label: '门诊患者' },
  70. { value: '2', label: '出院患者' }
  71. ],
  72. communityHospitals: [],
  73. title: '',
  74. dialogVisible: false,
  75. signatoryList: []
  76. }
  77. },
  78. methods: {
  79. init() {
  80. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  81. if (selectedRole.code.indexOf('350200') > -1) {
  82. this.level = 1 // 市卫健委
  83. this.areaOptions = [
  84. { label: '厦门市', value: '' },
  85. { label: '思明区', value: '350203' },
  86. { label: '海沧区', value: '350205' },
  87. { label: '湖里区', value: '350206' },
  88. { label: '集美区', value: '350211' },
  89. { label: '同安区', value: '350212' },
  90. { label: '翔安区', value: '350213' }
  91. ]
  92. } else if (selectedRole.code.length == 6) {
  93. this.level = 2 // 区管理
  94. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  95. this.form = {
  96. range: '1',
  97. area: selectedRole.code
  98. }
  99. this.getHospital(selectedRole.code)
  100. } else {
  101. this.level = 3 // 社区管理
  102. this.rangeOptions = [
  103. { label: '社区', value: '2' },
  104. { label: '团队', value: 'team' }
  105. ]
  106. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  107. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  108. this.form = {
  109. range: '2',
  110. town: selectedRole.code.substring(0, 6),
  111. hospital: selectedRole.code
  112. }
  113. this.getTeam(selectedRole.code)
  114. }
  115. this.initTime()
  116. this.searchFn()
  117. this.hospitalsByType()
  118. },
  119. initTime() {
  120. var vm = this
  121. var now = new Date()
  122. vm.nowyear = vm.chooseYear = now.getFullYear()
  123. vm.years = []
  124. for (i = vm.nowyear; i >= 2013; i--) {
  125. vm.years.push(i)
  126. }
  127. },
  128. resetArea() {
  129. if (this.level == 1) {
  130. delete this.form.area
  131. delete this.form.hospital
  132. delete this.form.team
  133. } else if (this.level == 2) {
  134. delete this.form.hospital
  135. delete this.form.team
  136. } else {
  137. delete this.form.team
  138. }
  139. },
  140. getDictData() {
  141. var vm = this
  142. statisticAPI.getDictByDictName({ name: 'rehabilitation_status' }).then(function (res) {
  143. vm.statusOptions = [{ value: '全部', code: '' }]
  144. vm.statusOptions = vm.statusOptions.concat(res.list)
  145. })
  146. statisticAPI.getDictByDictName({ name: 'rehabilitation_hospital' }).then(function (res) {
  147. vm.rehabilitationHospital = [{ value: '全部', code: '' }]
  148. vm.rehabilitationHospital = vm.rehabilitationHospital.concat(res.list)
  149. })
  150. statisticAPI.getDictByDictName({ name: 'archive_status' }).then(function (res) {
  151. vm.archiveList = [{ value: '全部', code: '' }]
  152. vm.archiveList = vm.archiveList.concat(res.list)
  153. })
  154. },
  155. searchFn() {
  156. var vm = this
  157. this.loading = true
  158. var params = {
  159. ...this.form,
  160. page:this.page,
  161. size:this.size
  162. }
  163. vm.tableData = []
  164. if (this.chooseTime) {
  165. params.startTime = this.chooseTime[0]
  166. params.endTime = this.chooseTime[1]
  167. }
  168. httpRequest.get('doctor/twoCancers/count/twoCancerProgress', { data: params }).then(function (res) {
  169. if (res.status == 200) {
  170. vm.tableData = res.detailModelList
  171. vm.total = res.totalCount
  172. }
  173. vm.loading = false
  174. })
  175. },
  176. exportTable() {
  177. var vm = this
  178. var params = {
  179. ...this.form,
  180. page:this.page,
  181. size:this.size
  182. }
  183. if (this.chooseTime) {
  184. params.startTime = this.chooseTime[0]
  185. params.endTime = this.chooseTime[1]
  186. }
  187. this.exportLoading = true
  188. var fileName = `两癌筛查进度统计${new Date().getTime()}.xls`
  189. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportTwoCancerProgress', fileName, params).then(function () {
  190. vm.exportLoading = false
  191. })
  192. },
  193. eliminateClick() {
  194. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  195. if (this.level == 1) {
  196. this.form = {
  197. range: '1'
  198. }
  199. } else if (this.level == 2) {
  200. this.form = {
  201. range: '1',
  202. area: selectedRole.code
  203. }
  204. this.getHospital(selectedRole.code)
  205. } else {
  206. this.form = {
  207. range: '2',
  208. town: selectedRole.code.substring(0, 6),
  209. hospital: selectedRole.code
  210. }
  211. this.getTeam(selectedRole.code)
  212. }
  213. this.yearType = '1'
  214. this.chooseYear = new Date().getFullYear()
  215. this.chooseTime = null
  216. this.$forceUpdate()
  217. },
  218. getHospital(code, flag = true) {
  219. var vm = this
  220. if (flag) {
  221. delete this.form.hospital
  222. delete this.form.team
  223. }
  224. var params = {
  225. type: 5,
  226. code: code
  227. }
  228. if (!code) {
  229. vm.hospitalOptions = [{ name: '全部', value: '' }]
  230. vm.teamOptions = [{ name: '全部', value: '' }]
  231. return false
  232. }
  233. httpRequest.post('common/district', { data: params }).then(function (res) {
  234. vm.hospitalOptions = res.list
  235. })
  236. },
  237. handleCurrentChange(val) {
  238. this.page = val
  239. this.searchFn()
  240. },
  241. handleSizeChange(val) {
  242. this.size = val
  243. this.searchFn()
  244. },
  245. // 获取社区医院
  246. hospitalsByType() {
  247. var vm = this
  248. // var code
  249. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  250. if (selectedRole.code.indexOf('350200') > -1) {
  251. code = '350200' // 市卫健委
  252. } else if (selectedRole.code.length == 6) {
  253. code = selectedRole.code
  254. } else {
  255. this.level = 3 // 社区管理
  256. }
  257. if (selectedRole.code.length > 6) {
  258. this.communityHospitals = [{ label: selectedRole.name, value: selectedRole.code }]
  259. } else {
  260. var type = 1
  261. if (selectedRole.code.indexOf('350200') > -1) {
  262. type = 1 // 市卫健委
  263. } else if (selectedRole.code.length == 6) {
  264. type = 2
  265. }
  266. statisticAPI
  267. .hospitalsByType({
  268. type: type,
  269. code: selectedRole.code
  270. })
  271. .then(function (res) {
  272. if (res.status == 200) {
  273. vm.communityHospitals = [{ label: '全部', value: '' }]
  274. res.list.forEach(function (v) {
  275. vm.communityHospitals.push({
  276. value: v.code,
  277. label: v.name
  278. })
  279. })
  280. }
  281. })
  282. .catch(function (err) {
  283. console.log(err, 'Errr')
  284. })
  285. }
  286. },
  287. closeDialog() {
  288. this.visible = false
  289. },
  290. closeDialog1() {
  291. this.dialogVisible = false
  292. },
  293. getData(data) {
  294. if (data) {
  295. this.yearType = data.yearType
  296. this.form.range = data.range
  297. this.form.area = data.area
  298. this.form.hospital = data.hospital
  299. this.form.team = data.team
  300. if (this.yearType == 1) {
  301. this.chooseYear = data.time
  302. } else {
  303. this.chooseTime = data.time
  304. }
  305. if (this.form.hospital) {
  306. // 如果有社区code传过来就调社区医院列表接口
  307. this.getHospital(data.area, false)
  308. }
  309. if (this.form.team) {
  310. // 如果有团队code传过来就调团队列表接口
  311. this.getTeam(data.hospital, false)
  312. }
  313. this.searchFn()
  314. } else {
  315. this.init()
  316. }
  317. }
  318. },
  319. mounted() {
  320. this.init()
  321. }
  322. })