appealHistory.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. const $ = require('jquery');
  2. require("../css/appealHistory.less");
  3. require('./modal.js');
  4. require('jquery-templates');
  5. const { api } = require('./api.js')
  6. const { post, getCookie, getLocal, getUrlArgObjectNew, emptyBox, downloadExportedData, expJson, getLogoParam, listenScroll, getPickerDate, exportTimeLimit } = require('./utils.js')
  7. require('./../resource/jquery-ui/jquery-ui.min.js');
  8. require('./../resource/jquery-ui/jquery-ui.min.css');
  9. const iconCheck = require("./../images/icon_check.png")
  10. const iconUnCheck = require("./../images/icon_unchecked.png")
  11. const iconCalenBlue = require("./../images/icon_calen_blue.png")
  12. const iconCalenGrey = require("./../images/icon_calen_grey.png")
  13. const iconDown = require("./../images/arrow_down.png")
  14. const iconUp = require("./../images/arrow_up.png")
  15. const loadingImg = require("./../images/loading.gif")
  16. const arrowLeft = require("./../images/arrow_left.png")
  17. const arrowRight = require("./../images/arrow_right.png")
  18. const goUpG = require("./../images/arrow_up_grey.png")
  19. const goUpB = require("./../images/arrow_up_blue.png")
  20. const goDownG = require("./../images/arrow_down_grey.png")
  21. const goDownB = require("./../images/arrow_down_blue.png");
  22. const ret = require('bluebird/js/release/util');
  23. listenScroll()
  24. let pageSet = [], pageSetCopy = [], showNum = 0, scrollTop = 0;
  25. $(".selectModular").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  26. $(".selectType").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  27. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  28. $(".fpSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  29. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  30. let srcUrl = $("#contentIframe", parent.document).attr("src")
  31. let statisticsType = getUrlArgObjectNew("dateType", srcUrl) || getUrlArgObjectNew("shijian", srcUrl) || ""
  32. let startDateParam = getUrlArgObjectNew("startDateParam", srcUrl) || ""
  33. let endDateParam = getUrlArgObjectNew("endDateParam", srcUrl) || ""
  34. let tabList = [], name = "", behospitalCode = "", deptName = "", deptNameTemp = "", behosDateStart = "", level = "", behosDateEnd = "", nameTemp = "", moduleName = "", operationType = "",
  35. behospitalCodeTemp = "", levelTemp = "", deptId = "", deptIdTemp = "", doctorName = "", doctorNameTemp = "", doctorNum = "", doctorNumTemp = "",
  36. fpCheckStatus = "", fpCheckStatusTemp = "", fpCheckName = "", fpCheckNameTemp = "", qcCheckName = "", qcCheckNameTemp = "", qcCheckMain = "", qcCheckStatus = "", state = "",
  37. data_desc = ["leave_hospital_date"], data_asc = [], global_checkers = []; //审核人列表;
  38. let isPlacefile = getCookie('isPlacefile') || 1
  39. $('.datapickerBox').append(`<img class="iconCalen" src=${iconCalenGrey} />`)
  40. $('.iconCalen').on("mouseenter", function (e) {
  41. $(this).attr("src", iconCalenBlue)
  42. })
  43. $('.iconCalen').on("mouseleave", function (e) {
  44. $(this).attr("src", iconCalenGrey)
  45. })
  46. $('.iconCalen').on("click", function (e) {
  47. $(this).parent().find("input").focus()
  48. })
  49. $(".menu .page", parent.document).removeClass("active")
  50. $(parent.document).find(".menu .page[code=YH-SSXX-SSJL]").addClass("active")
  51. function getTabData(activePage) {
  52. const behosDateStart = getPickerDate($("#datepicker"), 1)
  53. const behosDateEnd = getPickerDate($("#datepicker2"), 2)
  54. const param = {
  55. current: activePage,
  56. deptId: deptId.trim(),
  57. asc: data_asc, //升序
  58. desc: data_desc, //降序
  59. deptName: deptName == "全部" ? "" : deptName || '',
  60. casesName: moduleName,
  61. operationType: operationType,
  62. state: state,
  63. size: 15,
  64. name: $('.patientNameInp').val(),
  65. complaintDateEnd: behosDateEnd.replaceAll("/", "-"),
  66. complaintDateStart: behosDateStart.replaceAll("/", "-"),
  67. }
  68. $('.pagination').html("")
  69. $('.tbody').html(emptyBox('努力加载中...', '',))
  70. return post(api.getComplaintRecord, param).then(res => {
  71. if (res.data.code == '0') {
  72. tabList = res.data.data.data.records
  73. const totalPage = res.data.data.data.pages
  74. const totalNum = res.data.data.data.total
  75. renderTab(tabList)
  76. renderPagination(totalPage, Number(activePage), totalNum)
  77. if (totalPage > 1) {
  78. renderPagination(totalPage, Number(activePage), totalNum)
  79. } else {
  80. $('.pagination').html("")
  81. }
  82. } else {
  83. const token = localStorage.getItem('accessToken');
  84. if (!token && window.location.href.indexOf('login') == -1) {
  85. //alert('无token判断,跳回登录')
  86. } else {
  87. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  88. }
  89. }
  90. }).catch((e) => {
  91. })
  92. }
  93. $(".filter").on("click", function (e) {
  94. behosDateStart = $("#datepicker").val()
  95. behosDateEnd = $("#datepicker2").val()
  96. const behosDateStartTime = new Date(behosDateStart).getTime()
  97. const behosDateEndTime = new Date(behosDateEnd).getTime()
  98. if (behosDateStartTime > behosDateEndTime) {
  99. $.alerModal({ "message": '出院日期开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  100. return
  101. }
  102. if (behosDateStart) {
  103. behosDateStart = behosDateStart.replace(/\//g, '-') + ' 00:00:00'
  104. }
  105. if (behosDateEnd) {
  106. behosDateEnd = behosDateEnd.replace(/\//g, '-') + ' 23:59:59'
  107. }
  108. name = nameTemp
  109. behospitalCode = behospitalCodeTemp
  110. level = levelTemp === "全部" ? "" : levelTemp
  111. deptId = deptIdTemp
  112. deptName = deptNameTemp
  113. doctorName = doctorNameTemp
  114. fpCheckName = fpCheckNameTemp
  115. qcCheckName = qcCheckNameTemp
  116. doctorNum = doctorNumTemp
  117. fpCheckStatus = fpCheckStatusTemp
  118. qcCheckStatus = state
  119. getTabData(1)
  120. })
  121. $(".abnormalClear").on("click", function (e) {
  122. tabList = [];
  123. name = "";
  124. behospitalCode = "";
  125. level = "";
  126. scoreSum = 0;
  127. nameTemp = "";
  128. behospitalCodeTemp = "";
  129. levelTemp = "";
  130. deptId = "";
  131. deptIdTemp = "";
  132. deptName = deptNameTemp = "";
  133. doctorName = "";
  134. fpCheckName = "";
  135. qcCheckName = "";
  136. qcCheckMain = "";
  137. doctorNum = "";
  138. doctorNameTemp = "";
  139. doctorNumTemp = "";
  140. fpCheckNameTemp = "";
  141. qcCheckNameTemp = "";
  142. qcCheckMainTemp = "";
  143. fpCheckStatus = "";
  144. fpCheckStatusTemp = "";
  145. qcCheckStatus = "";
  146. state = ""
  147. operationType = ""
  148. data_desc = ["leave_hospital_date"]
  149. if (isPlacefile != 1) {
  150. data_desc = ["behospital_date"]
  151. }
  152. data_asc = [];
  153. $('.patientNameInp').val('')
  154. // $('#datepicker').val('')
  155. // $('#datepicker2').val('')
  156. //默认日期为近一周
  157. $("#datepicker").datepicker({
  158. changeMonth: true,
  159. changeYear: true,
  160. dateFormat: "yy/mm/dd",
  161. }).datepicker("setDate", "-6d");
  162. $("#datepicker2").datepicker({
  163. changeMonth: true,
  164. changeYear: true,
  165. dateFormat: "yy/mm/dd"
  166. }).datepicker("setDate", new Date());
  167. $("#datepickerFp1").datepicker({
  168. changeMonth: true,
  169. changeYear: true,
  170. dateFormat: "yy/mm/dd",
  171. }).datepicker("setDate", "");
  172. $("#datepickerFp2").datepicker({
  173. changeMonth: true,
  174. changeYear: true,
  175. dateFormat: "yy/mm/dd"
  176. }).datepicker("setDate", "");
  177. $("#datepickerQc1").datepicker({
  178. changeMonth: true,
  179. changeYear: true,
  180. dateFormat: "yy/mm/dd",
  181. }).datepicker("setDate", "");
  182. $("#datepickerQc2").datepicker({
  183. changeMonth: true,
  184. changeYear: true,
  185. dateFormat: "yy/mm/dd"
  186. }).datepicker("setDate", "");
  187. $('.selectDept ').html('全部')
  188. $(".deptList").css("display", "none")
  189. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  190. // $('.selectDept ').addClass('unSelect')
  191. $('.selectModular').html('全部')
  192. $(".modularList").css("display", "none")
  193. $(".selectModular").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  194. // $('.selectModular ').addClass('unSelect')
  195. $('.fpSelectCheck').html('全部')
  196. $(".fpCheckList").css("display", "none")
  197. $(".fpSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  198. $('.qcSelectCheck').html('全部')
  199. $(".qcCheckList").css("display", "none")
  200. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  201. $("th[code]").removeClass("asc desc")
  202. if (isPlacefile == 1) {
  203. $(".leaveHospitalDate").addClass(" desc")
  204. } else {
  205. $(".behospitalDate").addClass(" desc")
  206. }
  207. behosDateStart = $("#datepicker").val()
  208. behosDateEnd = $("#datepicker2").val()
  209. if (behosDateStart) {
  210. behosDateStart = behosDateStart.replace(/\//g, '-') + ' 00:00:00'
  211. }
  212. if (behosDateEnd) {
  213. behosDateEnd = behosDateEnd.replace(/\//g, '-') + ' 23:59:59'
  214. }
  215. getTabData(1)
  216. })
  217. //获取审核人下拉列表
  218. function getCheckUser() {
  219. const param = {};
  220. post(api.getReviewer, param).then(function (res) {
  221. if (res.data.code === '0') {
  222. const data = res.data.data;
  223. global_checkers = data;
  224. $("#flawDropTmpl").tmpl({ info: data }).appendTo("#delModal .checker-drop-box ul");
  225. userDropEvent(".checker-drop-input", selectChecker);
  226. }
  227. });
  228. }
  229. function userDropEvent(domSelector, selectEvent) {
  230. $("body").on("click", domSelector, function () {
  231. $(domSelector).parents(".drop-box").toggleClass("show");
  232. });
  233. $("body").on("click", ".checker-drop-box li", function () {
  234. $(".add-box .warning").hide();
  235. const n = $(this).attr("idx");
  236. selectEvent(domSelector, n);
  237. $(domSelector).parents(".drop-box").find(".warning").hide();
  238. $(domSelector).parents(".drop-box").removeClass("show");
  239. });
  240. }
  241. //审核人下拉选中
  242. function selectChecker(domSelector, n) {
  243. const flaw = global_checkers[n];
  244. const { id, userName } = flaw;
  245. $(domSelector).text(userName).attr({ "code": id, "title": userName });
  246. }
  247. function renderTab(data) {
  248. let str = ``
  249. if (data.length === 0) {
  250. $('.tbody').html(emptyBox(null, showNum + 12))
  251. return;
  252. }
  253. for (let i = 0; i < data.length; i++) {
  254. const item = data[i]
  255. str += `
  256. <tr>
  257. <td >${item.claimantName || "-"}</td>
  258. <td >${item.behDeptName || "-"}</td>
  259. <td >${item.claimantGmtCreate}</td>
  260. <td >${item.behospitalCode}</td>
  261. <td >${item.name || "-"}</td>
  262. <td >${item.casesName || "-"}</td>
  263. <td >${item.defectContent || "-"}</td>
  264. <td >${item.checkName || "-"}</td>
  265. <td >${item.checkGmtCreate || "-"}</td>
  266. <td >${item.appealOperationType == 0 ? '删改条目' : item.appealOperationType == 1 ? '新增已有条目' : item.appealOperationType == 2 ? '新增缺失条目' : '恢复条目'}</td>
  267. <td >${item.exampleStatus == 0 ? '<span class="review"><i></i>待审核</span>' : item.exampleStatus == 1 ? '<span class="rejected"><i></i>已驳回</span>' : '<span class="approved"<i></i>>审核通过</span>'}</td>
  268. <td data-id="${item.id || ""}" data-hos="${item.hospitalId || ""}" data-behospitalCode="${item.behospitalCode || ""}" data-casesEntryId="${item.casesEntryId || ""}" data-qcresultDetailId="${item.qcresultDetailId || ""}" data-appealOperationType="${item.appealOperationType || ""}" data-index=${i}>
  269. ${item.exampleStatus == 0 ? `<span class="appealBtn goHomeDetail1">查看</span><span class="appealBtn withdraw" >撤回</span>` : ''}
  270. ${item.exampleStatus == 1 || item.exampleStatus == 2 ? `<span class="appealBtn appealAgain">再次申述</span>` : ''}
  271. </td>
  272. </tr>
  273. `
  274. }
  275. $('.tbody').html(str)
  276. $(".withdraw").click(function () {
  277. let id = $(this).parent().attr("data-id")
  278. console.log(id);
  279. cancelAppealInfo(id)
  280. })
  281. $(".appealAgain").click(function () {
  282. let i = $(this).parent().attr("data-index")
  283. $("#delModal .modal-body").html("");
  284. $("#delModal").show();
  285. getCheckUser()
  286. $(".checker-drop-input").html('123')
  287. console.log(data[i].checkName);
  288. $("#appealDef").tmpl(data[i]).appendTo("#delModal .modal-body");
  289. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  290. addAppealInfo(data[i])
  291. });
  292. })
  293. $(".goHomeDetail1").click(function () {
  294. let id = $(this).parent().attr("data-id")
  295. let hospitalId = $(this).parent().attr("data-hos")
  296. let behospitalCode = $(this).parent().attr("data-behospitalCode")
  297. let casesEntryId = $(this).parent().attr("data-casesEntryId")
  298. let qcresultDetailId = $(this).parent().attr("data-qcresultDetailId")
  299. let appealOperationType = $(this).parent().attr("data-appealOperationType")
  300. $(parent.document).find("#contentIframe").attr("src", "appealExamine.html?id=" + id + "&hospitalId=" + hospitalId + "&behospitalCode=" + behospitalCode + "&casesEntryId=" + casesEntryId + "&qcresultDetailId=" + qcresultDetailId + "&appealOperationType=" + appealOperationType + "&form=" + 3)
  301. })
  302. }
  303. function cancelAppealInfo(id) {
  304. post(api.cancelAppealInfo, { id: id }).then(function (res) {
  305. if (res.data.code === '0') {
  306. getTabData(1)
  307. $.alerModal({ "message": "撤回成功", type: "tip", time: '1000', win: true });
  308. } else {
  309. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  310. }
  311. }).catch(() => {
  312. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  313. });
  314. }
  315. //再次申述
  316. function addAppealInfo(data) {
  317. if (data.appealOperationType == 1) {
  318. if (data.exampleStatus == 2) {
  319. data.appealOperationType = 0
  320. } else {
  321. data.appealOperationType = 1
  322. }
  323. } else if (data.appealOperationType == 3) {
  324. data.appealOperationType = 0
  325. }
  326. $(".warning").hide();
  327. let val = $(".textarea").val()
  328. let num = 500
  329. if (!val) {
  330. $(".warning .red").text("申诉说明不能为空~");
  331. $(".warning").show();
  332. return
  333. } else if (val.length > num) {
  334. $(".warning .red").text("申诉说明不能超过" + num + "个字~");
  335. $(".warning").show();
  336. return
  337. }
  338. const param = {
  339. appealExplain: $(".textarea").val(),
  340. appealOperationType: data.appealOperationType,
  341. behospitalCode: data.behospitalCode,
  342. checkId: $(".checker-drop-input").attr("code"),
  343. appealType: 1,
  344. }
  345. post(api.addAppealInfo, param).then(function (res) {
  346. if (res.data.code === '0') {
  347. getTabData(1)
  348. $("#delModal").hide();
  349. $.alerModal({ "message": "申述成功", type: "tip", time: '1000', win: true });
  350. } else {
  351. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  352. }
  353. }).catch(() => {
  354. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  355. });
  356. }
  357. $(document).on("click", ".checker-drop-input", (e) => {
  358. e.stopPropagation()
  359. $("#delModal ul").css("display", "block")
  360. });
  361. $(document).on("click", ".infoItem", (e) => {
  362. e.stopPropagation()
  363. const name = $(this).attr("data-name")
  364. $("#delModal ul").css("display", "none")
  365. });
  366. //选择病历等级
  367. $('.selectModular').on("click", function (e) {
  368. e.stopPropagation()
  369. $(".deptList ").css("display", "none")
  370. $(".selectDept .arrow").attr("src", iconDown)
  371. $(".checkList ").css("display", "none")
  372. $(".selectCheck .arrow").attr("src", iconDown)
  373. $(".fpCheckList ").css("display", "none")
  374. $(".fpSelectCheck .arrow").attr("src", iconDown)
  375. $(".qcSelectCheck .arrow").attr("src", iconDown)
  376. $(".qcCheckList ").css("display", "none")
  377. const showList = $(".modularList ").css("display")
  378. if (showList == "none" || !showList) {
  379. $(".modularList ").css("display", "block")
  380. $(".selectModular .arrow").attr("src", iconUp)
  381. } else {
  382. $(".modularList ").css("display", "none")
  383. $(".selectModular .arrow").attr("src", iconDown)
  384. }
  385. })
  386. //操作类型
  387. $('.selectType').on("click", function (e) {
  388. e.stopPropagation()
  389. $(".deptList ").css("display", "none")
  390. $(".selectDept .arrow").attr("src", iconDown)
  391. $(".checkList ").css("display", "none")
  392. $(".selectCheck .arrow").attr("src", iconDown)
  393. $(".fpCheckList ").css("display", "none")
  394. $(".fpSelectCheck .arrow").attr("src", iconDown)
  395. $(".qcSelectCheck .arrow").attr("src", iconDown)
  396. $(".qcCheckList ").css("display", "none")
  397. const showList = $(".typeList ").css("display")
  398. if (showList == "none" || !showList) {
  399. $(".typeList ").css("display", "block")
  400. $(".selectType .arrow").attr("src", iconUp)
  401. } else {
  402. $(".typeList ").css("display", "none")
  403. $(".selectType .arrow").attr("src", iconDown)
  404. }
  405. })
  406. //选择状态
  407. $('.qcSelectCheck').on("click", function (e) {
  408. e.stopPropagation()
  409. $(".deptList ").css("display", "none")
  410. $(".selectDept .arrow").attr("src", iconDown)
  411. $(".modularList ").css("display", "none")
  412. $(".selectModular .arrow").attr("src", iconDown)
  413. $(".fpSelectCheck .arrow").attr("src", iconDown)
  414. $(".fpCheckList ").css("display", "none")
  415. const showList = $(".qcCheckList ").css("display")
  416. if (showList == "none" || !showList) {
  417. $(".qcCheckList ").css("display", "block")
  418. $(".qcSelectCheck .arrow").attr("src", iconUp)
  419. } else {
  420. $(".qcCheckList ").css("display", "none")
  421. $(".qcSelectCheck .arrow").attr("src", iconDown)
  422. }
  423. })
  424. bindLeveldSelect()
  425. //病历等级选择
  426. function bindLeveldSelect() {
  427. $('.modularItem').on("click", function () {
  428. const modularItemName = $(this).attr("data-name")
  429. const modularItemItemId = $(this).attr("data-id")
  430. moduleName = modularItemItemId
  431. $('.selectModular').html(modularItemName)
  432. $(".modularList").css("display", "none")
  433. $(".selectModular").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  434. $('.selectModular').removeClass('unSelect')
  435. })
  436. }
  437. bindTypedSelect()
  438. //操作类型
  439. function bindTypedSelect() {
  440. $('.typeItem').on("click", function () {
  441. const typeItemName = $(this).attr("data-name")
  442. const typeItemItemId = $(this).attr("data-id")
  443. operationType = typeItemItemId
  444. $('.selectType').html(typeItemName)
  445. $(".typeList").css("display", "none")
  446. $(".selectType").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  447. $('.selectType').removeClass('unSelect')
  448. })
  449. }
  450. bindCheckedSelectQc()
  451. //病历核查状态选择
  452. function bindCheckedSelectQc() {
  453. $('.qcCheckItem').on("click", function () {
  454. const qcCheckItemName = $(this).attr("data-name")
  455. const qcCheckItemItemId = $(this).attr("data-id") || ""
  456. state = qcCheckItemItemId
  457. $('.qcSelectCheck').html(qcCheckItemName)
  458. $(".qcCheckList").css("display", "none")
  459. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  460. $('.qcSelectCheck').removeClass('unSelect')
  461. })
  462. }
  463. $('.selectDept').on("click", function (e) {
  464. e.stopPropagation()
  465. $(".modularList ").css("display", "none")
  466. $(".selectModular .arrow").attr("src", iconDown)
  467. $(".checkList ").css("display", "none")
  468. $(".selectCheck .arrow").attr("src", iconDown)
  469. $(".fpCheckList ").css("display", "none")
  470. $(".fpSelectCheck .arrow").attr("src", iconDown)
  471. $(".qcCheckList ").css("display", "none")
  472. $(".qcSelectCheck .arrow").attr("src", iconDown)
  473. const showList = $(".deptList ").css("display")
  474. if (showList == "none" || !showList) {
  475. $(".deptList ").css("display", "block")
  476. $(".selectDept .arrow").attr("src", iconUp)
  477. } else {
  478. $(".deptList ").css("display", "none")
  479. $(".selectDept .arrow").attr("src", iconDown)
  480. }
  481. })
  482. //获取科室列表
  483. getDeptList()
  484. function getDeptList() {
  485. post(api.getDeptListDept, { inputStr: "" }).then(res => {
  486. if (res.data.code == '0') {
  487. const deptList = res.data.data
  488. rendeDeptList(deptList)
  489. } else { }
  490. }).catch((e) => {
  491. })
  492. }
  493. function rendeDeptList(deptList) {
  494. let str = `<li class="deptItem ellipsis" data-id=" " data-name="全部">全部</li>`
  495. for (let i = 0; i < deptList.length; i++) {
  496. str += `<li class="deptItem ellipsis" title=${deptList[i].deptName} data-id=${deptList[i].deptId} data-name=${deptList[i].deptName}> ${deptList[i].deptName}</li>`
  497. }
  498. $('.deptList').html(str)
  499. bindDeptSelect()
  500. }
  501. //科室选择
  502. function bindDeptSelect() {
  503. $('.deptItem').on("click", function () {
  504. const deptItemName = $(this).attr("data-name")
  505. const deptItemId = $(this).attr("data-id")
  506. deptIdTemp = deptItemId
  507. deptName = deptNameTemp = deptItemName
  508. if (deptItemName.length > 10) {
  509. $('.selectDept').html(deptItemName.substring(0, 8) + '...')
  510. } else {
  511. $('.selectDept').html(deptItemName)
  512. }
  513. $('.selectDept ').attr('title', deptItemName)
  514. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  515. $('.selectDept').removeClass('unSelect')
  516. $(".deptList").css("display", "none")
  517. })
  518. }
  519. function renderColSet(list) {
  520. let pageSetList = list || pageSetCopy
  521. let allSelect = true
  522. for (let i = 0; i < pageSetList.length; i++) {
  523. if (pageSetList[i].status != 1) {
  524. allSelect = false
  525. }
  526. }
  527. let str = `<div class='colSetBox'>
  528. <div class='mask'></div>
  529. <div class='cloInfobox'>
  530. <div class='cloInfoTitle'><span class='cloInfoTitleTxt'>列显示设置</span> <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></div>
  531. <div class='cloInfo'></div>
  532. <div class='btnBox'><span class='defaultColSet'>恢复默认</span> <span class='cancalColSet'>取消</span> <span class='saveColSet'>保存设置</span></div>
  533. </div>
  534. </div>`
  535. 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' >`
  536. for (let i = 0; i < pageSetList.length; i++) {
  537. infoStr += `<div class='colTabInfo' data-index=${i}>
  538. <span class='colOpera' data-index=${i}>${pageSetList[i].status == 1 ? `<img class="toggleSelectCol" src=${iconCheck} />` : `<img class="toggleSelectCol" src=${iconUnCheck} />`}</span>
  539. <span class='colName'>
  540. <span>${pageSetList[i].name}</span>
  541. <span class="pageOrder">
  542. <span class="pageSetUpBox">${i === 0 ? '' : `<img class="pageSetUp" src=${goUpG} />`}</span>
  543. <span class="pageSetDownBox">${i === pageSetList.length - 1 ? '' : `<img class="pageSetDown" src=${goDownG} />`}</span>
  544. </span>
  545. </span>
  546. </div>`
  547. }
  548. infoStr += "</div>"
  549. // $(".main-body").append(str)
  550. if (!$("#mainBox .colSetBox", parent.document).length) {
  551. $("#mainBox", parent.document).append(str)
  552. }
  553. $("#mainBox .colSetBox .cloInfo", parent.document).html(infoStr)
  554. $(".colTabInfoBox", parent.document).scrollTop(scrollTop)
  555. scrollTop = 0
  556. bindSelectCol()
  557. bindColOrder()
  558. bindSaveColSet()
  559. bindDefaultColset()
  560. bindCloseColSet()
  561. bindImgEnter()
  562. }
  563. function bindDefaultColset() {
  564. $('.defaultColSet', parent.document).off("hover").hover(function () {
  565. $(this).css('color', '#00A1FF')
  566. }, function () {
  567. $(this).css('color', '#777777')
  568. })
  569. $('.defaultColSet', parent.document).off("click").on('click', function () {
  570. return post(api.getDefaultPageSet, { pageType: 1 }).then(res => {
  571. if (res.data.code == '0') {
  572. pageSet = res.data.data
  573. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  574. renderColSet(pageSetCopy)
  575. } else { }
  576. }).catch((e) => {
  577. })
  578. // closeColSet()
  579. })
  580. }
  581. function bindImgEnter() {
  582. $(".pageSetUpBox img", parent.document).off("mouseenter").on("mouseenter", function () {
  583. $(this).attr('src', goUpB)
  584. })
  585. $(".pageSetDownBox img", parent.document).off("mouseenter").on("mouseenter", function () {
  586. $(this).attr('src', goDownB)
  587. })
  588. $(".pageSetUpBox img", parent.document).off("mouseout").on("mouseout", function () {
  589. $(this).attr('src', goUpG)
  590. })
  591. $(".pageSetDownBox img", parent.document).off("mouseout").on("mouseout", function () {
  592. $(this).attr('src', goDownG)
  593. })
  594. }
  595. function bindSelectCol() {
  596. $(".toggleSelectCol", parent.document).off("click").on("click", function () {
  597. const index = $(this).parent().attr("data-index")
  598. pageSetCopy[index].status = pageSetCopy[index].status == 1 ? 0 : 1
  599. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  600. renderColSet(pageSetCopy)
  601. })
  602. $(".toggleSelectColAll", parent.document).off("click").on("click", function () {
  603. const hasSelectAll = $(this).attr("data-select")
  604. for (let i = 0; i < pageSetCopy.length; i++) {
  605. if (hasSelectAll == "true") {
  606. pageSetCopy[i].status = 0
  607. } else {
  608. pageSetCopy[i].status = 1
  609. }
  610. }
  611. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  612. renderColSet(pageSetCopy)
  613. })
  614. }
  615. function closeColSet() {
  616. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  617. $("#mainBox .colSetBox", parent.document).remove()
  618. }
  619. function bindCloseColSet() {
  620. $(".colSetBox .iconClose", parent.document).off("click").on("click", function () {
  621. closeColSet()
  622. })
  623. $(".colSetBox .cancalColSet", parent.document).off("click").on("click", function () {
  624. closeColSet()
  625. })
  626. }
  627. function bindSaveColSet() {
  628. $(".saveColSet", parent.document).off("click").on("click", function () {
  629. let showNumSet = 0
  630. let sysUserPagesetVOList = []
  631. for (let i = 0; i < pageSetCopy.length; i++) {
  632. const item = pageSetCopy[i]
  633. sysUserPagesetVOList.push({
  634. name: item.name,
  635. orderNo: i,
  636. status: item.status,
  637. val: item.val
  638. })
  639. if (item.status == 1) {
  640. showNumSet++
  641. }
  642. }
  643. if (showNumSet === 0) {
  644. $.alerModal({ "message": '最少显示一列', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  645. return
  646. }
  647. return post(api.saveQcListPageSet, { pageType: 1, sysUserPagesetVOList: sysUserPagesetVOList }).then(res => {
  648. if (res.data.code == '0') {
  649. closeColSet()
  650. } else {
  651. $("#mainBox .colSetBox", parent.document).remove()
  652. $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  653. }
  654. }).catch((e) => {
  655. $("#mainBox .colSetBox", parent.document).remove()
  656. $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  657. })
  658. })
  659. }
  660. function bindColOrder() {
  661. $(".pageSetUp", parent.document).off("click").on("click", function () {
  662. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  663. if (index != 0) {
  664. const upItem = pageSetCopy[index]
  665. const upItemPre = pageSetCopy[index - 1]
  666. pageSetCopy.splice(index - 1, 2, upItem, upItemPre)
  667. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  668. renderColSet(pageSetCopy)
  669. } else {
  670. return
  671. }
  672. })
  673. $(".pageSetDown", parent.document).off("click").on("click", function () {
  674. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  675. if (index == pageSetCopy.length - 1) {
  676. return
  677. } else {
  678. const downItem = pageSetCopy[index]
  679. const downItemBack = pageSetCopy[index + 1]
  680. pageSetCopy.splice(index, 2, downItemBack, downItem)
  681. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  682. renderColSet(pageSetCopy)
  683. }
  684. })
  685. }
  686. $(".patientNumInp").on("input", function (e) {
  687. const val = $(this).val().trim()
  688. let beCode = behospitalCode;
  689. const patrn = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/g;
  690. beCode = val.replace(patrn, function (x) {
  691. return "\\" + x;
  692. });
  693. behospitalCodeTemp = beCode
  694. })
  695. $(".patientNameInp").on("input", function (e) {
  696. const val = $(this).val().trim()
  697. nameTemp = val
  698. })
  699. $(".doctorInp").on("input", function (e) {
  700. const val = $(this).val().trim()
  701. doctorNameTemp = val
  702. })
  703. $(".fpCheckPeople").on("input", function (e) {
  704. const val = $(this).val().trim()
  705. fpCheckNameTemp = val
  706. })
  707. $(".qcCheckPeople").on("input", function (e) {
  708. const val = $(this).val().trim()
  709. qcCheckNameTemp = val
  710. })
  711. $(".qcCheckMain").on("input", function (e) {
  712. const val = $(this).val().trim()
  713. qcCheckMain = qcCheckMainTemp = val
  714. })
  715. $(".doctorNumInp").on("input", function (e) {
  716. const val = $(this).val().trim();
  717. doctorNumTemp = val
  718. })
  719. $(function () {
  720. $.datepicker.regional['zh-CN'] = {
  721. clearText: '清除',
  722. clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
  723. closeText: '关闭',
  724. closeStatus: '不改变当前选择',
  725. prevText: '<上月',
  726. prevStatus: '显示上月',
  727. prevBigText: '<<',
  728. prevBigStatus: '显示上一年',
  729. nextText: '下月>',
  730. nextStatus: '显示下月',
  731. nextBigText: '>>',
  732. nextBigStatus: '显示下一年',
  733. currentText: '今天',
  734. currentStatus: '显示本月',
  735. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  736. monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  737. yearNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  738. monthStatus: '选择月份',
  739. yearStatus: '选择年份',
  740. weekHeader: '周',
  741. weekStatus: '年内周次',
  742. dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
  743. dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  744. dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
  745. dayStatus: '设置 DD 为一周起始',
  746. dateStatus: '选择 m月 d日, DD',
  747. dateFormat: 'yy-mm-dd',
  748. firstDay: 1,
  749. initStatus: '请选择日期',
  750. isRTL: false
  751. };
  752. $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  753. let startDate = "", endDate = new Date()
  754. let year = new Date().getFullYear()
  755. let month = new Date().getMonth() + 1
  756. if (statisticsType == '1') {
  757. startDate = new Date(`${year}-${month}-01`)
  758. } else if (statisticsType == '2') {
  759. startDate = new Date(`${year}-01-01`)
  760. } else if (statisticsType == '3') {
  761. startDate = new Date(startDateParam)
  762. endDate = new Date(endDateParam)
  763. } else {
  764. startDate = "-6d"
  765. }
  766. $("#datepicker").datepicker({
  767. changeMonth: true,
  768. changeYear: true,
  769. dateFormat: "yy/mm/dd",
  770. }).datepicker("setDate", startDate);
  771. $("#datepicker2").datepicker({
  772. changeMonth: true,
  773. changeYear: true,
  774. dateFormat: "yy/mm/dd"
  775. }).datepicker("setDate", endDate);
  776. $("#datepickerFp1").datepicker({
  777. changeMonth: true,
  778. changeYear: true,
  779. dateFormat: "yy/mm/dd"
  780. }).datepicker("setDate", "");
  781. $("#datepickerFp2").datepicker({
  782. changeMonth: true,
  783. changeYear: true,
  784. dateFormat: "yy/mm/dd"
  785. }).datepicker("setDate", "");
  786. $("#datepickerQc1").datepicker({
  787. changeMonth: true,
  788. changeYear: true,
  789. dateFormat: "yy/mm/dd"
  790. }).datepicker("setDate", "");
  791. $("#datepickerQc2").datepicker({
  792. changeMonth: true,
  793. changeYear: true,
  794. dateFormat: "yy/mm/dd"
  795. }).datepicker("setDate", "");
  796. getTabData(1)
  797. });
  798. //分页渲染
  799. function renderPagination(totalPage, activePage, totalNum) {
  800. let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
  801. if (totalPage <= 6) {
  802. for (let i = 1; i <= totalPage; i++) {
  803. str += `<span class="pageNum ${'page' + i}" data-page=${i}>${i}</span>`
  804. }
  805. } else {
  806. if (activePage <= 3) { //选中页数小于4
  807. for (let i = 1; i <= 4; i++) {
  808. str += `<span class="pageNum ${'page' + i}" data-page=${i}>${i}</span>`
  809. }
  810. str += `<span class="more" >...</span>`
  811. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  812. } else if (activePage > totalPage - 3) {
  813. str += `<span class="pageNum page1" data-page=1>1</span>`
  814. str += `<span class="more" >...</span>`
  815. str += `<span class="pageNum ${'page' + (totalPage - 3)}" data-page=${totalPage - 3}>${totalPage - 3}</span>`
  816. str += `<span class="pageNum ${'page' + (totalPage - 2)}" data-page=${totalPage - 2}>${totalPage - 2}</span>`
  817. str += `<span class="pageNum ${'page' + (totalPage - 1)}" data-page=${totalPage - 1}>${totalPage - 1}</span>`
  818. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  819. } else {
  820. str += `<span class="pageNum page1" data-page=1>1</span>`
  821. str += `<span class="more" >...</span>`
  822. str += `<span class="pageNum ${'page' + (activePage - 1)}" data-page=${activePage - 1}>${activePage - 1}</span>`
  823. str += `<span class="pageNum ${'page' + activePage}" data-page=${activePage}>${activePage}</span>`
  824. str += `<span class="pageNum ${'page' + (activePage + 1)}" data-page=${activePage + 1}>${activePage + 1}</span>`
  825. str += `<span class="more" >...</span>`
  826. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  827. }
  828. }
  829. str += `<span class="nextPage"><img class="arrowPage" src=${arrowRight} /></span>`
  830. $('.pagination').html(str)
  831. $('.page' + activePage).addClass('activePage')
  832. $(".pageNum").on("click", function (e) {
  833. const activePageNow = Number($(this).attr('data-page'))
  834. getTabData(activePageNow)
  835. // renderPagination(totalPage,activePageNow,totalNum)
  836. })
  837. $(".prePage").on("click", function (e) {
  838. let activePageNow = Number($(".activePage").attr('data-page'))
  839. if (activePageNow > 1) {
  840. activePageNow--
  841. getTabData(activePageNow)
  842. // renderPagination(totalPage,activePageNow,totalNum)
  843. }
  844. })
  845. $(".nextPage").on("click", function (e) {
  846. let activePageNow = Number($(".activePage").attr('data-page'))
  847. if (activePageNow < totalPage) {
  848. activePageNow++
  849. getTabData(activePageNow)
  850. // renderPagination(totalPage,activePageNow,totalNum)
  851. }
  852. })
  853. }
  854. $(document).on("click", function () {
  855. $(".modularList ").css("display", "none")
  856. $(".deptList").css("display", "none")
  857. $(".checkList").css("display", "none")
  858. $(".fpCheckList").css("display", "none")
  859. $(".qcCheckList").css("display", "none")
  860. $(".selectDept .arrow").attr("src", iconDown)
  861. $(".selectModular .arrow").attr("src", iconDown)
  862. $(".selectCheck .arrow").attr("src", iconDown)
  863. $(".fpSelectCheck .arrow").attr("src", iconDown)
  864. $(".qcSelectCheck .arrow").attr("src", iconDown)
  865. $("#delModal ul").css("display", "none")
  866. })
  867. let radioCheck = 1;
  868. $((function ($) {
  869. $('.export').click(function () {
  870. const behosDateStartTime = new Date(behosDateStart).getTime()
  871. const behosDateEndTime = new Date(behosDateEnd).getTime()
  872. if (behosDateStartTime > behosDateEndTime) {
  873. $.alerModal({ "message": '开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  874. return
  875. }
  876. const param = {
  877. "behospitalCode": behospitalCode,
  878. "deptId": deptId.trim(),
  879. "doctorCode": doctorNum,
  880. "doctorName": doctorName,
  881. "asc": data_asc, //升序
  882. "desc": data_desc, //降序
  883. "leaveHosDateStart": isPlacefile == 1 ? behosDateStart : '', //出院日期--开始时间
  884. "leaveHosDateEnd": isPlacefile == 1 ? behosDateEnd : '', //出院日期--结束时间
  885. "behosDateStart": isPlacefile == 1 ? '' : behosDateStart, //出院日期--开始时间
  886. "behosDateEnd": isPlacefile == 1 ? '' : behosDateEnd, //出院日期--结束时间
  887. "isPlacefile": isPlacefile,
  888. "level": level,
  889. "name": name,
  890. "checkStatus": qcCheckStatus ? Number(qcCheckStatus) : qcCheckStatus, //病历核查状态
  891. "mrStatus": fpCheckStatus ? Number(fpCheckStatus) : fpCheckStatus, //首页核查状态(1:已核查,0:未核查)
  892. "chName": qcCheckName, //病历核查人员
  893. "diagnose": qcCheckMain, //病历主症状..........
  894. "mrName": fpCheckName, //首页核查人员
  895. "deptName": deptName == "全部" ? "" : deptName || '',
  896. "statisticsType": statisticsType,
  897. }
  898. $.alerModal({ type: "radio", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  899. closeRadio()
  900. radioSelect()
  901. bindSaveColPort(param)
  902. })
  903. })($));
  904. function closeRadio() {
  905. $(".colSetBox .iconClose,.colSetBox .cancalColSet", parent.document).off("click").on("click", function () {
  906. $(".divModal", parent.document).remove()
  907. })
  908. }
  909. function radioSelect() {
  910. $(".selectDate", parent.document).click(function () {
  911. $(this).find("input").prop("checked", true)
  912. $(this).siblings().find("input").prop("checked", false)
  913. })
  914. }
  915. function bindSaveColPort(param) {
  916. $(".savePort", parent.document).off("click").on("click", function () {
  917. radioCheck = $(".selectDate input[type='radio']:checked", parent.document).attr("data-select")
  918. let time = radioCheck == 2 ? exportTimeLimit.defectTime : exportTimeLimit.normalTime
  919. if ((new Date(behosDateEnd) - new Date(behosDateStart)) / 24 / 60 / 60 / 1000 > time) {
  920. $.alerModal({ "message": `最多只能导出${time}天`, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  921. return
  922. }
  923. param.radioCheck = radioCheck || 1
  924. expJson(api.exportQcListDept, param).then(res => {
  925. $(".divModal", parent.document).remove()
  926. downloadExportedData(res.data, behosDateStart.slice(0, 10).replace(/-/g, "") + "-" + behosDateEnd.slice(0, 10).replace(/-/g, "") + "抽查住院病历质量情况.xls")
  927. })
  928. })
  929. }