appealHistory.js 38 KB

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