Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js
===================================================================
diff -u -r26109 -r26220
--- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 26109)
+++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 26220)
@@ -2845,7 +2845,7 @@
});
}
/**
- * 检查是否有未归还的器械包,如果有,那就提示.
+ * 检查是否有未归还的器械包-针对回收保存,如果有,那就提示.
* @param confirmation 确认回收记录操作
* @param saveAndNew 保存并新建回收记录操作
* @param print 保存并打印回收记录操作
@@ -2897,7 +2897,60 @@
submitFormFunction(confirmation,saveAndNew,false,print,recyclingAmountConfirm);
}
}
+
/**
+ * 检查是否有未归还的器械包-针对清点确认,如果有,那就提示.
+ * @param confirmation 确认回收记录操作
+ * @param saveAndNew 保存并新建回收记录操作
+ * @param print 保存并打印回收记录操作
+ */
+function checkAutoReturnBorrowingForInventoryConfirm(confirmation,saveAndNew,print,recyclingAmountConfirm){
+ //除申请还物单、自定义器械申请单、外来器械申请单、历史回收记录等可以直接提交外,其它类型的单回收都需要判断是否有物品要归还,包括手动添加回收申请单、科室申领添加的申请单、使用记录转换的申请单等都需要判断是否需要自动归还
+ if(!isUndefinedOrNullOrEmpty(params_id)){
+ submitFormFunction(confirmation,saveAndNew,false,print,recyclingAmountConfirm);
+ return;
+ }
+ var tousseNames = [];
+ var recyclingItems = getRecyclingItemInfo();
+ for(var i = 0; i < recyclingItems.length;++i){
+ var itemRecycleAmount = recyclingItems[i].recycleAmount;
+ if(parseInt(itemRecycleAmount) > 0){
+ tousseNames.push(recyclingItems[i].tousseName);
+ }
+ }
+ var departCode = document.getElementById('departCode').value;
+ var borrowApplicationInfo = null;
+ DWREngine.setAsync(false);
+ RecyclingApplicationTableManager.getUnReturnBorrowApplication(params_appId , departCode,tousseNames.join(';'),function(datesOfTousseLease){
+ borrowApplicationInfo = datesOfTousseLease;
+ });
+ DWREngine.setAsync(true);
+ if(borrowApplicationInfo){
+ var borrowApplicationInfoJson = JSON.parse(borrowApplicationInfo);
+ var borrowTimes = borrowApplicationInfoJson.borrowTimes;
+ var tousseLeaseAmount = borrowTimes.split(';').length;
+
+ var confirmMessage = '您有'+tousseLeaseAmount+'张申请日期为'+borrowTimes+'的借物单的以下物品未归还,是否申请归还?';
+ var tdStyle = 'font-size:28px;text-align:center;';
+ var nameWidth = '440px;',taskGroupWidth='200px;',amoutWidth='140px;';
+ var table = '
'+ confirmMessage +' |
器械包 | 数量 |
';
+ for(var i = 0; i < borrowApplicationInfoJson.tousseData.length;++i){
+ var tousseData = borrowApplicationInfoJson.tousseData[i];
+ table += ''+tousseData.tousseName+' | '+tousseData.amount+' |
';
+ }
+ table += '
';
+ var html = ''+table+'
';
+ dialogConfirm(html,function(){
+ submitFormFunctionForInventoryConfirm(confirmation,saveAndNew,true,print,recyclingAmountConfirm);
+ },function(){
+ submitFormFunctionForInventoryConfirm(confirmation,saveAndNew,false,print,recyclingAmountConfirm);
+ },800 , 500);
+ }else{
+ submitFormFunctionForInventoryConfirm(confirmation,saveAndNew,false,print,recyclingAmountConfirm);
+ }
+}
+
+/**
* 显示回收物品清单
*/
function showRecyclingDetail(recyclingItems,confirmCallback){
@@ -2985,6 +3038,9 @@
}
}
+//是否进行清点确认 false 为保存,true 为清点确认
+var IntheBoxState = false;
+
/**
* 提交回收记录.
* @param confirmation 确认回收记录操作
@@ -2997,7 +3053,7 @@
alertDiv("保存中,请稍候......", true);
var jsonStr = getJsonParams(confirmation);
- var jSONe= JSON.parse(jsonStr)
+ var jSONe = JSON.parse(jsonStr)
if(IntheBoxState == true){
jSONe.tally = true;
}else{
@@ -3014,8 +3070,9 @@
if(sstsConfig.hasOwnProperty('recyclingUserDefault') && !sstsConfig.recyclingUserDefault){
recyclingUserDefault = false;
}
+ var submitUrl = WWWROOT + "/disinfectSystem/recyclingRecordAction!saveRecyclingRecord.do";
$.ajax({
- url : WWWROOT + "/disinfectSystem/recyclingRecordAction!saveRecyclingRecord.do",
+ url : submitUrl,
type : "POST",
timeout : 300000,
dataType :'json',
@@ -3085,15 +3142,97 @@
}
});
}
+
/**
+ * 提交清点确认.
+ * @param confirmation 确认回收记录操作
+ * @param saveAndNew 保存并新建回收记录操作
+ * @param autoReturnTheBorrowingTousse 自动归还借物单
+ * @param print 保存并打印回收记录操作
+ * Annie 如果tally为true是清点确认 否则就是false
+ */
+function submitFormFunctionForInventoryConfirm(confirmation,saveAndNew,autoReturnTheBorrowingTousse,print,recyclingAmountConfirm){
+
+ alertDiv("保存中,请稍候......", true);
+ var jsonStr = getJsonParams(confirmation);
+ var jSONe = JSON.parse(jsonStr)
+ if(IntheBoxState == true){
+ jSONe.tally = true;
+ }else{
+ jSONe.tally = false;
+ }
+ var id = document.getElementById('id').value;
+ var app_id = document.getElementById('recyclingApplicationId').value;
+ var departCode = document.getElementById('departCode').value;
+ var recyclingUser = document.getElementById('recyclingUser').value;
+ var operator = document.getElementById('operator').value;
+ var depart = document.getElementById('depart').value;
+ var recyclingTime = document.getElementById('recyclingTime').value;
+ var recyclingUserDefault = true;
+ if(sstsConfig.hasOwnProperty('recyclingUserDefault') && !sstsConfig.recyclingUserDefault){
+ recyclingUserDefault = false;
+ }
+ var submitUrl = WWWROOT + "/disinfectSystem/recyclingRecordAction!inventoryConfirm.do";
+ $.ajax({
+ url : submitUrl,
+ type : "POST",
+ timeout : 300000,
+ dataType :'json',
+ data : {
+ jsonParam : "" + JSON.stringify(jSONe) + "",
+ id : id,
+ recyclingApplicationId : app_id,
+ invoicePlanVersion : $("#invoicePlanVersion").val(),
+ departCode : departCode,
+ recyclingUser : recyclingUser,
+ operator : operator,
+ depart : depart,
+ recyclingTime : recyclingTime,
+ recyclingUserDefault : recyclingUserDefault,
+ autoReturnTheBorrowingTousse : autoReturnTheBorrowingTousse,
+ recyclingAmountConfirm:recyclingAmountConfirm,
+ remark:$('#remarkText').text(),
+ communicationUserName:$('#communicationUserName').val(),
+ communicationUserCode:$('#communicationUserCode').val(),
+ needPrint : print
+ },
+ success : function(result) {
+ if(result.success){
+ if(saveAndNew){
+ location.href = "recycleForTouchScreen.jsp?resolution=" + resolution + "&rememberRecycleUser=" + rememberRecycleUser;
+ }else{
+ location.href = "awaitForRecycleList.jsp?resolution=" + resolution;
+ }
+ }else{
+ alertDiv(result.message);
+ }
+ },
+ error: function(x, t, m) {
+ closeDiv();
+ if(t == "timeout") {
+ alert("提交超时,请重试");
+ } else {
+ alert(t);
+ }
+ }
+ });
+}
+
+/**
* 保存回收记录
*/
function doSaveAction(){
submitFunction(false,false,false,false);
}
-/*Annie 保存清点确认*/
-var IntheBoxState = false;//是否进行清点确认 false 为保存,true 为清点确认
-function submitFunctions(confirmation,saveAndNew,print,recyclingAmountConfirm){
+
+/**
+ * 提交清点确认
+ * @param confirmation 是否清点确认
+ * @param saveAndNew 是否保存并新建
+ * @param print 是否打印
+ * @param recyclingAmountConfirm 是否
+ */
+function submitInventoryConfirm(confirmation,saveAndNew,print,recyclingAmountConfirm){
if(submitChecks()){
//回收物品清单
var recyclingTousses = [];
@@ -3113,7 +3252,7 @@
if (recyclingTousses.length > 0){
//调用提示筐
showRecyclingDetail(recyclingTousses,function(){
- checkAutoReturnBorrowing(confirmation,saveAndNew,print,recyclingAmountConfirm);
+ checkAutoReturnBorrowingForInventoryConfirm(confirmation,saveAndNew,print,recyclingAmountConfirm);
});
}
else{
@@ -3221,7 +3360,7 @@
return false;
}
if(isCleanedEntirelys){
- alertDiv( tousseNames+'包为整包清洗,必须入筐后才能清点确认!');
+ alertDiv( tousseNames+'为整包清洗,必须入筐后才能清点确认!');
return false;
}
if(!isAllTousseInTheBasket){
@@ -3250,9 +3389,11 @@
return true;
}
-
-function IntheBox() {
- submitFunctions(false,false,false,false);
+/**
+ * 清点确认
+ */
+function inventoryConfirm() {
+ submitInventoryConfirm(false,false,false,false);
}
/**
Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp
===================================================================
diff -u -r25980 -r26220
--- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp (.../recycleForTouchScreen.jsp) (revision 25980)
+++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp (.../recycleForTouchScreen.jsp) (revision 26220)
@@ -330,7 +330,7 @@