Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js
===================================================================
diff -u -r28072 -r28153
--- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 28072)
+++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 28153)
@@ -4476,6 +4476,42 @@
return canEmpty;
}
+/*加载选择模板下拉框的数据*/
+function loadTemplateSelectData(){
+ if(sstsConfig.isOpenLoadTemplateByUnit){
+ var appType = $("#appType").val();
+ if(appType == ""){//为空代表是回收申请单
+ $('.departmentTemplate').show();
+ var departCode2 = $("#departCode").val();
+ var depart2 = $("#depart").val();
+ if(depart2 !="" ){
+ $.ajax({
+ type:'get',
+ url : WWWROOT + '/disinfectSystem/baseData/departmentAppTemplateAction!loadDepartmentTemplateTitle.do',
+ data:{
+ departmentCode:departCode2,
+ type:"回收申请单"
+ },
+ success:function(result){
+ var result = JSON.parse(result);
+ if(result.success){
+ $('#departmentTemplate').html("");
+ for(var i = 0;i < result.data.length;i++){
+ var str = "";
+ str += "";
+ $('#departmentTemplate').append(str);
+ }
+
+ }
+ },
+ error:function(msg){
+ }
+ });
+ }
+ }
+ }
+}
+
/*根据科室编码加载该科室绑定的清洗篮筐*/
function loadWashBasketsByDepartCode(departCode){
$.ajax({
@@ -4549,6 +4585,7 @@
document.getElementById('departCode').value = departCode;
}
+ loadTemplateSelectData();
emptyTousseItemTable();
// $("#tousseItemTable").empty();
if(dataArray.length > 0){
@@ -4592,6 +4629,116 @@
}
}
+$(function(){
+ if(sstsConfig.isOpenLoadTemplateByUnit){
+ $("#departmentTemplate").change(function(){
+ var requestParms = {};
+ requestParms.templateId = $('#departmentTemplate').val();
+ if($('#departmentTemplate').val() == 0){//当选择全部的时候,需要传科室编码orgUnitCoding和选择的模板templateId 2个参数
+ requestParms.orgUnitCoding =$("#departCode").val();
+ }
+
+ $.ajax({
+ type:'get',
+ url:WWWROOT + '/disinfectSystem/recyclingRecordAction!loadDepartmentAppTemplateForRecycle.do',
+ data:requestParms,
+ dataType:'json',
+ success:function(dataArray){
+ if(dataArray.length > 0){
+ //获取页面显示的每个包
+ var tousseItemsTable2 = $('#tousseItemTable').children().first().children();
+ var tousseItemsTable2length = tousseItemsTable2.length;
+
+ var hasCloumns = [];//存数量大于等于1的tousseDefinitionID
+ var hasCloumsObjs = [];//存数量大于等于1的对象
+
+ for (var j = 0; j < tousseItemsTable2.length; j++) {
+ var recycleAmountVal = parseInt($('#recycleAmount'+j).val(), 10);
+ if(recycleAmountVal >= 1){
+ hasCloumns.push($('#tousseDefinitionID' + j).val());
+
+ var obj = {};
+ obj.tousseItemId = "";
+ obj.tousseName = $("#tousseName" + j).val();
+ obj.tousseDefinitionID = $("#tousseDefinitionID" + j).val();
+ obj.applicationAmount = $("#applicationAmount" + j).val();
+ obj.recycleAmount = recycleAmountVal;
+ obj.loadedAmount = $("#loadedAmount" + j).val();
+ obj.isCleanedEntirely = $("#isCleanedEntirely" + j).val();
+ obj.tousseType = $("#tousseType" + j).val();
+ obj.isThereIdentificationCard = $("#isThereIdentificationCard" + j).val();
+ obj.isApplyEntireTousse = $("#isApplyEntireTousse" + j).val();
+ obj.urgentAmount = $("#urgentAmount" + j).val();
+ obj.tousseRemark = $("#tousseRemark" + j).val();
+ obj.errorDamageQmKey = $("#hiddenErrorDamageQmKey" + j).val();
+ obj.spelling = $("#spelling" + j).val();
+
+ hasCloumsObjs.push(obj);
+
+ }
+ $('#tousseItemsTr'+j).remove();//把全部都删掉,后面挨个添加,先添加数量大于等于1,再添加接口返回的
+ }
+
+
+ var addColumnArr = [];//用来增加的数据
+ if (hasCloumns.length > 0) {
+ //先获取到大于等于1的包的,循环拿到row,赋值给大于等于1的对象的row,保证这个id唯一和连续
+ for (var m = 0; m < hasCloumns.length; m++) {
+ var myObj = hasCloumsObjs[m];
+ myObj.row = m;
+ addColumnArr.push(myObj);
+ }
+ }
+ //获取到大于等于1的数组的长度,后面每次加一下,就是新增加的包的row
+ var totalLength = hasCloumns.length - 1;
+ for(var i =0;i < dataArray.length; i++){
+ //没找到,就是数量大于等于1的id,在后台返回的数据中没有,这时候就需要直接取到后台数据,增加到页面上
+ if(hasCloumns.indexOf(dataArray[i].tousseDefinitionID + "") == -1){
+ totalLength++;
+ var timeStr = new Date().getTime();
+ var errorDamageQmKey = dataArray[i].tousseDefinitionID + "_" + timeStr;
+ var toussItem = {
+ row: totalLength,
+ tousseItemId: '',
+ tousseName: dataArray[i].tousseName,
+ tousseDefinitionID: dataArray[i].tousseDefinitionID,
+ applicationAmount: 0,
+ recycleAmount: 0,
+ loadedAmount: 0,
+ isCleanedEntirely: dataArray[i].isCleanedEntirely,
+ tousseType: dataArray[i].tousseType,
+ isThereIdentificationCard: dataArray[i].isThereIdentificationCard,
+ isApplyEntireTousse: dataArray[i].isApplyEntireTousse,
+ urgentAmount : 0,
+ tousseRemark : '',
+ errorDamageQmKey : errorDamageQmKey,
+ spelling : dataArray[i].spelling
+ };
+ addColumnArr.push(toussItem);
+ }
+ }
+
+ for (var i = 0; i < addColumnArr.length; i++) {
+ var addColumnObj = addColumnArr[i];
+ //统一增加的原因,是防止下次去拿数据的时候,拿到刚增加进去的数据
+ addToussItem(addColumnObj, true);
+ }
+
+ //恢复点击入筐后,回收数量和装配数量背景色的控制,因为前面删掉了全部的数据
+ if(hasCloumns.length > 0){
+ for(var k=0;k
@@ -453,6 +467,12 @@
+
+
+
+
Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationForm.js
===================================================================
diff -u -r28031 -r28153
--- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationForm.js (.../goodsApplicationForm.js) (revision 28031)
+++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationForm.js (.../goodsApplicationForm.js) (revision 28153)
@@ -17,7 +17,7 @@
});
urgentLevelStore.load();
/**
- * 添加申请单或者修改申请单(目前只有:“通用申请单”、“器械包申请单”、“敷料包申请单”、“消毒物品申请单”、“一次性物品申请单”、“专科器械申请单”这六种申请单会调用此方法).
+ * 添加申请单或者修改申请单(目前只有:“通用申请单”、“器械包申请单”、“敷料包申请单”、“消毒物品申请单”、“一次性物品申请单”、“专科器械申请单”、“物品预约单”这六种申请单会调用此方法).
* @param id 申请单id
* @param deptCoding 申请科室的科室编码(如果是添加则是登录用户的当前科室编码)
* @param depart 申请科室的科室名称(如果是添加则是登录用户的当前科室名称)
@@ -39,6 +39,14 @@
if ((sstsConfig.tousseApplicationFormGridSplit && type == tousseApplicationForm) || (sstsConfig.tousseApplicationFormGridSplit && type == reservateionApplicationForm)) {
tousseApplicationFormGridSplit = true;
}
+ //配置项isOpenLoadTemplateByUnit为true并且是如下几种申请单,通用申请单,器械包申请单,一次性物品申请单,物品预约单,回收申请单,就显示选择模板按钮
+ var isShowAddTemplateBtn = true;
+ if(sstsConfig.isOpenLoadTemplateByUnit && (type == comboApplicationForm || type == tousseApplicationForm || type == diposableGoodsApplicationForm || type == reservateionApplicationForm
+ || type == recyclingCreateApplicationForm || type == disinfectGoodsApplicationForm
+ )){
+ isShowAddTemplateBtn = false;
+ }
+
//登录用户的当前科室编码
var departCoding = $Id('departCoding').value;
@@ -60,7 +68,7 @@
proxy : {
type : 'ajax',
url : WWWROOT + '/disinfectSystem/baseData/departmentAppTemplateAction!loadDepartmentTemplateTitleJson.do',
- extraParams : {departmentCode : departCoding,type:type},
+ //extraParams : {departmentCode : departCoding,type:type},
reader : {
type : 'json',
totalProperty : 'totalCount'
@@ -69,7 +77,27 @@
fields : [
{name : 'id',mapping : 'id'},
{name : 'title',mapping : 'title'}
- ]
+ ],
+ listeners: {
+ beforeload : function(store, operation, eOpts){
+ var departCoding2;
+ if(top.Ext4.getCmp('depart').getValue() == ""){//申请科室为空,那么模板下拉框也为空
+ departCoding2 = "";
+ }else{
+ departCoding2 = top.Ext4.getCmp('departCoding').getValue();
+ }
+
+ store.proxy.extraParams.departmentCode = departCoding2;
+ store.proxy.extraParams.type = type;
+ },
+ load : function(store, records, eOpts){
+ if(top.Ext4.getCmp('depart').getValue() != ""){
+ top.Ext4.getCmp("departmentTemplate").setValue(records[0].data.id);//设置为全部模板
+ top.Ext4.getCmp("departmentTemplate").setRawValue(records[0].data.title);
+ }
+
+ }
+ }
});
//项目的store
@@ -1644,24 +1672,30 @@
}
},{
text : '选择模板:',
- hidden:((type == comboApplicationForm || type == tousseApplicationForm || type == reservateionApplicationForm) ? true : (!isFirstSupplyRoomUser))
+ //hidden:((type == comboApplicationForm || type == tousseApplicationForm || type == reservateionApplicationForm) ? true : (!isFirstSupplyRoomUser))
+ hidden:isShowAddTemplateBtn
},{
xtype : 'combo',
valueField : 'id',
displayField : 'title',
store : departmentTemplateTitleStore,
forceSelection : true,
- hidden:((type == comboApplicationForm || type == tousseApplicationForm || type == reservateionApplicationForm) ? true:(!isFirstSupplyRoomUser)),
+ // hidden:((type == comboApplicationForm || type == tousseApplicationForm || type == reservateionApplicationForm) ? true:(!isFirstSupplyRoomUser)),
+ hidden:isShowAddTemplateBtn,
triggerAction : 'all',
name : "departmentTemplate",
id : "departmentTemplate",
width : 130,
//width : configWinWidth/6-10,
anchor : '95%',
- editable:false,
+ //editable:false,
listeners : {
select : function(combo, records, index) {
- loadProduction({templateId:records[0].data.id}, true);
+ var par = {
+ templateId:records[0].data.id,
+ reloadTemplate:top.Ext4.getCmp("departCoding").getValue()
+ }
+ loadProduction(par, true);
}
}
},{
@@ -1881,7 +1915,10 @@
if (!isOpenLoadTemplateByUnit){
departCode = '';
+ }else{
+ departmentTemplateTitleStore.load();
}
+
var paramete = {
handleDepartCoding: top.Ext4.getCmp("handleDepartCoding").getValue(),
reloadTemplate: departCode
@@ -2160,11 +2197,21 @@
if (records && records.length > 0) {
top.Ext4.getCmp("depart").setValue(depart);
top.Ext4.getCmp("departCoding").setValue(departCoding);
+ departmentTemplateTitleStore.load();
}
handleDepartStore.load({
callback: function(records, operation, success) {
setDefaultHandleDepart(records);
- loadProduction({}, false);
+ var param = {};
+ if(sstsConfig.isOpenLoadTemplateByUnit && (type == comboApplicationForm || type == tousseApplicationForm || type == diposableGoodsApplicationForm || type == reservateionApplicationForm
+ || type == recyclingCreateApplicationForm || type == disinfectGoodsApplicationForm
+ )){
+ var param = {
+ reloadTemplate: top.Ext4.getCmp("departCoding").getValue()
+ };
+ }
+
+ loadProduction(param, false);
}
});
}
@@ -2204,7 +2251,15 @@
handleDepartStore.load({
callback: function(records, operation, success) {
setDefaultHandleDepart(records);
- loadProduction({}, false);
+ var param = {};
+ if(sstsConfig.isOpenLoadTemplateByUnit && (type == comboApplicationForm || type == tousseApplicationForm || type == diposableGoodsApplicationForm || type == reservateionApplicationForm
+ || type == recyclingCreateApplicationForm || type == disinfectGoodsApplicationForm
+ )){
+ var param = {
+ reloadTemplate: top.Ext4.getCmp("departCoding").getValue()
+ };
+ }
+ loadProduction(param, false);
}
});
}
@@ -2236,7 +2291,7 @@
top.Ext4.getCmp("depart").setValue(recyclingApplication.depart);
top.Ext4.getCmp("departCoding").setValue(recyclingApplication.departCoding);
-
+ departmentTemplateTitleStore.load();
//simon-add:根据申请科室编码查找此申请科室设置的默认结算科室;如果没有配置默认的结算科室,那么结算科室默认显示为可结算的申请科室
top.Ext4.getCmp("settleAccountsDepartCoding").setValue(recyclingApplication.settleAccountsDepartCoding);
top.Ext4.getCmp("settleAccountsDepart").setValue(recyclingApplication.settleAccountsDepart);
@@ -2325,11 +2380,11 @@
var rightTemp = getApplyGoods(rightTemplateStore);
var disposableFloatPercent = result.disposableFloatPercent;
if (!isUndefinedOrNullOrEmpty(leftTemp)){
- var newLeft = iterData(result.leftStore.children, leftTemp);
+ var newLeft = iterData(result.leftStore.children, leftTemp,type);
result.leftStore.children = reCalculatePrice(newLeft, disposableFloatPercent);
}
if (!isUndefinedOrNullOrEmpty(rightTemp)){
- var newRight = iterData(result.rightStore.children, rightTemp);
+ var newRight = iterData(result.rightStore.children, rightTemp,type);
result.rightStore.children = reCalculatePrice(newRight, disposableFloatPercent);
}
}
@@ -2378,6 +2433,21 @@
}
});
result = result.concat(newDatas);
+
+ //模板已经申请的要置顶
+ if(sstsConfig.isOpenLoadTemplateByUnit && (type == comboApplicationForm || type == tousseApplicationForm || type == diposableGoodsApplicationForm || type == reservateionApplicationForm
+ || type == recyclingCreateApplicationForm || type == disinfectGoodsApplicationForm)){
+ var beforeShowData = [];
+ var lastShowData = [];
+ for(var i = 0; i < result.length; i++){
+ if(result[i].count > 0){
+ beforeShowData.push(result[i]);
+ }else{
+ lastShowData.push(result[i]);
+ }
+ }
+ result = beforeShowData.concat(lastShowData);
+ }
return result;
}
/**