appealHistory.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  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. $("#flawDropTmpl").tmpl({ info: data }).appendTo("#delModal .checker-drop-box ul");
  297. userDropEvent(".checker-drop-input", selectChecker);
  298. }
  299. });
  300. }
  301. function userDropEvent(domSelector, selectEvent) {
  302. $("body").on("click", domSelector, function () {
  303. $(domSelector).parents(".drop-box").toggleClass("show");
  304. });
  305. $("body").on("click", ".checker-drop-box li", function () {
  306. $(".add-box .warning").hide();
  307. const n = $(this).attr("idx");
  308. selectEvent(domSelector, n);
  309. $(domSelector).parents(".drop-box").find(".warning").hide();
  310. $(domSelector).parents(".drop-box").removeClass("show");
  311. });
  312. }
  313. //审核人下拉选中
  314. function selectChecker(domSelector, n) {
  315. const flaw = global_checkers[n];
  316. const { id, userName } = flaw;
  317. $(domSelector).text(userName).attr({ "code": id, "title": userName });
  318. }
  319. function renderTab(data) {
  320. let str = ``
  321. if (data.length === 0) {
  322. $('.tbody').html(emptyBox(null, showNum + 12))
  323. return;
  324. }
  325. for (let i = 0; i < data.length; i++) {
  326. const item = data[i]
  327. str += `
  328. <tr>
  329. <td >${item.claimantName || "-"}</td>
  330. <td >${item.behDeptName || "-"}</td>
  331. <td >${item.claimantGmtCreate}</td>
  332. <td >${item.behospitalCode}</td>
  333. <td >${item.name || "-"}</td>
  334. <td >${item.modeName || "-"}</td>
  335. <td >${item.qcresultDetailMsg || "-"}</td>
  336. <td >${item.checkName || "-"}</td>
  337. <td >${item.checkGmtCreate || "-"}</td>
  338. <td >${item.appealOperationType == 0 ? '删改条目' : item.appealOperationType == 1 ? '新增已有条目' : item.appealOperationType == 2 ? '新增缺失条目' : '恢复条目'}</td>
  339. <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>
  340. <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}>
  341. ${item.exampleStatus == 0 ? `<span class="appealBtn goHomeDetail1">查看</span><span class="appealBtn withdraw" >撤回</span>` : ''}
  342. ${item.exampleStatus == 1 || item.exampleStatus == 2 ? `<span class="appealBtn goHomeDetail1">查看</span><span class="appealBtn appealAgain">再次申诉</span>` : ''}
  343. </td>
  344. </tr>
  345. `
  346. }
  347. $('.tbody').html(str)
  348. $(".withdraw").click(function () {
  349. let id = $(this).parent().attr("data-id")
  350. $("#delModal .modal-body").html("确定撤回该申诉?<br/>注:第一次提交的申诉撤回后,记录将被删除。");
  351. $("#delModal").show();
  352. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  353. cancelAppealInfo(id)
  354. });
  355. })
  356. $(".appealAgain").click(function () {
  357. let i = $(this).parent().attr("data-index")
  358. getCheckUser()
  359. getAppealOperationType(data[i])
  360. })
  361. $(".goHomeDetail1").click(function () {
  362. let id = $(this).parent().attr("data-id")
  363. let hospitalId = $(this).parent().attr("data-hos")
  364. let behospitalCode = $(this).parent().attr("data-behospitalCode")
  365. let casesEntryId = $(this).parent().attr("data-casesEntryId")
  366. let qcresultDetailId = $(this).parent().attr("data-qcresultDetailId")
  367. let appealOperationType = $(this).parent().attr("data-appealOperationType")
  368. $(parent.document).find("#contentIframe").attr("src", "appealExamine.html?id=" + id + "&hospitalId=" + hospitalId + "&behospitalCode=" + behospitalCode + "&casesEntryId=" + casesEntryId + "&qcresultDetailId=" + qcresultDetailId + "&appealOperationType=" + appealOperationType + "&page=" + page + "&form=" + 3)
  369. })
  370. }
  371. function getComplaintDetailMsg(data){
  372. post(api.getComplaintDetailMsg, { behospitalCode: data.behospitalCode, casesEntryId: data.casesEntryId, id: data.qcresultDetailId }).then(function (res) {
  373. if (res.data.code === '0') {
  374. data.qcresultDetailMsg = res.data.data
  375. $("#delModal .modal-body").html("");
  376. $("#delModal").show();
  377. $("#appealDef").tmpl(data).appendTo("#delModal .modal-body");
  378. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  379. addAppealInfo(data)
  380. });
  381. } else {
  382. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'warn' });
  383. }
  384. }).catch(() => {
  385. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  386. });
  387. }
  388. function getAppealOperationType(data) {
  389. post(api.getAppealOperationType, { appealOperationType: data.appealOperationType, exampleStatus: data.exampleStatus, qcresultDetailId: data.qcresultDetailId }).then(function (res) {
  390. if (res.data.code === '0') {
  391. data.appealOperationType = res.data.data.appealOperationType
  392. getComplaintDetailMsg(data)
  393. // $("#delModal .modal-body").html("");
  394. // $("#delModal").show();
  395. // $("#appealDef").tmpl(data).appendTo("#delModal .modal-body");
  396. // $("#delModal .confirm").text("确定").unbind("click").click(function () {
  397. // addAppealInfo(data)
  398. // });
  399. } else {
  400. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'warn' });
  401. }
  402. }).catch(() => {
  403. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  404. });
  405. }
  406. function cancelAppealInfo(id) {
  407. post(api.cancelAppealInfo, { id: id }).then(function (res) {
  408. if (res.data.code === '0') {
  409. getTabData(page)
  410. $("#delModal").hide();
  411. $.alerModal({ "message": "撤回成功", type: "tip", time: '1000', win: true });
  412. } else {
  413. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  414. }
  415. }).catch(() => {
  416. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  417. });
  418. }
  419. //再次申诉
  420. function addAppealInfo(data) {
  421. $(".warning").hide();
  422. let val = $(".textarea").val()
  423. let num = 500
  424. if (!val) {
  425. $(".warning .red").text("申诉说明不能为空~");
  426. $(".warning").show();
  427. return
  428. } else if (val.length > num) {
  429. $(".warning .red").text("申诉说明不能超过" + num + "个字~");
  430. $(".warning").show();
  431. return
  432. }
  433. const param = {
  434. appealExplain: $(".textarea").val(),
  435. appealOperationType: data.appealOperationType,
  436. behospitalCode: data.behospitalCode,
  437. checkId: $(".checker-drop-input").attr("code"),
  438. appealType: 1,
  439. qcresultDetailId: data.qcresultDetailId,
  440. isReject: data.isReject,
  441. modeId: data.modeId,
  442. casesScore: data.casesScore,
  443. casesEntryId: data.casesEntryId,
  444. qcresultDetaiValue: data.qcresultDetaiValue,
  445. qcresultDetailMsg: data.qcresultDetailMsg
  446. }
  447. post(api.addAppealInfo, param).then(function (res) {
  448. if (res.data.code === '0') {
  449. getTabData(page)
  450. $("#delModal").hide();
  451. $.alerModal({ "message": "申诉成功", type: "tip", time: '1000', win: true });
  452. } else {
  453. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  454. }
  455. }).catch(() => {
  456. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  457. });
  458. }
  459. $(document).on("click", ".checker-drop-input", (e) => {
  460. e.stopPropagation()
  461. $("#delModal ul").css("display", "block")
  462. });
  463. $(document).on("click", ".infoItem", (e) => {
  464. e.stopPropagation()
  465. const name = $(this).attr("data-name")
  466. $("#delModal ul").css("display", "none")
  467. });
  468. //选择申诉模块
  469. $('.selectModular').on("click", function (e) {
  470. e.stopPropagation()
  471. $(".typeList ").css("display", "none")
  472. $(".selectType .arrow").attr("src", iconDown)
  473. $(".deptList ").css("display", "none")
  474. $(".selectDept .arrow").attr("src", iconDown)
  475. $(".qcSelectCheck .arrow").attr("src", iconDown)
  476. $(".qcCheckList ").css("display", "none")
  477. const showList = $(".modularList ").css("display")
  478. if (showList == "none" || !showList) {
  479. $(".modularList ").css("display", "block")
  480. $(".selectModular .arrow").attr("src", iconUp)
  481. } else {
  482. $(".modularList ").css("display", "none")
  483. $(".selectModular .arrow").attr("src", iconDown)
  484. }
  485. })
  486. //操作类型
  487. $('.selectType').on("click", function (e) {
  488. e.stopPropagation()
  489. $(".deptList ").css("display", "none")
  490. $(".selectDept .arrow").attr("src", iconDown)
  491. $(".qcSelectCheck .arrow").attr("src", iconDown)
  492. $(".qcCheckList ").css("display", "none")
  493. $(".modularList ").css("display", "none")
  494. $(".selectModular .arrow").attr("src", iconDown)
  495. const showList = $(".typeList ").css("display")
  496. if (showList == "none" || !showList) {
  497. $(".typeList ").css("display", "block")
  498. $(".selectType .arrow").attr("src", iconUp)
  499. } else {
  500. $(".typeList ").css("display", "none")
  501. $(".selectType .arrow").attr("src", iconDown)
  502. }
  503. })
  504. //选择状态
  505. $('.qcSelectCheck').on("click", function (e) {
  506. e.stopPropagation()
  507. $(".typeList ").css("display", "none")
  508. $(".selectType .arrow").attr("src", iconDown)
  509. $(".deptList ").css("display", "none")
  510. $(".selectDept .arrow").attr("src", iconDown)
  511. $(".modularList ").css("display", "none")
  512. $(".selectModular .arrow").attr("src", iconDown)
  513. const showList = $(".qcCheckList ").css("display")
  514. if (showList == "none" || !showList) {
  515. $(".qcCheckList ").css("display", "block")
  516. $(".qcSelectCheck .arrow").attr("src", iconUp)
  517. } else {
  518. $(".qcCheckList ").css("display", "none")
  519. $(".qcSelectCheck .arrow").attr("src", iconDown)
  520. }
  521. })
  522. $('.selectDept').on("click", function (e) {
  523. e.stopPropagation()
  524. $(".typeList ").css("display", "none")
  525. $(".selectType .arrow").attr("src", iconDown)
  526. $(".modularList ").css("display", "none")
  527. $(".selectModular .arrow").attr("src", iconDown)
  528. $(".qcCheckList ").css("display", "none")
  529. $(".qcSelectCheck .arrow").attr("src", iconDown)
  530. const showList = $(".deptList ").css("display")
  531. if (showList == "none" || !showList) {
  532. $(".deptList ").css("display", "block")
  533. $(".selectDept .arrow").attr("src", iconUp)
  534. } else {
  535. $(".deptList ").css("display", "none")
  536. $(".selectDept .arrow").attr("src", iconDown)
  537. }
  538. })
  539. //获取科室列表
  540. getDeptList()
  541. function getDeptList() {
  542. post(api.getAppealDept, { inputStr: "", pageType: 1 }).then(res => {
  543. if (res.data.code == '0') {
  544. const deptList = res.data.data
  545. rendeDeptList(deptList)
  546. } else { }
  547. }).catch((e) => {
  548. })
  549. }
  550. function rendeDeptList(deptList) {
  551. let str = `<li class="deptItem ellipsis" data-id=" " data-name="全部">全部</li>`
  552. for (let i = 0; i < deptList.length; i++) {
  553. str += `<li class="deptItem ellipsis" title=${deptList[i].deptName} data-id=${deptList[i].deptId} data-name=${deptList[i].deptName}> ${deptList[i].deptName}</li>`
  554. }
  555. $('.deptList').html(str)
  556. bindDeptSelect()
  557. }
  558. //科室选择
  559. function bindDeptSelect() {
  560. $('.deptItem').on("click", function () {
  561. const deptItemName = $(this).attr("data-name")
  562. const deptItemId = $(this).attr("data-id")
  563. deptIdTemp = deptItemId
  564. deptName = deptNameTemp = deptItemName
  565. if (deptItemName.length > 10) {
  566. $('.selectDept').html(deptItemName.substring(0, 8) + '...')
  567. } else {
  568. $('.selectDept').html(deptItemName)
  569. }
  570. $('.selectDept ').attr('title', deptItemName)
  571. $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
  572. $('.selectDept').removeClass('unSelect')
  573. $(".deptList").css("display", "none")
  574. })
  575. }
  576. function renderColSet(list) {
  577. let pageSetList = list || pageSetCopy
  578. let allSelect = true
  579. for (let i = 0; i < pageSetList.length; i++) {
  580. if (pageSetList[i].status != 1) {
  581. allSelect = false
  582. }
  583. }
  584. let str = `<div class='colSetBox'>
  585. <div class='mask'></div>
  586. <div class='cloInfobox'>
  587. <div class='cloInfoTitle'><span class='cloInfoTitleTxt'>列显示设置</span> <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></div>
  588. <div class='cloInfo'></div>
  589. <div class='btnBox'><span class='defaultColSet'>恢复默认</span> <span class='cancalColSet'>取消</span> <span class='saveColSet'>保存设置</span></div>
  590. </div>
  591. </div>`
  592. 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' >`
  593. for (let i = 0; i < pageSetList.length; i++) {
  594. infoStr += `<div class='colTabInfo' data-index=${i}>
  595. <span class='colOpera' data-index=${i}>${pageSetList[i].status == 1 ? `<img class="toggleSelectCol" src=${iconCheck} />` : `<img class="toggleSelectCol" src=${iconUnCheck} />`}</span>
  596. <span class='colName'>
  597. <span>${pageSetList[i].name}</span>
  598. <span class="pageOrder">
  599. <span class="pageSetUpBox">${i === 0 ? '' : `<img class="pageSetUp" src=${goUpG} />`}</span>
  600. <span class="pageSetDownBox">${i === pageSetList.length - 1 ? '' : `<img class="pageSetDown" src=${goDownG} />`}</span>
  601. </span>
  602. </span>
  603. </div>`
  604. }
  605. infoStr += "</div>"
  606. // $(".main-body").append(str)
  607. if (!$("#mainBox .colSetBox", parent.document).length) {
  608. $("#mainBox", parent.document).append(str)
  609. }
  610. $("#mainBox .colSetBox .cloInfo", parent.document).html(infoStr)
  611. $(".colTabInfoBox", parent.document).scrollTop(scrollTop)
  612. scrollTop = 0
  613. bindSelectCol()
  614. bindColOrder()
  615. bindSaveColSet()
  616. bindDefaultColset()
  617. bindCloseColSet()
  618. bindImgEnter()
  619. }
  620. function bindDefaultColset() {
  621. $('.defaultColSet', parent.document).off("hover").hover(function () {
  622. $(this).css('color', '#00A1FF')
  623. }, function () {
  624. $(this).css('color', '#777777')
  625. })
  626. $('.defaultColSet', parent.document).off("click").on('click', function () {
  627. return post(api.getDefaultPageSet, { pageType: 1 }).then(res => {
  628. if (res.data.code == '0') {
  629. pageSet = res.data.data
  630. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  631. renderColSet(pageSetCopy)
  632. } else { }
  633. }).catch((e) => {
  634. })
  635. // closeColSet()
  636. })
  637. }
  638. function bindImgEnter() {
  639. $(".pageSetUpBox img", parent.document).off("mouseenter").on("mouseenter", function () {
  640. $(this).attr('src', goUpB)
  641. })
  642. $(".pageSetDownBox img", parent.document).off("mouseenter").on("mouseenter", function () {
  643. $(this).attr('src', goDownB)
  644. })
  645. $(".pageSetUpBox img", parent.document).off("mouseout").on("mouseout", function () {
  646. $(this).attr('src', goUpG)
  647. })
  648. $(".pageSetDownBox img", parent.document).off("mouseout").on("mouseout", function () {
  649. $(this).attr('src', goDownG)
  650. })
  651. }
  652. function bindSelectCol() {
  653. $(".toggleSelectCol", parent.document).off("click").on("click", function () {
  654. const index = $(this).parent().attr("data-index")
  655. pageSetCopy[index].status = pageSetCopy[index].status == 1 ? 0 : 1
  656. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  657. renderColSet(pageSetCopy)
  658. })
  659. $(".toggleSelectColAll", parent.document).off("click").on("click", function () {
  660. const hasSelectAll = $(this).attr("data-select")
  661. for (let i = 0; i < pageSetCopy.length; i++) {
  662. if (hasSelectAll == "true") {
  663. pageSetCopy[i].status = 0
  664. } else {
  665. pageSetCopy[i].status = 1
  666. }
  667. }
  668. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  669. renderColSet(pageSetCopy)
  670. })
  671. }
  672. function closeColSet() {
  673. pageSetCopy = JSON.parse(JSON.stringify(pageSet))
  674. $("#mainBox .colSetBox", parent.document).remove()
  675. }
  676. function bindCloseColSet() {
  677. $(".colSetBox .iconClose", parent.document).off("click").on("click", function () {
  678. closeColSet()
  679. })
  680. $(".colSetBox .cancalColSet", parent.document).off("click").on("click", function () {
  681. closeColSet()
  682. })
  683. }
  684. function bindSaveColSet() {
  685. $(".saveColSet", parent.document).off("click").on("click", function () {
  686. let showNumSet = 0
  687. let sysUserPagesetVOList = []
  688. for (let i = 0; i < pageSetCopy.length; i++) {
  689. const item = pageSetCopy[i]
  690. sysUserPagesetVOList.push({
  691. name: item.name,
  692. orderNo: i,
  693. status: item.status,
  694. val: item.val
  695. })
  696. if (item.status == 1) {
  697. showNumSet++
  698. }
  699. }
  700. if (showNumSet === 0) {
  701. $.alerModal({ "message": '最少显示一列', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  702. return
  703. }
  704. return post(api.saveQcListPageSet, { pageType: 1, sysUserPagesetVOList: sysUserPagesetVOList }).then(res => {
  705. if (res.data.code == '0') {
  706. closeColSet()
  707. } else {
  708. $("#mainBox .colSetBox", parent.document).remove()
  709. $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  710. }
  711. }).catch((e) => {
  712. $("#mainBox .colSetBox", parent.document).remove()
  713. $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  714. })
  715. })
  716. }
  717. function bindColOrder() {
  718. $(".pageSetUp", parent.document).off("click").on("click", function () {
  719. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  720. if (index != 0) {
  721. const upItem = pageSetCopy[index]
  722. const upItemPre = pageSetCopy[index - 1]
  723. pageSetCopy.splice(index - 1, 2, upItem, upItemPre)
  724. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  725. renderColSet(pageSetCopy)
  726. } else {
  727. return
  728. }
  729. })
  730. $(".pageSetDown", parent.document).off("click").on("click", function () {
  731. const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
  732. if (index == pageSetCopy.length - 1) {
  733. return
  734. } else {
  735. const downItem = pageSetCopy[index]
  736. const downItemBack = pageSetCopy[index + 1]
  737. pageSetCopy.splice(index, 2, downItemBack, downItem)
  738. scrollTop = $(".colTabInfoBox", parent.document).scrollTop()
  739. renderColSet(pageSetCopy)
  740. }
  741. })
  742. }
  743. $(".fpCheckPeople").on("input", function (e) {
  744. const val = $(this).val().trim()
  745. fpCheckNameTemp = val
  746. })
  747. $(".qcCheckPeople").on("input", function (e) {
  748. const val = $(this).val().trim()
  749. qcCheckNameTemp = val
  750. })
  751. $(".qcCheckMain").on("input", function (e) {
  752. const val = $(this).val().trim()
  753. qcCheckMain = qcCheckMainTemp = val
  754. })
  755. $(function () {
  756. $.datepicker.regional['zh-CN'] = {
  757. clearText: '清除',
  758. clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
  759. closeText: '关闭',
  760. closeStatus: '不改变当前选择',
  761. prevText: '<上月',
  762. prevStatus: '显示上月',
  763. prevBigText: '<<',
  764. prevBigStatus: '显示上一年',
  765. nextText: '下月>',
  766. nextStatus: '显示下月',
  767. nextBigText: '>>',
  768. nextBigStatus: '显示下一年',
  769. currentText: '今天',
  770. currentStatus: '显示本月',
  771. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  772. monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  773. yearNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  774. monthStatus: '选择月份',
  775. yearStatus: '选择年份',
  776. weekHeader: '周',
  777. weekStatus: '年内周次',
  778. dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
  779. dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  780. dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
  781. dayStatus: '设置 DD 为一周起始',
  782. dateStatus: '选择 m月 d日, DD',
  783. dateFormat: 'yy-mm-dd',
  784. firstDay: 1,
  785. initStatus: '请选择日期',
  786. isRTL: false
  787. };
  788. $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
  789. let startDate = "", endDate = new Date()
  790. let year = new Date().getFullYear()
  791. let month = new Date().getMonth() + 1
  792. if (statisticsType == '1') {
  793. startDate = new Date(`${year}-${month}-01`)
  794. } else if (statisticsType == '2') {
  795. startDate = new Date(`${year}-01-01`)
  796. } else if (statisticsType == '3') {
  797. startDate = new Date(startDateParam)
  798. endDate = new Date(endDateParam)
  799. } else {
  800. startDate = "-6d"
  801. }
  802. $("#datepicker").datepicker({
  803. changeMonth: true,
  804. changeYear: true,
  805. dateFormat: "yy/mm/dd",
  806. }).datepicker("setDate", startDate);
  807. $("#datepicker2").datepicker({
  808. changeMonth: true,
  809. changeYear: true,
  810. dateFormat: "yy/mm/dd"
  811. }).datepicker("setDate", endDate);
  812. $("#datepickerFp1").datepicker({
  813. changeMonth: true,
  814. changeYear: true,
  815. dateFormat: "yy/mm/dd"
  816. }).datepicker("setDate", "");
  817. $("#datepickerFp2").datepicker({
  818. changeMonth: true,
  819. changeYear: true,
  820. dateFormat: "yy/mm/dd"
  821. }).datepicker("setDate", "");
  822. $("#datepickerQc1").datepicker({
  823. changeMonth: true,
  824. changeYear: true,
  825. dateFormat: "yy/mm/dd"
  826. }).datepicker("setDate", "");
  827. $("#datepickerQc2").datepicker({
  828. changeMonth: true,
  829. changeYear: true,
  830. dateFormat: "yy/mm/dd"
  831. }).datepicker("setDate", "");
  832. getTabData(page)
  833. });
  834. //分页渲染
  835. function renderPagination(totalPage, activePage, totalNum) {
  836. let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
  837. if (totalPage <= 6) {
  838. for (let i = 1; i <= totalPage; i++) {
  839. str += `<span class="pageNum ${'page' + i}" data-page=${i}>${i}</span>`
  840. }
  841. } else {
  842. if (activePage <= 3) { //选中页数小于4
  843. for (let i = 1; i <= 4; i++) {
  844. str += `<span class="pageNum ${'page' + i}" data-page=${i}>${i}</span>`
  845. }
  846. str += `<span class="more" >...</span>`
  847. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  848. } else if (activePage > totalPage - 3) {
  849. str += `<span class="pageNum page1" data-page=1>1</span>`
  850. str += `<span class="more" >...</span>`
  851. str += `<span class="pageNum ${'page' + (totalPage - 3)}" data-page=${totalPage - 3}>${totalPage - 3}</span>`
  852. str += `<span class="pageNum ${'page' + (totalPage - 2)}" data-page=${totalPage - 2}>${totalPage - 2}</span>`
  853. str += `<span class="pageNum ${'page' + (totalPage - 1)}" data-page=${totalPage - 1}>${totalPage - 1}</span>`
  854. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  855. } else {
  856. str += `<span class="pageNum page1" data-page=1>1</span>`
  857. str += `<span class="more" >...</span>`
  858. str += `<span class="pageNum ${'page' + (activePage - 1)}" data-page=${activePage - 1}>${activePage - 1}</span>`
  859. str += `<span class="pageNum ${'page' + activePage}" data-page=${activePage}>${activePage}</span>`
  860. str += `<span class="pageNum ${'page' + (activePage + 1)}" data-page=${activePage + 1}>${activePage + 1}</span>`
  861. str += `<span class="more" >...</span>`
  862. str += `<span class="pageNum ${'page' + totalPage}" data-page=${totalPage}>${totalPage}</span>`
  863. }
  864. }
  865. str += `<span class="nextPage"><img class="arrowPage" src=${arrowRight} /></span>`
  866. $('.pagination').html(str)
  867. $('.page' + activePage).addClass('activePage')
  868. $(".pageNum").on("click", function (e) {
  869. const activePageNow = Number($(this).attr('data-page'))
  870. page = activePageNow
  871. getTabData(activePageNow)
  872. // renderPagination(totalPage,activePageNow,totalNum)
  873. })
  874. $(".prePage").on("click", function (e) {
  875. let activePageNow = Number($(".activePage").attr('data-page'))
  876. page = activePageNow
  877. if (activePageNow > 1) {
  878. activePageNow--
  879. getTabData(activePageNow)
  880. // renderPagination(totalPage,activePageNow,totalNum)
  881. }
  882. })
  883. $(".nextPage").on("click", function (e) {
  884. let activePageNow = Number($(".activePage").attr('data-page'))
  885. page = activePageNow
  886. if (activePageNow < totalPage) {
  887. activePageNow++
  888. getTabData(activePageNow)
  889. // renderPagination(totalPage,activePageNow,totalNum)
  890. }
  891. })
  892. }
  893. $(document).on("click", function () {
  894. $(".typeList ").css("display", "none")
  895. $(".modularList ").css("display", "none")
  896. $(".deptList").css("display", "none")
  897. $(".qcCheckList").css("display", "none")
  898. $(".selectDept .arrow").attr("src", iconDown)
  899. $(".selectModular .arrow").attr("src", iconDown)
  900. $(".qcSelectCheck .arrow").attr("src", iconDown)
  901. $(".selectType .arrow").attr("src", iconDown)
  902. $("#delModal ul").css("display", "none")
  903. })
  904. let radioCheck = 1;
  905. $((function ($) {
  906. $('.export').click(function () {
  907. const behosDateStartTime = new Date(behosDateStart).getTime()
  908. const behosDateEndTime = new Date(behosDateEnd).getTime()
  909. if (behosDateStartTime > behosDateEndTime) {
  910. $.alerModal({ "message": '开始时间不能大于结束时间~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  911. return
  912. }
  913. const param = {
  914. deptId: deptId.trim(),
  915. deptName: deptName == "全部" ? "" : deptName || '',
  916. modeName: moduleName == "全部" ? "" : moduleName || '',
  917. operationType: operationType,
  918. state: state,
  919. size: 15,
  920. name: $('.name').val(),
  921. patientName: $('.patientNameInp').val(),
  922. complaintDateEnd: behosDateEnd.replaceAll("/", "-"),
  923. complaintDateStart: behosDateStart.replaceAll("/", "-"),
  924. "desc": ['claimant_gmt_create']
  925. }
  926. expJson(api.getComplaintRecordExport, param).then(res => {
  927. downloadExportedData(res.data, "申诉记录.xls")
  928. })
  929. })
  930. })($));