index.js 18 KB

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