index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. // 慢阻肺患者档案表格组件
  2. var template = ''
  3. $.ajax('../../../component/statistics/CopdPatientRecord/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-patient-record', {
  15. template: template,
  16. props: [],
  17. data() {
  18. return {
  19. docInfo: JSON.parse(window.localStorage.getItem('docInfo')),
  20. daLoading:false,
  21. dataList: [
  22. ],
  23. // 当前编辑的数据,点击编辑按钮后设置,取消或退出则清空
  24. currentEditData: null,
  25. // 编辑页面是否显示
  26. editViewVisable: false,
  27. //服务记录是否显示
  28. serviceRecordVisable: false,
  29. transferStatusOptions:[{code:'',value:'全部'}],
  30. recordStatusOptions:[{code:'',value:'全部'}],
  31. receivingHospitalList:[{code:'',name:'全部'}],
  32. receiveStatusOptions:[{value:'',label:'全部'},{value:'1',label:' 已接收'},{value:'0',label:' 未接收'}],
  33. survivalStatusOption:[{code:'',value:'全部'}],
  34. // 健康档案是否显示
  35. healthRecordVisable: false,
  36. page: 1,
  37. size: 50,
  38. currentSize:50,
  39. currentPage: 1,
  40. totalPage: 0,
  41. totalCount: 0,
  42. name:'',
  43. turnDownStatus:'',
  44. receiveStatus:'',
  45. archivesStatus:'',
  46. hospital:'',
  47. doctorName:'',
  48. isLive: '',
  49. firstOrg: '',
  50. currentSelect:[],
  51. dicName:['jkcopd_archivesStatus','jkcopd_turnDownStatus','jkcopd_isLive'],
  52. isShow: false,
  53. fileList: [],
  54. file: undefined,
  55. isProgressShow: false,
  56. percentage: 0,
  57. success: false,
  58. loading: false,
  59. isOver: false,
  60. status: "",
  61. errList: [],
  62. pickerOptions: {
  63. disabledDate(time) {
  64. let timeSpace = time.getTime() <= moment.toDate().getTime();
  65. return timeSpace;
  66. }
  67. },
  68. }
  69. },
  70. computed: {
  71. showTotalTable() {
  72. return (
  73. this.currentEditData == null &&
  74. this.editViewVisable == false &&
  75. this.serviceRecordVisable == false &&
  76. this.healthRecordVisable == false
  77. )
  78. },
  79. showEditView() {
  80. return this.currentEditData && this.editViewVisable
  81. }
  82. },
  83. mounted() {
  84. var vm = this
  85. this.hospitalList()
  86. EventBus.$on('copd-reset-select', function () {
  87. vm.currentEditData = null
  88. vm.editViewVisable = false
  89. vm.serviceRecordVisable = false
  90. vm.healthRecordVisable = false
  91. })
  92. EventBus.$on('copd-reset-save', function () {
  93. vm.currentEditData = null
  94. vm.editViewVisable = false
  95. vm.serviceRecordVisable = false
  96. vm.healthRecordVisable = false
  97. vm.getJkCopdPatientPage()
  98. vm.dicName.forEach(function(item) {
  99. vm.getDictByDictName(item)
  100. });
  101. })
  102. this.getJkCopdPatientPage()
  103. this.dicName.forEach(function(item) {
  104. vm.getDictByDictName(item)
  105. });
  106. },
  107. destroyed() {
  108. EventBus.$off('copd-reset-select')
  109. EventBus.$off('copd-reset-save')
  110. },
  111. methods: {
  112. handlePreview(value) {
  113. var vm = this
  114. var file = value.target.files[0]
  115. this.daLoading=true
  116. console.log(file,'vvvvvvvvvvvv',value,value.target.files[0])
  117. if(file && file.size) {
  118. var formFile = new FormData()
  119. formFile.append("file", file)
  120. httpRequest.post('doctor/jkCopd/importExcel',{
  121. data: formFile,
  122. cache: false,//上传文件无需缓存
  123. processData: false,//用于对data参数进行序列化处理 这里必须false
  124. contentType: false, //必须
  125. }).then(function(res) {
  126. if(res.status == 200) {
  127. vm.getJkCopdPatientPage()
  128. vm.dicName.forEach(function(item) {
  129. vm.getDictByDictName(item)
  130. });
  131. vm.daLoading=false
  132. vm.$message({
  133. message: '导入成功!',
  134. type: 'success'
  135. });
  136. } else {
  137. vm.$message.error('导入失败!')
  138. vm.daLoading=false
  139. }
  140. }).catch(function(e) {
  141. console.error(e)
  142. vm.daLoading=false
  143. })
  144. // statisticAPI.importExcel({file:formFile}).then(function(res){
  145. // console.log('22222222222',res)
  146. // })
  147. }
  148. },
  149. hospitalList(){
  150. var vm=this
  151. statisticAPI.hospitalList().then(function(res){
  152. vm.receivingHospitalList=vm.receivingHospitalList.concat(res.detailModelList)
  153. })
  154. },
  155. exportTable(){
  156. var vm=this
  157. vm.daLoading=true
  158. var params = {
  159. turnDownStatus:this.turnDownStatus,
  160. receiveStatus:this.receiveStatus,
  161. archivesStatus:this.archivesStatus,
  162. hospital:this.hospital,
  163. doctorName:this.doctorName,
  164. isLive: this.isLive,
  165. firstOrg: this.firstOrg
  166. }
  167. statisticAPI.exportJkCopdAchives(params,'居民档案.xls').then(
  168. function(res){
  169. vm.daLoading=false
  170. vm.$message({
  171. message: '导出成功!',
  172. type: 'success'
  173. });
  174. }
  175. )
  176. },
  177. selectionLineChangeHandle(val){
  178. var vm=this
  179. var arr=[]
  180. val.forEach(function(item){
  181. arr.push(item.id)
  182. })
  183. vm.currentSelect=arr
  184. },
  185. synPatient(){
  186. var vm=this
  187. if(vm.currentSelect.length){
  188. statisticAPI.synPatient({
  189. ids:vm.currentSelect.join(','),
  190. doctor: vm.docInfo.code
  191. }).then(function(res){
  192. if(res.status=='200'){
  193. vm.$message({
  194. message: res.message,
  195. type: 'success'
  196. });
  197. vm.getJkCopdPatientPage()
  198. vm.dicName.forEach(function(item) {
  199. vm.getDictByDictName(item)
  200. });
  201. }else{
  202. vm.$message({
  203. message: res.message,
  204. type: 'warning'
  205. });
  206. }
  207. })
  208. }else{
  209. vm.$message('请勾选患者!')
  210. }
  211. },
  212. queryDate(){
  213. this.getJkCopdPatientPage()
  214. },
  215. distributionHospital(){
  216. var vm=this
  217. if(vm.currentSelect.length){
  218. vm.daLoading=true
  219. statisticAPI.distributionHospital({
  220. type:1,
  221. ids:vm.currentSelect.join(','),
  222. doctor: vm.docInfo.code
  223. }).then(function(res){
  224. if(res.status=='200'){
  225. vm.daLoading=false
  226. vm.$message({
  227. message: res.message,
  228. type: 'success'
  229. });
  230. vm.getJkCopdPatientPage()
  231. vm.dicName.forEach(function(item) {
  232. vm.getDictByDictName(item)
  233. });
  234. }else{
  235. vm.daLoading=false
  236. vm.$message({
  237. message: res.message,
  238. type: 'warning'
  239. });
  240. }
  241. })
  242. }else{
  243. vm.daLoading=false
  244. vm.$message('请勾选患者!')
  245. }
  246. },
  247. eliminateClick(){
  248. this.name='',
  249. this.turnDownStatus='',
  250. this.receiveStatus='',
  251. this.archivesStatus='',
  252. this.hospital='',
  253. this.doctorName='',
  254. this.isLive= '',
  255. this.firstOrg= ''
  256. },
  257. //下转状态
  258. getDictByDictName(value){
  259. var vm=this
  260. statisticAPI.getDictByDictName({name:value}).then(function(res){
  261. if(value=='jkcopd_turnDownStatus'){
  262. vm.transferStatusOptions= vm.transferStatusOptions.concat(res.list)
  263. }else if(value=='jkcopd_archivesStatus'){
  264. vm.recordStatusOptions=vm.recordStatusOptions.concat(res.list)
  265. }else if(value=='jkcopd_isLive'){
  266. vm.survivalStatusOption= vm.survivalStatusOption.concat(res.list)
  267. }
  268. })
  269. },
  270. onClickEdit(record) {
  271. if (!record) {
  272. return
  273. }
  274. this.currentEditData = record
  275. this.editViewVisable = true
  276. },
  277. onClickServiceRecord(record) {
  278. this.currentEditData = record
  279. this.serviceRecordVisable = true
  280. },
  281. onClickHealthRecord(record) {
  282. console.log('ssssssssssssssss',record)
  283. var healthRecordServer="http://www.xmtyw.cn/wlyy/profileweb/#/" //健康档案服务
  284. var healthRecordServer="https://www.xmtyw.cn/wlyytest/profileweb/#/" //健康档案服务wlyytest
  285. window.open(healthRecordServer + '?patientCode=' + record.patient)
  286. // this.healthRecordVisable = true
  287. },
  288. handleCurrentChange:function(val) {
  289. this.page = val
  290. this.getJkCopdPatientPage()
  291. },
  292. getJkCopdPatientPage: function (val) {
  293. this.daLoading=true
  294. var vm =this
  295. var params = {
  296. page: this.page,
  297. size: this.size,
  298. name:this.name,
  299. turnDownStatus:this.turnDownStatus,
  300. receiveStatus:this.receiveStatus,
  301. archivesStatus:this.archivesStatus,
  302. hospital:this.hospital,
  303. doctorName:this.doctorName,
  304. isLive: this.isLive,
  305. firstOrg: this.firstOrg
  306. }
  307. statisticAPI.jkCopdAchivesPage(params).then(function (res) {
  308. vm.totalCount = res.totalCount
  309. vm.totalPage = res.totalPage
  310. vm.currentPage=res.currPage
  311. vm.dataList = res.detailModelList
  312. console.log(vm.currentPage,res,'88888888888')
  313. vm.daLoading=false
  314. })
  315. },
  316. //上传
  317. toggle(isShow){
  318. this.isShow = isShow
  319. if(!isShow){
  320. this.reset()
  321. }
  322. },
  323. reset(type){
  324. this.percentage = 0
  325. this.success = false
  326. this.isOver = false
  327. this.errList = []
  328. if(type!=1){
  329. this.loading = false
  330. this.file = undefined
  331. this.month = ""
  332. }
  333. },
  334. close(type){
  335. this.reset(type)
  336. this.isProgressShow = false
  337. if(type!=1){
  338. this.isShow = false
  339. }
  340. },
  341. beforeUploadPic(file){
  342. console.log(file,'000000000000000000000')
  343. this.file = file
  344. },
  345. check(){
  346. var vm = this
  347. vm.loading = true
  348. if(!vm.file){
  349. vm.loading = false
  350. vm.$message('请选择文件');
  351. return
  352. }
  353. vm.save()
  354. },
  355. save(){
  356. var vm = this
  357. vm.daLoading=true
  358. var formData = new FormData()
  359. formData.append("file", vm.file)
  360. // vm.initProgress()
  361. console.log(formData, 'formData');
  362. httpRequest.post('doctor/jkCopd/importExcel',{
  363. data: formData,
  364. cache: false,//上传文件无需缓存
  365. processData: false,//用于对data参数进行序列化处理 这里必须false
  366. contentType: false, //必须
  367. }).then(function(res) {
  368. if(res.status == 200) {
  369. vm.getJkCopdPatientPage()
  370. vm.dicName.forEach(function(item) {
  371. vm.getDictByDictName(item)
  372. });
  373. vm.daLoading=false
  374. vm.isShow = false
  375. vm.$message({
  376. message: '导入成功!',
  377. type: 'success'
  378. });
  379. } else {
  380. vm.$message.error('导入失败!')
  381. vm.daLoading=false
  382. }
  383. }).catch(function(e) {
  384. console.error(e)
  385. vm.daLoading=false
  386. })
  387. },
  388. initProgress(){
  389. var vm = this
  390. this.isProgressShow = true
  391. setTimeout(()=>{
  392. if(!vm.isOver && vm.percentage!=90){
  393. vm.percentage += 10
  394. vm.initProgress()
  395. }
  396. }, 1000)
  397. }
  398. }
  399. })