index.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. // 两癌筛查居民档案-服务记录
  2. var template = ''
  3. $.ajax('../../../component/statistics/CopdServiceRecordPatient/index.html', {
  4. data: {},
  5. dataType: 'html',
  6. cache: false,
  7. timeout: 60000,
  8. async: false,
  9. error: function (res) {},
  10. success: function (res) {
  11. template = res
  12. }
  13. })
  14. Vue.component('Copd-service-record-patient', {
  15. template: template,
  16. props: ['detailInfo'],
  17. data() {
  18. return {
  19. dialog: false,
  20. loading: false,
  21. page: 1,
  22. size: 999,
  23. idcardTypeName: '',
  24. followInfo: {},
  25. events: [
  26. { date: '2023年' },
  27. { title: 'Event 1', date: '05-11 17:00:01', description: 'Description for event 1' },
  28. { date: '2024年', description: 'Description for event 2' },
  29. { date: '2025年', description: 'Description for event 3' },
  30. { date: '2026年', description: 'Description for event 4' },
  31. { title: 'Event 5', date: '2027年', description: 'Description for event 5' }
  32. ],
  33. dicName: [
  34. 'jkcopd_back_type',
  35. 'jkcopd_followup_status',
  36. 'jkcopd_symptom',
  37. 'jkcopd_isLive',
  38. 'jkcopd_first_area',
  39. 'jkcopd_first_org_level',
  40. 'jkcopd_marriage',
  41. 'jkcopd_occupation',
  42. 'jkcopd_smoke',
  43. 'jkcopd_drink',
  44. 'jkcopd_archivesStatus',
  45. 'jkcopd_disease_conversion',
  46. 'jkcopd_firstVisitType',
  47. 'jkcopd_educational',
  48. 'idCardType',
  49. 'jkcopd_diagnosticBasis'
  50. ],
  51. marriageArr: [],
  52. backTypeName: '',
  53. diagnosticBasisName: '',
  54. marriageName: '',
  55. symptom: '',
  56. symptomsArr: [],
  57. followupArr: [],
  58. followup: '',
  59. idCardTypeArr: [],
  60. firstAreaArr: [],
  61. firstAreaName: '',
  62. isLiveArr: [],
  63. orgLevelArr: [],
  64. orGlevelName: '',
  65. occupationArr: [],
  66. occupation: '',
  67. smokeArr: [],
  68. drinkArr: [],
  69. archivesArr: [],
  70. diseaseConversion: '',
  71. conversionArr: [],
  72. firstVisitTypeArr: [],
  73. educationalArr: [],
  74. educational: '',
  75. nationDict: [],
  76. nationName: '',
  77. communityArr: [],
  78. yearList: [{ label: '全部年份', value: '' }],
  79. nodeList: [
  80. { label: '全部节点', value: '' },
  81. { label: '居民预约', value: 1 },
  82. { label: '乳腺临床检查', value: 2 },
  83. { label: '辅助检查-乳腺超声', value: 3 },
  84. { label: '辅助检查-乳腺钼靶', value: 4 },
  85. { label: '乳腺病理学检查', value: 5 },
  86. { label: '乳腺外科门诊', value: 6 },
  87. { label: '乳腺癌治疗信息', value: 7 }
  88. ],
  89. nodeList2: [
  90. { label: '社区随访', value: 8 },
  91. { label: '妇科检查', value: 9 },
  92. { label: 'HPV', value: 10 },
  93. { label: '宫颈细胞学检查', value: 11 },
  94. { label: '初筛结果临床评估', value: 12 },
  95. { label: '阴道镜检查', value: 13 },
  96. { label: '阴道镜检查随访', value: 14 },
  97. { label: '组织病理学检查', value: 15 },
  98. { label: '组织病理学检查随访', value: 16 },
  99. { label: '最后诊断', value: 17 }
  100. ],
  101. serviceYear: '',
  102. customizeYear: [],
  103. serviceNode: '',
  104. changeModule: 1,
  105. moreFlag: true
  106. }
  107. },
  108. methods: {
  109. getMore() {
  110. this.moreFlag = !this.moreFlag
  111. if (this.moreFlag) {
  112. this.nodeList.splice(8, 10)
  113. } else {
  114. this.nodeList = [...this.nodeList, ...this.nodeList2]
  115. }
  116. },
  117. getNation() {
  118. var vm = this
  119. statisticAPI.getNationDict().then(function (res) {
  120. vm.nationDict = res.data
  121. vm.nationDict.forEach(function (item) {
  122. if (item.NATION_CODE == vm.followInfo.nation) {
  123. vm.nationName = item.NATION_NAME
  124. }
  125. })
  126. })
  127. },
  128. setLeftHeights() {
  129. this.$nextTick(() => {
  130. this.events.forEach((event, index) => {
  131. const rightContent = document.getElementById('right-' + index)
  132. const leftContent = document.getElementById('left-' + index)
  133. if (rightContent && leftContent) {
  134. leftContent.style.height = rightContent.offsetHeight + 'px'
  135. }
  136. })
  137. })
  138. },
  139. //字典
  140. getDictByDictName(value) {
  141. var vm = this
  142. statisticAPI.getDictByDictName({ name: value }).then(function (res) {
  143. if (value == 'jkcopd_marriage') {
  144. var arr = res.list
  145. arr.forEach(function (item) {
  146. if (item.code == vm.followInfo.marriage) {
  147. vm.marriageName = item.value
  148. }
  149. })
  150. } else if (value == 'jkcopd_smoke') {
  151. // var vm=this
  152. // vm.smokeArr=res.list
  153. } else if (value == 'jkcopd_drink') {
  154. // var vm=this
  155. // vm.drinkArr=res.list
  156. } else if (value == 'jkcopd_first_area') {
  157. var arr = res.list
  158. arr.forEach(function (item) {
  159. if (item.code == vm.followInfo.firstVisitArea) {
  160. vm.firstAreaName = item.value
  161. }
  162. })
  163. } else if (value == 'jkcopd_disease_conversion') {
  164. var arr = res.list
  165. arr.forEach(function (item) {
  166. if (item.code == vm.followInfo.diseaseConversion) {
  167. vm.diseaseConversion = item.value
  168. }
  169. })
  170. } else if (value == 'jkcopd_firstVisitType') {
  171. // vm.firstVisitTypeArr=res.list
  172. } else if (value == 'jkcopd_first_org_level') {
  173. var arr = res.list
  174. arr.forEach(function (item) {
  175. if (item.code == vm.followInfo.firstVisitOrgLevel) {
  176. vm.orGlevelName = item.value
  177. }
  178. })
  179. } else if (value == 'jkcopd_followup_status') {
  180. vm.followupArr = res.list
  181. vm.followupArr.forEach(function (item) {
  182. if (item.code == vm.followInfo.status) {
  183. vm.followup = item.value
  184. }
  185. })
  186. } else if (value == 'idCardType') {
  187. var arr = res.list
  188. arr.forEach(function (item) {
  189. if (item.code == vm.followInfo.idcardType) {
  190. vm.idcardTypeName = item.value
  191. }
  192. })
  193. } else if (value == 'jkcopd_occupation') {
  194. var arr = res.list
  195. arr.forEach(function (item) {
  196. if (item.code == vm.followInfo.occupation) {
  197. vm.occupation = item.value
  198. }
  199. })
  200. } else if (value == 'jkcopd_educational') {
  201. var arr = res.list
  202. arr.forEach(function (item) {
  203. if (item.code == vm.followInfo.educational) {
  204. vm.educational = item.value
  205. }
  206. })
  207. } else if (value == 'jkcopd_symptom') {
  208. var arr = res.list
  209. vm.symptomsArr = []
  210. var symptoms = vm.followInfo.symptom.split(',')
  211. arr.forEach(function (item) {
  212. symptoms.forEach(function (v) {
  213. if (v == item.code) {
  214. vm.symptomsArr.push(item.value)
  215. }
  216. })
  217. })
  218. vm.symptom = vm.symptomsArr.join()
  219. } else if (value == 'jkcopd_diagnosticBasis') {
  220. var arr = res.list
  221. arr.forEach(function (item) {
  222. if (item.code == vm.followInfo.diagnosticBasis) {
  223. vm.diagnosticBasisName = item.value
  224. }
  225. })
  226. }
  227. })
  228. },
  229. recordBack() {
  230. this.$emit('back')
  231. EventBus.$emit('copd-reset-select')
  232. },
  233. getDealRecord() {
  234. var vm = this
  235. vm.loading = true
  236. var params = {
  237. page: vm.page,
  238. size: vm.size,
  239. patient: vm.detailInfo && vm.detailInfo.patient ? vm.detailInfo.patient : null,
  240. type: vm.serviceNode
  241. }
  242. if (vm.serviceYear == 'customize') {
  243. params.startTime = vm.customizeYear[0]
  244. params.endTime = vm.customizeYear[1]
  245. } else if (vm.serviceYear != '') {
  246. params.startTime = vm.serviceYear + '-01-01'
  247. params.endTime = vm.serviceYear + '-12-31'
  248. } else {
  249. params.startTime = ''
  250. params.endTime = ''
  251. }
  252. statisticAPI.dealRecordPage(params).then(function (res) {
  253. res.detailModelList.forEach(function (item, index) {
  254. var time1 = res.detailModelList[index] && res.detailModelList[index].createTime && res.detailModelList[index].createTime.slice(0, 4)
  255. var time2 = res.detailModelList[index + 1] && res.detailModelList[index + 1].createTime && res.detailModelList[index + 1].createTime.slice(0, 4)
  256. if (index == 0) {
  257. item.flag = 1
  258. } else if (index != res.detailModelList.length - 1 && time1 == time2) {
  259. res.detailModelList[index + 1].flag = 0
  260. } else if (
  261. res.detailModelList.length - 1 == index &&
  262. res.detailModelList[index + 1] &&
  263. res.detailModelList[index + 1].createTime &&
  264. res.detailModelList[index] &&
  265. res.detailModelList[index].createTime
  266. ) {
  267. if (res.detailModelList[index - 1].createTime.slice(0, 4) == res.detailModelList[index].createTime.slice(0, 4)) {
  268. res.detailModelList[res.detailModelList.length - 1].flag = 0
  269. } else {
  270. res.detailModelList[res.detailModelList.length - 1].flag = 1
  271. }
  272. }
  273. })
  274. vm.loading = false
  275. vm.events = res.detailModelList
  276. })
  277. },
  278. showDetail(item) {
  279. var vm = this
  280. statisticAPI.followupDetail({ id: item.jkcopdFollowup.id }).then(function (res) {
  281. vm.followInfo = res.obj
  282. vm.dicName.forEach(function (item) {
  283. vm.getDictByDictName(item)
  284. })
  285. vm.getNation()
  286. // statisticAPI.getDictByDictName({name:'idCardType'}).then(function(res){
  287. // res.list.forEach(function(item){
  288. // if(item.code==vm.followInfo.idcardType){
  289. // vm.idcardTypeName=item.value
  290. // }
  291. // })
  292. // })
  293. vm.dialog = true
  294. })
  295. },
  296. getYearList() {
  297. for (var i = 0; i < 6; i++) {
  298. var year = new Date().getFullYear() - i
  299. this.yearList.push({ label: year, value: year })
  300. }
  301. this.yearList.push({ label: '自定义', value: 'customize' })
  302. },
  303. getTypeName(type) {
  304. return this.nodeList.find(function (item) {
  305. return item.value == type
  306. })?.label
  307. }
  308. },
  309. mounted() {
  310. // this.$nextTick(() => {
  311. // this.setLeftHeights();
  312. // });
  313. console.log('创建66666')
  314. var vm = this
  315. this.getDealRecord()
  316. this.getYearList()
  317. }
  318. })