qcListCopy.js 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  1. const $ = require('jquery');
  2. require("../css/qcListCopy.less");
  3. require('./modal.js');
  4. const {api} = require('./api.js')
  5. const {post,getCookie,setCookie,getLocal,getUrlArgObjectNew,emptyBox,downloadExportedData,expJson,getLogoParam,focusMenuItem,listenScroll,exportTimeLimit} = 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. const goUpG= require("./../images/arrow_up_grey.png")
  18. const goUpB = require("./../images/arrow_up_blue.png")
  19. const goDownG= require("./../images/arrow_down_grey.png")
  20. const goDownB = require("./../images/arrow_down_blue.png")
  21. let isPlacefile = getCookie('isPlacefile')||1
  22. let pageSet = [],pageSetCopy = [], showNum = 0, scrollTop=0;
  23. let srcUrl = $("#contentIframe",parent.document).attr("src")
  24. let statisticsType = getUrlArgObjectNew("dateType",srcUrl)||getUrlArgObjectNew("shijian",srcUrl) || "3"
  25. let chengdu = getUrlArgObjectNew("chengdu",srcUrl)||""
  26. let deptIdPram = getUrlArgObjectNew("deptId",srcUrl)||""
  27. let deptNamePram = getUrlArgObjectNew("deptName",srcUrl)||"";
  28. let docName = getUrlArgObjectNew("docName",srcUrl)||"";
  29. let startDateParam = getUrlArgObjectNew("startDate",srcUrl)||"";
  30. let endDateParam = getUrlArgObjectNew("endDate",srcUrl)||"";
  31. let from = getUrlArgObjectNew("from",srcUrl)||"";
  32. let defectName = getUrlArgObjectNew("defectName",srcUrl)||"";
  33. let casesEntryId = getUrlArgObjectNew("casesEntryId",srcUrl)|| "";
  34. let casesId = getUrlArgObjectNew("casesId",srcUrl)|| "";
  35. let ruleType = getUrlArgObjectNew("ruleType",srcUrl)||"";
  36. let isSingleReject = getUrlArgObjectNew("isSingleReject",srcUrl)||"";
  37. let fromDays = getUrlArgObjectNew("fromDays", srcUrl) || "";
  38. let deptListDept = JSON.parse(localStorage.getItem('deptList')) || []
  39. let improveType = getUrlArgObjectNew("improveType", srcUrl) || '';
  40. let professor = getUrlArgObjectNew("professor", srcUrl) || ""
  41. let currentPage;
  42. $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  43. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  44. $(".fpSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  45. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  46. let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",behosDateEnd="", scoreSum = 0,
  47. nameTemp = "", behospitalCodeTemp="",levelTemp="", deptId="",deptIdTemp="", doctorName="", deptName="", deptNameTemp="",doctorNum="",doctorNameTemp="",doctorNumTemp="",
  48. fpCheckStatus="",fpCheckStatusTemp="",fpCheckName="",fpCheckNameTemp="",qcCheckName="",qcCheckNameTemp="",qcCheckStatus="",qcCheckStatusTemp="",fpCheckDateStart="",fpCheckDateEnd="",
  49. qcCheckDateStart = "", qcCheckDateEnd = "", casesEntryName="",qcCheckMain="",qcCheckMainTemp="",
  50. data_desc=["leaveHospitalDate"],data_asc=[];
  51. listenScroll('.qcListCopy')
  52. if(isPlacefile != 1){
  53. data_desc=["behospitalDate"]
  54. }
  55. if(chengdu){
  56. levelTemp = chengdu
  57. level = chengdu
  58. $('.selectLevel').html(chengdu)
  59. $(".levelList").css("display", "none")
  60. $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  61. }
  62. if (defectName && defectName !== 'undefined'){
  63. casesEntryName=defectName
  64. $('.selectDefect').html(casesEntryName)
  65. }else{
  66. $('.defectItem').css("display","none")
  67. }
  68. if(docName){
  69. doctorNameTemp = docName
  70. doctorName = docName
  71. $('.doctorInp').val(docName)
  72. $('.doctorInp').prop('disabled', true)
  73. }
  74. if(deptIdPram&&deptNamePram){
  75. if(deptNamePram == "全院"){
  76. deptNamePram = "全部"
  77. }
  78. deptId = deptIdTemp = deptIdPram
  79. deptName = deptNameTemp = deptNamePram
  80. $('.selectDept').val(deptNamePram)
  81. $('.selectDept ').attr('title',deptNamePram)
  82. $(".deptList").css("display", "none")
  83. }
  84. if(from==2){
  85. $(".export").css('display','none')
  86. $(".partTitle .titlePic ").html(`<a class="consoleD" href="deptConsole.html">控制台(科室) / </a><a class="consoleP" href="singleVeto.html?from=1">条目缺陷占比 / </a>缺陷列表`)
  87. deptId=deptListDept[0]&&deptListDept[0].deptId;
  88. deptName=deptListDept[0]&&deptListDept[0].deptName;
  89. deptNameTemp=deptListDept[0]&&deptListDept[0].deptName;
  90. deptIdTemp=deptListDept[0]&&deptListDept[0].deptId;
  91. $('.selectDept').val(deptName)
  92. }else if(from==3){
  93. $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a href="keyItemFlawControl.html">关键条目缺陷占比 / </a>病历列表`)
  94. }else if(from==4){
  95. // $(".qcFiliterItem").css("display","none")
  96. // 控制台 / 病案首页合格率占比 / 缺陷详情
  97. // $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="singleVeto.html?from=1">条目缺陷占比 / </a><a class="defectDetail" href="quexianDetailControlHome.html">缺陷详情 / </a>病历详情`)
  98. $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="partDetailControl.html?from=1">病案首页合格率占比 / </a><a class="defectDetail" href="quexianDetailControlHome.html">缺陷列表 / </a>病历列表`)
  99. $(".defectDetail").on("click",function(){
  100. $(parent.document).find("#contentIframe").attr("src","quexianDetailControlHome.html?deptName="+`${deptNamePram=="全部" ?"全院":deptNamePram}`+"&deptId="+deptIdPram+"&from=4&casesId=243"+"&shijian=3"+"&ruleType="+ruleType+"&startDateParam="+startDateParam+"&endDateParam="+endDateParam)
  101. })
  102. } else if (from == 12) {
  103. // 来自 各科室缺陷占比的跳转
  104. $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="qualifiedPhysician.html?from=1">医师病案首页合格率占比 / </a><a class="defectDetail" href="quexianDetailControlHome.html">缺陷列表 / </a>病历列表`)
  105. $(".defectDetail").on("click", function () {
  106. $(parent.document).find("#contentIframe").attr("src", "quexianDetailControlHome.html?deptName=" + `${deptNamePram == "全部" ? "全院" : deptNamePram}` + "&deptId=" + deptIdPram + "&from=12&casesId=243" + "&shijian=3" +"&ruleType="+ruleType+ "&startDateParam=" + startDateParam + "&endDateParam=" + endDateParam+ "&docName=" + docName + "&code=XY" + "&professor=" + professor)
  107. })
  108. }else if(from==9){
  109. // 来自 各科室缺陷占比的跳转
  110. $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="deptScoreDetailControl.html?from=1">各科室缺陷占比 / </a><a class="defectDetail" href="quexianDetailControl.html">缺陷列表 / </a>病历列表`)
  111. $(".defectDetail").on("click", function () {
  112. $(parent.document).find("#contentIframe").attr("src", "quexianDetailControl.html?deptName=" + `${deptNamePram == "全部" ? "全院" : deptNamePram}` + "&deptId=" + deptIdPram + "&from=1&" + "&shijian=3" + "&startDateParam=" + startDateParam + "&endDateParam=" + endDateParam)
  113. })
  114. } else if (from == 8 || from == 7) {
  115. // 来自 质控核查统计的跳转
  116. $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="checkControl.html?from=1">质控核查统计 / </a>病历列表`)
  117. $(".defectDetail").on("click", function () {
  118. $(parent.document).find("#contentIframe").attr("src", "checkControl.html?deptName=" + `${deptNamePram == "全部" ? "全院" : deptNamePram}` + "&deptId=" + deptIdPram + "&from=1&" + "&shijian=3" + "&startDateParam=" + startDateParam + "&endDateParam=" + endDateParam)
  119. })
  120. } else if (from == 6) {
  121. // 来自 质控核查统计的跳转 ---改善数量的跳转
  122. $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="checkControl.html?from=1">质控核查统计 / </a>病历列表`)
  123. $(".defectDetail").on("click", function () {
  124. $(parent.document).find("#contentIframe").attr("src", "checkControl.html?deptName=" + `${deptNamePram == "全部" ? "全院" : deptNamePram}` + "&deptId=" + deptIdPram + "&from=1&" + "&shijian=3" + "&startDateParam=" + startDateParam + "&endDateParam=" + endDateParam)
  125. })
  126. }else{
  127. $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="singleVeto.html?from=1">条目缺陷占比 / </a>病历列表`)
  128. }
  129. $(".partTitle .consoleD").click(function(){
  130. //初始菜单选中
  131. focusMenuItem(from==2?'YH-KZTKS':'YH-KZT')
  132. $(".container",parent.document).addClass("console-cont");
  133. })
  134. $('.datapickerBox').append(`<img class="iconCalen" src=${iconCalenGrey} />`)
  135. $('.iconCalen').on("mouseenter", function(e){
  136. $(this).attr("src", iconCalenBlue)
  137. })
  138. $('.iconCalen').on("mouseleave", function(e){
  139. $(this).attr("src", iconCalenGrey)
  140. })
  141. $('.iconCalen').on("click", function(e){
  142. $(this).parent().find("input").focus()
  143. })
  144. $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5')
  145. setCookie('excelName', $(".partTitle").text());
  146. $("#filterToggler").click(function(){
  147. const text = $(this).text();
  148. $(".toggle-item").slideToggle();
  149. $(this).text(text==="收起筛选"?"展开筛选":"收起筛选").toggleClass("up");
  150. });
  151. //判断有无某一权限
  152. function hasData(data){
  153. let trdObj = JSON.parse(getLocal("trdObj"))
  154. let lis = trdObj['YH-BLZK-ZKPF']
  155. if(!lis){
  156. return false
  157. }
  158. if(lis.indexOf(data)>-1){//有权限
  159. return true
  160. }
  161. return false;
  162. }
  163. // 初始化请求列表接口
  164. function formatPostUrl(type) {
  165. if(type==='2'){
  166. return api.qcResultShortByDeptPage
  167. } else if (type === '7' || type === '8'){
  168. return api.qcCheckMRPage
  169. } else if (type === '6') {
  170. return api.hmImproveMRPage
  171. } else if (type === '12') {
  172. return api.qcResultShortXYPage
  173. }else{
  174. return api.qcResultDefectList
  175. }
  176. }
  177. // 初始化导出接口
  178. function formatExportUrl(type) {
  179. if (type === '7' || type === '8') {
  180. return api.qcCheckMRPageExport
  181. } else if (type === '6') {
  182. return api.hmImproveMRPageExport
  183. } else if (type === '12') {
  184. return api.qcResultShortXYPageExport
  185. }else {
  186. // 默认导出接口
  187. return api.qcResultShortPageExport
  188. }
  189. }
  190. function getTabData(activePage){
  191. // 判断是否是 住院超过31日病人数
  192. let beHosGT31Days = null
  193. if (fromDays && fromDays === "1") {
  194. beHosGT31Days = 1
  195. }
  196. if (casesEntryId === 'undefined') {
  197. casesEntryId = ""
  198. }
  199. let param = {
  200. current:activePage,
  201. behospitalCode: behospitalCode,
  202. patName: name, //病人姓名
  203. level:level,//病历等级
  204. behDeptName: deptName == "全部" ? "":deptName||"",
  205. deptName: deptName == "全部" ? "":deptName||"",
  206. ascs:data_asc, //升序
  207. descs:data_desc, //降序
  208. startDate: behosDateStart.replace(/\//g,'-'), //出院日期--开始时间
  209. endDate: behosDateEnd.replace(/\//g,'-'), //出院日期--结束时间
  210. casesEntryName: casesEntryName,
  211. casesEntryId: casesEntryId,
  212. casesId:casesId,
  213. professor: professor,
  214. beHosGT31Days,
  215. size: 15,
  216. deptId: deptId,
  217. ruleType:ruleType,
  218. isReject: isSingleReject,
  219. doctorName: doctorName,
  220. doctorId: doctorNum,
  221. checkStatus: qcCheckStatus?Number(qcCheckStatus):qcCheckStatus, //病历核查状态
  222. mrStatus: fpCheckStatus?Number(fpCheckStatus):fpCheckStatus, //首页核查状态(1:已核查,0:未核查)
  223. chName: qcCheckName, //病历核查人员
  224. diagnose: qcCheckMain,
  225. mrName: fpCheckName, //首页核查人员
  226. chTimeStart: qcCheckDateStart.replace(/\//g,'-'), //病历核查起始时间
  227. chTimeEnd: qcCheckDateEnd.replace(/\//g,'-'), //病历核查截止时间
  228. mrTimeStart: fpCheckDateStart.replace(/\//g,'-'), //首页核查起始时间
  229. mrTimeEnd: fpCheckDateEnd.replace(/\//g,'-'), //首页核查截止时间
  230. }
  231. if (from == 9) {
  232. if (deptName ==="全部"){
  233. deptName = ''
  234. }
  235. param = { ...param, behDeptName: deptName}
  236. }
  237. if (from == 7) {
  238. param = { ...param, checkStatus: 1 }
  239. }
  240. if (from == 6) {
  241. param = { ...param, improveType }
  242. }
  243. let url = formatPostUrl(from)
  244. $('.pagination').html("")
  245. $('.tbody').html(emptyBox('努力加载中...','',1))
  246. return post(url,param).then(res =>{
  247. if(res.data.code == '0'){
  248. const data = res.data.data;
  249. tabList = data.records;
  250. const totalPage = data.pages;
  251. const totalNum = data.total;
  252. currentPage = activePage
  253. renderTab(tabList,data.hospitalId);
  254. renderPagination(totalPage,Number(activePage),totalNum)
  255. if(totalPage > 1){
  256. renderPagination(totalPage,Number(activePage),totalNum)
  257. } else{
  258. $('.pagination').html("")
  259. }
  260. }else{
  261. $.alerModal({"message":res.data.msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  262. }
  263. }).catch((e) =>{
  264. console.log(999)
  265. })
  266. }
  267. //getTabData(1)
  268. $(".filter").on("click", function(e){
  269. behosDateStart = $("#datepicker").val()
  270. behosDateEnd = $("#datepicker2").val()
  271. fpCheckDateStart = $("#datepickerFp1").val()
  272. fpCheckDateEnd = $("#datepickerFp2").val()
  273. qcCheckDateStart = $("#datepickerQc1").val()
  274. qcCheckDateEnd = $("#datepickerQc2").val()
  275. const behosDateStartTime = new Date(behosDateStart).getTime()
  276. const behosDateEndTime = new Date(behosDateEnd).getTime()
  277. const qcCheckDateStartTime = new Date(qcCheckDateStart).getTime()
  278. const qcCheckDateEndTime = new Date(qcCheckDateEnd).getTime()
  279. const fpCheckDateStartTime = new Date(fpCheckDateStart).getTime()
  280. const fpCheckDateEndTime = new Date(fpCheckDateEnd).getTime()
  281. if(behosDateStartTime > behosDateEndTime){
  282. $.alerModal({"message":'出院日期开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  283. return
  284. }
  285. if(qcCheckDateStartTime > qcCheckDateEndTime){
  286. $.alerModal({"message":'病历核查开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  287. return
  288. }
  289. if(fpCheckDateStartTime > fpCheckDateEndTime){
  290. $.alerModal({"message":'病案首页核查开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  291. return
  292. }
  293. if(behosDateStart){
  294. behosDateStart = behosDateStart + ' 00:00:00'
  295. }
  296. if(behosDateEnd){
  297. behosDateEnd = behosDateEnd + ' 23:59:59'
  298. }
  299. if(fpCheckDateStart){
  300. fpCheckDateStart = fpCheckDateStart + ' 00:00:00'
  301. }
  302. if(fpCheckDateEnd){
  303. fpCheckDateEnd = fpCheckDateEnd + ' 23:59:59'
  304. }
  305. if(qcCheckDateStart){
  306. qcCheckDateStart = qcCheckDateStart + ' 00:00:00'
  307. }
  308. if(qcCheckDateEnd){
  309. qcCheckDateEnd = qcCheckDateEnd + ' 23:59:59'
  310. }
  311. name = nameTemp
  312. behospitalCode = behospitalCodeTemp
  313. level = levelTemp==="全部"?"":levelTemp
  314. deptId = deptIdTemp
  315. deptName = deptNameTemp
  316. doctorName = doctorNameTemp
  317. fpCheckName = fpCheckNameTemp
  318. qcCheckName = qcCheckNameTemp
  319. qcCheckMain = qcCheckMainTemp
  320. doctorNum = doctorNumTemp
  321. fpCheckStatus = fpCheckStatusTemp
  322. qcCheckStatus = qcCheckStatusTemp
  323. if(deptName == ""){
  324. $(".selectDept").attr({'title':"全部",'data-id':''}).val("全部")
  325. }
  326. getTabData(1)
  327. })
  328. $(".abnormalClear").on("click", function(e){
  329. tabList = [];
  330. name = "";
  331. behospitalCode="";
  332. level="";
  333. scoreSum = 0;
  334. nameTemp = "";
  335. behospitalCodeTemp="";
  336. levelTemp="";
  337. deptId="";
  338. deptName="";
  339. deptNameTemp="";
  340. deptIdTemp="";
  341. // doctorName="";
  342. fpCheckName="";
  343. qcCheckName="" ;
  344. qcCheckMain="" ;
  345. doctorNum="";
  346. // doctorNameTemp="";
  347. fpCheckNameTemp="";
  348. qcCheckNameTemp="";
  349. qcCheckMainTemp="";
  350. doctorNumTemp="";
  351. fpCheckStatus="";
  352. fpCheckStatusTemp="";
  353. qcCheckStatus="";
  354. qcCheckStatusTemp=""
  355. data_desc=["leaveHospitalDate"]
  356. if(isPlacefile != 1){
  357. data_desc=["behospitalDate"]
  358. }
  359. data_asc=[];
  360. if (from == 2 ){
  361. deptId=deptListDept[0]&&deptListDept[0].deptId;
  362. deptName=deptListDept[0]&&deptListDept[0].deptName;
  363. deptNameTemp=deptListDept[0]&&deptListDept[0].deptName;
  364. deptIdTemp=deptListDept[0]&&deptListDept[0].deptId;
  365. }
  366. if (from == 4 || from == 9 || from == 8 || from == 12){
  367. deptId = deptIdTemp = deptIdPram
  368. deptName = deptNameTemp = deptNamePram
  369. }
  370. $('.patientNumInp').val('')
  371. $('.patientNameInp').val('')
  372. // $('.doctorInp').val('')
  373. $('.doctorNumInp').val('')
  374. $('.fpCheckPeople').val('')
  375. $('.qcCheckPeople').val('')
  376. $('.qcCheckMain').val('')
  377. // $('#datepicker').val('')
  378. // $('#datepicker2').val('')
  379. //默认日期为近一个月
  380. let year = new Date().getFullYear()
  381. let month = new Date().getMonth() + 1
  382. $( "#datepicker" ).datepicker({
  383. changeMonth: true,
  384. changeYear: true,
  385. dateFormat:"yy/mm/dd",
  386. }).datepicker( "setDate", new Date(`${year}-01-01`));
  387. $( "#datepicker2" ).datepicker({
  388. changeMonth: true,
  389. changeYear: true,
  390. dateFormat:"yy/mm/dd"
  391. }).datepicker( "setDate",new Date());
  392. $( "#datepickerFp1" ).datepicker({
  393. changeMonth: true,
  394. changeYear: true,
  395. dateFormat:"yy/mm/dd",
  396. }).datepicker( "setDate", "");
  397. $( "#datepickerFp2" ).datepicker({
  398. changeMonth: true,
  399. changeYear: true,
  400. dateFormat:"yy/mm/dd"
  401. }).datepicker( "setDate","");
  402. $( "#datepickerQc1" ).datepicker({
  403. changeMonth: true,
  404. changeYear: true,
  405. dateFormat:"yy/mm/dd",
  406. }).datepicker( "setDate", "");
  407. $( "#datepickerQc2" ).datepicker({
  408. changeMonth: true,
  409. changeYear: true,
  410. dateFormat:"yy/mm/dd"
  411. }).datepicker( "setDate","");
  412. if (from == 2){
  413. $('.selectDept ').val(deptListDept[0].deptName)
  414. deptName = deptNameTemp = deptListDept[0].deptName
  415. } else if (from == 4 || from == 9 || from == 8 || from == 12){
  416. $('.selectDept').val(deptNamePram)
  417. deptName = deptNameTemp = deptNamePram
  418. deptId = deptIdTemp = deptIdPram
  419. $('.selectDept ').attr('title',deptNamePram)
  420. $(".deptList").css("display", "none")
  421. }else{
  422. $('.selectDept ').val('全部')
  423. }
  424. $(".deptList").css("display", "none")
  425. // $('.selectDept ').addClass('unSelect')
  426. $('.selectLevel').html('全部')
  427. $(".levelList").css("display", "none")
  428. $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  429. // $('.selectLevel ').addClass('unSelect')
  430. $('.fpSelectCheck').html('全部')
  431. $(".fpCheckList").css("display", "none")
  432. $(".fpSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  433. $('.qcSelectCheck').html('全部')
  434. $(".qcCheckList").css("display", "none")
  435. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  436. $("th[code]").removeClass("asc desc")
  437. if(isPlacefile == 1){
  438. $(".leaveHospitalDate").addClass(" desc")
  439. }else{
  440. $(".behospitalDate").addClass(" desc")
  441. }
  442. behosDateStart = $("#datepicker").val()
  443. behosDateEnd = $("#datepicker2").val()
  444. if(behosDateStart){
  445. behosDateStart = behosDateStart + ' 00:00:00'
  446. }
  447. if(behosDateEnd){
  448. behosDateEnd = behosDateEnd + ' 23:59:59'
  449. }
  450. fpCheckDateStart = ""
  451. fpCheckDateEnd = ""
  452. qcCheckDateStart = ""
  453. qcCheckDateEnd = ""
  454. getTabData(1)
  455. })
  456. function renderTab(data,hisId){
  457. let str = ``
  458. let hasSelectAll = true;
  459. if(data.length===0){
  460. $('.tbody').html(emptyBox(null,showNum+2))
  461. // initScroll("qcListCopy","YX",1)
  462. return;
  463. }
  464. for(let i = 0; i < data.length; i++){
  465. const item = data[i]
  466. if(!item.hasSelect){
  467. hasSelectAll = false
  468. }
  469. // str += `
  470. // <tr data-index=${i}>
  471. // <td class="textCenter">${(currentPage-1)*15 + i+1}</td>`
  472. str += `
  473. <tr data-index=${i}>
  474. <td class="scoreOperaItem textCenter">${item.hasSelect ? `<img class="iconCheck" src=${iconCheck} />` : `<img class="iconCheck" src=${iconUnCheck} />`}</td>
  475. `
  476. for(let j = 0; j < pageSet.length; j++){
  477. if(pageSet[j].status == 1){
  478. if(pageSet[j].val === "checkStatus" || pageSet[j].val === "mrStatus" ){
  479. str += `<td class="${isTextCenter(pageSet[j].val) ? 'textCenter':''}"><span data-index=${i} class="${pageSet[j].val=='name'?'patientNameSpan':'' } ">${item[pageSet[j].val] =="1"? "已核查" :item[pageSet[j].val] === 0 ? "未核查":"-"}<span></td>`
  480. }else if(pageSet[j].val == 'scoreRes'||pageSet[j].val == 'scoreBn'){
  481. str += `<td class="${isTextCenter(pageSet[j].val) ? 'textCenter':'textCenter'}"><span data-index=${i} class="${pageSet[j].val=='name'?'patientNameSpan':'' } ">${item[pageSet[j].val]===null?'-': item[pageSet[j].val]}<span></td>`
  482. }else{
  483. str += `<td class="${isTextCenter(pageSet[j].val) ? 'textCenter':''}"><span data-index=${i} class="${pageSet[j].val=='name'?'patientNameSpan':'' } ">${item[pageSet[j].val] || "-"}<span></td>`
  484. }
  485. }
  486. }
  487. // <td >${item.behospitalCode || "-"}</td>
  488. // <td>${item.fileCode || "-"}</td>
  489. // <td class="textCenter"><span data-index=${i} class="patientNameSpan">${item.name || "-"}<span></td>
  490. // <td class="textCenter">${item.sex || "-"}</td>
  491. // <td class="textCenter">${item.age || "-"}</td>
  492. // <td class="textCenter">${item.bedCode || "-"}</td>
  493. // <td class="textCenter">${item.behospitalDate&&item.behospitalDate.slice(0,10) || "-"}</td>
  494. // <td class="textCenter">${item.leaveHospitalDate&&item.leaveHospitalDate.slice(0,10)|| "-"}</td>
  495. // <td class="textCenter">${item.diagnose|| "-"}</td>
  496. // <td class="textCenter">${item.behDoctorName || "-"}</td>
  497. // <td class="textCenter">${item.doctorName || "-"}</td>
  498. // <td class="textCenter">${item.directorDoctorName || "-"}</td>
  499. // <td class="textCenter">${item.behDeptName || "-"}</td>
  500. // <td class="textCenter">${item.level || "-"}</td>
  501. // <td class="textCenter">${item.scoreRes || "-"}</td>
  502. // <td class="textCenter">${item.gradeTime&&item.gradeTime.slice(0,10) || "-"}</td>
  503. str += "</tr>"
  504. }
  505. if(data.length === 0){
  506. hasSelectAll = false
  507. }
  508. if(hasSelectAll){
  509. $('.scoreOpera img').attr("src" ,iconCheck)
  510. $('.scoreOpera').attr("data-selectall",true)
  511. }else{
  512. $('.scoreOpera img').attr("src" ,iconUnCheck)
  513. $('.scoreOpera').attr("data-selectall",false)
  514. }
  515. $('.tbody').html(str)
  516. bindScoreOperaItem()
  517. bindRecordScoreOper()
  518. bindScoreDetail(hisId)
  519. // initScroll("qcListCopy","YX",1)
  520. }
  521. function isTextCenter(name){
  522. const textCenterList = ['level', 'scoreRes', 'sex','age', 'behospitalDate', 'leaveHospitalDate', 'placefileDate', 'gradeTime','checkStatus','mrStatus','mrTime','chTime','chName','mrName','diagnose','behDoctorName','directorDoctorName','doctorName','name']
  523. return textCenterList.findIndex(item=> item==name) > -1
  524. }
  525. function scoreDetail(id,age,hid,code,name){
  526. const logoParam = getLogoParam();
  527. window.open(`./qcScore.html?id=${id}&age=${age}&name=${name}&hid=${getCookie('hospitalid')}&code=${code}`+logoParam)
  528. }
  529. function bindScoreDetail(hisId){
  530. $('.patientNameSpan').on('click',function(e){
  531. const index = $(this).attr("data-index")
  532. const id = tabList[index].behospitalCode
  533. const age = tabList[index].age;
  534. const noScore = tabList[index].level == '未评分'
  535. if(noScore){
  536. $.alerModal({"message":'请先进行评分!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  537. return
  538. } else{
  539. scoreDetail(id,age,hisId,'YH-BLZK-ZKPF',tabList[index].name)
  540. }
  541. })
  542. }
  543. //选择病历等级
  544. $('.selectLevel').on("click", function(e){
  545. e.stopPropagation()
  546. $(".deptList ").css("display", "none")
  547. $(".selectDept .arrow").attr("src",iconDown)
  548. $(".fpCheckList ").css("display", "none")
  549. $(".fpSelectCheck .arrow").attr("src",iconDown)
  550. $(".qcSelectCheck .arrow").attr("src",iconDown)
  551. $(".qcCheckList ").css("display", "none")
  552. const showList = $(".levelList ").css("display")
  553. if(showList == "none" ||!showList){
  554. $(".levelList ").css("display","block")
  555. $(".selectLevel .arrow").attr("src",iconUp)
  556. }else{
  557. $(".levelList ").css("display", "none")
  558. $(".selectLevel .arrow").attr("src",iconDown)
  559. }
  560. })
  561. //选择病案首页核查状态
  562. $('.fpSelectCheck').on("click", function(e){
  563. e.stopPropagation()
  564. $(".deptList ").css("display", "none")
  565. $(".selectDept .arrow").attr("src",iconDown)
  566. $(".levelList ").css("display","none")
  567. $(".selectLevel .arrow").attr("src",iconDown)
  568. $(".qcSelectCheck .arrow").attr("src",iconDown)
  569. $(".qcCheckList ").css("display", "none")
  570. const showList = $(".fpCheckList ").css("display")
  571. if(showList == "none" ||!showList){
  572. $(".fpCheckList ").css("display","block")
  573. $(".fpSelectCheck .arrow").attr("src",iconUp)
  574. }else{
  575. $(".fpCheckList ").css("display", "none")
  576. $(".fpSelectCheck .arrow").attr("src",iconDown)
  577. }
  578. })
  579. //选择病历核查状态
  580. $('.qcSelectCheck').on("click", function(e){
  581. e.stopPropagation()
  582. $(".deptList ").css("display", "none")
  583. $(".selectDept .arrow").attr("src",iconDown)
  584. $(".levelList ").css("display","none")
  585. $(".selectLevel .arrow").attr("src",iconDown)
  586. $(".fpSelectCheck .arrow").attr("src",iconDown)
  587. $(".fpCheckList ").css("display", "none")
  588. const showList = $(".qcCheckList ").css("display")
  589. if(showList == "none" ||!showList){
  590. $(".qcCheckList ").css("display","block")
  591. $(".qcSelectCheck .arrow").attr("src",iconUp)
  592. }else{
  593. $(".qcCheckList ").css("display", "none")
  594. $(".qcSelectCheck .arrow").attr("src",iconDown)
  595. }
  596. })
  597. bindLeveldSelect()
  598. //病历等级选择
  599. function bindLeveldSelect(){
  600. $('.levelItem').on("click",function(){
  601. const levelItemName = $(this).attr("data-name")
  602. const levelItemItemId = $(this).attr("data-id")
  603. levelTemp =levelItemItemId
  604. $('.selectLevel').html(levelItemName)
  605. $(".levelList").css("display", "none")
  606. $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  607. $('.selectLevel').removeClass('unSelect')
  608. })
  609. }
  610. bindCheckedSelectFp()
  611. //病案首页核查状态选择
  612. function bindCheckedSelectFp(){
  613. $('.fpCheckItem').on("click",function(){
  614. const fpCheckItemName = $(this).attr("data-name")
  615. const fpCheckItemItemId = $(this).attr("data-id") || ""
  616. fpCheckStatusTemp =fpCheckItemItemId
  617. $('.fpSelectCheck').html(fpCheckItemName)
  618. $(".fpCheckList").css("display", "none")
  619. $(".fpSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  620. $('.fpSelectCheck').removeClass('unSelect')
  621. })
  622. }
  623. bindCheckedSelectQc()
  624. //病历核查状态选择
  625. function bindCheckedSelectQc(){
  626. $('.qcCheckItem').on("click",function(){
  627. const qcCheckItemName = $(this).attr("data-name")
  628. const qcCheckItemItemId = $(this).attr("data-id") || ""
  629. qcCheckStatusTemp =qcCheckItemItemId
  630. $('.qcSelectCheck').html(qcCheckItemName)
  631. $(".qcCheckList").css("display", "none")
  632. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  633. $('.qcSelectCheck').removeClass('unSelect')
  634. })
  635. }
  636. function bindScoreOperaItem(){
  637. $(".scoreOperaItem").off("click").on("click", function(e){
  638. const index = $(this).parent().attr("data-index")
  639. tabList[index].hasSelect = tabList[index].hasSelect ? false:true
  640. renderTab(tabList)
  641. })
  642. }
  643. function bindRecordScoreOper(){
  644. $(".recordScoreOperaBtn").on("click", function(e){
  645. if(!hasData('FUNC000017')){
  646. return
  647. }
  648. const index = $(this).parent().attr("data-index")
  649. const behospitalCode = tabList[index].behospitalCode
  650. loading()
  651. recordScore(behospitalCode,1,true)
  652. })
  653. }
  654. function bindOperaAll(){
  655. $('.scoreOpera').on("click", function(e){
  656. const hasSelectAll = $('.scoreOpera').attr("data-selectall")
  657. if(hasSelectAll == 'true'){
  658. for(let i = 0; i < tabList.length; i++){
  659. tabList[i].hasSelect = false
  660. }
  661. }else{
  662. for(let i = 0; i < tabList.length; i++){
  663. tabList[i].hasSelect = true
  664. }
  665. }
  666. renderTab(tabList)
  667. })
  668. }
  669. $('.selectDept').on("focus", function(e){
  670. e.stopPropagation()
  671. // let val = $(this).val().trim()
  672. // deptName = deptNameTemp = val
  673. // val&&getDeptList(val)
  674. $(".levelList ").css("display","none")
  675. $(".selectLevel .arrow").attr("src",iconDown)
  676. $(".fpCheckList ").css("display", "none")
  677. $(".fpSelectCheck .arrow").attr("src",iconDown)
  678. $(".qcCheckList ").css("display", "none")
  679. $(".qcSelectCheck .arrow").attr("src",iconDown)
  680. $(".deptList ").css("display","block")
  681. })
  682. $('.selectDept').on("blur", function(e){
  683. $(".deptList ").css("display", "none")
  684. $(".selectDept .arrow").attr("src",iconDown)
  685. })
  686. $('.selectDept').on("input", function(e){
  687. let val = $(this).val().trim()
  688. deptName = deptNameTemp = val
  689. getDeptList(deptName)
  690. })
  691. //获取科室列表
  692. getDeptList()
  693. function getDeptList(val){
  694. if(from == 2){
  695. rendeDeptList(deptListDept)
  696. return
  697. }
  698. post(api.getDeptList,{inputStr:val=="全部"?"":val||""}).then(res =>{
  699. if(res.data.code == '0'){
  700. const deptList = res.data.data||[]
  701. rendeDeptList(deptList)
  702. }else{
  703. rendeDeptList([])
  704. }
  705. }).catch((e) =>{
  706. })
  707. }
  708. function rendeDeptList(deptList){
  709. if(deptList.length == 0){
  710. $('.deptList').html("")
  711. return
  712. }
  713. let str = `<li class="deptItem ellipsis" data-id="" data-name="全部">全部</li>`;
  714. if(from == 2){
  715. str = ''
  716. }
  717. for(let i = 0; i < deptList.length; i++){
  718. str += `<li class="deptItem ellipsis" title=${deptList[i].deptName} data-id=${deptList[i].deptId} data-name=${deptList[i].deptName}> ${deptList[i].deptName}</li>`
  719. }
  720. $('.deptList').html(str)
  721. bindDeptSelect()
  722. }
  723. //科室选择
  724. function bindDeptSelect(){
  725. $('.deptItem').on("mousedown",function(){
  726. const deptItemName = $(this).attr("data-name")
  727. const deptItemId = $(this).attr("data-id")
  728. deptId = deptIdTemp =deptItemId
  729. deptNameTemp=deptItemName==="全部"?"":deptItemName;
  730. $('.selectDept').val(deptItemName)
  731. $('.selectDept ').attr('title',deptItemName)
  732. $(".deptList").css("display", "none")
  733. $('.selectDept').removeClass('unSelect')
  734. })
  735. }
  736. //获取页面配置
  737. function getPageSet(){
  738. return post(api.getQcListPageSet,{pageType:1}).then(res =>{
  739. if(res.data.code == '0'){
  740. pageSet = res.data.data
  741. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  742. showNum = 0
  743. renderTabTitle(pageSet)
  744. }else{}
  745. }).catch((e) =>{
  746. })
  747. }
  748. function renderTabTitle(data){
  749. // let str = `
  750. // <th class="textCenter" style="width: 65px;">序号</th>`
  751. let str = ` <th class="textCenter" ></th>`
  752. let defaultOrder = isPlacefile == 1 ? 'leaveHospitalDate':'behospitalDate'
  753. for(let i = 0; i < data.length; i++){
  754. const item = data[i]
  755. if(item.status == 1){
  756. showNum++
  757. str += `<th class="textCenter ${item.val} ${item.val ==defaultOrder ? 'desc':''}" code="${item.val}">${item.name}</th>`
  758. }
  759. }
  760. // <span class="setCol"><img class="iconSetting" src=${require('./../images/setting.png')} alt="关闭" />列设置</span>
  761. let operStr=`<td colspan="${showNum+2}" style="background: #fff">
  762. <div class="tabFoot">
  763. <span class="scoreOpera" data-selectAll=false><img class="iconCheck" src="${iconUnCheck}" alt="checkbox">全选</span>
  764. <span class="recordScoreBtn">评分</span>
  765. <span class="setCol">列设置</span>
  766. <span class="tipIcon"><img class="toolTipIcon" src=${require('./../images/toolTip.png')} alt="关闭" /></span>
  767. <span class="tooltip">可设置列的隐藏、显示及排序</span>
  768. </div>
  769. </td>`
  770. $(".tabOpera").html(operStr)
  771. $(".tabTitle").html(str)
  772. //全选绑定
  773. bindOperaAll()
  774. bindRecordScoreBtn()
  775. bindSetCol()
  776. bindOrder()
  777. bindToolTip()
  778. }
  779. function bindToolTip() {
  780. $('.tipIcon').off("hover").hover(function () {
  781. $('.tooltip').css('visibility', "visible")
  782. }, function () {
  783. $('.tooltip').css('visibility', "hidden")
  784. })
  785. }
  786. function bindSetCol(){
  787. $(".setCol").off("click").on("click", function(){
  788. renderColSet(pageSetCopy)
  789. })
  790. $('.setCol').off("hover").hover(function () {
  791. $('.setCol').css('color', '#00A1FF')
  792. }, function () {
  793. $('.setCol').css('color', '#777777')
  794. })
  795. }
  796. function loading(){
  797. const str = `
  798. <div class="loadingBox">
  799. <div class="mask"></div>
  800. <img class="loadingImg" src=${loadingImg} alt="loading" />
  801. </div>
  802. `
  803. $("#mainBox", parent.document).append(str)
  804. }
  805. function hideLoading(){
  806. $("#mainBox .loadingBox", parent.document).remove()
  807. }
  808. function bindRecordScoreBtn(){
  809. $('.recordScoreBtn').off("click").on("click",function(e){
  810. scoreSum = 0; // 解决全选评分之后 再单选 toast不隐藏的bug
  811. // if(!hasData('FUNC000017')){
  812. // return
  813. // }
  814. let scoreList = []
  815. for(let i = 0; i <tabList.length; i++){
  816. if(tabList[i].hasSelect){
  817. scoreList.push(tabList[i].behospitalCode)
  818. }
  819. }
  820. if(scoreList.length === 0){
  821. $.alerModal({"message":'请选择要评分的项!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  822. return
  823. } else{
  824. loading()
  825. for(let j = 0; j < scoreList.length; j++){
  826. recordScore(scoreList[j],scoreList.length,true)
  827. }
  828. }
  829. })
  830. }
  831. function bindOrder(){
  832. $("th[code]").off("click").on("click",function(e){
  833. const code=$(this).attr("code");
  834. if(data_asc[0]===code){
  835. data_desc=[code];
  836. data_asc=[];
  837. $("th[code]").removeClass("asc desc");
  838. $(this).addClass("desc");
  839. }else{
  840. data_desc=[];
  841. data_asc=[code];
  842. $("th[code]").removeClass("asc desc");
  843. $(this).addClass("asc");
  844. }
  845. getTabData(1);
  846. // console.log(code)
  847. });
  848. }
  849. function recordScore(behospitalCode,totalNum,hasToast){
  850. const param = {
  851. behospitalCode: behospitalCode
  852. }
  853. post(api.recordScore,param).then(res =>{
  854. if(res.data.code == '0'){
  855. scoreSum++
  856. if(scoreSum === totalNum){
  857. hideLoading()
  858. scoreSum = 0
  859. const activePage = $(".activePage").attr('data-page') || 1
  860. getTabData(activePage)
  861. if(hasToast){
  862. $.alerModal({"message":'评分成功',type:"tip",time:'1000',isFather: true,win: true, fatherWrapper: $("#mainBox", parent.document)});
  863. }
  864. }
  865. }else{
  866. scoreSum++
  867. if(scoreSum === totalNum){
  868. hideLoading()
  869. scoreSum = 0
  870. const activePage = $(".activePage").attr('data-page') || 1
  871. getTabData(activePage)
  872. if(hasToast){
  873. $.alerModal({"message":'评分失败,请重试~',type:"tip",time:'1000',win: 'default',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  874. }
  875. }
  876. }
  877. }).catch((e) =>{
  878. scoreSum++
  879. if(scoreSum === totalNum){
  880. hideLoading()
  881. scoreSum = 0
  882. const activePage = $(".activePage").attr('data-page') || 1
  883. getTabData(activePage)
  884. if(hasToast){
  885. $.alerModal({"message":'评分失败,请重试~',type:"tip",time:'1000',win: 'default',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  886. }
  887. }
  888. })
  889. }
  890. function renderColSet(list){
  891. let pageSetList = list || pageSetCopy
  892. let allSelect = true
  893. for(let i = 0; i < pageSetList.length; i++){
  894. if(pageSetList[i].status != 1){
  895. allSelect = false
  896. }
  897. }
  898. let str = `<div class='colSetBox'>
  899. <div class='mask'></div>
  900. <div class='cloInfobox'>
  901. <div class='cloInfoTitle'><span class='cloInfoTitleTxt'>列显示设置</span> <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></div>
  902. <div class='cloInfo'></div>
  903. <div class='btnBox'><span class='defaultColSet'>恢复默认</span> <span class='cancalColSet'>取消</span> <span class='saveColSet'>保存设置</span></div>
  904. </div>
  905. </div>`
  906. let infoStr = `<div class='colTabTitle' ><span class='colOpera toggleSelectColAll' data-select=${allSelect}>${allSelect ? `<img src=${iconCheck} />`:`<img src=${iconUnCheck} />`}全选</span><span class='colName'>列名</span></div><div class='colTabInfoBox' >`
  907. for(let i = 0; i < pageSetList.length; i++){
  908. infoStr += `<div class='colTabInfo' data-index=${i}>
  909. <span class='colOpera' data-index=${i}>${pageSetList[i].status == 1 ? `<img class="toggleSelectCol" src=${iconCheck} />`:`<img class="toggleSelectCol" src=${iconUnCheck} />`}</span>
  910. <span class='colName'>
  911. <span>${pageSetList[i].name}</span>
  912. <span class="pageOrder">
  913. <span class="pageSetUpBox">${ i === 0 ?'':`<img class="pageSetUp" src=${goUpG} />`}</span>
  914. <span class="pageSetDownBox">${ i === pageSetList.length -1 ?'':`<img class="pageSetDown" src=${goDownG} />`}</span>
  915. </span>
  916. </span>
  917. </div>`
  918. }
  919. infoStr += "</div>"
  920. // $(".main-body").append(str)
  921. if(!$("#mainBox .colSetBox", parent.document).length){
  922. $("#mainBox", parent.document).append(str)
  923. }
  924. $("#mainBox .colSetBox .cloInfo", parent.document).html(infoStr)
  925. $(".colTabInfoBox", parent.document).scrollTop(scrollTop)
  926. scrollTop = 0
  927. bindSelectCol()
  928. bindColOrder()
  929. bindSaveColSet()
  930. bindDefaultColset()
  931. bindCloseColSet()
  932. bindImgEnter()
  933. }
  934. function bindDefaultColset() {
  935. $('.defaultColSet', parent.document).off("hover").hover(function () {
  936. $(this).css('color', '#00A1FF')
  937. }, function () {
  938. $(this).css('color', '#777777')
  939. })
  940. $('.defaultColSet', parent.document).off("click").on('click', function () {
  941. return post(api.getDefaultPageSet, { pageType: 1 }).then(res => {
  942. if (res.data.code == '0') {
  943. pageSet = res.data.data
  944. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  945. renderColSet(pageSetCopy)
  946. } else { }
  947. }).catch((e) => {
  948. })
  949. // closeColSet()
  950. })
  951. }
  952. function bindImgEnter(){
  953. $(".pageSetUpBox img",parent.document).off("mouseenter").on("mouseenter",function(){
  954. $(this).attr('src', goUpB)
  955. })
  956. $(".pageSetDownBox img",parent.document).off("mouseenter").on("mouseenter",function(){
  957. $(this).attr('src', goDownB)
  958. })
  959. $(".pageSetUpBox img",parent.document).off("mouseout").on("mouseout",function(){
  960. $(this).attr('src', goUpG)
  961. })
  962. $(".pageSetDownBox img",parent.document).off("mouseout").on("mouseout",function(){
  963. $(this).attr('src', goDownG)
  964. })
  965. }
  966. function bindSelectCol(){
  967. $(".toggleSelectCol", parent.document ).off("click").on("click", function(){
  968. const index = $(this).parent().attr("data-index")
  969. pageSetCopy[index].status = pageSetCopy[index].status == 1 ? 0 : 1
  970. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  971. renderColSet(pageSetCopy)
  972. })
  973. $(".toggleSelectColAll", parent.document ).off("click").on("click", function(){
  974. const hasSelectAll = $(this).attr("data-select")
  975. for(let i = 0; i < pageSetCopy.length; i++){
  976. if(hasSelectAll == "true"){
  977. pageSetCopy[i].status = 0
  978. }else{
  979. pageSetCopy[i].status = 1
  980. }
  981. }
  982. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  983. renderColSet(pageSetCopy)
  984. })
  985. }
  986. function closeColSet(){
  987. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  988. $("#mainBox .colSetBox", parent.document).remove()
  989. }
  990. function bindCloseColSet(){
  991. $(".colSetBox .iconClose", parent.document ).off("click").on("click",function(){
  992. closeColSet()
  993. })
  994. $(".colSetBox .cancalColSet", parent.document ).off("click").on("click",function(){
  995. closeColSet()
  996. })
  997. }
  998. function bindSaveColSet(){
  999. $(".saveColSet", parent.document ).off("click").on("click", function(){
  1000. let showNumSet = 0
  1001. let sysUserPagesetVOList = []
  1002. for(let i = 0; i < pageSetCopy.length; i++){
  1003. const item = pageSetCopy[i]
  1004. sysUserPagesetVOList.push({
  1005. name: item.name,
  1006. orderNo: i,
  1007. status: item.status,
  1008. val: item.val
  1009. })
  1010. if(item.status == 1){
  1011. showNumSet++
  1012. }
  1013. }
  1014. if(showNumSet === 0){
  1015. $.alerModal({"message":'最少显示一列',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1016. return
  1017. }
  1018. return post(api.saveQcListPageSet,{pageType:1,sysUserPagesetVOList:sysUserPagesetVOList}).then(res =>{
  1019. if(res.data.code == '0'){
  1020. closeColSet()
  1021. getPageSet().then(res =>{
  1022. $(".filter").click(); //初始查询
  1023. })
  1024. }else{
  1025. $("#mainBox .colSetBox", parent.document).remove()
  1026. $.alerModal({"message":'保存失败,请重试~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1027. }
  1028. }).catch((e) =>{
  1029. $("#mainBox .colSetBox", parent.document).remove()
  1030. $.alerModal({"message":'保存失败,请重试~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1031. })
  1032. })
  1033. }
  1034. function bindColOrder(){
  1035. $(".pageSetUp", parent.document ).off("click").on("click", function(){
  1036. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  1037. if(index != 0){
  1038. const upItem = pageSetCopy[index]
  1039. const upItemPre = pageSetCopy[index-1]
  1040. pageSetCopy.splice(index-1,2,upItem,upItemPre)
  1041. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  1042. renderColSet(pageSetCopy)
  1043. }else{
  1044. return
  1045. }
  1046. })
  1047. $(".pageSetDown", parent.document ).off("click").on("click", function(){
  1048. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  1049. if(index == pageSetCopy.length - 1){
  1050. return
  1051. }else{
  1052. const downItem = pageSetCopy[index]
  1053. const downItemBack = pageSetCopy[index + 1]
  1054. pageSetCopy.splice(index,2,downItemBack,downItem)
  1055. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  1056. renderColSet(pageSetCopy)
  1057. }
  1058. })
  1059. }
  1060. $(".patientNumInp").on("input", function(e){
  1061. const val = $(this).val().trim();
  1062. let beCode=behospitalCode;
  1063. const patrn = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/g;
  1064. beCode=val.replace(patrn,function(x){
  1065. return "\\"+x;
  1066. });
  1067. behospitalCodeTemp = beCode
  1068. });
  1069. $(".patientNameInp").on("input", function(e){
  1070. const val = $(this).val().trim()
  1071. nameTemp = val
  1072. })
  1073. $(".doctorInp").on("input", function(e){
  1074. const val = $(this).val().trim()
  1075. doctorNameTemp = val
  1076. })
  1077. $(".fpCheckPeople").on("input", function(e){
  1078. const val = $(this).val().trim()
  1079. fpCheckNameTemp = val
  1080. })
  1081. $(".qcCheckPeople").on("input", function(e){
  1082. const val = $(this).val().trim()
  1083. qcCheckNameTemp = val
  1084. })
  1085. $(".qcCheckMain").on("input", function(e){
  1086. const val = $(this).val().trim()
  1087. qcCheckMainTemp = val
  1088. })
  1089. $(".doctorNumInp").on("input", function(e){
  1090. const val = $(this).val().trim();
  1091. doctorNumTemp = val
  1092. })
  1093. $(function() {
  1094. $.datepicker.regional['zh-CN'] = {
  1095. clearText: '清除',
  1096. clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
  1097. closeText: '关闭',
  1098. closeStatus: '不改变当前选择',
  1099. prevText: '<上月',
  1100. prevStatus: '显示上月',
  1101. prevBigText: '<<',
  1102. prevBigStatus: '显示上一年',
  1103. nextText: '下月>',
  1104. nextStatus: '显示下月',
  1105. nextBigText: '>>',
  1106. nextBigStatus: '显示下一年',
  1107. currentText: '今天',
  1108. currentStatus: '显示本月',
  1109. monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  1110. monthNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  1111. yearNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
  1112. monthStatus: '选择月份',
  1113. yearStatus: '选择年份',
  1114. weekHeader: '周',
  1115. weekStatus: '年内周次',
  1116. dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
  1117. dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
  1118. dayNamesMin: ['日','一','二','三','四','五','六'],
  1119. dayStatus: '设置 DD 为一周起始',
  1120. dateStatus: '选择 m月 d日, DD',
  1121. dateFormat: 'yy-mm-dd',
  1122. firstDay: 1,
  1123. initStatus: '请选择日期',
  1124. isRTL: false};
  1125. $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  1126. let startDate = "", endDate=new Date()
  1127. let year = new Date().getFullYear()
  1128. let month = new Date().getMonth() + 1
  1129. if(statisticsType == '1'){
  1130. startDate = new Date(`${year}-${month}-01`)
  1131. }else if(statisticsType == '2'){
  1132. startDate = new Date(`${year}-01-01`)
  1133. } else if(statisticsType == '3') {
  1134. startDate = new Date(startDateParam)
  1135. endDate = new Date(endDateParam)
  1136. }else{
  1137. startDate = "-6d"
  1138. }
  1139. $( "#datepicker" ).datepicker({
  1140. changeMonth: true,
  1141. changeYear: true,
  1142. dateFormat:"yy/mm/dd",
  1143. }).datepicker( "setDate", startDate);
  1144. $( "#datepicker2" ).datepicker({
  1145. changeMonth: true,
  1146. changeYear: true,
  1147. dateFormat:"yy/mm/dd"
  1148. }).datepicker( "setDate",endDate);
  1149. $( "#datepickerFp1" ).datepicker({
  1150. changeMonth: true,
  1151. changeYear: true,
  1152. dateFormat:"yy/mm/dd"
  1153. }).datepicker( "setDate","");
  1154. $( "#datepickerFp2" ).datepicker({
  1155. changeMonth: true,
  1156. changeYear: true,
  1157. dateFormat:"yy/mm/dd"
  1158. }).datepicker( "setDate","");
  1159. $( "#datepickerQc1" ).datepicker({
  1160. changeMonth: true,
  1161. changeYear: true,
  1162. dateFormat:"yy/mm/dd"
  1163. }).datepicker( "setDate","");
  1164. $( "#datepickerQc2" ).datepicker({
  1165. changeMonth: true,
  1166. changeYear: true,
  1167. dateFormat:"yy/mm/dd"
  1168. }).datepicker( "setDate","");
  1169. getPageSet().then(res =>{
  1170. $(".filter").click(); //初始查询
  1171. })
  1172. });
  1173. //分页渲染
  1174. function renderPagination(totalPage,activePage,totalNum){
  1175. let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
  1176. if(totalPage <= 6){
  1177. for(let i = 1; i <= totalPage; i++){
  1178. str += `<span class="pageNum ${'page'+i}" data-page=${i}>${i}</span>`
  1179. }
  1180. }else{
  1181. if(activePage <= 3){ //选中页数小于4
  1182. for(let i = 1; i <= 4; i++){
  1183. str += `<span class="pageNum ${'page'+i}" data-page=${i}>${i}</span>`
  1184. }
  1185. str += `<span class="more" >...</span>`
  1186. str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
  1187. } else if(activePage > totalPage -3){
  1188. str += `<span class="pageNum page1" data-page=1>1</span>`
  1189. str += `<span class="more" >...</span>`
  1190. str += `<span class="pageNum ${'page'+(totalPage-3)}" data-page=${totalPage -3}>${totalPage -3}</span>`
  1191. str += `<span class="pageNum ${'page'+(totalPage-2)}" data-page=${totalPage -2}>${totalPage -2}</span>`
  1192. str += `<span class="pageNum ${'page'+(totalPage-1)}" data-page=${totalPage -1}>${totalPage -1}</span>`
  1193. str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
  1194. } else {
  1195. str += `<span class="pageNum page1" data-page=1>1</span>`
  1196. str += `<span class="more" >...</span>`
  1197. str += `<span class="pageNum ${'page'+(activePage -1)}" data-page=${activePage -1}>${activePage -1}</span>`
  1198. str += `<span class="pageNum ${'page'+activePage}" data-page=${activePage}>${activePage}</span>`
  1199. str += `<span class="pageNum ${'page'+(activePage +1)}" data-page=${activePage +1}>${activePage +1}</span>`
  1200. str += `<span class="more" >...</span>`
  1201. str += `<span class="pageNum ${'page'+totalPage}" data-page=${totalPage}>${totalPage}</span>`
  1202. }
  1203. }
  1204. str += `<span class="nextPage"><img class="arrowPage" src=${arrowRight} /></span>`
  1205. $('.pagination').html(str)
  1206. $('.page' + activePage).addClass('activePage')
  1207. $(".pageNum").on("click", function(e){
  1208. const activePageNow = Number($(this).attr('data-page'))
  1209. getTabData(activePageNow)
  1210. // renderPagination(totalPage,activePageNow,totalNum)
  1211. })
  1212. $(".prePage").on("click", function(e){
  1213. let activePageNow = Number($(".activePage").attr('data-page'))
  1214. if(activePageNow > 1){
  1215. activePageNow--
  1216. getTabData(activePageNow)
  1217. // renderPagination(totalPage,activePageNow,totalNum)
  1218. }
  1219. })
  1220. $(".nextPage").on("click", function(e){
  1221. let activePageNow = Number($(".activePage").attr('data-page'))
  1222. if(activePageNow < totalPage){
  1223. activePageNow++
  1224. getTabData(activePageNow)
  1225. // renderPagination(totalPage,activePageNow,totalNum)
  1226. }
  1227. })
  1228. }
  1229. $(document).on("click", function(){
  1230. $(".levelList ").css("display", "none")
  1231. $(".fpCheckList").css("display", "none")
  1232. $(".qcCheckList").css("display", "none")
  1233. $(".selectDept .arrow").attr("src",iconDown)
  1234. $(".selectLevel .arrow").attr("src",iconDown)
  1235. $(".fpSelectCheck .arrow").attr("src",iconDown)
  1236. $(".qcSelectCheck .arrow").attr("src",iconDown)
  1237. })
  1238. $(function($){
  1239. $('.export').click(function(){
  1240. const behosDateStartTime = new Date(behosDateStart).getTime()
  1241. const behosDateEndTime = new Date(behosDateEnd).getTime()
  1242. const exportTime = defectName && defectName !== 'undefined' ? exportTimeLimit.defectTime :exportTimeLimit.normalTime
  1243. if(behosDateStartTime > behosDateEndTime){
  1244. $.alerModal({"message":'开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1245. return
  1246. }
  1247. // 判断是否是 住院超过31日病人数
  1248. let beHosGT31Days = null
  1249. if (fromDays && fromDays === "1") {
  1250. beHosGT31Days = 1
  1251. }
  1252. let param = {
  1253. behospitalCode: behospitalCode,
  1254. patName: name, //病人姓名
  1255. level:level,//病历等级
  1256. deptName: deptName == "全部" ? "":deptName||"",
  1257. behDeptName: deptName == "全部" ? "":deptName||"",
  1258. ascs:data_asc, //升序
  1259. descs:data_desc, //降序
  1260. ruleType:ruleType,
  1261. startDate: behosDateStart.replace(/\//g,'-'), //出院日期--开始时间
  1262. endDate: behosDateEnd.replace(/\//g,'-'), //出院日期--结束时间
  1263. casesEntryName: casesEntryName,
  1264. isPlacefile: isPlacefile,
  1265. casesEntryId:"",
  1266. casesId:casesId,
  1267. beHosGT31Days,
  1268. isReject: isSingleReject,
  1269. doctorName: doctorName,
  1270. doctorId: doctorNum,
  1271. checkStatus: qcCheckStatus?Number(qcCheckStatus):qcCheckStatus, //病历核查状态
  1272. mrStatus: fpCheckStatus?Number(fpCheckStatus):fpCheckStatus, //首页核查状态(1:已核查,0:未核查)
  1273. chName: qcCheckName, //病历核查人员
  1274. diagnose: qcCheckMain,
  1275. mrName: fpCheckName, //首页核查人员
  1276. chTimeStart: qcCheckDateStart.replace(/\//g,'-'), //病历核查起始时间
  1277. chTimeEnd: qcCheckDateEnd.replace(/\//g,'-'), //病历核查截止时间
  1278. mrTimeStart: fpCheckDateStart.replace(/\//g,'-'), //首页核查起始时间
  1279. mrTimeEnd: fpCheckDateEnd.replace(/\//g,'-'), //首页核查截止时间
  1280. }
  1281. let exportURL = formatExportUrl(from)
  1282. // console.log(exportURL,'exportURL导出接口');
  1283. if (from == 9) {
  1284. if (deptName === "全部") {
  1285. deptName = ''
  1286. }
  1287. param = { ...param, behDeptName: deptName }
  1288. }
  1289. if (from == 7) {
  1290. param = { ...param, checkStatus: 1 }
  1291. }
  1292. if (from == 6) {
  1293. param = { ...param, improveType }
  1294. }
  1295. if(exportTime==90){
  1296. if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > exportTime){
  1297. $.alerModal({"message":`最多只能导出${exportTime}天`,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1298. return
  1299. }else{
  1300. expJson(exportURL,param).then(res =>{
  1301. downloadExportedData(res.data, $(".partTitle").text()+".xls")
  1302. })
  1303. }
  1304. }else{
  1305. $.alerModal({type:"radio",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1306. closeRadio()
  1307. radioSelect()
  1308. bindSaveColPort(param,exportURL)
  1309. }
  1310. })
  1311. });
  1312. function closeRadio(){
  1313. $(".colSetBox .iconClose,.colSetBox .cancalColSet", parent.document ).off("click").on("click",function(){
  1314. $(".divModal", parent.document).remove()
  1315. })
  1316. }
  1317. function radioSelect(){
  1318. $(".selectDate", parent.document).click(function(){
  1319. $(this).find("input").prop("checked",true)
  1320. $(this).siblings().find("input").prop("checked",false)
  1321. })
  1322. }
  1323. function bindSaveColPort(param,exportURL){
  1324. $(".savePort", parent.document ).off("click").on("click", function(){
  1325. let radioCheck = $(".selectDate input[type='radio']:checked", parent.document).attr("data-select")
  1326. let time = radioCheck==2?exportTimeLimit.defectTime:exportTimeLimit.normalTime
  1327. if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > time){
  1328. $.alerModal({"message":`最多只能导出${time}天`,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
  1329. return
  1330. }
  1331. param.radioCheck = radioCheck||1
  1332. expJson(exportURL,param).then(res =>{
  1333. $(".divModal", parent.document).remove()
  1334. downloadExportedData(res.data, $(".partTitle").text()+".xls")
  1335. })
  1336. })
  1337. }