index.js 11 KB

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