payDetail.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. const $ = require('jquery');
  2. require("../css/payDetail.less");
  3. require('./modal.js');
  4. const {api} = require('./api.js')
  5. const {post,getCookie,setCookie,getLocal,getUrlArgObjectNew,emptyBox,expJson,downloadExportedData,initScroll} = require('./utils.js')
  6. require('./../resource/jquery-ui/jquery-ui.min.js');
  7. require('./../resource/jquery-ui/jquery-ui.min.css');
  8. const iconCheck= require("./../images/icon_check.png")
  9. const iconUnCheck = require("./../images/icon_unchecked.png")
  10. const iconCalenBlue= require("./../images/icon_calen_blue.png")
  11. const iconCalenGrey= require("./../images/icon_calen_grey.png")
  12. const iconDown= require("./../images/arrow_down.png")
  13. const iconUp = require("./../images/arrow_up.png")
  14. const loadingImg = require("./../images/loading.gif")
  15. const arrowLeft= require("./../images/arrow_left.png")
  16. const arrowRight = require("./../images/arrow_right.png")
  17. let isPlacefile = getCookie('isPlacefile')||1
  18. setCookie('excelName', "科室平均住院花费");
  19. $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  20. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  21. let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",behosDateEnd="", scoreSum = 0,statisticsType=2,
  22. nameTemp = "", behospitalCodeTemp="",levelTemp="", deptId="",deptIdTemp="", doctorName="", doctorNum="",doctorNameTemp="",doctorNumTemp="",
  23. data_desc=[],data_asc=[];
  24. let srcUrl = $("#contentIframe",parent.document).attr("src")
  25. statisticsType = getUrlArgObjectNew("dateType",srcUrl)||""
  26. if(statisticsType == 1){
  27. $(".monthYear .mon").css({
  28. backgroundColor:'#00A1FF',
  29. color:'#fff'
  30. }).siblings().css({
  31. color:'#00A1FF',
  32. backgroundColor:'#fff'
  33. })
  34. }else{
  35. $(".monthYear .year").css({
  36. backgroundColor:'#00A1FF',
  37. color:'#fff'
  38. }).siblings().css({
  39. color:'#00A1FF',
  40. backgroundColor:'#fff'
  41. })
  42. }
  43. $(".abnormalClear").click(function(){
  44. behospitalCode=behospitalCodeTemp = ""
  45. $(".patientNumInp").val("")
  46. getTabData(1)
  47. })
  48. $(".partTitle a").click(function(){
  49. //初始菜单选中
  50. $(".menu .page",parent.document).removeClass("active").eq(0).addClass("active");
  51. $(".container",parent.document).addClass("console-cont");
  52. })
  53. $('.datapickerBox').append(`<img class="iconCalen" src=${iconCalenGrey} />`)
  54. $('.iconCalen').on("mouseenter", function(e){
  55. $(this).attr("src", iconCalenBlue)
  56. })
  57. $('.iconCalen').on("mouseleave", function(e){
  58. $(this).attr("src", iconCalenGrey)
  59. })
  60. $('.iconCalen').on("click", function(e){
  61. $(this).parent().find("input").focus()
  62. })
  63. $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5')
  64. dateChange()
  65. //所有数据切换日期筛选
  66. function dateChange(){
  67. $(".monthYear .mon").click(function(){
  68. $(this).css({
  69. backgroundColor:'#00A1FF',
  70. color:'#fff'
  71. }).siblings().css({
  72. color:'#00A1FF',
  73. backgroundColor:'#fff'
  74. })
  75. $(".dayDetail .deptListWrap").css("display","block")
  76. $(".dayDetail .dayFilter").css("display","none")
  77. statisticsType = 1
  78. getTabData(1)
  79. })
  80. $(".monthYear .year").click(function(){
  81. $(this).css({
  82. backgroundColor:'#00A1FF',
  83. color:'#fff'
  84. }).siblings().css({
  85. color:'#00A1FF',
  86. backgroundColor:'#fff'
  87. })
  88. $(".dayDetail .deptListWrap").css("display","none")
  89. $(".dayDetail .dayFilter").css("display","block")
  90. statisticsType = 2
  91. getTabData(1)
  92. })
  93. }
  94. //判断有无某一权限
  95. function hasData(data){
  96. let trdObj = JSON.parse(getLocal("trdObj"))
  97. let lis = trdObj['YH-BLZK-ZKPF']
  98. if(!lis){
  99. return false
  100. }
  101. if(lis.indexOf(data)>-1){//有权限
  102. return true
  103. }
  104. return false;
  105. }
  106. function getTabData(activePage){
  107. const param = {
  108. current:activePage,
  109. size: 15,
  110. name: behospitalCode||"",
  111. type: statisticsType||2, //1-本月,2-本年
  112. dateType: "",//(3-上月,4-去年本月,5-去年(必填))
  113. }
  114. post(api.getAverageFeePage,param).then(res =>{
  115. if(res.data.code == '0'){
  116. const data = res.data.data;
  117. tabList = data.records;
  118. const totalPage = data.pages;
  119. const totalNum = data.total;
  120. renderTab(tabList,data.hospitalId,activePage);
  121. renderPagination(totalPage,Number(activePage),totalNum)
  122. if(totalPage > 1){
  123. renderPagination(totalPage,Number(activePage),totalNum)
  124. } else{
  125. $('.pagination').html("")
  126. }
  127. }else{
  128. $.alerModal({"message":res.data.msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  129. }
  130. }).catch((e) =>{
  131. })
  132. }
  133. getTabData(1)
  134. $(".filter").on("click", function(e){
  135. name = nameTemp
  136. behospitalCode = behospitalCodeTemp
  137. level = levelTemp
  138. deptId = deptIdTemp
  139. getTabData(1)
  140. })
  141. function renderTab(data,hisId,activePage){
  142. let str = '',tmp = ''
  143. for(let i = 0; i < data.length; i++){
  144. const item = data[i]
  145. str += `
  146. <tr data-index=${i}>
  147. <td class="textCenter">${(activePage-1)*15 + i+1}</td>
  148. <td>${item.name || "-"}</td>
  149. <td >${item.averageValue}</td>
  150. <td >${item.lastAverageValue}</td>
  151. ${statisticsType==1?'<td>'+item.lastYearAverageValue+'</td>':''}
  152. </tr>
  153. `
  154. }
  155. let sts = `
  156. ${statisticsType==1?`<thead class="monType">
  157. <th class="moduleName" style="width: 65px;">序号</th>
  158. <th class="beHospitalId textCenter">科室</th>
  159. <th class="patientNo textCenter" >本月平均住院花费(元)</th>
  160. <th class="patientNo textCenter" >上月平均住院花费(元)</th>
  161. <th class="patientNo textCenter" >去年本月平均住院花费(元)</th>
  162. </thead>`:`
  163. <thead class="yearType">
  164. <th class="moduleName" style="width: 65px;">序号</th>
  165. <th class="beHospitalId textCenter">科室</th>
  166. <th class="patientNo textCenter" >本年平均住院花费(元)</th>
  167. <th class="patientNo textCenter" >去年平均住院花费(元)</th>
  168. </thead>
  169. `}
  170. <tbody>
  171. ${str?str:emptyBox()}
  172. </tbody>
  173. `
  174. $('.tableDay').html(sts)
  175. bindScoreDetail(hisId)
  176. // initScroll("payDetail","YX",1)
  177. }
  178. function scoreDetail(id,age,hid,code){
  179. window.open(`./qcScore.html?id=${id}&age=${age}&hid=${hid}&code=${code}`)
  180. }
  181. function bindScoreDetail(hisId){
  182. $('.patientNameSpan').on('click',function(e){
  183. const index = $(this).attr("data-index")
  184. const type = $(this).attr("data-type")
  185. const item = tabList[index]
  186. midifyMsgBox(item,type)
  187. })
  188. }
  189. function midifyMsgBox(item,type){
  190. const itemCopy = JSON.parse(JSON.stringify(item))
  191. let msgBox = ''
  192. if(type == 1){
  193. msgBox = `<div class="midifyMsgBox">
  194. <div class="mask"></div>
  195. <div class="midifyMsgContent abnormal">
  196. <p class="midifyMsgTitle">修改 <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></p>
  197. <div class="itemMsgInfoBox">
  198. <span class="itemMsgLab abnormalLeft">状态:</span>
  199. <span class="abnormalAll" data-status="${itemCopy.status}">${itemCopy.status == 0?"未处理":"已处理"}</span>
  200. <ul class="abnormalStatusLis">
  201. <li data-status="0">未处理</li>
  202. <li data-status="1">已处理</li>
  203. </ul>
  204. </div>
  205. <div class="itemMsgInfoBox">
  206. <span class="itemMsgLab abnormalLeft abnormalMark">备注:</span>
  207. <span class="itemInfoRight">
  208. <textarea class="abnormalTxt" placeholder="请输入内容" >${itemCopy.remark}</textarea>
  209. </span>
  210. </div>
  211. <div class="itemMsgInfoTips">支持≥0的数字输入,最多保留小数点后1位~</div>
  212. <div class="midifyMsgBtn abnormalBtn">
  213. <span class="midifyEdit">保存</span>
  214. </div>
  215. </div>
  216. </div>`
  217. }else{
  218. msgBox = `<div class="midifyMsgBox">
  219. <div class="mask"></div>
  220. <div class="midifyMsgContent midifyMsgContentDel">
  221. <p class="midifyMsgTitle">修改 <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></p>
  222. <p class="delTips">确认要删除该条异常记录?</p>
  223. <div class="midifyMsgBtn midifyMsgBtnDel">
  224. <span class="midifyEdit midifyEditDel">删除</span>
  225. <span class="midifyEdit midifyEditQuit">取消</span>
  226. </div>
  227. </div>
  228. </div>`
  229. }
  230. $("#mainBox", parent.document).append(msgBox)
  231. $(".midifyEditDel", parent.document).on("click",function(){
  232. delModifyOne(itemCopy)
  233. })
  234. $(".midifyEditQuit", parent.document).on("click",function(){
  235. $("#mainBox .midifyMsgBox", parent.document).remove()
  236. })
  237. $(".abnormalAll", parent.document).on("click",function(){
  238. $(".abnormalStatusLis", parent.document).slideToggle()
  239. })
  240. $(".abnormalStatusLis li", parent.document).on("click",function(){
  241. let status = $(this).attr("data-status")
  242. let str = $(this).html()
  243. $(".abnormalAll", parent.document).attr("data-status",status).html(str)
  244. $(".abnormalStatusLis", parent.document).slideToggle()
  245. })
  246. $("#mainBox .midifyMsgBox .iconClose", parent.document).on("click", function(e){
  247. $("#mainBox .midifyMsgBox", parent.document).remove()
  248. })
  249. $("#mainBox .midifyMsgBox .itemScore", parent.document).on("keypress", function(event){
  250. return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))
  251. })
  252. $("#mainBox .midifyMsgBox .itemScore", parent.document).on("input", function(e){
  253. const val = $(this).val()
  254. itemCopy.score = val
  255. })
  256. $("#mainBox .midifyMsgBox .midifyEdit", parent.document).on("click", function(e){
  257. saveModifyOne(itemCopy)
  258. })
  259. }
  260. //保存修改
  261. function delModifyOne(itemCopy){
  262. let param = {
  263. "id": itemCopy.id
  264. }
  265. post(api.delQcAnnormal,param).then(res =>{
  266. if(res.data.code == '0'){
  267. const data = res.data.data;
  268. getTabData(1)
  269. $("#mainBox .midifyMsgBox", parent.document).remove()
  270. $.alerModal({"message":'删除成功',type:"tip",time:'1000',isFather: true,win: true, fatherWrapper: $("#mainBox", parent.document)});
  271. }else{
  272. $.alerModal({"message":'删除失败,请重试~',type:"tip",time:'1000',win:'default',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  273. }
  274. }).catch((e) =>{
  275. $.alerModal({"message":'删除失败,请重试~',type:"tip",time:'1000',win:'default',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  276. })
  277. }
  278. //保存修改
  279. function saveModifyOne(itemCopy){
  280. let txt = $(".abnormalTxt", parent.document).val()
  281. let status = $(".abnormalAll", parent.document).attr("data-status")
  282. let param = {
  283. "id": itemCopy.id,
  284. "remark": txt,
  285. "status": status
  286. }
  287. post(api.saveQcAnnormal,param).then(res =>{
  288. if(res.data.code == '0'){
  289. const data = res.data.data;
  290. getTabData(1)
  291. $("#mainBox .midifyMsgBox", parent.document).remove()
  292. $.alerModal({"message":'修改成功',type:"tip",time:'1000',isFather: true,win: true, fatherWrapper: $("#mainBox", parent.document)});
  293. }else{
  294. $.alerModal({"message":'修改失败,请重试~',type:"tip",time:'1000',isFather: true,win: 'default', fatherWrapper: $("#mainBox", parent.document)});
  295. }
  296. }).catch((e) =>{
  297. $.alerModal({"message":'修改失败,请重试~',type:"tip",time:'1000',isFather: true,win: 'default', fatherWrapper: $("#mainBox", parent.document)});
  298. })
  299. }
  300. //选择病历等级
  301. $('.selectLevel').on("click", function(e){
  302. e.stopPropagation()
  303. $(".deptList ").css("display", "none")
  304. $(".selectDept .arrow").attr("src",iconDown)
  305. const showList = $(".levelList ").css("display")
  306. if(showList == "none" ||!showList){
  307. $(".levelList ").css("display","block")
  308. $(".selectLevel .arrow").attr("src",iconUp)
  309. }else{
  310. $(".levelList ").css("display", "none")
  311. $(".selectLevel .arrow").attr("src",iconDown)
  312. }
  313. })
  314. bindLeveldSelect()
  315. //是否启用选择
  316. function bindLeveldSelect(){
  317. $('.levelItem').on("click",function(){
  318. const levelItemName = $(this).attr("data-name")
  319. const levelItemItemId = $(this).attr("data-id")
  320. levelTemp =levelItemItemId
  321. $('.selectLevel').html(levelItemName)
  322. $(".levelList").css("display", "none")
  323. $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  324. })
  325. }
  326. //全选绑定
  327. $('.selectDept').on("click", function(e){
  328. e.stopPropagation()
  329. $(".levelList ").css("display","none")
  330. $(".selectLevel .arrow").attr("src",iconDown)
  331. const showList = $(".deptList ").css("display")
  332. if(showList == "none" ||!showList){
  333. $(".deptList ").css("display","block")
  334. $(".selectDept .arrow").attr("src",iconUp)
  335. }else{
  336. $(".deptList ").css("display", "none")
  337. $(".selectDept .arrow").attr("src",iconDown)
  338. }
  339. })
  340. function rendeDeptList(deptList){
  341. let str = `<li class="deptItem " data-id=" " data-name="全部">全部</li>`
  342. for(let i = 0; i < deptList.length; i++){
  343. str += `<li class="deptItem ellipsis" title=${deptList[i].deptName} data-id=${deptList[i].deptId} data-name=${deptList[i].deptName}> ${deptList[i].deptName}</li>`
  344. }
  345. $('.deptList').html(str)
  346. }
  347. bindDeptSelect()
  348. //科室选择
  349. function bindDeptSelect(){
  350. $('.deptItem').on("click",function(){
  351. const deptItemName = $(this).attr("data-name")
  352. const deptItemId = $(this).attr("data-id")
  353. deptIdTemp =deptItemId
  354. if(deptItemName.length > 10){
  355. $('.selectDept').html(deptItemName.substring(0,8)+'...')
  356. }else{
  357. $('.selectDept').html(deptItemName)
  358. }
  359. $('.selectDept ').attr('title',deptItemName)
  360. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  361. $(".deptList").css("display", "none")
  362. })
  363. }
  364. function loading(){
  365. const str = `
  366. <div class="loadingBox">
  367. <div class="mask"></div>
  368. <img class="loadingImg" src=${loadingImg} alt="loading" />
  369. </div>
  370. `
  371. $("#mainBox", parent.document).append(str)
  372. }
  373. function hideLoading(){
  374. $("#mainBox .loadingBox", parent.document).remove()
  375. }
  376. $('.recordScoreBtn').on("click",function(e){
  377. if(!hasData('FUNC000017')){
  378. return
  379. }
  380. let scoreList = []
  381. for(let i = 0; i <tabList.length; i++){
  382. if(tabList[i].hasSelect){
  383. scoreList.push(tabList[i].behospitalCode)
  384. }
  385. }
  386. if(scoreList.length === 0){
  387. $.alerModal({"message":'请选择要评分的项!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  388. return
  389. } else{
  390. loading()
  391. for(let j = 0; j < scoreList.length; j++){
  392. recordScore(scoreList[j],scoreList.length)
  393. }
  394. }
  395. })
  396. $("th[code]").on("click",function(e){
  397. const code=$(this).attr("code");
  398. if(data_asc[0]===code){
  399. data_desc=[code];
  400. data_asc=[];
  401. $("th[code]").removeClass("asc desc");
  402. $(this).addClass("desc");
  403. }else{
  404. data_desc=[];
  405. data_asc=[code];
  406. $("th[code]").removeClass("asc desc");
  407. $(this).addClass("asc");
  408. }
  409. getTabData(1);
  410. });
  411. function recordScore(behospitalCode,totalNum){
  412. const param = {
  413. behospitalCode: behospitalCode
  414. }
  415. post(api.recordScore,param).then(res =>{
  416. if(res.data.code == '0'){
  417. scoreSum++
  418. if(scoreSum === totalNum){
  419. hideLoading()
  420. scoreSum = 0
  421. const activePage = $(".activePage").attr('data-page') || 1
  422. getTabData(activePage)
  423. }
  424. }else{}
  425. }).catch((e) =>{
  426. })
  427. }
  428. $(".patientNumInp").on("input", function(e){
  429. const val = $(this).val().trim()
  430. behospitalCodeTemp = val
  431. })
  432. $(".patientNameInp").on("input", function(e){
  433. const val = $(this).val().trim()
  434. nameTemp = val
  435. })
  436. $(".doctorInp").on("input", function(e){
  437. const val = $(this).val().trim()
  438. doctorNameTemp = val
  439. })
  440. $(".doctorNumInp").on("input", function(e){
  441. const val = $(this).val().trim();
  442. doctorNumTemp = val
  443. })
  444. $(function() {
  445. $.datepicker.regional['zh-CN'] = {
  446. clearText: '清除',
  447. clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
  448. closeText: '关闭',
  449. closeStatus: '不改变当前选择',
  450. prevText: '<上月',
  451. prevStatus: '显示上月',
  452. prevBigText: '<<',
  453. prevBigStatus: '显示上一年',
  454. nextText: '下月>',
  455. nextStatus: '显示下月',
  456. nextBigText: '>>',
  457. nextBigStatus: '显示下一年',
  458. currentText: '今天',
  459. currentStatus: '显示本月',
  460. monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  461. monthNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  462. yearNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  463. monthStatus: '选择月份',
  464. yearStatus: '选择年份',
  465. weekHeader: '周',
  466. weekStatus: '年内周次',
  467. dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
  468. dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
  469. dayNamesMin: ['日','一','二','三','四','五','六'],
  470. dayStatus: '设置 DD 为一周起始',
  471. dateStatus: '选择 m月 d日, DD',
  472. dateFormat: 'yy-mm-dd',
  473. firstDay: 1,
  474. initStatus: '请选择日期',
  475. isRTL: false};
  476. $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  477. $( "#datepicker" ).datepicker({
  478. changeMonth: true,
  479. changeYear: true,
  480. dateFormat:"yy/mm/dd"
  481. });
  482. $( "#datepicker2" ).datepicker({
  483. changeMonth: true,
  484. changeYear: true,
  485. dateFormat:"yy/mm/dd"
  486. });
  487. });
  488. //分页渲染
  489. function renderPagination(totalPage,activePage,totalNum){
  490. let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
  491. if(totalPage <= 6){
  492. for(let i = 1; i <= totalPage; i++){
  493. str += `<span class="pageNum ${'page'+i}" data-page=${i}>${i}</span>`
  494. }
  495. }else{
  496. if(activePage <= 3){ //选中页数小于4
  497. for(let i = 1; i <= 4; i++){
  498. str += `<span class="pageNum ${'page'+i}" data-page=${i}>${i}</span>`
  499. }
  500. str += `<span class="more" >...</span>`
  501. str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
  502. } else if(activePage > totalPage -3){
  503. str += `<span class="pageNum page1" data-page=1>1</span>`
  504. str += `<span class="more" >...</span>`
  505. str += `<span class="pageNum ${'page'+(totalPage-3)}" data-page=${totalPage -3}>${totalPage -3}</span>`
  506. str += `<span class="pageNum ${'page'+(totalPage-2)}" data-page=${totalPage -2}>${totalPage -2}</span>`
  507. str += `<span class="pageNum ${'page'+(totalPage-1)}" data-page=${totalPage -1}>${totalPage -1}</span>`
  508. str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
  509. } else {
  510. str += `<span class="pageNum page1" data-page=1>1</span>`
  511. str += `<span class="more" >...</span>`
  512. str += `<span class="pageNum ${'page'+(activePage -1)}" data-page=${activePage -1}>${activePage -1}</span>`
  513. str += `<span class="pageNum ${'page'+activePage}" data-page=${activePage}>${activePage}</span>`
  514. str += `<span class="pageNum ${'page'+(activePage +1)}" data-page=${activePage +1}>${activePage +1}</span>`
  515. str += `<span class="more" >...</span>`
  516. str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
  517. }
  518. }
  519. str += `<span class="nextPage"><img class="arrowPage" src=${arrowRight} /></span>`
  520. $('.pagination').html(str)
  521. $('.page' + activePage).addClass('activePage')
  522. $(".pageNum").on("click", function(e){
  523. const activePageNow = Number($(this).attr('data-page'))
  524. getTabData(activePageNow)
  525. // renderPagination(totalPage,activePageNow,totalNum)
  526. })
  527. $(".prePage").on("click", function(e){
  528. let activePageNow = Number($(".activePage").attr('data-page'))
  529. if(activePageNow > 1){
  530. activePageNow--
  531. getTabData(activePageNow)
  532. // renderPagination(totalPage,activePageNow,totalNum)
  533. }
  534. })
  535. $(".nextPage").on("click", function(e){
  536. let activePageNow = Number($(".activePage").attr('data-page'))
  537. if(activePageNow < totalPage){
  538. activePageNow++
  539. getTabData(activePageNow)
  540. // renderPagination(totalPage,activePageNow,totalNum)
  541. }
  542. })
  543. }
  544. $(document).on("click", function(){
  545. $(".levelList ").css("display", "none")
  546. $(".deptList").css("display", "none")
  547. $(".selectLevel .arrow").attr("src",iconDown)
  548. })
  549. $(function($){
  550. $('.exportData').click(function(){
  551. const param = {
  552. isPlacefile:isPlacefile,
  553. name: behospitalCode||"",
  554. type: statisticsType||2, //1-本月,2-本年
  555. dateType: "",//(3-上月,4-去年本月,5-去年(必填))
  556. }
  557. expJson(api.getAverageFeeExport,param).then(res =>{
  558. downloadExportedData(res.data, "科室平均住院花费.xls")
  559. })
  560. })
  561. });