appealHistory.js 40 KB

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