appealCheck.js 37 KB

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