index.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  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. currentEditData: null,
  24. // 编辑页面是否显示
  25. editViewVisable: false,
  26. userRoleCode: '',
  27. //服务记录是否显示
  28. serviceRecordVisable: false,
  29. transferStatusOptions: [{ code: '', value: '全部' }],
  30. recordStatusOptions: [{ code: '', value: '全部' }],
  31. followStatusArr: [{ code: '', value: '全部' }],
  32. receivingHospitalList: [{ code: '', name: '全部' }],
  33. receiveStatusOptions: [
  34. { value: '', label: '全部' },
  35. { value: '1', label: ' 已接收' },
  36. { value: '0', label: ' 未接收' }
  37. ],
  38. survivalStatusOption: [{ code: '', value: '全部' }],
  39. // 健康档案是否显示
  40. healthRecordVisable: false,
  41. page: 1,
  42. size: 20,
  43. rangeList: [
  44. { name: '按区', code: 'town' },
  45. { name: '按社区', code: 'hospital' }
  46. ],
  47. rangeCode: 'town',
  48. totalPage: 0,
  49. totalCount: 0,
  50. name: '',
  51. years: '',
  52. turnDownStatus: '',
  53. receiveStatus: '',
  54. archivesStatus: '',
  55. hospital: '',
  56. doctorName: '',
  57. isLive: '',
  58. patientCode: '',
  59. firstOrg: '',
  60. currentSelect: [],
  61. followupStatus: [],
  62. dicName: ['jkcopd_archivesStatus', 'jkcopd_turnDownStatus', 'jkcopd_isLive', 'jkcopd_followup_status'],
  63. isShow: false,
  64. startTime: '',
  65. endTime: '',
  66. chooseYear: '',
  67. nowyear: '',
  68. areaList: [],
  69. areaCode: null,
  70. communityCode: null,
  71. fileList: [],
  72. file: undefined,
  73. isProgressShow: false,
  74. percentage: 0,
  75. success: false,
  76. loading: false,
  77. isOver: false,
  78. status: '',
  79. errList: [],
  80. pickerOptions: {
  81. disabledDate(time) {
  82. let timeSpace = time.getTime() <= moment.toDate().getTime()
  83. return timeSpace
  84. }
  85. },
  86. communityList: [],
  87. allocationForm: {},
  88. doctorList: [],
  89. allocationDialog: false,
  90. isGuGan: false, // 判断是否是骨干,若是显示分配,若不是显示批量分配
  91. exportStandardLoading: false,
  92. selectLoading: false
  93. }
  94. },
  95. computed: {
  96. showTotalTable() {
  97. return this.currentEditData == null && this.editViewVisable == false && this.serviceRecordVisable == false && this.healthRecordVisable == false
  98. },
  99. showEditView() {
  100. return this.currentEditData && this.editViewVisable
  101. }
  102. },
  103. mounted() {
  104. var vm = this
  105. var userRole = window.sessionStorage.getItem('selectedRole')
  106. vm.userRoleCode = JSON.parse(userRole).code
  107. this.initTime(vm)
  108. if(this.docInfo.expandLevelName){
  109. this.isGuGan = this.docInfo.expandLevelName.indexOf('慢病骨干') > -1
  110. }
  111. this.initScope(3)
  112. if(this.isGuGan){
  113. // 如何是慢病骨干 则只能选社区,并且限定死社区
  114. this.rangeList = [
  115. { name: '按社区', code: 'hospital' }
  116. ]
  117. this.rangeCode = 'hospital'
  118. this.areaList = [
  119. {name: this.docInfo.hospitalName.substring(0,3),code:this.docInfo.town}
  120. ]
  121. this.areaCode = this.docInfo.town
  122. this.communityList = [
  123. { name: this.docInfo.hospitalName,code:this.docInfo.hospital }
  124. ]
  125. this.communityCode = this.docInfo.hospital
  126. vm.receivingHospitalList = [{code:this.docInfo.hospital,name:this.docInfo.hospitalName}]
  127. this.hospital = this.docInfo.hospital
  128. }else{
  129. this.hospitalList()
  130. }
  131. EventBus.$on('copd-reset-select', function () {
  132. vm.currentEditData = null
  133. vm.editViewVisable = false
  134. vm.serviceRecordVisable = false
  135. vm.healthRecordVisable = false
  136. })
  137. EventBus.$on('copd-reset-save', function () {
  138. vm.currentEditData = null
  139. vm.editViewVisable = false
  140. vm.serviceRecordVisable = false
  141. vm.healthRecordVisable = false
  142. ;(vm.transferStatusOptions = [{ code: '', value: '全部' }]),
  143. (vm.recordStatusOptions = [{ code: '', value: '全部' }]),
  144. (vm.followStatusArr = [{ code: '', value: '全部' }]),
  145. (vm.receiveStatusOptions = [
  146. { value: '', label: '全部' },
  147. { value: '1', label: ' 已接收' },
  148. { value: '0', label: ' 未接收' }
  149. ]),
  150. (vm.survivalStatusOption = [{ code: '', value: '全部' }]),
  151. vm.getJkCopdPatientPage()
  152. vm.dicName.forEach(function (item) {
  153. vm.getDictByDictName(item)
  154. })
  155. })
  156. this.dicName.forEach(function (item) {
  157. vm.getDictByDictName(item)
  158. })
  159. setTimeout(function(){
  160. // vm.getJkCopdPatientPage()
  161. },200)
  162. },
  163. watch:{
  164. rangeCode(nv){
  165. if(nv == 'hospital'){
  166. this.initScope(5)
  167. }
  168. }
  169. },
  170. destroyed() {
  171. EventBus.$off('copd-reset-select')
  172. EventBus.$off('copd-reset-save')
  173. },
  174. methods: {
  175. // 初始化时间
  176. initTime(vm) {
  177. var now = new Date()
  178. vm.endTime = now.format('yyyy-MM-dd')
  179. var start = now.getFullYear() + '-' + '01-01'
  180. vm.startTime = new Date(start).format('yyyy-MM-dd')
  181. vm.nowyear = vm.chooseYear = now.getFullYear()
  182. vm.chooseYear = '全部'
  183. vm.nowmonth = now.getMonth() + 1
  184. vm.years = ['全部']
  185. for (i = vm.nowyear; i >= 2013; i--) {
  186. vm.years.push(i)
  187. }
  188. },
  189. // 数据范围初始化
  190. initScope(type) {
  191. var vm = this
  192. //获得缓存中缓存的角色权限
  193. var userRole = window.sessionStorage.getItem('selectedRole')
  194. if (!userRole) {
  195. return false
  196. }
  197. vm.userRole = JSON.parse(userRole)
  198. vm.areaTitle = vm.userRole.name
  199. if(vm.isGuGan){
  200. return
  201. }
  202. if (type == 3) {
  203. this.areaCode = null
  204. this.communityCode = null
  205. if (vm.userRole.code == '350200' || vm.userRole.code == 'jk_350200') {
  206. vm.getDistrict(type, 350200, '厦门市')
  207. } else if (vm.userRole.code.indexOf('jk_') > -1) {
  208. vm.getDistrict(type, vm.userRole.code.substring(3), vm.areaTitle.substring(0, 3))
  209. } else if (vm.userRole.code.length == 6) {
  210. vm.getDistrict(type, vm.userRole.code, vm.areaTitle.substring(0, 3))
  211. }
  212. }else{
  213. this.communityCode = null
  214. if(this.rangeCode == 'hospital')vm.getDistrict(type, vm.areaCode)
  215. }
  216. //level:2、市,3、区,4、社区,5、团队
  217. // vm.initareaLevel = vm.areaLevel = vm.userRole.code == 'jk_350200' ? 2 : vm.userRole.code.length == 9 ? 3 : 4
  218. // vm.initlevel = vm.level = vm.userRole.code == 'jk_350200' ? 4 : vm.userRole.code.length == 9 ? 3 : 2
  219. // // if(vm.userRole.code == 'jk_350200'||vm.userRole.code =='350200'){
  220. // // vm.initareaLevel = vm.areaLevel = 2
  221. // // vm.initlevel = vm.level = 4
  222. // // }else if(vm.userRole.code.length == 9){
  223. // // vm.initareaLevel = vm.areaLevel = 3
  224. // // vm.initlevel = vm.level = 3
  225. // // }else{
  226. // // vm.initareaLevel = vm.areaLevel = 4
  227. // // vm.initlevel = vm.level = 2
  228. // // }
  229. // console.log(vm.initlevel);
  230. // vm.initarea = vm.area = vm.userRole.code
  231. // vm.areaTitle = vm.userRole.name
  232. // if (vm.initlevel == 4) {
  233. // //市获取区
  234. // if(vm.userRole.code == 'jk_350200'){
  235. // vm.getDistrict(3, vm.initarea.substring(3), vm.areaTitle.substr(0, 3))
  236. // }else{
  237. // vm.getDistrict(3, vm.initarea, vm.areaTitle.substr(0, 3))
  238. // }
  239. // vm.rangeCode = vm.rangeList[0].code
  240. // } else if (vm.initlevel == 3) {
  241. // //区获取社区
  242. // vm.areaList = [{ code: vm.initarea, name: vm.areaTitle }]
  243. // vm.areaCode = vm.initarea
  244. // vm.rangeCode = vm.rangeList[0].code
  245. // } else if (vm.initlevel == 2) {
  246. // //社区获取团队
  247. // vm.communityList = [{ code: vm.initarea, name: vm.areaTitle }]
  248. // vm.communityCode = vm.initarea
  249. // vm.rangeList.shift()
  250. // vm.rangeCode = vm.rangeList[0]?.code
  251. // }
  252. // vm.range = vm.rangeCode
  253. },
  254. handlePreview(value) {
  255. var vm = this
  256. var file = value.target.files[0]
  257. this.daLoading = true
  258. if (file && file.size) {
  259. var formFile = new FormData()
  260. formFile.append('file', file)
  261. httpRequest
  262. .post('doctor/jkCopd/importExcel', {
  263. data: formFile,
  264. cache: false, //上传文件无需缓存
  265. processData: false, //用于对data参数进行序列化处理 这里必须false
  266. contentType: false //必须
  267. })
  268. .then(function (res) {
  269. if (res.status == 200) {
  270. vm.getJkCopdPatientPage()
  271. vm.dicName.forEach(function (item) {
  272. vm.getDictByDictName(item)
  273. })
  274. vm.daLoading = false
  275. vm.$message({
  276. message: '导入成功!',
  277. type: 'success'
  278. })
  279. } else {
  280. vm.$message.error('导入失败!')
  281. vm.daLoading = false
  282. }
  283. })
  284. .catch(function (e) {
  285. console.error(e)
  286. vm.daLoading = false
  287. })
  288. // statisticAPI.importExcel({file:formFile}).then(function(res){
  289. // console.log('22222222222',res)
  290. // })
  291. }
  292. },
  293. //获取省市区 type:区3
  294. getDistrict: function (type, code, name) {
  295. var vm = this,
  296. list = [],
  297. param = ''
  298. if (type == 3) {
  299. list = [{ code: code, name: name }]
  300. param = 'area'
  301. } else if (type == 5) {
  302. list = [{ code: '', name: '全部' }]
  303. param = 'community'
  304. }
  305. var params = {
  306. type: type,
  307. code: code
  308. }
  309. homeAPI.getDistrict(params).then(function (res) {
  310. if (res.status == 200) {
  311. vm[param + 'List'] = list.concat(res.list)
  312. // vm[param + 'Code'] = vm[param + 'List'][0].code
  313. // console.log(vm.areaList)
  314. } else {
  315. vm.$message.error(res.msg)
  316. }
  317. })
  318. },
  319. hospitalList() {
  320. var vm = this
  321. statisticAPI.hospitalList({ queryArea: vm.userRoleCode }).then(function (res) {
  322. vm.receivingHospitalList = vm.receivingHospitalList && vm.receivingHospitalList.concat(res.detailModelList)
  323. })
  324. },
  325. exportTable() {
  326. if(this.rangeCode == 'town' && this.areaCode == null){
  327. this.$message.warning("请选择地区")
  328. return
  329. }
  330. if(this.rangeCode == 'hospital' && this.communityCode == null){
  331. this.$message.warning("请选择社区")
  332. return
  333. }
  334. var vm = this
  335. vm.daLoading = true
  336. var params = {
  337. startTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-01-01',
  338. endTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-12-31',
  339. name: this.name,
  340. turnDownStatus: this.turnDownStatus,
  341. receiveStatus: this.receiveStatus,
  342. archivesStatus: this.archivesStatus,
  343. hospital: this.hospital,
  344. doctorName: this.doctorName,
  345. isLive: this.isLive,
  346. firstOrg: this.firstOrg,
  347. queryArea: this.areaCode,
  348. queryHospital: this.communityCode == null?'':this.communityCode,
  349. }
  350. statisticAPI.exportJkCopdAchives(params, '居民档案.xls').then(function (res) {
  351. vm.daLoading = false
  352. vm.$message({
  353. message: '导出成功!',
  354. type: 'success'
  355. })
  356. })
  357. },
  358. selectionLineChangeHandle(val) {
  359. var vm = this
  360. var arr = []
  361. val.forEach(function (item) {
  362. arr.push(item.id)
  363. })
  364. vm.currentSelect = arr
  365. },
  366. synPatient() {
  367. var vm = this
  368. if (vm.currentSelect.length) {
  369. statisticAPI
  370. .synPatient({
  371. ids: vm.currentSelect.join(','),
  372. doctor: vm.docInfo.code
  373. })
  374. .then(function (res) {
  375. if (res.status == '200') {
  376. vm.$message({
  377. message: res.message,
  378. type: 'success'
  379. })
  380. vm.getJkCopdPatientPage()
  381. vm.dicName.forEach(function (item) {
  382. vm.getDictByDictName(item)
  383. })
  384. } else {
  385. vm.$message({
  386. message: res.message,
  387. type: 'warning'
  388. })
  389. }
  390. })
  391. } else {
  392. vm.$message('请勾选患者!')
  393. }
  394. },
  395. queryDate() {
  396. if(this.rangeCode == 'town' && this.areaCode == null){
  397. this.$message.warning("请选择地区")
  398. return
  399. }
  400. if(this.rangeCode == 'hospital' && this.communityCode == null){
  401. this.$message.warning("请选择社区")
  402. return
  403. }
  404. this.getJkCopdPatientPage()
  405. },
  406. distributionHospital() {
  407. var vm = this
  408. if (vm.currentSelect.length) {
  409. vm.daLoading = true
  410. statisticAPI
  411. .distributionHospital({
  412. type: 1,
  413. ids: vm.currentSelect.join(','),
  414. doctor: vm.docInfo.code
  415. })
  416. .then(function (res) {
  417. if (res.status == '200') {
  418. vm.daLoading = false
  419. vm.$message({
  420. message: res.message,
  421. type: 'success'
  422. })
  423. vm.getJkCopdPatientPage()
  424. vm.dicName.forEach(function (item) {
  425. vm.getDictByDictName(item)
  426. })
  427. } else {
  428. vm.daLoading = false
  429. vm.$message({
  430. message: res.message,
  431. type: 'warning'
  432. })
  433. }
  434. })
  435. } else {
  436. vm.daLoading = false
  437. vm.$message('请勾选患者!')
  438. }
  439. },
  440. eliminateClick() {
  441. ;(this.name = ''),
  442. (this.turnDownStatus = ''),
  443. (this.receiveStatus = ''),
  444. (this.archivesStatus = ''),
  445. (this.hospital = ''),
  446. (this.doctorName = ''),
  447. (this.isLive = ''),
  448. (this.firstOrg = '')
  449. },
  450. //下转状态
  451. getDictByDictName(value) {
  452. var vm = this
  453. statisticAPI.getDictByDictName({ name: value }).then(function (res) {
  454. if (value == 'jkcopd_turnDownStatus') {
  455. vm.transferStatusOptions = vm.transferStatusOptions.concat(res.list)
  456. } else if (value == 'jkcopd_archivesStatus') {
  457. vm.recordStatusOptions = vm.recordStatusOptions.concat(res.list)
  458. } else if (value == 'jkcopd_isLive') {
  459. vm.survivalStatusOption = vm.survivalStatusOption.concat(res.list)
  460. } else if (value == 'jkcopd_followup_status') {
  461. vm.followStatusArr = vm.followStatusArr.concat(res.list)
  462. }
  463. })
  464. },
  465. onClickEdit(record) {
  466. window.localStorage.setItem('editDetail', JSON.stringify(record))
  467. if (!record) {
  468. return
  469. }
  470. this.currentEditData = record
  471. this.editViewVisable = true
  472. },
  473. onClickServiceRecord(record) {
  474. this.currentEditData = record
  475. this.serviceRecordVisable = true
  476. },
  477. /*打开预览链接*/
  478. openURL(url) {
  479. let aLabel = document.createElement('a')
  480. //设置链接
  481. aLabel.setAttribute('href', url)
  482. //新窗口打开链接
  483. aLabel.setAttribute('target', '_blank')
  484. //设置标签ID
  485. aLabel.setAttribute('id', 'reportpoint')
  486. // 防止反复添加
  487. if (document.getElementById('reportpoint')) {
  488. document.body.removeChild(document.getElementById('reportpoint'))
  489. }
  490. document.body.appendChild(aLabel)
  491. aLabel.click()
  492. //window.open(url);
  493. },
  494. onClickHealthRecord(record) {
  495. this.getCode(record.idcard)
  496. },
  497. getCode(idcard) {
  498. var vm = this
  499. this.patientCode = ''
  500. statisticAPI.getPatientAccetokenByIdcard({ idcard: idcard }).then(function (res) {
  501. if (res.status == 200) {
  502. vm.patientCode = res.data.patientCode
  503. var healthRecordServer = 'http://www.xmtyw.cn/wlyy/profileweb/#/menzhen' //健康档案服务
  504. //var healthRecordServer="https://www.xmtyw.cn/wlyytest/profileweb/#/menzhen" //健康档案服务wlyytest
  505. window.open(healthRecordServer + '?patientCode=' + res.data.patientCode)
  506. } else {
  507. vm.patientCode = ''
  508. this.$message.error('获取授权码失败')
  509. return
  510. }
  511. })
  512. },
  513. handleCurrentChange: function (val) {
  514. this.page = val
  515. this.getJkCopdPatientPage()
  516. },
  517. handleSizeChange(val) {
  518. this.size = val
  519. this.getJkCopdPatientPage()
  520. },
  521. getJkCopdPatientPage: function (val) {
  522. this.daLoading = true
  523. var vm = this
  524. var params = {
  525. page: this.page,
  526. size: this.size,
  527. name: this.name,
  528. turnDownStatus: this.turnDownStatus,
  529. receiveStatus: this.receiveStatus,
  530. archivesStatus: this.archivesStatus,
  531. hospital: this.hospital,
  532. doctorName: this.doctorName,
  533. isLive: this.isLive,
  534. queryArea: this.areaCode,
  535. firstOrg: this.firstOrg,
  536. startTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-01-01',
  537. endTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-12-31'
  538. }
  539. if(this.rangeCode == 'hospital'){
  540. params.queryHospital = this.communityCode
  541. }
  542. statisticAPI.jkCopdAchivesPage(params).then(function (res) {
  543. vm.totalCount = res.totalCount
  544. vm.totalPage = res.totalPage
  545. vm.dataList = res.detailModelList
  546. vm.daLoading = false
  547. })
  548. },
  549. //上传
  550. toggle(isShow) {
  551. this.isShow = isShow
  552. if (!isShow) {
  553. this.reset()
  554. }
  555. },
  556. reset(type) {
  557. this.percentage = 0
  558. this.success = false
  559. this.isOver = false
  560. this.errList = []
  561. if (type != 1) {
  562. this.loading = false
  563. this.file = undefined
  564. this.month = ''
  565. }
  566. },
  567. close(type) {
  568. this.reset(type)
  569. this.isProgressShow = false
  570. if (type != 1) {
  571. this.isShow = false
  572. }
  573. },
  574. beforeUploadPic(file) {
  575. this.file = file
  576. },
  577. check() {
  578. var vm = this
  579. vm.loading = true
  580. if (!vm.file) {
  581. vm.loading = false
  582. vm.$message('请选择文件')
  583. return
  584. }
  585. vm.save()
  586. },
  587. save() {
  588. var vm = this
  589. vm.daLoading = true
  590. var formData = new FormData()
  591. formData.append('file', vm.file)
  592. // vm.initProgress()
  593. httpRequest
  594. .post('doctor/jkCopd/importExcel', {
  595. data: formData,
  596. cache: false, //上传文件无需缓存
  597. processData: false, //用于对data参数进行序列化处理 这里必须false
  598. contentType: false //必须
  599. })
  600. .then(function (res) {
  601. if (res.status == 200) {
  602. vm.getJkCopdPatientPage()
  603. vm.dicName.forEach(function (item) {
  604. vm.getDictByDictName(item)
  605. })
  606. vm.daLoading = false
  607. vm.isShow = false
  608. vm.$message({
  609. message: '导入成功!',
  610. type: 'success'
  611. })
  612. } else {
  613. vm.$message.error('导入失败!')
  614. vm.daLoading = false
  615. }
  616. })
  617. .catch(function (e) {
  618. console.error(e)
  619. vm.daLoading = false
  620. })
  621. },
  622. initProgress() {
  623. var vm = this
  624. this.isProgressShow = true
  625. setTimeout(() => {
  626. if (!vm.isOver && vm.percentage != 90) {
  627. vm.percentage += 10
  628. vm.initProgress()
  629. }
  630. }, 1000)
  631. },
  632. openAllocationDialog() {
  633. if (this.currentSelect.length == 0) {
  634. this.$message.warning('请选择患者')
  635. return
  636. }
  637. var vm = this
  638. this.allocationDialog = true
  639. this.selectLoading = true
  640. statisticAPI.findDoctorList({ hospital: this.docInfo.hospital }).then(function (res) {
  641. vm.doctorList = res.detailModelList
  642. vm.selectLoading = false
  643. })
  644. },
  645. closeAllocationDialog() {
  646. this.allocationDialog = false
  647. },
  648. back() {
  649. var vm = this
  650. vm.currentEditData = null
  651. vm.editViewVisable = false
  652. vm.serviceRecordVisable = false
  653. vm.healthRecordVisable = false
  654. },
  655. allocationFn() {
  656. var vm = this
  657. this.$refs.allocationForm.validate(function (valid) {
  658. if (valid) {
  659. statisticAPI.distributionPatient({ ids: vm.currentSelect.join(','), doctor: vm.allocationForm.doctor }).then(function (res) {
  660. if (res.status == 200) {
  661. vm.allocationDialog = false
  662. vm.$message.success('分配成功')
  663. vm.getJkCopdPatientPage()
  664. } else {
  665. vm.$message.error(res.msg)
  666. }
  667. })
  668. }
  669. })
  670. },
  671. standardExport() {
  672. if(this.rangeCode == 'town' && this.areaCode == null){
  673. this.$message.warning("请选择地区")
  674. return
  675. }
  676. if(this.rangeCode == 'hospital' && this.communityCode == null){
  677. this.$message.warning("请选择社区")
  678. return
  679. }
  680. var vm = this
  681. vm.exportStandardLoading = true
  682. var params = {
  683. name: this.name,
  684. turnDownStatus: this.turnDownStatus,
  685. receiveStatus: this.receiveStatus,
  686. archivesStatus: this.archivesStatus,
  687. hospital: this.hospital,
  688. doctorName: this.doctorName,
  689. isLive: this.isLive,
  690. queryArea: this.areaCode,
  691. firstOrg: this.firstOrg,
  692. queryHospital: this.communityCode == null?'':this.communityCode,
  693. startTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-01-01',
  694. endTime: this.chooseYear == '全部' ? '' : this.chooseYear + '-12-31'
  695. }
  696. var time = new Date().getTime()
  697. statisticAPI.exportCountryStandard(params, `国家标准${time}.xls`).then(function (res) {
  698. vm.exportStandardLoading = false
  699. vm.$message({
  700. message: '导出成功!',
  701. type: 'success'
  702. })
  703. })
  704. }
  705. }
  706. })