statistics.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. function showSuccessMessage(msg) {
  2. layer.msg(msg, {
  3. icon: 1
  4. })
  5. }
  6. function showErrorMessage(msg) {
  7. layer.msg(msg, {
  8. icon: 5
  9. })
  10. }
  11. function showWarningMessage(msg) {
  12. layer.msg(msg, {
  13. icon: 2
  14. })
  15. }
  16. function showInfoMessage(msg) {
  17. layer.msg(msg, {
  18. icon: 6
  19. })
  20. }
  21. var httpData=GetRequest();
  22. new Vue({
  23. el: '#app',
  24. data: {
  25. modal: '',
  26. type: '',
  27. status: '',
  28. name: '',
  29. isDanger: '1',
  30. pagesize: 10,
  31. total: 0,
  32. pagetotal: 0, //总页数
  33. currentPage: 1, //当前页数
  34. tablelist: [],
  35. types: [],
  36. Statics: {},
  37. scListItem:'',
  38. wujilu: false,
  39. value1:'',
  40. datamodelshow: true,
  41. centerDialogVisible: false,
  42. surveyResultCode:"",
  43. isloading:false,
  44. docInfo:JSON.parse(window.localStorage.getItem('docInfo')),
  45. jiayiShow:false,
  46. doctorMobile:'',
  47. newDropdownItems: [
  48. ],
  49. selectedNewDropdown: ''
  50. },
  51. created:function() {
  52. },
  53. watch:{
  54. },
  55. mounted: function () {
  56. var vm = this
  57. // vm.scListItem={
  58. // id: 3297,
  59. // code: "e95d50219c71401ba4fb52a63faf821f",
  60. // templateCode: "6bcd306aaafb4e4381071346d86fadbb1",
  61. // templateTitle: "ASCVD风险评估",
  62. // disease: 3,
  63. // doctor: "361aef4891de492cb0e6a47cf9fe31f3",
  64. // doctorMobile: "15200000001",
  65. // patientCode: "0fab4dd67e074e16ac86db6b6c15233e",
  66. // photo: "group1/M01/23/EF/Cl8WjGUL6EeAUdSeAATf8kYXf5o571.png",
  67. // openId: null,
  68. // patientName: "黄小蕾",
  69. // screenResultCode: "1",
  70. // screenResultScore: -1,
  71. // screenResult: "超高危",
  72. // isDanger: 1,
  73. // isOrder: 0,
  74. // following: 0,
  75. // isEducate: 0,
  76. // over: 1,
  77. // reservationCode: null,
  78. // czrq: "2024-10-18 15:04:50",
  79. // isAgain: 1,
  80. // parentCode: null,
  81. // originCode: "e95d50219c71401ba4fb52a63faf821f",
  82. // adviceCode: null,
  83. // otherAdvice: null,
  84. // source: 1,
  85. // updateTime: null,
  86. // idcard: "650101198007121633",
  87. // sex: "1",
  88. // age: 44,
  89. // level: 0,
  90. // doctorName: null,
  91. // isThird: null,
  92. // thirdId: null,
  93. // thirdSource: "4",
  94. // thirdAdvice: "应定期到医院进行检查,积极采取各类措施,并服用一些必要的药物进行预防。针对超高危人群的低密度脂蛋白胆固醇推荐目标值为<1.4mmol/L",
  95. // doctorNameReservation: null,
  96. // czrqReservation: null,
  97. // startTimeReservation: null,
  98. // surveyStatus: null,
  99. // hospitalName: null,
  100. // value1: null,
  101. // value2: null,
  102. // doctorIdcard: null,
  103. // hospital: null,
  104. // town: null,
  105. // mobile: null,
  106. // birthday: null
  107. // }
  108. // vm.name=vm.scListItem.patientName
  109. if(httpData.scListItem){
  110. vm.scListItem=JSON.parse(decodeURIComponent(httpData.scListItem))
  111. vm.name=vm.scListItem.patientName
  112. console.log('3333333333333333',JSON.parse(decodeURIComponent(httpData.scListItem)))
  113. }
  114. vm.getModal()
  115. // 初始化Bootstrap下拉菜单
  116. // 专科
  117. if(vm.docInfo.level == '1') {
  118. vm.getList()
  119. }else{
  120. vm.getDatas()
  121. }
  122. vm.gettypes()
  123. vm.getDraopDown()
  124. parent.eventBuss.$on('guan_results',function(index){
  125. top.layer.close(index)
  126. if(vm.docInfo.level == '1') {
  127. vm.getList()
  128. }else{
  129. vm.getDatas()
  130. }
  131. vm.getModal()
  132. })
  133. },
  134. methods: {
  135. selectTemplate: function (template) {
  136. this.templateCode = template.code
  137. $('#TemplateCode').val(template.name)
  138. },
  139. lianxijiayi:function(data) {
  140. this.doctorMobile = data.doctorMobile
  141. this.jiayiShow = true
  142. },
  143. centerDialogClick:function() {
  144. var vm = this
  145. var docInfo=JSON.parse(window.localStorage.getItem('docInfo'));
  146. this.centerDialogVisible = false
  147. vm.isloading = true
  148. jbscAPI.changeSurveyState({
  149. surveyResultCode:this.surveyResultCode, //问卷code
  150. surveyStatus:1, //surveyStatus =1 社区随访--已管理
  151. doctorCode:docInfo.code //医生code
  152. }).then(function(res){
  153. if(res.status == 200) {
  154. showSuccessMessage('操作成功')
  155. vm.isloading = false
  156. if(vm.docInfo.level == '1') {
  157. vm.getList()
  158. }else{
  159. vm.getDatas()
  160. }
  161. vm.getModal()
  162. }
  163. })
  164. },
  165. //获取筛查数据模型
  166. getModal: function () {
  167. var vm = this
  168. jbscAPI.screenStatics({
  169. type:vm.docInfo.level==1?"2":'1' // 类型 1全科 2专科(默认1)
  170. }).then(function (res) {
  171. if (res.status == 200) {
  172. vm.Statics = res.data
  173. } else {
  174. showErrorMessage(res.msg)
  175. }
  176. })
  177. },
  178. //获取数据
  179. getDatas: function () {
  180. var vm = this
  181. var params = {
  182. diseaseType:vm.scListItem?'3': vm.type, //疾病类型
  183. dealType: vm.status, //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
  184. patientName: vm.name, //搜索居民的姓名
  185. isDanger: vm.isDanger, //是否高危预警(0否 1是)
  186. pageNo: vm.currentPage,
  187. pageSize: vm.pagesize,
  188. templateCode: vm.scListItem?'6bcd306aaafb4e4381071346d86fadbb1': vm.selectedNewDropdown,
  189. startDate:vm.value1[0],
  190. endDate:vm.value1[1],
  191. patient:vm.scListItem?vm.scListItem.patientCode:"",
  192. onlyPatient:vm.scListItem? '1':''
  193. }
  194. jbscAPI.getResultList(params).then(function (res) {
  195. if (res.status == 200) {
  196. vm.wujilu = false
  197. vm.total = res.data.num
  198. vm.pagetotal = Math.ceil(res.data.num / vm.pagesize)
  199. vm.tablelist = res.data.data
  200. if (vm.tablelist.length == 0) {
  201. vm.wujilu = true
  202. }
  203. } else {
  204. showErrorMessage(res.msg)
  205. }
  206. })
  207. },
  208. getList:function() {
  209. var vm = this
  210. var params = {
  211. doctor: vm.docInfo.code, //专科医生code
  212.             diseaseType: vm.type, //疾病类型
  213.             type: vm.status, //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
  214.             patientName: vm.name, //搜索居民的姓名
  215.             isDanger: vm.isDanger, //是否高危预警(''否 1是 0日常健康管理)
  216.             pageNo: vm.currentPage,
  217.             pageSize: vm.pagesize
  218. }
  219. jbscAPI.getList(params).then(function (res) {
  220. if (res.status == 200) {
  221. vm.wujilu = false
  222. vm.total = res.total?res.total:'0'
  223. vm.pagetotal = Math.ceil(res.total / vm.pagesize)
  224. vm.tablelist = res.data
  225. if (vm.tablelist.length == 0) {
  226. vm.wujilu = true
  227. }
  228. } else {
  229. showErrorMessage(res.msg)
  230. }
  231. })
  232. },
  233. getDraopDown:function(diseaseType){
  234. var vm=this
  235. console.log(diseaseType,'asdddddddddddd')
  236. jbscAPI.getScreenList({pageNo:1,pageSize:1000,labelType:'5',title:'',diseaseType:diseaseType}).then(function (res) {
  237. if (res.status == 200) {
  238. vm.newDropdownItems = _.map(res.data, function (v) {
  239. return {
  240. code: v.code,
  241. name: v.title
  242. }
  243. }
  244. )
  245. if(vm.newDropdownItems.length>1){
  246. vm.newDropdownItems=[
  247. {
  248. code: 'all',
  249. name: '全部'
  250. }
  251. ].concat(vm.newDropdownItems)
  252. }
  253. }})
  254. },
  255. exportScreenResultList:function(){
  256. var vm=this
  257. if(vm.selectedNewDropdown==''||vm.selectedNewDropdown=='all'){
  258. showErrorMessage('请选中筛查表单!')
  259. return false
  260. }
  261. jbscAPI.exportScreenResultList({
  262. diseaseType: vm.type, //疾病类型
  263. dealType: vm.status? vm.status:'', //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
  264. patientName: vm.name, //搜索居民的姓名
  265. isDanger: vm.isDanger, //是否高危预警(0否 1是)
  266. pageNo: vm.currentPage,
  267. pageSize: vm.pagesize,
  268. templateCode:vm.selectedNewDropdown,
  269. startDate:vm.value1[0]?vm.value1[0]:'',
  270. endDate:vm.value1[1]?vm.value1[1]:''
  271. },'筛查表单.xls')
  272. },
  273. gettypes: function () {
  274. var vm = this
  275. var search = true
  276. $('#Status').bsSuggest({
  277. data: {
  278. value: [
  279. {
  280. code: '',
  281. name: '全部'
  282. },
  283. {
  284. code: '1',
  285. name: '已预约'
  286. },
  287. {
  288. code: '2',
  289. name: '已跟踪'
  290. },
  291. {
  292. code: '3',
  293. name: '已接诊'
  294. },
  295. {
  296. code: '4',
  297. name: '待处理'
  298. },
  299. {
  300. code: '5',
  301. name: '日常健康管理'
  302. },
  303. {
  304. code: '6',
  305. name: '已管理'
  306. },
  307. {
  308. code: '7',
  309. name: '住院补筛'
  310. }
  311. ]
  312. },
  313. getDataMethod: 'data',
  314. effectiveFields: ['name'],
  315. idField: 'code',
  316. keyField: 'name'
  317. })
  318. jbscAPI.getSpecialDisease().then(function (res) {
  319. if (res.status == 200) {
  320. var data = {}
  321. data.value = _.map(res.data, function (v) {
  322. return {
  323. code: v.code,
  324. name: v.name
  325. }
  326. })
  327. if (search) {
  328. data.value = [
  329. {
  330. code: '',
  331. name: '全部'
  332. }
  333. ].concat(data.value)
  334. }
  335. $('#Type').bsSuggest({
  336. data: data,
  337. getDataMethod: 'data',
  338. effectiveFields: ['name'],
  339. idField: 'code',
  340. keyField: 'name',
  341. }).on('onSetSelectValue', function (e, selectedData, selectedRawData) {
  342. vm.getDraopDown(selectedData.id)
  343. vm.selectedNewDropdown=''
  344. console.log('onSetSelectValue: ', e.target.value, selectedData, selectedRawData);
  345. })
  346. vm.types = res.data
  347. } else {
  348. showErrorMessage(res.msg)
  349. }
  350. })
  351. },
  352. gettable: function (type) {
  353. var vm = this
  354. if (type == '1') {
  355. if (vm.status == '') {
  356. $('#Status').attr({
  357. 'data-id': '',
  358. 'value': '全部'
  359. })
  360. $('#Status').val('全部')
  361. }
  362. } else {
  363. if (vm.status != '') {
  364. vm.status = ''
  365. $('#Status').attr({
  366. 'data-id': '',
  367. 'value': '全部'
  368. })
  369. $('#Status').val('全部')
  370. }
  371. }
  372. vm.isDanger = type
  373. vm.search(1)
  374. },
  375. //页面跳转
  376. search: function (page) {
  377. var vm = this
  378. vm.type = $('#Type').attr('data-id')
  379. var status = $('#Status').attr('data-id')
  380. if (status == '5') {
  381. vm.status = ''
  382. vm.isDanger = '0'
  383. } else if (status == '' || status == undefined) {
  384. if (vm.isDanger == '0') {
  385. vm.isDanger = ''
  386. }
  387. vm.status = status
  388. } else {
  389. vm.isDanger = '1'
  390. vm.status = status
  391. }
  392. vm.currentPage = page
  393. if(vm.docInfo.level == '1') {
  394. vm.getList()
  395. }else{
  396. vm.getDatas()
  397. }
  398. },
  399. //转诊
  400. zhuanzhen: function (data) {
  401. console.log(data,"ssss")
  402. // showInfoMessage('PC上暂不支持,请打开手机端疑似高危记录进行转诊预约!')
  403. // top.layer.msg('PC上暂不支持,请打开手机端疑似高危记录进行转诊预约', { icon: 5 })
  404. // 如果是康复复诊过去预约挂号,在就诊信息页面少一个字段显示,1隐藏字段,0正常显示
  405. sessionStorage.setItem("isFuzhen",0)
  406. top.layer.open({
  407. type: 2,
  408. closeBtn: 1, // 显示关闭按钮
  409. area: ['800px', '90%'],
  410. title: '预约挂号',
  411. content: '../../jbsc/html/appointment/appoint-select.html?patient=' + data.patientCode + '&surveyCode='+data.code
  412. })
  413. },
  414. //健康教育
  415. jkjy: function (data) {
  416. // sessionStorage.setItem("jbsc-jkwzreceiver", JSON.stringify(receiver))
  417. // sessionStorage.setItem("jbsc-jkroler", 1)
  418. layer.open({
  419. type: 2,
  420. // offset: ['100px'], //右下角弹出
  421. area: ['80%', '648px'],
  422. shade: 0.5,
  423. title: '健康教育',
  424. fixed: true, //不固定
  425. maxmin: true,
  426. closeBtn: 1,
  427. shift: 5,
  428. shadeClose: false, //点击遮罩关闭层
  429. content: '../../article/html/article.html?code=' + data.patientCode + '&resultCode=' + data.code
  430. })
  431. // location.href="../../../../health-education/login.html?origin=jbsc"
  432. },
  433. //健康指导
  434. jkzd: function (data) {
  435. // sessionStorage.setItem("jbsc-jkwzreceiver", JSON.stringify(receiver))
  436. // sessionStorage.setItem("jbsc-jkroler", 1)
  437. layer.open({
  438. type: 2,
  439. // offset: ['100px'], //右下角弹出
  440. area: ['80%', '648px'],
  441. shade: 0.5,
  442. title: '健康指导',
  443. fixed: true, //不固定
  444. maxmin: true,
  445. closeBtn: 1,
  446. shift: 5,
  447. shadeClose: false, //点击遮罩关闭层
  448. content: '../../guidance/html/index.html?patient=' + data.patientCode + '&resultCode=' + data.code
  449. })
  450. // location.href="../../../../health-education/login.html?origin=jbsc"
  451. },
  452. view: function (data) {
  453. var vm = this
  454. layer.open({
  455. type: 2,
  456. // offset: ['100px'], //右下角弹出
  457. area: ['568px', '100%'],
  458. shade: 0.5,
  459. title: '查看筛选结果',
  460. fixed: true, //不固定
  461. maxmin: true,
  462. closeBtn: 1,
  463. shift: 5,
  464. shadeClose: false, //点击遮罩关闭层
  465. content: '../../jbsc/html/view_screening_results.html?isView=true&resultCode=' + data.code,
  466. end:function() {
  467. vm.tablelist = []
  468. if(vm.docInfo.level == '1') {
  469. vm.getList()
  470. }else{
  471. vm.getDatas()
  472. }
  473. vm.getModal()
  474. },
  475. })
  476. },
  477. //筛查
  478. shaicha: function (data, isNew) {
  479. var vm = this
  480. if (isNew) {
  481. //再次筛查数+1
  482. layer.open({
  483. type: 2,
  484. area: ['820px', '648px'],
  485. shade: 0.5,
  486. id: 'questionnaire',
  487. title: '筛选统计',
  488. fixed: true, //不固定
  489. maxmin: true,
  490. closeBtn: 1,
  491. shift: 5,
  492. shadeClose: false, //点击遮罩关闭层
  493. content:
  494. '../../jbsc/html/questionnaire.html?fliter_code=' +
  495. data.templateCode +
  496. '&fliter_title=' +
  497. data.templateTitle +
  498. '&resident_code=' +
  499. data.patientCode +
  500. '&resident_name=' +
  501. data.patientName
  502. })
  503. return
  504. }
  505. layer.open({
  506. type: 2,
  507. offset: 'rb', //右下角弹出
  508. id: 'filter_type',
  509. area: ['280px', '100%'],
  510. shade: 0.5,
  511. title: false,
  512. fixed: true, //不固定
  513. maxmin: false,
  514. closeBtn: 0,
  515. shift: 5,
  516. shadeClose: true, //点击遮罩关闭层
  517. content: '../../jbsc/html/filter_type.html'
  518. })
  519. },
  520. //健康跟踪
  521. jkgz: function (data) {
  522. var vm = this
  523. //跳转到筛查结果页面
  524. var index = layer.open({
  525. type: 2,
  526. area: ['500px', '550px'],
  527. shade: 0.5,
  528. title: '家医建议',
  529. fixed: true, //不固定
  530. maxmin: false,
  531. closeBtn: 1,
  532. shift: 5,
  533. shadeClose: false, //点击遮罩关闭层
  534. content: '../../jbsc/html/advice.html?resultCode=' + data.code + '&filter_code=' + data.templateCode
  535. })
  536. console.log(index)
  537. },
  538. datamodeltap: function () {
  539. var vm = this
  540. $('#sc_datamodel').toggle('normal', function () {
  541. if (vm.datamodelshow) {
  542. vm.datamodelshow = false
  543. $('#datamodeltap').removeClass('up_datamodel').addClass('down_datamodel')
  544. $('#datamodeltap span').text('展开')
  545. } else {
  546. vm.datamodelshow = true
  547. $('#datamodeltap').removeClass('down_datamodel').addClass('up_datamodel')
  548. $('#datamodeltap span').text('收起')
  549. }
  550. })
  551. },
  552. sqsf: function (item) {
  553. var vm = this
  554. vm.surveyResultCode = item.code
  555. vm.centerDialogVisible = true
  556. }
  557. }
  558. })