Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r20735 -r20772 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 20735) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 20772) @@ -316,6 +316,23 @@ {hidden :SSTS_DisposableGoodSsettleAccounts_Manager,text:"一次性物品结算管理",href:WWWROOT+'/disinfectsystem/reportforms/stocktakeView.jsp',hrefTarget:linkTarget,leaf:true} ] },{ + text:"高值耗材管理", + singleClickExpand:singleClickExpandTree, + hidden:!sstsConfig.enableExpensiveGoods, + children:[ + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材使用记录",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveDisposableGoodsUseRecordView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材库存",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsStockView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods || !sstsConfig.enableBatchStockCompare,text:"库存对比",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/batchStockCompare.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材出入库记录",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材入库单管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/godownEntryView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材退库单管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/godownOutView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材调拨单管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/appropriationView.jsp',hrefTarget:linkTarget,leaf:true}, + //{hidden :SSTS_DisposableGoodsProfitAndLoss_Manager,text:"高值耗材盘盈盘亏管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/godownStockTakeView.jsp',hrefTarget:linkTarget,leaf:true}, + //{hidden :SSTS_DisposableGoodsCheck_Manager,text:"高值耗材盘点管理",href:WWWROOT+'/disinfectsystem/stocktakerecordmanager/'+ (sstsConfig.inventoryDisposableVersion == 2 ? "inventoryrecordView2.jsp" : "inventoryrecordView.jsp") +'?type=expensiveGoods',hrefTarget:linkTarget,leaf:true}, + {hidden :!sstsConfig.enableExpensiveGoods,text:"高值耗材结算管理",href:WWWROOT+'/disinfectsystem/reportforms/stocktakeView.jsp',hrefTarget:linkTarget,leaf:true} + ] +},{ text:"采购计划", singleClickExpand:singleClickExpandTree, hidden:SSTS_PurchasePlan_Manager, Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsStockManagerImpl.java =================================================================== diff -u -r20747 -r20772 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsStockManagerImpl.java (.../ExpensiveGoodsStockManagerImpl.java) (revision 20747) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsStockManagerImpl.java (.../ExpensiveGoodsStockManagerImpl.java) (revision 20772) @@ -13,54 +13,45 @@ import java.util.regex.Matcher; import java.util.stream.Collectors; -import com.forgon.directory.model.OrgUnit; -import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; -import com.forgon.disinfectsystem.common.CssdUtils; -import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse; -import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; - -import net.sf.json.JSONObject; - import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Service; import com.forgon.directory.acegi.tools.AcegiHelper; +import com.forgon.directory.model.OrgUnit; import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; +import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; +import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoodsStock; -import com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig; +import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse; import com.forgon.disinfectsystem.expensiveGoods.util.ExpensiveGoodsUtils; import com.forgon.security.tools.Util; import com.forgon.tools.Constants; -import com.forgon.tools.MathTools; import com.forgon.tools.SqlBuilder; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.string.StringTools; import com.forgon.tools.util.SqlUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.log4j.Logger; - -import javax.annotation.Resource; - +@Service("expensiveGoodsStockManagerTarget") public class ExpensiveGoodsStockManagerImpl implements ExpensiveGoodsStockManager { protected Logger logger = Logger.getLogger(this.getClass()); private ObjectDao objectDao; - private ExpensiveGoodsBatchStockManager diposableGoodBatchStockManager; - private SupplyRoomConfigManager supplyRoomConfigManager; private WareHouseManager wareHouseManager; - private ExpensiveGoodsManager diposableGoodsManagerTarget; + private ExpensiveGoodsManager expensiveGoodsManager; - public void setDiposableGoodsManagerTarget(ExpensiveGoodsManager diposableGoodsManagerTarget) { - this.diposableGoodsManagerTarget = diposableGoodsManagerTarget; + public void setExpensiveGoodsManager(ExpensiveGoodsManager expensiveGoodsManager) { + this.expensiveGoodsManager = expensiveGoodsManager; } public void setWareHouseManager(WareHouseManager wareHouseManager) { @@ -71,11 +62,6 @@ this.objectDao = objectDao; } - public void setDiposableGoodBatchStockManager( - ExpensiveGoodsBatchStockManager diposableGoodBatchStockManager) { - this.diposableGoodBatchStockManager = diposableGoodBatchStockManager; - } - public void setSupplyRoomConfigManager( SupplyRoomConfigManager supplyRoomConfigManager) { this.supplyRoomConfigManager = supplyRoomConfigManager; @@ -268,21 +254,21 @@ String displayName; - if (showReferencePrice) { - double referencePrice = resultSet.getDouble("referencePrice"); - temp.put("referencePrice", referencePrice); - - // 价格修改为浮动价格 - Double price = diposableGoodBatchStockManager.getEarliestPrice(disposableGoodsStockId,referencePrice); - price = MathTools.mul(price, floatPercent).doubleValue(); - temp.put("price", price); - displayName = getDisposableGoodsStockDisplayName(name,specification,price,packageSpec,damount); - }else{ - displayName = getDisposableGoodsStockDisplayName(name,specification,damount); - } +// if (showReferencePrice) { +// double referencePrice = resultSet.getDouble("referencePrice"); +// temp.put("referencePrice", referencePrice); +// +// // 价格修改为浮动价格 +// Double price = diposableGoodBatchStockManager.getEarliestPrice(disposableGoodsStockId,referencePrice); +// price = MathTools.mul(price, floatPercent).doubleValue(); +// temp.put("price", price); +// displayName = getDisposableGoodsStockDisplayName(name,specification,price,packageSpec,damount); +// }else{ +// displayName = getDisposableGoodsStockDisplayName(name,specification,damount); +// } +// +// temp.put("displayName", displayName); - temp.put("displayName", displayName); - return temp; } /** @@ -345,7 +331,7 @@ // 省医需求:一次性物品库存数量 = 原来的库存数量 - 待发货的数量 if (ObjectUtils.equals("true", CssdUtils.getSystemSetConfigByName("storageUseStorageSubtractWaitDeliver"))){ logger.info("原来的库存是:" + storage); - storage = diposableGoodsManagerTarget.reCalculateStorageAmount(Long.parseLong(disposableGoodsId), storage); + storage = expensiveGoodsManager.reCalculateStorageAmount(Long.parseLong(disposableGoodsId), storage); logger.info("重新计算后的库存是:" + storage); } return storage; Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java =================================================================== diff -u -r20747 -r20772 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 20747) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 20772) @@ -35,6 +35,7 @@ import org.hibernate.LockMode; import org.hibernate.Query; import org.hibernate.Session; +import org.springframework.stereotype.Service; import com.forgon.attachfile.service.AttachFileManager; import com.forgon.databaseadapter.service.DateQueryAdapter; @@ -87,6 +88,8 @@ import com.forgon.tools.string.StringTools; import com.forgon.tools.util.SqlUtils; + +@Service("expensiveGoodsManagerTarget") public class ExpensiveGoodsManagerImpl extends BasePoManagerImpl implements ExpensiveGoodsManager { protected Logger logger = Logger.getLogger(this.getClass()); @@ -95,16 +98,13 @@ private AttachFileManager attachFileManager; - private ExpensiveGoodsBatchStockManager diposableGoodBatchStockManager; private SupplyRoomConfigManager supplyRoomConfigManager; - private InitDbConnection dbConnection; private SerialNumManager serialNumManager; - private ExpensiveGoodsStockManager expensiveGoodssStockManager; private WareHouseManager wareHouseManager; @@ -134,10 +134,7 @@ this.httpOptionManager = httpOptionManager; } - public void setDiposableGoodBatchStockManager( - ExpensiveGoodsBatchStockManager diposableGoodBatchStockManager) { - this.diposableGoodBatchStockManager = diposableGoodBatchStockManager; - } + public void setSupplyRoomConfigManager( SupplyRoomConfigManager supplyRoomConfigManager) { @@ -152,11 +149,6 @@ this.serialNumManager = serialNumManager; } - public void setExpensiveGoodsStockManager( - ExpensiveGoodsStockManager expensiveGoodssStockManager) { - this.expensiveGoodssStockManager = expensiveGoodssStockManager; - } - public void setDateQueryAdapter(DateQueryAdapter dateQueryAdapter) { this.dateQueryAdapter = dateQueryAdapter; } Index: ssts-web/src/main/webapp/WEB-INF/dwr.xml =================================================================== diff -u -r20735 -r20772 --- ssts-web/src/main/webapp/WEB-INF/dwr.xml (.../dwr.xml) (revision 20735) +++ ssts-web/src/main/webapp/WEB-INF/dwr.xml (.../dwr.xml) (revision 20772) @@ -331,9 +331,11 @@ + + + + - - Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveDisposableGoodsUseRecordView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveDisposableGoodsUseRecordView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveDisposableGoodsUseRecordView.jsp (revision 20772) @@ -0,0 +1,61 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods,com.forgon.Constants"%> + + + + +一次性物品信息 + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/batchStockCompare.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/batchStockCompare.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/batchStockCompare.jsp (revision 20772) @@ -0,0 +1,42 @@ +<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.GodownEntryItem"%> +<%@page import="com.forgon.disinfectsystem.entity.basedatamanager.supplier.Supplier,com.forgon.disinfectsystem.entity.assestmanagement.GodownEntry "%> +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ include file="/common/include_Ext42_Css.jsp"%> +<%@ page import="com.forgon.tools.SpringBeanManger" %> + +<%@ include file="/common/includeExtJs4_2.jsp"%> + + + +库存对比信息 + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+ + + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsDemo.xls =================================================================== diff -u Binary files differ Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsPurchaseTableManager.java =================================================================== diff -u -r20747 -r20772 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsPurchaseTableManager.java (.../ExpensiveGoodsPurchaseTableManager.java) (revision 20747) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsPurchaseTableManager.java (.../ExpensiveGoodsPurchaseTableManager.java) (revision 20772) @@ -9,13 +9,12 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; import com.forgon.component.grid.GridManager; import com.forgon.databaseadapter.service.DateQueryAdapter; import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; -import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; -import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoodsStock; import com.forgon.disinfectsystem.entity.assestmanagement.GoodPurchaseItem; import com.forgon.disinfectsystem.entity.assestmanagement.GoodPurchasePlan; import com.forgon.disinfectsystem.entity.basedatamanager.materialdefinition.MaterialDefinition; @@ -31,6 +30,7 @@ * @author kzh * */ +//@Service public class ExpensiveGoodsPurchaseTableManager { private GridManager gridManager; Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsGodownEntryTableManager.java =================================================================== diff -u -r20747 -r20772 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsGodownEntryTableManager.java (.../ExpensiveGoodsGodownEntryTableManager.java) (revision 20747) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsGodownEntryTableManager.java (.../ExpensiveGoodsGodownEntryTableManager.java) (revision 20772) @@ -10,23 +10,24 @@ import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; import com.forgon.component.grid.GridManager; import com.forgon.databaseadapter.service.DateQueryAdapter; import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; -import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; import com.forgon.disinfectsystem.entity.assestmanagement.GodownEntry; import com.forgon.disinfectsystem.entity.assestmanagement.GodownEntryItem; import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse; -import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsManager; import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsGodownEntryItemManager; import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsGodownEntryManager; +import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsManager; import com.forgon.disinfectsystem.vo.PriceAmount; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.json.JSONUtil; import com.forgon.tools.util.SqlUtils; +//@Service public class ExpensiveGoodsGodownEntryTableManager { private GridManager gridManager; Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/disposableGoodsStockView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/disposableGoodsStockView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/disposableGoodsStockView.jsp (revision 20772) @@ -0,0 +1,63 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods,com.forgon.Constants"%> + + + + +一次性物品信息 + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsWarningView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsWarningView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsWarningView.jsp (revision 20772) @@ -0,0 +1,54 @@ +<%@page import="com.forgon.disinfectsystem.entity.systemwarning.SystemWarningItemVO"%> +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods"%> + + + + +一次性物品信息 + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> +<% + String queryType = request.getParameter("queryType"); + request.setAttribute("queryType", queryType); + %> + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ + \ No newline at end of file Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsTableManager.java =================================================================== diff -u -r20747 -r20772 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsTableManager.java (.../ExpensiveGoodsTableManager.java) (revision 20747) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsTableManager.java (.../ExpensiveGoodsTableManager.java) (revision 20772) @@ -7,7 +7,6 @@ import java.util.Calendar; import java.util.Date; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -16,41 +15,37 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.directwebremoting.util.Logger; +import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSONArray; import com.forgon.component.grid.GridManager; import com.forgon.databaseadapter.service.DateQueryAdapter; import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; -import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoodsBatch; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoodsBatchStock; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoodsStock; import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveDisposablegoods; import com.forgon.disinfectsystem.entity.basedatamanager.datasynchronization.HisMaterialDefinition; import com.forgon.disinfectsystem.entity.basedatamanager.datasynchronization.HisMaterialType; import com.forgon.disinfectsystem.entity.systemwarning.SystemWarningItemVO; -import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsBatchStockManager; import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsManager; import com.forgon.disinfectsystem.expensiveGoods.util.ExpensiveGoodsUtils; import com.forgon.systemsetting.model.HttpOption; import com.forgon.systemsetting.service.HttpOptionManager; import com.forgon.tools.SpringBeanManger; import com.forgon.tools.hibernate.ObjectDao; -import com.forgon.tools.json.JSONUtil; import com.forgon.tools.util.ForgonStringUtils; import com.forgon.tools.util.SqlUtils; +@Service public class ExpensiveGoodsTableManager { - private ExpensiveGoodsBatchStockManager diposableGoodBatchStockManager; - private GridManager gridManager; - private ExpensiveGoodsManager diposableGoodsManager; + private ExpensiveGoodsManager expensiveGoodsManager; private DateQueryAdapter dateQueryAdapter; - private WareHouseManager wareHouseManager; private ObjectDao objectDao; @@ -59,18 +54,12 @@ this.dateQueryAdapter = dateQueryAdapter; } - public void setDiposableGoodBatchStockManager( - ExpensiveGoodsBatchStockManager diposableGoodBatchStockManager) { - this.diposableGoodBatchStockManager = diposableGoodBatchStockManager; - } - public void setGridManager(GridManager gridManager) { this.gridManager = gridManager; } - public void setDiposableGoodsManager( - ExpensiveGoodsManager diposableGoodsManager) { - this.diposableGoodsManager = diposableGoodsManager; + public void setExpensiveGoodsManager(ExpensiveGoodsManager expensiveGoodsManager) { + this.expensiveGoodsManager = expensiveGoodsManager; } public void setWareHouseManager(WareHouseManager wareHouseManager) { @@ -293,94 +282,14 @@ return json; } - public String[] getBatchNumbersByDiposableGoodsId(String id, - boolean selectAll) { - List batchStocks = diposableGoodBatchStockManager - .getDisposableGoodsBatchStockByDisposableGoodsId(id, selectAll); - String[] batchNumbers = new String[batchStocks.size()]; - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - for (int i = 0; i < batchStocks.size(); i++) { - DisposableGoodsBatchStock batchStock = batchStocks.get(i); - batchNumbers[i] = batchStock.getBatchNumber() - + ";" - + (batchStock.getCost() != null ? batchStock.getCost() : "") - + ";" - + (batchStock.getSupplierName() != null ? batchStock - .getSupplierName() : "") - + ";" - + (batchStock.getExpDate() != null ? dateFormat - .format(batchStock.getExpDate()) : ""); - } - return batchNumbers; - } - public String getBatchsByDiposableGoodsId(String id, - boolean selectAll) { - List batchStocks = diposableGoodBatchStockManager - .getDisposableGoodsBatchStockByDisposableGoodsId(id, selectAll); - String batchs = "[]"; - if(batchStocks != null){ - batchs = JSONUtil.toJSONStringEx(batchStocks,true,DisposableGoodsBatchStock.filterProperties); - } - return batchs; - } - /** - * 根据一次性物品id及仓库查询一次性物品批次库存信息 - * @param id - * @param warehouseId - * @param selectAll - * @return - */ - public String getBatchsByDiposableGoodsIdAndWarehouseId(String disposableGoodsId,String warehouseId, - boolean selectAll) { - List batchStocks = diposableGoodBatchStockManager - .getDisposableGoodsBatchStockByDisposableGoodsId(disposableGoodsId,warehouseId, selectAll); - String batchs = "[]"; - if(batchStocks != null){ - batchs = JSONUtil.toJSONStringEx(batchStocks,true,DisposableGoodsBatchStock.filterProperties); - } - return batchs; - } - /** - * 根据一次性物品定义的id获取批次 - * @param id 一次性物品定义id - * @param wareHouseId 仓库id - * @param selectAll 是获取所有还是只获取供应室可以申请的 - * @return - */ - public String getBatchsByDisposableGoodsIDAndWareHouse(String disposableGoodsId,String wareHouseId, - boolean selectAll){ - List batchStocks = diposableGoodBatchStockManager - .getDisposableGoodsBatchStockByDisposableGoodsId(disposableGoodsId,wareHouseId, selectAll); - String batchs = "[]"; - if(batchStocks != null){ - batchs = JSONUtil.toJSONStringEx(batchStocks,true,DisposableGoodsBatchStock.filterProperties); - } - return batchs; - } - public String getExpDateByDiposableGoodsId_batcherNum(String id, - String batcherNumber) { - java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( - "yyyy-MM-dd"); - String dateStr = ""; - List batchStocks = diposableGoodBatchStockManager - .getDisposableGoodsBatchStockByDisposableGoodsId(id, false); - if (batchStocks.size() != 0) { - for (DisposableGoodsBatchStock batchStock : batchStocks) { - if (batchStock.getBatchNumber().equals(batcherNumber)) { - dateStr = sdf.format(batchStock.getExpDate()); - } - } - } - return dateStr; - } /** * */ public String updateOldData() { - return diposableGoodsManager.updateOldData(); + return expensiveGoodsManager.updateOldData(); } /** Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.js (revision 20772) @@ -0,0 +1,190 @@ +var grid; + +// 全部一次性物品 +var allDiposableGoodsStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsData.do?allItems=yes', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'spelling',mapping : 'spelling'}, + {name : 'name',mapping : 'name'}, + {name : 'displayName',mapping : 'displayName'}, + {name : 'referencePrice',mapping : 'referencePrice'} + ]) +}); + +// 科室能申请的一次性物品 +var diposableGoodsStore = new Ext.data.Store({ + pageSize : 100, + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsData.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'spelling',mapping : 'spelling'}, + {name : 'name',mapping : 'name'}, + {name : 'displayName',mapping : 'displayName'}, + {name : 'referencePrice',mapping : 'referencePrice'} + ]) +}); + +Ext.onReady(function() { + Ext.QuickTips.init(); + + var storageRecord = new StorageRecord(); + + var dt = new Date(); + var v = dt.getMonth()+1; + if(v < 10){ + v = "0" + (dt.getMonth()+1); + } + var startDayofMonth = dt.getFullYear() + "/" + v + "/01"; + var form = new Ext.Panel({ + id : 'northPanel', + layout : 'table', + frame : true, + region : 'north', + border : false, + bodyBorder : false, + layoutConfig : {columns : 2}, + height : 63, + items : [{ + width :900, + layout : 'column', + items:[{ + columnWidth : .73, + layout : 'form', + labelWidth : 60, + items : [{ + fieldLabel : '关键字', + xtype : 'combo', + id : 'code', + name : 'code', + queryParam : 'spell', + minChars : 0, + valueField : 'id', + displayField : 'displayName', + width : 600, + pageSize : 100, + store : allDiposableGoodsStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : true, + anchor : '97%', + listeners : { + select : function(combo, record, index) { + Ext.getCmp('disposableGoodsID').setValue(record.data.id); + Ext.getCmp('code').setValue(record.data.name); + } + } + }] + },{ + columnWidth : .25, + layout : 'form', + labelWidth : 60, + items : [{ + xtype:'hidden', + id:'disposableGoodsID', + name:'disposableGoodsID' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'datefield', + fieldLabel : '开始日期', + name : 'startDate', + id : 'startDate', + readOnly : false, + altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + editable : false, + format : 'Y-m-d', + value:new Date(startDayofMonth), + anchor : '94%' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'datefield', + fieldLabel : '结束日期', + name : 'endDate', + id : 'endDate', + readOnly : false, + altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + editable : false, + format : 'Y-m-d', + value:new Date(), + anchor : '94%' + }] + }] + },{ + width :150, + layout : 'column', + items : [{ + columnWidth : .5, + layout :'form', + items : [{ + xtype : 'button', + text : '查询', + minWidth : 70, + iconCls : 'icon_search', + handler : function() { + var startDate = Ext.getCmp('startDate').getRawValue(); + var endDate = Ext.getCmp('endDate').getRawValue(); + var disposableGoodsID = Ext.getCmp('disposableGoodsID').getValue(); + if(startDate || endDate){ + if(!compareDate(startDate,endDate)){ + showResult("开始时间不能大于结束时间"); + return; + } + } + if(isUndefinedOrNullOrEmpty(disposableGoodsID)){ + showResult("请选择一次性物品"); + return; + } + storageRecord.setDisposableGoodsId(disposableGoodsID); + storageRecord.loadData(null,startDate,endDate); + } + }] + },{ + columnWidth : .5, + layout :'form', + items : [{ + xtype : 'button', + text : '重置', + minWidth : 70, + iconCls : 'icon_set', + handler : function() { + //Ext.getCmp('code').setValue(""); + Ext.getCmp('startDate').setValue(""); + Ext.getCmp('endDate').setValue(""); + } + }] + }] + }] + }); + var viewport = new Ext.Viewport( { + layout : 'border', + items : [form,{ + region : 'center', + margins : '0 0 0 0', + layout : 'fit', + items:[storageRecord.getShowGrid()] + }] + }); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/disposableGoodsStockView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/disposableGoodsStockView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/disposableGoodsStockView.js (revision 20772) @@ -0,0 +1,997 @@ +var entityName = "一次性物品库存"; +var grid; +var root; +var formObj; +var formWindow = null; +var disposableGoodsStock = null; +var TYPE_DIPOSABLEGOODS = '普通物品'; +var TYPE_EXPENSIVEDIPOSABLEGOODS = '高值耗材'; + +function closeFormWindow(){ + if(formWindow != null){ + formWindow.close(); + formWindow = null; + } +} +function addDiposableGoods(disposableGoodsId,disposableGoodsStockId) { + var dType = document.getElementById("parm_s_type").value; + var diposableGooodsStore = new Ext.data.SimpleStore({ + fields : [ 'typeName' ], + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsType.do' + }); + + //能否作为器械包材料 + var isPartOfTousseMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + //能否被科室申请 + var isApplicationMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + //是否供应室物品 + var yesNoStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[STR_YES],[STR_NO]] + }); + + var godownEntryItemStore = new top.Ext.data.Store({ + proxy : new top.Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDisposableGoodsBatchStocksByDisposableGoodsStockID.do?id=' + disposableGoodsStockId, + method : 'POST' + }), + reader : new top.Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'disposableGoodsBatchId'}, + {name : 'barcode'}, + {name : 'storage'}, + {name : 'batchNumber'}, + {name : 'cost'}, + {name : 'expDate'}, + {name : 'supplierName'} + ] + }) + }); + + var tbar = [{ + text : '查看高值耗材', + iconCls : 'btn_ext_refresh', + handler : function(){ + var records = top.Ext.getCmp('batchNumberGrid').getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要查看的批次!"); + return false; + } + var disposableGoodsBatchStockIds = ''; + for ( var i = 0, len = records.length; i < len; i++) { + if(disposableGoodsBatchStockIds == ''){ + disposableGoodsBatchStockIds = records[i].data.id; + }else { + disposableGoodsBatchStockIds += ','+ records[i].data.id; + } + } + + viewExpensiveDisposablegoods(disposableGoodsId, disposableGoodsStockId, disposableGoodsBatchStockIds); + } + }, '-', { + text : '查看所有高值耗材', + iconCls : 'btn_ext_application_edit', + id : 'editTbar', + handler : function() { + viewExpensiveDisposablegoods(disposableGoodsId, disposableGoodsStockId, ''); + } + }]; + var selectModel = new top.Ext.grid.CheckboxSelectionModel(); + formObj = new top.Ext.FormPanel( { + id : 'diposableGoodsForm', + frame : true, + labelAlign:'right', + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + autoHeight : true, + autoScroll : true, + items:[{ + layout : 'column', + items : [{ + columnWidth : 0.4, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'originalFormParams', + id : 'originalFormParams' + },{ + xtype : 'hidden', + name : 'orginalName', + id : 'orginalName' + },{ + xtype : 'hidden', + name : 'orginalSpecification', + id : 'orginalSpecification' + },{ + xtype : 'hidden', + name : 'items', + id : 'items' + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '名称', + maxLength : '41', + id : 'name', + name : 'name', + allowBlank : false, + anchor : '95%', + listeners:{ + change:function(field,nV,oV){ + var value = nV.trim(); + field.setValue(value); + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '规格', + maxLength : '41', + id : 'specification', + name : 'specification', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '单位转换调整系数', + maxLength : '41', + id : 'unitConvertCoefficient', + name : 'unitConvertCoefficient', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '包装规格', + maxLength : '41', + id : 'packageSpec', + name : 'packageSpec', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "类别", + valueField : 'typeName', + displayField : 'typeName', + store : diposableGooodsStore, + forceSelection : true, + editable : false, + triggerAction : 'all', + name : "type", + id : "type", + value : dType, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "能否配包", + valueField : 'value', + displayField : 'value', + store : isPartOfTousseMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isPartOfTousseMaterial", + id : "isPartOfTousseMaterial", + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '能否申请', + valueField : 'value', + displayField : 'value', + store : isApplicationMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isApplicationMaterial", + id : "isApplicationMaterial", + anchor : '95%' + }] + },{ + + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '消毒供应中心物品', + valueField : 'value', + displayField : 'value', + store : yesNoStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isSupplyRoomGoods", + id : "isSupplyRoomGoods", + anchor : '95%' + }] + + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小库存', + allowDecimals : false, + maxLength : '16', + id : 'minStorage', + name : 'minStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最大库存', + allowDecimals : false, + maxLength : '16', + id : 'maxStorage', + name : 'maxStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '拼音码', + id : 'spelling', + name : 'spelling', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '五笔码', + id : 'wbCode', + name : 'wbCode', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '外部编码', + maxLength : '16', + id : 'externalCode', + name : 'externalCode', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '参考价', + maxLength : '16', + id : 'referencePrice', + name : 'referencePrice', + allowBlank : false, + allowNegative : false, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小申请数量', + maxLength : '16', + id : 'minApplyAmount', + name : 'minApplyAmount', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '单位', + maxLength : '16', + id : 'unit', + name : 'unit', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '总数', + maxLength : '16', + id : 'amount', + name : 'amount', + readOnly : true, + cls : 'fieldReadOnlyNoRemove', + allowBlank : false, + value : 0, + anchor : '95%' + }] + } + ] + },{ + columnWidth : 0.6, + layout : 'form', + items : [ + new top.Ext.grid.GridPanel({ + id :'batchNumberGrid', + store : godownEntryItemStore , + height : 390, + width : 485, + bodyStyle : 'border:1px solid #afd7af', + sm : selectModel, + cm : new top.Ext.grid.ColumnModel([selectModel, + {header : "id",dataIndex : 'id',hidden : true}, + {header : "条码",width : 90,dataIndex : 'barcode',menuDisabled:true}, + {header : "批次",width : 90,dataIndex : 'batchNumber',menuDisabled:true,renderer : function batchRenderer(v, p, record){ + return v; +// var data = record.data; +// var disposableGoodsBatchStockIds = data.id; +// var params = disposableGoodsId+','+disposableGoodsStockId+','+disposableGoodsBatchStockIds; +// return '' + v + ''; + }}, + {header : "价格",width : 50,dataIndex : 'cost',menuDisabled:true}, + {header : "库存",width : 50,dataIndex : 'storage',menuDisabled:true}, + {header : "失效期",width : 90,dataIndex : 'expDate',renderer:myDateFormat,menuDisabled:true}, + {id:'supplierName',header : "供应商",width : 130,dataIndex : 'supplierName',menuDisabled:true} + ]), + autoExpandColumn : 'supplierName', + frame : false, + viewConfig: {forceFit:true}, + tbar: tbar, + title : '批次列表' + }) + ] + }] + }], + buttons : [{ + id : 'saveBtn', + hidden: true, + text : '保存', + handler : save + },{ + id : 'cancleBtn', + text : '取消', + handler : function() { + closeFormWindow(); + } + },{ + id : 'print', +// hidden:true, + text : '打印批次', + handler : function() { + var items = null; + var records = top.Ext.getCmp('batchNumberGrid').getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要打印的批次!"); + return false; + } + var goodsName = top.Ext.getCmp('name').getValue(); + + for ( var i = 0, len = records.length; i < len; i++) { + if(items == null){ + items = records[i].data.disposableGoodsBatchId; + }else { + items += ',' + records[i].data.disposableGoodsBatchId; + } + } + top.Ext.getCmp("items").setValue(items); + formObj.form.submit({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!printDiposableGoods.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + window.close(); + grid.dwrReload(); + //打印条码 + printBarcode(action.result.barcode); + + }, + failure : function(form, action) { + showResult(action.result.message); + } + }); + } + }] + }); + + if($Id("parm_s_type").value != ""){ + top.Ext.getCmp("type").setValue($Id("parm_s_type").value); + } + + formWindow = new top.Ext.Window( { + id : 'diposableGoodsWin', + layout : 'fit', + title : '一次性物品信息', + width : 850, + modal : true, + autoHeight : true, + border : false, + plain : true, + items : [ formObj ] + }); + formWindow.show(); + diposableGooodsStore.load(); + if(id != 0){ + godownEntryItemStore.load(); + } +} + +function printAmount() { + top.Ext.MessageBox.prompt("输入框", "打印数量:", function(bu, txt) { + return txt; + }); +} + +function printBarcode(barcodeStr){ + if(barcodeStr!=null && barcodeStr.length > 0){ + top.Ext.Msg.show({ + title: '输入框', + msg: '打印数量:', + width: 100, + buttons: Ext.MessageBox.OKCANCEL, + prompt : true, + fn: function(bu, txt) { + if(bu == 'ok'){ + if(isNaN(txt) == false){ + var godownEntryItem = barcodeStr.split(";"); + var specification = top.Ext.getCmp('specification').getValue(); + for(var j = 0 ; j< Number(txt) ; j++){ + for ( var i = 0; i < godownEntryItem.length; i++) { + var resultItem = godownEntryItem[i].split("#&"); + var name =resultItem[0]; + var barcode = resultItem[1]; + var expDate = resultItem[2]; + var supplierName = resultItem[3]; + var batchNumber = resultItem[4]; + printDiposableGoodsInfo(barcode,name,expDate,supplierName,batchNumber,0,specification); + } + } + }else{ + showResult("打印数量必须是数字,请重新输入!"); + } + } + }, + animEl: 'addAddressBtn', + value:'1' + }); + } +} + +function submitForSaveDisposableGoods(){ + formObj.form.submit( { + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!saveDiposableGoods.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + formWindow.close(); + showResult('保存成功'); + grid.dwrReload(); + }, + failure : function(form, action) { + showResult(action.result.message); + top.Ext.getCmp('saveBtn').enable(); + } + }); +} +function validateAndSubmit(){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!validate.do', + params : { + validateId : top.Ext.getCmp('id').getValue(), + valifateName:top.Ext.getCmp('name').getValue(), + specification:top.Ext.getCmp('specification').getValue() + }, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if(result.stauts==1){ + var orginalName = top.Ext.getCmp("orginalName").getValue(); + var orginalSpecification = top.Ext.getCmp("orginalSpecification").getValue(); + var name = top.Ext.getCmp("name").getValue(); + var specification = top.Ext.getCmp("specification").getValue(); + var msg = ''; + if(!stringLooksEquals(orginalName,name) && !stringLooksEquals(orginalSpecification,specification)){ + msg = "是否确定修改一次性物品名称和规格?" + }else if(!stringLooksEquals(orginalName,name)){ + msg = "是否确定修改一次性物品名称?" + }else if(!stringLooksEquals(orginalSpecification,specification)){ + msg = "是否确定修改一次性物品规格?" + }else{ + submitForSaveDisposableGoods(); + return; + } + top.Ext.MessageBox.confirm("请确认",msg, + function(button, text) { + if ("yes" == button){ + submitForSaveDisposableGoods(); + }else{ + top.Ext.getCmp('saveBtn').enable(); + } + }); + }else{ + showResult(result.message); + top.Ext.getCmp('saveBtn').enable(); + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + showResult(result.cause); + } + }); +} + +function save(){ + //if(!form.getForm().isValid()){ + if(!formObj.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + var unitConvertCoefficient = top.Ext.getCmp('unitConvertCoefficient').getValue(); + if(unitConvertCoefficient != null && unitConvertCoefficient != ""){ + if(unitConvertCoefficient <= 0){ + showResult("单位转换调整系数必须大于0!"); + top.Ext.getCmp('unitConvertCoefficient').setValue(""); + top.Ext.getCmp('unitConvertCoefficient').focus(); + return false; + } + } + + var max = top.Ext.getCmp('maxStorage').getValue(); + var min = top.Ext.getCmp('minStorage').getValue(); + if(typeof max == 'number' && typeof min == 'number'){ + if(min>max){ + showResult('最小库存不能大于最大库存'); + top.Ext.getCmp('minStorage').focus(); + return false; + } + } + this.disable(); + validateAndSubmit(); +} + +function printBatchNum(barcodeStr){ + if(barcodeStr!=null && barcodeStr.length > 0){ + Ext.Msg.show({ + title: '输入框', + msg: '打印数量:', + width: 100, + buttons: Ext.MessageBox.OKCANCEL, + prompt : true, + fn: function(bu, txt) { + if(bu == 'ok'){ + if(isNaN(txt) == false){ + var godownEntryItem = barcodeStr.split(";"); + for(var j = 0 ; j< Number(txt) ; j++){ + for ( var i = 0; i < godownEntryItem.length; i++) { + var resultItem = godownEntryItem[i].split("#&"); + var name =resultItem[0]; + var barcode = resultItem[1]; + var expDate = resultItem[2]; + var supplierName = resultItem[3]; + var batchNumber = resultItem[4]; + var specification = resultItem[5]; + printDiposableGoodsInfo(barcode,name,expDate,supplierName,batchNumber,0,specification); + } + } + }else{ + showResult("打印数量必须是数字,请重新输入!"); + } + } + }, + animEl: 'addAddressBtn', + value:'1' + }); + } +} +function onStorageRecordDetail(grid){ + var records = grid.getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择一次性物品"); + return; + } + if(records.length != 1){ + showResult("只能选择一个一次性物品"); + return; + } + + var storageRecord = new StorageRecord(); + storageRecord.setDisposableGoodsId(records[0].data['disposableGoodsID']); + storageRecord.showDetail(); +} +//打印批次条码 +function printBatchStockBarcode(grid){ + var records = grid.getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择要打印批次条码的物品"); + }else{ + var ids = ""; + for(var i = 0,len=records.length;i 1) { + showResult("一次只能修改一个一次性物品!"); + return false; + } + id = records[0].data['id']; + var disposableGoodsID = records[0].data.disposableGoodsID; + addDiposableGoods(disposableGoodsID,id); + top.Ext.getCmp('diposableGoodsForm').form.load({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDisposableGoodsStock.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + params : {id : id}, + success : function(form, action) { + disposableGoodsStock = action.result.data; + top.Ext.getCmp("orginalName").setValue(disposableGoodsStock.name); + top.Ext.getCmp("orginalSpecification").setValue(disposableGoodsStock.specification); + }, + failure : function(form, action) { + } + }); +}; + +function reloadGrid(type){ + $Id("parm_s_type").value = type; + grid.dwrReload(); +} + +function modify(){ + loadFormData(grid); +} + +function rendeColor(v, p, record){ + var data = record.data; + var amount = data.amount; + if(typeof amount=='number'){ + if((typeof data.minStorage=='number' && data.minStorage>amount) || (typeof data.maxStorage=='number' && data.maxStorage" + v + "

