index.js 10 KB

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