From f56aaf0e7514a6e05332e4f3dadf823feb42d277 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E6=80=9D=E6=87=BF?= <1509159964@qq.com>
Date: Fri, 22 May 2020 16:57:49 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=89=E6=8B=A9=E9=94=81?=
=?UTF-8?q?=E5=AE=9A=E7=97=85=E6=A1=88=E5=80=9F=E9=98=85=E7=94=B3=E8=AF=B7?=
=?UTF-8?q?=EF=BC=8C=E4=B8=8B=E8=BD=BD=EF=BC=8C=E4=B8=8B=E8=BD=BD=E7=94=B3?=
=?UTF-8?q?=E8=AF=B7=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/emr/annotation/DynamicDataSource.java | 1 +
.../userDistributionManage.jsp | 2 +-
.../recordManage/commomSearch/commomList1.jsp | 2 +-
.../approveManageList/approveManageList1.js | 1 -
.../commomSearch/commomListBlood.js | 2 +-
.../templateSearch/searchCommomMethodBlood.js | 77 +++++++++++++++----
6 files changed, 68 insertions(+), 17 deletions(-)
diff --git a/src/main/java/com/emr/annotation/DynamicDataSource.java b/src/main/java/com/emr/annotation/DynamicDataSource.java
index ce2060f..e8b02f6 100644
--- a/src/main/java/com/emr/annotation/DynamicDataSource.java
+++ b/src/main/java/com/emr/annotation/DynamicDataSource.java
@@ -4,6 +4,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
+
/**
* @ProjectName:
* @Description:
diff --git a/src/main/webapp/WEB-INF/views/distributionManage/userDistributionManage.jsp b/src/main/webapp/WEB-INF/views/distributionManage/userDistributionManage.jsp
index 5eac91a..e073d44 100644
--- a/src/main/webapp/WEB-INF/views/distributionManage/userDistributionManage.jsp
+++ b/src/main/webapp/WEB-INF/views/distributionManage/userDistributionManage.jsp
@@ -85,7 +85,7 @@
+ placeholder="工号/用户名" maxlength="16"/>
diff --git a/src/main/webapp/WEB-INF/views/recordManage/commomSearch/commomList1.jsp b/src/main/webapp/WEB-INF/views/recordManage/commomSearch/commomList1.jsp
index 4055a5b..8961298 100644
--- a/src/main/webapp/WEB-INF/views/recordManage/commomSearch/commomList1.jsp
+++ b/src/main/webapp/WEB-INF/views/recordManage/commomSearch/commomList1.jsp
@@ -267,7 +267,7 @@
--%>
-
+
diff --git a/src/main/webapp/static/js/approveManage/approveManageList/approveManageList1.js b/src/main/webapp/static/js/approveManage/approveManageList/approveManageList1.js
index 75f3667..27ef0dc 100644
--- a/src/main/webapp/static/js/approveManage/approveManageList/approveManageList1.js
+++ b/src/main/webapp/static/js/approveManage/approveManageList/approveManageList1.js
@@ -322,7 +322,6 @@ $(function () {
* 批量审批
*/
function addApprovesMore() {
- debugger
clearContent();
tabChecks = getChecked();
if (tabChecks.length > 0){
diff --git a/src/main/webapp/static/js/recordManage/commomSearch/commomListBlood.js b/src/main/webapp/static/js/recordManage/commomSearch/commomListBlood.js
index c283760..e7008db 100644
--- a/src/main/webapp/static/js/recordManage/commomSearch/commomListBlood.js
+++ b/src/main/webapp/static/js/recordManage/commomSearch/commomListBlood.js
@@ -14,7 +14,7 @@ function getSql(){
var inputValue = getInputValue();
if(inputValue != ''){
//select语句字符串
- var selectNames = 'select ' + commomtable + '.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id is null THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,';
+ var selectNames = 'select distinct ' + commomtable + '.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id is null THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,';
selectNames += $("#englishFields").val();
//from语句字符串
var fromTableNames = ' from ';
diff --git a/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodBlood.js b/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodBlood.js
index 390f517..12bd800 100644
--- a/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodBlood.js
+++ b/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodBlood.js
@@ -129,7 +129,7 @@ function freshTable() {
var sql = $("#sql").val();
if (sql == '') {
var userName = "'" + $("#userName").val() + "'";
- sql = "select commomtable.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id is null THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,commomtable.inpatient_no,commomtable.admiss_id,commomtable.name,commomtable.main_dis_thing from commomtable "
+ sql = "select distinct commomtable.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id is null THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,commomtable.inpatient_no,commomtable.admiss_id,commomtable.name,commomtable.main_dis_thing from commomtable "
+ "left join emr_apply_approve on commomtable.patient_id = emr_apply_approve.patient_id and emr_apply_approve.apply_type != 3 and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = " + userName
+ "left join emr_apply_approve emr_apply_approve1 on commomtable.patient_id = emr_apply_approve1.patient_id and emr_apply_approve1.apply_type = 3 and emr_apply_approve1.approve_state = 1 and emr_apply_approve1.effe_time > GETDATE()-1 and emr_apply_approve1.applyer = " + userName
+ " left join emr_lock on commomtable.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1";
@@ -370,8 +370,10 @@ function AddFunctionAlty(value, row, index) {
var downloadOper = row.downloadOper;
var isDownload = row.isDownload;
var str = '';
- if (lockStatus != '' && lockStatus == 1 && unlockOper == 1) {
- str += '';
+ if (lockStatus != '' && lockStatus == 1) {
+ if (unlockOper != '' && unlockOper == 1) {
+ str += '';
+ }
} else {
if ((null != isShowDetail && isShowDetail == 1) || showRecord == "1") {
str += '查看详情';
@@ -395,6 +397,35 @@ function AddFunctionAlty(value, row, index) {
return str;
}
+/**
+ * 判断所选内容是否包含锁定的信息
+ * @returns {boolean}
+ */
+function judgeLocked() {
+ var idlist = getSelectedRow_st("mytab");
+ if (idlist.length > 0) {
+ var patientIds = new Array();
+ for (var i = 0; i < idlist.length; i++) {
+ patientIds.push("'" + idlist[i].patientId + "'");
+ }
+ var locks = $("#locks").val();
+ var lockList = locks.split(",");
+ for (var i = 0; i < lockList.length; i++) {
+ /*for (var j = 0; j < patientIds.length; j++){
+ if (patientIds[j] === lockList[i]){
+ return false;
+ }
+ }*/
+ if (patientIds.indexOf(lockList[i]) >= 0) {
+ return false;
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
/***********************************************按钮功能*****************************************************************/
//清空功能
function clearForm() {
@@ -408,12 +439,16 @@ function downloadZip(typeId) {
getChecked();
var checks = $("#checks").val();
if (checks != '') {
- patientIds = powerPotient(checks, true, typeId);
- if (patientIds != '') {
- patientIds = patientIds.substring(0, patientIds.length - 1);
- post(path + '/template/downloadBloodZip', {"patientIds": patientIds, "flag": $("#flag").val()});
+ if (judgeLocked()) {
+ patientIds = powerPotient(checks, true, typeId);
+ if (patientIds != '') {
+ patientIds = patientIds.substring(0, patientIds.length - 1);
+ post(path + '/template/downloadBloodZip', {"patientIds": patientIds, "flag": $("#flag").val()});
+ } else {
+ toastr.warning("必须申请通过!")
+ }
} else {
- toastr.warning("必须申请通过!")
+ toastr.warning("所选的病案中存在已锁定的病案,如果需要下载锁定的病案,请先解锁病案");
}
} else {
var sql = $("#sql").val();
@@ -464,6 +499,7 @@ function downloadZip(typeId) {
toastr.warning("搜索条件不可为空!");
}
}
+
}
//下载pdf功能
@@ -542,6 +578,7 @@ function loadApplyType(type) {
//单个申请借阅
function borrowing(patientId) {
+ pickTime("effeTime", null);
$("#typeId").val('approves');
//加载申请借阅类型
loadApplyType(1);
@@ -623,16 +660,23 @@ function borrowings() {
}
}
} else {
- $('#borrowings').attr("data-toggle", "modal");
- $('#borrowings').attr("data-target", "#myModal1");
+ if (judgeLocked()) {
+ $('#borrowings').attr("data-toggle", "modal");
+ $('#borrowings').attr("data-target", "#myModal1");
+ } else {
+ toastr.warning("所选的病案中存在已锁定的病案,如果需要下载锁定的病案,请先解锁病案");
+ }
}
+
+
}
//单个下载申请
function downBorrowing(patientId) {
+ pickTime("effeTime", null);
$("#typeId").val('loads');
//加载申请借阅类型
- loadApplyType(1);
+ loadApplyType(2);
setFormToken();
document.forms[1].reset();
$("#approveId").val("");
@@ -711,9 +755,15 @@ function downBorrowings() {
}
}
} else {
- $('#downBorrowings').attr("data-toggle", "modal");
- $('#downBorrowings').attr("data-target", "#myModal1");
+ if (judgeLocked()) {
+ $('#downBorrowings').attr("data-toggle", "modal");
+ $('#downBorrowings').attr("data-target", "#myModal1");
+ } else {
+ toastr.warning("所选的病案中存在已锁定的病案,如果需要下载锁定的病案,请先解锁病案");
+ }
}
+
+
}
//模态框保存操作
@@ -1056,6 +1106,7 @@ function powerPotient(patientIds, flag, typeId) {
}
}
if (patientIds != '') {
+ //debugger
var patientIdList = patientIds.split(",");
//锁定的
var locks = $("#locks").val();