"; + } + } + return "" + v + ""; +} + +function viewExpensiveDisposablegoods(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds){ + if(isUndefinedOrNull(disposableGoodsStockIds)){ + disposableGoodsStockIds = ''; + } + if(isUndefinedOrNull(disposableGoodsBatchStockIds)){ + disposableGoodsBatchStockIds = ''; + } + closeFormWindow(); + loadExpensiveDisposableGoodsInfo(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds); +} +Ext.onReady(function() { + Ext.QuickTips.init(); + + //********* 1、Tree *********** + root = new Ext.tree.AsyncTreeNode({ + text:'一次性物品类型', + id:'0', + draggable:false, + listeners:{ + click:function(node,event){ + reloadGrid(""); + } + } + }); + + var myLoader = new Ext.tree.TreeLoader({dataUrl:WWWROOT + '/disinfectSystem/diposableGoodsAction!treeLoad.do'}); + + //********* 2、ForgonGrid *********** + var columns = [ + {header : "编码",width : 60,dataIndex : 'externalCode'}, + {header : "名称",width : 180,dataIndex : 'name', renderer : rendeColor}, + {header : "规格",width : 100,dataIndex : 'specification'}, + {header : "库存",width : 50,dataIndex : 'amount'}, + {header : "仓库",width : 100,dataIndex : 'warehouseName'}, + {header : "包装规格",width : 80,dataIndex : 'packageSpec'}, + {header : "参考价",width : 60,dataIndex : 'referencePrice'}, + {header : "总数",width : 50,dataIndex : 'amount',hidden:true}, + {header : "最小申请数量",width : 80,dataIndex : 'minApplyAmount'}, + {header : "单位",width : 50,dataIndex : 'unit'}, + {header : "拼音码",width : 90,dataIndex : 'spelling',hidden: true}, + {header : "五笔码",width : 90,dataIndex : 'wbCode', hidden: true}, +// {header : "能否作为器械包材料",width : 120,dataIndex : 'isPartOfTousseMaterial'}, +// {header : "能否被科室申请",width : 100,dataIndex : 'isApplicationMaterial'}, +// {header : "是否消毒供应中心领用物品",width : 100,dataIndex : 'isSupplyRoomGoods'}, + {header : "最小库存",width : 60,dataIndex : 'minStorage'}, + {id : 'operationRemark',header : "最大库存",width : 60,dataIndex : 'maxStorage'} + + ]; + + var readerDetail = [ + {name : 'id'}, + {name : 'name'}, + {name : 'externalCode'}, + {name : 'specification'}, + {name : 'packageSpec'}, + {name : 'amount'}, + {name : 'warehouseName'}, + {name : 'minApplyAmount'}, + {name : 'unit'}, + {name : 'minStorage'}, + {name : 'maxStorage'}, + {name : 'spelling'}, + {name : 'wbCode'}, + {name : 'isPartOfTousseMaterial'}, + {name : 'referencePrice'}, + {name : 'isApplicationMaterial'}, + {name : 'disposableGoodsID'}, + {name : 'isSupplyRoomGoods'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters:[ + {type: 'string', dataIndex: 'name'}, + {type: 'string', dataIndex: 'externalCode'}, + {type: 'numeric', dataIndex: 'amount'}, + {type: 'numeric', dataIndex: 'minApplyAmount'}, + {type: 'string', dataIndex: 'unit'}, + {type: 'numeric', dataIndex: 'minStorage'}, + {type: 'numeric', dataIndex: 'maxStorage'}, + {type: 'string', dataIndex: 'spelling'}, + {type: 'string', dataIndex: 'wbCode'}, + {type: 'string', dataIndex: 'isPartOfTousseMaterial'}, + {type: 'string', dataIndex: 'isApplicationMaterial'}, + {type: 'string', dataIndex: 'isSupplyRoomGoods'}, + {type: 'numeric', dataIndex: 'referencePrice'} + ]} + ); + + var tbar = [{ + text : '出入库记录', + iconCls : 'btn_ext_refresh', + handler : function(){ + onStorageRecordDetail(grid); + } + }, '-' , { + text : '打印批次', +// hidden: true, + iconCls : 'icon_print', + handler : function(){ + printBatchStockBarcode(grid); + } + }/* + , '-' , { + //用于程序员调试 + text : '更新旧数据', + hidden : false, + handler : function() { + DiposableGoodsTableManager.updateOldData(function(msg){showResult(msg);}); + } + }, '-' , { + //将属于供应室领用的一次性物品进行分类 + text : '分类供应室领用类型', + hadden : false, + handler : function() { + DiposableGoodsTableManager.updateSupplyRoomDiposableGoodsType(function(msg){showResult('更新成功,请刷新页面')}); + } + } + , '-' , { + text : '导出一次性物品库存', + handler : function() { + window.location.href = WWWROOT+"/disinfectsystem/reportforms/diposableGoodsStorageReportExportForm.jsp"; + } + }, '-' , { + text : '导出物资收发存汇总', + handler : function() { + window.location.href = WWWROOT+"/disinfectsystem/reportforms/diposableGoodsPriceStatisticsReportExportForm.jsp"; + } + }, '-' , { + //用于程序员调试 + text : '更新旧数据', + hidden : false, + handler : function() { + DiposableGoodsTableManager.updateOldData(function(msg){showResult(msg);}); + } + }, '-', { + text : '导入一次性物品库存EXCEL', + hidden : false, + handler : function() { + location.href = WWWROOT + + "/disinfectsystem/basedatamanager/importbasedata/amendDiposableGoodsStorage.mhtml"; + } + } + */ + ]; + + grid = new Ext.ux.ForgonPageGrid( { + tbar : tbar, + pageSize : 20, + defaultSortField : 'externalCode', + title : '一次性物品列表', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + plugins: filters, + columns : columns, + autoExpandColumn : 'operationRemark', + renderTo : 'gridDiv', + frame : false + }, readerDetail, + DiposableGoodsTableManager.findDisposableGoodsStockTableList, + null + ); + + var viewport = new Ext.Viewport({ + layout:'border', + items:[{ + region:'west', + id:'west-panel', + lines : false, + margins : '0 0 5 5', + cmargins : '0 0 0 0', + layout : 'accordion', + layoutConfig : {animate : true}, + collapsible: true, //允许折叠 + animCollapse:true, //折叠时是否有动画效果 + split: true, //是否允许拖动大小,与下面的折叠形式配合 + collapseMode:'mini', //折叠形式 + width: 200, + minSize : 130, + maxSize : 400, + xtype: 'treepanel', + loader: myLoader, //数据加载 + autoScroll: true, + root: root, + tbar:[ + new Ext.Action({ + text: '展开所有', + handler: function(){ + var treePanel = viewport.findById('west-panel'); + treePanel.expandAll(); + } + }), + new Ext.Action({ + text: '折叠所有', + handler: function(){ + var treePanel = viewport.findById('west-panel'); + treePanel.collapseAll(); + } + }) + ] + },{ + region:'center', + margins:'0 5 5 0', + xtype : 'panel', + autoScroll:true, + layout: 'fit', + items:grid + }] + }); + + root.expand(false, /*no anim*/ false); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.jsp (revision 20772) @@ -0,0 +1,63 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods,com.forgon.Constants"%> + + + + +一次性物品信息 + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoods.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoods.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoods.js (revision 20772) @@ -0,0 +1,90 @@ +//单价数据源 +var priceStore = null; +var PriceRecord = null; +var BatchRecordProperties = [ + {name : 'diposableGoods'}, + {name : 'id'}, + {name : 'barcode'}, + {name : 'type'}, + {name : 'batchNumber'}, + {name : 'sterileBatchNumber'}, + {name : 'supplierName'}, + {name : 'manufacturer'}, + {name : 'storage'}, + {name : 'cost'}, + {name : 'supplierName'}, + {name : 'expDate'} + ] +var diposableGoodsBatchNumStore = new Ext.data.Store({ + reader : new Ext.data.JsonReader({ + fields : BatchRecordProperties + }) +}); + +var BatchRecord = Ext.data.Record.create(BatchRecordProperties); +// 清空批次和价格 +function clearBatchNumberAndPrice() { + clearBatchNumber(); + clearPrice(); +} +function clearBatchNumber() { + clearCombo(diposableGoodsBatchNumStore,'batchNumber'); +} +// 清空价格 +function clearPrice() { + clearCombo(priceStore,'combo_price'); +} +// 设置批次 +function setBatchNumbers(batches,selectFirst) { + clearBatchNumber(); + if(typeof(batches) == 'undefined' || batches == null){ + return; + } + for(var i = 0;i 0){ + setCmpValue('batchNumber',batches[0].batchNumber); + var combo = top.Ext.getCmp("batchNumber"); + // 触发选中事件 + combo.fireEvent('select', combo,diposableGoodsBatchNumStore.getAt(0),0); + } + } +} +//设置价格 +function setPrices(prices,selectFirst) { + clearPrice() + if(typeof(prices) == 'undefined' || prices == null){ + return; + } + for(var i = 0;i 0){ + setCmpValue('combo_price',prices[0].price); + } + } +} + +//获取当前选中的批次 +function getSelectedBatch(){ + var batchNumber = top.Ext.getCmp('batchNumber').getValue(); + var batch = findRecordDataByNameAndValue(diposableGoodsBatchNumStore,'batchNumber',batchNumber); + return batch; +} +//获取当前选中的价格 +function getSelectedPriceAmount(){ + return getSelectedDataFromCombo(priceStore,'combo_price','price'); +} +// 转换日期 +function transBatchesDate(batches){ + for(var i = 0;i { Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.js (revision 20772) @@ -0,0 +1,1383 @@ +var entityName = "一次性物品"; +var grid; +var root; +var formObj; +var formWindow; +var autoFillExternalCodeOfDisposableGoods = false; +function addExpensiveGoods(id) { + autoFillExternalCodeOfDisposableGoods = getBoolValueFromJs('sstsConfig.autoFillExternalCodeOfDisposableGoods',autoFillExternalCodeOfDisposableGoods); + var dType = document.getElementById("parm_s_type").value; + var diposableGooodsStore = new Ext.data.SimpleStore({ + fields : [ 'typeName' ], + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!getExpensiveGoodsType.do' + }); + + //能否作为器械包材料 + var isPartOfTousseMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + var goodsTypeStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [['普通物品'],['高值耗材']] + }); + + //能否被科室申请 + var isApplicationMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + //是否供应室物品 + var yesNoStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[STR_YES],[STR_NO]] + }); + + var godownEntryItemStore = new top.Ext.data.Store({ + proxy : new top.Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!loadDisposableGoodsBatchesByDisposableGoodsID.do?id=' + id, + method : 'POST' + }), + reader : new top.Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'barcode'}, + {name : 'storage'}, + {name : 'batchNumber'}, + {name : 'cost'}, + {name : 'expDate'}, + {name : 'sterileBatchNumber'}, + {name : 'hasPrinted'}, + {name : 'printTime'}, + {name : 'supplierName'}, + {name : 'inventorySerialNumber'} + ] + }) + }); + + var inventoryGoodsStore = new Ext.data.SimpleStore({ + fields : [ 'value' ], + data : [ ['否' ], ['是' ]] + }); + + + var selectModel = new top.Ext.grid.CheckboxSelectionModel(); + formObj = new top.Ext.FormPanel( { + id : 'expensiveGoodsForm', + frame : true, + labelAlign:'right', + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + // autoHeight : true, + height : 620, + autoScroll : true, + items:[{ + layout : 'column', + items : [{ + columnWidth : 0.35, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'originalFormParams', + id : 'originalFormParams' + },{ + xtype : 'hidden', + name : 'originalGoodsType', + id : 'originalGoodsType' + },{ + xtype : 'hidden', + name : 'orginalName', + id : 'orginalName' + },{ + xtype : 'hidden', + name : 'orginalSpecification', + id : 'orginalSpecification' + },{ + xtype : 'hidden', + name : 'orginalApplicationSpecification', + id : 'orginalApplicationSpecification' + },{ + xtype : 'hidden', + name : 'items', + id : 'items' + },{ + xtype : 'hidden', + name : 'notInventoryDeptCode', + id : 'notInventoryDeptCode' + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '名称', + maxLength : '41', + id : 'name', + name : 'name', + allowBlank : false, + anchor : '95%', + listeners:{ + change:function(field,nV,oV){ + var value = nV.trim(); + field.setValue(value); + } + } + }] + },{ + layout:'column', + items:[{ + hidden: !sstsConfig.expensiveGoodsInventorySerialNumber, + columnWidth : .87, + layout : 'form', + border:true, + labelWidth :110, + items : [{ + xtype : 'numberfield', + fieldLabel : '物资编码', + maxLength : '16', + width : 380, + id : 'inventorySerialNumber', + allowBlank : true, + anchor : '95%' + }] + },{ + hidden: !sstsConfig.expensiveGoodsInventorySerialNumber||!sstsConfig.showHrpDiposableGoodByInventorySerialNumber, + columnWidth : .13, + layout : 'form', + border:true, + width: 10, + items : [{//根据物资编码查找hrp一次性物品信息 + xtype: 'button', + iconCls: 'icon_search', + handler: getHrpDiposableGood + }] + } + ] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '语音提示名称', + maxLength : '41', + id : 'ttsName', + name : 'ttsName', + allowBlank : true, + anchor : '95%', + listeners:{ + change:function(field,nV,oV){ + var value = nV.trim(); + field.setValue(value); + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '规格', + maxLength : '41', + id : 'specification', + name : 'specification', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '单位转换调整系数', + maxLength : '41', + id : 'unitConvertCoefficient', + name : 'unitConvertCoefficient', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '包装规格', + maxLength : '41', + id : 'packageSpec', + name : 'packageSpec', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "类型", + valueField : 'typeName', + displayField : 'typeName', + store : diposableGooodsStore, + forceSelection : true, + editable : false, + triggerAction : 'all', + name : "type", + id : "type", + value : dType, + anchor : '95%', + listeners : { + select : function(combo , record , index){ + // 如果类型不为空,并且配置为自动增加外部编码,那么获取下一个编码,并且填上 + if(!isUndefinedOrNullOrEmpty(combo.value) && autoFillExternalCodeOfDisposableGoods){ + ExpensiveGoodsTableManager.getNextExternalCodeOfDisposableGoods(combo.value,function(externalCode){ + if(!isUndefinedOrNullOrEmpty(externalCode)){ + top.Ext.getCmp("externalCode").setValue(externalCode); + } + }); + } + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [ + isUndefinedOrNullOrEmpty(id)?{ + xtype : 'combo', + fieldLabel : "物品类型", + valueField : 'value', + displayField : 'value', + store : goodsTypeStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "goodsType", + id : "goodsType", + anchor : '95%' + }:{ + xtype : 'textfield', + fieldLabel : "物品类型", + readOnly: true, + cls : 'fieldReadOnlyNoRemove', + allowBlank : false, + mode : 'local', + name : "goodsType", + id : "goodsType", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "类别", + valueField : 'name', + displayField : 'name', + store : new Ext.data.SimpleStore({ + data:[['一类'],['二类'],['三类']], + fields:['name'] + }), + mode : 'local', + forceSelection : true, + editable : false, + triggerAction : 'all', + name : "grade", + id : "grade", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "能否配包", + valueField : 'value', + displayField : 'value', + store : isPartOfTousseMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isPartOfTousseMaterial", + id : "isPartOfTousseMaterial", + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '能否申请', + valueField : 'value', + displayField : 'value', + store : isApplicationMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isApplicationMaterial", + id : "isApplicationMaterial", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '消毒供应中心物品', + valueField : 'value', + displayField : 'value', + store : yesNoStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isSupplyRoomGoods", + id : "isSupplyRoomGoods", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '包外标签是否打印', + valueField : 'value', + displayField : 'value', + store : yesNoStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "printInLabel", + id : "printInLabel", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小库存', + allowDecimals : false, + maxLength : '16', + id : 'minStorage', + name : 'minStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最大库存', + allowDecimals : false, + maxLength : '16', + id : 'maxStorage', + name : 'maxStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '拼音码', + id : 'spelling', + name : 'spelling', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '五笔码', + id : 'wbCode', + name : 'wbCode', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '外部编码', + maxLength : '16', + id : 'externalCode', + name : 'externalCode', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '参考价', + maxLength : '16', + id : 'referencePrice', + name : 'referencePrice', + allowBlank : false, + allowNegative : false, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小申请数量', + maxLength : '16', + id : 'minApplyAmount', + name : 'minApplyAmount', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最大申请数量', + maxLength : '16', + id : 'maxApplyAmount', + name : 'maxApplyAmount', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '单位', + maxLength : '16', + id : 'unit', + name : 'unit', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '申领单位', + maxLength : '16', + id : 'middlePackageUnit', + name : 'middlePackageUnit', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '申领规格', + maxLength : '16', + id : 'applicationSpecification', + name : 'applicationSpecification', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '申领单位转换单位系数', + maxLength : '16', + id : 'transferScale', + name : 'transferScale', + allowDecimals : false, + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '顺序号', + maxLength : '16', + id : 'sequence', + name : 'sequence', + allowDecimals : false, + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '是否盘点', + id : 'isInventoryGoods', + name : 'isInventoryGoods', + width : 130, + valueField : 'value', + displayField : 'value', + store : inventoryGoodsStore, + forceSelection : true, + allowBlank: true, + mode : 'local', + editable : false, + triggerAction : 'all', + anchor : '95%' + }] + } + ] + },{ + columnWidth : 0.65, + layout : 'form', + items : [ + new top.Ext.grid.GridPanel({ + id :'batchNumberGrid', + store : godownEntryItemStore , + height : 425, + width : 630, + bodyStyle : 'border:1px solid #afd7af', + sm : selectModel, + cm : new top.Ext.grid.ColumnModel([selectModel, + {header : "id",dataIndex : 'id',hidden : true}, + {header : "条码",width : 80,dataIndex : 'barcode',menuDisabled:true}, + {header : "批次",width : 80,dataIndex : 'batchNumber',menuDisabled:true}, + {header : "价格",width : 50,dataIndex : 'cost',menuDisabled:true}, + {header : "失效期",width : 90,dataIndex : 'expDate',renderer:myDateFormat,menuDisabled:true}, + {header : "灭菌批号",width : 90,dataIndex : 'sterileBatchNumber'}, + {header : "是否打印",width : 70,dataIndex : 'hasPrinted',menuDisabled:true}, + {header : "打印时间",width : 90,dataIndex : 'printTime',renderer:myDateFormat,menuDisabled:true}, + {id:'supplierName',header : "供应商",width : 130,dataIndex : 'supplierName',menuDisabled:true} + ]), + autoExpandColumn : 'supplierName', + frame : false, + viewConfig: {forceFit:true}, + title : '批次列表' + }) + ] + },{ + columnWidth : 0.65, + title: 'Hrp一次性物品数据', + id :'hrpContrastDefinition', + hidden:true, + height : 130, + width : 630, + layout : 'column', + xtype: 'fieldset', + items: [{ + columnWidth : 1, + layout : 'form', + labelWidth : 50, + items : [{ + xtype : 'textfield', + fieldLabel : '名字', + width : 540, + maxLength : '60', + anchor : '100%', + id : 'hrpName', + name : 'hrpName', + readOnly : true + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 50, + items : [{ + xtype : 'textfield', + fieldLabel : '规格', + width : 540, + maxLength : '60', + anchor : '100%', + id : 'hrpSpecification', + name : 'hrpSpecification', + readOnly : true + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 50, + items : [{ + xtype : 'textfield', + fieldLabel : '价格', + width : 245, + maxLength : '16', + anchor : '100%', + id : 'hrpCost', + name : 'hrpCost', + readOnly : true + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 50, + items : [{ + xtype : 'textfield', + fieldLabel : '单位', + width : 243, + maxLength : '16', + anchor : '100%', + id : 'hrpUnit', + name : 'hrpUnit', + readOnly : true + }] + }] + }] + }], + buttons : [{ + id : 'saveBtn', + text : '保存', + handler : save + },{ + id : 'cancleBtn', + text : '取消', + handler : function() { + formWindow.close(); + } + },{ + id : 'print', + text : '打印批次', + handler : function() { + var items = null; + var records = top.Ext.getCmp('batchNumberGrid').getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要打印的批次!"); + return false; + } + var goodsName = top.Ext.getCmp('name').getValue(); + + for ( var i = 0, len = records.length; i < len; i++) { + if(items == null){ + items = records[i].data.id; + }else { + items += ',' + records[i].data.id; + } + } + top.Ext.getCmp("items").setValue(items); + formObj.form.submit({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!printExpensiveGoods.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + window.close(); + grid.dwrReload(); + //打印条码 + printBarcode(action.result.barcode); + + }, + failure : function(form, action) { + showResult(action.result.message); + } + }); + } + }] + }); + + if($Id("parm_s_type").value != ""){ + top.Ext.getCmp("type").setValue($Id("parm_s_type").value); + } + + formWindow = new top.Ext.Window( { + id : 'expensiveGoodsWin', + layout : 'fit', + title : '一次性物品信息', + width : 980, + // height : 620, + height : top.screen.height > 800 ? 660 : 500, + modal : true, + // autoHeight : true, + border : false, + plain : true, + items : [ formObj ] + }); + formWindow.show(); + diposableGooodsStore.load(); + // 如果类型不为空,并且配置为自动增加外部编码,那么获取下一个编码,并且填上 + if(!isUndefinedOrNullOrEmpty(dType) && autoFillExternalCodeOfDisposableGoods){ + ExpensiveGoodsTableManager.getNextExternalCodeOfDisposableGoods(dType,function(externalCode){ + if(!isUndefinedOrNullOrEmpty(externalCode)){ + top.Ext.getCmp("externalCode").setValue(externalCode); + } + }); + } + if(id != 0){ + godownEntryItemStore.load(); + } +} + +function printAmount() { + top.Ext.MessageBox.prompt("输入框", "打印数量:", function(bu, txt) { + return txt; + }); +} + +function printBarcode(barcodeStr){ + if(barcodeStr!=null && barcodeStr.length > 0){ + top.Ext.Msg.show({ + title: '输入框', + msg: '打印数量:', + width: 100, + buttons: Ext.MessageBox.OKCANCEL, + prompt : true, + fn: function(bu, txt) { + if(bu == 'ok'){ + if(isNaN(txt) == false){ + var godownEntryItem = barcodeStr.split(";"); + var specification = top.Ext.getCmp('specification').getValue(); + for(var j = 0 ; j< Number(txt) ; j++){ + for ( var i = 0; i < godownEntryItem.length; i++) { + var resultItem = godownEntryItem[i].split("#&"); + var name =resultItem[0]; + var barcode = resultItem[1]; + var expDate = resultItem[2]; + var supplierName = resultItem[3]; + var batchNumber = resultItem[4]; + printExpensiveGoodsInfo(barcode,name,expDate,supplierName,batchNumber,0,specification); + } + } + }else{ + showResult("打印数量必须是数字,请重新输入!"); + } + } + }, + animEl: 'addAddressBtn', + value:'1' + }); + } +} + +function submitForSaveDisposableGoods(){ + formObj.form.submit( { + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!saveExpensiveGoods.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + var result = Ext.decode(action.response.responseText); + if(isUndefinedOrNullOrEmpty(result.errorMessage)){ + showResult('保存成功'); + formWindow.close(); + grid.dwrReload(); + }else{ + showResult('保存出错, ' + result.errorMessage); + top.Ext.getCmp('saveBtn').enable(); + } + }, + failure : function(form, action) { + showResult('保存出错'); + top.Ext.getCmp('saveBtn').enable(); + } + }); +} +function validateAndSubmit(){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!validate.do', + params : { + validateId : top.Ext.getCmp('id').getValue(), + valifateName:top.Ext.getCmp('name').getValue(), + specification:top.Ext.getCmp('specification').getValue() + }, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if(result.stauts==1){ +// var originalGoodsType = top.Ext.getCmp("originalGoodsType").getValue(); +// var goodsType = top.Ext.getCmp("goodsType").getValue(); + var orginalName = top.Ext.getCmp("orginalName").getValue(); + var orginalSpecification = top.Ext.getCmp("orginalSpecification").getValue(); + var orginalApplicationSpecification = top.Ext.getCmp("orginalApplicationSpecification").getValue(); + var name = top.Ext.getCmp("name").getValue(); + var specification = top.Ext.getCmp("specification").getValue(); + var applicationSpecification = top.Ext.getCmp("applicationSpecification").getValue(); + var msg = ''; + var id = top.Ext.getCmp('id').getValue(); + // 规格不为空且和申领规格相等,提示 + if( !isUndefinedOrNullOrEmpty(specification) && stringLooksEquals(specification,applicationSpecification)){ + msg = "是否确定规格和申领规格相同?"; + } + if(id != null && id != ''){ + if(!stringLooksEquals(orginalName,name) && (!stringLooksEquals(orginalSpecification,specification) || !stringLooksEquals(orginalApplicationSpecification,applicationSpecification))){ + msg = "是否确定修改一次性物品名称和规格?" + }else if(!stringLooksEquals(orginalName,name)){ + msg = "是否确定修改一次性物品名称?" + }else if(!stringLooksEquals(orginalSpecification,specification) || !stringLooksEquals(orginalApplicationSpecification,applicationSpecification)){ + msg = "是否确定修改一次性物品规格?" + } + } + +// if(!stringLooksEquals(originalGoodsType,goodsType)){ +// msg += "是否确定更改物品类型?" +// } + if(msg == ''){ + submitForSaveDisposableGoods(); + return; + } + top.Ext.MessageBox.confirm("请确认",msg, + function(button, text) { + if ("yes" == button){ + submitForSaveDisposableGoods(); + }else{ + top.Ext.getCmp('saveBtn').enable(); + } + }); + }else{ + showResult(result.message); + top.Ext.getCmp('saveBtn').enable(); + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + showResult(result.cause); + } + }); +} + +function save(){ + //if(!form.getForm().isValid()){ + if(!formObj.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + var unitConvertCoefficient = top.Ext.getCmp('unitConvertCoefficient').getValue(); + if(unitConvertCoefficient != null && unitConvertCoefficient != ""){ + if(unitConvertCoefficient <= 0){ + showResult("单位转换调整系数必须大于0!"); + top.Ext.getCmp('unitConvertCoefficient').setValue(""); + top.Ext.getCmp('unitConvertCoefficient').focus(); + return false; + } + } + var transferScale = top.Ext.getCmp('transferScale').getValue(); + + var max = top.Ext.getCmp('maxStorage').getValue(); + var min = top.Ext.getCmp('minStorage').getValue(); + var minApply = top.Ext.getCmp('minApplyAmount').getValue(); + var maxApply = top.Ext.getCmp('maxApplyAmount').getValue(); + if(typeof max == 'number' && typeof min == 'number'){ + if(min>max){ + showResult('最小库存不能大于最大库存'); + top.Ext.getCmp('minStorage').focus(); + return false; + } + if(minApply > maxApply){ + showResult('最小申请数不能大于最大申请数'); + top.Ext.getCmp('minApplyAmount').focus(); + return false; + } + } + var middlePackageUnit = top.Ext.getCmp('middlePackageUnit').getValue(); + var applicationSpecification = top.Ext.getCmp("applicationSpecification").getValue(); + if ( !((isUndefinedOrNullOrEmpty(middlePackageUnit) && isUndefinedOrNullOrEmpty(transferScale) && isUndefinedOrNullOrEmpty(applicationSpecification)) || + (!isUndefinedOrNullOrEmpty(middlePackageUnit) && !isUndefinedOrNullOrEmpty(transferScale) && !isUndefinedOrNullOrEmpty(applicationSpecification)) + )){ + showResult('申领规格、申领单位和申领单位转换单位系数必须同时有值或者同时为空,且转换系数大于0!'); + return false; + } + + this.disable(); + validateAndSubmit(); +} + +function printBatchNum(barcodeStr){ + if(barcodeStr!=null && barcodeStr.length > 0){ + Ext.Msg.show({ + title: '输入框', + msg: '打印数量:', + width: 100, + buttons: Ext.MessageBox.OKCANCEL, + prompt : true, + fn: function(bu, txt) { + if(bu == 'ok'){ + if(isNaN(txt) == false){ + var godownEntryItem = barcodeStr.split(";"); + for(var j = 0 ; j< Number(txt) ; j++){ + for ( var i = 0; i < godownEntryItem.length; i++) { + var resultItem = godownEntryItem[i].split("#&"); + var name =resultItem[0]; + var barcode = resultItem[1]; + var expDate = resultItem[2]; + var supplierName = resultItem[3]; + var batchNumber = resultItem[4]; + var specification = resultItem[5]; + printExpensiveGoodsInfo(barcode,name,expDate,supplierName,batchNumber,0,specification); + } + } + }else{ + showResult("打印数量必须是数字,请重新输入!"); + } + } + }, + animEl: 'addAddressBtn', + value:'1' + }); + } +} +function onStorageRecordDetail(grid){ + var records = grid.getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择一次性物品"); + return; + } + if(records.length != 1){ + showResult("只能选择一个一次性物品"); + return; + } + + var storageRecord = new StorageRecord(); + storageRecord.setDisposableGoodsId(records[0].data['id']); + storageRecord.showDetail(); +} +//打印批次条码 +function printBatchStockBarcode(grid){ + var records = grid.getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择要打印批次条码的物品"); + }else{ + var ids = ""; + for(var i = 0,len=records.length;i 1) { + showResult("一次只能修改一个一次性物品!"); + return false; + } + id = records[0].data['id']; + addExpensiveGoods(id); + top.Ext.getCmp('expensiveGoodsForm').form.load({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!loadExpensiveGoods.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + params : {id : id}, + success : function(form, action) { + var expensiveGoods = action.result.data; + top.Ext.getCmp("originalGoodsType").setValue(expensiveGoods.goodsType); + top.Ext.getCmp("orginalName").setValue(expensiveGoods.name); + top.Ext.getCmp("orginalSpecification").setValue(expensiveGoods.specification); + top.Ext.getCmp("orginalApplicationSpecification").setValue(expensiveGoods.applicationSpecification); + }, + failure : function(form, action) { + } + }); +}; + +function reloadGrid(type){ + $Id("parm_s_type").value = type; + grid.dwrReload(); +} + +function modify(){ + loadFormData(grid); +} + +function rendeColor(v, p, record){ + var data = record.data; + var amount = data.amount; + if(typeof amount=='number'){ + if((typeof data.minStorage=='number' && data.minStorage>amount) || (typeof data.maxStorage=='number' && data.maxStorage" + v + "

