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