index.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. this.initTime()
  123. },
  124. getDictData() {
  125. var vm = this
  126. statisticAPI.getDictByDictName({ name: 'rehabilitation_status' }).then(function (res) {
  127. vm.statusOptions = [{ value: '全部', code: '' }]
  128. vm.statusOptions = vm.statusOptions.concat(res.list)
  129. })
  130. statisticAPI.getDictByDictName({ name: 'rehabilitation_hospital' }).then(function (res) {
  131. vm.rehabilitationHospital = [{ value: '全部', code: '' }]
  132. vm.rehabilitationHospital = vm.rehabilitationHospital.concat(res.list)
  133. })
  134. statisticAPI.getDictByDictName({ name: 'archive_status' }).then(function (res) {
  135. vm.archiveList = [{ value: '全部', code: '' }]
  136. vm.archiveList = vm.archiveList.concat(res.list)
  137. })
  138. },
  139. // 获取社区医院
  140. hospitalsByType: function () {
  141. var vm = this
  142. statisticAPI
  143. .hospitalsByType({
  144. type: 1,
  145. code: '350200'
  146. })
  147. .then(function (res) {
  148. if (res.status == 200) {
  149. vm.communityHospitals = [{ label: '全部', value: '' }]
  150. res.list.forEach(function (v) {
  151. vm.communityHospitals.push({
  152. value: v.code,
  153. label: v.name
  154. })
  155. })
  156. }
  157. })
  158. .catch(function (err) {
  159. console.log(err, 'Errr')
  160. })
  161. },
  162. handleCurrentChange(val) {
  163. this.page = val
  164. this.getList()
  165. },
  166. handleSizeChange(val) {
  167. this.size = val
  168. this.getList()
  169. },
  170. // 康复下转操作
  171. operation(num, item) {
  172. var vm = this
  173. if (num != 2) {
  174. statisticAPI
  175. .synchronizePationSingle({ id: item.id })
  176. .then(function (res) {
  177. if (res.status == 200) {
  178. vm.$message.success('操作成功')
  179. } else {
  180. vm.$message.error(res.msg)
  181. }
  182. })
  183. .catch(function (err) {
  184. console.log(err, 'Errr')
  185. })
  186. } else {
  187. vm.signatoryList = []
  188. statisticAPI
  189. .kangfuGetSignInfo({ idcard: item.idcard })
  190. .then(function (res) {
  191. if (res.status == 200) {
  192. if (res.data != null) {
  193. vm.signatoryList.push(res.data)
  194. }
  195. }
  196. })
  197. .catch(function (err) {
  198. console.log(err, 'Errr')
  199. })
  200. this.dialogVisible = true
  201. }
  202. }
  203. },
  204. mounted() {
  205. this.initTime()
  206. this.getDictData()
  207. this.hospitalsByType()
  208. this.getList()
  209. }
  210. })