"; + } + } + return "" + v + ""; +} + +//hrp一次性物品信息 +function getHrpDiposableGood(){ + var inventorySerialNumber = top.Ext.getCmp('inventorySerialNumber').getValue(); + if(!inventorySerialNumber){ + showResult("请填写物资编码"); + return false; + } + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!getHrpDefinition.do', + params : {inventorySerialNumber : inventorySerialNumber}, + success : function(response, options){ + var obj = Ext.util.JSON.decode(response.responseText); + if(obj.success){ + var data = obj.data; + if (data) { + top.Ext.getCmp("hrpName").setValue(data.name); + top.Ext.getCmp("hrpSpecification").setValue(data.specification); + top.Ext.getCmp("hrpUnit").setValue(data.unit); + top.Ext.getCmp("hrpCost").setValue(data.cost); + top.Ext.getCmp("hrpContrastDefinition").show(); + } else { + showResult("没有该物资编码对应的hrp一次性物品信息"); + } + }else{ + showResult("后台异常,请联系系统管理!"); + } + } + }) +} + +Ext.onReady(function() { + Ext.QuickTips.init(); + + //********* 1、Tree *********** + root = new Ext.tree.AsyncTreeNode({ + text:'一次性物品类型', + id:'0', + draggable:false, + listeners:{ + click:function(node,event){ + reloadGrid(""); + } + } + }); + + var myLoader = new Ext.tree.TreeLoader({dataUrl:WWWROOT + '/disinfectSystem/expensiveGoodsAction!treeLoad.do'}); + + //********* 2、ForgonGrid *********** + var columns = [ + {header : "编码",width : 60,dataIndex : 'externalCode'}, + {header : "名称",width : 150,dataIndex : 'name', renderer : rendeColor}, + {header : "规格",width : 100,dataIndex : 'specification'}, + {header : "类型",width : 80,dataIndex : 'type'}, + {header : "类别",width : 80,dataIndex : 'grade'}, + {header : "包装规格",width : 80,dataIndex : 'packageSpec'}, + {header : "参考价",width : 60,dataIndex : 'referencePrice'}, + {header : "总数",width : 50,dataIndex : 'amount',hidden:true}, + {header : "最小申请数量",width : 80,dataIndex : 'minApplyAmount'}, + {header : "最大申请数量",width : 80,dataIndex : 'maxApplyAmount'}, + {header : "单位",width : 50,dataIndex : 'unit'}, + {header : "申领单位",width : 90,dataIndex : 'middlePackageUnit'}, + {header : "申领单位转换单位系数",width : 90,dataIndex : 'transferScale'}, + {header : "顺序号",width : 50,dataIndex : 'sequence'}, + {header : "拼音码",width : 90,dataIndex : 'spelling'}, + {header : "五笔码",width : 90,dataIndex : 'wbCode'}, + {header : "能否作为器械包材料",width : 120,dataIndex : 'isPartOfTousseMaterial'}, + {header : "能否被科室申请",width : 100,dataIndex : 'isApplicationMaterial'}, + {header : "是否消毒供应中心领用物品",width : 100,dataIndex : 'isSupplyRoomGoods'}, + {header : "最小库存",width : 60,dataIndex : 'minStorage'}, + {id : 'operationRemark',header : "最大库存",width : 60,dataIndex : 'maxStorage'} + + ]; + + var readerDetail = [ + {name : 'id'}, + {name : 'name'}, + {name : 'externalCode'}, + {name : 'specification'}, + {name : 'type'}, + {name : 'grade'}, + {name : 'packageSpec'}, + {name : 'amount'}, + {name : 'minApplyAmount'}, + {name : 'maxApplyAmount'}, + {name : 'unit'}, + {name : 'middlePackageUnit'}, + {name : 'transferScale'}, + {name : 'sequence'}, + {name : 'minStorage'}, + {name : 'maxStorage'}, + {name : 'spelling'}, + {name : 'wbCode'}, + {name : 'isPartOfTousseMaterial'}, + {name : 'referencePrice'}, + {name : 'isApplicationMaterial'}, + {name : 'isSupplyRoomGoods'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters:[ + {type: 'string', dataIndex: 'name'}, + {type: 'string', dataIndex: 'externalCode'}, + {type: 'numeric', dataIndex: 'amount'}, + {type: 'numeric', dataIndex: 'minApplyAmount'}, + {type: 'numeric', dataIndex: 'maxApplyAmount'}, + {type: 'string', dataIndex: 'unit'}, + {type: 'string', dataIndex: 'middlePackageUnit'}, + {type: 'numeric', dataIndex: 'transferScale'}, + {type: 'numeric', dataIndex: 'sequence'}, + {type: 'numeric', dataIndex: 'minStorage'}, + {type: 'numeric', dataIndex: 'maxStorage'}, + {type: 'string', dataIndex: 'spelling'}, + {type: 'string', dataIndex: 'wbCode'}, + {type: 'string', dataIndex: 'isPartOfTousseMaterial'}, + {type: 'string', dataIndex: 'isApplicationMaterial'}, + {type: 'string', dataIndex: 'isSupplyRoomGoods'}, + {type: 'numeric', dataIndex: 'referencePrice'} + ]} + ); + + var tbar = [ { + text : '添加', + hidden : SSTS_ExpensiveGoods_Create, + iconCls : 'btn_ext_application_add', + handler : function() { + addExpensiveGoods(0); + } + }, '-', { + text : '修改', + hidden : SSTS_ExpensiveGoods_Update, + iconCls : 'btn_ext_application_edit', + id : 'editTbar', + handler : function() { + loadFormData(grid); + } + }, '-', { + text : '删除', + hidden : SSTS_ExpensiveGoods_Delete, + iconCls : 'btn_ext_application_del', + handler : function() { + deleteExpensiveGoods(grid); + } + },'-',{ + text : '出入库记录', + iconCls : 'btn_ext_refresh', + handler : function(){ + onStorageRecordDetail(grid); + } + }, '-' , { + text : '打印批次', + hidden : false, + iconCls : 'icon_print', + handler : function(){ + printBatchStockBarcode(grid); + } + }, '-' , { + text : '打印高值耗材', + hidden : false, + iconCls : 'icon_print', + handler : function(){ + printExpensiveDisposableGoodsBarcode(grid); + } + }/* + , '-' , { + //用于程序员调试 + text : '更新旧数据', + hidden : false, + handler : function() { + ExpensiveGoodsTableManager.updateOldData(function(msg){showResult(msg);}); + } + }, '-' , { + //将属于供应室领用的一次性物品进行分类 + text : '分类供应室领用类型', + hadden : false, + handler : function() { + ExpensiveGoodsTableManager.updateSupplyRoomExpensiveGoodsType(function(msg){showResult('更新成功,请刷新页面')}); + } + } + , '-' , { + text : '导出一次性物品库存', + handler : function() { + window.location.href = WWWROOT+"/disinfectsystem/reportforms/expensiveGoodsStorageReportExportForm.jsp"; + } + }, '-' , { + text : '导出物资收发存汇总', + handler : function() { + window.location.href = WWWROOT+"/disinfectsystem/reportforms/expensiveGoodsPriceStatisticsReportExportForm.jsp"; + } + }, '-' , { + //用于程序员调试 + text : '更新旧数据', + hidden : false, + handler : function() { + ExpensiveGoodsTableManager.updateOldData(function(msg){showResult(msg);}); + } + }, '-', { + text : '导入一次性物品库存EXCEL', + hidden : false, + handler : function() { + location.href = WWWROOT + + "/disinfectsystem/basedatamanager/importbasedata/amendExpensiveGoodsStorage.mhtml"; + } + } + */ + ]; + + grid = new Ext.ux.ForgonPageGrid( { + tbar : tbar, + pageSize : 20, + defaultSortField : 'externalCode', + title : '一次性物品列表', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + plugins: filters, + columns : columns, + autoExpandColumn : 'operationRemark', + renderTo : 'gridDiv', + frame : false + }, readerDetail, + ExpensiveGoodsTableManager.findDisposableGoodsTableList, + null + ); + + var viewport = new Ext.Viewport({ + layout:'border', + items:[{ + region:'west', + id:'west-panel', + lines : false, + margins : '0 0 5 5', + cmargins : '0 0 0 0', + layout : 'accordion', + layoutConfig : {animate : true}, + collapsible: true, //允许折叠 + animCollapse:true, //折叠时是否有动画效果 + split: true, //是否允许拖动大小,与下面的折叠形式配合 + collapseMode:'mini', //折叠形式 + width: 200, + minSize : 130, + maxSize : 400, + xtype: 'treepanel', + loader: myLoader, //数据加载 + autoScroll: true, + root: root, + tbar:[ + new Ext.Action({ + text: '展开所有', + handler: function(){ + var treePanel = viewport.findById('west-panel'); + treePanel.expandAll(); + } + }), + new Ext.Action({ + text: '折叠所有', + handler: function(){ + var treePanel = viewport.findById('west-panel'); + treePanel.collapseAll(); + } + }) + ] + },{ + region:'center', + margins:'0 5 5 0', + xtype : 'panel', + autoScroll:true, + layout: 'fit', + items:grid + }] + }); + + root.expand(false, /*no anim*/ false); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsWarningView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsWarningView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsWarningView.js (revision 20772) @@ -0,0 +1,493 @@ +var entityName = "一次性物品"; +var grid; +var formObj; +var formWindow; + +function addDiposableGoods(id) { + var diposableGooodsStore = new Ext.data.SimpleStore({ + fields : [ 'typeName' ], + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsType.do', + listeners:{ + load:function(store,records) { + if(records.length>0 && id==0) { + top.Ext.getCmp('type').setValue(records[0].data.typeName); + } + } + } + }); + + //能否作为器械包材料 + var isPartOfTousseMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + //能否被科室申请 + var isApplicationMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + var godownEntryItemStore = new top.Ext.data.Store({ + proxy : new top.Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadExpiredGodownEntryItemByid.do?id=' + id, + method : 'POST' + }), + reader : new top.Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'barcode'}, + {name : 'storage'}, + {name : 'batchNumber'}, + {name : 'cost'}, + {name : 'expDate'}, + {name : 'supplierName'} + ] + }) + }); + + + var selectModel = new top.Ext.grid.CheckboxSelectionModel(); + formObj = new top.Ext.FormPanel( { + id : 'diposableGoodsForm', + frame : true, + labelAlign:'right', + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + autoHeight : true, + autoScroll : true, + items:[{ + layout : 'column', + items : [{ + columnWidth : 0.4, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'items', + id : 'items' + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'textfield', + fieldLabel : '名称', + maxLength : '41', + id : 'name', + name : 'name', + allowBlank : false, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'textfield', + fieldLabel : '规格', + maxLength : '41', + id : 'specification', + name : 'specification', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'combo', + fieldLabel : "类别", + valueField : 'typeName', + displayField : 'typeName', + store : diposableGooodsStore, + forceSelection : true, + editable : false, + triggerAction : 'all', + name : "type", + id : "type", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'combo', + fieldLabel : "能否配包", + valueField : 'value', + displayField : 'value', + store : isPartOfTousseMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isPartOfTousseMaterial", + id : "isPartOfTousseMaterial", + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'combo', + fieldLabel : '能否申请', + valueField : 'value', + displayField : 'value', + store : isApplicationMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isApplicationMaterial", + id : "isApplicationMaterial", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小库存', + allowDecimals : false, + maxLength : '16', + id : 'minStorage', + name : 'minStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'numberfield', + fieldLabel : '最大库存', + allowDecimals : false, + maxLength : '16', + id : 'maxStorage', + name : 'maxStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'textfield', + fieldLabel : '拼音码', + id : 'spelling', + name : 'spelling', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'textfield', + fieldLabel : '五笔码', + id : 'wbCode', + name : 'wbCode', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'numberfield', + fieldLabel : '参考价', + maxLength : '16', + id : 'referencePrice', + name : 'referencePrice', + allowNegative : false, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'textfield', + fieldLabel : '外部编码', + maxLength : '16', + id : 'externalCode', + name : 'externalCode', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小申请数量', + maxLength : '16', + id : 'minApplyAmount', + name : 'minApplyAmount', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'textfield', + fieldLabel : '单位', + maxLength : '16', + id : 'unit', + name : 'unit', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 80, + items : [{ + xtype : 'numberfield', + fieldLabel : '总数', + maxLength : '16', + id : 'expDateAmount', + name : 'expDateAmount', + readOnly : true, + cls : 'fieldReadOnlyNoRemove', + allowBlank : false, + value : 0, + anchor : '95%' + }] + } + ] + },{ + columnWidth : 0.6, + layout : 'form', + items : [ + new top.Ext.grid.GridPanel({ + id :'batchNumberGrid', + store : godownEntryItemStore , + height : 325, + width : 485, + bodyStyle : 'border:1px solid #afd7af', + sm : selectModel, + cm: new top.Ext.grid.ColumnModel([selectModel, + {header : "id",dataIndex : 'id',hidden : true}, + {header : "条码",width : 90,dataIndex : 'barcode',menuDisabled:true}, + {header : "批次",width : 90,dataIndex : 'batchNumber',menuDisabled:true}, + {header : "价格",width : 50,dataIndex : 'cost',menuDisabled:true}, + {header : "库存",width : 50,dataIndex : 'storage',menuDisabled:true}, + {header : "失效期",width : 90,dataIndex : 'expDate',renderer:myDateFormat,menuDisabled:true}, + {id:'supplierName',header : "供应商",width : 130,dataIndex : 'supplierName',menuDisabled:true} + ]), + autoExpandColumn : 'supplierName', + frame : false, + viewConfig: {forceFit:true}, + title : '批次列表' + }) + ] + }] + }], + buttons : [{ + id : 'cancleBtn', + text : '取消', + handler : function() { + formWindow.close(); + } + }] + }); + + if($Id("parm_s_type").value != ""){ + top.Ext.getCmp("type").setValue($Id("parm_s_type").value); + } + + formWindow = new top.Ext.Window( { + id : 'diposableGoodsWin', + layout : 'fit', + title : '一次性物品信息'+'('+$Id("parm_s_type").value+')', + width : 850, + modal : true, + autoHeight : true, + border : false, + plain : true, + items : [ formObj ] + }); + formWindow.show(); + diposableGooodsStore.load(); + if(id != 0){ + godownEntryItemStore.baseParams.type = $Id("parm_s_type").value//警告类型 + godownEntryItemStore.load(); + } +} + + +var loadFormData = function(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要修改的一次性物品!"); + return false; + } + if (records.length > 1) { + showResult("一次只能修改一个一次性物品!"); + return false; + } + id = records[0].data['diposableGoods.id']; + addDiposableGoods(id); + top.Ext.getCmp('diposableGoodsForm').form.load({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadExpiredDiposableGoods.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + params : {id : id, type: $Id("parm_s_type").value}, + success : function(form, action) { + }, + failure : function(form, action) { + } + }); +}; + +function reloadGrid(type){ + $Id("parm_s_type").value = type; + grid.dwrReload(); +} + +function modify(){ + loadFormData(grid); +} + +function rendeColor(v, p, record){ + var data = record.data; + var amount = data.amount; + if(typeof amount=='number'){ + if((typeof data.minStorage=='number' && data.minStorage>amount) || (typeof data.maxStorage=='number' && data.maxStorage" + v + "

"; + } + } + return "" + v + ""; +} + +Ext.onReady(function() { + Ext.QuickTips.init(); + document.getElementById("parm_s_type").value = warningType; + + //********* 2、ForgonGrid *********** + var columns = [ + {header : "名称",width : 150,dataIndex : 'diposableGoods.name', renderer : rendeColor}, + {header : "规格",width : 100,dataIndex : 'diposableGoods.specification'}, + {header : "编号",width : 50,dataIndex : 'diposableGoods.externalCode'}, + {header : "参考价",width : 60,dataIndex : 'diposableGoods.referencePrice'}, + {header : "总数",width : 50,dataIndex : 'diposableGoods.amount'}, + {header : "最小申请数量",width : 80,dataIndex : 'diposableGoods.minApplyAmount'}, + {header : "单位",width : 50,dataIndex : 'diposableGoods.unit'}, + {header : "拼音码",width : 90,dataIndex : 'diposableGoods.spelling'}, + {header : "五笔码",width : 90,dataIndex : 'diposableGoods.wbCode'}, + {header : "能否作为器械包材料",width : 120,dataIndex : 'diposableGoods.isPartOfTousseMaterial'}, + {header : "能否被科室申请",width : 100,dataIndex : 'diposableGoods.isApplicationMaterial'}, + {header : "最小库存",width : 60,dataIndex : 'diposableGoods.minStorage'}, + {id : 'operationRemark',header : "最大库存",width : 60,dataIndex : 'diposableGoods.maxStorage'} + + ]; + + var readerDetail = [ + {name : 'diposableGoods.id'}, + {name : 'diposableGoods.name'}, + {name : 'diposableGoods.externalCode'}, + {name : 'diposableGoods.specification'}, + {name : 'diposableGoods.amount'}, + {name : 'diposableGoods.minApplyAmount'}, + {name : 'diposableGoods.unit'}, + {name : 'diposableGoods.minStorage'}, + {name : 'diposableGoods.maxStorage'}, + {name : 'diposableGoods.spelling'}, + {name : 'diposableGoods.wbCode'}, + {name : 'diposableGoods.isPartOfTousseMaterial'}, + {name : 'diposableGoods.referencePrice'}, + {name : 'diposableGoods.isApplicationMaterial'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters:[ + {type: 'string', dataIndex: 'diposableGoods.name'}, + {type: 'string', dataIndex: 'diposableGoods.externalCode'}, + {type: 'numeric', dataIndex: 'diposableGoods.amount'}, + {type: 'numeric', dataIndex: 'diposableGoods.minApplyAmount'}, + {type: 'string', dataIndex: 'diposableGoods.unit'}, + {type: 'numeric', dataIndex: 'diposableGoods.minStorage'}, + {type: 'numeric', dataIndex: 'diposableGoods.maxStorage'}, + {type: 'string', dataIndex: 'diposableGoods.spelling'}, + {type: 'string', dataIndex: 'diposableGoods.wbCode'}, + {type: 'string', dataIndex: 'diposableGoods.isPartOfTousseMaterial'}, + {type: 'string', dataIndex: 'diposableGoods.isApplicationMaterial'}, + {type: 'numeric', dataIndex: 'diposableGoods.referencePrice'} + ]} + ); + + var invoiceTypeStore = new Ext.data.SimpleStore( { + fields : [ 'id','value'], + data : [['0','全部'],['1',disabledGoods],['2',diposableGoods]] + }); + + var tbar = [{ + text : '告警类型:' + },{ + xtype : 'combo', + id : 'warningType', + name : 'warningType', + valueField : 'id', + displayField : 'value', + store : invoiceTypeStore, + forceSelection : true, + mode : 'local', + editable:false, + triggerAction : 'all', + width : 180, + value:warningType, + listeners : { + select : function(combo,record,index ){ + $Id('parm_s_type').value = combo.getRawValue(); + grid.dwrReload(); + } + } + }]; + + grid = new Ext.ux.ForgonPageGrid( { + tbar : tbar, + pageSize : 20, + defaultSortField : 'id', + title : '一次性物品告警列表', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + plugins: filters, + columns : columns, + autoExpandColumn : 'operationRemark', + renderTo : 'gridDiv', + frame : false + }, readerDetail, + DiposableGoodsTableManager.findWarningDiposableGoodsTableList, + null + ); + + var viewport = new Ext.Viewport({ + layout:'border', + items:[{ + region:'center', + margins:'0 5 5 0', + xtype : 'panel', + autoScroll:true, + layout: 'fit', + items:grid + }] + }); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsImport.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsImport.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/diposableGoodsImport.jsp (revision 20772) @@ -0,0 +1,147 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + +<%@ include file="/common/includeUploadFilesJSAndCSS.jsp"%> + + + + + + + + + + + + + + + + + +
+ +
+
    +
  • 当前位置--导入${poName }
  • +
+
+
+ +
+ +
+
+
+
+

导入${poName }

+
+
+ + + + + +
${poName }文件: + +
+
+
+
+
+
+
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.jsp (revision 20772) @@ -0,0 +1,86 @@ +<%@page import="com.forgon.disinfectsystem.entity.basedatamanager.supplier.Supplier,com.forgon.disinfectsystem.entity.assestmanagement.GodownEntry "%> +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ page import="com.forgon.tools.SpringBeanManger" %> +<% + String userName = AcegiHelper.getLoginUser().getUserFullName(); + request.setAttribute("userName",userName); +%> + + + +入库单信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + + + +
+ + + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/batchStockCompare.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/batchStockCompare.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/batchStockCompare.js (revision 20772) @@ -0,0 +1,224 @@ +var entityName = "库存对比"; +var grid; + +/*var wareHouseStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'}, + {name : 'orgUnitCode',mapping : 'orgUnitCode'}, + ]), + listeners : { + load : function(store,records) { + if(records.length > 0 && (!commonEntry.isOpen())){ + var combo = top.Ext.getCmp("wareHouse1"); + // 触发选中事件 + combo.fireEvent('select', combo,records[0],0); + } + top.Ext.getCmp("name1").enable(); + } + } +});*/ + +// 全部一次性物品 +var allDiposableGoodsStore = new Ext.data.Store({ + pageSize: 100, + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsData.do?allItems=yes', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'sourceId',mapping : 'sourceId'}, + {name : 'name',mapping : 'name'}, + {name : 'displayName',mapping : 'displayName'} + ]) +}); + +function openFileImportWindow(){ + var dialog = new top.Ext.ux.UploadDialog.Dialog({ + title: "导入数据(只能上传一个文件)", + url:WWWROOT + '/disinfectSystem/disposableGoodsStockAction!uploadInventoryStockFile.do', //这里我用struts2做后台处理 + post_var_name:'uploadFiles',//这里是自己定义的,默认的名字叫file + width : 450, + height : 300, + minWidth : 450, + minHeight : 300, + draggable : true , + resizable : true , + constraintoviewport: true , + permitted_extensions:['xls'], + modal: true , + reset_on_hide: false , + allow_close_on_upload: false , //关闭上传窗口是否仍然上传文件 + upload_autostart: false + }); + + dialog.show(); + dialog.on('uploadsuccess',function(dialog){ + showResult("文件导入成功!"); + + //刷新外面的窗体表格数据 + grid.dwrReload(); + + dialog.hide(); + }); //定义上传完成回调函数 + dialog.on('uploadfailed',function(dialog){ + showResult("文件上传失败!"); + //dialog.hide(); + }); //定义上传完成回调函数 +} + +Ext.onReady(function() { + Ext.QuickTips.init(); + var columns = [ + {header : "sourceId",width : 200,dataIndex : 'sourceId',sortable:false}, + {header : "batchId",width : 200,dataIndex : 'batchId',sortable:false}, + {header : "外部编码",width : 200,dataIndex : 'externalCode',sortable:false}, + {header : "名称",width : 200,dataIndex : 'displayName',sortable:false}, + {header : "批次号",width : 200,dataIndex : 'batchNumber',sortable:false}, + {header : "追溯系统库存",width : 200,dataIndex : 'cssdStock',sortable:false}, + {header : "物资系统库存",width : 200,dataIndex : 'inventoryStock',sortable:false} + ]; + + var readerDetail = [ + {name : 'sourceId'}, + {name : 'batchId'}, + {name : 'externalCode'}, + {name : 'displayName'}, + {name : 'batchNumber'}, + {name : 'cssdStock'}, + {name : 'inventoryStock'} + ]; + + + + grid = new Ext.ux.ForgonPageGrid( { + pageSize : 10000, + //defaultSortField : 'externalCode', + title : '库存对比差异数据', + //defaultSortDirection : '', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : false, + columns : columns, + renderTo : 'gridDiv', + frame : false + }, readerDetail, + DiposableGoodsTableManager.findBatchStockCompareList, + null + ); + + function initQueryValueAndReload() { + var sourceId = Ext.getCmp('comboDisposableGoods').getValue(); + $Id('parm_s_sourceId').value = sourceId; + grid.dwrReload(); + } + var form = new Ext.Panel({ + id : 'northPanel', + layout : 'table', + frame : true, + region : 'north', + border : false, + bodyBorder : false, + layoutConfig : {columns : 2}, + height : 63, + items : [{ + width :500, + layout : 'column', + items:[{ + columnWidth : .99, + layout : 'form', + labelWidth : 60, + items : [{ + fieldLabel : '关键字', + xtype : 'combo', + id : 'comboDisposableGoods', + name : 'code', + queryParam : 'spell', + minChars : 0, + valueField : 'sourceId', + displayField : 'name', + store : allDiposableGoodsStore, + pageSize : 100, + width : 500, + listConfig: {width: 300}, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : true, + anchor : '97%', + listeners : { + select : function(combo, record, index) { + Ext.getCmp('comboDisposableGoods').setRawValue(record.data.name); + initQueryValueAndReload(); + } + } + }] + }] + },{ + width :300, + layout : 'column', + items : [{ + columnWidth : .32, + layout :'form', + items : [{ + xtype : 'button', + text : '查询', + minWidth : 70, + iconCls : 'icon_search', + handler : function() { + initQueryValueAndReload(); + } + }] + },{ + columnWidth : .32, + layout :'form', + items : [{ + xtype : 'button', + text : '重置', + minWidth : 70, + iconCls : 'icon_set', + handler : function() { + Ext.getCmp('comboDisposableGoods').setValue(""); + initQueryValueAndReload(); + } + }] + },{ + columnWidth : .36, + layout :'form', + items : [{ + xtype : 'button', + text : '导入物资库存', + minWidth : 100, + iconCls : 'icon_set', + handler : function() { + //构造文件上传的widnow及formPanel + openFileImportWindow(); + } + }] + }] + }] + }); + + var viewport = new Ext.Viewport( { + layout : 'border', + items : [form,{ + region : 'center', + margins : '0 0 0 0', + layout : 'fit', + items : grid + }] + }); +}); \ No newline at end of file Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsPurchasePlanManagerImpl.java =================================================================== diff -u -r20747 -r20772 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsPurchasePlanManagerImpl.java (.../ExpensiveGoodsPurchasePlanManagerImpl.java) (revision 20747) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsPurchasePlanManagerImpl.java (.../ExpensiveGoodsPurchasePlanManagerImpl.java) (revision 20772) @@ -26,17 +26,13 @@ import org.apache.poi.ss.usermodel.RichTextString; import com.forgon.Constants; -import com.forgon.disinfectsystem.common.CssdUtils; -import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; import com.forgon.disinfectsystem.entity.assestmanagement.GodownEntry; import com.forgon.disinfectsystem.entity.assestmanagement.GoodPurchaseItem; import com.forgon.disinfectsystem.entity.assestmanagement.GoodPurchasePlan; -import com.forgon.disinfectsystem.entity.basedatamanager.materialdefinition.MaterialDefinition; import com.forgon.disinfectsystem.vo.GodownEntryItemPrintVO; import com.forgon.serialnumber.model.SerialNum; import com.forgon.serialnumber.service.SerialNumManager; import com.forgon.tools.Path; -import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.excel.ExcelCellStyle; import com.forgon.tools.excel.ExcelHelper; import com.forgon.tools.hibernate.ObjectDao; Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveDisposableGoodsView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveDisposableGoodsView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveDisposableGoodsView.js (revision 20772) @@ -0,0 +1,448 @@ + +function loadExpensiveDisposableGoodsForm(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds) { + var dType = document.getElementById("parm_s_type").value; + var diposableGooodsStore = new Ext.data.SimpleStore({ + fields : [ 'typeName' ], + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsType.do' + }); + + //能否作为器械包材料 + var isPartOfTousseMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + //能否被科室申请 + var isApplicationMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + //是否供应室物品 + var yesNoStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[STR_YES],[STR_NO]] + }); + + var params = 'disposableGoodsId='+disposableGoodsId+'&disposableGoodsStockIds='+disposableGoodsStockIds+'&disposableGoodsBatchStockIds='+disposableGoodsBatchStockIds; + var godownEntryItemStore = new top.Ext.data.Store({ + proxy : new top.Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadExpensiveDisposableGoods.do?' + params, + method : 'POST' + }), + reader : new top.Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'barcode'}, + {name : 'batchNumber'}, + {name : 'price'}, + {name : 'status'}, + {name : 'expDate'}, + {name : 'printTime'}, + {name : 'warehouseName'}, + {name : 'supplierName'} + ] + }) + }); + + var tbar = [{ + text : '打印高值耗材', + iconCls : 'btn_ext_refresh', + handler : function(){ + + var grid = top.Ext.getCmp('batchNumberGrid'); + var records = grid.getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择要打印的高值耗材"); + }else{ + var ids = ""; + for(var i = 0,len=records.length;i