Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r26343 -r26370 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 26343) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 26370) @@ -8,11 +8,7 @@ if(isHideHospitalNumber != false){ isHideHospitalNumber = true; } -//是否隐藏加急数量(只有config.js的配置为false时才不隐藏,否则都隐藏) -var isHideUrgentAmount = sstsConfig.isHideUrgentAmount; -if(isHideUrgentAmount != false){ - isHideUrgentAmount = true; -} + //器械包申请单的物品视图是否分成两个grid var tousseApplicationFormGridSplit = false; var grid; @@ -60,6 +56,7 @@ * @param specifyDisposableTypes是否包含指定的一次性物品类型,格式:{include:是否包含,disposableTypes:'一次性物品类型集合'} */ function openApplication(form, tousseGroups, specifyDisposableTypes) { + if (!isUndefinedOrNullOrEmpty(form)){ //1、限制同一个科室(供应室除外)只能申请一张申请单 if (sstsConfig.limitApply && form == comboApplicationForm && !isSupplyRoomUser) { @@ -470,6 +467,7 @@ {name : 'middlePackageAmount',mapping : 'middlePackageAmount'}, {name : 'transferScale',mapping : 'transferScale'}, {name : 'urgentAmount',mapping : 'urgentAmount'}, + {name : 'urgentLevel',mapping : 'urgentLevel'}, {name : 'materials',mapping : 'materials'}, {name : 'minApplyAmount',mapping : 'minApplyAmount'}, {name : 'expressInvoice',mapping : 'expressInvoice'}, //是否快速发货 @@ -547,6 +545,7 @@ {name : 'minApplyAmount',mapping : 'minApplyAmount'}, {name : 'maxApplyAmount',mapping : 'maxApplyAmount'}, {name : 'urgentAmount',mapping : 'urgentAmount'}, + {name : 'urgentLevel',mapping : 'urgentLevel'}, {name : 'unit',mapping : 'unit'}, {name : 'price',mapping : 'price'}, {name : 'amount',mapping : 'amount'}] @@ -560,6 +559,7 @@ {name : 'name'}, {name : 'count'}, {name : 'urgentAmount'}, + {name : 'urgentLevel'}, {name : 'minApplyAmount'}, {name : 'maxApplyAmount'}, {name : 'diposable'}, @@ -587,6 +587,7 @@ {name : 'name'}, {name : 'count'}, {name : 'urgentAmount'}, + {name : 'urgentLevel'}, {name : 'price'}, {name : 'status'}, {name : 'hasReturnedNum'}, @@ -653,6 +654,7 @@ {name : 'materials'}, //消毒物品的材料信息 {name : 'materialDefinitionId'},//材料id {name : 'urgentAmount'}, //加急数量 + {name : 'urgentLevel'}, //加急级别 {name : 'children'} //消毒物品的材料信息 ]}); @@ -785,12 +787,15 @@ * @param count 数量 * @param price 价格 * @param urgentAmount 加急数量 + * @param urgentLevel 加急级别 + * @param urgentLevelId 加急级别id * @param para 追加的参数,是一个对象,里面可以有多种属性,方便以后扩展用(目前只有{behavior:操作类型(添加或者提交或者绑定物品),transferScale:中包装单位装换单位系数,middlePackageUnit:申领单位(原来叫中包装单位)}) */ -function updateNode(treegrid, foundNode, count, price, urgentAmount, para){ +function updateNode(treegrid, foundNode, count, price, urgentAmount,urgentLevel,urgentLevelId,para){ var targetNode = foundNode; targetNode.set('urgentAmount', urgentAmount); - + targetNode.set('urgentLevel', urgentLevel); + targetNode.set('urgentLevelId', urgentLevelId); // 如果节点是消毒物品,并且不是整包清洗,则更新其子节点(材料)的数量 if (!targetNode.get('leaf') && targetNode.get('isApplyEntireTousse') != '是'){ //在父节点被子节点覆盖前先把urgentAmount清空 @@ -799,6 +804,8 @@ targetNode = childNodes[0]; //保留父节点的值,清空子节点的值 targetNode.set('urgentAmount', ''); + targetNode.set('urgentLevel', ''); + targetNode.set('urgentLevelId', ''); //传入的价格对拆包的消毒物品来说,是材料的平均价,而这里计算的是材料节点的总价,需要用材料节点的价格 price = targetNode.get('price'); } @@ -858,19 +865,21 @@ * @param minApplyAmount 最小申请数量(只用于一次性物品) * @param maxApplyAmount 最大申请数量(只用于一次性物品) * @param urgentAmount 加急数量 + * @param urgentLevel 加急级别 + * @param urgentLevelId 加急级别id * @param para 追加的参数,是一个对象,里面可以有多种属性,方便以后扩展用(目前只有{behavior:操作类型(添加或者提交或者绑定物品),transferScale:中包装单位装换单位系数,middlePackageUnit:申领单位(原来叫中包装单位)}) * @param expressInvoice 是否快速发货 */ function addItems(tousseDefinitionID,name,count,diposable,isApplyEntireTousse,originalPrice,price,externalCode, - storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,para,expressInvoice){ + storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice){ //1、处理从模板里面找到的(因为前面过滤已经添加的物品,所以剩下的只是模板的物品了) var foundNode = null; var needToCheckNode = {tousseDefinitionID : tousseDefinitionID,name : name,tousseType : tousseType}; var goodsAppDomObj = GoodsAppHelper.getGoodsAppDomObj(); if('是' == diposable){ foundNode = goodsAppDomObj.getExitsNodeByNode(rightTemplateStore, needToCheckNode); if (foundNode != null){ - updateNode('diposableTreeGrid', foundNode, count, price, urgentAmount, para); + updateNode('diposableTreeGrid', foundNode, count, price, urgentAmount,urgentLevel,urgentLevelId, para); } }else{ var tempGrid = 'tousseTreeGrid'; @@ -881,7 +890,7 @@ } if (foundNode != null){ - updateNode(tempGrid, foundNode, count, price,urgentAmount); + updateNode(tempGrid, foundNode, count, price,urgentAmount,urgentLevel,urgentLevelId); if(tousseType == tousseType_disinfectGoods){ updateDisinfectParentNode(foundNode, para); } @@ -909,6 +918,8 @@ name : name, count : pacakgeCount, urgentAmount : urgentAmount, + urgentLevel : urgentLevel, + urgentLevelId:urgentLevelId, diposable : diposable, tousseType : tousseType, isApplyEntireTousse : isApplyEntireTousse, @@ -954,6 +965,8 @@ minApplyAmount : minApplyAmount, maxApplyAmount : maxApplyAmount, urgentAmount : urgentAmount, + urgentLevel : urgentLevel, + urgentLevelId:urgentLevelId, totalPrice: isUndefinedOrNullOrEmpty(transferScale) ? roundValue(price*count) : roundValue(price*count*transferScale), packageSpec:packageSpec }); @@ -973,7 +986,7 @@ tempGrid = 'diposableTreeGrid'; } - updateNode(tempGrid, appendNode, count, price, urgentAmount); + updateNode(tempGrid, appendNode, count, price, urgentAmount,urgentLevel,urgentLevelId); if(tousseType == tousseType_disinfectGoods){ updateDisinfectParentNode(appendNode, para); } @@ -1020,6 +1033,8 @@ var tousseType = top.Ext4.getCmp('tousseType').getValue(); var materials = top.Ext4.getCmp('materials').getValue(); var urgentAmount = top.Ext4.getCmp('urgentAmount').getValue(); + var urgentLevel = top.Ext4.getCmp('urgentLevel').getRawValue(); + var urgentLevelId = top.Ext4.getCmp('urgentLevel').getValue(); var transferScale = top.Ext4.getCmp('transferScale').getValue(); var middlePackageUnit = top.Ext4.getCmp('middlePackageUnit').getValue(); @@ -1061,6 +1076,12 @@ top.Ext4.getCmp('count1').setValue(""); top.Ext4.getCmp('count1').focus(); return false; + }else if(sstsConfig.enableUrgentFunction && !Ext4.isEmpty(urgentAmount) && Ext4.isEmpty(urgentLevel)){ + showResult("加急级别不能为空!"); + return false; + }else if(sstsConfig.enableUrgentFunction && !Ext4.isEmpty(urgentLevel) && Ext4.isEmpty(urgentAmount)){ + showResult("加急数量不能为空!"); + return false; }else{ //库存数量(说明:如果storageUseStorageSubtractWaitDeliver配置成true则:库存=现有的库存-待发货数量) var storageAmount = sstsConfig.storageUseStorageSubtractWaitDeliver ? findStorageByDisposeIdAndHandleDepartCode(id) : parseInt(top.Ext4.getCmp('diposableGoodsAmount').getValue(),10); @@ -1085,16 +1106,16 @@ if (btn != 'yes') { return false; }else{ - addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,para,expressInvoice); + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice); afterAddItem(true); } }); }else{ - addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,para,expressInvoice); + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice); afterAddItem(true); } }else{ - addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,para,expressInvoice); + addItems(id,name,count,isDiposableGoods,isApplyEntireTousse,originalPrice,price,externalCode,storageAmount,tousseType,materials,unit,packageSpec,minApplyAmount,maxApplyAmount,urgentAmount,urgentLevel,urgentLevelId,para,expressInvoice); afterAddItem(true); } } @@ -1122,6 +1143,7 @@ goodsBindHandler.handleBindGood(); } top.Ext4.getCmp('urgentAmount').setValue(''); + top.Ext4.getCmp('urgentLevel').setValue(''); top.Ext4.getCmp('diposableGoodsAmount').setValue(''); top.Ext4.getCmp('minApplyAmount').setValue(''); top.Ext4.getCmp('maxApplyAmount').setValue(''); @@ -1273,6 +1295,8 @@ obj.tousseType = node.get("tousseType"); obj.externalCode = node.get("externalCode"); obj.urgentAmount = node.get("urgentAmount"); + obj.urgentLevel = node.get("urgentLevel"); + obj.urgentLevelId = node.get("urgentLevelId"); obj.storage = node.get("storage"); obj.transferScale = node.get("transferScale"); obj.minUnit = node.get("minUnit"); @@ -1317,6 +1341,7 @@ tr += "