index.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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. town: selectedRole.code
  118. }
  119. this.getHospital(selectedRole.code)
  120. } else {
  121. this.level = 3 // 社区管理
  122. this.rangeOptions = [
  123. { label: '机构', value: '2' }
  124. ]
  125. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  126. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  127. this.form = {
  128. range: '2',
  129. town: selectedRole.code.substring(0, 6),
  130. hospital: selectedRole.code
  131. }
  132. this.getTeam(selectedRole.code)
  133. }
  134. this.initTime()
  135. this.searchFn()
  136. this.hospitalsByType()
  137. },
  138. gotoService(item) {
  139. this.currentEditData = item.patient
  140. this.serviceRecordVisable = true
  141. },
  142. initTime() {
  143. var vm = this
  144. var now = new Date()
  145. vm.nowyear = vm.chooseYear = now.getFullYear()
  146. vm.years = []
  147. for (i = vm.nowyear; i >= 2013; i--) {
  148. vm.years.push(i)
  149. }
  150. },
  151. resetArea() {
  152. if(this.form.range==2){
  153. this.hospitalsByType()
  154. }
  155. },
  156. getDictData() {
  157. var vm = this
  158. statisticAPI.getDictByDictName({ name: 'rehabilitation_status' }).then(function (res) {
  159. vm.statusOptions = [{ value: '全部', code: '' }]
  160. vm.statusOptions = vm.statusOptions.concat(res.list)
  161. })
  162. statisticAPI.getDictByDictName({ name: 'rehabilitation_hospital' }).then(function (res) {
  163. vm.rehabilitationHospital = [{ value: '全部', code: '' }]
  164. vm.rehabilitationHospital = vm.rehabilitationHospital.concat(res.list)
  165. })
  166. statisticAPI.getDictByDictName({ name: 'archive_status' }).then(function (res) {
  167. vm.archiveList = [{ value: '全部', code: '' }]
  168. vm.archiveList = vm.archiveList.concat(res.list)
  169. })
  170. },
  171. searchFn() {
  172. var vm = this
  173. this.loading = true
  174. var params = {
  175. ...this.form,
  176. // page: this.page,
  177. // size: this.size
  178. }
  179. if(this.form.range==3){
  180. if(this.form.town){
  181. params.town=this.areaOptions.find(item=>item.value==this.form.town).label
  182. }
  183. }
  184. vm.tableData = []
  185. if (this.chooseTime) {
  186. params.startTime = this.chooseTime[0]
  187. params.endTime = this.chooseTime[1]
  188. }
  189. httpRequest.get('doctor/twoCancers/count/twoCancerProgress', { data: params }).then(function (res) {
  190. if (res.status == 200) {
  191. vm.tableData = res.detailModelList
  192. // vm.total = res.totalCount
  193. }
  194. vm.loading = false
  195. })
  196. },
  197. exportTable() {
  198. var vm = this
  199. var params = {
  200. ...this.form,
  201. page: this.page,
  202. size: this.size
  203. }
  204. if (this.chooseTime) {
  205. params.startTime = this.chooseTime[0]
  206. params.endTime = this.chooseTime[1]
  207. }
  208. vm.exportLoading = true
  209. var fileName = `两癌筛查进度统计${new Date().getTime()}.xls`
  210. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportTwoCancerProgress', fileName, params).then(function () {
  211. vm.exportLoading = false
  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. httpRequest.post('common/district', { data: params }).then(function (res) {
  264. vm.hospitalOptions = [{ code: '', name: '全部' }]
  265. vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  266. })
  267. },
  268. handleCurrentChange(val) {
  269. this.page = val
  270. this.searchFn()
  271. },
  272. handleSizeChange(val) {
  273. this.size = val
  274. this.searchFn()
  275. },
  276. // 获取社区医院
  277. hospitalsByType() {
  278. var vm = this
  279. // var code
  280. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  281. if (selectedRole.code.indexOf('350200') > -1) {
  282. code = '350200' // 市卫健委
  283. } else if (selectedRole.code.length == 6) {
  284. code = selectedRole.code
  285. } else {
  286. this.level = 3 // 社区管理
  287. }
  288. if (selectedRole.code.length > 6) {
  289. this.communityHospitals = [{ label: selectedRole.name, value: selectedRole.code }]
  290. } else {
  291. var type = 1
  292. if (selectedRole.code.indexOf('350200') > -1) {
  293. type = 1 // 市卫健委
  294. } else if (selectedRole.code.length == 6) {
  295. type = 2
  296. }
  297. statisticAPI
  298. .hospitalsByType({
  299. type: type,
  300. code: selectedRole.code
  301. })
  302. .then(function (res) {
  303. if (res.status == 200) {
  304. vm.hospitalOptions = [{ name: '全部', code: '' }]
  305. res.list.forEach(function (v) {
  306. vm.hospitalOptions.push(v)
  307. })
  308. console.log('22222222222222222222',vm)
  309. }
  310. })
  311. .catch(function (err) {
  312. console.log(err, 'Errr')
  313. })
  314. }
  315. },
  316. closeDialog() {
  317. this.query = {
  318. page: 1,
  319. size: 10,
  320. total: 0,
  321. type:this.query.type,
  322. orgCode:this.query.orgCode,
  323. }
  324. this.visible = false
  325. },
  326. closeDialog1() {
  327. this.dialogVisible = false
  328. },
  329. getData(data) {
  330. if (data) {
  331. this.yearType = data.yearType
  332. this.form.range = data.range
  333. this.form.area = data.area
  334. this.form.hospital = data.hospital
  335. this.form.team = data.team
  336. if (this.yearType == 1) {
  337. this.chooseYear = data.time
  338. } else {
  339. this.chooseTime = data.time
  340. }
  341. if (this.form.hospital) {
  342. // 如果有社区code传过来就调社区医院列表接口
  343. this.getHospital(data.area, false)
  344. }
  345. if (this.form.team) {
  346. // 如果有团队code传过来就调团队列表接口
  347. this.getTeam(data.hospital, false)
  348. }
  349. this.searchFn()
  350. } else {
  351. this.init()
  352. }
  353. },
  354. openDialog(row, prop) {
  355. var vm = this
  356. if (prop != 'total') {
  357. this.query.status = prop.charAt(prop.length - 1)
  358. }
  359. vm.dialogLoading = true
  360. this.query.type = 't_' + prop
  361. this.query.orgCode = row.orgCode
  362. var params = {
  363. ...this.query,
  364. range: (this.form && this.form.range) || '',
  365. town: (this.form && this.form.town) || ''
  366. }
  367. vm.dialogTableData = []
  368. if (this.chooseTime) {
  369. params.startTime = this.chooseTime[0]
  370. params.endTime = this.chooseTime[1]
  371. }
  372. delete params.total
  373. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  374. vm.dialogTableData = res.detailModelList
  375. vm.query.total = res.totalCount
  376. vm.visible = true
  377. vm.dialogLoading = false
  378. console.log('333333333333333',vm)
  379. })
  380. },
  381. caseDataList() {
  382. var vm = this
  383. vm.dialogLoading = true
  384. var params = {
  385. ...this.query,
  386. range: (this.form && this.form.range) || '',
  387. town: (this.form && this.form.town) || '',
  388. hospital: (this.form && this.form.hospital) || ''
  389. }
  390. vm.dialogTableData = []
  391. if (this.chooseTime) {
  392. params.startTime = this.chooseTime[0]
  393. params.endTime = this.chooseTime[1]
  394. }
  395. delete params.total
  396. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  397. vm.dialogTableData = res.detailModelList
  398. vm.query.total = res.totalCount
  399. vm.dialogLoading = false
  400. })
  401. },
  402. dialogSearchFn() {
  403. this.caseDataList()
  404. },
  405. handleCurrentChange1(val) {
  406. this.query.page = val
  407. this.caseDataList()
  408. },
  409. handleSizeChange1(val) {
  410. this.query.size = val
  411. this.caseDataList()
  412. },
  413. dialogExportFn() {
  414. var vm = this
  415. this.dialogExportLoading = true
  416. var params = {
  417. ...this.query,
  418. range: (this.form && this.form.range) || '',
  419. town: (this.form && this.form.town) || '',
  420. hospital: (this.form && this.form.hospital) || ''
  421. }
  422. if (this.chooseTime) {
  423. params.startTime = this.chooseTime[0]
  424. params.endTime = this.chooseTime[1]
  425. }
  426. var fileName = `个案数据列表${new Date().getTime()}.xls`
  427. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportCaseDataList', fileName, params).then(function () {
  428. vm.dialogExportLoading = false
  429. })
  430. },
  431. dialogResetFn() {
  432. this.query = {
  433. page: 1,
  434. size: 10,
  435. total: 0,
  436. type:this.query.type,
  437. orgCode:this.query.orgCode,
  438. }
  439. this.caseDataList()
  440. },
  441. formatDate(date) {
  442. const year = date.getFullYear()
  443. const month = String(date.getMonth() + 1).padStart(2, '0')
  444. const day = String(date.getDate()).padStart(2, '0')
  445. return `${year}-${month}-${day}`
  446. }
  447. },
  448. mounted() {
  449. const now = new Date()
  450. // 获取当前日期
  451. const endDate = new Date()
  452. // 获取30天前的日期
  453. const startDate = new Date()
  454. startDate.setDate(endDate.getDate() - 30)
  455. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  456. this.init()
  457. }
  458. })