index.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  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 || selectedRole.code.indexOf('8d94ce907e4d4356b68f6c5d4d0d6bc9') > -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. 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. vm.exportLoading = true
  210. var fileName = `两癌筛查进度统计${new Date().getTime()}.xls`
  211. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportTwoCancerProgress', fileName, params).then(function () {
  212. vm.exportLoading = false
  213. })
  214. },
  215. eliminateClick() {
  216. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  217. if (this.level == 1) {
  218. this.form = {
  219. range: '1'
  220. }
  221. } else if (this.level == 2) {
  222. this.form = {
  223. range: '1',
  224. area: selectedRole.code
  225. }
  226. this.getHospital(selectedRole.code)
  227. } else {
  228. this.form = {
  229. range: '2',
  230. town: selectedRole.code.substring(0, 6),
  231. hospital: selectedRole.code
  232. }
  233. this.getTeam(selectedRole.code)
  234. }
  235. this.yearType = '1'
  236. this.chooseYear = new Date().getFullYear()
  237. this.chooseTime = null
  238. const now = new Date()
  239. // 获取当前日期
  240. const endDate = new Date()
  241. // 获取30天前的日期
  242. const startDate = new Date()
  243. startDate.setDate(endDate.getDate() - 30)
  244. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  245. this.init()
  246. this.$forceUpdate()
  247. },
  248. getHospital(code, flag = true) {
  249. var vm = this
  250. if (flag) {
  251. delete this.form.hospital
  252. delete this.form.team
  253. }
  254. var params = {
  255. type: 5,
  256. code: code
  257. }
  258. if (!code) {
  259. params = {
  260. type: 6,
  261. code: '350200'
  262. }
  263. }
  264. httpRequest.post('common/district', { data: params }).then(function (res) {
  265. vm.hospitalOptions = [{ code: '', name: '全部' }]
  266. vm.hospitalOptions = vm.hospitalOptions.concat(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.hospitalOptions = [{ name: '全部', code: '' }]
  306. res.list.forEach(function (v) {
  307. vm.hospitalOptions.push(v)
  308. })
  309. console.log('22222222222222222222', vm)
  310. }
  311. })
  312. .catch(function (err) {
  313. console.log(err, 'Errr')
  314. })
  315. }
  316. },
  317. closeDialog() {
  318. this.query = {
  319. page: 1,
  320. size: 10,
  321. total: 0,
  322. type: this.query.type,
  323. orgCode: this.query.orgCode
  324. }
  325. this.visible = false
  326. },
  327. closeDialog1() {
  328. this.dialogVisible = false
  329. },
  330. getData(data) {
  331. if (data) {
  332. this.yearType = data.yearType
  333. this.form.range = data.range
  334. this.form.area = data.area
  335. this.form.hospital = data.hospital
  336. this.form.team = data.team
  337. if (this.yearType == 1) {
  338. this.chooseYear = data.time
  339. } else {
  340. this.chooseTime = data.time
  341. }
  342. if (this.form.hospital) {
  343. // 如果有社区code传过来就调社区医院列表接口
  344. this.getHospital(data.area, false)
  345. }
  346. if (this.form.team) {
  347. // 如果有团队code传过来就调团队列表接口
  348. this.getTeam(data.hospital, false)
  349. }
  350. this.searchFn()
  351. } else {
  352. this.init()
  353. }
  354. },
  355. openDialog(row, prop) {
  356. var vm = this
  357. if (prop != 'total') {
  358. this.query.status = prop.charAt(prop.length - 1)
  359. }
  360. vm.dialogLoading = true
  361. this.query.type = 't_' + prop
  362. this.query.orgCode = row.orgCode
  363. var params = {
  364. ...this.query,
  365. range: (this.form && this.form.range) || '',
  366. town: this.form.range == 3 ? row.orgCode : (this.form && this.form.town) || ''
  367. }
  368. vm.dialogTableData = []
  369. if (this.chooseTime) {
  370. params.startTime = this.chooseTime[0]
  371. params.endTime = this.chooseTime[1]
  372. }
  373. delete params.total
  374. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  375. vm.dialogTableData = res.detailModelList
  376. vm.query.total = res.totalCount
  377. vm.visible = true
  378. vm.dialogLoading = false
  379. console.log('333333333333333', vm)
  380. })
  381. },
  382. caseDataList() {
  383. var vm = this
  384. vm.dialogLoading = true
  385. this.query.type = this.query.type.substring(0, this.query.type.length - 1) + this.query.status
  386. var params = {
  387. ...this.query,
  388. range: (this.form && this.form.range) || '',
  389. town: (this.form && this.form.town) || '',
  390. hospital: (this.form && this.form.hospital) || ''
  391. }
  392. vm.dialogTableData = []
  393. if (this.chooseTime) {
  394. params.startTime = this.chooseTime[0]
  395. params.endTime = this.chooseTime[1]
  396. }
  397. delete params.total
  398. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  399. vm.dialogTableData = res.detailModelList
  400. vm.query.total = res.totalCount
  401. vm.dialogLoading = false
  402. })
  403. },
  404. dialogSearchFn() {
  405. this.caseDataList()
  406. },
  407. handleCurrentChange1(val) {
  408. this.query.page = val
  409. this.caseDataList()
  410. },
  411. handleSizeChange1(val) {
  412. this.query.size = val
  413. this.caseDataList()
  414. },
  415. dialogExportFn() {
  416. var vm = this
  417. this.dialogExportLoading = true
  418. var params = {
  419. ...this.query,
  420. range: (this.form && this.form.range) || '',
  421. town: (this.form && this.form.town) || '',
  422. hospital: (this.form && this.form.hospital) || ''
  423. }
  424. if (this.chooseTime) {
  425. params.startTime = this.chooseTime[0]
  426. params.endTime = this.chooseTime[1]
  427. }
  428. var fileName = `个案数据列表${new Date().getTime()}.xls`
  429. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportCaseDataList', fileName, params).then(function () {
  430. vm.dialogExportLoading = false
  431. })
  432. },
  433. dialogResetFn() {
  434. this.query = {
  435. page: 1,
  436. size: 10,
  437. total: 0,
  438. type: this.query.type,
  439. orgCode: this.query.orgCode
  440. }
  441. this.caseDataList()
  442. },
  443. formatDate(date) {
  444. const year = date.getFullYear()
  445. const month = String(date.getMonth() + 1).padStart(2, '0')
  446. const day = String(date.getDate()).padStart(2, '0')
  447. return `${year}-${month}-${day}`
  448. }
  449. },
  450. mounted() {
  451. const now = new Date()
  452. // 获取当前日期
  453. const endDate = new Date()
  454. // 获取30天前的日期
  455. const startDate = new Date()
  456. startDate.setDate(endDate.getDate() - 30)
  457. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  458. this.init()
  459. }
  460. })