appealCheck.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. const $ = require('jquery');
  2. require("../css/appealCheck.less");
  3. require('./modal.js');
  4. const { api } = require('./api.js')
  5. const { post, getCookie, getLocal, getUrlArgObjectNew, emptyBox, downloadExportedData, expJson, getLogoParam, listenScroll, getPickerDate, 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 arrowLeft = require("./../images/arrow_left.png")
  15. const arrowRight = require("./../images/arrow_right.png")
  16. const goUpG = require("./../images/arrow_up_grey.png")
  17. const goUpB = require("./../images/arrow_up_blue.png")
  18. const goDownG = require("./../images/arrow_down_grey.png")
  19. const goDownB = require("./../images/arrow_down_blue.png")
  20. listenScroll()
  21. let pageSet = [], pageSetCopy = [], showNum = 0, scrollTop = 0;
  22. $(".selectModular").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  23. $(".selectType").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  24. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  25. $(".fpSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  26. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  27. let srcUrl = $("#contentIframe", parent.document).attr("src")
  28. let statisticsType = getUrlArgObjectNew("dateType", srcUrl) || getUrlArgObjectNew("shijian", srcUrl) || ""
  29. let startDateParam = getUrlArgObjectNew("startDateParam", srcUrl) || ""
  30. let endDateParam = getUrlArgObjectNew("endDateParam", srcUrl) || ""
  31. let page = getUrlArgObjectNew("page", srcUrl) || 1
  32. let tabList = [], deptName = "", deptNameTemp = "", behosDateStart = "", behosDateEnd = "", nameTemp = "", casesName = "", operationType = "",
  33. deptId = "", deptIdTemp = "",
  34. fpCheckStatusTemp = "", fpCheckNameTemp = "", qcCheckNameTemp = "", state = "";
  35. let isPlacefile = getCookie('isPlacefile') || 1
  36. $('.datapickerBox').append(`<img class="iconCalen" src=${iconCalenGrey} />`)
  37. $('.iconCalen').on("mouseenter", function (e) {
  38. $(this).attr("src", iconCalenBlue)
  39. })
  40. $('.iconCalen').on("mouseleave", function (e) {
  41. $(this).attr("src", iconCalenGrey)
  42. })
  43. $('.iconCalen').on("click", function (e) {
  44. $(this).parent().find("input").focus()
  45. })
  46. $(".menu .page", parent.document).removeClass("active")
  47. $(parent.document).find(".menu .page[code=YH-SSXX-SSSH]").addClass("active")
  48. function getTabData(activePage) {
  49. const behosDateStart = getPickerDate($("#datepicker"), 1)
  50. const behosDateEnd = getPickerDate($("#datepicker2"), 2)
  51. const param = {
  52. current: activePage,
  53. deptId: deptId.trim(),
  54. deptName: deptName == "全部" ? "" : deptName || '',
  55. modeName: casesName == "全部" ? "" : casesName || '',
  56. operationType: operationType,
  57. state: state,
  58. size: 15,
  59. name: nameTemp,
  60. complaintDateEnd: behosDateEnd.replace(/\//g, '-'),
  61. complaintDateStart: behosDateStart.replace(/\//g, '-'),
  62. "desc": ['claimant_gmt_create']
  63. }
  64. $('.pagination').html("")
  65. $('.tbody').html(emptyBox('努力加载中...', '',))
  66. return post(api.getAppealReview, param).then(res => {
  67. if (res.data.code == '0') {
  68. tabList = res.data.data.records
  69. const totalPage = res.data.data.pages
  70. const totalNum = res.data.data.total
  71. renderTab(tabList)
  72. renderPagination(totalPage, Number(activePage), totalNum)
  73. if (totalPage > 1) {
  74. renderPagination(totalPage, Number(activePage), totalNum)
  75. } else {
  76. $('.pagination').html("")
  77. }
  78. } else {
  79. const token = localStorage.getItem('accessToken');
  80. if (!token && window.location.href.indexOf('login') == -1) {
  81. //alert('无token判断,跳回登录')
  82. } else {
  83. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  84. }
  85. }
  86. }).catch((e) => {
  87. })
  88. }
  89. $(".filter").on("click", function (e) {
  90. behosDateStart = $("#datepicker").val()
  91. behosDateEnd = $("#datepicker2").val()
  92. const behosDateStartTime = new Date(behosDateStart).getTime()
  93. const behosDateEndTime = new Date(behosDateEnd).getTime()
  94. if (behosDateStartTime > behosDateEndTime) {
  95. $.alerModal({ "message": '申诉时间开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  96. return
  97. }
  98. if (behosDateStart) {
  99. behosDateStart = behosDateStart.replace(/\//g, '-') + ' 00:00:00'
  100. }
  101. if (behosDateEnd) {
  102. behosDateEnd = behosDateEnd.replace(/\//g, '-') + ' 23:59:59'
  103. }
  104. deptId = deptIdTemp
  105. deptName = deptNameTemp
  106. fpCheckName = fpCheckNameTemp
  107. qcCheckName = qcCheckNameTemp
  108. fpCheckStatus = fpCheckStatusTemp
  109. qcCheckStatus = state
  110. getTabData(page)
  111. })
  112. $(".abnormalClear").on("click", function (e) {
  113. page = 1
  114. tabList = [];
  115. behospitalCode = "";
  116. scoreSum = 0;
  117. nameTemp = "";
  118. deptId = "";
  119. deptIdTemp = "";
  120. deptName = deptNameTemp = "";
  121. fpCheckName = "";
  122. qcCheckName = "";
  123. qcCheckMain = "";
  124. fpCheckNameTemp = "";
  125. qcCheckNameTemp = "";
  126. qcCheckMainTemp = "";
  127. fpCheckStatus = "";
  128. fpCheckStatusTemp = "";
  129. qcCheckStatus = "";
  130. state = ""
  131. casesName = ""
  132. operationType = ""
  133. data_desc = ["leave_hospital_date"]
  134. if (isPlacefile != 1) {
  135. data_desc = ["behospital_date"]
  136. }
  137. data_asc = [];
  138. $('.patientNameInp').val('')
  139. // $('#datepicker').val('')
  140. // $('#datepicker2').val('')
  141. //默认日期为近一周
  142. $("#datepicker").datepicker({
  143. changeMonth: true,
  144. changeYear: true,
  145. dateFormat: "yy/mm/dd",
  146. }).datepicker("setDate", "-6d");
  147. $("#datepicker2").datepicker({
  148. changeMonth: true,
  149. changeYear: true,
  150. dateFormat: "yy/mm/dd"
  151. }).datepicker("setDate", new Date());
  152. $("#datepickerFp1").datepicker({
  153. changeMonth: true,
  154. changeYear: true,
  155. dateFormat: "yy/mm/dd",
  156. }).datepicker("setDate", "");
  157. $("#datepickerFp2").datepicker({
  158. changeMonth: true,
  159. changeYear: true,
  160. dateFormat: "yy/mm/dd"
  161. }).datepicker("setDate", "");
  162. $("#datepickerQc1").datepicker({
  163. changeMonth: true,
  164. changeYear: true,
  165. dateFormat: "yy/mm/dd",
  166. }).datepicker("setDate", "");
  167. $("#datepickerQc2").datepicker({
  168. changeMonth: true,
  169. changeYear: true,
  170. dateFormat: "yy/mm/dd"
  171. }).datepicker("setDate", "");
  172. $('.selectDept ').html('全部')
  173. $(".deptList").css("display", "none")
  174. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  175. // $('.selectDept ').addClass('unSelect')
  176. $('.selectModular').html('全部')
  177. $(".modularList").css("display", "none")
  178. $(".selectModular").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  179. // $('.selectModular ').addClass('unSelect')
  180. $('.selectType').html('全部')
  181. $(".typeList ").css("display", "none")
  182. $(".selectType").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  183. $('.qcSelectCheck').html('全部')
  184. $(".qcCheckList").css("display", "none")
  185. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  186. $("th[code]").removeClass("asc desc")
  187. if (isPlacefile == 1) {
  188. $(".leaveHospitalDate").addClass(" desc")
  189. } else {
  190. $(".behospitalDate").addClass(" desc")
  191. }
  192. behosDateStart = $("#datepicker").val()
  193. behosDateEnd = $("#datepicker2").val()
  194. if (behosDateStart) {
  195. behosDateStart = behosDateStart.replace(/\//g, '-') + ' 00:00:00'
  196. }
  197. if (behosDateEnd) {
  198. behosDateEnd = behosDateEnd.replace(/\//g, '-') + ' 23:59:59'
  199. }
  200. getTabData(page)
  201. })
  202. function renderTab(data) {
  203. let str = ``
  204. if (data.length === 0) {
  205. $('.tbody').html(emptyBox(null, showNum + 12))
  206. return;
  207. }
  208. for (let i = 0; i < data.length; i++) {
  209. const item = data[i]
  210. str += `
  211. <tr data-index=${i} data-doc="${item.doctorName || ""}" >
  212. <td >${item.claimantName || "-"}</td>
  213. <td >${item.behDeptName || "-"}</td>
  214. <td >${item.claimantGmtCreate}</td>
  215. <td >${item.behospitalCode}</td>
  216. <td >${item.name || "-"}</td>
  217. <td >${item.modeName || "-"}</td>
  218. <td >${item.qcresultDetailMsg || "-"}</td>
  219. <td >${item.checkName || "-"}</td>
  220. <td >${item.checkGmtCreate || "-"}</td>
  221. <td >${item.appealOperationType == 0 ? '删改条目' : item.appealOperationType == 1 ? '新增已有条目' : item.appealOperationType == 2 ? '新增缺失条目' : '恢复条目'}</td>
  222. <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>
  223. <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 || ""}">
  224. ${item.exampleStatus == 0 ? `<span class="appealBtn goExamine">审核</span><span class="appealBtn goHomeDetail1">查看</span>` : ''}
  225. ${item.exampleStatus == 1 || item.exampleStatus == 2 ? `<span class="appealBtn goHomeDetail1">查看</span>` : ''}
  226. </td>
  227. </tr>
  228. `
  229. }
  230. $('.tbody').html(str)
  231. $(".goExamine").click(function () {
  232. let id = $(this).parent().attr("data-id")
  233. let hospitalId = $(this).parent().attr("data-hos")
  234. let behospitalCode = $(this).parent().attr("data-behospitalCode")
  235. let casesEntryId = $(this).parent().attr("data-casesEntryId")
  236. let qcresultDetailId = $(this).parent().attr("data-qcresultDetailId")
  237. let appealOperationType = $(this).parent().attr("data-appealOperationType")
  238. $(parent.document).find("#contentIframe").attr("src", "appealExamine.html?id=" + id + "&hospitalId=" + hospitalId + "&behospitalCode=" + behospitalCode + "&casesEntryId=" + casesEntryId + "&qcresultDetailId=" + qcresultDetailId + "&appealOperationType=" + appealOperationType + "&page=" + page + "&form=" + 1)
  239. })
  240. $(".goHomeDetail1").click(function () {
  241. let id = $(this).parent().attr("data-id")
  242. let hospitalId = $(this).parent().attr("data-hos")
  243. let behospitalCode = $(this).parent().attr("data-behospitalCode")
  244. let casesEntryId = $(this).parent().attr("data-casesEntryId")
  245. let qcresultDetailId = $(this).parent().attr("data-qcresultDetailId")
  246. let appealOperationType = $(this).parent().attr("data-appealOperationType")
  247. $(parent.document).find("#contentIframe").attr("src", "appealExamine.html?id=" + id + "&hospitalId=" + hospitalId + "&behospitalCode=" + behospitalCode + "&casesEntryId=" + casesEntryId + "&qcresultDetailId=" + qcresultDetailId + "&appealOperationType=" + appealOperationType + "&page=" + page + "&form=" + 2)
  248. })
  249. }
  250. //选择病历等级
  251. $('.selectModular').on("click", function (e) {
  252. e.stopPropagation()
  253. $(".selectDept .arrow").attr("src", iconDown)
  254. $(".deptList").css("display", "none")
  255. $(".selectType .arrow").attr("src", iconDown)
  256. $(".typeList").css("display", "none")
  257. $(".qcSelectCheck .arrow").attr("src", iconDown)
  258. $(".qcCheckList").css("display", "none")
  259. const showList = $(".modularList ").css("display")
  260. if (showList == "none" || !showList) {
  261. $(".modularList ").css("display", "block")
  262. $(".selectModular .arrow").attr("src", iconUp)
  263. } else {
  264. $(".modularList ").css("display", "none")
  265. $(".selectModular .arrow").attr("src", iconDown)
  266. }
  267. })
  268. //操作类型
  269. $('.selectType').on("click", function (e) {
  270. e.stopPropagation()
  271. $(".selectDept .arrow").attr("src", iconDown)
  272. $(".deptList").css("display", "none")
  273. $(".selectModular .arrow").attr("src", iconDown)
  274. $(".modularList ").css("display", "none")
  275. $(".qcSelectCheck .arrow").attr("src", iconDown)
  276. $(".qcCheckList").css("display", "none")
  277. const showList = $(".typeList ").css("display")
  278. if (showList == "none" || !showList) {
  279. $(".typeList ").css("display", "block")
  280. $(".selectType .arrow").attr("src", iconUp)
  281. } else {
  282. $(".typeList ").css("display", "none")
  283. $(".selectType .arrow").attr("src", iconDown)
  284. }
  285. })
  286. //选择状态
  287. $('.qcSelectCheck').on("click", function (e) {
  288. e.stopPropagation()
  289. $(".selectDept .arrow").attr("src", iconDown)
  290. $(".deptList").css("display", "none")
  291. $(".selectModular .arrow").attr("src", iconDown)
  292. $(".modularList ").css("display", "none")
  293. $(".selectType .arrow").attr("src", iconDown)
  294. $(".typeList").css("display", "none")
  295. const showList = $(".qcCheckList ").css("display")
  296. if (showList == "none" || !showList) {
  297. $(".qcCheckList ").css("display", "block")
  298. $(".qcSelectCheck .arrow").attr("src", iconUp)
  299. } else {
  300. $(".qcCheckList ").css("display", "none")
  301. $(".qcSelectCheck .arrow").attr("src", iconDown)
  302. }
  303. })
  304. getmoduleList()
  305. //获取模块类型
  306. function getmoduleList() {
  307. post(api.getAppealMode, { pageType: 2 }).then(res => {
  308. if (res.data.code == '0') {
  309. const moduleTypeList = res.data.data
  310. renderModuleList(moduleTypeList)
  311. } else { }
  312. }).catch((e) => {
  313. })
  314. }
  315. function renderModuleList(moduleTypeList) {
  316. let str = `<li class="modularItem " data-id="" data-name="全部">全部</li>`
  317. for (let i = 0; i < moduleTypeList.length; i++) {
  318. str += `<li class="modularItem ellipsis" title=${moduleTypeList[i].modeName} data-id=${moduleTypeList[i].modeId} data-name=${moduleTypeList[i].modeName}> ${moduleTypeList[i].modeName}</li>`
  319. }
  320. $('.modularList').html(str)
  321. bindModuleSelect()
  322. }
  323. //模块类型选择
  324. function bindModuleSelect() {
  325. $('.modularItem').on("click", function () {
  326. const modularItemName = $(this).attr("data-name")
  327. const modularItemItemId = $(this).attr("data-id")
  328. casesName = modularItemName
  329. $('.selectModular').html(modularItemName)
  330. $(".modularList").css("display", "none")
  331. $(".selectModular").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  332. $('.selectModular').removeClass('unSelect')
  333. })
  334. }
  335. getAppealReviewDictionary()
  336. //获取操作类型
  337. function getAppealReviewDictionary() {
  338. post(api.getAppealReviewDictionary).then(res => {
  339. if (res.data.code == '0') {
  340. const typeList = res.data.data['操作类型']
  341. const statusList = res.data.data['状态']
  342. renderTypeList(typeList)
  343. renderStatusList(statusList)
  344. } else { }
  345. }).catch((e) => {
  346. })
  347. }
  348. function renderTypeList(data) {
  349. console.log(data);
  350. let str = `<li class="typeItem " data-id="" data-name="全部">全部</li>`
  351. for (var i in data) {
  352. str += `<li class="typeItem ellipsis" title=${data[i]} data-id=${i} data-name=${data[i]}> ${data[i]}</li>`
  353. }
  354. $('.typeList').html(str)
  355. bindTypedSelect()
  356. }
  357. //操作类型选择
  358. function bindTypedSelect() {
  359. $('.typeItem').on("click", function () {
  360. const typeItemName = $(this).attr("data-name")
  361. const typeItemItemId = $(this).attr("data-id")
  362. operationType = typeItemItemId
  363. $('.selectType').html(typeItemName)
  364. $(".typeList").css("display", "none")
  365. $(".selectType").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  366. $('.selectType').removeClass('unSelect')
  367. })
  368. }
  369. function renderStatusList(data) {
  370. let str = `<li class="qcCheckItem " data-id="" data-name="全部">全部</li>`
  371. for (var i in data) {
  372. str += `<li class="qcCheckItem ellipsis" title=${data[i]} data-id=${i} data-name=${data[i]}> ${data[i]}</li>`
  373. }
  374. $('.qcCheckList').html(str)
  375. bindCheckedSelectQc()
  376. }
  377. //状态
  378. function bindCheckedSelectQc() {
  379. $('.qcCheckItem').on("click", function () {
  380. const qcCheckItemName = $(this).attr("data-name")
  381. const qcCheckItemItemId = $(this).attr("data-id") || ""
  382. state = qcCheckItemItemId
  383. $('.qcSelectCheck').html(qcCheckItemName)
  384. $(".qcCheckList").css("display", "none")
  385. $(".qcSelectCheck").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  386. $('.qcSelectCheck').removeClass('unSelect')
  387. })
  388. }
  389. $('.selectDept').on("click", function (e) {
  390. e.stopPropagation()
  391. $(".selectModular .arrow").attr("src", iconDown)
  392. $(".modularList ").css("display", "none")
  393. $(".selectType .arrow").attr("src", iconDown)
  394. $(".typeList").css("display", "none")
  395. $(".qcSelectCheck .arrow").attr("src", iconDown)
  396. $(".qcCheckList").css("display", "none")
  397. const showList = $(".deptList ").css("display")
  398. if (showList == "none" || !showList) {
  399. $(".deptList ").css("display", "block")
  400. $(".selectDept .arrow").attr("src", iconUp)
  401. } else {
  402. $(".deptList ").css("display", "none")
  403. $(".selectDept .arrow").attr("src", iconDown)
  404. }
  405. })
  406. //获取科室列表
  407. getDeptList()
  408. function getDeptList() {
  409. post(api.getAppealDept, { inputStr: "", pageType: 2 }).then(res => {
  410. if (res.data.code == '0') {
  411. const deptList = res.data.data
  412. rendeDeptList(deptList)
  413. } else { }
  414. }).catch((e) => {
  415. })
  416. }
  417. function rendeDeptList(deptList) {
  418. let str = `<li class="deptItem ellipsis" data-id=" " data-name="全部">全部</li>`
  419. for (let i = 0; i < deptList.length; i++) {
  420. str += `<li class="deptItem ellipsis" title=${deptList[i].deptName} data-id=${deptList[i].deptId} data-name=${deptList[i].deptName}> ${deptList[i].deptName}</li>`
  421. }
  422. $('.deptList').html(str)
  423. bindDeptSelect()
  424. }
  425. //科室选择
  426. function bindDeptSelect() {
  427. $('.deptItem').on("click", function () {
  428. const deptItemName = $(this).attr("data-name")
  429. const deptItemId = $(this).attr("data-id")
  430. deptIdTemp = deptItemId
  431. deptName = deptNameTemp = deptItemName
  432. if (deptItemName.length > 10) {
  433. $('.selectDept').html(deptItemName.substring(0, 8) + '...')
  434. } else {
  435. $('.selectDept').html(deptItemName)
  436. }
  437. $('.selectDept ').attr('title', deptItemName)
  438. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  439. $('.selectDept').removeClass('unSelect')
  440. $(".deptList").css("display", "none")
  441. })
  442. }
  443. function renderColSet(list) {
  444. let pageSetList = list || pageSetCopy
  445. let allSelect = true
  446. for (let i = 0; i < pageSetList.length; i++) {
  447. if (pageSetList[i].status != 1) {
  448. allSelect = false
  449. }
  450. }
  451. let str = `<div class='colSetBox'>
  452. <div class='mask'></div>
  453. <div class='cloInfobox'>
  454. <div class='cloInfoTitle'><span class='cloInfoTitleTxt'>列显示设置</span> <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></div>
  455. <div class='cloInfo'></div>
  456. <div class='btnBox'><span class='defaultColSet'>恢复默认</span> <span class='cancalColSet'>取消</span> <span class='saveColSet'>保存设置</span></div>
  457. </div>
  458. </div>`
  459. 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' >`
  460. for (let i = 0; i < pageSetList.length; i++) {
  461. infoStr += `<div class='colTabInfo' data-index=${i}>
  462. <span class='colOpera' data-index=${i}>${pageSetList[i].status == 1 ? `<img class="toggleSelectCol" src=${iconCheck} />` : `<img class="toggleSelectCol" src=${iconUnCheck} />`}</span>
  463. <span class='colName'>
  464. <span>${pageSetList[i].name}</span>
  465. <span class="pageOrder">
  466. <span class="pageSetUpBox">${i === 0 ? '' : `<img class="pageSetUp" src=${goUpG} />`}</span>
  467. <span class="pageSetDownBox">${i === pageSetList.length - 1 ? '' : `<img class="pageSetDown" src=${goDownG} />`}</span>
  468. </span>
  469. </span>
  470. </div>`
  471. }
  472. infoStr += "</div>"
  473. // $(".main-body").append(str)
  474. if (!$("#mainBox .colSetBox", parent.document).length) {
  475. $("#mainBox", parent.document).append(str)
  476. }
  477. $("#mainBox .colSetBox .cloInfo", parent.document).html(infoStr)
  478. $(".colTabInfoBox", parent.document).scrollTop(scrollTop)
  479. scrollTop = 0
  480. bindSelectCol()
  481. bindColOrder()
  482. bindSaveColSet()
  483. bindDefaultColset()
  484. bindCloseColSet()
  485. bindImgEnter()
  486. }
  487. function bindDefaultColset() {
  488. $('.defaultColSet', parent.document).off("hover").hover(function () {
  489. $(this).css('color', '#00A1FF')
  490. }, function () {
  491. $(this).css('color', '#777777')
  492. })
  493. $('.defaultColSet', parent.document).off("click").on('click', function () {
  494. return post(api.getDefaultPageSet, { pageType: 1 }).then(res => {
  495. if (res.data.code == '0') {
  496. pageSet = res.data.data
  497. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  498. renderColSet(pageSetCopy)
  499. } else { }
  500. }).catch((e) => {
  501. })
  502. // closeColSet()
  503. })
  504. }
  505. function bindImgEnter() {
  506. $(".pageSetUpBox img", parent.document).off("mouseenter").on("mouseenter", function () {
  507. $(this).attr('src', goUpB)
  508. })
  509. $(".pageSetDownBox img", parent.document).off("mouseenter").on("mouseenter", function () {
  510. $(this).attr('src', goDownB)
  511. })
  512. $(".pageSetUpBox img", parent.document).off("mouseout").on("mouseout", function () {
  513. $(this).attr('src', goUpG)
  514. })
  515. $(".pageSetDownBox img", parent.document).off("mouseout").on("mouseout", function () {
  516. $(this).attr('src', goDownG)
  517. })
  518. }
  519. function bindSelectCol() {
  520. $(".toggleSelectCol", parent.document).off("click").on("click", function () {
  521. const index = $(this).parent().attr("data-index")
  522. pageSetCopy[index].status = pageSetCopy[index].status == 1 ? 0 : 1
  523. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  524. renderColSet(pageSetCopy)
  525. })
  526. $(".toggleSelectColAll", parent.document).off("click").on("click", function () {
  527. const hasSelectAll = $(this).attr("data-select")
  528. for (let i = 0; i < pageSetCopy.length; i++) {
  529. if (hasSelectAll == "true") {
  530. pageSetCopy[i].status = 0
  531. } else {
  532. pageSetCopy[i].status = 1
  533. }
  534. }
  535. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  536. renderColSet(pageSetCopy)
  537. })
  538. }
  539. function closeColSet() {
  540. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  541. $("#mainBox .colSetBox", parent.document).remove()
  542. }
  543. function bindCloseColSet() {
  544. $(".colSetBox .iconClose", parent.document).off("click").on("click", function () {
  545. closeColSet()
  546. })
  547. $(".colSetBox .cancalColSet", parent.document).off("click").on("click", function () {
  548. closeColSet()
  549. })
  550. }
  551. function bindSaveColSet() {
  552. $(".saveColSet", parent.document).off("click").on("click", function () {
  553. let showNumSet = 0
  554. let sysUserPagesetVOList = []
  555. for (let i = 0; i < pageSetCopy.length; i++) {
  556. const item = pageSetCopy[i]
  557. sysUserPagesetVOList.push({
  558. name: item.name,
  559. orderNo: i,
  560. status: item.status,
  561. val: item.val
  562. })
  563. if (item.status == 1) {
  564. showNumSet++
  565. }
  566. }
  567. if (showNumSet === 0) {
  568. $.alerModal({ "message": '最少显示一列', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  569. return
  570. }
  571. return post(api.saveQcListPageSet, { pageType: 1, sysUserPagesetVOList: sysUserPagesetVOList }).then(res => {
  572. if (res.data.code == '0') {
  573. closeColSet()
  574. } else {
  575. $("#mainBox .colSetBox", parent.document).remove()
  576. $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  577. }
  578. }).catch((e) => {
  579. $("#mainBox .colSetBox", parent.document).remove()
  580. $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  581. })
  582. })
  583. }
  584. function bindColOrder() {
  585. $(".pageSetUp", parent.document).off("click").on("click", function () {
  586. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  587. if (index != 0) {
  588. const upItem = pageSetCopy[index]
  589. const upItemPre = pageSetCopy[index - 1]
  590. pageSetCopy.splice(index - 1, 2, upItem, upItemPre)
  591. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  592. renderColSet(pageSetCopy)
  593. } else {
  594. return
  595. }
  596. })
  597. $(".pageSetDown", parent.document).off("click").on("click", function () {
  598. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  599. if (index == pageSetCopy.length - 1) {
  600. return
  601. } else {
  602. const downItem = pageSetCopy[index]
  603. const downItemBack = pageSetCopy[index + 1]
  604. pageSetCopy.splice(index, 2, downItemBack, downItem)
  605. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  606. renderColSet(pageSetCopy)
  607. }
  608. })
  609. }
  610. $(".patientNameInp").on("input", function (e) {
  611. const val = $(this).val().trim()
  612. nameTemp = val
  613. })
  614. $(function () {
  615. $.datepicker.regional['zh-CN'] = {
  616. clearText: '清除',
  617. clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
  618. closeText: '关闭',
  619. closeStatus: '不改变当前选择',
  620. prevText: '<上月',
  621. prevStatus: '显示上月',
  622. prevBigText: '<<',
  623. prevBigStatus: '显示上一年',
  624. nextText: '下月>',
  625. nextStatus: '显示下月',
  626. nextBigText: '>>',
  627. nextBigStatus: '显示下一年',
  628. currentText: '今天',
  629. currentStatus: '显示本月',
  630. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  631. monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  632. yearNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  633. monthStatus: '选择月份',
  634. yearStatus: '选择年份',
  635. weekHeader: '周',
  636. weekStatus: '年内周次',
  637. dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
  638. dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  639. dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
  640. dayStatus: '设置 DD 为一周起始',
  641. dateStatus: '选择 m月 d日, DD',
  642. dateFormat: 'yy-mm-dd',
  643. firstDay: 1,
  644. initStatus: '请选择日期',
  645. isRTL: false
  646. };
  647. $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  648. let startDate = "", endDate = new Date()
  649. let year = new Date().getFullYear()
  650. let month = new Date().getMonth() + 1
  651. if (statisticsType == '1') {
  652. startDate = new Date(`${year}-${month}-01`)
  653. } else if (statisticsType == '2') {
  654. startDate = new Date(`${year}-01-01`)
  655. } else if (statisticsType == '3') {
  656. startDate = new Date(startDateParam)
  657. endDate = new Date(endDateParam)
  658. } else {
  659. startDate = "-6d"
  660. }
  661. $("#datepicker").datepicker({
  662. changeMonth: true,
  663. changeYear: true,
  664. dateFormat: "yy/mm/dd",
  665. }).datepicker("setDate", startDate);
  666. $("#datepicker2").datepicker({
  667. changeMonth: true,
  668. changeYear: true,
  669. dateFormat: "yy/mm/dd"
  670. }).datepicker("setDate", endDate);
  671. $("#datepickerFp1").datepicker({
  672. changeMonth: true,
  673. changeYear: true,
  674. dateFormat: "yy/mm/dd"
  675. }).datepicker("setDate", "");
  676. $("#datepickerFp2").datepicker({
  677. changeMonth: true,
  678. changeYear: true,
  679. dateFormat: "yy/mm/dd"
  680. }).datepicker("setDate", "");
  681. $("#datepickerQc1").datepicker({
  682. changeMonth: true,
  683. changeYear: true,
  684. dateFormat: "yy/mm/dd"
  685. }).datepicker("setDate", "");
  686. $("#datepickerQc2").datepicker({
  687. changeMonth: true,
  688. changeYear: true,
  689. dateFormat: "yy/mm/dd"
  690. }).datepicker("setDate", "");
  691. getTabData(page)
  692. });
  693. //分页渲染
  694. function renderPagination(totalPage, activePage, totalNum) {
  695. let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
  696. if (totalPage <= 6) {
  697. for (let i = 1; i <= totalPage; i++) {
  698. str += `<span class="pageNum ${'page' + i}" data-page=${i}>${i}</span>`
  699. }
  700. } else {
  701. if (activePage <= 3) { //选中页数小于4
  702. for (let i = 1; i <= 4; i++) {
  703. str += `<span class="pageNum ${'page' + i}" data-page=${i}>${i}</span>`
  704. }
  705. str += `<span class="more" >...</span>`
  706. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  707. } else if (activePage > totalPage - 3) {
  708. str += `<span class="pageNum page1" data-page=1>1</span>`
  709. str += `<span class="more" >...</span>`
  710. str += `<span class="pageNum ${'page' + (totalPage - 3)}" data-page=${totalPage - 3}>${totalPage - 3}</span>`
  711. str += `<span class="pageNum ${'page' + (totalPage - 2)}" data-page=${totalPage - 2}>${totalPage - 2}</span>`
  712. str += `<span class="pageNum ${'page' + (totalPage - 1)}" data-page=${totalPage - 1}>${totalPage - 1}</span>`
  713. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  714. } else {
  715. str += `<span class="pageNum page1" data-page=1>1</span>`
  716. str += `<span class="more" >...</span>`
  717. str += `<span class="pageNum ${'page' + (activePage - 1)}" data-page=${activePage - 1}>${activePage - 1}</span>`
  718. str += `<span class="pageNum ${'page' + activePage}" data-page=${activePage}>${activePage}</span>`
  719. str += `<span class="pageNum ${'page' + (activePage + 1)}" data-page=${activePage + 1}>${activePage + 1}</span>`
  720. str += `<span class="more" >...</span>`
  721. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  722. }
  723. }
  724. str += `<span class="nextPage"><img class="arrowPage" src=${arrowRight} /></span>`
  725. $('.pagination').html(str)
  726. $('.page' + activePage).addClass('activePage')
  727. $(".pageNum").on("click", function (e) {
  728. const activePageNow = Number($(this).attr('data-page'))
  729. page = activePageNow
  730. getTabData(activePageNow)
  731. // renderPagination(totalPage,activePageNow,totalNum)
  732. })
  733. $(".prePage").on("click", function (e) {
  734. let activePageNow = Number($(".activePage").attr('data-page'))
  735. page = activePageNow
  736. if (activePageNow > 1) {
  737. activePageNow--
  738. getTabData(activePageNow)
  739. // renderPagination(totalPage,activePageNow,totalNum)
  740. }
  741. })
  742. $(".nextPage").on("click", function (e) {
  743. let activePageNow = Number($(".activePage").attr('data-page'))
  744. page = activePageNow
  745. if (activePageNow < totalPage) {
  746. activePageNow++
  747. getTabData(activePageNow)
  748. // renderPagination(totalPage,activePageNow,totalNum)
  749. }
  750. })
  751. }
  752. $(document).on("click", function () {
  753. $(".selectDept .arrow").attr("src", iconDown)
  754. $(".deptList").css("display", "none")
  755. $(".selectModular .arrow").attr("src", iconDown)
  756. $(".modularList ").css("display", "none")
  757. $(".selectType .arrow").attr("src", iconDown)
  758. $(".typeList").css("display", "none")
  759. $(".qcSelectCheck .arrow").attr("src", iconDown)
  760. $(".qcCheckList").css("display", "none")
  761. })
  762. let radioCheck = 1;
  763. $((function ($) {
  764. $('.export').click(function () {
  765. const behosDateStartTime = new Date(behosDateStart).getTime()
  766. const behosDateEndTime = new Date(behosDateEnd).getTime()
  767. if (behosDateStartTime > behosDateEndTime) {
  768. $.alerModal({ "message": '开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  769. return
  770. }
  771. const param = {
  772. deptId: deptId.trim(),
  773. deptName: deptName == "全部" ? "" : deptName || '',
  774. modeName: casesName == "全部" ? "" : casesName || '',
  775. operationType: operationType,
  776. state: state,
  777. size: 15,
  778. name: nameTemp,
  779. complaintDateEnd: behosDateEnd.replaceAll("/", "-"),
  780. complaintDateStart: behosDateStart.replaceAll("/", "-"),
  781. "desc": ['claimant_gmt_create']
  782. }
  783. expJson(api.getAppealReviewExport, param).then(res => {
  784. downloadExportedData(res.data, "申诉审核.xls")
  785. })
  786. })
  787. })($));