index.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. var template = ''
  2. $.ajax('../../../component/statistics/breastCancerPatient/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('breast-cancer-patient', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. dialogVisible: true,
  20. serviceRecordVisable: false,
  21. currentEditData: '',
  22. dialogExportLoading: false,
  23. yearType: '1',
  24. chooseYear: null,
  25. chooseTime: null,
  26. rangeOptions: [
  27. { label: '区', value: '1' },
  28. { label: '机构', value: '2' },
  29. { label: '居住地', value: '3' }
  30. ],
  31. areaOptions: [
  32. { label: '思明区', value: '350203' },
  33. { label: '海沧区', value: '350205' },
  34. { label: '湖里区', value: '350206' },
  35. { label: '集美区', value: '350211' },
  36. { label: '同安区', value: '350212' },
  37. { label: '翔安区', value: '350213' }
  38. ],
  39. hospitalOptions: [],
  40. teamOptions: [],
  41. dialogTableData: [],
  42. dialogHeader: [
  43. { label: '居民姓名', prop: 'name', width: '100' },
  44. { label: '证件号码', prop: 'idcard', width: '100' },
  45. { label: '手机号', prop: 'mobile', width: '110' },
  46. { label: '年龄', prop: 'age', width: '90' },
  47. { label: '出生日期', prop: 'birthday', width: '90' },
  48. { label: '常驻地址', prop: 'address', width: '100' },
  49. { label: '个人筛查状态', prop: 'statusName', width: '100' }
  50. ],
  51. form: {
  52. range: '1'
  53. },
  54. query: {
  55. page: 1,
  56. size: 10,
  57. total: 0
  58. },
  59. loading: false,
  60. exportLoading: false,
  61. tableData: [],
  62. visible: false,
  63. tableHeader: [
  64. { label: '居民姓名', prop: 'name', width: '100' },
  65. { label: '证件号码', prop: 'idcard', width: '100' },
  66. { label: '手机号', prop: 'mobile', width: '110' },
  67. { label: '年龄', prop: 'age', width: '90' },
  68. { label: '出生日期', prop: 'birthday', width: '90' },
  69. { label: '常住地址', prop: 'diagnosisName', width: '130' },
  70. { label: '个人筛查状态', prop: 'isSign', width: '90' },
  71. { label: '基本信息状态', prop: 'hospitalName', width: '90' },
  72. { label: '乳腺临床检查状态', prop: 'num', width: '90' },
  73. { label: '乳腺超声初筛时间', prop: 'turnDownTime', width: '150' },
  74. { label: '乳腺超声评估结果', prop: 'eventType', width: '130' },
  75. { label: '乳腺超声评估机构', prop: 'screenNum', width: '110' },
  76. { label: '乳腺超声评估人', prop: 'cudUser', width: '130' },
  77. { label: '乳腺钼靶评估时间', prop: 'turnDownTime', width: '150' },
  78. { label: '乳腺钼靶评估结果', prop: 'eventType', width: '130' },
  79. { label: '乳腺钼靶评估状态(待随访/已完成)', prop: 'screenNum', width: '110' },
  80. { label: '乳腺病理结果', prop: 'bpatResultName', width: '130' },
  81. { label: '乳腺病理评估机构', prop: 'bpatOrg', width: '130' },
  82. { label: '乳腺病理随访时间', prop: 'turnDownTime', width: '150' },
  83. { label: '乳腺癌分期状态(术前)', prop: 'eventType', width: '130' },
  84. { label: '乳腺癌分期状态(术后)', prop: 'screenNum', width: '110' },
  85. { label: '宫颈初筛时间', prop: 'gynTime', width: '130' },
  86. { label: '宫颈评估机构', prop: 'cerOrg', width: '130' },
  87. { label: '宫颈评估人', prop: 'turnDownTime', width: '150' },
  88. { label: '宫颈评估时间', prop: 'eventType', width: '130' },
  89. { label: '宫颈评估状态', prop: 'screenNum', width: '110' },
  90. { label: '宫颈评估人群', prop: 'screenResult', width: '130' }
  91. ],
  92. loadingTwo: false,
  93. page: 1,
  94. size: 10,
  95. total: 0,
  96. level: 0,
  97. tableHeaderGroups: [
  98. {
  99. label: '基本信息',
  100. children: [
  101. { prop: 'infoCompleteNum', label: '完善' },
  102. { prop: 'basquelouNum', label: '缺漏' }
  103. ]
  104. },
  105. {
  106. label: '乳腺临床检查',
  107. children: [
  108. { prop: 'clicheckNum', label: '检查人数' },
  109. { prop: 'clijujueNum', label: '拒绝' },
  110. { prop: 'cliyicongNum', label: '依从' },
  111. { prop: 'cliquelouNum', label: '缺漏' }
  112. ]
  113. },
  114. {
  115. label: '乳腺超声检查',
  116. children: [
  117. { prop: 'total', label: '检查人数' },
  118. { prop: 'jujueNum', label: '拒绝' },
  119. { prop: 'yicongNum', label: '依从' },
  120. { prop: 'quelouNum', label: '缺漏' }
  121. ]
  122. },
  123. {
  124. label: '乳腺超声检查BI-RADS分级',
  125. children: [
  126. { prop: 'cduBiRads0', label: '0级' },
  127. { prop: 'cduBiRads1', label: '1级' },
  128. { prop: 'cduBiRads2', label: '2级' },
  129. { prop: 'cduBiRads3', label: '3级' },
  130. { prop: 'cduBiRads4a', label: '4a级' },
  131. { prop: 'cduBiRads4b', label: '4b级' },
  132. { prop: 'cduBiRads4c', label: '4c级' },
  133. { prop: 'cduBiRads05', label: '5级' },
  134. { prop: 'cduHeji', label: '合计' }
  135. ]
  136. },
  137. {
  138. label: '乳腺钼靶检查',
  139. children: [
  140. { prop: 'molycNum', label: '应查人数' },
  141. { prop: 'molyicongNum', label: '依从' },
  142. { prop: 'moljujueNum', label: '拒绝' },
  143. { prop: 'mollostNum', label: '失访' },
  144. { prop: 'molycNum1', label: '检查率' },
  145. { prop: 'molycNum2', label: '待完成人数' }
  146. ]
  147. },
  148. {
  149. label: '乳腺钼靶检查BI-RADS分级',
  150. children: [
  151. { prop: 'molBiRads0', label: '0级' },
  152. { prop: 'molBiRads1', label: '1级' },
  153. { prop: 'molBiRads2', label: '2级' },
  154. { prop: 'molBiRads3', label: '3级' },
  155. { prop: 'molBiRads4a', label: '4a级' },
  156. { prop: 'molBiRads4b', label: '4b级' },
  157. { prop: 'molBiRads4c', label: '4c级' },
  158. { prop: 'molBiRads5', label: '5级' },
  159. { prop: 'molBiRads6', label: '不详' },
  160. { prop: 'molHeji', label: '合计' }
  161. ]
  162. },
  163. {
  164. label: '乳腺病理检查\n乳腺病理学监测情况',
  165. children: [
  166. { prop: 'needCheckNum', label: '应查人数' },
  167. { prop: 'checkedNum', label: '已查人数' },
  168. { prop: 'patjujueNum', label: '拒诊人数' },
  169. { prop: 'lostNum', label: '失访人数' },
  170. { prop: 'rate1', label: '病理检查率' }
  171. ]
  172. },
  173. {
  174. label: '乳腺癌检出情况',
  175. children: [
  176. { prop: 'type4', label: '小叶原位癌人数' },
  177. { prop: 'type3', label: '导管原位癌人数' },
  178. { prop: 'type1', label: '浸润性导管癌人数' },
  179. { prop: 'type2', label: '浸润性小叶癌人数' },
  180. { prop: 'type6', label: '其他恶性肿瘤人数' },
  181. { prop: 'type7', label: '不详人数' },
  182. { prop: 'hejiNum', label: '合计人数' },
  183. { prop: 'rate2', label: '乳腺癌检出率' }
  184. ]
  185. },
  186. {
  187. label: 'TNM分期',
  188. children: [
  189. { prop: 'TNM0', label: '0期' },
  190. { prop: 'TNM1', label: '1期' },
  191. { prop: 'TNM2a', label: 'IIA期' },
  192. { prop: 'TNM2b', label: 'IIB期' },
  193. { prop: 'TNM3up', label: 'III期以上' },
  194. { prop: 'TNMbuxiang', label: '不详' },
  195. { prop: 'rate3', label: '获得TNM分期比率' },
  196. { prop: 'rate4', label: '乳腺癌早诊率' }
  197. ]
  198. },
  199. {
  200. label: '治疗情况',
  201. children: [
  202. { prop: 'num1', label: '应治疗人数' },
  203. { prop: 'yzlNum', label: '已治疗人数' },
  204. { prop: 'jzOrLostNum', label: '拒诊治疗或失访人数' },
  205. { prop: 'rate5', label: '早治率' }
  206. ]
  207. },
  208. {
  209. label: '乳腺癌风险人群',
  210. children: [
  211. { prop: 'label1', label: '一般风险' },
  212. { prop: 'label2', label: '高风险' },
  213. { prop: 'labelWait', label: '待评估' },
  214. { prop: 'rate6', label: '高风险人群比例' }
  215. ]
  216. }
  217. ],
  218. dialogLoading: false
  219. }
  220. },
  221. methods: {
  222. back() {
  223. this.currentEditData = ''
  224. this.serviceRecordVisable = false
  225. },
  226. gotoService(item) {
  227. this.currentEditData = item.patient
  228. this.serviceRecordVisable = true
  229. },
  230. init() {
  231. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  232. if (selectedRole.code.indexOf('350200') > -1 || selectedRole.code.indexOf('8d94ce907e4d4356b68f6c5d4d0d6bc9') > -1) {
  233. this.level = 1 // 市卫健委
  234. this.areaOptions = [
  235. { label: '厦门市', value: '' },
  236. { label: '思明区', value: '350203' },
  237. { label: '海沧区', value: '350205' },
  238. { label: '湖里区', value: '350206' },
  239. { label: '集美区', value: '350211' },
  240. { label: '同安区', value: '350212' },
  241. { label: '翔安区', value: '350213' }
  242. ]
  243. } else if (selectedRole.code.length == 6) {
  244. this.level = 2 // 区管理
  245. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  246. this.form = {
  247. range: '1',
  248. town: selectedRole.code
  249. }
  250. this.getHospital(selectedRole.code)
  251. } else {
  252. this.level = 3 // 社区管理
  253. this.rangeOptions = [{ label: '机构', value: '2' }]
  254. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
  255. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  256. this.form = {
  257. range: '2',
  258. town: selectedRole.code.substring(0, 6),
  259. hospital: selectedRole.code
  260. }
  261. this.getTeam(selectedRole.code)
  262. }
  263. this.initTime()
  264. this.getList()
  265. },
  266. initTime() {
  267. var vm = this
  268. var now = new Date()
  269. vm.nowyear = vm.chooseYear = now.getFullYear()
  270. vm.years = []
  271. for (i = vm.nowyear; i >= 2013; i--) {
  272. vm.years.push(i)
  273. }
  274. },
  275. resetArea() {
  276. if (this.level == 1) {
  277. this.areaOptions.push({ label: '其他', value: 'other' })
  278. }
  279. },
  280. getList() {
  281. var vm = this
  282. this.loading = true
  283. var params = {
  284. ...this.form
  285. }
  286. if (this.form.range == 3) {
  287. if (this.form.town && this.form.town != 'other') {
  288. params.town = this.areaOptions.find(item => item.value == this.form.town).label
  289. }
  290. }
  291. console.log('22222222222222222222', vm)
  292. vm.tableData = []
  293. if (this.chooseTime) {
  294. params.startTime = this.chooseTime[0]
  295. params.endTime = this.chooseTime[1]
  296. }
  297. httpRequest.get('doctor/twoCancers/count/breastQualityCount', { data: params }).then(function (res) {
  298. if (res.status == 200) {
  299. vm.tableData = res.detailModelList
  300. vm.total = res.totalCount
  301. // vm.tableData = [{ name: '张三' }]
  302. // vm.total = 1
  303. }
  304. vm.loading = false
  305. })
  306. },
  307. queryDate() {
  308. this.page = 1
  309. this.getList()
  310. },
  311. exportTable() {
  312. var params = {
  313. ...this.form,
  314. page: this.page,
  315. size: this.size
  316. }
  317. if (this.chooseTime) {
  318. params.startTime = this.chooseTime[0]
  319. params.endTime = this.chooseTime[1]
  320. }
  321. this.exportLoading = true
  322. var fileName = `乳腺癌筛查质控统计${new Date().getTime()}.xls`
  323. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportBreastQualityCount', fileName, params).then(function () {
  324. this.exportLoading = false
  325. })
  326. },
  327. eliminateClick() {
  328. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  329. if (this.level == 1) {
  330. this.form = {
  331. range: '1'
  332. }
  333. } else if (this.level == 2) {
  334. this.form = {
  335. range: '1',
  336. town: selectedRole.code
  337. }
  338. this.getHospital(selectedRole.code)
  339. } else {
  340. this.form = {
  341. range: '2',
  342. town: selectedRole.code.substring(0, 6),
  343. hospital: selectedRole.code
  344. }
  345. this.getTeam(selectedRole.code)
  346. }
  347. this.yearType = '1'
  348. this.chooseYear = new Date().getFullYear()
  349. this.chooseTime = null
  350. console.log('1111111111111111', this)
  351. const now = new Date()
  352. // 获取当前日期
  353. const endDate = new Date()
  354. // 获取30天前的日期
  355. const startDate = new Date()
  356. startDate.setDate(endDate.getDate() - 30)
  357. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  358. this.init()
  359. this.$forceUpdate()
  360. },
  361. getHospital(code) {
  362. var vm = this
  363. delete this.form.hospital
  364. delete this.form.team
  365. var params = {
  366. type: 5,
  367. code: code
  368. }
  369. if (!code) {
  370. params = {
  371. type: 6,
  372. code: '350200'
  373. }
  374. }
  375. httpRequest.post('common/district', { data: params }).then(function (res) {
  376. vm.hospitalOptions = [{ code: '', name: '全部' }]
  377. vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  378. })
  379. },
  380. getTeam(code) {
  381. var vm = this
  382. delete this.form.team
  383. var params = {
  384. hospital: code,
  385. area: this.form.area
  386. }
  387. httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
  388. vm.teamOptions = [{ id: '', name: '全部' }]
  389. vm.teamOptions = vm.teamOptions.concat(res.data)
  390. })
  391. },
  392. handleCurrentChange(val) {
  393. this.page = val
  394. this.getList()
  395. },
  396. handleSizeChange(val) {
  397. this.size = val
  398. this.getList()
  399. },
  400. openDialog(row, prop) {
  401. var vm = this
  402. vm.dialogLoading = true
  403. this.query.type = 'r_' + prop
  404. this.query.orgCode = row.orgCode
  405. var params = {
  406. ...this.query,
  407. range: (this.form && this.form.range) || '',
  408. town: this.form.range == 3 ? row.orgCode : (this.form && this.form.town) || ''
  409. }
  410. vm.dialogTableData = []
  411. if (this.chooseTime) {
  412. params.startTime = this.chooseTime[0]
  413. params.endTime = this.chooseTime[1]
  414. }
  415. delete params.total
  416. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  417. vm.dialogTableData = res.detailModelList
  418. vm.query.total = res.totalCount
  419. vm.visible = true
  420. vm.dialogLoading = false
  421. })
  422. },
  423. caseDataList() {
  424. var vm = this
  425. vm.dialogLoading = true
  426. this.query.type = this.query.type.substring(0, this.query.type.length - 1) + this.query.status
  427. var params = {
  428. ...this.query,
  429. range: (this.form && this.form.range) || '',
  430. town: this.form.range == 3 ? row.orgCode : (this.form && this.form.town) || '',
  431. hospital: (this.form && this.form.hospital) || ''
  432. }
  433. vm.dialogTableData = []
  434. if (this.chooseTime) {
  435. params.startTime = this.chooseTime[0]
  436. params.endTime = this.chooseTime[1]
  437. }
  438. delete params.total
  439. httpRequest.get('doctor/twoCancers/count/caseDataList', { data: params }).then(function (res) {
  440. vm.dialogTableData = res.detailModelList
  441. vm.query.total = res.totalCount
  442. vm.dialogLoading = false
  443. })
  444. },
  445. closeDialog() {
  446. this.query = {
  447. page: 1,
  448. size: 10,
  449. total: 0,
  450. type: this.query.type,
  451. orgCode: this.query.orgCode
  452. }
  453. this.visible = false
  454. },
  455. dialogSearchFn() {
  456. this.caseDataList()
  457. },
  458. handleCurrentChange1(val) {
  459. this.query.page = val
  460. this.caseDataList()
  461. },
  462. handleSizeChange1(val) {
  463. this.query.size = val
  464. this.caseDataList()
  465. },
  466. dialogExportFn() {
  467. var vm = this
  468. this.dialogExportLoading = true
  469. var params = {
  470. ...this.query,
  471. range: (this.form && this.form.range) || '',
  472. town: (this.form && this.form.town) || '',
  473. hospital: (this.form && this.form.hospital) || ''
  474. }
  475. if (this.chooseTime) {
  476. params.startTime = this.chooseTime[0]
  477. params.endTime = this.chooseTime[1]
  478. }
  479. var fileName = `个案数据列表${new Date().getTime()}.xls`
  480. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportCaseDataList', fileName, params).then(function () {
  481. vm.dialogExportLoading = false
  482. })
  483. },
  484. dialogResetFn() {
  485. console.log('22222222222222', this)
  486. this.query = {
  487. page: 1,
  488. size: 10,
  489. total: 0,
  490. type: this.query.type,
  491. orgCode: this.query.orgCode
  492. }
  493. this.caseDataList()
  494. },
  495. formatDate(date) {
  496. const year = date.getFullYear()
  497. const month = String(date.getMonth() + 1).padStart(2, '0')
  498. const day = String(date.getDate()).padStart(2, '0')
  499. return `${year}-${month}-${day}`
  500. }
  501. },
  502. mounted() {
  503. const now = new Date()
  504. // 获取当前日期
  505. const endDate = new Date()
  506. // 获取30天前的日期
  507. const startDate = new Date()
  508. startDate.setDate(endDate.getDate() - 30)
  509. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  510. this.init()
  511. }
  512. })