index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. this.getHospital()
  107. } else if (selectedRole.code.length == 6) {
  108. // console.log('区管理')
  109. this.level = 2 // 区管理
  110. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code }]
  111. this.form = {
  112. range: '1',
  113. town: selectedRole.code
  114. }
  115. this.getHospital(selectedRole.code)
  116. } else {
  117. console.log('社区管理')
  118. this.level = 3 // 社区管理
  119. this.rangeOptions = [{ label: '机构', value: '2' }]
  120. this.areaOptions = [{ label: selectedRole.name.substring(0, 3), value: selectedRole.code.substring(0, 6) }]
  121. this.hospitalOptions = [{ name: selectedRole.name, code: selectedRole.code }]
  122. this.form = {
  123. range: '2',
  124. town: selectedRole.code.substring(0, 6),
  125. hospital: selectedRole.code
  126. }
  127. this.getTeam(selectedRole.code)
  128. }
  129. this.initTime()
  130. this.getList()
  131. },
  132. initTime() {
  133. var vm = this
  134. var now = new Date()
  135. vm.nowyear = vm.chooseYear = now.getFullYear()
  136. vm.years = []
  137. for (i = vm.nowyear; i >= 2013; i--) {
  138. vm.years.push(i)
  139. }
  140. },
  141. resetArea() {
  142. if (this.level == 1) {
  143. delete this.form.town
  144. delete this.form.hospital
  145. delete this.form.team
  146. } else if (this.level == 2) {
  147. delete this.form.hospital
  148. delete this.form.team
  149. } else {
  150. delete this.form.team
  151. }
  152. },
  153. back() {
  154. var vm = this
  155. vm.showTotalTable = true
  156. vm.serviceRecordVisable = false
  157. },
  158. getList() {
  159. var vm = this
  160. this.loading = true
  161. var params = {
  162. ...this.form,
  163. page: this.page,
  164. size: this.size,
  165. timeType: this.yearType
  166. }
  167. console.log('11111111111111111', this)
  168. if (this.yearType && this.yearType == 1) {
  169. if (this.chooseTime) {
  170. params.startTime = this.chooseTime[0]
  171. params.endTime = this.chooseTime[1]
  172. }
  173. } else if (this.yearType && this.yearType == 2) {
  174. if (this.chooseTime1) {
  175. params.startTime = this.chooseTime1[0]
  176. params.endTime = this.chooseTime1[1]
  177. }
  178. }
  179. httpRequest.get('doctor/twoCancers/count/patientArchive', { data: params }).then(function (res) {
  180. if (res.status == 200) {
  181. vm.tableData = res.detailModelList
  182. vm.total = res.totalCount
  183. }
  184. vm.loading = false
  185. })
  186. },
  187. onClickServiceRecord(record) {
  188. this.currentEditData = record.patient
  189. this.showTotalTable = false
  190. this.serviceRecordVisable = true
  191. },
  192. queryDate() {
  193. this.page = 1
  194. this.getList()
  195. },
  196. exportTable() {
  197. var vm = this
  198. var params = {
  199. ...this.form,
  200. page: this.page,
  201. size: this.size,
  202. timeType: this.yearType
  203. }
  204. if (this.yearType && this.yearType == 1) {
  205. if (this.chooseTime) {
  206. params.startTime = this.chooseTime[0]
  207. params.endTime = this.chooseTime[1]
  208. }
  209. } else if (this.yearType && this.yearType == 2) {
  210. if (this.chooseTime1) {
  211. params.startTime = this.chooseTime1[0]
  212. params.endTime = this.chooseTime1[1]
  213. }
  214. }
  215. var fileName = `两癌筛查居民档案${new Date().getTime()}.xls`
  216. httpRequest.downLoadFileForAjax('doctor/twoCancers/count/exportPatientArchive', fileName, params).then(function () {
  217. vm.$message.success('导出成功')
  218. })
  219. },
  220. eliminateClick() {
  221. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  222. console.log('11111111111111', this.level)
  223. if (this.level == 1) {
  224. this.form = {
  225. range: '1'
  226. }
  227. } else if (this.level == 2) {
  228. this.form = {
  229. range: '1',
  230. town: selectedRole.code
  231. }
  232. this.getHospital(selectedRole.code)
  233. } else {
  234. this.form = {
  235. range: '2',
  236. town: selectedRole.code.substring(0, 6),
  237. hospital: selectedRole.code
  238. }
  239. this.getTeam(selectedRole.code)
  240. }
  241. this.yearType = '1'
  242. this.chooseYear = new Date().getFullYear()
  243. this.chooseTime = null
  244. const now = new Date()
  245. // 获取当前日期
  246. const endDate = new Date()
  247. // 获取30天前的日期
  248. const startDate = new Date()
  249. startDate.setDate(endDate.getDate() - 30)
  250. this.chooseTime1 = [this.formatDate(startDate), this.formatDate(endDate)]
  251. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  252. this.init()
  253. this.$forceUpdate()
  254. },
  255. getHospital(code) {
  256. var vm = this
  257. // delete this.form.hospital
  258. // delete this.form.team
  259. // var params = {
  260. // type: 5,
  261. // code: code
  262. // }
  263. // if (!code) {
  264. // params = {
  265. // type: 6,
  266. // code: '350200'
  267. // }
  268. // }
  269. var data = {
  270. town: code ? code : this.form.town ? this.form.town : '',
  271. hospital: ''
  272. }
  273. // common/district
  274. httpRequest.get('doctor/twoCancers/count/hospitalList', { data }).then(function (res) {
  275. vm.hospitalOptions = []
  276. // vm.hospitalOptions = vm.hospitalOptions.concat(res.list)
  277. if (res.status == 200) {
  278. vm.hospitalOptions = [{ code: '', name: '全部' }]
  279. res.data.forEach(item => {
  280. vm.hospitalOptions.push({
  281. name: item.hospital_name,
  282. code: item.hospital
  283. })
  284. })
  285. }
  286. })
  287. },
  288. getTeam(code) {
  289. var vm = this
  290. delete this.form.team
  291. var params = {
  292. hospital: code,
  293. area: this.form.area
  294. }
  295. httpRequest.get('statisticsExport/teamList', { data: params }).then(function (res) {
  296. vm.teamOptions = [{ id: '', name: '全部' }]
  297. vm.teamOptions = vm.teamOptions.concat(res.data)
  298. })
  299. },
  300. handleCurrentChange(val) {
  301. this.page = val
  302. this.getList()
  303. },
  304. handleSizeChange(val) {
  305. this.size = val
  306. this.getList()
  307. },
  308. openDialog(row) {
  309. this.dialogVisible = true
  310. // console.log(row)
  311. this.currentInfo = row
  312. },
  313. getCode(idcard) {
  314. var vm = this
  315. this.patientCode = ''
  316. statisticAPI.getPatientAccetokenByIdcard({ idcard: idcard }).then(function (res) {
  317. if (res.status == 200) {
  318. vm.patientCode = res.data.patientCode
  319. var healthRecordServer = 'https://ijk.xmyys.com.cn/wlyy/profileweb/#/menzhen' //健康档案服务
  320. //var healthRecordServer="https://ijk.xmyys.com.cn/wlyytest/profileweb/#/menzhen" //健康档案服务wlyytest
  321. window.open(healthRecordServer + '?patientCode=' + res.data.patientCode)
  322. } else {
  323. vm.patientCode = ''
  324. this.$message.error('获取授权码失败')
  325. return
  326. }
  327. })
  328. }
  329. },
  330. mounted() {
  331. const now = new Date()
  332. // 获取当前日期
  333. const endDate = new Date()
  334. // 获取30天前的日期
  335. const startDate = new Date()
  336. startDate.setDate(endDate.getDate() - 30)
  337. this.chooseTime1 = [this.formatDate(startDate), this.formatDate(endDate)]
  338. this.chooseTime = [this.formatDate(startDate), this.formatDate(endDate)]
  339. this.init()
  340. }
  341. })