index.js 15 KB

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