index.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascCervical/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-cervical', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. yearType: '1',
  20. loadingTwo: false,
  21. chooseYear: null,
  22. chooseTime: null,
  23. query: {
  24. page: 1,
  25. size: 10,
  26. total: 0
  27. },
  28. rangeOptions: [
  29. { label: '区', value: '1' },
  30. { label: '机构', value: '2' },
  31. { label: '居住地', value: '3' }
  32. ],
  33. areaOptions: [
  34. { label: '思明区', value: '350203' },
  35. { label: '海沧区', value: '350205' },
  36. { label: '湖里区', value: '350206' },
  37. { label: '集美区', value: '350211' },
  38. { label: '同安区', value: '350212' },
  39. { label: '翔安区', value: '350213' }
  40. ],
  41. hospitalOptions: [],
  42. teamOptions: [],
  43. form: {
  44. range: '1'
  45. },
  46. loading: false,
  47. tableData: [],
  48. tableHeader: [],
  49. constantHeader: [
  50. { label: '下转次数', prop: 'totalTimes', width: '90' },
  51. { label: '门诊下转次数', prop: 'mzTimes', width: '110' },
  52. { label: '出院下转次数', prop: 'zyTimes', width: '110' },
  53. { label: '下转人数', prop: 'totalNum', width: '110' },
  54. { label: '门诊下转人数', prop: 'mzNum', width: '110' },
  55. { label: '出院下转人数', prop: 'zyNum', width: '110' },
  56. { label: '门诊下转已评估', prop: 'mzScreenNum', width: '120' },
  57. { label: '门诊下转未评估', prop: 'unMzScreenNum', width: '120' },
  58. { label: '出院下转已评估', prop: 'zyScreenNum', width: '120' },
  59. { label: '出院下转未评估', prop: 'unZyScreenNum', width: '120' }
  60. ],
  61. level: 0,
  62. visible: false,
  63. dataRangeOption: [],
  64. dialogTableData: [],
  65. dialogHeader: [
  66. { label: '居民姓名', prop: 'name', width: '100' },
  67. { label: '证件号码', prop: 'idcard', width: '100' },
  68. { label: '手机号', prop: 'mobile', width: '110' },
  69. { label: '年龄', prop: 'age', width: '90' },
  70. { label: '出生日期', prop: 'birthday', width: '90' },
  71. { label: '常驻地址', prop: 'address', width: '100' },
  72. { label: '个人筛查状态', prop: 'statusName', width: '100' }
  73. ],
  74. page: 1,
  75. size: 10,
  76. total: 0,
  77. messageVisible: false,
  78. messInfo: null,
  79. remind: '',
  80. dialogLoading: false,
  81. dialogExportLoading: false,
  82. statusOptions: [],
  83. rehabilitationHospital: [],
  84. archiveList: [],
  85. inviteStatus: [
  86. { value: '', label: '全部' },
  87. { value: '1', label: '门诊患者' },
  88. { value: '2', label: '出院患者' }
  89. ],
  90. communityHospitals: [],
  91. title: '',
  92. dialogVisible: false,
  93. signatoryList: [],
  94. cervicalHeaderGroups: [
  95. {
  96. label: '宫颈癌管理情况',
  97. children: [
  98. { prop: 'num2', label: '妇科检查人数' },
  99. { prop: 'assessNum', label: '线上评估人数' },
  100. { prop: 'orderNum', label: '线上预约人数' }
  101. ]
  102. },
  103. {
  104. label: '宫颈妇科检查情况',
  105. children: [
  106. { prop: 'jujueNum', label: '拒绝' },
  107. { prop: 'yicongNum', label: '依从' },
  108. { prop: 'num3', label: '检查人数' },
  109. { prop: 'waitNum', label: '待完善人数' }
  110. ]
  111. },
  112. {
  113. label: 'HPV检查情况',
  114. children: [
  115. { prop: 'hpvNum', label: '检查人数' },
  116. { prop: 'n1', label: '待完善人数' }
  117. ]
  118. },
  119. {
  120. label: '高危HPV分型检测情况',
  121. children: [
  122. { prop: 'hpvH', label: '高危HPV阳性人数' },
  123. { prop: 'hpv16', label: '16型阳性人数' },
  124. { prop: 'hpv18', label: '18型阳性人数' },
  125. { prop: 'hpv31', label: '31型阳性人数' },
  126. { prop: 'hpv33', label: '33型阳性人数' },
  127. { prop: 'hpv35', label: '35型阳性人数' },
  128. { prop: 'hpv39', label: '39型阳性人数' },
  129. { prop: 'hpv45', label: '45型阳性人数' },
  130. { prop: 'hpv51', label: '51型阳性人数' },
  131. { prop: 'hpv52', label: '52型阳性人数' },
  132. { prop: 'hpv53', label: '53型阳性人数' },
  133. { prop: 'hpv56', label: '56型阳性人数' },
  134. { prop: 'hpv58', label: '58型阳性人数' },
  135. { prop: 'hpv59', label: '59型阳性人数' },
  136. { prop: 'hpv66', label: '66型阳性人数' },
  137. { prop: 'hpv68', label: '68型阳性人数' },
  138. { prop: 'hpv73', label: '73型阳性人数' },
  139. { prop: 'hpv82', label: '82型阳性人数' }
  140. ]
  141. },
  142. {
  143. label: '低危HPV分型检测情况',
  144. children: [
  145. { prop: 'hpvL', label: '低危HPV阳性人数' },
  146. { prop: 'hpv6', label: '6型阳性人数' },
  147. { prop: 'hpv11', label: '11型阳性人数' },
  148. { prop: 'hpv42', label: '42型阳性人数' },
  149. { prop: 'hpv43', label: '43型阳性人数' },
  150. { prop: 'hpv44', label: '44型阳性人数' },
  151. { prop: 'hpv81', label: '81型阳性人数' },
  152. { prop: 'hpv83', label: '83型阳性人数' }
  153. ]
  154. },
  155. {
  156. label: '宫颈细胞学检查情况',
  157. children: [
  158. { prop: 'cytNum', label: '检查人数' },
  159. { prop: 'cytNum1', label: '检查异常人数' },
  160. { prop: 'cytNum2', label: '待完善人数' }
  161. ]
  162. },
  163. {
  164. label: '初筛结果临床评估情况',
  165. children: [
  166. { prop: 'preNum', label: '检查人数' },
  167. { prop: 'preNum1', label: '待完善人数' },
  168. { prop: 'preNum2', label: '未见异常,定期筛查' },
  169. { prop: 'preNum3', label: '异常,6-12个月复查' },
  170. { prop: 'preNum4', label: '异常,嘱进一步行阴道镜检查' }
  171. ]
  172. },
  173. {
  174. label: '阴道镜检查情况',
  175. children: [
  176. { prop: 'colNum', label: '需要阴道镜检查人数' },
  177. { prop: 'colNum1', label: '阴道镜检查人数' },
  178. { prop: 'colNum2', label: '接受检查人数' },
  179. { prop: 'colNum3', label: '拒绝检查人数' },
  180. { prop: 'colNum4', label: '未见异常人数' },
  181. { prop: 'colNum5', label: '异常人数' },
  182. { prop: 'colNum6', label: '待完善人数' }
  183. ]
  184. },
  185. {
  186. label: '阴道镜检查随访情况',
  187. children: [
  188. { prop: 'colfNum', label: '已随访人数' },
  189. { prop: 'colfNum1', label: '待随访人数' },
  190. { prop: 'colfNum2', label: '未见异常' },
  191. { prop: 'colfNum3', label: '低度病变' },
  192. { prop: 'colfNum4', label: '高度病变' },
  193. { prop: 'colfNum5', label: '可疑癌' },
  194. { prop: 'colfNum6', label: '其他' },
  195. { prop: 'colfNum7', label: '不详' }
  196. ]
  197. },
  198. {
  199. label: '组织病理学检查情况',
  200. children: [
  201. { prop: 'cpatNum', label: '需要组织病理学检查' },
  202. { prop: 'cpatNum1', label: '病理学检查人数' },
  203. { prop: 'cpatNum2', label: '接受检查人数' },
  204. { prop: 'cpatNum3', label: '拒绝检查人数' },
  205. { prop: 'cpatNum4', label: '未见异常人数' },
  206. { prop: 'cpatNum5', label: '炎症' },
  207. { prop: 'cpatNum6', label: '低级别病变(原CIN1)' },
  208. { prop: 'cpatNum7', label: '高级别病变(原CIN2及CIN3)' },
  209. { prop: 'cpatNum8', label: '宫颈原位腺癌(AIS)' },
  210. { prop: 'cpatNum9', label: '宫颈微小浸润癌(鳞癌/腺癌)' },
  211. { prop: 'cpatNum10', label: '宫颈浸润癌(鳞癌/腺癌)' }
  212. ]
  213. },
  214. {
  215. label: '组织病理学检查随访情况',
  216. children: [
  217. { prop: 'cpatfNum', label: '已随访人数' },
  218. { prop: 'cpatfNum1', label: '待随访人数' },
  219. { prop: 'cpatfNum2', label: '炎症' },
  220. { prop: 'cpatfNum3', label: '低级别病变(原CIN1)' },
  221. { prop: 'cpatfNum4', label: '高级别病变(原CIN2及CIN3)' },
  222. { prop: 'cpatfNum5', label: '宫颈原位腺癌(AIS)' },
  223. { prop: 'cpatfNum6', label: '宫颈微小浸润癌(鳞癌/腺癌)' },
  224. { prop: 'cpatfNum7', label: '宫颈浸润癌(鳞癌/腺癌)' }
  225. ]
  226. },
  227. {
  228. label: '最后诊断情况',
  229. children: [
  230. { prop: 'finNum', label: '未见异常人数' },
  231. { prop: 'finNum1', label: '炎症' },
  232. { prop: 'finNum2', label: '低级别病变(原CIN1)' },
  233. { prop: 'finNum3', label: '高级别病变(原CIN2及CIN3)' },
  234. { prop: 'finNum4', label: '宫颈原位腺癌(AIS)' },
  235. { prop: 'finNum5', label: '宫颈微小浸润癌(鳞癌/腺癌)' },
  236. { prop: 'finNum6', label: '宫颈浸润癌(鳞癌/腺癌)' },
  237. { prop: 'finNum7', label: '待完善人数' }
  238. ]
  239. },
  240. {
  241. label: '宫颈病变接受治疗情况',
  242. children: [
  243. { prop: 'finTNum1', label: '接受治疗人数' },
  244. { prop: 'finTNum2', label: '不接受治疗人数' },
  245. { prop: 'finTNum3', label: '不详人数' }
  246. ]
  247. },
  248. {
  249. label: '术后病理—接受组织病理学检查情况',
  250. children: [
  251. { prop: 'finSNum1', label: '接受检查人数' },
  252. { prop: 'finSNum2', label: '不接受检查人数' },
  253. { prop: 'finSNum3', label: '炎症' },
  254. { prop: 'finSNum4', label: '低级别病变(原CIN1)' },
  255. { prop: 'finSNum5', label: '高级别病变(原CIN2及CIN3)' },
  256. { prop: 'finSNum6', label: '宫颈原位腺癌(AIS)' },
  257. { prop: 'finSNum7', label: '宫颈微小浸润癌(鳞癌/腺癌)' },
  258. { prop: 'finSNum8', label: '宫颈浸润癌(鳞癌/腺癌)' }
  259. ]
  260. }
  261. ],
  262. currentEditData: '',
  263. serviceRecordVisable: false
  264. }
  265. },
  266. methods: {
  267. back() {
  268. this.currentEditData = ''
  269. this.serviceRecordVisable = false
  270. },
  271. gotoService(item) {
  272. this.currentEditData = item.patient
  273. this.serviceRecordVisable = true
  274. },
  275. init() {
  276. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  277. if (selectedRole.code.indexOf('350200') > -1 || selectedRole.code.indexOf('8d94ce907e4d4356b68f6c5d4d0d6bc9') > -1) {
  278. this.level = 1 // 市卫健委
  279. this.areaOptions = [
  280. { label: '厦门市', value: '' },
  281. { label: '思明区', value: '350203' },
  282. { label: '海沧区', value: '350205' },
  283. { label: '湖里区', value: '350206' },
  284. { label: '集美区', value: '350211' },
  285. { label: '同安区', value: '350212' },
  286. { label: '翔安区', value: '350213' }
  287. ]
  288. this.getHospital()
  289. } else if (selectedRole.code.length == 6) {
  290. this.level = 2 // 区管理
  291. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  292. this.form = {
  293. range: '2',
  294. town: selectedRole.code
  295. }
  296. this.getHospital(selectedRole.code)
  297. } else {
  298. this.level = 3 // 社区管理
  299. this.rangeOptions = [{ label: '机构', value: '2' }]
  300. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  301. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  302. this.form = {
  303. range: '2',
  304. town: selectedRole.code.substring(0, 6),
  305. hospital: selectedRole.code
  306. }
  307. this.getTeam(selectedRole.code)
  308. }
  309. this.initTime()
  310. this.searchFn()
  311. this.hospitalsByType()
  312. },
  313. initTime() {
  314. var vm = this
  315. var now = new Date()
  316. vm.nowyear = vm.chooseYear = now.getFullYear()
  317. vm.years = []
  318. for (i = vm.nowyear; i >= 2013; i--) {
  319. vm.years.push(i)
  320. }
  321. },
  322. resetArea() {
  323. console.log('11111111111111111', this)
  324. if (this.level == 1) {
  325. this.areaOptions.push({ label: '其他', value: 'other' })
  326. }
  327. },
  328. getDictData() {},
  329. searchFn() {
  330. var vm = this
  331. this.loading = true
  332. var params = {
  333. ...this.form
  334. // page: this.page,
  335. // size: this.size
  336. }
  337. if (this.form.range == 3) {
  338. if (this.form.town && this.form.town != 'other') {
  339. params.town = this.areaOptions.find(item => item.value == this.form.town).label
  340. }
  341. }
  342. vm.tableData = []
  343. if (this.chooseTime) {
  344. params.startTime = this.chooseTime[0]
  345. params.endTime = this.chooseTime[1]
  346. }
  347. httpRequest.get('/doctor/twoCancers/count/cervicalQualityCount', { data: params }).then(function (res) {
  348. if (res.status == 200) {
  349. vm.tableData = res.detailModelList
  350. // vm.total = res.totalCount
  351. }
  352. console.log('22222222222222222', vm.tableData)
  353. vm.loading = false
  354. })
  355. },
  356. exportTable() {
  357. var vm = this
  358. var params = {
  359. ...this.form,
  360. page: this.page,
  361. size: this.size
  362. }
  363. if (this.chooseTime) {
  364. params.startTime = this.chooseTime[0]
  365. params.endTime = this.chooseTime[1]
  366. }
  367. var fileName = `宫颈癌质控统计表${new Date().getTime()}.xls`
  368. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportCervicalQualityCount', fileName, params).then(function () {
  369. vm.$message.success('导出成功')
  370. })
  371. },
  372. eliminateClick() {
  373. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  374. if (this.level == 1) {
  375. this.form = {
  376. range: '1'
  377. }
  378. } else if (this.level == 2) {
  379. this.form = {
  380. range: '1',
  381. area: selectedRole.code
  382. }
  383. this.getHospital(selectedRole.code)
  384. } else {
  385. this.form = {
  386. range: '2',
  387. area: selectedRole.code.substring(0, 6),
  388. hospital: selectedRole.code
  389. }
  390. this.getTeam(selectedRole.code)
  391. }
  392. this.chooseYear = new Date().getFullYear()
  393. this.chooseTime = null
  394. const now = new Date()
  395. // 获取当前日期
  396. const endDate = new Date()
  397. // 获取30天前的日期
  398. const startDate = new Date()
  399. startDate.setDate(endDate.getDate() - 30)
  400. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  401. this.init()
  402. this.$forceUpdate()
  403. },
  404. getHospital(code, flag = true) {
  405. var vm = this
  406. // if (flag) {
  407. // delete this.form.hospital
  408. // delete this.form.team
  409. // }
  410. // var params = {
  411. // type: 5,
  412. // code: code
  413. // }
  414. // if (!code) {
  415. // params = {
  416. // type: 6,
  417. // code: '350200'
  418. // }
  419. // }
  420. // httpRequest.post('common/district', { data: params }).then(function (res) {
  421. // vm.hospitalOptions = [{ name: '全部', value: '' }]
  422. // vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  423. // })
  424. var data = {
  425. town: code ? code : this.form.town ? this.form.town : '',
  426. hospital: ''
  427. }
  428. httpRequest.get('doctor/twoCancers/count/hospitalList', { data }).then(function (res) {
  429. vm.hospitalOptions = []
  430. // vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  431. if (res.status == 200) {
  432. vm.hospitalOptions = [{ code: '', name: '全部' }]
  433. res.data.forEach(item => {
  434. vm.hospitalOptions.push({
  435. name: item.hospital_name,
  436. code: item.hospital
  437. })
  438. })
  439. }
  440. })
  441. },
  442. getTeam(code, flag = true) {
  443. var vm = this
  444. if (flag) {
  445. delete this.form.team
  446. }
  447. var params = {
  448. hospital: code
  449. }
  450. httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
  451. vm.teamOptions = res.data
  452. })
  453. },
  454. handleCurrentChange(val) {
  455. this.page = val
  456. this.searchFn()
  457. },
  458. handleSizeChange(val) {
  459. this.size = val
  460. this.searchFn()
  461. },
  462. // 获取社区医院
  463. hospitalsByType() {
  464. var vm = this
  465. // var code
  466. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  467. if (selectedRole.code.indexOf('350200') > -1 || selectedRole.code.indexOf('8d94ce907e4d4356b68f6c5d4d0d6bc9') > -1) {
  468. code = '350200' // 市卫健委
  469. } else if (selectedRole.code.length == 6) {
  470. code = selectedRole.code
  471. } else {
  472. this.level = 3 // 社区管理
  473. }
  474. if (selectedRole.code.length > 6) {
  475. this.communityHospitals = [{ label: selectedRole.name, value: selectedRole.code }]
  476. } else {
  477. var type = 1
  478. if (selectedRole.code.indexOf('350200') > -1) {
  479. type = 1 // 市卫健委
  480. } else if (selectedRole.code.length == 6) {
  481. type = 2
  482. }
  483. statisticAPI
  484. .hospitalsByType({
  485. type: type,
  486. code: selectedRole.code
  487. })
  488. .then(function (res) {
  489. if (res.status == 200) {
  490. vm.communityHospitals = [{ label: '全部', value: '' }]
  491. res.list.forEach(function (v) {
  492. vm.communityHospitals.push({
  493. value: v.code,
  494. label: v.name
  495. })
  496. })
  497. }
  498. })
  499. .catch(function (err) {
  500. console.log(err, 'Errr')
  501. })
  502. }
  503. },
  504. openDialog(row, prop) {
  505. var vm = this
  506. vm.dialogLoading = true
  507. this.query.type = 'g_' + prop
  508. this.query.orgCode = row.orgCode
  509. var params = {
  510. ...this.query,
  511. range: (this.form && this.form.range) || '',
  512. town: this.form.range == 3 ? row.orgCode : (this.form && this.form.town) || ''
  513. }
  514. vm.dialogTableData = []
  515. if (this.chooseTime) {
  516. params.startTime = this.chooseTime[0]
  517. params.endTime = this.chooseTime[1]
  518. }
  519. delete params.total
  520. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  521. vm.dialogTableData = res.detailModelList
  522. vm.query.total = res.totalCount
  523. vm.visible = true
  524. vm.dialogLoading = false
  525. })
  526. },
  527. caseDataList() {
  528. var vm = this
  529. vm.dialogLoading = true
  530. // this.query.type = this.query.type.substring(0, this.query.type.length - 1) + this.query.status
  531. var params = {
  532. ...this.query,
  533. range: (this.form && this.form.range) || '',
  534. town: (this.form && this.form.town) || '',
  535. hospital: (this.form && this.form.hospital) || ''
  536. }
  537. vm.dialogTableData = []
  538. if (this.chooseTime) {
  539. params.startTime = this.chooseTime[0]
  540. params.endTime = this.chooseTime[1]
  541. }
  542. delete params.total
  543. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  544. vm.dialogTableData = res.detailModelList
  545. vm.query.total = res.totalCount
  546. vm.dialogLoading = false
  547. })
  548. },
  549. dialogSearchFn() {
  550. this.caseDataList()
  551. },
  552. handleCurrentChange1(val) {
  553. this.query.page = val
  554. this.caseDataList()
  555. },
  556. handleSizeChange1(val) {
  557. this.query.size = val
  558. this.caseDataList()
  559. },
  560. dialogExportFn() {
  561. var vm = this
  562. this.dialogExportLoading = true
  563. var params = {
  564. ...this.query,
  565. range: (this.form && this.form.range) || '',
  566. town: (this.form && this.form.town) || '',
  567. hospital: (this.form && this.form.hospital) || ''
  568. }
  569. if (this.chooseTime) {
  570. params.startTime = this.chooseTime[0]
  571. params.endTime = this.chooseTime[1]
  572. }
  573. var fileName = `个案数据列表${new Date().getTime()}.xls`
  574. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportCaseDataList', fileName, params).then(function () {
  575. vm.dialogExportLoading = false
  576. })
  577. },
  578. dialogResetFn() {
  579. this.query = {
  580. page: 1,
  581. size: 10,
  582. total: 0,
  583. type: this.query.type,
  584. orgCode: this.query.orgCode
  585. }
  586. this.caseDataList()
  587. },
  588. closeDialog() {
  589. this.query = {
  590. page: 1,
  591. size: 10,
  592. total: 0,
  593. type: this.query.type,
  594. orgCode: this.query.orgCode
  595. }
  596. this.visible = false
  597. },
  598. closeDialog1() {
  599. this.dialogVisible = false
  600. },
  601. getData(data) {
  602. if (data) {
  603. this.yearType = data.yearType
  604. this.form.range = data.range
  605. this.form.area = data.area
  606. this.form.hospital = data.hospital
  607. this.form.team = data.team
  608. if (this.yearType == 1) {
  609. this.chooseYear = data.time
  610. } else {
  611. this.chooseTime = data.time
  612. }
  613. if (this.form.hospital) {
  614. // 如果有社区code传过来就调社区医院列表接口
  615. this.getHospital(data.area, false)
  616. }
  617. if (this.form.team) {
  618. // 如果有团队code传过来就调团队列表接口
  619. this.getTeam(data.hospital, false)
  620. }
  621. this.searchFn()
  622. } else {
  623. this.init()
  624. }
  625. },
  626. formatDate(date) {
  627. const year = date.getFullYear()
  628. const month = String(date.getMonth() + 1).padStart(2, '0')
  629. const day = String(date.getDate()).padStart(2, '0')
  630. return `${year}-${month}-${day}`
  631. }
  632. },
  633. mounted() {
  634. const now = new Date()
  635. // 获取当前日期
  636. const endDate = new Date()
  637. // 获取30天前的日期
  638. const startDate = new Date()
  639. startDate.setDate(endDate.getDate() - 30)
  640. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  641. this.init()
  642. }
  643. })