qcScore.js 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744
  1. require("../css/qcScore.less");
  2. const $ = require('jquery');
  3. require('jquery-templates');
  4. require('./modal.js');
  5. const { post, post1, getUrlArgObject, setBoxHeight, getCookie, getLocal, initScroll } = require('./utils.js');
  6. const { api, ywCheckApi } = require('./api.js');
  7. const axios = require("axios")
  8. let checkOk = require('./../images/checkOk.png')
  9. const loadingImg = require("./../images/loading.gif")
  10. const adLogo = require("../images/adlogo.png");
  11. const { resolve, reject } = require("bluebird");
  12. if (localStorage.getItem('toLogin') === '1') {
  13. window.location.href = '../login.html';
  14. }
  15. /**
  16. *data_type:存储的是对缺陷总览页面的缺陷总览和控费缺陷两个子页面操作时,
  17. *停留在哪个页面,2表示为缺陷总览子页面,1表示控费缺陷子页面,
  18. *点击侧边菜单栏data_type会重置为2
  19. *
  20. */
  21. let data_type = 2
  22. $(function () {
  23. const hideLogo = getUrlArgObject("hideLg");
  24. if (hideLogo) {
  25. $(".sub-menu .logo img,.copy-right").remove();
  26. $(".menu-mini .logo").text("");
  27. }
  28. const otherLogo = getUrlArgObject("adLg");
  29. if (otherLogo) {
  30. $(".logo img").attr("src", adLogo);
  31. $(".menu-mini .logo").text("艾登");
  32. $(".copy-right").remove();
  33. }
  34. //本页全局变量
  35. let global_flawData = {}; //缺陷数据
  36. let global_flawDataPay = {}; //缺陷数据
  37. const global_id = getUrlArgObject("id");
  38. const global_hid = getUrlArgObject("hid");
  39. let global_check;
  40. let global_check_home, global_check_show, check_Operation_WithAppeal;
  41. let global_entryName, global_casesEntryId
  42. const global_code = getUrlArgObject("code");
  43. let global_activeTab = $(".sub-menu .page.active").attr("code"); //当前激活菜单项
  44. let global_modules = {}; //模板数据缓存
  45. let global_flaws = []; //缺陷条目列表缓存
  46. let global_selectedFlaw = {}; //新增时选中的条目信息
  47. let isPlacefile = getCookie('isPlacefile')
  48. let global_diagList
  49. let global_operaList
  50. getAllModules();
  51. let showCheckBtns = global_code === "YH-ZKHC-HCRWLB";
  52. window.document.title = (showCheckBtns ? "质控核查-" : "质控评分-") + getUrlArgObject("name");
  53. let hasAu5 = isPlacefile == 0 ? true : showCheckBtns && hasData('FUNC000011'); //新增缺陷权限
  54. // 缺陷总览 权限全开
  55. if (global_code === "YH-BLZK-ZKPF") {
  56. hasAu5 = true
  57. }
  58. if (hasAu5) {
  59. $(".add-flaw").click(function () {
  60. getQcCasesEntry();
  61. });
  62. }
  63. $("body").on("click", ".refreshBtn", function () {
  64. supplementData()
  65. });
  66. function showAppealDetailEvent() {
  67. //申诉状态点击事件
  68. $(".flaw-item").off("click").on("click", ".title .btn", function () {
  69. showModal("5", $(this).attr("data_id"), $(this).attr("data_type"), $(this).attr("data_casesEntryId"), $(this).attr("data_qcresultDetailId"));
  70. });
  71. }
  72. function initMenu(data) {
  73. const menu = [{ id: 0, name: "缺陷总览", parentId: -1, sonMode: [] }, ...(data || [])];
  74. //菜单数据填充
  75. $("#subMenuTmpl").tmpl(menu).appendTo("#subMenu");
  76. $("#miniMenuTmpl").tmpl(menu).appendTo(".menu-mini ul");
  77. //菜单收起展开
  78. $(document).on("click", ".sub-menu .list-1", function () {
  79. $(".sub-menu .list-1 .slide-up").removeClass('slide-up');
  80. $(this).toggleClass('slide-up');
  81. $(this).find("ul").slideToggle();
  82. // setTimeout(function(){
  83. // initScroll("subMenu","Y",2)
  84. // },300)
  85. });
  86. $(".sub-menu .list-1 li").on("click", function (e) {
  87. e.stopPropagation();
  88. });
  89. //收起菜单
  90. $(".slide-show").click(function () {
  91. $(".sub-menu,.copy-right").animate({ "width": "60px" }, function () {
  92. $(this).hide();
  93. $(".menu-mini").show();
  94. });
  95. $(".tab-container").animate({ "margin-left": "60px" });
  96. });
  97. //展开菜单
  98. $(".slide-hide").click(function () {
  99. $(".menu-mini").hide();
  100. $(".sub-menu,.copy-right").show().animate({ "width": "220px" }, function () {
  101. });
  102. $(".tab-container").animate({ "margin-left": "220px" });
  103. });
  104. //右侧内容切换
  105. $(".page").on("click", function () {
  106. data_type = 2
  107. $(".info-item .cont,.flaw-item,td").removeClass("active"); //清空缺陷定位背景
  108. const title = $(this).attr("code");
  109. if (title == '缺陷总览' || !global_check_show) { //质控核查页进来隐藏原核查按钮
  110. $(".check,.ywCheck").css('display', 'none')
  111. }/*else if(title == '病案首页'){
  112. if(showCheckBtns){
  113. $(".ywCheck").show();
  114. }else{
  115. $(".check").css('display','block').text(global_check_home==1?'重新核查':'病案首页核查')
  116. }
  117. }*/else {
  118. if (showCheckBtns) {
  119. $(".ywCheck").show();
  120. } else {
  121. $(".check").css('display', 'block').text(global_check == 1 ? '重新核查' : '病历核查')
  122. }
  123. }
  124. if (title === "缺陷总览" || title === "谈话告知书" || title === "知情同意书" || title === '医嘱信息' || title === '检验信息' || title === '检查信息' || title === '护理信息' || title === '其他信息') {
  125. if (title === "缺陷总览") {
  126. getRecordDetailUpdate()
  127. }
  128. $(".flaw-table .page-item").hide();
  129. $(".flaw-table,.flaw-table .page-item[code=" + title + "]").show();
  130. } else {
  131. $(".flaw-table").hide();
  132. }
  133. iframeShow(title)
  134. //选中样式
  135. $(".sub-menu .active,.menu-mini .active").removeClass('active');
  136. const mItems = $(".sub-menu .page[code=" + title + "],.menu-mini .page[code=" + title + "]");
  137. mItems.addClass("active");
  138. mItems.parents(".list-1").addClass("active");
  139. //显示对应内容
  140. const code = $(this).attr("code");
  141. global_activeTab = code;
  142. //initModuleData();
  143. $(".content-item,.flaw-item").hide();
  144. $(".content-item[code='" + code + "']").show();
  145. showFlawList();
  146. $("#contentInfo").scrollTop(0)
  147. });
  148. // initScroll("subMenu","Y",2)
  149. }
  150. function iframeShow(title) {
  151. if (title === '医嘱信息') {
  152. $("#pacsIframeIn,#assistIframeIn,#pacsDetailIframeIn,#contentNursing,#contentOther").css("display", "none")
  153. $("#contentIframeIn").css({ display: 'block' }).attr("src", 'advice.html').contents().find(".adviceWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  154. $(window).resize(function () {
  155. $("#contentIframeIn").contents().find(".adviceWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  156. });
  157. } else if (title === '检验信息') {
  158. $("#contentIframeIn,#assistIframeIn,#pacsDetailIframeIn,#contentNursing,#contentOther").css("display", "none")
  159. $("#pacsIframeIn").css({ display: 'block' }).attr("src", 'pacs.html').contents().find(".pacsWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  160. $(window).resize(function () {
  161. $("#pacsIframeIn").contents().find(".pacsWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  162. });
  163. } else if (title === '检查信息') {
  164. $("#contentIframeIn,#pacsIframeIn,#pacsDetailIframeIn,#contentNursing,#contentOther").css("display", "none")
  165. $("#assistIframeIn").css({ display: 'block' }).attr("src", 'assist.html').contents().find(".assistWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  166. $(window).resize(function () {
  167. $("#assistIframeIn").contents().find(".assistWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  168. });
  169. } else if (title === '护理信息') {
  170. $("#pacsIframeIn,#assistIframeIn,#pacsDetailIframeIn,#contentIframeIn,#contentOther").css("display", "none")
  171. $("#contentNursing").css({ display: 'block' }).attr("src", 'nursing.html').contents().find(".nursingWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  172. $(window).resize(function () {
  173. $("#contentNursing").contents().find(".nursingWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  174. });
  175. } else if (title === '其他信息') {
  176. $("#pacsIframeIn,#assistIframeIn,#pacsDetailIframeIn,#contentIframeIn,#contentNursing").css("display", "none")
  177. $("#contentOther").css({ display: 'block' }).attr("src", 'other.html').contents().find(".otherWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  178. $(window).resize(function () {
  179. $("#contentOther").contents().find(".otherWrp").height(window.innerHeight - $("#patientInfo").height() - 20 + 'px')
  180. });
  181. } else {
  182. $("#contentIframeIn,#pacsIframeIn,#pacsDetailIframeIn,#assistIframeIn,#contentNursing,#contentOther").css({ display: 'none' })
  183. }
  184. }
  185. //判断有无某一权限
  186. function hasData(data) {
  187. return true
  188. let trdObj = JSON.parse(getLocal("trdObj"))
  189. let lis = trdObj[global_code]
  190. if (!lis) {
  191. return false
  192. }
  193. if (lis.indexOf(data) > -1) {//有权限
  194. return true
  195. }
  196. return false;
  197. }
  198. //获取病例明细
  199. function getRecordDetail(type) {
  200. post(api.getRecordDetail, { 'behospitalCode': global_id }).then(function (res) {
  201. if (res.data.code === '0') {
  202. const data = res.data.data;
  203. const { beHospital, result, msg, checkStatus, drgs, mrStatus, checkShow, checkOperationWithAppeal } = data;
  204. global_check = checkStatus
  205. global_check_home = mrStatus
  206. global_check_show = checkShow;//0隐藏操作按钮1显示
  207. check_Operation_WithAppeal = checkOperationWithAppeal;
  208. const info = Object.assign(beHospital, result);
  209. initMenu(JSON.parse(result.menuData));
  210. // $(".sub-menu>ul>li:first-child.page,.menu-mini>ul>li:first-child.page").addClass("active");
  211. $(".subMenu >li:first-child.page,.menu-mini>ul>li:first-child.page").addClass("active");
  212. global_activeTab = $(".sub-menu .page.active").attr("code");
  213. $(".operation").show()
  214. initPatientInfo(info);
  215. initContent(result.pageData, 2);
  216. initList(msg);
  217. initScoreItem(msg);
  218. global_flawData = msg;
  219. global_flawDataPay = drgs;
  220. const pageData = JSON.parse(result.pageData)
  221. const list2 = pageData.病案首页
  222. const diagList = JSON.parse(list2[0].出院诊断)
  223. const operaList = JSON.parse(list2[0].手术信息)
  224. console.log("diagList", diagList)
  225. console.log("operaList", operaList);
  226. global_diagList = diagList;
  227. global_operaList = operaList;
  228. setBoxHeight();
  229. changePay()
  230. } else {
  231. $.alerModal({ "message": '接口出错', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
  232. }
  233. }).catch(() => {
  234. $.alerModal({ "message": '接口出错', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
  235. });
  236. }
  237. function getRecordDetailUpdate() {
  238. post(api.getRecordDetail, { 'behospitalCode': global_id }).then(function (res) {
  239. if (res.data.code === '0') {
  240. const data = res.data.data;
  241. const { beHospital, result, msg, checkStatus, drgs } = data;
  242. // global_check = checkStatus
  243. // const info=Object.assign(beHospital,result);
  244. // initMenu(JSON.parse(result.menuData));
  245. // $(".subMenu >li:first-child.page,.menu-mini>ul>li:first-child.page").addClass("active");
  246. // global_activeTab=$(".sub-menu .page.active").attr("code");
  247. // initPatientInfo(info);
  248. // initContent(result.pageData);
  249. initList(msg);
  250. initScoreItem(msg);
  251. global_flawData = msg;
  252. global_flawDataPay = drgs;
  253. // setBoxHeight();
  254. // changePay()
  255. }
  256. });
  257. }
  258. //补录数据,接口来自技术服务部
  259. function supplementData() {
  260. //重新拉数据接口
  261. post(api.supplementData, { 'behospitalCode': global_id, 'behospitalNum': '' }).then(function (res) {
  262. const { code, data } = res.data;
  263. if (code === '0') {
  264. if (data === '0') { //0表示数据已更新,-1表示数据未更新
  265. //数据更新后先评分(评分成功后)再重新获取详情即刷新页面
  266. recordScore();
  267. } else {
  268. $.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
  269. }
  270. } else {
  271. $.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
  272. }
  273. });
  274. }
  275. function loading() {
  276. const str = `
  277. <div class="loadingBox">
  278. <div class="mask"></div>
  279. <img class="loadingImg" src=${loadingImg} alt="loading" />
  280. </div>
  281. `
  282. $("body", parent.document).append(str)
  283. }
  284. function hideLoading() {
  285. $(".loadingBox", parent.document).remove()
  286. }
  287. //评分
  288. function recordScore() {
  289. const param = {
  290. behospitalCode: global_id
  291. };
  292. loading();
  293. post(api.recordScore, param).then(res => {
  294. if (res.data.code === '0') {
  295. hideLoading();
  296. //评分成功,刷新病历详情页面
  297. window.parent.location.reload()
  298. } else {
  299. hideLoading()
  300. $.alerModal({ "message": res.data.msg || '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  301. }
  302. }).catch(() => {
  303. hideLoading()
  304. $.alerModal({ "message": '刷新失败,请重试~', type: "tip", win: 'default', time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  305. })
  306. }
  307. function changePay() {
  308. $(document).on('click', ".titleSpecial span", function () {
  309. let type = $(this).attr("data-type")
  310. // window.localStorage.setItem("data_type", type)
  311. data_type = Number(type)
  312. if (type == 1) {
  313. initList(global_flawDataPay, type);
  314. } else {
  315. initList(global_flawData, type);
  316. }
  317. })
  318. }
  319. //填充患者信息
  320. function initPatientInfo(data) {
  321. const obj = Object.assign({}, data, { showCheckBtns, checkState: global_check, checkStateHome: global_check_home });
  322. $("#infoTmpl").tmpl(obj).appendTo("#patientInfo");
  323. /*$(".check").on("click", function(){
  324. checkQc()
  325. })*/
  326. $(".ywCheck").on("click", function () {
  327. checkYwQc()
  328. })
  329. }
  330. //显示病例模块明细
  331. function initContent(data, type) {
  332. const obj = JSON.parse(data);
  333. let info = [];
  334. let hml = '', moduleId = '';
  335. if (type == 2) {
  336. formatSpecPage(obj["谈话告知书"], "谈话告知书");
  337. formatSpecPage(obj["知情同意书"], "知情同意书");
  338. }
  339. // formatSpecPage(obj["医嘱信息"],"医嘱信息");
  340. $(".content-box").show();
  341. for (let k in obj) {
  342. if (k === "谈话告知书" || k === "知情同意书") {
  343. continue;
  344. }
  345. for (let i in obj[k]) {
  346. info = formatInfoData(k, obj[k][i]);
  347. moduleId = info.mode_id;
  348. if (global_modules[moduleId]) {
  349. hml = initModuleData(moduleId, obj[k]);
  350. // hml:模板 info:数据。
  351. $.tmpl(hml, info).appendTo("#contentInfo");
  352. } else {
  353. const icon = require("../images/empty1.png");
  354. const sid = moduleId ? "(" + moduleId + ")" : "";
  355. const code = k.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '');
  356. const emptyStr = `<div class="empty">
  357. <img src="${icon}" alt="空"/>
  358. <p>暂无信息~</p>
  359. </div>`;
  360. if (!$(".content-item[code=" + code + "] .empty").length) { //显示一条空提示即可
  361. hml = '<div class="content-item" code="' + code + '">' +
  362. '<h2 class="title">' + k + sid + '</h2>' + emptyStr + '</div>';
  363. $.tmpl(hml, {}).appendTo("#contentInfo");
  364. }
  365. }
  366. }
  367. }
  368. $(".content-item[code=" + global_activeTab + "]").show();
  369. //console.log(obj)
  370. }
  371. function formatInfoData(k, data) {
  372. let obj = {}, name = "";
  373. for (let i in data) {
  374. if (i !== "mode_id") {
  375. name = i.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, "").replace(/^[0-9]+/, "a"); //过滤key中存在的特殊符号,模板会渲染不出来且不报错
  376. obj[name] = data[i].replace(/\n/g, "<br/>") || "";
  377. } else {
  378. obj[i] = data[i].replace(/\n/g, "<br/>") || "";
  379. }
  380. }
  381. return Object.assign({ title: k }, obj);
  382. }
  383. //知情同意书、谈话告知书
  384. function formatSpecPage(data, title, type) {
  385. $(".page-item[code='缺陷总览']").remove()
  386. // $(".flaw-table").html("")
  387. let hasAu = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000013'); //修改缺陷权限
  388. let hasAu2 = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000012'); //删除缺陷权限
  389. // let hasAu4 = isPlacefile == 0 ? true : check_Operation_WithAppeal && showCheckBtns && global_check_show
  390. // let hasAu3 = check_Operation_WithAppeal
  391. // 缺陷总览 权限全开
  392. if (global_code === "YH-BLZK-ZKPF") {
  393. hasAu = true
  394. hasAu2 = true
  395. }
  396. // console.log("hasAu3:", check_Operation_WithAppeal)
  397. $("#appointBookTmpl").tmpl({ title, data, hasAu, hasAu2 }).appendTo(".flaw-table");
  398. // 防止页面数据更新时,页面不显示
  399. $(".page-item[code='缺陷总览']").css("display", "block")
  400. setBoxHeight();
  401. // console.log("data:", data)
  402. // 操作列: 修改,恢复和编辑
  403. $(".scroll-table .oper a").unbind("click").click(function () {
  404. // 获取当前操作的类型,当前分为:病案首页,入院记录和出院小结等
  405. let opType_old = $(this).parents("tr").attr("code");
  406. // 剔除掉opType_old的特殊符号
  407. let opType_new = opType_old.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, "")
  408. // 获取当前这条记录在同类型里的索引
  409. const i = $(`.scroll-table tr[code= '${opType_old}' ]`).index($(this).parents("tr"))
  410. //获取当前记录的ID
  411. const code = $(this).attr("code");
  412. // 查看是否点击的是编辑
  413. const isEdit = $(this).is(".edit-flaw");
  414. //if(!hasAu)return
  415. // 由于弹窗的数据填充的是由当前菜单决定的,需要修改global_activeTab为当前操作类型
  416. global_activeTab = opType_new
  417. if (isEdit && hasAu) {
  418. showModal('0', code, i); //编辑
  419. } else if (!isEdit && hasAu2) {
  420. if ($(this).is(".recover-flaw")) {
  421. showModal('3', code, i); //恢复
  422. //
  423. } else {
  424. showModal('1', code, i); //删除
  425. }
  426. }
  427. // 防止影响菜单,重新激活菜单项
  428. global_activeTab = $(".sub-menu .page.active").attr("code");
  429. })
  430. $(".page-anchor").on("click", function () {
  431. const code = $(this).attr("code");
  432. const pCode = $(this).parents("tr").attr("code").replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '');
  433. //菜单同步状态
  434. $(".sub-menu .page[code=" + pCode + "]").parents(".list-1").click();
  435. $(".sub-menu .page[code=" + pCode + "],.menu-mini .page[code=" + pCode + "").click();
  436. //缺陷定位
  437. $(".info-item .cont,.flaw-item,td").removeClass("active");
  438. const flawItem = $(".flaw-item .title a[code=" + code + "]");
  439. if (!flawItem.length) {
  440. $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
  441. return;
  442. }
  443. $(".flaw-item .title a[code=" + code + "]").click();
  444. const anch = $(".flaw-item .title a[code=" + code + "]").attr("href");
  445. if ($(anch)[0]) {
  446. $('#contentInfo').scrollTop($(anch).offset().top - 60);
  447. }
  448. });
  449. if (global_activeTab == "缺陷总览") {
  450. $(".check").css("display", "none")
  451. } else {
  452. $(".check").css("display", "block")
  453. }
  454. if (type && type == 1) {
  455. $(".titleNo").css({
  456. 'background-color': '#00A1FF',
  457. 'color': '#fff',
  458. 'border-color': '#00A1FF'
  459. })
  460. $(".titlePay").css({
  461. 'background-color': '#fff',
  462. 'border': '1px solid #777',
  463. 'border-right': 0,
  464. 'color': '#777'
  465. })
  466. setBoxHeight()
  467. } else if (type && type == 2) {
  468. $(".titleNo").css({
  469. 'background-color': '#fff',
  470. 'border': '1px solid #777',
  471. 'border-left': 0,
  472. 'color': '#777'
  473. })
  474. $(".titlePay").css({
  475. 'background-color': '#00A1FF',
  476. 'color': '#fff',
  477. 'border-color': '#00A1FF'
  478. })
  479. setBoxHeight()
  480. }
  481. }
  482. function initList(data, type) {
  483. //$("#flawTotalList").tmpl({title:"缺陷总览",data:data}).appendTo(".flaw-table");
  484. formatSpecPage(data, "缺陷总览", type);
  485. $(".flaw-table").show();
  486. $(".flaw-table .page-item[code=" + global_activeTab + "]").show();
  487. $(".slide-up").off("click").on("click", function () {
  488. const name = $(this).text();
  489. $("tr[code='" + name + "']").slideToggle();
  490. $(this).toggleClass("down");
  491. });
  492. }
  493. //评分项数据填充
  494. function initScoreItem(data) {
  495. $("#flaws .flaw-box").html("");
  496. // console.log(showCheckBtns, 11122);
  497. let hasAu = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000013'); //修改缺陷权限
  498. let hasAu2 = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000012'); //删除缺陷权限
  499. let hasAu4 = isPlacefile == 0 ? true : check_Operation_WithAppeal && showCheckBtns && global_check_show //显示新增的权限
  500. let hasAu3 = check_Operation_WithAppeal
  501. // let hasAu4 = showCheckBtns && hasData('FUNC000011'); //新增缺陷权限
  502. // 缺陷总览 权限全开
  503. if (global_code === "YH-BLZK-ZKPF") {
  504. hasAu = true
  505. hasAu2 = true
  506. hasAu3 = true
  507. hasAu4 = true
  508. }
  509. for (let k in data) {
  510. for (let i = 0; i < data[k].length; i++) {
  511. let item = data[k][i];
  512. item.hasAu3 = hasAu3
  513. }
  514. $("#flawTmpl").tmpl(data[k]).appendTo("#flaws .flaw-box");
  515. }
  516. showFlawList();
  517. $(".flaw-item .oper a").unbind("click").click(function () {
  518. const i = $(".flaw-item[code=" + global_activeTab + "]").index($(this).parents(".flaw-item"));
  519. const code = $(this).attr("code");
  520. const isEdit = $(this).is(".edit-flaw");
  521. // console.log("global_activeTab:", global_activeTab)
  522. //if(!hasAu)return
  523. if (isEdit && hasAu) {
  524. showModal('0', code, i); //编辑
  525. } else if (!isEdit && hasAu2) {
  526. if ($(this).is(".recover-flaw")) {
  527. showModal('3', code, i); //恢复
  528. } else {
  529. showModal('1', code, i); //删除
  530. }
  531. }
  532. })
  533. $(".edit-flaw").css({ "display": hasAu ? "inline" : "none" });
  534. $(".del-flaw").css({ "display": hasAu2 ? "inline" : "none" });
  535. $(".add-flaw").css({ "display": hasAu4 ? "inline" : "none" });
  536. $(".recover-flaw").css({ "display": hasAu2 ? "inline" : "none" });
  537. $(".flaw-item .title a[href]").unbind("click").click(function () {
  538. const id = $(this).attr("href");
  539. const anchors = $(this).attr("anchors").split(",");
  540. let ans = anchors.map((it) => {
  541. return "#anchor" + it;
  542. });
  543. $(".info-item .cont,.flaw-item,td").removeClass("active");
  544. $(ans.join(",")).addClass("active");
  545. $(this).parents(".flaw-item").addClass("active");
  546. });
  547. }
  548. //显示缺陷列表
  549. function showFlawList() {
  550. const hml = $(".flaw-item[code=" + global_activeTab + "]");
  551. if (hml.length) {
  552. hml.show();
  553. $("#flaws .empty").hide();
  554. } else {
  555. $("#flaws .empty").length ? $("#flaws .empty").show() : $("#emptyTmpl").tmpl().appendTo("#flaws .flaw-box");
  556. }
  557. showAppealDetailEvent();
  558. }
  559. //删除评分项
  560. function delScore(id, info, isRecover) {
  561. const text = isRecover ? "恢复" : "删除";
  562. const param = {
  563. 'behospitalCode': global_id,
  564. 'optResultAlgVO': {
  565. 'id': id
  566. },
  567. 'delStatus': isRecover ? 1 : 0
  568. };
  569. post(api.delScore, param).then(function (res) {
  570. if (res.data.code === '0') {
  571. $("#delModal").hide();
  572. updateFlaws(res.data.data);
  573. $("#anchor" + info.pageKeyList[0]).removeClass("active");
  574. $.alerModal({ "message": text + "成功", type: "tip", time: '1000', win: true });
  575. } else {
  576. $.alerModal({ "message": res.data.msg || (text + '失败,请重试~'), type: "tip", time: '1000', win: 'default' });
  577. }
  578. }).catch(() => {
  579. $.alerModal({ "message": text + '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  580. });
  581. }
  582. //修改评分项
  583. function editScore(info) {
  584. info.reviewer = info.exampleDate > info.gmtModified ? info.reviewer : info.linkman
  585. info.exampleDate = info.exampleDate > info.gmtModified ? info.exampleDate : info.gmtModified
  586. const param = {
  587. "behospitalCode": global_id,
  588. "optResultAlgVO": info
  589. };
  590. post(api.editScore, param).then(function (res) {
  591. if (res.data.code === '0') {
  592. $("#delModal").hide();
  593. updateFlaws(res.data.data);
  594. $.alerModal({ "message": "修改成功", type: "tip", time: '1000', win: true });
  595. } else {
  596. $.alerModal({ "message": '修改失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
  597. }
  598. }).catch(() => {
  599. $.alerModal({ "message": '修改失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
  600. });
  601. }
  602. //添加评分项
  603. function addScore(info) {
  604. const optResultAlgVO = {
  605. "casesEntryId": info.casesEntryId,
  606. "casesId": info.casesId,
  607. "casesScore": info.caseScore,
  608. "code": info.code || "",
  609. "id": info.id || "",
  610. "info": info.info || "",
  611. "isReject": info.isReject,
  612. "msg": info.msg || "",
  613. "score": info.score,
  614. "explainInfo": info.explainInfo,
  615. }
  616. const param = {
  617. "behospitalCode": global_id,
  618. "optResultAlgVO": optResultAlgVO
  619. };
  620. post(api.addScore, param).then(function (res) {
  621. if (res.data.code === '0') {
  622. $("#delModal").hide();
  623. updateFlaws(res.data.data);
  624. $.alerModal({ "message": "添加成功", type: "tip", win: true, time: '1000' });
  625. } else {
  626. $.alerModal({ "message": "添加失败,请重试~", type: "tip", win: 'default', time: '1000' });
  627. }
  628. }).catch(() => {
  629. $.alerModal({ "message": "添加失败,请重试~", type: "tip", win: 'default', time: '1000' });
  630. });
  631. }
  632. //显示删除/修改弹窗
  633. function showModal(flag, code, i, id, qcresultDetailId) {
  634. // console.log(flag);
  635. $("#delModal .modal-body").html("");
  636. $("#delModal").show();
  637. $("#delModal .cancel").text("关闭")
  638. $("#delModal .cancel").hide();
  639. $(".info-item .cont,.flaw-item .title,td").removeClass("active");
  640. //事件解绑
  641. $("#delModal .confirm").off("click");
  642. let flawsList
  643. if (data_type === 2) {
  644. flawsList = formatFlawKeys(global_flawData)
  645. } else {
  646. flawsList = formatFlawKeys(global_flawDataPay)
  647. }
  648. // console.log("flawsList:", flawsList)
  649. const info = flawsList[global_activeTab] && flawsList[global_activeTab][i];
  650. if (flag === '0') { //修改
  651. $("#delModal .confirm").show()
  652. $("#delModal .title").text("修改");
  653. $("#delModal .confirm").text("保存");
  654. $("#editTmpl").tmpl(info).appendTo("#delModal .modal-body");
  655. $("#qcScore,#qcMsg,#qcInfo").off("input");
  656. //分数输入验证
  657. $("#qcScore").on("input", function () {
  658. const val = $(this).val();
  659. if (/^[0-9]\d*$|^[0-9]\d*(.\d)?$/.test(val) && val <= 100) {
  660. $(".edit-box .warning").hide();
  661. } else {
  662. $(".edit-box .warning .red").text("支持≥0且≤100的数字输入,最多保留小数点后1位~");
  663. $(".edit-box .warning").show();
  664. }
  665. });
  666. //提示信息输入验证
  667. $("#qcMsg").on("input", function () {
  668. const val = $(this).val();
  669. $(this).attr("title", val)
  670. if (val.trim()) {
  671. $(".edit-box .warning").hide();
  672. } else {
  673. $(".edit-box .warning .red").text("提示信息不能为空~");
  674. $(".edit-box .warning").show();
  675. }
  676. });
  677. //提示信息输入验证
  678. $("#qcInfo").on("input", function () {
  679. const val = $(this).val();
  680. $(this).attr("title", val)
  681. if (val.length > 125) {
  682. $(".edit-box .warning .red").text("备注不能超过125个字~");
  683. $(".edit-box .warning").show();
  684. } else {
  685. $(".edit-box .warning").hide();
  686. return;
  687. }
  688. });
  689. if ($("#qcInfo").val().length > 125) {
  690. $(".edit-box .warning .red").text("备注不能超过125个字~");
  691. $(".edit-box .warning").show();
  692. return;
  693. }
  694. $("#delModal .confirm").unbind("click").click(function () {
  695. if ($(".edit-box .warning").is(":visible")) {
  696. return;
  697. }
  698. const obj = Object.assign({}, info, { explainInfo: $("#delModal #qcInfo").val(), msg: $("#delModal #qcMsg").val(), score: $("#delModal #qcScore").val() });
  699. editScore(obj);
  700. });
  701. } else if (flag === '5') { //查看
  702. $("#delModal .title").text("查看");
  703. $("#delModal .confirm").hide();
  704. $("#delModal .cancel").show();
  705. $("#delModal .modal-box").css("margin-top", '-245px');
  706. //0申诉1驳回2审核
  707. //新增项模板
  708. getAppealDetail(code, i, id, qcresultDetailId);
  709. } else if (flag === '2') { //新增
  710. $("#delModal .confirm").show();
  711. $("#delModal .title").text("新增");
  712. $("#delModal .confirm").text("保存");
  713. $("#addFlawTmpl").tmpl().appendTo("#delModal .modal-body");
  714. $("#flawDropTmpl").tmpl({ info: code }).appendTo("#delModal .modal-body ul");
  715. $("#addQcScore,#addQcMsg,#addQcInfo").off("input");
  716. //分数输入验证
  717. $("#addQcScore").on("input", function () {
  718. const val = $(this).val();
  719. if (/^[0-9]\d*$|^[0-9]\d*(.\d)?$/.test(val) && val <= 100) {
  720. $(".add-box .warning").hide();
  721. } else {
  722. $(".add-box .warning .red").text("支持≥0且≤100的数字输入,最多保留小数点后1位~");
  723. $(".add-box .warning").show();
  724. return;
  725. }
  726. });
  727. //提示信息输入验证
  728. $("#addQcMsg").on("input", function () {
  729. const val = $(this).val();
  730. $(this).attr("title", val)
  731. if (val.trim()) {
  732. $(".add-box .warning").hide();
  733. } else {
  734. $(".add-box .warning .red").text("提示信息不能为空~");
  735. $(".add-box .warning").show();
  736. return;
  737. }
  738. });
  739. //提示信息输入验证
  740. $("#addQcInfo").on("input", function () {
  741. const val = $(this).val();
  742. $(this).attr("title", val)
  743. if (val.length > 125) {
  744. $(".add-box .warning .red").text("备注不能超过125个字~");
  745. $(".add-box .warning").show();
  746. } else {
  747. $(".add-box .warning").hide();
  748. return;
  749. }
  750. });
  751. $("#delModal .confirm").unbind("click").click(function () {
  752. if (!$(".flaw-drop-input").attr("code")) {
  753. $(".add-box .warning .red").text("请选择质控条目~");
  754. $(".add-box .warning").show();
  755. return;
  756. }
  757. const msg = $("#delModal #addQcMsg").val();
  758. const score = Number($("#delModal #addQcScore").val());
  759. const explainInfo = $("#delModal #addQcInfo").val();
  760. if ($(".add-box .warning").is(":visible")) {
  761. return;
  762. }
  763. if (!msg.trim()) {
  764. $(".add-box .warning .red").text("提示信息不能为空~");
  765. $(".add-box .warning").show();
  766. return;
  767. }
  768. if ((!score) && $("#delModal #addQcScore").val() != '0') {
  769. $(".add-box .warning .red").text("分值不能为空~");
  770. $(".add-box .warning").show();
  771. return;
  772. }
  773. if ($("#addQcInfo").val().length > 125) {
  774. $(".add-box .warning .red").text("备注不能超过125个字~");
  775. $(".add-box .warning").show();
  776. return;
  777. }
  778. const obj = Object.assign({}, global_selectedFlaw, { msg, score, explainInfo });
  779. addScore(obj);
  780. });
  781. } else if (flag === '3') {
  782. $("#delModal .confirm").show();
  783. $("#delModal .title").text("恢复提示");
  784. $("#delModal .modal-body").html('<p>确定要恢复该评分记录吗?</p>');
  785. $("#delModal .confirm").text("取消").unbind("click").click(function () {
  786. $("#delModal").hide();
  787. });
  788. $("#delModal .cancel").show().text("恢复").unbind("click").click(function () {
  789. delScore(code, info, true);
  790. });
  791. } else {
  792. $("#delModal .confirm").show();
  793. $("#delModal .title").text("删除提示");
  794. $("#delModal .modal-body").html('<p>确定要删除该评分记录吗?</p>');
  795. $("#delModal .confirm").text("取消").unbind("click").click(function () {
  796. $("#delModal").hide();
  797. });
  798. $("#delModal .cancel").show().text("删除").unbind("click").click(function () {
  799. // console.log(123);
  800. delScore(code, info);
  801. });
  802. }
  803. }
  804. function getAppealDetail(id, flg, casesEntryId, qcresultDetailId) {
  805. const param = {
  806. behospitalCode: global_id,
  807. casesEntryId: casesEntryId,
  808. hospitalId: global_hid,
  809. qcresultDetailId: qcresultDetailId,
  810. id: +id
  811. };
  812. post(api.getApprovedView, param).then((res) => {
  813. const info = res.data.data || {};
  814. const appealInfo = info.appealExamineRecordDTOList;
  815. $("#appealStatusTmpl").tmpl(appealInfo).appendTo("#delModal .modal-body");
  816. $("#delModal .cancel").text("关闭").unbind("click").click(function () {
  817. $("#delModal").hide();
  818. });
  819. /*if (flg === '1') {
  820. $(".check-item").hide();
  821. $(".reject-item").show();
  822. } else if (flg === '2') {
  823. $(".check-item").show();
  824. }*/
  825. })
  826. }
  827. //缺陷列表key值去掉特殊符号
  828. function formatFlawKeys(data) {
  829. const obj = {};
  830. for (let k in data) {
  831. obj[k.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '')] = data[k];
  832. }
  833. return obj;
  834. }
  835. //获取缺陷条目下拉列表
  836. function getQcCasesEntry(name) {
  837. const id = $("#subMenu [code=" + global_activeTab + "]").attr("mode");
  838. const param = {
  839. 'behospitalCode': global_id,
  840. 'entryName': name || "",
  841. 'modeId': id
  842. };
  843. post(api.findQcCasesEntry, param).then(function (res) {
  844. if (res.data.code === '0') {
  845. const data = res.data.data;
  846. if (name) {
  847. global_flaws = data;
  848. $("#delModal .modal-body ul").html("");
  849. $("#flawDropTmpl").tmpl({ info: data }).appendTo("#delModal .modal-body ul");
  850. } else {
  851. global_flaws = data;
  852. if ($("#delModal").css("display") == "block") {
  853. $("#flawDropTmpl").tmpl({ info: data }).appendTo("#delModal .modal-body ul");
  854. return
  855. }
  856. showModal('2', data);
  857. }
  858. }
  859. });
  860. }
  861. //增加条目弹窗元素事件
  862. $("body").on("click", ".add-box .flaw-drop-input", function () {
  863. $(".add-box .drop-box").addClass("show");
  864. });
  865. $("body").on("blur", ".add-box .flaw-drop-input", function () {
  866. setTimeout(function () {
  867. $(".add-box .drop-box").removeClass("show");
  868. }, 300)
  869. });
  870. $("body").on("input", ".add-box .flaw-drop-input", function () {
  871. $(this).attr({ "code": "", "title": $(this).val().trim() });
  872. getQcCasesEntry($(this).val().trim());
  873. });
  874. $("body").on("click", ".add-box .drop-box li", function () {
  875. const n = $(this).attr("idx");
  876. const flaw = global_flaws[n];
  877. const { score, msg, entryName, casesEntryId } = flaw;
  878. global_selectedFlaw = flaw;
  879. global_entryName = entryName
  880. global_casesEntryId = casesEntryId
  881. $(".flaw-drop-input").val(entryName).attr({ "code": casesEntryId, "title": entryName });
  882. $("#addQcMsg").val(msg).attr("title", msg);
  883. $("#addQcScore").val(score);
  884. $(".add-box .warning").hide();
  885. $(".add-box .drop-box").removeClass("show");
  886. // console.log(123);
  887. });
  888. $(document).on("blur", ".flaw-drop-input", (e) => {
  889. $('.flaw-drop-input').val(global_entryName).attr({ "code": global_casesEntryId, "title": global_entryName });
  890. });
  891. //更新缺陷列表
  892. function updateFlaws(info) {
  893. $("#patientInfo .level").text("质控等级:" + info.level);
  894. $("#patientInfo .score").text("质控得分:" + info.scoreRes);
  895. const param = {
  896. 'behospitalCode': global_id,
  897. 'paramStr': [
  898. "msg"
  899. ]
  900. };
  901. post(api.getRecordDetail, param).then(function (res) {
  902. if (res.data.code === '0') {
  903. const data = res.data.data;
  904. const { msg, drgs } = data;
  905. initScoreItem(msg);
  906. global_flawData = msg;
  907. global_flawDataPay = drgs
  908. // console.log("data:", data)
  909. // 单独刷新缺陷总览页面的数据
  910. if (data_type === 1) {
  911. // 控费缺陷
  912. formatSpecPage(drgs, "缺陷总览", 1);
  913. } else {
  914. // 缺陷总览
  915. formatSpecPage(msg, "缺陷总览", 2);
  916. }
  917. }
  918. });
  919. }
  920. //获取病例模板
  921. function getInfoModule(moduleId) {
  922. const param = {
  923. moduleId: moduleId
  924. };
  925. post(api.getInfoModule, param).then(function (res) {
  926. if (res.data.code === '0') {
  927. const data = res.data.data;
  928. cachemoduleDatas(data);
  929. getRecordDetail();
  930. }
  931. });
  932. }
  933. //模板数据缓存
  934. function cachemoduleDatas(data) {
  935. const moudle = data.moduleDetail;
  936. global_modules[data.modeName] = [];
  937. for (let i in moudle) {
  938. global_modules[data.modeName].push(moudle[i]);
  939. }
  940. }
  941. //初始化模板
  942. function initModuleData(mid, obj) {
  943. const n = obj.length;
  944. const module = global_modules[mid].moduleDetail;
  945. const key = global_modules[mid].modeName.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '');
  946. let hml = '<div class="content-item" code="' + key + '">' +
  947. '<h2 class="title">' + '<button class="save">编辑</button>' + global_modules[mid].modeName + '(' + mid + ')</h2>' +
  948. (n > 1 ? '<div class="container">' : '<div class="container content-hts">');
  949. for (let i in module) {
  950. hml = hml + '<div class="info-item">';
  951. for (let j = 0; j < module[i].length; j++) {
  952. const detal = module[i][j].questionDTO;
  953. const { tagType } = detal;
  954. switch (tagType) {
  955. case 1:
  956. hml = hml + simpleStructure(detal, obj);
  957. break;
  958. case 4:
  959. hml = hml + combineStructure(detal);
  960. break;
  961. default:
  962. break;
  963. }
  964. }
  965. hml = hml + "</div>"
  966. }
  967. return hml + "</div></div>";
  968. }
  969. //基础类型结构生成
  970. function simpleStructure(data, obj) {
  971. const { name, val, monoLine, addLine, position, bold, retract, id } = data;
  972. if (name === "手术记录表格-1") {
  973. const value = val.replace("【", "").replace("】", "");
  974. const diag = obj[0][value] ? JSON.parse(obj[0][value]) : "";
  975. let thml = `<div class="cont" style="width: 100%;" id="anchor${id}">`;
  976. thml += $("#tableTmpl").tmpl({ k: "手术信息", data: diag })[0].outerHTML + "</div>";
  977. return thml;
  978. }
  979. if (name === "出院诊断表格-1") {
  980. const value = val.replace("【", "").replace("】", "");
  981. const diag = obj[0][value] ? JSON.parse(obj[0][value]) : "";
  982. let thml = `<div class="cont" style="width: 100%;" id="anchor${id}">`;
  983. thml += $("#tableTmpl").tmpl({ k: "出院诊断", data: diag })[0].outerHTML + "</div>";
  984. return thml;
  985. }
  986. const posClass = position === 1 ? 'text-left' : '';
  987. const boldClass = bold === 1 ? 'text-bold' : '';
  988. const retractClass = retract === 1 ? 'text-indent' : '';
  989. // const lineHml = ('<p class="' + posClass + ' ' + boldClass + ' ' + retractClass + '">' + extractVars(val) + '</p>');
  990. // const txtHml = ('<p style="display: inline;vertical-align: middle;" class="' + posClass + ' ' + boldClass + ' ' + retractClass + '">' + extractVars(val) + '</p>');
  991. const lineHml = ('<p class="' + posClass + ' ' + boldClass + ' ' + retractClass + '" contenteditable="false">' + extractVars(val) + '</p >');
  992. const txtHml = ('<p style="display: inline;vertical-align: middle;" class="' + posClass + ' ' + boldClass + ' ' + retractClass + '" contenteditable="false">' + extractVars(val) + '</p >');
  993. let hml = addLine || monoLine ? `<div class="cont ${posClass}" style="width: 100%;" id="anchor${id}">` : `<div class="cont" id="anchor${id}">`;
  994. hml = hml + `<span class="label">${name}</span>` + (addLine ? lineHml : txtHml) + `</div>`;
  995. return hml;
  996. }
  997. //组合类型结构生成
  998. function combineStructure(data) {
  999. const { name, questionMapping, id } = data;
  1000. let hml = '<div class="inner-table"><table>';
  1001. const colNum = Math.ceil(questionMapping.length / 2);
  1002. let tdVal = '';
  1003. const regexp = /(【(.+?)】)/g;
  1004. for (let i = 0; i < questionMapping.length;) {
  1005. if (questionMapping[i + 1]) {
  1006. tdVal = "<td id='anchor" + questionMapping[i].id + "' contenteditable='true'>" + questionMapping[i].name + extractVars(questionMapping[i].val) + "</td><td id='anchor" + questionMapping[i + 1].id + "' contenteditable='true'>" + questionMapping[i + 1].name + extractVars(questionMapping[i + 1].val) + "</td>";
  1007. } else {
  1008. tdVal = "<td id='anchor" + questionMapping[i].id + "' contenteditable='true'>" + questionMapping[i].name + extractVars(questionMapping[i].val) + "</td><td contenteditable='true'></td>";
  1009. }
  1010. if (i == 0) {
  1011. hml = hml + `<tr><td rowspan="${colNum}" id='anchor${id}' contenteditable='true'>${name}</td>${tdVal}`;
  1012. } else {
  1013. hml = hml + `<tr>${tdVal}`;
  1014. }
  1015. hml = hml + "</tr>";
  1016. i = ((i + 2) > questionMapping.length ? i + 1 : i + 2)
  1017. }
  1018. hml = hml + "</table></div>";
  1019. return hml;
  1020. }
  1021. //抽取变量
  1022. function extractVars(org) {
  1023. const regexp = /(【(.+?)】)/g;
  1024. const arr = org.split(regexp);
  1025. //console.log(arr)
  1026. let htl = '', val = '';
  1027. for (let i = 0; i < arr.length; i++) {
  1028. val = arr[i].indexOf("【") != -1 ? '' : (arr[i - 1] && arr[i - 1].indexOf("【") != -1 ? "{{html " + arr[i] + "}}" : arr[i]);
  1029. htl = htl + val;
  1030. }
  1031. return htl;
  1032. }
  1033. //获取所有模板
  1034. function getAllModules() {
  1035. const param = {
  1036. hospitalId: getUrlArgObject("hid"),
  1037. modeId: ''
  1038. };
  1039. post(api.getModuleById, param).then((res) => {
  1040. if (res.data.code === '0') {
  1041. const data = res.data.data;
  1042. global_modules = data;
  1043. getRecordDetail();
  1044. $("#loading").hide();
  1045. /*setTimeout(function(){
  1046. $(".operation").show()
  1047. },50)*/
  1048. }
  1049. });
  1050. }
  1051. /*function checkQc(){
  1052. const param={
  1053. behospitalCode:getUrlArgObject("id"),
  1054. hospitalId:getUrlArgObject("hid"),
  1055. checkType: global_activeTab == '病案首页'?'1':'0'
  1056. };
  1057. post(api.checkQc,param).then((res)=>{
  1058. if(res.data.code==='0') {
  1059. if(global_activeTab == '病案首页'){
  1060. global_check_home = 1
  1061. }else{
  1062. global_check = 1
  1063. }
  1064. $(".check").text("重新核查")
  1065. $.alerModal({"message":"核查成功",type:"tip",time:'1000',win:true});
  1066. }else{
  1067. $.alerModal({"message":res.data.msg ||"核查失败",type:"tip",time:'1000',isFather: false});
  1068. }
  1069. });
  1070. }*/
  1071. function checkYwQc() {
  1072. const param = {
  1073. behospitalCode: getUrlArgObject("id"),
  1074. hospitalId: getUrlArgObject("hid"),
  1075. };
  1076. post(ywCheckApi.recordCheck, param).then((res) => {
  1077. if (res.data.code === '0') {
  1078. global_check = 1
  1079. $(".ywCheck").text("重新核查")
  1080. $.alerModal({ "message": "核查成功", type: "tip", time: '1000', win: true });
  1081. } else {
  1082. $.alerModal({ "message": res.data.msg || "核查失败", type: "tip", time: '1000', isFather: false });
  1083. }
  1084. });
  1085. }
  1086. var isEditing = false;
  1087. // $().attr('contenteditable', isEditing);
  1088. $("body").on("click", ".save", function () {
  1089. isEditing = !isEditing; // 切换状态
  1090. if (isEditing) {
  1091. console.log("编辑中");
  1092. $(this).text('保存');
  1093. // $('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td').off("input")
  1094. } else {
  1095. let state = saveOrUpdate()
  1096. if (state === true) {
  1097. console.log("保存成功");
  1098. } else {
  1099. console.log("保存失败");
  1100. }
  1101. $(this).text('编辑');
  1102. }
  1103. $('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td').attr('contenteditable', isEditing);
  1104. });
  1105. function saveOrUpdate() {
  1106. /**病案首页编号*/
  1107. const homePageId = $('.patient-info span').eq(0).text().match(/\d+/)[0]
  1108. /**医院ID*/
  1109. const hospitalId = getUrlArgObject("hid")
  1110. /**病人住院ID*/
  1111. const behospitalCode = getUrlArgObject("id")
  1112. /**组织机构代码*/
  1113. const hospitalCode = ""
  1114. /**医疗机构名称*/
  1115. const hospitalName = ""
  1116. /**医疗机构代码*/
  1117. const orgCode = ""
  1118. /**医疗付费方式*/
  1119. const payType = ""
  1120. /**健康卡号*/
  1121. const healthCard = ""
  1122. /**住院次数*/
  1123. const behospitalNum = ""
  1124. /**病案号*/
  1125. const fileCode = ""
  1126. /**病人姓名*/
  1127. const name = $('#anchor2242 p').text()
  1128. /**病人性别*/
  1129. const sex = $('#anchor22322 p').text()
  1130. /**病人出生日期*/
  1131. const birthday = $('#anchor22323 p').text()
  1132. /**病人年龄*/
  1133. const age = $('#anchor22325 p').text().replace("岁", "")
  1134. /**年龄单位*/
  1135. const ageUnit = "岁"
  1136. /**国籍*/
  1137. const nationality = $('#anchor22324 p').text()
  1138. /**新生儿出生月数*/
  1139. const newbornMonth = ""
  1140. /**新生儿出生天数*/
  1141. const newbornDay = ""
  1142. /**新生儿出生体重*/
  1143. const newbornWeight = $('#anchor2244 p').text().replace("克", "")
  1144. /**新生儿入院体重*/
  1145. const newbornBehospitalWeight = $('#anchor2245 p').text().replace("克", "")
  1146. /**出生地*/
  1147. const bornAddress = $('#anchor2246 p').text()
  1148. /**籍贯*/
  1149. const bornPlace = $('#anchor2247 p').text()
  1150. /**民族*/
  1151. const nation = $('#anchor2248 p').text()
  1152. /**身份证号*/
  1153. const identityCardNo = $('#anchor2249 p').text()
  1154. /**职业*/
  1155. const jobType = $('#anchor2250 p').text()
  1156. /**婚姻状态*/
  1157. const marriage = $('#anchor2251 p').text()
  1158. /**现住址*/
  1159. const curAddress = $('#anchor2252 p').text()
  1160. /**现住址电话*/
  1161. const curPhone = $('#anchor22328 p').text()
  1162. /**现住址邮编*/
  1163. const curPostCode = $('#anchor22329 p').text()
  1164. /**户口地址*/
  1165. const residenceAddress = $('#anchor2253 p').text()
  1166. /**户口地址邮编*/
  1167. const residencePostCode = $('#anchor2254 p').text()
  1168. /**工作单位*/
  1169. const workAddress = $('#anchor2255 p').text()
  1170. /**工作单位电话*/
  1171. const workPhone = $('#anchor22326 p').text()
  1172. /**工作单位邮编*/
  1173. const workPostCode = $('#anchor22327 p').text()
  1174. /**联系人姓名*/
  1175. const contactName = $('#anchor2256 p').text()
  1176. /**联系人关系*/
  1177. const contactRelation = $('#anchor22330 p').text()
  1178. /**联系人地址*/
  1179. const contactAddress = $('#anchor22331 p').text()
  1180. /**联系人电话*/
  1181. const contactPhone = $('#anchor22332 p').text()
  1182. /**入院途径*/
  1183. const behospitalWay = $('#anchor2257 p').text()
  1184. /**入院时间*/
  1185. const behospitalDate = $('#anchor2258 p').text()
  1186. /**入院科别*/
  1187. const behospitalDept = $('#anchor22333 p').text()
  1188. /**入院病房*/
  1189. const behospitalWard = $('#anchor22334 p').text()
  1190. /**入院床位序号*/
  1191. const behospitalBedId = ""
  1192. /**入院床位号码*/
  1193. const behospitalBedCode = ""
  1194. /**转科科别*/
  1195. const changeDept = $('#anchor22335 p').text()
  1196. /**出院时间*/
  1197. const leaveHospitalDate = $('#anchor2259 p').text()
  1198. /**出院科别*/
  1199. const leaveHospitalDept = $('#anchor22336 p').text()
  1200. /**出院病房*/
  1201. const leaveHospitalWard = $('#anchor22337 p').text()
  1202. /**出院床位序号*/
  1203. const leaveHospitalBedId = ""
  1204. /**出院床位号码*/
  1205. const leaveHospitalBedCode = ""
  1206. /**实际住院天数*/
  1207. const behospitalDayNum = $('#anchor22338 p').text()
  1208. /**门急诊诊断*/
  1209. const outpatientEmrDiagnose = $('#anchor2260 p').text()
  1210. /**门急诊诊断编码*/
  1211. const outpatientEmrDiagnoseCode = $('#anchor2261 p').text()
  1212. /**损伤中毒因素*/
  1213. const poisonFactor = $('#anchor2263 p').text()
  1214. /**损伤中毒因素编码*/
  1215. const poisonFactorCode = $('#anchor2264 p').text()
  1216. /**病理诊断*/
  1217. const pathologyDiagnose = $('#anchor2265 p').text()
  1218. /**病理诊断编码*/
  1219. const pathologyDiagnoseCode = $('#anchor2266 p').text()
  1220. /**病理诊断编号*/
  1221. const pathologyDiagnoseId = $('#anchor2267 p').text()
  1222. /**有无药物过敏*/
  1223. const isMedAllergy = $('#anchor2268 p').text();
  1224. /** 过敏药物 */
  1225. const medAllergyName = $('#anchor2269 p').text();
  1226. /** 死亡患者尸检 */
  1227. const autopsy = $('#anchor2270 p').text();
  1228. /** 血型 */
  1229. const bloodType = $('#anchor2271 p').text();
  1230. /** Rh */
  1231. const rh = $('#anchor2272 p').text();
  1232. /** 科主任 */
  1233. const deptDirector = $('#anchor2273 p').text();
  1234. /** 主任医师 */
  1235. const directorDoctor = $('#anchor2274 p').text();
  1236. /** 主治医师 */
  1237. const attendingDoctor = $('#anchor2275 p').text();
  1238. /** 住院医师 */
  1239. const behospitalDoctor = $('#anchor2276 p').text();
  1240. /** 责任护士 */
  1241. const responseNurse = $('#anchor2277 p').text();
  1242. /** 进修医师 */
  1243. const studyDoctor = $('#anchor2278 p').text();
  1244. /** 实习医师 */
  1245. const practiceDoctor = $('#anchor2279 p').text();
  1246. /** 编码员 */
  1247. const encodeMan = $('#anchor2280 p').text() || "无";
  1248. /** 病案质量 */
  1249. const homePageQuality = $('#anchor2281 p').text();
  1250. /** 质控医师 */
  1251. const qcDoctor = $('#anchor2282 p').text();
  1252. /** 质控护士 */
  1253. const qcNurse = $('#anchor2283 p').text();
  1254. /** 质控日期 */
  1255. const qcDate = $('#anchor2284 p').text();
  1256. /** 离院方式 */
  1257. const leaveHospitalType = $('#anchor2286 p').text();
  1258. /** 接收机构名称 */
  1259. const acceptOrgCode = $('#anchor2287 p').text();
  1260. /** 31天内再住院计划 */
  1261. const againBehospitalPlan = $('#anchor2288 p').text();
  1262. /** 再住院目的 */
  1263. const againBehospitalGoal = $('#anchor2289 p').text();
  1264. /** 颅脑损伤患者昏迷前天数 */
  1265. const tbiBeforeDay = '';
  1266. /** 颅脑损伤患者昏迷前小时 */
  1267. const tbiBeforeHour = '';
  1268. /** 颅脑损伤患者昏迷前分钟 */
  1269. const tbiBeforeMinute = '';
  1270. /** 颅脑损伤患者昏迷后天数 */
  1271. const tbiAfterDay = '';
  1272. /** 颅脑损伤患者昏迷后小时 */
  1273. const tbiAfterHour = '';
  1274. /** 颅脑损伤患者昏迷后分钟 */
  1275. const tbiAfterMinute = '';
  1276. /** 总费用 */
  1277. const totalFee = $('#anchor2291 p').text().match(/总费用(\d+\.?\d+)/)[1] || '';
  1278. /** 自付金额 */
  1279. const ownFee = $('#anchor2291 p').text().match(/自付金额(\d+\.?\d+)/)[1] || '';
  1280. /** 一般医疗服务费 */
  1281. const generalFee = $('#anchor2292 p').text().match(/一般医疗服务费:(\d+\.?\d+)/)[1] || '';
  1282. const str_anchor2292 = $('#anchor2292 p').text()
  1283. const matchs_anchor2292 = str_anchor2292.match(/一般治疗服务费:(\d+\.?\d+)/)
  1284. /** 一般治疗服务费 */
  1285. const serviceFee = matchs_anchor2292 ? matchs_anchor2292[1] : "";
  1286. /** 护理费 */
  1287. const nurseFee = $('#anchor2292 p').text().match(/护理费:(\d+\.?\d+)/)[1] || '';
  1288. /** 其他费用 */
  1289. const otherFee = $('#anchor2292 p').text().match(/其他费用:(\d+\.?\d+)/)[1] || '';
  1290. /** 病理诊断费 */
  1291. const pathologyFee = $('#anchor2293 p').text().match(/病理诊断费:(\d+\.?\d+)/)[1] || '';
  1292. /** 实验室诊断费 */
  1293. const labFee = $('#anchor2293 p').text().match(/实验室诊断费:(\d+\.?\d+)/)[1] || '';
  1294. /** 影像学诊断费 */
  1295. const pacsFee = $('#anchor2293 p').text().match(/影像学诊断费:(\d+\.?\d+)/)[1] || '';
  1296. /** 临床诊断项目费 */
  1297. const clinicDiagnoseFee = $('#anchor2293 p').text().match(/临床诊断项目费:(\d+\.?\d+)/)[1] || '';
  1298. /** 非手术治疗项目费 */
  1299. const notOperationFee = $('#anchor2294 p').text().match(/非手术治疗项目费:(\d+\.?\d+)/)[1] || '';
  1300. /** 临床物理治疗费 */
  1301. const clinicPhysicFee = $('#anchor2294 p').text().match(/临床物理治疗费:(\d+\.?\d+)/)[1] || '';
  1302. /** 手术治疗费 */
  1303. const operationTreatFee = $('#anchor2294 p').text().match(/临床物理治疗费:(\d+\.?\d+)/)[1] || '';
  1304. /** 麻醉费 */
  1305. const anaesthesiaFee = $('#anchor2294 p').text().match(/麻醉费:(\d+\.?\d+)/)[1] || '';
  1306. /** 手术费 */
  1307. const operationFee = $('#anchor2294 p').text().match(/手术费:(\d+\.?\d+)/)[1] || '';
  1308. let matchs_anchor2295 = $('#anchor2295 p').text().match(/康复费:(\d+\.?\d+)/)
  1309. /** 康复类 */
  1310. const healthTypeFee = matchs_anchor2295 ? matchs_anchor2295[1] : '';
  1311. /** 中医治疗费 */
  1312. const chnTreatFee = $('#anchor2296 p').text().match(/中医治疗费:(\d+\.?\d+)/)[1] || '';
  1313. /** 西药费 */
  1314. const westernMedFee = $('#anchor2297 p').text().match(/西药费:(\d+\.?\d+)/)[1] || '';
  1315. /** 抗菌药物费用 */
  1316. const antibiosisFee = $('#anchor2297 p').text().match(/抗菌药物费用:(\d+\.?\d+)/)[1] || '';
  1317. /** 中成药费 */
  1318. const chnMedFee = $('#anchor2298 p').text().match(/中成药费:(\d+\.?\d+)/)[1] || '';
  1319. /** 中草药费 */
  1320. const chnHerbFee = $('#anchor2298 p').text().match(/中草药费:(\d+\.?\d+)/)[1] || '';
  1321. /** 血费 */
  1322. const bloodFee = $('#anchor2299 p').text().match(/血费:(\d+\.?\d+)/)[1] || '';
  1323. /** 白蛋白类制品费 */
  1324. const albumenFee = $('#anchor2299 p').text().match(/白蛋白类制品费:(\d+\.?\d+)/)[1] || '';
  1325. /** 球蛋白类制品费 */
  1326. const globulinFee = $('#anchor2299 p').text().match(/球蛋白类制品费:(\d+\.?\d+)/)[1] || '';
  1327. /** 凝血因子类制品费 */
  1328. const bloodFactorFee = $('#anchor2299 p').text().match(/凝血因子类制品费:(\d+\.?\d+)/)[1] || '';
  1329. /** 细胞因子类制品费 */
  1330. const cellFactorFee = $('#anchor2299 p').text().match(/细胞因子类制品费:(\d+\.?\d+)/)[1] || '';
  1331. //耗材类
  1332. let str_anchor2300 = $('#anchor2300 p').text()
  1333. let matchs_anchor2300_1 = str_anchor2300.match(/检查用一次性医用耗材费:(\d+\.?\d+)/)
  1334. let matchs_anchor2300_2 = str_anchor2300.match(/治疗用一次性医用耗材费:(\d+\.?\d+)/)
  1335. let matchs_anchor2300_3 = str_anchor2300.match(/手术用一次性医用耗材费:(\d+\.?\d+)/)
  1336. /** 检查用一次性医用材料费 */
  1337. const checkMaterialFee = matchs_anchor2300_1 ? matchs_anchor2300_1[1] : "";
  1338. /** 治疗用一次性医用材料费 */
  1339. const treatMaterialFee = matchs_anchor2300_2 ? matchs_anchor2300_2[1] : '';
  1340. /** 手术用一次性医用材料费 */
  1341. const operationMaterialFee = matchs_anchor2300_3 ? matchs_anchor2300_3[1] : '';
  1342. /** 其他类其他费 */
  1343. const otherTypeFee = $('#anchor2301 p').text().match(/其他费:(\d+\.?\d+)/)[1] || '';
  1344. /** 单病种管理 */
  1345. const singleDiagManage = $('#anchor2302 p').text();
  1346. /** 临床路径管理 */
  1347. const clinicPathwayManage = $('#anchor2303 p').text();
  1348. /**诊断符合情况*/
  1349. const str_anchor2304 = $('#anchor2304 p').text()
  1350. const split_anchor2304 = str_anchor2304.split(/\d+\./g);
  1351. const results_anchor2304 = {}
  1352. split_anchor2304.forEach(el => {
  1353. if (el) {
  1354. const [item, status] = el.split(':');
  1355. results_anchor2304[item.trim()] = status.trim();
  1356. }
  1357. });
  1358. /** 门诊与住院 */
  1359. const isOutpatientBehospital = results_anchor2304["门诊与出院"] || "";
  1360. /** 入院与出院 */
  1361. const isLeaveBehospital = results_anchor2304["入院与出院"] || "";
  1362. /** 术前与术后 */
  1363. const isOperationBeforeAfter = results_anchor2304["术前与术后"] || "";
  1364. /** 临床与病理 */
  1365. const isClinicPathology = results_anchor2304["临床与病理"] || "";
  1366. /** 放射与病理 */
  1367. const isRadiatePathology = results_anchor2304["放射与病理"] || "";
  1368. let matchs_nchor2305 = $('#anchor2305 p').text().match(/\d+/g)
  1369. /** 病人抢救次数 */
  1370. const rescueNum = matchs_nchor2305 ? matchs_nchor2305[0] : "0";
  1371. /** 病人抢救成功次数 */
  1372. const rescueSuccessNum = matchs_nchor2305 ? matchs_nchor2305[1] : "0";
  1373. /** 是否为自动出院 */
  1374. const isAutoLeavehospital = '';
  1375. /** 转归情况 */
  1376. const returnToType = $('#anchor2306 p').text();
  1377. /** 住院期间身体约束 */
  1378. const isPhysicalRestraint = $('#anchor2594 p').text();
  1379. /** 颅脑损伤患者昏迷时间(入院前) */
  1380. const tbiBehospitalBeforeTime = $('#anchor2582 p').text();
  1381. /** 颅脑损伤患者昏迷时间(入院后) */
  1382. const tbiBehospitalAfterTime = $('#anchor2583 p').text();
  1383. /** 住院期间是否发生跌倒或坠床 */
  1384. const isFallBed = $('#anchor2593 p').text();
  1385. /** 医院感染 */
  1386. const isNosocomialInfection = $('#anchor2589 p').text();
  1387. /** 入住ICU情况 */
  1388. const isIntoIcu = $('#anchor2586 p').text();
  1389. /** 并发症情况 */
  1390. const isComplications = $('#anchor2588 p').text();
  1391. /** 是否发生压疮 */
  1392. const isPressureSore = $('#anchor2591 p').text();
  1393. /** 是否住院期间发生压疮 */
  1394. const isBehospitalPressureSore = $('#anchor2592 p').text();
  1395. /** 非计划再次手术 */
  1396. const isUnplannedReoperation = $('#anchor2587 p').text();
  1397. /** 治疗结果 */
  1398. const treatmentResults = '';
  1399. /** 并发症 */
  1400. const complicationsResults = $('#anchor2588 p').text();
  1401. /** 感染部位 */
  1402. const infectionSite = '';
  1403. /** 住院期间有无告病危 */
  1404. const isBeInDanger = $('#anchor2585 p').text();
  1405. /** 出院诊断 */
  1406. const leaveDiags = addLeaveDiags()
  1407. /** 住院手术 */
  1408. const operations = addoperations()
  1409. let param = {
  1410. "dockModeType": "3",
  1411. "homePages": [
  1412. {
  1413. "homePageId": homePageId,
  1414. "hospitalId": hospitalId,
  1415. "behospitalCode": behospitalCode,
  1416. "hospitalCode": hospitalCode,
  1417. "hospitalName": hospitalName,
  1418. "orgCode": orgCode,
  1419. "payType": payType,
  1420. "healthCard": healthCard,
  1421. "behospitalNum": behospitalNum,
  1422. "fileCode": fileCode,
  1423. "name": name,
  1424. "sex": sex,
  1425. "birthday": birthday,
  1426. "age": age,
  1427. "ageUnit": ageUnit,
  1428. "nationality": nationality,
  1429. "newbornMonth": newbornMonth,
  1430. "newbornDay": newbornDay,
  1431. "newbornWeight": newbornWeight,
  1432. "newbornBehospitalWeight": newbornBehospitalWeight,
  1433. "bornAddress": bornAddress,
  1434. "bornPlace": bornPlace,
  1435. "nation": nation,
  1436. "identityCardNo": identityCardNo,
  1437. "jobType": jobType,
  1438. "marriage": marriage,
  1439. "curAddress": curAddress,
  1440. "curPhone": curPhone,
  1441. "curPostCode": curPostCode,
  1442. "residenceAddress": residenceAddress,
  1443. "residencePostCode": residencePostCode,
  1444. "workAddress": workAddress,
  1445. "workPhone": workPhone,
  1446. "workPostCode": workPostCode,
  1447. "contactName": contactName,
  1448. "contactRelation": contactRelation,
  1449. "contactAddress": contactAddress,
  1450. "contactPhone": contactPhone,
  1451. "behospitalWay": behospitalWay,
  1452. "behospitalDate": behospitalDate,
  1453. "behospitalDept": behospitalDept,
  1454. "behospitalWard": behospitalWard,
  1455. "behospitalBedId": behospitalBedId,
  1456. "behospitalBedCode": behospitalBedCode,
  1457. "changeDept": changeDept,
  1458. "leaveHospitalDate": leaveHospitalDate,
  1459. "leaveHospitalDept": leaveHospitalDept,
  1460. "leaveHospitalWard": leaveHospitalWard,
  1461. "leaveHospitalBedId": leaveHospitalBedId,
  1462. "leaveHospitalBedCode": leaveHospitalBedCode,
  1463. "behospitalDayNum": behospitalDayNum,
  1464. "outpatientEmrDiagnose": outpatientEmrDiagnose,
  1465. "outpatientEmrDiagnoseCode": outpatientEmrDiagnoseCode,
  1466. "poisonFactor": poisonFactor,
  1467. "poisonFactorCode": poisonFactorCode,
  1468. "pathologyDiagnose": pathologyDiagnose,
  1469. "pathologyDiagnoseCode": pathologyDiagnoseCode,
  1470. "pathologyDiagnoseId": pathologyDiagnoseId,
  1471. "isMedAllergy": isMedAllergy,
  1472. "medAllergyName": medAllergyName,
  1473. "autopsy": autopsy,
  1474. "bloodType": bloodType,
  1475. "rh": rh,
  1476. "deptDirector": deptDirector,
  1477. "directorDoctor": directorDoctor,
  1478. "attendingDoctor": attendingDoctor,
  1479. "behospitalDoctor": behospitalDoctor,
  1480. "responseNurse": responseNurse,
  1481. "studyDoctor": studyDoctor,
  1482. "practiceDoctor": practiceDoctor,
  1483. "encodeMan": encodeMan,
  1484. "homePageQuality": homePageQuality,
  1485. "qcDoctor": qcDoctor,
  1486. "qcNurse": qcNurse,
  1487. "qcDate": qcDate,
  1488. "leaveHospitalType": leaveHospitalType,
  1489. "acceptOrgCode": acceptOrgCode,
  1490. "againBehospitalPlan": againBehospitalPlan,
  1491. "againBehospitalGoal": againBehospitalGoal,
  1492. "tbiBeforeDay": tbiBeforeDay,
  1493. "tbiBeforeHour": tbiBeforeHour,
  1494. "tbiBeforeMinute": tbiBeforeMinute,
  1495. "tbiAfterDay": tbiAfterDay,
  1496. "tbiAfterHour": tbiAfterHour,
  1497. "tbiAfterMinute": tbiAfterMinute,
  1498. "totalFee": totalFee,
  1499. "ownFee": ownFee,
  1500. "generalFee": generalFee,
  1501. "serviceFee": serviceFee,
  1502. "nurseFee": nurseFee,
  1503. "otherFee": otherFee,
  1504. "pathologyFee": pathologyFee,
  1505. "labFee": labFee,
  1506. "pacsFee": pacsFee,
  1507. "clinicDiagnoseFee": clinicDiagnoseFee,
  1508. "notOperationFee": notOperationFee,
  1509. "clinicPhysicFee": clinicPhysicFee,
  1510. "operationTreatFee": operationTreatFee,
  1511. "anaesthesiaFee": anaesthesiaFee,
  1512. "operationFee": operationFee,
  1513. "healthTypeFee": healthTypeFee,
  1514. "chnTreatFee": chnTreatFee,
  1515. "westernMedFee": westernMedFee,
  1516. "antibiosisFee": antibiosisFee,
  1517. "chnMedFee": chnMedFee,
  1518. "chnHerbFee": chnHerbFee,
  1519. "bloodFee": bloodFee,
  1520. "albumenFee": albumenFee,
  1521. "globulinFee": globulinFee,
  1522. "bloodFactorFee": bloodFactorFee,
  1523. "cellFactorFee": cellFactorFee,
  1524. "checkMaterialFee": checkMaterialFee,
  1525. "treatMaterialFee": treatMaterialFee,
  1526. "operationMaterialFee": operationMaterialFee,
  1527. "otherTypeFee": otherTypeFee,
  1528. "singleDiagManage": singleDiagManage,
  1529. "clinicPathwayManage": clinicPathwayManage,
  1530. "isOutpatientBehospital": isOutpatientBehospital,
  1531. "isLeaveBehospital": isLeaveBehospital,
  1532. "isOperationBeforeAfter": isOperationBeforeAfter,
  1533. "isClinicPathology": isClinicPathology,
  1534. "isRadiatePathology": isRadiatePathology,
  1535. "rescueNum": rescueNum,
  1536. "rescueSuccessNum": rescueSuccessNum,
  1537. "isAutoLeavehospital": isAutoLeavehospital,
  1538. "returnToType": returnToType,
  1539. "leaveDiags": leaveDiags,
  1540. "operations": operations
  1541. }
  1542. ]
  1543. }
  1544. console.log("param:", param)
  1545. let state = 1
  1546. // axios.post(api.sendHomePageIng, param).then((res) => {
  1547. // console.log("res", res.data);
  1548. // })
  1549. post1(api.sendHomePageIng, param).then(res => {
  1550. if (res.data.code == '0') {
  1551. // window.parent.location.reload()
  1552. console.log("sendHomePageIngRes", res.data)
  1553. console.log("成功");
  1554. } else {
  1555. state = 0
  1556. console.log("失败");
  1557. }
  1558. }).catch((e) => {
  1559. state = 0
  1560. console.log("失败1");
  1561. })
  1562. if (state === 1) {
  1563. return true
  1564. } else {
  1565. return false
  1566. }
  1567. }
  1568. /**
  1569. *取表格里的数据-出院诊断
  1570. */
  1571. function addLeaveDiags() {
  1572. let leaveDiagsArray = []
  1573. let i = 0//顺序号
  1574. $('.embed-table tbody tr').each(function (rowIndex) {//遍历每一行
  1575. if (rowIndex > 0 && $(this).find('th').length === 0 && i < global_diagList.length) {
  1576. let diagsObj = {
  1577. "behospitalType": "",
  1578. "diagnoseName": "",
  1579. "diagnoseOrderNo": "",
  1580. "diagnoseType": "",
  1581. "diagnoseTypeShort": "",
  1582. "behospitalCode": global_id,
  1583. "hospitalId": global_hid,
  1584. "icdCode": "",
  1585. "leaveHospitalType": "",
  1586. "pathologyDiagnose": "",
  1587. "homePageId": ""
  1588. };
  1589. diagsObj.diagnoseName = $(this).find('td').eq(0).text()
  1590. diagsObj.icdCode = $(this).find('td').eq(1).text()
  1591. diagsObj.behospitalType = $(this).find('td').eq(2).text()
  1592. diagsObj.leaveHospitalType = $(this).find('td').eq(3).text()
  1593. diagsObj.diagnoseOrderNo = global_diagList[i].诊断序号
  1594. diagsObj.homePageId = $('.patient-info span').eq(0).text().match(/\d+/)[0]
  1595. if (rowIndex === 2) {
  1596. diagsObj.diagnoseType = "主要诊断"
  1597. diagsObj.diagnoseTypeShort = "主"
  1598. } else {
  1599. diagsObj.diagnoseType = "次要诊断"
  1600. diagsObj.diagnoseTypeShort = "次"
  1601. }
  1602. leaveDiagsArray.push(diagsObj)
  1603. i = i + 1
  1604. }
  1605. });
  1606. return leaveDiagsArray
  1607. }
  1608. /**
  1609. * 取表格里的数据-手术情况
  1610. * @return {} operationsArry 表格的数据
  1611. */
  1612. function addoperations() {
  1613. let operationsArry = []
  1614. let i = 0//顺序号
  1615. $('.opera-table tbody tr').each(function (rowIndex) {//遍历每一行
  1616. if (rowIndex > 1 && $(this).find('th').length === 0) {
  1617. let operationObj = {
  1618. "anaesthesiaName": "",
  1619. "cutLevel": "",
  1620. "firstAssistantId": "",
  1621. "healingLevel": "",
  1622. "homePageId": "",
  1623. "hospitalId": global_hid,
  1624. "operationCode": "",
  1625. "operationDate": "",
  1626. "operationDoctorId": "",
  1627. "operationLevel": "",
  1628. "operationName": "",
  1629. "operationOrderNo": "",
  1630. "secondAssistantId": "",
  1631. "shamOperationName": ""
  1632. }
  1633. operationObj.operationOrderNo = global_operaList[i].手术序号
  1634. operationObj.homePageId = $('.patient-info span').eq(0).text().match(/\d+/)[0]
  1635. operationObj.operationCode = $(this).find('td').eq(0).text()
  1636. operationObj.operationDate = $(this).find('td').eq(1).text()
  1637. operationObj.operationLevel = $(this).find('td').eq(2).text()
  1638. operationObj.operationName = $(this).find('td').eq(3).text()
  1639. operationObj.operationDoctorId = $(this).find('td').eq(4).text()
  1640. operationObj.firstAssistantId = $(this).find('td').eq(5).text()
  1641. operationObj.secondAssistantId = $(this).find('td').eq(6).text()
  1642. operationObj.cutLevel = $(this).find('td').eq(7).text()
  1643. operationObj.healingLevel = $(this).find('td').eq(8).text()
  1644. operationObj.anaesthesiaName = $(this).find('td').eq(9).text()
  1645. operationObj.anaesthesiaName = $(this).find('td').eq(10).text()
  1646. operationsArry.push(operationObj)
  1647. i = i + 1
  1648. }
  1649. });
  1650. return operationsArry
  1651. }
  1652. });