index.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. var template = ''
  2. $.ajax('../../../component/statistics/TurndownDetail/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('turndown-detail', {
  14. template: template,
  15. props: [],
  16. data: function () {
  17. return {
  18. chooseTime: null,
  19. statusOptions: [],
  20. form: {
  21. status: '',
  22. hospitalCode: '',
  23. orgCode: '',
  24. archiveStatus: '',
  25. patientType: ''
  26. },
  27. loading: false,
  28. exportLoading: false,
  29. tableData: [],
  30. tableHeader: [
  31. { label: '患者姓名', prop: 'name', width: '90' },
  32. { label: '年龄', prop: 'age', width: '90' },
  33. { label: '性别', prop: 'sex', width: '90' },
  34. { label: '患者手机号', prop: 'mobile', width: '130' },
  35. { label: '下转医院', prop: 'hospitalName', width: '170' },
  36. { label: '下转医生', prop: 'hospitalDoctor', width: '90' },
  37. { label: '下转时间', prop: 'createTime', width: '90' },
  38. { label: '患者类型', prop: 'patientType', width: '90' },
  39. { label: '下转状态', prop: 'statusName', width: '110' },
  40. { label: '接收社区医院', prop: 'orgName', width: '110' },
  41. { label: '接收签约医生', prop: 'doctorName', width: '170' },
  42. { label: '接收时间', prop: 'receiveTime', width: '90' },
  43. { label: '档案状态', prop: 'archiveStatusName', width: '130' }
  44. ],
  45. communityHospitals: [],
  46. archiveList: [],
  47. rehabilitationHospital: [],
  48. inviteStatus: [
  49. { value: '', label: '全部' },
  50. { value: '1', label: '门诊患者' },
  51. { value: '2', label: '出院患者' }
  52. ],
  53. signatoryList: [],
  54. page: 1,
  55. size: 10,
  56. total: 0,
  57. dialogVisible: false
  58. }
  59. },
  60. methods: {
  61. initTime() {
  62. var date = new Date()
  63. var maxTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
  64. var date1 = new Date(date.getTime() - 2592000000)
  65. var minTime = `${date1.getFullYear()}-${date1.getMonth() + 1}-${date1.getDate()}`
  66. this.chooseTime = [minTime, maxTime]
  67. },
  68. getList() {
  69. var vm = this
  70. this.loading = true
  71. var params = {
  72. ...this.form,
  73. page: this.page,
  74. size: this.size
  75. }
  76. if (this.chooseTime) {
  77. params.startTime = this.chooseTime[0]
  78. params.endTime = this.chooseTime[1]
  79. }
  80. httpRequest.get('doctor/specialist/rehabilitation/rehabilitationPatientInfo', { data: params }).then(function (res) {
  81. if (res.status == 200) {
  82. vm.tableData = res.detailModelList
  83. vm.total = res.totalCount
  84. }
  85. vm.loading = false
  86. })
  87. },
  88. queryDate() {
  89. this.page = 1
  90. this.getList()
  91. },
  92. exportTable() {
  93. var vm = this
  94. var params = {
  95. ...this.form,
  96. page: this.page,
  97. size: this.size
  98. }
  99. if (this.chooseTime) {
  100. params.startTime = this.chooseTime[0]
  101. params.endTime = this.chooseTime[1]
  102. }
  103. this.exportLoading = true
  104. var fileName = `康复下转明细${new Date().getTime()}.xls`
  105. statisticAPI
  106. .exportRehabilitationPatientInfo(params, fileName)
  107. .then(function (res) {
  108. vm.exportLoading = false
  109. })
  110. .catch(function (err) {
  111. vm.exportLoading = false
  112. })
  113. },
  114. eliminateClick() {
  115. this.form = {
  116. status: '',
  117. hospitalCode: '',
  118. orgCode: '',
  119. archiveStatus: '',
  120. patientType: ''
  121. }
  122. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  123. // 如果是社区管理员
  124. if(selectedRole.code.length > 6){
  125. this.form.orgCode = selectedRole.code
  126. }
  127. this.initTime()
  128. },
  129. getDictData() {
  130. var vm = this
  131. statisticAPI.getDictByDictName({ name: 'rehabilitation_status' }).then(function (res) {
  132. vm.statusOptions = [{ value: '全部', code: '' }]
  133. vm.statusOptions = vm.statusOptions.concat(res.list)
  134. })
  135. statisticAPI.getDictByDictName({ name: 'rehabilitation_hospital' }).then(function (res) {
  136. vm.rehabilitationHospital = [{ value: '全部', code: '' }]
  137. vm.rehabilitationHospital = vm.rehabilitationHospital.concat(res.list)
  138. })
  139. statisticAPI.getDictByDictName({ name: 'archive_status' }).then(function (res) {
  140. vm.archiveList = [{ value: '全部', code: '' }]
  141. vm.archiveList = vm.archiveList.concat(res.list)
  142. })
  143. },
  144. // 获取社区医院
  145. hospitalsByType: function () {
  146. var vm = this
  147. // var code
  148. var selectedRole = JSON.parse(sessionStorage.getItem('selectedRole'))
  149. if (selectedRole.code.indexOf('350200') > -1) {
  150. code = '350200' // 市卫健委
  151. } else if (selectedRole.code.length == 6) {
  152. code = selectedRole.code
  153. } else {
  154. this.level = 3 // 社区管理
  155. }
  156. if (selectedRole.code.length > 6) {
  157. this.communityHospitals = [{ label: selectedRole.name, value: selectedRole.code }]
  158. this.form.orgCode = selectedRole.code
  159. } else {
  160. var type = 1
  161. if (selectedRole.code.indexOf('350200') > -1) {
  162. type = 1 // 市卫健委
  163. } else if (selectedRole.code.length == 6) {
  164. type = 2
  165. }
  166. statisticAPI
  167. .hospitalsByType({
  168. type: type,
  169. code: selectedRole.code
  170. })
  171. .then(function (res) {
  172. if (res.status == 200) {
  173. vm.communityHospitals = [{ label: '全部', value: '' }]
  174. res.list.forEach(function (v) {
  175. vm.communityHospitals.push({
  176. value: v.code,
  177. label: v.name
  178. })
  179. })
  180. }
  181. })
  182. .catch(function (err) {
  183. console.log(err, 'Errr')
  184. })
  185. }
  186. },
  187. handleCurrentChange(val) {
  188. this.page = val
  189. this.getList()
  190. },
  191. handleSizeChange(val) {
  192. this.size = val
  193. this.getList()
  194. },
  195. // 康复下转操作
  196. operation(num, item) {
  197. var vm = this
  198. if (num != 2) {
  199. statisticAPI
  200. .synchronizePationSingle({ id: item.id })
  201. .then(function (res) {
  202. if (res.status == 200) {
  203. vm.$message.success('操作成功')
  204. } else {
  205. vm.$message.error(res.msg)
  206. }
  207. })
  208. .catch(function (err) {
  209. console.log(err, 'Errr')
  210. })
  211. } else {
  212. vm.signatoryList = []
  213. statisticAPI
  214. .kangfuGetSignInfo({ idcard: item.idcard })
  215. .then(function (res) {
  216. if (res.status == 200) {
  217. if (res.data != null) {
  218. vm.signatoryList.push(res.data)
  219. }
  220. }
  221. })
  222. .catch(function (err) {
  223. console.log(err, 'Errr')
  224. })
  225. this.dialogVisible = true
  226. }
  227. },
  228. transformData(data, prop) {
  229. if (prop == 'sex') {
  230. if (data == 0) {
  231. return '男'
  232. } else {
  233. return '女'
  234. }
  235. } else {
  236. return data
  237. }
  238. }
  239. },
  240. mounted() {
  241. this.initTime()
  242. this.getDictData()
  243. this.hospitalsByType()
  244. this.getList()
  245. }
  246. })