index.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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. },
  60. dialogHeader: [
  61. { label: '居民姓名', prop: 'name', width: '100' },
  62. { label: '证件号码', prop: 'idcard', width: '100' },
  63. { label: '手机号', prop: 'mobile', width: '110' },
  64. { label: '年龄', prop: 'age', width: '90' },
  65. { label: '出生日期', prop: 'birthday', width: '90' },
  66. { label: '常驻地址', prop: 'address', width: '100' },
  67. { label: '个人筛查状态', prop: 'statusName', width: '100' }
  68. ],
  69. currentEditData: '',
  70. serviceRecordVisable: false,
  71. page: 1,
  72. size: 10,
  73. total: 0,
  74. messageVisible: false,
  75. messInfo: null,
  76. remind: '',
  77. dialogLoading: false,
  78. dialogExportLoading: false,
  79. statusOptions: [],
  80. rehabilitationHospital: [],
  81. archiveList: [],
  82. inviteStatus: [
  83. { value: '', label: '全部' },
  84. { value: '1', label: '门诊患者' },
  85. { value: '2', label: '出院患者' }
  86. ],
  87. communityHospitals: [],
  88. title: '',
  89. dialogVisible: false,
  90. signatoryList: [],
  91. dialogTableData: []
  92. }
  93. },
  94. methods: {
  95. back() {
  96. this.currentEditData = ''
  97. this.serviceRecordVisable = false
  98. },
  99. init() {
  100. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  101. if (selectedRole.code.indexOf('350200') > -1) {
  102. this.level = 1 // 市卫健委
  103. this.areaOptions = [
  104. { label: '厦门市', value: '' },
  105. { label: '思明区', value: '350203' },
  106. { label: '海沧区', value: '350205' },
  107. { label: '湖里区', value: '350206' },
  108. { label: '集美区', value: '350211' },
  109. { label: '同安区', value: '350212' },
  110. { label: '翔安区', value: '350213' }
  111. ]
  112. } else if (selectedRole.code.length == 6) {
  113. this.level = 2 // 区管理
  114. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  115. this.form = {
  116. range: '1',
  117. area: selectedRole.code
  118. }
  119. this.getHospital(selectedRole.code)
  120. } else {
  121. this.level = 3 // 社区管理
  122. this.rangeOptions = [
  123. { label: '社区', value: '2' },
  124. { label: '团队', value: 'team' }
  125. ]
  126. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  127. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  128. this.form = {
  129. range: '2',
  130. town: selectedRole.code.substring(0, 6),
  131. hospital: selectedRole.code
  132. }
  133. this.getTeam(selectedRole.code)
  134. }
  135. this.initTime()
  136. this.searchFn()
  137. this.hospitalsByType()
  138. },
  139. gotoService(item) {
  140. this.currentEditData = item.patient
  141. this.serviceRecordVisable = true
  142. },
  143. initTime() {
  144. var vm = this
  145. var now = new Date()
  146. vm.nowyear = vm.chooseYear = now.getFullYear()
  147. vm.years = []
  148. for (i = vm.nowyear; i >= 2013; i--) {
  149. vm.years.push(i)
  150. }
  151. },
  152. resetArea() {
  153. if (this.level == 1) {
  154. delete this.form.area
  155. delete this.form.hospital
  156. delete this.form.team
  157. } else if (this.level == 2) {
  158. delete this.form.hospital
  159. delete this.form.team
  160. } else {
  161. delete this.form.team
  162. }
  163. },
  164. getDictData() {
  165. var vm = this
  166. statisticAPI.getDictByDictName({ name: 'rehabilitation_status' }).then(function (res) {
  167. vm.statusOptions = [{ value: '全部', code: '' }]
  168. vm.statusOptions = vm.statusOptions.concat(res.list)
  169. })
  170. statisticAPI.getDictByDictName({ name: 'rehabilitation_hospital' }).then(function (res) {
  171. vm.rehabilitationHospital = [{ value: '全部', code: '' }]
  172. vm.rehabilitationHospital = vm.rehabilitationHospital.concat(res.list)
  173. })
  174. statisticAPI.getDictByDictName({ name: 'archive_status' }).then(function (res) {
  175. vm.archiveList = [{ value: '全部', code: '' }]
  176. vm.archiveList = vm.archiveList.concat(res.list)
  177. })
  178. },
  179. searchFn() {
  180. var vm = this
  181. this.loading = true
  182. var params = {
  183. ...this.form,
  184. page: this.page,
  185. size: this.size
  186. }
  187. vm.tableData = []
  188. if (this.chooseTime) {
  189. params.startTime = this.chooseTime[0]
  190. params.endTime = this.chooseTime[1]
  191. }
  192. httpRequest.get('doctor/twoCancers/count/twoCancerProgress', { data: params }).then(function (res) {
  193. if (res.status == 200) {
  194. vm.tableData = res.detailModelList
  195. vm.total = res.totalCount
  196. }
  197. vm.loading = false
  198. })
  199. },
  200. exportTable() {
  201. var vm = this
  202. var params = {
  203. ...this.form,
  204. page: this.page,
  205. size: this.size
  206. }
  207. if (this.chooseTime) {
  208. params.startTime = this.chooseTime[0]
  209. params.endTime = this.chooseTime[1]
  210. }
  211. this.exportLoading = true
  212. var fileName = `两癌筛查进度统计${new Date().getTime()}.xls`
  213. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportTwoCancerProgress', fileName, params).then(function () {
  214. vm.exportLoading = false
  215. })
  216. },
  217. eliminateClick() {
  218. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  219. if (this.level == 1) {
  220. this.form = {
  221. range: '1'
  222. }
  223. } else if (this.level == 2) {
  224. this.form = {
  225. range: '1',
  226. area: selectedRole.code
  227. }
  228. this.getHospital(selectedRole.code)
  229. } else {
  230. this.form = {
  231. range: '2',
  232. town: selectedRole.code.substring(0, 6),
  233. hospital: selectedRole.code
  234. }
  235. this.getTeam(selectedRole.code)
  236. }
  237. this.yearType = '1'
  238. this.chooseYear = new Date().getFullYear()
  239. this.chooseTime = null
  240. const now = new Date()
  241. // 获取当前日期
  242. const endDate = new Date()
  243. // 获取30天前的日期
  244. const startDate = new Date()
  245. startDate.setDate(endDate.getDate() - 30)
  246. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  247. this.init()
  248. this.$forceUpdate()
  249. },
  250. getHospital(code, flag = true) {
  251. var vm = this
  252. if (flag) {
  253. delete this.form.hospital
  254. delete this.form.team
  255. }
  256. var params = {
  257. type: 5,
  258. code: code
  259. }
  260. if (!code) {
  261. vm.hospitalOptions = [{ name: '全部', value: '' }]
  262. vm.teamOptions = [{ name: '全部', value: '' }]
  263. return false
  264. }
  265. httpRequest.post('common/district', { data: params }).then(function (res) {
  266. vm.hospitalOptions = res.list
  267. })
  268. },
  269. handleCurrentChange(val) {
  270. this.page = val
  271. this.searchFn()
  272. },
  273. handleSizeChange(val) {
  274. this.size = val
  275. this.searchFn()
  276. },
  277. // 获取社区医院
  278. hospitalsByType() {
  279. var vm = this
  280. // var code
  281. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  282. if (selectedRole.code.indexOf('350200') > -1) {
  283. code = '350200' // 市卫健委
  284. } else if (selectedRole.code.length == 6) {
  285. code = selectedRole.code
  286. } else {
  287. this.level = 3 // 社区管理
  288. }
  289. if (selectedRole.code.length > 6) {
  290. this.communityHospitals = [{ label: selectedRole.name, value: selectedRole.code }]
  291. } else {
  292. var type = 1
  293. if (selectedRole.code.indexOf('350200') > -1) {
  294. type = 1 // 市卫健委
  295. } else if (selectedRole.code.length == 6) {
  296. type = 2
  297. }
  298. statisticAPI
  299. .hospitalsByType({
  300. type: type,
  301. code: selectedRole.code
  302. })
  303. .then(function (res) {
  304. if (res.status == 200) {
  305. vm.communityHospitals = [{ label: '全部', value: '' }]
  306. res.list.forEach(function (v) {
  307. vm.communityHospitals.push({
  308. value: v.code,
  309. label: v.name
  310. })
  311. })
  312. }
  313. })
  314. .catch(function (err) {
  315. console.log(err, 'Errr')
  316. })
  317. }
  318. },
  319. closeDialog() {
  320. this.visible = false
  321. },
  322. closeDialog1() {
  323. this.dialogVisible = false
  324. },
  325. getData(data) {
  326. if (data) {
  327. this.yearType = data.yearType
  328. this.form.range = data.range
  329. this.form.area = data.area
  330. this.form.hospital = data.hospital
  331. this.form.team = data.team
  332. if (this.yearType == 1) {
  333. this.chooseYear = data.time
  334. } else {
  335. this.chooseTime = data.time
  336. }
  337. if (this.form.hospital) {
  338. // 如果有社区code传过来就调社区医院列表接口
  339. this.getHospital(data.area, false)
  340. }
  341. if (this.form.team) {
  342. // 如果有团队code传过来就调团队列表接口
  343. this.getTeam(data.hospital, false)
  344. }
  345. this.searchFn()
  346. } else {
  347. this.init()
  348. }
  349. },
  350. openDialog(row, prop) {
  351. var vm = this
  352. if (prop != 'total') {
  353. this.query.status = prop.charAt(prop.length - 1)
  354. }
  355. vm.dialogLoading = true
  356. this.query.type = 't_' + prop
  357. this.query.orgCode = row.orgCode
  358. var params = {
  359. ...this.query,
  360. range: (this.form && this.form.range) || '',
  361. town: (this.form && this.form.town) || ''
  362. }
  363. vm.dialogTableData = []
  364. if (this.chooseTime) {
  365. params.startTime = this.chooseTime[0]
  366. params.endTime = this.chooseTime[1]
  367. }
  368. delete params.total
  369. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  370. vm.dialogTableData = res.detailModelList
  371. vm.query.total = res.totalCount
  372. vm.visible = true
  373. vm.dialogLoading = false
  374. console.log('333333333333333',vm)
  375. })
  376. },
  377. caseDataList() {
  378. var vm = this
  379. vm.dialogLoading = true
  380. var params = {
  381. ...this.query,
  382. range: (this.form && this.form.range) || '',
  383. town: (this.form && this.form.town) || '',
  384. hospital: (this.form && this.form.hospital) || ''
  385. }
  386. vm.dialogTableData = []
  387. if (this.chooseTime) {
  388. params.startTime = this.chooseTime[0]
  389. params.endTime = this.chooseTime[1]
  390. }
  391. delete params.total
  392. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  393. vm.dialogTableData = res.detailModelList
  394. vm.query.total = res.totalCount
  395. vm.dialogLoading = false
  396. })
  397. },
  398. dialogSearchFn() {
  399. this.caseDataList()
  400. },
  401. handleCurrentChange1(val) {
  402. this.query.page = val
  403. this.caseDataList()
  404. },
  405. handleSizeChange1(val) {
  406. this.query.size = val
  407. this.caseDataList()
  408. },
  409. dialogExportFn() {
  410. var vm = this
  411. this.dialogExportLoading = true
  412. var params = {
  413. ...this.query,
  414. range: (this.form && this.form.range) || '',
  415. town: (this.form && this.form.town) || '',
  416. hospital: (this.form && this.form.hospital) || ''
  417. }
  418. if (this.chooseTime) {
  419. params.startTime = this.chooseTime[0]
  420. params.endTime = this.chooseTime[1]
  421. }
  422. var fileName = `个案数据列表${new Date().getTime()}.xls`
  423. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportCaseDataList', fileName, params).then(function () {
  424. vm.dialogExportLoading = false
  425. })
  426. },
  427. dialogResetFn() {
  428. this.query = {
  429. page: 1,
  430. size: 10,
  431. total: 0,
  432. type:this.query.type,
  433. orgCode:this.query.orgCode,
  434. }
  435. this.caseDataList()
  436. },
  437. formatDate(date) {
  438. const year = date.getFullYear()
  439. const month = String(date.getMonth() + 1).padStart(2, '0')
  440. const day = String(date.getDate()).padStart(2, '0')
  441. return `${year}-${month}-${day}`
  442. }
  443. },
  444. mounted() {
  445. const now = new Date()
  446. // 获取当前日期
  447. const endDate = new Date()
  448. // 获取30天前的日期
  449. const startDate = new Date()
  450. startDate.setDate(endDate.getDate() - 30)
  451. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  452. this.init()
  453. }
  454. })