abnormal.js 26 KB

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