index.js 14 KB

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