index.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. // 慢阻肺患者档案-服务档案
  2. var template = ''
  3. $.ajax('../../../component/statistics/CopdServiceRecord/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', {
  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. { label: '分配患者', value: 8 },
  89. { label: '添加患者', value: 9 },
  90. ],
  91. serviceYear: "",
  92. customizeYear: [],
  93. serviceNode: ""
  94. }
  95. },
  96. methods: {
  97. getNation() {
  98. var vm = this
  99. statisticAPI.getNationDict().then(function (res) {
  100. vm.nationDict = res.data
  101. vm.nationDict.forEach(function (item) {
  102. if (item.NATION_CODE == vm.followInfo.nation) {
  103. vm.nationName = item.NATION_NAME
  104. }
  105. })
  106. })
  107. },
  108. setLeftHeights() {
  109. this.$nextTick(() => {
  110. this.events.forEach((event, index) => {
  111. const rightContent = document.getElementById('right-' + index)
  112. const leftContent = document.getElementById('left-' + index)
  113. if (rightContent && leftContent) {
  114. leftContent.style.height = rightContent.offsetHeight + 'px'
  115. }
  116. })
  117. })
  118. },
  119. //字典
  120. getDictByDictName(value) {
  121. var vm = this
  122. statisticAPI.getDictByDictName({ name: value }).then(function (res) {
  123. if (value == 'jkcopd_marriage') {
  124. var arr = res.list
  125. arr.forEach(function (item) {
  126. if (item.code == vm.followInfo.marriage) {
  127. vm.marriageName = item.value
  128. }
  129. })
  130. } else if (value == 'jkcopd_smoke') {
  131. // var vm=this
  132. // vm.smokeArr=res.list
  133. } else if (value == 'jkcopd_drink') {
  134. // var vm=this
  135. // vm.drinkArr=res.list
  136. } else if (value == 'jkcopd_first_area') {
  137. var arr = res.list
  138. arr.forEach(function (item) {
  139. if (item.code == vm.followInfo.firstVisitArea) {
  140. vm.firstAreaName = item.value
  141. }
  142. })
  143. } else if (value == 'jkcopd_disease_conversion') {
  144. var arr = res.list
  145. arr.forEach(function (item) {
  146. if (item.code == vm.followInfo.diseaseConversion) {
  147. vm.diseaseConversion = item.value
  148. }
  149. })
  150. } else if (value == 'jkcopd_firstVisitType') {
  151. // vm.firstVisitTypeArr=res.list
  152. } else if (value == 'jkcopd_first_org_level') {
  153. var arr = res.list
  154. arr.forEach(function (item) {
  155. if (item.code == vm.followInfo.firstVisitOrgLevel) {
  156. vm.orGlevelName = item.value
  157. }
  158. })
  159. } else if (value == 'jkcopd_followup_status') {
  160. vm.followupArr = res.list
  161. vm.followupArr.forEach(function (item) {
  162. if (item.code == vm.followInfo.status) {
  163. vm.followup = item.value
  164. }
  165. })
  166. } else if (value == 'idCardType') {
  167. var arr = res.list
  168. arr.forEach(function (item) {
  169. if (item.code == vm.followInfo.idcardType) {
  170. vm.idcardTypeName = item.value
  171. }
  172. })
  173. } else if (value == 'jkcopd_occupation') {
  174. var arr = res.list
  175. arr.forEach(function (item) {
  176. if (item.code == vm.followInfo.occupation) {
  177. vm.occupation = item.value
  178. }
  179. })
  180. } else if (value == 'jkcopd_educational') {
  181. var arr = res.list
  182. arr.forEach(function (item) {
  183. if (item.code == vm.followInfo.educational) {
  184. vm.educational = item.value
  185. }
  186. })
  187. } else if (value == 'jkcopd_symptom') {
  188. var arr = res.list
  189. vm.symptomsArr = []
  190. var symptoms = vm.followInfo.symptom.split(',')
  191. arr.forEach(function (item) {
  192. symptoms.forEach(function (v) {
  193. if (v == item.code) {
  194. vm.symptomsArr.push(item.value)
  195. }
  196. })
  197. })
  198. vm.symptom = vm.symptomsArr.join()
  199. } else if (value == 'jkcopd_diagnosticBasis') {
  200. var arr = res.list
  201. arr.forEach(function (item) {
  202. if (item.code == vm.followInfo.diagnosticBasis) {
  203. vm.diagnosticBasisName = item.value
  204. }
  205. })
  206. }
  207. })
  208. },
  209. recordBack() {
  210. this.$emit('back')
  211. EventBus.$emit('copd-reset-select')
  212. },
  213. getDealRecord () {
  214. var vm = this
  215. vm.loading = true
  216. var params = {
  217. page: vm.page,
  218. size: vm.size,
  219. patient: vm.detailInfo.patient,
  220. type: vm.serviceNode
  221. }
  222. if(vm.serviceYear == 'customize'){
  223. params.startTime = vm.customizeYear[0]
  224. params.endTime = vm.customizeYear[1]
  225. }else if(vm.serviceYear != ''){
  226. params.startTime = vm.serviceYear + "-01-01"
  227. params.endTime = vm.serviceYear + "-12-31"
  228. } else{
  229. params.startTime = ''
  230. params.endTime = ''
  231. }
  232. statisticAPI.dealRecordPage(params).then(function (res) {
  233. res.detailModelList.forEach(function (item, index) {
  234. var time1 = res.detailModelList[index] && res.detailModelList[index].createTime && res.detailModelList[index].createTime.slice(0, 4)
  235. var time2 = res.detailModelList[index + 1] && res.detailModelList[index + 1].createTime && res.detailModelList[index + 1].createTime.slice(0, 4)
  236. if (index == 0) {
  237. item.flag = 1
  238. } else if (index != res.detailModelList.length - 1 && time1 == time2) {
  239. res.detailModelList[index + 1].flag = 0
  240. } else if (
  241. res.detailModelList.length - 1 == index &&
  242. res.detailModelList[index + 1] &&
  243. res.detailModelList[index + 1].createTime &&
  244. res.detailModelList[index] &&
  245. res.detailModelList[index].createTime
  246. ) {
  247. if (res.detailModelList[index - 1].createTime.slice(0, 4) == res.detailModelList[index].createTime.slice(0, 4)) {
  248. res.detailModelList[res.detailModelList.length - 1].flag = 0
  249. } else {
  250. res.detailModelList[res.detailModelList.length - 1].flag = 1
  251. }
  252. }
  253. })
  254. vm.loading = false
  255. vm.events = res.detailModelList
  256. })
  257. },
  258. showDetail(item) {
  259. var vm = this
  260. statisticAPI.followupDetail({ id: item.jkcopdFollowup.id }).then(function (res) {
  261. vm.followInfo = res.obj
  262. vm.dicName.forEach(function (item) {
  263. vm.getDictByDictName(item)
  264. })
  265. vm.getNation()
  266. // statisticAPI.getDictByDictName({name:'idCardType'}).then(function(res){
  267. // res.list.forEach(function(item){
  268. // if(item.code==vm.followInfo.idcardType){
  269. // vm.idcardTypeName=item.value
  270. // }
  271. // })
  272. // })
  273. vm.dialog = true
  274. })
  275. },
  276. getYearList() {
  277. for (var i = 0; i < 6; i++) {
  278. var year = new Date().getFullYear() - i
  279. this.yearList.push({ label: year, value: year })
  280. }
  281. this.yearList.push({ label: '自定义', value: 'customize' })
  282. },
  283. getTypeName(type){
  284. return this.nodeList.find(function(item){return item.value == type})?.label
  285. }
  286. },
  287. mounted() {
  288. // this.$nextTick(() => {
  289. // this.setLeftHeights();
  290. // });
  291. var vm = this
  292. this.getDealRecord()
  293. this.getYearList()
  294. }
  295. })