|
@@ -10,6 +10,13 @@ const adLogo = require("../images/adlogo.png")
|
|
|
if (localStorage.getItem('toLogin') === '1') {
|
|
|
window.location.href = '../login.html';
|
|
|
}
|
|
|
+/**
|
|
|
+ *data_type:存储的是对缺陷总览页面的缺陷总览和控费缺陷两个子页面操作时,
|
|
|
+ *停留在哪个页面,2表示为缺陷总览子页面,1表示控费缺陷子页面,
|
|
|
+ *点击侧边菜单栏data_type会重置为2
|
|
|
+ *
|
|
|
+*/
|
|
|
+let data_type = 2
|
|
|
$(function () {
|
|
|
const hideLogo = getUrlArgObject("hideLg");
|
|
|
if (hideLogo) {
|
|
@@ -35,13 +42,13 @@ $(function () {
|
|
|
let global_modules = {}; //模板数据缓存
|
|
|
let global_flaws = []; //缺陷条目列表缓存
|
|
|
let global_selectedFlaw = {}; //新增时选中的条目信息
|
|
|
- let menuList = [];
|
|
|
+ let isPlacefile = getCookie('isPlacefile')
|
|
|
getAllModules();
|
|
|
let showCheckBtns = global_code === "YH-ZKHC-HCRWLB";
|
|
|
window.document.title = (showCheckBtns ? "质控核查-" : "质控评分-") + getUrlArgObject("name");
|
|
|
|
|
|
- let hasAu3 = showCheckBtns && hasData('FUNC000011'); //新增缺陷权限
|
|
|
- if (hasAu3) {
|
|
|
+ let hasAu5 = isPlacefile == 0 ? true : showCheckBtns && hasData('FUNC000011'); //新增缺陷权限
|
|
|
+ if (hasAu5) {
|
|
|
$(".add-flaw").click(function () {
|
|
|
getQcCasesEntry();
|
|
|
});
|
|
@@ -89,6 +96,7 @@ $(function () {
|
|
|
});
|
|
|
//右侧内容切换
|
|
|
$(".page").on("click", function () {
|
|
|
+ data_type = 2
|
|
|
$(".info-item .cont,.flaw-item,td").removeClass("active"); //清空缺陷定位背景
|
|
|
const title = $(this).attr("code");
|
|
|
if (title == '缺陷总览' || !global_check_show) { //质控核查页进来隐藏原核查按钮
|
|
@@ -189,15 +197,6 @@ $(function () {
|
|
|
global_check = checkStatus
|
|
|
global_check_home = mrStatus
|
|
|
global_check_show = checkShow;//0隐藏操作按钮1显示
|
|
|
- const list = JSON.parse(result.menuData)
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- const item = list[i];
|
|
|
- menuList.push(item.name)
|
|
|
- for (let j = 0; j < item.sonMode.length; j++) {
|
|
|
- const it = item.sonMode[j];
|
|
|
- menuList.push(it.name)
|
|
|
- }
|
|
|
- }
|
|
|
check_Operation_WithAppeal = checkOperationWithAppeal;
|
|
|
const info = Object.assign(beHospital, result);
|
|
|
initMenu(JSON.parse(result.menuData));
|
|
@@ -206,19 +205,19 @@ $(function () {
|
|
|
global_activeTab = $(".sub-menu .page.active").attr("code");
|
|
|
$(".operation").show()
|
|
|
initPatientInfo(info);
|
|
|
- initContent(result.pageData,2);
|
|
|
+ initContent(result.pageData, 2);
|
|
|
initList(msg);
|
|
|
initScoreItem(msg);
|
|
|
global_flawData = msg;
|
|
|
global_flawDataPay = drgs;
|
|
|
setBoxHeight();
|
|
|
changePay()
|
|
|
- }else{
|
|
|
- $.alerModal({ "message": '接口出错', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
|
|
|
- }
|
|
|
- }).catch(()=>{
|
|
|
- $.alerModal({ "message": '接口出错', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ $.alerModal({ "message": '接口出错', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ $.alerModal({ "message": '接口出错', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
|
|
|
+ });
|
|
|
}
|
|
|
function getRecordDetailUpdate() {
|
|
|
post(api.getRecordDetail, { 'behospitalCode': global_id }).then(function (res) {
|
|
@@ -244,57 +243,59 @@ $(function () {
|
|
|
//补录数据,接口来自技术服务部
|
|
|
function supplementData() {
|
|
|
//重新拉数据接口
|
|
|
- post(api.supplementData, { 'behospitalCode': global_id,'behospitalNum':'' }).then(function (res) {
|
|
|
- const {code,data}=res.data;
|
|
|
+ post(api.supplementData, { 'behospitalCode': global_id, 'behospitalNum': '' }).then(function (res) {
|
|
|
+ const { code, data } = res.data;
|
|
|
if (code === '0') {
|
|
|
- if(data==='0'){ //0表示数据已更新,-1表示数据未更新
|
|
|
+ if (data === '0') { //0表示数据已更新,-1表示数据未更新
|
|
|
//数据更新后先评分(评分成功后)再重新获取详情即刷新页面
|
|
|
- recordScore();
|
|
|
- }else{
|
|
|
- $.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
|
|
|
- }
|
|
|
- }else{
|
|
|
+ recordScore();
|
|
|
+ } else {
|
|
|
+ $.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
$.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function loading() {
|
|
|
- const str = `
|
|
|
+ const str = `
|
|
|
<div class="loadingBox">
|
|
|
<div class="mask"></div>
|
|
|
<img class="loadingImg" src=${loadingImg} alt="loading" />
|
|
|
</div>
|
|
|
`
|
|
|
- $("body", parent.document).append(str)
|
|
|
+ $("body", parent.document).append(str)
|
|
|
}
|
|
|
function hideLoading() {
|
|
|
- $(".loadingBox", parent.document).remove()
|
|
|
+ $(".loadingBox", parent.document).remove()
|
|
|
}
|
|
|
-//评分
|
|
|
+ //评分
|
|
|
function recordScore() {
|
|
|
- const param = {
|
|
|
- behospitalCode: global_id
|
|
|
- };
|
|
|
- loading();
|
|
|
- post(api.recordScore, param).then(res => {
|
|
|
- if (res.data.code === '0') {
|
|
|
- hideLoading();
|
|
|
- //评分成功,刷新病历详情页面
|
|
|
- window.parent.location.reload()
|
|
|
- } else {
|
|
|
- hideLoading()
|
|
|
+ const param = {
|
|
|
+ behospitalCode: global_id
|
|
|
+ };
|
|
|
+ loading();
|
|
|
+ post(api.recordScore, param).then(res => {
|
|
|
+ if (res.data.code === '0') {
|
|
|
+ hideLoading();
|
|
|
+ //评分成功,刷新病历详情页面
|
|
|
+ window.parent.location.reload()
|
|
|
+ } else {
|
|
|
+ hideLoading()
|
|
|
$.alerModal({ "message": res.data.msg || '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- hideLoading()
|
|
|
- $.alerModal({ "message": '刷新失败,请重试~', type: "tip", win: 'default', time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
|
|
|
- })
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ hideLoading()
|
|
|
+ $.alerModal({ "message": '刷新失败,请重试~', type: "tip", win: 'default', time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
function changePay() {
|
|
|
$(document).on('click', ".titleSpecial span", function () {
|
|
|
let type = $(this).attr("data-type")
|
|
|
+ // window.localStorage.setItem("data_type", type)
|
|
|
+ data_type = Number(type)
|
|
|
if (type == 1) {
|
|
|
initList(global_flawDataPay, type);
|
|
|
} else {
|
|
@@ -315,15 +316,15 @@ $(function () {
|
|
|
})
|
|
|
}
|
|
|
//显示病例模块明细
|
|
|
- function initContent(data,type) {
|
|
|
+ function initContent(data, type) {
|
|
|
const obj = JSON.parse(data);
|
|
|
let info = [];
|
|
|
let hml = '', moduleId = '';
|
|
|
- if(type == 2){
|
|
|
+ if (type == 2) {
|
|
|
formatSpecPage(obj["谈话告知书"], "谈话告知书");
|
|
|
formatSpecPage(obj["知情同意书"], "知情同意书");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// formatSpecPage(obj["医嘱信息"],"医嘱信息");
|
|
|
$(".content-box").show();
|
|
|
for (let k in obj) {
|
|
@@ -372,28 +373,69 @@ $(function () {
|
|
|
//知情同意书、谈话告知书
|
|
|
function formatSpecPage(data, title, type) {
|
|
|
$(".page-item[code='缺陷总览']").remove()
|
|
|
- $("#appointBookTmpl").tmpl({ title, data }).appendTo(".flaw-table");
|
|
|
+ // $(".flaw-table").html("")
|
|
|
+
|
|
|
+ let hasAu = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000013'); //修改缺陷权限
|
|
|
+ let hasAu2 = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000012'); //删除缺陷权限
|
|
|
+ // let hasAu4 = isPlacefile == 0 ? true : check_Operation_WithAppeal && showCheckBtns && global_check_show
|
|
|
+ // let hasAu3 = check_Operation_WithAppeal
|
|
|
+
|
|
|
+ // console.log("hasAu3:", check_Operation_WithAppeal)
|
|
|
+
|
|
|
+ $("#appointBookTmpl").tmpl({ title, data, hasAu, hasAu2 }).appendTo(".flaw-table");
|
|
|
+ // 防止页面数据更新时,页面不显示
|
|
|
+ $(".page-item[code='缺陷总览']").css("display", "block")
|
|
|
+
|
|
|
setBoxHeight();
|
|
|
+ // console.log("data:", data)
|
|
|
+
|
|
|
+ // 操作列: 修改,恢复和编辑
|
|
|
+ $(".scroll-table .oper a").unbind("click").click(function () {
|
|
|
+ // 获取当前操作的类型,当前分为:病案首页,入院记录和出院小结等
|
|
|
+ let opType_old = $(this).parents("tr").attr("code");
|
|
|
+ // 剔除掉opType_old的特殊符号
|
|
|
+ let opType_new = opType_old.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, "")
|
|
|
+
|
|
|
+ // 获取当前这条记录在同类型里的索引
|
|
|
+ const i = $(`.scroll-table tr[code= '${opType_old}' ]`).index($(this).parents("tr"))
|
|
|
+ // debugger
|
|
|
+ //获取当前记录的ID
|
|
|
+ const code = $(this).attr("code");
|
|
|
+ // 查看是否点击的是编辑
|
|
|
+ const isEdit = $(this).is(".edit-flaw");
|
|
|
+ //if(!hasAu)return
|
|
|
+ // 由于弹窗的数据填充的是由当前菜单决定的,需要修改global_activeTab为当前操作类型
|
|
|
+
|
|
|
+ global_activeTab = opType_new
|
|
|
+
|
|
|
+ if (isEdit && hasAu) {
|
|
|
+ showModal('0', code, i); //编辑
|
|
|
+ } else if (!isEdit && hasAu2) {
|
|
|
+ if ($(this).is(".recover-flaw")) {
|
|
|
+ showModal('3', code, i); //恢复
|
|
|
+ //
|
|
|
+ } else {
|
|
|
+ showModal('1', code, i); //删除
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 防止影响菜单,重新激活菜单项
|
|
|
+ global_activeTab = $(".sub-menu .page.active").attr("code");
|
|
|
+ })
|
|
|
+
|
|
|
$(".page-anchor").on("click", function () {
|
|
|
const code = $(this).attr("code");
|
|
|
const pCode = $(this).parents("tr").attr("code").replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g, '');
|
|
|
- const tCode = $(this).parents("tr").attr("code")
|
|
|
- //菜单同步状态
|
|
|
- if (menuList.indexOf(tCode) == -1) {
|
|
|
- console.log(123);
|
|
|
- $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
|
|
|
- return;
|
|
|
- }
|
|
|
//菜单同步状态
|
|
|
$(".sub-menu .page[code=" + pCode + "]").parents(".list-1").click();
|
|
|
$(".sub-menu .page[code=" + pCode + "],.menu-mini .page[code=" + pCode + "").click();
|
|
|
//缺陷定位
|
|
|
$(".info-item .cont,.flaw-item,td").removeClass("active");
|
|
|
- // const flawItem = $(".flaw-item .title a[code=" + code + "]");
|
|
|
- // if (!flawItem.length) {
|
|
|
- // $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ const flawItem = $(".flaw-item .title a[code=" + code + "]");
|
|
|
+ if (!flawItem.length) {
|
|
|
+ $.alerModal({ "message": '模块数据缺失~', type: "tip", time: '1000', isFather: true, fatherWrapper: $(".flaw-table", parent.document) });
|
|
|
+ return;
|
|
|
+ }
|
|
|
$(".flaw-item .title a[code=" + code + "]").click();
|
|
|
const anch = $(".flaw-item .title a[code=" + code + "]").attr("href");
|
|
|
if ($(anch)[0]) {
|
|
@@ -451,9 +493,10 @@ $(function () {
|
|
|
//评分项数据填充
|
|
|
function initScoreItem(data) {
|
|
|
$("#flaws .flaw-box").html("");
|
|
|
- let hasAu = showCheckBtns && global_check_show && hasData('FUNC000013'); //修改缺陷权限
|
|
|
- let hasAu2 = showCheckBtns && global_check_show && hasData('FUNC000012'); //删除缺陷权限
|
|
|
- let hasAu4 = check_Operation_WithAppeal && showCheckBtns
|
|
|
+ // console.log(showCheckBtns, 11122);
|
|
|
+ let hasAu = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000013'); //修改缺陷权限
|
|
|
+ let hasAu2 = isPlacefile == 0 ? true : showCheckBtns && global_check_show && hasData('FUNC000012'); //删除缺陷权限
|
|
|
+ let hasAu4 = isPlacefile == 0 ? true : check_Operation_WithAppeal && showCheckBtns && global_check_show
|
|
|
let hasAu3 = check_Operation_WithAppeal
|
|
|
for (let k in data) {
|
|
|
for (let i = 0; i < data[k].length; i++) {
|
|
@@ -467,6 +510,7 @@ $(function () {
|
|
|
const i = $(".flaw-item[code=" + global_activeTab + "]").index($(this).parents(".flaw-item"));
|
|
|
const code = $(this).attr("code");
|
|
|
const isEdit = $(this).is(".edit-flaw");
|
|
|
+ // console.log("global_activeTab:", global_activeTab)
|
|
|
//if(!hasAu)return
|
|
|
if (isEdit && hasAu) {
|
|
|
showModal('0', code, i); //编辑
|
|
@@ -480,7 +524,7 @@ $(function () {
|
|
|
})
|
|
|
$(".edit-flaw").css({ "display": hasAu ? "inline" : "none" });
|
|
|
$(".del-flaw").css({ "display": hasAu2 ? "inline" : "none" });
|
|
|
- $(".add-flaw").css({ "display": hasAu4 && global_check_show ? "inline" : "none" });
|
|
|
+ $(".add-flaw").css({ "display": hasAu4 ? "inline" : "none" });
|
|
|
$(".recover-flaw").css({ "display": hasAu2 ? "inline" : "none" });
|
|
|
$(".flaw-item .title a[href]").unbind("click").click(function () {
|
|
|
const id = $(this).attr("href");
|
|
@@ -590,7 +634,7 @@ $(function () {
|
|
|
|
|
|
//显示删除/修改弹窗
|
|
|
function showModal(flag, code, i, id, qcresultDetailId) {
|
|
|
- console.log(flag);
|
|
|
+ // console.log(flag);
|
|
|
$("#delModal .modal-body").html("");
|
|
|
$("#delModal").show();
|
|
|
$("#delModal .cancel").text("关闭")
|
|
@@ -598,7 +642,16 @@ $(function () {
|
|
|
$(".info-item .cont,.flaw-item .title,td").removeClass("active");
|
|
|
//事件解绑
|
|
|
$("#delModal .confirm").off("click");
|
|
|
- const flawsList = formatFlawKeys(global_flawData);
|
|
|
+ let flawsList
|
|
|
+ if (data_type === 2) {
|
|
|
+ flawsList = formatFlawKeys(global_flawData)
|
|
|
+ } else {
|
|
|
+ flawsList = formatFlawKeys(global_flawDataPay)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // console.log("flawsList:", flawsList)
|
|
|
const info = flawsList[global_activeTab] && flawsList[global_activeTab][i];
|
|
|
if (flag === '0') { //修改
|
|
|
$("#delModal .confirm").show()
|
|
@@ -648,11 +701,6 @@ $(function () {
|
|
|
if ($(".edit-box .warning").is(":visible")) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!$("#qcMsg").val().trim()) {
|
|
|
- $(".edit-box .warning .red").text("提示信息不能为空~");
|
|
|
- $(".edit-box .warning").show();
|
|
|
- return;
|
|
|
- }
|
|
|
const obj = Object.assign({}, info, { explainInfo: $("#delModal #qcInfo").val(), msg: $("#delModal #qcMsg").val(), score: $("#delModal #qcScore").val() });
|
|
|
editScore(obj);
|
|
|
});
|
|
@@ -754,7 +802,7 @@ $(function () {
|
|
|
$("#delModal").hide();
|
|
|
});
|
|
|
$("#delModal .cancel").show().text("删除").unbind("click").click(function () {
|
|
|
- console.log(123);
|
|
|
+ // console.log(123);
|
|
|
delScore(code, info);
|
|
|
});
|
|
|
}
|
|
@@ -841,7 +889,7 @@ $(function () {
|
|
|
$("#addQcScore").val(score);
|
|
|
$(".add-box .warning").hide();
|
|
|
$(".add-box .drop-box").removeClass("show");
|
|
|
- console.log(123);
|
|
|
+ // console.log(123);
|
|
|
});
|
|
|
$(document).on("blur", ".flaw-drop-input", (e) => {
|
|
|
$('.flaw-drop-input').val(global_entryName).attr({ "code": global_casesEntryId, "title": global_entryName });
|
|
@@ -859,9 +907,22 @@ $(function () {
|
|
|
post(api.getRecordDetail, param).then(function (res) {
|
|
|
if (res.data.code === '0') {
|
|
|
const data = res.data.data;
|
|
|
- const { msg } = data;
|
|
|
+ const { msg, drgs } = data;
|
|
|
initScoreItem(msg);
|
|
|
global_flawData = msg;
|
|
|
+ global_flawDataPay = drgs
|
|
|
+ // console.log("data:", data)
|
|
|
+
|
|
|
+ // 单独刷新缺陷总览页面的数据
|
|
|
+ if (data_type === 1) {
|
|
|
+ // 控费缺陷
|
|
|
+ formatSpecPage(drgs, "缺陷总览", 1);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // 缺陷总览
|
|
|
+ formatSpecPage(msg, "缺陷总览", 2);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|