index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascPatient/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-patient', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. years: [],
  19. currentEditData: '',
  20. dialogVisible: false,
  21. showTotalTable: true,
  22. serviceRecordVisable: false,
  23. yearType: '1',
  24. chooseYear: null,
  25. chooseTime1: null,
  26. chooseTime: null,
  27. patientCode: '',
  28. formDialogVisible: true,
  29. rangeOptions: [
  30. { label: '区', value: '1' },
  31. { label: '机构', value: '2' }
  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. { label: '居民姓名', prop: 'name', width: '100' },
  50. { label: '证件号码', prop: 'idcard', width: '100' },
  51. { label: '手机号', prop: 'mobile', width: '110' },
  52. { label: '年龄', prop: 'age', width: '90' },
  53. { label: '出生日期', prop: 'birthday', width: '90' },
  54. { label: '常住地址', prop: 'address', width: '130' },
  55. { label: '个人筛查状态', prop: 'statusName', width: '90' },
  56. { label: '基本信息状态', prop: 'infoStatusName', width: '90' },
  57. { label: '乳腺临床检查状态', prop: 'cliStatusName', width: '90' },
  58. { label: '乳腺超声初筛时间', prop: 'cduTime', width: '150' },
  59. { label: '乳腺超声评估结果', prop: 'cduResultName', width: '130' },
  60. { label: '乳腺超声评估机构', prop: 'cduOrg', width: '110' },
  61. { label: '乳腺超声评估人', prop: 'cudUser', width: '130' },
  62. { label: '乳腺钼靶评估时间', prop: 'molTime', width: '150' },
  63. { label: '乳腺钼靶评估结果', prop: 'molResultName', width: '130' },
  64. { label: '乳腺钼靶评估状态(待随访/已完成)', prop: 'molStatusName', width: '110' },
  65. { label: '乳腺病理结果', prop: 'bpatResultName', width: '130' },
  66. { label: '乳腺病理评估机构', prop: 'bpatOrg', width: '130' },
  67. { label: '乳腺病理随访时间', prop: 'bpatTime', width: '150' },
  68. { label: '乳腺癌分期状态(术前)', prop: 'opFrontName', width: '130' },
  69. { label: '乳腺癌分期状态(术后)', prop: 'opAfterName', width: '110' },
  70. { label: '宫颈初筛时间', prop: 'gynTime', width: '130' },
  71. { label: '宫颈评估机构', prop: 'cerOrg', width: '130' },
  72. { label: '宫颈评估人', prop: 'cerUser', width: '150' },
  73. { label: '宫颈评估时间', prop: 'cerTime', width: '130' },
  74. { label: '宫颈评估状态', prop: 'cerStatusName', width: '110' },
  75. { label: '宫颈评估人群', prop: 'screenResult', width: '130' }
  76. ],
  77. page: 1,
  78. size: 10,
  79. total: 0,
  80. level: 0,
  81. FormData: {},
  82. currentInfo: {}
  83. }
  84. },
  85. methods: {
  86. formatDate(date) {
  87. const year = date.getFullYear()
  88. const month = String(date.getMonth() + 1).padStart(2, '0')
  89. const day = String(date.getDate()).padStart(2, '0')
  90. return `${year}-${month}-${day}`
  91. },
  92. init() {
  93. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  94. console.log('selectedRole', selectedRole)
  95. if (selectedRole.code.indexOf('350200') > -1 || selectedRole.code.indexOf('8d94ce907e4d4356b68f6c5d4d0d6bc9') > -1) {
  96. this.level = 1 // 市卫健委
  97. this.areaOptions = [
  98. { label: '厦门市', value: '' },
  99. { label: '思明区', value: '350203' },
  100. { label: '海沧区', value: '350205' },
  101. { label: '湖里区', value: '350206' },
  102. { label: '集美区', value: '350211' },
  103. { label: '同安区', value: '350212' },
  104. { label: '翔安区', value: '350213' }
  105. ]
  106. } else if (selectedRole.code.length == 6) {
  107. // console.log('区管理')
  108. this.level = 2 // 区管理
  109. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  110. this.form = {
  111. range: '1',
  112. town: selectedRole.code
  113. }
  114. this.getHospital(selectedRole.code)
  115. } else {
  116. // console.log('社区管理')
  117. this.level = 3 // 社区管理
  118. this.rangeOptions = [{ label: '机构', value: '2' }]
  119. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
  120. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  121. this.form = {
  122. range: '2',
  123. town: selectedRole.code.substring(0, 6),
  124. hospital: selectedRole.code
  125. }
  126. this.getTeam(selectedRole.code)
  127. }
  128. this.initTime()
  129. this.getList()
  130. },
  131. initTime() {
  132. var vm = this
  133. var now = new Date()
  134. vm.nowyear = vm.chooseYear = now.getFullYear()
  135. vm.years = []
  136. for (i = vm.nowyear; i >= 2013; i--) {
  137. vm.years.push(i)
  138. }
  139. },
  140. resetArea() {
  141. if (this.level == 1) {
  142. delete this.form.town
  143. delete this.form.hospital
  144. delete this.form.team
  145. } else if (this.level == 2) {
  146. delete this.form.hospital
  147. delete this.form.team
  148. } else {
  149. delete this.form.team
  150. }
  151. },
  152. back() {
  153. var vm = this
  154. vm.showTotalTable = true
  155. vm.serviceRecordVisable = false
  156. },
  157. getList() {
  158. var vm = this
  159. this.loading = true
  160. var params = {
  161. ...this.form,
  162. page: this.page,
  163. size: this.size,
  164. timeType: this.yearType
  165. }
  166. console.log('11111111111111111', this)
  167. if (this.yearType && this.yearType == 1) {
  168. if (this.chooseTime) {
  169. params.startTime = this.chooseTime[0]
  170. params.endTime = this.chooseTime[1]
  171. }
  172. } else if (this.yearType && this.yearType == 2) {
  173. if (this.chooseTime1) {
  174. params.startTime = this.chooseTime1[0]
  175. params.endTime = this.chooseTime1[1]
  176. }
  177. }
  178. httpRequest.get('doctor/twoCancers/count/patientArchive', { data: params }).then(function (res) {
  179. if (res.status == 200) {
  180. vm.tableData = res.detailModelList
  181. vm.total = res.totalCount
  182. }
  183. vm.loading = false
  184. })
  185. },
  186. onClickServiceRecord(record) {
  187. this.currentEditData = record.patient
  188. this.showTotalTable = false
  189. this.serviceRecordVisable = true
  190. },
  191. queryDate() {
  192. this.page = 1
  193. this.getList()
  194. },
  195. exportTable() {
  196. var vm = this
  197. var params = {
  198. ...this.form,
  199. page: this.page,
  200. size: this.size,
  201. timeType: this.yearType
  202. }
  203. if (this.yearType && this.yearType == 1) {
  204. if (this.chooseTime) {
  205. params.startTime = this.chooseTime[0]
  206. params.endTime = this.chooseTime[1]
  207. }
  208. } else if (this.yearType && this.yearType == 2) {
  209. if (this.chooseTime1) {
  210. params.startTime = this.chooseTime1[0]
  211. params.endTime = this.chooseTime1[1]
  212. }
  213. }
  214. var fileName = `两癌筛查居民档案${new Date().getTime()}.xls`
  215. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportPatientArchive', fileName, params).then(function () {
  216. vm.$message.success('导出成功')
  217. })
  218. },
  219. eliminateClick() {
  220. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  221. console.log('11111111111111', this.level)
  222. if (this.level == 1) {
  223. this.form = {
  224. range: '1'
  225. }
  226. } else if (this.level == 2) {
  227. this.form = {
  228. range: '1',
  229. town: selectedRole.code
  230. }
  231. this.getHospital(selectedRole.code)
  232. } else {
  233. this.form = {
  234. range: '2',
  235. town: selectedRole.code.substring(0, 6),
  236. hospital: selectedRole.code
  237. }
  238. this.getTeam(selectedRole.code)
  239. }
  240. this.yearType = '1'
  241. this.chooseYear = new Date().getFullYear()
  242. this.chooseTime = null
  243. const now = new Date()
  244. // 获取当前日期
  245. const endDate = new Date()
  246. // 获取30天前的日期
  247. const startDate = new Date()
  248. startDate.setDate(endDate.getDate() - 30)
  249. this.chooseTime1 = [this.formatDate(startDate), this.formatDate(endDate)]
  250. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  251. this.init()
  252. this.$forceUpdate()
  253. },
  254. getHospital(code) {
  255. var vm = this
  256. delete this.form.hospital
  257. delete this.form.team
  258. var params = {
  259. type: 5,
  260. code: code
  261. }
  262. if (!code) {
  263. params = {
  264. type: 6,
  265. code: '350200'
  266. }
  267. }
  268. httpRequest.post('common/district', { data: params }).then(function (res) {
  269. vm.hospitalOptions = [{ code: '', name: '全部' }]
  270. vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  271. })
  272. },
  273. getTeam(code) {
  274. var vm = this
  275. delete this.form.team
  276. var params = {
  277. hospital: code,
  278. area: this.form.area
  279. }
  280. httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
  281. vm.teamOptions = [{ id: '', name: '全部' }]
  282. vm.teamOptions = vm.teamOptions.concat(res.data)
  283. })
  284. },
  285. handleCurrentChange(val) {
  286. this.page = val
  287. this.getList()
  288. },
  289. handleSizeChange(val) {
  290. this.size = val
  291. this.getList()
  292. },
  293. openDialog(row) {
  294. this.dialogVisible = true
  295. // console.log(row)
  296. this.currentInfo = row
  297. },
  298. getCode(idcard) {
  299. var vm = this
  300. this.patientCode = ''
  301. statisticAPI.getPatientAccetokenByIdcard({ idcard: idcard }).then(function (res) {
  302. if (res.status == 200) {
  303. vm.patientCode = res.data.patientCode
  304. var healthRecordServer = 'https://ijk.xmyys.com.cn/wlyy/profileweb/#/menzhen' //健康档案服务
  305. //var healthRecordServer="https://ijk.xmyys.com.cn/wlyytest/profileweb/#/menzhen" //健康档案服务wlyytest
  306. window.open(healthRecordServer + '?patientCode=' + res.data.patientCode)
  307. } else {
  308. vm.patientCode = ''
  309. this.$message.error('获取授权码失败')
  310. return
  311. }
  312. })
  313. }
  314. },
  315. mounted() {
  316. const now = new Date()
  317. // 获取当前日期
  318. const endDate = new Date()
  319. // 获取30天前的日期
  320. const startDate = new Date()
  321. startDate.setDate(endDate.getDate() - 30)
  322. this.chooseTime1 = [this.formatDate(startDate), this.formatDate(endDate)]
  323. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  324. this.init()
  325. }
  326. })