Fisheye: Tag 23729 refers to a dead (removed) revision in file `ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstanceView.js'. Fisheye: No comparison available. Pass `N' to diff? Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java =================================================================== diff -u -r23727 -r23729 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 23727) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 23729) @@ -3288,7 +3288,7 @@ ExpensiveGoodsInstance.class.getSimpleName(), expensiveGoodsInstanceSql); if(CollectionUtils.isNotEmpty(expensiveGoodsInstanceList)){ for (ExpensiveGoodsInstance expensiveGoodsInstance : expensiveGoodsInstanceList) { - if(expensiveGoodsInstance.getUseRecord()!=null|| expensiveGoodsInstance.getExpensiveGoodsBillId()!=null){ + if(expensiveGoodsInstance.getUseRecord()!=null|| expensiveGoodsInstance.getExpensiveGoodsBill()!=null){ invoicePlanList.remove(invoicePlan); break; } Index: ssts-web/src/main/webapp/expensivegoodshomepage/portalPage.js =================================================================== diff -u -r23640 -r23729 --- ssts-web/src/main/webapp/expensivegoodshomepage/portalPage.js (.../portalPage.js) (revision 23640) +++ ssts-web/src/main/webapp/expensivegoodshomepage/portalPage.js (.../portalPage.js) (revision 23729) @@ -455,7 +455,7 @@ //只显示高值耗材的几个图标和高级视图(因为需要登录时提示有关的告警信息,所以系统告警图标也需要显示) if(itemId == 'expensiveGoodsApplication' || itemId == 'expensiveGodownEntryPurchase' || itemId == 'expensiveGodownEntryPrepareIn' || itemId == 'expensiveInvoicePlan' || itemId == 'expensiveInvoice' || itemId == 'expensiveBill' || itemId == 'expensiveStockTake' - || itemId == 'useRecord' || itemId == 'myUnFinishedTask' || itemId == 'myFinishedTask' || itemId == 'expensiveEnterpriseView' || itemId == 'systemWarning'){ + || itemId == 'useRecord' || itemId == 'myUnFinishedTask' || itemId == 'myFinishedTask' || itemId == 'expensiveGoodsInstanceView' || itemId == 'expensiveEnterpriseView' || itemId == 'systemWarning'){ var itemLinkUrl = encodeURI(item['itemLinkUrl']); returnContent += '
  • '; returnContent += '

    '; Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsTableManager.java =================================================================== diff -u -r22353 -r23729 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsTableManager.java (.../ExpensiveGoodsTableManager.java) (revision 22353) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/dwr/table/ExpensiveGoodsTableManager.java (.../ExpensiveGoodsTableManager.java) (revision 23729) @@ -4,23 +4,33 @@ import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; +import java.util.Collection; import java.util.Date; +import java.util.GregorianCalendar; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import net.sf.json.JSONObject; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Transformer; import org.apache.commons.lang.StringUtils; import org.directwebremoting.util.Logger; import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSONArray; +import com.fasterxml.jackson.databind.ObjectMapper; import com.forgon.Constants; import com.forgon.component.grid.GridManager; import com.forgon.databaseadapter.service.DateQueryAdapter; +import com.forgon.directory.acegi.tools.AcegiHelper; +import com.forgon.directory.model.BarcodeDevice; +import com.forgon.directory.vo.LoginUserData; import com.forgon.disinfectsystem.basedatamanager.supplier.service.ExpensiveGoodsSupplierManager; import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; @@ -32,16 +42,27 @@ import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsStock; import com.forgon.disinfectsystem.entity.basedatamanager.datasynchronization.HisMaterialDefinition; import com.forgon.disinfectsystem.entity.basedatamanager.datasynchronization.HisMaterialType; +import com.forgon.disinfectsystem.entity.basedatamanager.sterilizer.Sterilizer; import com.forgon.disinfectsystem.entity.basedatamanager.supplier.ExpensiveGoodsSupplier; import com.forgon.disinfectsystem.entity.basedatamanager.supplier.RegistrationCertification; +import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseInstance; +import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse; +import com.forgon.disinfectsystem.entity.idcardinstance.IDCardInstance; +import com.forgon.disinfectsystem.entity.invoicemanager.Invoice; +import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; import com.forgon.disinfectsystem.entity.systemwarning.SystemWarningItemVO; +import com.forgon.disinfectsystem.entity.useRecord.UseRecord; +import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsInstanceManager; import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsManager; import com.forgon.disinfectsystem.expensiveGoods.util.ExpensiveGoodsUtils; +import com.forgon.disinfectsystem.idpredicate.IDOperators; import com.forgon.systemsetting.model.HttpOption; import com.forgon.systemsetting.service.HttpOptionManager; import com.forgon.tools.SpringBeanManger; +import com.forgon.tools.SqlBuilder; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.util.SqlUtils; +import com.forgon.disinfectsystem.barcode.service.BarcodeManager; @Service public class ExpensiveGoodsTableManager { @@ -58,8 +79,10 @@ private SupplyRoomConfigManager supplyRoomConfigManager; - private ExpensiveGoodsSupplierManager expensiveGoodsSupplierManager; + private BarcodeManager barcodeManager; + private ExpensiveGoodsInstanceManager expensiveGoodsInstanceManager; + public void setDateQueryAdapter(DateQueryAdapter dateQueryAdapter) { this.dateQueryAdapter = dateQueryAdapter; } @@ -88,10 +111,14 @@ this.supplyRoomConfigManager = supplyRoomConfigManager; } - public void setExpensiveGoodsSupplierManager( - ExpensiveGoodsSupplierManager expensiveGoodsSupplierManager) { - this.expensiveGoodsSupplierManager = expensiveGoodsSupplierManager; + public void setBarcodeManager(BarcodeManager barcodeManager) { + this.barcodeManager = barcodeManager; } + + public void setExpensiveGoodsInstanceManager( + ExpensiveGoodsInstanceManager expensiveGoodsInstanceManager) { + this.expensiveGoodsInstanceManager = expensiveGoodsInstanceManager; + } /** * 查找高值耗材库存 @@ -159,37 +186,6 @@ null); } - public String findExpensiveGoodsInstanceTableList( - Map> parameterMap) { - Map sqlWhereParamMap = gridManager - .getParamFromView(parameterMap); - - // 关键字查询-》把小写字母转换成大写字母 - if (!parameterMap.get("grid_search_query").isEmpty()) { - List keyList = parameterMap.get("grid_search_query"); - List queryKey = new ArrayList(keyList.size()); - for (int i = 0; i < keyList.size(); i++) { - queryKey.add(((String) keyList.get(i)).toUpperCase()); - } - parameterMap.put("grid_search_query", queryKey); - } - String type = sqlWhereParamMap.get("type"); - String sql = "where 1=1"; - - if (StringUtils.isNotBlank(type)) { - sql = String.format(" where %s", SqlUtils.getStringFieldPredicate("expensiveGoods.type", type)); - } else { - sql += " and 1=1"; - } - if(!supplyRoomConfigManager.isExpensiveGoodsSupplyRoomUser()){ - sql += " and " + SqlUtils.getNonStringFieldInCollectionsPredicate("po.warehouseID", wareHouseManager.getCurrentUserOrgUnitWarehouseIds()); - } - return gridManager.renderGrid(parameterMap, - ExpensiveGoodsInstance.class.getSimpleName(), sql, - null); - } - - // 高值耗材使用记录 public String findExpensiveDisposableGoodsUseRecordList( Map> parameterMap) { @@ -267,8 +263,344 @@ filterProperties); return json; } + + //高值耗材实例查询 + public String findExpensiveGoodsInstanceTableList(Map> parameterMap) { + Map sqlWhereParamMap = gridManager.getParamFromView(parameterMap); + // 关键字查询-》把小写字母转换成大写字母 + if (!parameterMap.get("grid_search_query").isEmpty()) { + List keyList = parameterMap.get("grid_search_query"); + List queryKey = new ArrayList(keyList.size()); + for (int i = 0; i < keyList.size(); i++) { + queryKey.add(((String) keyList.get(i)).toUpperCase()); + } + parameterMap.put("grid_search_query", queryKey); + } + String type = sqlWhereParamMap.get("type"); + String sql = "where 1=1"; + + if (StringUtils.isNotBlank(type)) { + sql = String.format(" where %s", SqlUtils.getStringFieldPredicate("expensiveGoods.type", type)); + } else { + sql += " and 1=1"; + } + if(!supplyRoomConfigManager.isExpensiveGoodsSupplyRoomUser()){ + sql += " and " + SqlUtils.getNonStringFieldInCollectionsPredicate("po.warehouseID", wareHouseManager.getCurrentUserOrgUnitWarehouseIds()); + } + return gridManager.renderGrid(parameterMap, + ExpensiveGoodsInstance.class.getSimpleName(), sql, + null); + } + +////////////////////////实例查询////////////////////////////////////////////////// /** + * 把参数endTime加上秒(前台传回来的值只到分),然后根据数据库对应数据是否为date类型来判断是否需要进行适配 + * @param startTime + * @param isDateType 数据库字段是否为date类型 + * @return + */ + private String parseStartTime(String startTime, boolean isDateType){ + String startString = startTime+":00"; + if(isDateType){ + return dateQueryAdapter.dateAdapter(startString); + }else{ + return startString; + } + } + + /** + * 把参数endTime加1min之后转换为对应的数据库的yyyy-MM-dd HH:mm:00格式的日期数据返回 + * @param endTime 结束时间 + * @param isDateType 数据库字段是否为date类型 + * @return + */ + private String parseEndTime(String endTime, boolean isDateType){ + Date date = null; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + try + { + date = sdf.parse(endTime); + } + catch (Exception e) + { +// logger.debug("解析时间出错"); + } + Calendar calendar = new GregorianCalendar(); + calendar.setTime(date); + + calendar.add(Calendar.MINUTE, +1); //推后1min + Date end = calendar.getTime(); + String endString = sdf.format(end)+":00"; + if(isDateType){ + return dateQueryAdapter.dateAdapter(endString); + }else{ + return endString; + } + } + + @SuppressWarnings("unchecked") + public String findExpensiveGoodsInstanceTableList2(Map> parameterMap) { + Map sqlWhereParamMap = gridManager.getParamFromView(parameterMap); + + /***********过滤条件********/ + StringBuilder sqlBuilder = new StringBuilder(" WHERE 1=1 "); + //1、条码条件 + //条码() + String barcodeSearch = sqlWhereParamMap.get("barcodeSearch"); + //条码集合(用户启用多次扫描模式并且不是第一次扫描条码时才有值,此时要按照此条码集合查询) + String barcodes = sqlWhereParamMap.get("barcodes"); + if(StringUtils.isNotBlank(barcodeSearch)){ + BarcodeDevice barcodeDevice = barcodeManager.getBarcodeByBarcode(barcodeSearch); + //1、若无此条码 2、用户没启用多次扫描模式,或者是启用了而且是第一次扫描 (同时满足1和2则两个条件直接返回) + if(barcodeDevice == null && StringUtils.isBlank(barcodes)) { + String[] fp = {}; + Map map = new HashMap(); + map.put("totalResults", 0); + map.put("list", Arrays.asList()); + map.put("selectSqlWhereCondition", ""); + String json = gridManager.converJsonString(0, Arrays.asList(), "",fp); + return json; + } + if (StringUtils.isNotBlank(barcodes)) { + String[] barcodeArray = barcodes.split(";"); + List barcodeList = Arrays.asList(barcodeArray); + sqlBuilder.append(" AND" + SqlBuilder.build_IN_Statement("po.barcode",SqlBuilder.IN, barcodeList)); + } else { + sqlBuilder.append(String.format(" AND po.barcode = '%s'",barcodeSearch)); + } + } + + //2、物品名称条件 + //通过在物品下拉框选项中选中的名称(采用精确匹配) + String expensiveGoodName = sqlWhereParamMap.get("expensiveGoodName"); + //通过在物品下拉里输入但未从下拉选项选中的物品名称(采用模糊匹配) + String expensiveGoodNameFuzzy = sqlWhereParamMap.get("expensiveGoodNameFuzzy"); + if (StringUtils.isNotBlank(expensiveGoodName)) { + sqlBuilder.append(" AND po.expensiveGoods.name = '" + expensiveGoodName+ "'"); + }else if (StringUtils.isNotBlank(expensiveGoodNameFuzzy)) { + sqlBuilder.append(" AND po.expensiveGoods.name like '%" + expensiveGoodNameFuzzy+ "%'"); + } + + //3、型号名称条件 + //通过在型号下拉框选项中选中的名称(采用精确匹配) + String modelName = sqlWhereParamMap.get("modelName"); + //通过在型号下拉里输入但未从下拉选项选中的物品名称(采用模糊匹配) + String modelNameFuzzy = sqlWhereParamMap.get("modelNameFuzzy"); + if (StringUtils.isNotBlank(modelName)) { + sqlBuilder.append(" AND po.model = '" + modelName+ "'"); + }else if (StringUtils.isNotBlank(modelNameFuzzy)) { + sqlBuilder.append(" AND po.model like '%" + modelNameFuzzy+ "%'"); + } + + //4、科室过滤条件 + String department = sqlWhereParamMap.get("department"); + if (StringUtils.isNotBlank(department)){ + sqlBuilder.append(String.format(" AND po.location = '%s' ",department)); + } + + //5、实例状态过滤条件 + String instanceStatus = sqlWhereParamMap.get("instanceStatus"); + if (StringUtils.isNotBlank(instanceStatus)){ + String[] instanceStatuses = instanceStatus.split(", "); + if(!"全部".equals(instanceStatuses[0])){ + if(instanceStatuses.length == 1){ + sqlBuilder.append(String.format(" AND (po.status = '%s') ",instanceStatuses[0])); + }else{ + sqlBuilder.append(String.format(" AND (%s) ", + SqlUtils.getStringFieldInCollectionsPredicate("po.status", Arrays.asList(instanceStatuses)))); + } + } + } + + //6、实例结算状态过滤条件 + String instanceSettledStatus = sqlWhereParamMap.get("instanceSettledStatus"); + if (StringUtils.isNotBlank(instanceSettledStatus)){ + String[] instanceSettledStatuses = instanceSettledStatus.split(", "); + if(!"全部".equals(instanceSettledStatuses[0])){ + if(instanceSettledStatuses.length == 1){ + sqlBuilder.append(String.format(" AND (po.settledStatus = '%s') ",instanceSettledStatuses[0])); + }else{ + sqlBuilder.append(String.format(" AND (%s) ", + SqlUtils.getStringFieldInCollectionsPredicate("po.settledStatus", Arrays.asList(instanceSettledStatuses)))); + } + } + } + + //7、实例验收状态过滤条件 + String instanceCheckStatus = sqlWhereParamMap.get("instanceCheckStatus"); + if (StringUtils.isNotBlank(instanceCheckStatus)){ + String[] instanceCheckStatuses = instanceCheckStatus.split(", "); + if(!"全部".equals(instanceCheckStatuses[0])){ + if(instanceCheckStatuses.length == 1){ + sqlBuilder.append(String.format(" AND (po.checkStatus = '%s') ",instanceCheckStatuses[0])); + }else{ + sqlBuilder.append(String.format(" AND (%s) ", + SqlUtils.getStringFieldInCollectionsPredicate("po.checkStatus", Arrays.asList(instanceCheckStatuses)))); + } + } + } + + //8、实例入库类型过滤条件 + String expensiveGoodsGodownType = sqlWhereParamMap.get("expensiveGoodsGodownType"); + if (StringUtils.isNotBlank(expensiveGoodsGodownType)){ + String[] expensiveGoodsGodownTypes = expensiveGoodsGodownType.split(", "); + if(!"全部".equals(expensiveGoodsGodownTypes[0])){ + if(expensiveGoodsGodownTypes.length == 1){ + sqlBuilder.append(String.format(" AND (po.entryType = '%s') ",expensiveGoodsGodownTypes[0])); + }else{ + sqlBuilder.append(String.format(" AND (%s) ", + SqlUtils.getStringFieldInCollectionsPredicate("po.entryType", Arrays.asList(expensiveGoodsGodownTypes)))); + } + } + } + + //9、入库时间过滤条件 + String godownStartTime = sqlWhereParamMap.get("godownStartTime"); //入库开始时间 + if (StringUtils.isNotBlank(godownStartTime)) { + sqlBuilder.append(String.format( + " AND po.entryDate >= '%s' ",parseStartTime(godownStartTime,false))); + } + + String godownEndTime = sqlWhereParamMap.get("godownEndTime"); //入库结束日期 + if (StringUtils.isNotBlank(godownEndTime)) { + sqlBuilder.append(String.format( + " AND po.entryDate <= '%s' ",parseEndTime(godownEndTime,false))); + } + + //10、使用时间过滤条件 + String useRecordStratTime = sqlWhereParamMap.get("useRecordStratTime"); //使用开始时间 + if (StringUtils.isNotBlank(useRecordStratTime)) { + sqlBuilder.append(String.format( + " AND po.useRecord.enteringDate >= '%s' ",parseStartTime(useRecordStratTime,false))); + } + + String useRecordEndTime = sqlWhereParamMap.get("useRecordEndTime"); //使用结束日期 + if (StringUtils.isNotBlank(useRecordEndTime)) { + sqlBuilder.append(String.format( + " AND po.useRecord.enteringDate <= '%s' ",parseEndTime(useRecordEndTime,false))); + } + + //11、结算时间过滤条件 + String billStatrTime = sqlWhereParamMap.get("billStatrTime"); //结算开始时间 + if (StringUtils.isNotBlank(billStatrTime)) { + sqlBuilder.append(String.format( + " AND po.expensiveGoodsBill.settledTime >= '%s' ",parseStartTime(billStatrTime,false))); + } + + String billEndTime = sqlWhereParamMap.get("billEndTime"); //结算结束日期 + if (StringUtils.isNotBlank(billEndTime)) { + sqlBuilder.append(String.format( + " AND po.expensiveGoodsBill.settledTime <= '%s' ",parseEndTime(billEndTime,false))); + } + + /*******获得返回信息************/ + int start = 0; + int pageSize = 20; + String orderStr = ""; + String filterSqlStr = ""; + String searchSql = ""; + String filterSql = ""; + if (parameterMap != null) { + Map paramSqlMap = gridManager.parserMapToSQL(parameterMap); + orderStr = paramSqlMap.get(GridManager.GRID_MAPPARAM_SORT_KEY); + filterSqlStr = paramSqlMap.get(GridManager.GRID_MAPPARAM_FILTER_KEY); + List pageStart = parameterMap.get(GridManager.GRID_PAGE_START); + if (pageStart != null && pageStart.size() > 0 + && StringUtils.isNotBlank(pageStart.get(0)) + && StringUtils.isNumeric(pageStart.get(0))) { + start = Integer.valueOf(pageStart.get(0)); + } + + List pageSizeStr = parameterMap.get(GridManager.GRID_PAGE_SIZE); + if (pageSizeStr != null && pageSizeStr.size() > 0 + && StringUtils.isNotBlank(pageSizeStr.get(0)) + && StringUtils.isNumeric(pageSizeStr.get(0))) { + pageSize = Integer.valueOf(pageSizeStr.get(0)); + } + + // 处理GridSearch的参数 + searchSql = gridManager.getSearchFieldSql(parameterMap); + // 处理GridFilter的参数 + filterSql = gridManager.getFilterFieldSql(parameterMap); + } + + // 合并用户自定义的sql + if (StringUtils.isNotBlank(filterSqlStr)) { + sqlBuilder.append(" AND "); + sqlBuilder.append(filterSqlStr); + } + + if (StringUtils.isNotBlank(searchSql)) { + sqlBuilder.append(" AND "); + sqlBuilder.append(searchSql); + } + + if (StringUtils.isNotBlank(filterSql)) { + sqlBuilder.append(" AND "); + sqlBuilder.append(filterSql); + } + + String sql = sqlBuilder.toString(); + + int totalResults = objectDao.countObjectBySql(ExpensiveGoodsInstance.class.getSimpleName(), sql); + + List instancelist = objectDao.findBySql( + ExpensiveGoodsInstance.class.getSimpleName(), sql, start, + pageSize, orderStr); + + Map map = new HashMap(); + map.put("totalResults", totalResults); + map.put("list", instancelist); + map.put("selectSqlWhereCondition", sql); + + //增加申请时间 + List ids = instancelist.stream().map(ExpensiveGoodsInstance::getInvoicePlanId).collect(Collectors.toList()); + List invoicePlanIds = new ArrayList(); + for (Long id : ids) { + if(null!=id){ + invoicePlanIds.add(id); + } + } + if(!invoicePlanIds.isEmpty()){ + List InvoicePlans = objectDao.findByIds(InvoicePlan.class.getSimpleName(), invoicePlanIds); + for(Object obj : instancelist){ + ExpensiveGoodsInstance ti = (ExpensiveGoodsInstance) obj; + if(null==ti.getInvoicePlanId()){ + continue; + } + InvoicePlan ip = IDOperators.find(InvoicePlans,ti.getInvoicePlanId()); + if(null==ip){ + continue; + } + if(null!=ip.getApplicationTimeStr()){ + ti.setApplicationTimeStr(ip.getApplicationTimeStr()); + } + } + } + + //增加病人姓名 + List instanceIds = instancelist.stream().map(ExpensiveGoodsInstance::getId).collect(Collectors.toList()); + String sql2 = String.format("select epi.id as \"instanceId\",po.patientName from " + + " %s po join %s epi on po.id = epi.userecordId where %s;", + UseRecord.class.getSimpleName(),ExpensiveGoodsInstance.class.getSimpleName(),SqlUtils.getNonStringFieldInCollectionsPredicate("epi.id", instanceIds)); + List> byParam = objectDao.findSqlByParam(sql2, new Object[]{}); + for (Map byParamMap : byParam) { + Long instanceId = MapUtils.getLong(byParamMap,"instanceId"); + String patientName = MapUtils.getString(byParamMap, "patientName"); + ExpensiveGoodsInstance egi = IDOperators.find(instancelist,instanceId); + if(egi !=null){ + egi.setPatientName(patientName); + } + } + String[] fp2 = {"registrationCertification","expensiveGoodsBill"}; + String json = gridManager.converJsonString(totalResults, instancelist, sql,fp2); + return json; + } + +///////////////////////////////////////////// + + /** * 一次性物品告警grid * * @param parameterMap Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAction.java =================================================================== diff -u -r23710 -r23729 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAction.java (.../ExpensiveGoodsAction.java) (revision 23710) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAction.java (.../ExpensiveGoodsAction.java) (revision 23729) @@ -5,6 +5,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -16,24 +17,49 @@ import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import net.sf.json.JsonConfig; +import net.sf.json.util.CycleDetectionStrategy; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; +import com.forgon.Constants; import com.forgon.databaseadapter.service.DateQueryAdapter; import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.disinfectsystem.basedatamanager.supplier.service.RegistrationCertificationManager; import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoods; +import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsBill; +import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsBillItem; +import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsGodownEntry; +import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsGodownEntryItem; +import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsInstance; import com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsStock; +import com.forgon.disinfectsystem.entity.basedatamanager.position.TousseOperation; import com.forgon.disinfectsystem.entity.basedatamanager.supplier.ExpensiveGoodsSupplier; import com.forgon.disinfectsystem.entity.basedatamanager.supplier.RegistrationCertification; +import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseInstance; import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse; +import com.forgon.disinfectsystem.entity.becleanitem.ClassifyBasket; import com.forgon.disinfectsystem.entity.expensivegoods.ExpensiveGoodsBatch; import com.forgon.disinfectsystem.entity.expensivegoods.ExpensiveGoodsModel; +import com.forgon.disinfectsystem.entity.invoicemanager.ExpensiveGoodsItem; +import com.forgon.disinfectsystem.entity.invoicemanager.Invoice; +import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; +import com.forgon.disinfectsystem.entity.packing.PackingRecord; +import com.forgon.disinfectsystem.entity.packing.ReviewedBasket; +import com.forgon.disinfectsystem.entity.qualitymonitoringmanager.qualitymonitoring.QualityMonitoringInstance; +import com.forgon.disinfectsystem.entity.recyclingrecord.RecyclingRecord; +import com.forgon.disinfectsystem.entity.sterilizationmanager.sterilizationrecord.SterilizationRecord; +import com.forgon.disinfectsystem.entity.toussetransition.TousseTransitionRecord; +import com.forgon.disinfectsystem.entity.toussetransition.WashTransitionItem; +import com.forgon.disinfectsystem.entity.toussetransition.WashTransitionRecord; +import com.forgon.disinfectsystem.entity.useRecord.UseRecord; +import com.forgon.disinfectsystem.entity.washanddisinfectmanager.washanddisinfectrecord.WashAndDisinfectRecord; +import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsInstanceManager; import com.forgon.disinfectsystem.expensiveGoods.service.ExpensiveGoodsManager; import com.forgon.entity.PageEntity; import com.forgon.log.model.Log; @@ -48,8 +74,10 @@ import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.json.JSONUtil; +import com.forgon.tools.util.ForgonDateUtils; import com.forgon.tools.util.PageUtil; import com.forgon.tools.util.SqlUtils; +import com.forgon.workflow.service.WorkFlowApprovalTaskManager; import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.Preparable; @@ -71,6 +99,10 @@ private WareHouseManager wareHouseManager; + private ExpensiveGoodsInstanceManager expensiveGoodsInstanceManager; + + private WorkFlowApprovalTaskManager workFlowApprovalTaskManager; + // private ExpensiveGoodsStorageRecordManager expensiveGoodsStorageRecordManager; private LogManager appLogManager; @@ -117,10 +149,19 @@ // this.expensiveGoodsStorageRecordManager = expensiveGoodsStorageRecordManager; // } + public void setExpensiveGoodsInstanceManager( + ExpensiveGoodsInstanceManager expensiveGoodsInstanceManager) { + this.expensiveGoodsInstanceManager = expensiveGoodsInstanceManager; + } + public void setObjectDao(ObjectDao objectDao) { this.objectDao = objectDao; } + public void setWorkFlowApprovalTaskManager( + WorkFlowApprovalTaskManager workFlowApprovalTaskManager) { + this.workFlowApprovalTaskManager = workFlowApprovalTaskManager; + } /** @@ -817,6 +858,32 @@ return null; } + /** + * 根据高值耗材名字获取高值耗材的型号定义 + * @return + */ + public void loadExpensiveGoodsModelsByName(){ + String expensiveGoodsName = StrutsParamUtils.getPraramValue("expensiveGoodsName", ""); + String spelling = StrutsParamUtils.getPraramValue("spell", null); + JSONArray data = new JSONArray(); + try { + List expensiveGoodsModelList = expensiveGoodsManager + .getExpensiveGoodsModelByGoodsName(expensiveGoodsName,spelling); + if (CollectionUtils.isNotEmpty(expensiveGoodsModelList)) { + for (ExpensiveGoodsModel expensiveGoodsModel : expensiveGoodsModelList) { + JSONObject expensiveGoodsModelJson = new JSONObject(); + expensiveGoodsModelJson.put("id", expensiveGoodsModel.getId()); + expensiveGoodsModelJson.put("model", expensiveGoodsModel.getModel()); + expensiveGoodsModelJson.put("modelReferencePrice", expensiveGoodsModel.getReferencePrice());//参考价格 + data.add(expensiveGoodsModelJson); + } + } + PageUtil.outPutResult(PageUtil.getPagePara(), data); + } catch (Exception e) { + e.printStackTrace(); + } + } + // 根据名字获取库存 public void getStorageByExpensiveGoodsIds(){ JSONArray storages = new JSONArray(); @@ -1010,4 +1077,127 @@ } + /** + * 根据高值耗材实例id,获取实例部分追溯信息 + */ + public void getExpensiveGoodsInstanceInfoById() { + String id = StrutsParamUtils.getPraramValue("expensiveGoodsInstanceId", ""); + if (DatabaseUtil.isPoIdValid(id)) { + ExpensiveGoodsInstance egi = expensiveGoodsInstanceManager.get(id); + if (egi != null) { + //实例信息 + JSONObject expensiveGoodsInstanceJSON = new JSONObject(); + expensiveGoodsInstanceJSON.put("instance_price",egi.getPrice());//单价 + expensiveGoodsInstanceJSON.put("instance_model",egi.getModel());//型号 + expensiveGoodsInstanceJSON.put("instance_supplierName",egi.getSupplierName());//供应商 + + //申请记录 + JSONObject invoicePlanJSON = new JSONObject(); + InvoicePlan ip = (InvoicePlan) objectDao.getByProperty(InvoicePlan.class.getSimpleName(), "id", egi.getInvoicePlanId()); + if(null!=ip){ + invoicePlanJSON.put("invoicePlan_applicationTime", ip.getApplicationTimeStr()==null?"":ip.getApplicationTimeStr());//申请时间 + invoicePlanJSON.put("invoicePlan_serialNum", ip.getSerialNumber()==null?"": ip.getSerialNumber());//申请单号 + invoicePlanJSON.put("invoicePlan_applicant", ip.getApplicant()==null?"":ip.getApplicant());//申请人 + invoicePlanJSON.put("invoicePlan_type", ip.getType()==null?"":ip.getType());//申请类型 + invoicePlanJSON.put("invoicePlan_depart", ip.getDepart()==null?"":ip.getDepart());//申请科室 + invoicePlanJSON.put("invoicePlan_patient", ip.getPatient()==null?"":ip.getPatient());//病人 + } + + //流程审核记录(该实例绑定的申请单的流程审核记录) + JSONArray taskRecordInfoArrayInfoJSONs = new JSONArray(); + if(null != ip){ + taskRecordInfoArrayInfoJSONs = workFlowApprovalTaskManager.loadWorkFlowApprovalTaskRecordList(ip.getId().toString()); + } + + //入库记录 + JSONObject expensiveGoodsGodownJSON = new JSONObject(); + ExpensiveGoodsGodownEntry godownEntry = (ExpensiveGoodsGodownEntry) objectDao.getByProperty(ExpensiveGoodsGodownEntry.class.getSimpleName(), "id", egi.getGodownEntryId()); + ExpensiveGoodsGodownEntryItem godownEntryItem = (ExpensiveGoodsGodownEntryItem) objectDao.getByProperty(ExpensiveGoodsGodownEntryItem.class.getSimpleName(), "id", egi.getGodownEntryItemId()); + if(null != godownEntry){ + expensiveGoodsGodownJSON.put("inGodown_time", ForgonDateUtils.safelyFormatDate(godownEntry.getTime(), ForgonDateUtils.SIMPLEDATEFORMAT_YYYYMMDDHHMM, ""));//入库时间 + expensiveGoodsGodownJSON.put("inGodown_invoiceSerialNum",godownEntry.getInvoicePlanSerialNumber()); //绑定的申请单号 + expensiveGoodsGodownJSON.put("inGodown_subType", godownEntry.getSubType()); //入库类型 + expensiveGoodsGodownJSON.put("inGodown_operator",godownEntry.getOperator()); //入库员 + expensiveGoodsGodownJSON.put("inGodown_supplierName", godownEntry.getSupplierName()); //供应商 + expensiveGoodsGodownJSON.put("inGodown_warehouseName", godownEntry.getWarehouseName()); //仓库 + if(null != godownEntryItem){ + expensiveGoodsGodownJSON.put("inGodownItem_model", godownEntryItem.getModel()); //型号 + expensiveGoodsGodownJSON.put("inGodownItem_manufacturerName", godownEntryItem.getManufacturerName());//生产厂家 + expensiveGoodsGodownJSON.put("inGodownItem_cost", godownEntryItem.getCost()); //入库单价 + } + } + + //发货记录 + JSONObject invoiceJSON = new JSONObject(); + Invoice invoice = (Invoice) objectDao.getByProperty(Invoice.class.getSimpleName(), "id", egi.getInvoiceId()); + if(null != invoice){ + invoiceJSON.put("invoice_serialNum", invoice.getSerialNumber()); //发货流水号 + invoiceJSON.put("invoice_depart", invoice.getDepart()); //申请科室 + invoiceJSON.put("invoice_settleAccountsDepart", invoice.getSettleAccountsDepart());//结算科室 + invoiceJSON.put("invoice_sendTime", invoice.getSendTime()); //发货时间 + invoiceJSON.put("invoice_sourceWarehouseName", invoice.getSourceWarehouseName());//发货仓库 + } + + //使用记录 + JSONObject useRecordJSON = new JSONObject(); + UseRecord useRecord = egi.getUseRecord(); + if(null != useRecord){ + useRecordJSON.put("hospitalNum",useRecord.getHospitalNum()); //住院号 + useRecordJSON.put("treatmentNum",useRecord.getTreatmentNum()); //诊疗号 + useRecordJSON.put("patientName",useRecord.getPatientName()); //病人姓名 + useRecordJSON.put("patientIDCard",useRecord.getPatientIDCard());//病人身份证 + useRecordJSON.put("enteringDate",useRecord.getEnteringDate()); //录入日期 + useRecordJSON.put("doctorName",useRecord.getDoctorName()); //医生 + useRecordJSON.put("operation",useRecord.getOperation()); //手术名称 + useRecordJSON.put("operator",useRecord.getOperator()); //操作员 + useRecordJSON.put("circuitNurse",useRecord.getCircuitNurse()); //巡回护士 + } + + //发票结算记录 + JSONObject expensiveGoodsBillJSON = new JSONObject(); + ExpensiveGoodsBill egbill = egi.getExpensiveGoodsBill(); + ExpensiveGoodsBillItem egbillitem = (ExpensiveGoodsBillItem) objectDao.getByProperty(ExpensiveGoodsBillItem.class.getSimpleName(), "id", egi.getExpensiveGoodsBillItemId()); + if(null != egbill){ + expensiveGoodsBillJSON.put("bill_settledTime", ForgonDateUtils.safelyFormatDate(egbill.getSettledTime(), ForgonDateUtils.SIMPLEDATEFORMAT_YYYYMMDDHHMM, ""));//开票时间 + expensiveGoodsBillJSON.put("bill_serialNumber",egbill.getSerialNumber()); //发票号 + expensiveGoodsBillJSON.put("bill_supplierName", egbill.getSupplierName()); //供应商 + if(null != egbillitem){ + expensiveGoodsBillJSON.put("billitem_manufacturerName", egbillitem.getManufacturerName()); //生产厂家 + expensiveGoodsBillJSON.put("billitem_price", egbillitem.getPrice()); //结算单价 + } + } + + //退库记录 + JSONObject outGodownEntryJSON = new JSONObject(); + ExpensiveGoodsGodownEntry outGodownEntry = (ExpensiveGoodsGodownEntry) objectDao.getByProperty(ExpensiveGoodsGodownEntry.class.getSimpleName(), "id", egi.getGodownOutEntryId()); + if(null != outGodownEntry){ + outGodownEntryJSON.put("outGodown_time", ForgonDateUtils.safelyFormatDate(outGodownEntry.getTime(), ForgonDateUtils.SIMPLEDATEFORMAT_YYYYMMDDHHMM, ""));//退库时间 + outGodownEntryJSON.put("outGodown_operator",outGodownEntry.getOperator()); //操作员 + outGodownEntryJSON.put("outGodown_serialNumber",outGodownEntry.getSerialNumber());//退库单号 + } + + + Map map = new HashMap(); + map.put("success", true); + map.put("expensiveGoodsInstanceJSON", expensiveGoodsInstanceJSON); //实例信息 + map.put("invoicePlanJSON", invoicePlanJSON); //申请单记录 + map.put("taskRecordInfoArrayInfoJSONs", taskRecordInfoArrayInfoJSONs);//流程审核记录 + map.put("expensiveGoodsGodownJSON", expensiveGoodsGodownJSON); //入库记录 + map.put("invoiceJSON", invoiceJSON); //发货记录 + map.put("useRecord", useRecordJSON); //使用记录 + map.put("expensiveGoodsBillJSON", expensiveGoodsBillJSON); //发票结算记录 + map.put("outGodownEntryJSON", outGodownEntryJSON); //退库记录 + + + JsonConfig config = new JsonConfig(); + String[] filterProperties = {}; +// config.setExcludes(TousseInstance.filterProperties); + config.setExcludes(filterProperties); + config.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); + JSONObject jsonObject = JSONObject.fromObject(map, config); + StrutsResponseUtils.output(jsonObject); + } + } + } + } Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r23696 -r23729 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 23696) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 23729) @@ -338,7 +338,7 @@ children:[ {hidden :SSTS_ExpensiveGoodsDefinition_Hidden_Manager,text:"高值耗材定义管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoodsImport_Hidden_Menu,text:"导入高值耗材",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/importExpensiveGoods.mhtml',hrefTarget:linkTarget,leaf:true}, - {hidden :SSTS_ViewExpensiveGoodsInstance_Hidden_Menu,text:"高值耗材实例列表",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstanceView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :SSTS_ViewExpensiveGoodsInstance_Hidden_Menu,text:"高值耗材实例列表",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoodsStockEntry_Hidden_Manager,text:"高值耗材库存",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsStockView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoods_Hidden_Menu,text:"高值耗材申请单",href:WWWROOT+'/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationView.jsp',hrefTarget:linkTarget,leaf:true}, //{hidden :SSTS_ExpensiveGoods_Hidden_Menu,text:"高值耗材出入库记录",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.jsp',hrefTarget:linkTarget,leaf:true}, Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManager.java =================================================================== diff -u -r23710 -r23729 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManager.java (.../ExpensiveGoodsManager.java) (revision 23710) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManager.java (.../ExpensiveGoodsManager.java) (revision 23729) @@ -292,6 +292,13 @@ * @return */ List getExpensiveGoodsModel(String expensiveGoodsId,String spell); + + /** + * 根据高值耗材物品定义的名字获取型号定义集合 + * @param expensiveGoodsName + * @return + */ + public List getExpensiveGoodsModelByGoodsName(String expensiveGoodsName,String spell); /** * 根据型号,高值耗材物品定义的id,获取高值耗材物品型号定义 Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java =================================================================== diff -u -r23710 -r23729 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 23710) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 23729) @@ -2775,6 +2775,19 @@ } @Override + public List getExpensiveGoodsModelByGoodsName(String expensiveGoodsName, String spell) { + if(StringUtils.isNotBlank(expensiveGoodsName)){ + String hql = String.format("select po from %s po where po.expensiveGoods.name = '%s' and po.model is not null", + ExpensiveGoodsModel.class.getSimpleName(),expensiveGoodsName); + if(!StringTools.isBlank(spell)){ + hql += " and po.model like '%" + spell + "%'"; + } + return objectDao.findByHql(hql); + } + return null; + } + + @Override public JSONObject loadExpensiveGoods(String id) { ExpensiveGoods expensiveGoods = null; if (DatabaseUtil.isPoIdValid(id)) { Index: ssts-web/src/main/webapp/homepage/portalPage.js =================================================================== diff -u -r23679 -r23729 --- ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 23679) +++ ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 23729) @@ -789,7 +789,7 @@ //高值耗材的几个图标不显示 if(itemId == 'expensiveGoodsApplication' || itemId == 'expensiveGodownEntryPurchase' || itemId == 'expensiveGodownEntryPrepareIn' || itemId == 'expensiveInvoicePlan' || itemId == 'expensiveInvoice' || itemId == 'expensiveBill' - || itemId == 'expensiveStockTake' || itemId == 'myUnFinishedTask' || itemId == 'myFinishedTask' || itemId == 'expensiveEnterpriseView'){ + || itemId == 'expensiveStockTake' || itemId == 'myUnFinishedTask' || itemId == 'myFinishedTask' || itemId == 'expensiveGoodsInstanceView'|| itemId == 'expensiveEnterpriseView'){ return returnContent; } Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ExpensiveGoodsInstance.java =================================================================== diff -u -r23492 -r23729 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ExpensiveGoodsInstance.java (.../ExpensiveGoodsInstance.java) (revision 23492) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ExpensiveGoodsInstance.java (.../ExpensiveGoodsInstance.java) (revision 23729) @@ -8,6 +8,8 @@ import javax.persistence.Entity; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; @@ -124,9 +126,15 @@ private Date expDate; /** + * 高值耗材发票(多对一) + */ + private ExpensiveGoodsBill expensiveGoodsBill; + + /** * 高值耗材发票单id */ - private Long expensiveGoodsBillId; +// private Long expensiveGoodsBillId; + /** * 高值耗材发票明细id */ @@ -186,6 +194,46 @@ public static final String STATUS_SETTLED = "已结算"; public static final String STATUS_NOSETTLED = "未结算"; + /** + * 绑定的申请单申请时间(只用于显示,不保存在数据库) + */ + private String applicationTimeStr; + + /** + * 使用病人姓名(只用于显示,不保存在数据库) + */ + private String patientName; + +// @Transient +// public Long getExpensiveGoodsBillId() { +// if(expensiveGoodsBill != null){ +// return expensiveGoodsBill.getId(); +// } +// return expensiveGoodsBillId; +// } +// +// public void setExpensiveGoodsBillId(Long expensiveGoodsBillId) { +// this.expensiveGoodsBillId = expensiveGoodsBillId; +// } + + @Transient + public String getApplicationTimeStr() { + return applicationTimeStr; + } + + public void setApplicationTimeStr(String applicationTimeStr) { + this.applicationTimeStr = applicationTimeStr; + } + + @Transient + public String getPatientName() { + return patientName; + } + + public void setPatientName(String patientName) { + this.patientName = patientName; + } + public String getModel() { return model; } @@ -250,14 +298,6 @@ this.expensiveGoodsBillItemId = expensiveGoodsBillItemId; } - public Long getExpensiveGoodsBillId() { - return expensiveGoodsBillId; - } - - public void setExpensiveGoodsBillId(Long expensiveGoodsBillId) { - this.expensiveGoodsBillId = expensiveGoodsBillId; - } - public ExpensiveGoodsInstance() { super(); setType(BarcodeDevice.BARCODE_TYPE_EXPENSIVEGOODS); @@ -305,7 +345,17 @@ public void setExpensiveGoods(ExpensiveGoods expensiveGoods) { this.expensiveGoods = expensiveGoods; } + + @ManyToOne(cascade = CascadeType.REFRESH) + @JoinColumn(name = "expensiveGoodsBillId", referencedColumnName = "id") + public ExpensiveGoodsBill getExpensiveGoodsBill() { + return expensiveGoodsBill; + } + public void setExpensiveGoodsBill(ExpensiveGoodsBill expensiveGoodsBill) { + this.expensiveGoodsBill = expensiveGoodsBill; + } + public String getConclusion() { return conclusion; } Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.js (revision 23729) @@ -0,0 +1,1009 @@ +var grid; +var root; +var formObj; +var formWindow; +var autoFillExternalCodeOfDisposableGoods = false; +var currentSelectedTousseName; //物品名称选择下拉框的当前所选中的值 +var currentSelectedModelName; //类型名称选择下拉框的当前所选中的值 +var barcodes = ''; +var BatchRecord = null; +var selCertification = null; + +var departmentComboBoxStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + },[ + {name : 'id',mapping : 'id'}, + {name : 'departCode',mapping : 'departCode'}, + {name : 'name',mapping : 'name'} + ] + ) +}); + +var modelStore = new top.Ext.data.Store({ + proxy : new top.Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!loadExpensiveGoodsModelsByName.do', + method : 'POST' + }), + + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'model'} + ]), + listeners: { + beforeload: function(thiz){ + var expensiveGoodsName = Ext.getCmp('expensiveGoodName').getRawValue(); +// console.log(expensiveGoodsName); + thiz.baseParams.expensiveGoodsName = null; + if(!isUndefinedOrNullOrEmpty(expensiveGoodsName)){ + thiz.baseParams.expensiveGoodsName = expensiveGoodsName; + } + } + } +}); + +function onAllChoosedOrNot(combo, record,index,nameOfFiled){ + var choose = record.get(combo.checkField); + var fristRecord = combo.store.getAt(0); + if(index != 0){ + if(!choose) { + fristRecord.set(combo.checkField, false); + combo.setValue(combo.getCheckedValue()); + }else{ + var isAllChoosed = true; + combo.store.each(function (thisRecord) + { + if(thisRecord.get(nameOfFiled) != (STR_ALL) && !thisRecord.get(combo.checkField)){ + isAllChoosed = false; + } + }); + if(isAllChoosed){ + fristRecord.set(combo.checkField, true); + combo.setValue(combo.getCheckedValue()); + } + } + return; + } + if(choose){ + combo.selectAll(); + }else{ + combo.deselectAll(); + } +} + +function initQueryValueAndReload() { + var barcode = $Id('barcodeSearch').value; //条码字符串 + //var barcodeReg = /(\d){9}/; + //if (barcode.length == 9 && barcodeReg.test(barcode)) { //条码字符串为9数字,扫描码才有意义,否则清空 + if (barcode) { //条码字符串为9数字,扫描码才有意义,否则清空 + if (repeatScanLabel == $Id('scanPattern').value) { //启用多次扫描模式 + if (barcodes) { + barcodes += ';' + barcode ; + } else { //启用多次扫描模式的第一次扫描 + barcodes = barcode; + } + } else { + barcodes = ''; + } + } else { + barcode = ''; + barcodes = ''; + } + + $Id('parm_s_barcodeSearch').value = barcode; //条码 + //$Id('parm_s_barcodes').value = (barcodes.length == 9 ? '' : barcodes); //barcodes长度为9说明用户启用多次扫描模式,并且是第一次扫描 + $Id('parm_s_barcodes').value = (barcodes); //多次扫描模式下的条码 + if(preciseQuery == Ext.getCmp('queryMode').getRawValue()){ //物品名称(根据查询模式设置不同) + $Id('parm_s_expensiveGoodName').value = Ext.getCmp('expensiveGoodName').getRawValue(); + $Id('parm_s_expensiveGoodNameFuzzy').value = ''; + }else{ + $Id('parm_s_expensiveGoodNameFuzzy').value = Ext.getCmp('expensiveGoodName').getRawValue(); + $Id('parm_s_expensiveGoodName').value = ''; + } + if(preciseQuery == Ext.getCmp('queryMode').getRawValue()){ //物品型号(根据查询模式设置不同) + $Id('parm_s_modelName').value = $Id('modelName').value; + $Id('parm_s_modelNameFuzzy').value = ''; + }else{ + $Id('parm_s_modelNameFuzzy').value = Ext.getCmp('modelName').getRawValue(); + $Id('parm_s_modelName').value = ''; + } + + $Id('parm_s_department').value = Ext.getCmp('department').getRawValue(); //科室编号 + $Id('parm_s_instanceStatus').value = $Id('instanceStatus').value; //实例状态 + $Id('parm_s_instanceSettledStatus').value = $Id('instanceSettledStatus').value; //结算状态 + $Id('parm_s_instanceCheckStatus').value = $Id('instanceCheckStatus').value; //验收状态 + $Id('parm_s_expensiveGoodsGodownType').value = $Id('expensiveGoodsGodownType').value; //入库类型 + + $Id('parm_s_godownStartTime').value = $Id('godownStartTime').value; //入库开始时间 + $Id('parm_s_godownEndTime').value = $Id('godownEndTime').value; //入库结束时间 + $Id('parm_s_useRecordStratTime').value = $Id('useRecordStratTime').value; //使用开始时间 + $Id('parm_s_useRecordEndTime').value = $Id('useRecordEndTime').value; //使用结束时间 + $Id('parm_s_billStatrTime').value = $Id('billStatrTime').value; //结算开始时间 + $Id('parm_s_billEndTime').value = $Id('billEndTime').value; //结算结束时间 + + Ext.getCmp('barcodeSearch').setValue(''); + grid.getStore().lastOptions.params['start'] = 0; + grid.dwrReload(); +} + +/** + * 显示追溯窗口 + */ +function renderCallExpensiveInstanceInfoShowFun(v, p, record){ + var instanceId = record.data['id']; + var goodsName = record.data['expensiveGoods.name']; + return "" + goodsName + ""; +} + +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 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 printExpensiveDisposableGoodsBarcode(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("orginalName").setValue(expensiveGoods.name); + top.Ext.getCmp("orginalSpecification").setValue(expensiveGoods.specification); + top.Ext.getCmp("registrationCertification").setValue(expensiveGoods.registrationCertification); + }, + 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(); + + //********* 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 : 100,dataIndex : 'barcode'}, + {/*id : 'expensiveGoodsName',*/header : "名称",width : 200,dataIndex : 'expensiveGoods.name',renderer : renderCallExpensiveInstanceInfoShowFun}, + {header : "型号",width : 100,dataIndex : 'model'}, + {header : "入库日期",width : 150,dataIndex : 'entryDate',renderer : myDateFormat}, + {header : "失效日期",width : 150,dataIndex : 'expDate',renderer : myDateFormat}, + {header : "入库类型",width : 80,dataIndex : 'entryType'}, + {header : "打印时间",width : 80,dataIndex : 'printTime'}, + {header : "单价",width : 80,dataIndex : 'price'}, + {header : "状态",width : 80,dataIndex : 'status'}, + {header : "验收状态",width : 80,dataIndex : 'checkStatus'}, + {header : "结算状态",width : 80,dataIndex : 'settledStatus'}, + {header : "科室",width : 80,dataIndex : 'locationForDisplay'}, + {header : "仓库",width : 120,dataIndex : 'warehouseName'}, + {header : "申请时间",width : 125,dataIndex : 'applicationTimeStr',sortable: false,menuDisabled : true}, + {header : "使用病人",width : 60,dataIndex : 'patientName',sortable: false,menuDisabled : true}, + {header : "自带条码1",width : 120,dataIndex : 'firstBodyCode'}, + {header : "自带条码2",width : 120,dataIndex : 'secondBodyCode'}, + {header : "自带条码3",width : 120,dataIndex : 'thirdBodyCode'} +// {header : "类别",width : 80,dataIndex : 'expensiveGoods.grade'}, +// {header : "包装规格",width : 80,dataIndex : 'expensiveGoods.packageSpec'}, +// {header : "参考价",width : 60,dataIndex : 'expensiveGoods.referencePrice'} +// {header : "单位",width : 50,dataIndex : 'expensiveGoods.unit'}, +// {header : "顺序号",width : 50,dataIndex : 'expensiveGoods.sequence'} +// {header : "拼音码",width : 90,dataIndex : 'expensiveGoods.spelling'}, +// {header : "五笔码",width : 90,dataIndex : 'expensiveGoods.wbCode'} + + ]; + + var readerDetail = [ + {name : 'id'}, + {name : 'barcode'}, + {name : 'expensiveGoods.externalCode'}, + {name : 'expensiveGoods.name'}, + {name : 'model'}, + {name : 'entryDate'}, + {name : 'expDate'}, + {name : 'entryType'}, + {name : 'printTime'}, + {name : 'price'}, + {name : 'status'}, + {name : 'checkStatus'}, + {name : 'settledStatus'}, + {name : 'locationForDisplay'}, + {name : 'warehouseName'}, + {name : 'firstBodyCode'}, + {name : 'secondBodyCode'}, + {name : 'thirdBodyCode'}, + {name : 'applicationTimeStr'}, + {name : 'patientName'}, + {name : 'expensiveGoods.grade'}, + {name : 'expensiveGoods.packageSpec'}, + {name : 'expensiveGoods.referencePrice'}, + {name : 'expensiveGoods.unit'}, + {name : 'expensiveGoods.sequence'}, + {name : 'expensiveGoods.spelling'}, + {name : 'expensiveGoods.wbCode'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters:[ + {type: 'string', dataIndex: 'barcode'}, + {type: 'string', dataIndex: 'expensiveGoods.name'}, + {type: 'string', dataIndex: 'model'}, + {type: 'string', dataIndex: 'entryType'}, + {type: 'numeric', dataIndex: 'price'}, + {type: 'string', dataIndex: 'status'}, + {type: 'string', dataIndex: 'settledStatus'}, + {type: 'string', dataIndex: 'locationForDisplay'}, + {type: 'string', dataIndex: 'firstBodyCode'}, + {type: 'string', dataIndex: 'secondBodyCode'}, + {type: 'string', dataIndex: 'thirdBodyCode'}, + {type: 'string', dataIndex: 'checkStatus'} + ]} + ); + + //**************查询过滤条件***************// + var dt = new Date(); + var v = dt.getMonth()+1; + if(v<10){ + v = "0" + v; + } + var labelWidth =( fontSize == 12 ? 86 : 101); + var datefieldWithMinWidth = ( fontSize == 12 ? 129 : 154); + + row1Array = [{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : { + xtype : 'combo', + id : 'scanPattern', + name : 'scanPattern', + valueField : 'scanPatternValue', + displayField : 'scanPatternValue', + anchor : '100%', + fieldLabel : '扫描模式', + mode : 'local', + readOnly : true, + value : singleScanLabel, + triggerAction : 'all', + forceSelection : true, + store : new Ext.data.SimpleStore({ + fields : ['scanPatternValue'], + data : [[singleScanLabel],[repeatScanLabel]] + }) + } + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : { + xtype : 'textfield', + fieldLabel : '条码', + name : 'barcodeSearch', + id : 'barcodeSearch', + anchor : '100%', + listeners : { + specialkey : function(field, ee) { + if (ee.getKey() == Ext.EventObject.ENTER) { +// initQueryValueAndReload(); + } + } + } + } + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + xtype : 'combo', + id : 'expensiveGoodName', + name : 'expensiveGoodName', + fieldLabel : '物品名称', + queryParam : 'spell', + minChars : 0, + valueField : 'name', + displayField : 'name', + listWidth : 450, + store : new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!searchExpensiveGoods.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'} + ] + ) + }), + forceSelection : false, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + anchor : '100%', + listeners : { + select : function(combo, record, index) { + combo.setValue(record.data.name); + //存储当前所选中的值 + currentSelectedTousseName = record.data.name; + }, + blur : function(){ + modelStore.load(); + } + } + }] + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + xtype : 'combo', + id : 'modelName', + name : 'modelName', + fieldLabel : '型号', + queryParam : 'spell', + minChars : 0, + valueField : 'name', + displayField : 'name', + listWidth:300, + store : modelStore, + forceSelection : false, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + anchor : '100%', + listeners : { + select : function(combo, record, index) { + combo.setValue(record.data.name); + //存储当前所选中的值 + currentSelectedModelName = record.data.name; + } + } + }] + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth+20, + labelAlign:"right", + items : [{ + xtype : 'combo', + id : 'queryMode', + name : 'queryMode', + valueField : 'queryMode', + displayField : 'queryMode', + anchor : '100%', + fieldLabel : '查询模式', + mode : 'local', + readOnly : true, + value : preciseQuery, + triggerAction : 'all', + forceSelection : true, + store : new Ext.data.SimpleStore({ + fields : ['queryMode'], + data : [[preciseQuery],[fuzzyQuery]] + }) + }] + }]; + + row2Array = [{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign: "right", + items : [{ + xtype : 'combo', + fieldLabel : '科室', + id : 'department', + name : 'department', + valueField : 'departCode', + displayField : 'name', + store : departmentComboBoxStore, + triggerAction : 'all', + mode : 'remote', + forceSelection : true, + allowBlank : true, + editable : true, + queryParam : 'spell', + minChars : 0, + listWidth : 180, + hideTrigger : true, + anchor : '100%' + }] + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign: "right", + items : [{ + xtype : 'multiSelect', + triggerAction : 'all', + fieldLabel : '实例状态', + id : 'instanceStatus', + name : 'instanceStatus', + valueField : 'instanceStatus', + displayField : 'instanceStatus', + listeners : { + select : function(combo, record, index){ + onAllChoosedOrNot(combo, record,index,'instanceStatus'); + } + }, + store : new Ext.data.SimpleStore({ + fields : ['instanceStatus'], + data : [ + [STR_ALL], + [STATUS_IN_WAREHOUSE],[STATUS_OUT_WAREHOUSE],[STATUS_PRE_IN_WAREHOUSE],[STATUS_PRE_OUT_WAREHOUSE], + [STATUS_DELIVERED],[STATUS_RECEIVED],[STATUS_USED] + ] + }), + mode : 'local', + forceSelection : false, + allowBlank : true, + editable : false, + anchor : '100%' + }] + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign: "right", + items : [{ + xtype : 'multiSelect', + triggerAction : 'all', + fieldLabel : '验收状态', + id : 'instanceCheckStatus', + name : 'instanceCheckStatus', + valueField : 'instanceCheckStatus', + displayField : 'instanceCheckStatus', + listeners : { + select : function(combo, record, index){ + onAllChoosedOrNot(combo, record,index,'instanceCheckStatus'); + } + }, + store : new Ext.data.SimpleStore({ + fields : ['instanceCheckStatus'], + data : [[STR_ALL], + [CHECK_STATUS_NOCHECK],[CHECK_STATUS_PREPARECHECK],[CHECK_STATUS_CHECKED] + ] + }), + mode : 'local', + forceSelection : false, + allowBlank : true, + editable : false, + anchor : '100%' + }] + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign: "right", + items : [{ + xtype : 'multiSelect', + triggerAction : 'all', + fieldLabel : '结算状态', + id : 'instanceSettledStatus', + name : 'instanceSettledStatus', + valueField : 'instanceSettledStatus', + displayField : 'instanceSettledStatus', + listeners : { + select : function(combo, record, index){ + onAllChoosedOrNot(combo, record,index,'instanceSettledStatus'); + } + }, + store : new Ext.data.SimpleStore({ + fields : ['instanceSettledStatus'], + data : [[STR_ALL], + [STATUS_SETTLED],[STATUS_NOSETTLED] + ] + }), + mode : 'local', + forceSelection : false, + allowBlank : true, + editable : false, + anchor : '100%' + }] + },{ + columnWidth : .2, + layout : 'form', + labelWidth : labelWidth, + labelAlign: "right", + items : [{ + xtype : 'multiSelect', + triggerAction : 'all', + fieldLabel : '入库类型', + id : 'expensiveGoodsGodownType', + name : 'expensiveGoodsGodownType', + valueField : 'expensiveGoodsGodownType', + displayField : 'expensiveGoodsGodownType', + listeners : { + select : function(combo, record, index){ + onAllChoosedOrNot(combo, record,index,'expensiveGoodsGodownType'); + } + }, + store : new Ext.data.SimpleStore({ + fields : ['expensiveGoodsGodownType'], + data : [[STR_ALL], + [ENTRY_TYPE_PURCHASE],[ENTRY_TYPE_PREPARE],[ENTRY_TYPE_STOCKTAKEIN] + ] + }), + mode : 'local', + forceSelection : false, + allowBlank : true, + editable : false, + anchor : '100%' + }] + }]; + + row3Array = [{ + columnWidth : .15, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '入库开始时间', + name : 'godownStartTime', + id : 'godownStartTime', + width : datefieldWithMinWidth, +// altFormats:'Y-m-d H:i|Y-n-j H:i|y-n-j H:i|y-m-j H:i|y-m-d H:i|y-n-d H:i|Y-n-d H:i|Y-m-j H:i|Ymd H:i|Ynj H:i|ynj H:i|ymj H:i|ymd H:i|ynd H:i|Ynd H:i|Ymj H:i|Y/m/d H:i|Y/n/j H:i|y/n/j H:i|y/m/j H:i|y/m/d H:i|y/n/d H:i|Y/n/d H:i|Y/m/j|Y-m-d G:i|Y-n-j G:i|y-n-j G:i|y-m-j G:i|y-m-d G:i|y-n-d G:i|Y-n-d G:i|Y-m-j G:i|Ymd G:i|Ynj G:i|ynj G:i|ymj G:i|ymd G:i|ynd G:i|Ynd G:i|Ymj G:i|Y/m/d G:i|Y/n/j G:i|y/n/j G:i|y/m/j G:i|y/m/d G:i|y/n/d G:i|Y/n/d G:i|Y/m/j|G:i|H:i', +// selectOnFocus :true, + readOnly : true, + theHours : 0, + theMinutes : 0, + format : 'Y-m-d H:i' + }] + },{ + columnWidth : .15, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '入库结束时间', + name : 'godownEndTime', + id : 'godownEndTime', + width : datefieldWithMinWidth, +// altFormats:'Y-m-d H:i|Y-n-j H:i|y-n-j H:i|y-m-j H:i|y-m-d H:i|y-n-d H:i|Y-n-d H:i|Y-m-j H:i|Ymd H:i|Ynj H:i|ynj H:i|ymj H:i|ymd H:i|ynd H:i|Ynd H:i|Ymj H:i|Y/m/d H:i|Y/n/j H:i|y/n/j H:i|y/m/j H:i|y/m/d H:i|y/n/d H:i|Y/n/d H:i|Y/m/j|Y-m-d G:i|Y-n-j G:i|y-n-j G:i|y-m-j G:i|y-m-d G:i|y-n-d G:i|Y-n-d G:i|Y-m-j G:i|Ymd G:i|Ynj G:i|ynj G:i|ymj G:i|ymd G:i|ynd G:i|Ynd G:i|Ymj G:i|Y/m/d G:i|Y/n/j G:i|y/n/j G:i|y/m/j G:i|y/m/d G:i|y/n/d G:i|Y/n/d G:i|Y/m/j|G:i|H:i', +// selectOnFocus :true, + readOnly : true, + theHours : 0, + theMinutes : 0, + format : 'Y-m-d H:i' + }] + },{ + columnWidth : .15, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '使用开始时间', + name : 'useRecordStratTime', + id : 'useRecordStratTime', + width : datefieldWithMinWidth, + // altFormats:'Y-m-d H:i|Y-n-j H:i|y-n-j H:i|y-m-j H:i|y-m-d H:i|y-n-d H:i|Y-n-d H:i|Y-m-j H:i|Ymd H:i|Ynj H:i|ynj H:i|ymj H:i|ymd H:i|ynd H:i|Ynd H:i|Ymj H:i|Y/m/d H:i|Y/n/j H:i|y/n/j H:i|y/m/j H:i|y/m/d H:i|y/n/d H:i|Y/n/d H:i|Y/m/j|Y-m-d G:i|Y-n-j G:i|y-n-j G:i|y-m-j G:i|y-m-d G:i|y-n-d G:i|Y-n-d G:i|Y-m-j G:i|Ymd G:i|Ynj G:i|ynj G:i|ymj G:i|ymd G:i|ynd G:i|Ynd G:i|Ymj G:i|Y/m/d G:i|Y/n/j G:i|y/n/j G:i|y/m/j G:i|y/m/d G:i|y/n/d G:i|Y/n/d G:i|Y/m/j|G:i|H:i', + // selectOnFocus :true, + readOnly : true, + theHours : 23, + theMinutes : 59, + format : 'Y-m-d H:i' + }] + },{ + columnWidth : .15, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '使用结束时间', + name : 'useRecordEndTime', + id : 'useRecordEndTime', + width : datefieldWithMinWidth, + // altFormats:'Y-m-d H:i|Y-n-j H:i|y-n-j H:i|y-m-j H:i|y-m-d H:i|y-n-d H:i|Y-n-d H:i|Y-m-j H:i|Ymd H:i|Ynj H:i|ynj H:i|ymj H:i|ymd H:i|ynd H:i|Ynd H:i|Ymj H:i|Y/m/d H:i|Y/n/j H:i|y/n/j H:i|y/m/j H:i|y/m/d H:i|y/n/d H:i|Y/n/d H:i|Y/m/j|Y-m-d G:i|Y-n-j G:i|y-n-j G:i|y-m-j G:i|y-m-d G:i|y-n-d G:i|Y-n-d G:i|Y-m-j G:i|Ymd G:i|Ynj G:i|ynj G:i|ymj G:i|ymd G:i|ynd G:i|Ynd G:i|Ymj G:i|Y/m/d G:i|Y/n/j G:i|y/n/j G:i|y/m/j G:i|y/m/d G:i|y/n/d G:i|Y/n/d G:i|Y/m/j|G:i|H:i', + // selectOnFocus :true, + readOnly : true, + theHours : 0, + theMinutes : 0, + format : 'Y-m-d H:i' + }] + },{ + columnWidth : .15, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + fieldLabel : '结算开始时间', + name : 'billStatrTime', + id : 'billStatrTime', + xtype : 'datefieldWithMin', + width : datefieldWithMinWidth, + // altFormats:'Y-m-d H:i|Y-n-j H:i|y-n-j H:i|y-m-j H:i|y-m-d H:i|y-n-d H:i|Y-n-d H:i|Y-m-j H:i|Ymd H:i|Ynj H:i|ynj H:i|ymj H:i|ymd H:i|ynd H:i|Ynd H:i|Ymj H:i|Y/m/d H:i|Y/n/j H:i|y/n/j H:i|y/m/j H:i|y/m/d H:i|y/n/d H:i|Y/n/d H:i|Y/m/j|Y-m-d G:i|Y-n-j G:i|y-n-j G:i|y-m-j G:i|y-m-d G:i|y-n-d G:i|Y-n-d G:i|Y-m-j G:i|Ymd G:i|Ynj G:i|ynj G:i|ymj G:i|ymd G:i|ynd G:i|Ynd G:i|Ymj G:i|Y/m/d G:i|Y/n/j G:i|y/n/j G:i|y/m/j G:i|y/m/d G:i|y/n/d G:i|Y/n/d G:i|Y/m/j|G:i|H:i', + // selectOnFocus :true, + readOnly : true, + theHours : 23, + theMinutes : 59, + format : 'Y-m-d H:i' + }] + },{ + columnWidth : .15, + layout : 'form', + labelWidth : labelWidth, + labelAlign:"right", + items : [{ + fieldLabel : '结算结束时间', + name : 'billEndTime', + id : 'billEndTime', + xtype : 'datefieldWithMin', + width : datefieldWithMinWidth, +// altFormats:'Y-m-d H:i|Y-n-j H:i|y-n-j H:i|y-m-j H:i|y-m-d H:i|y-n-d H:i|Y-n-d H:i|Y-m-j H:i|Ymd H:i|Ynj H:i|ynj H:i|ymj H:i|ymd H:i|ynd H:i|Ynd H:i|Ymj H:i|Y/m/d H:i|Y/n/j H:i|y/n/j H:i|y/m/j H:i|y/m/d H:i|y/n/d H:i|Y/n/d H:i|Y/m/j|Y-m-d G:i|Y-n-j G:i|y-n-j G:i|y-m-j G:i|y-m-d G:i|y-n-d G:i|Y-n-d G:i|Y-m-j G:i|Ymd G:i|Ynj G:i|ynj G:i|ymj G:i|ymd G:i|ynd G:i|Ynd G:i|Ymj G:i|Y/m/d G:i|Y/n/j G:i|y/n/j G:i|y/m/j G:i|y/m/d G:i|y/n/d G:i|Y/n/d G:i|Y/m/j|G:i|H:i', +// selectOnFocus :true, + readOnly : true, + theHours : 23, + theMinutes : 59, + format : 'Y-m-d H:i' + }] + }]; + + /**********查询*****************/ + var form1 = new Ext.Panel({ + title : '高值耗材实例查询条件', + layout : 'table', + frame : true, + buttonAlign : 'center', + region : 'north', + height : 150, + items : { + layout : 'column', + width: 1500, + items : [{ + columnWidth : 1, + xtype : 'fieldset', + layout : 'column', + frame : false, + border : false, + items : row1Array.concat(row2Array).concat(row3Array) + }] + }, + buttons : [{ + xtype : 'button', + text : '重置', + minWidth : 70, + iconCls : 'icon_set', + handler : function() { + //查询条件全部重置 + $Id('scanPattern').value = singleScanLabel; //扫描模式 + $Id('barcodeSearch').value = ""; //条码 + $Id('queryMode').value = preciseQuery; //查询模式 + Ext.getCmp('expensiveGoodName').clearValue(); //物品名称 + $Id('modelName').value = ""; //型号名称 + modelStore.load(); + + $Id('department').value = ""; //科室显示值 + Ext.getCmp('department').setValue(""); //科室后台值 + $Id('instanceStatus').value=""; //实例状态 + Ext.getCmp('instanceStatus').deselectAll(); + $Id('instanceSettledStatus').value = ""; //结算状态 + Ext.getCmp('instanceStatus').deselectAll(); + $Id('instanceCheckStatus').value = ""; //验收状态 + Ext.getCmp('instanceCheckStatus').deselectAll(); + $Id('expensiveGoodsGodownType').value = ""; //入库类型 + Ext.getCmp('expensiveGoodsGodownType').deselectAll(); + + $Id('godownStartTime').value= ""; //入库开始时间 + $Id('godownEndTime').value= ""; //入库结束时间 + $Id('useRecordStratTime').value= ""; //使用开始时间 + $Id('useRecordEndTime').value= ""; //使用结束时间 + $Id('billStatrTime').value= ""; //结算开始时间 + $Id('billEndTime').value= ""; //结算结束时间 + + barcodes = ''; + } + },{ + xtype : 'button', + text : '查询', + minWidth : 70, + iconCls : 'icon_search', + handler : function() { + initQueryValueAndReload(); + } + }] + }); + + + /*var tbar = [ '-',{ + text : '出入库记录', + hidden: true, + iconCls : 'btn_ext_refresh', + handler : function(){ + onStorageRecordDetail(grid); + } + }, '-' , { + text : '打印高值耗材', + hidden: true, + 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 : 'barcode', + title : '高值耗材实例列表', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : false, + plugins: filters, + columns : columns, +// autoExpandColumn : 'expensiveGoodsName', + renderTo : 'gridDiv', + frame : false + }, readerDetail, + ExpensiveGoodsTableManager.findExpensiveGoodsInstanceTableList2, + 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(); + } + }) + ] + },form1,{ + 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-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsBillManagerImpl.java =================================================================== diff -u -r23587 -r23729 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsBillManagerImpl.java (.../ExpensiveGoodsBillManagerImpl.java) (revision 23587) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsBillManagerImpl.java (.../ExpensiveGoodsBillManagerImpl.java) (revision 23729) @@ -13,6 +13,8 @@ import java.util.Map.Entry; import java.util.stream.Collectors; +import javax.annotation.Resource; + import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -33,6 +35,8 @@ import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; import com.forgon.disinfectsystem.vo.PrintExpensiveGoodsBillitmeVO; import com.forgon.entity.ExtJsEntity; +import com.forgon.serialnumber.model.SerialNum; +import com.forgon.serialnumber.service.SerialNumManager; import com.forgon.tools.MathTools; import com.forgon.tools.date.DateTools; import com.forgon.tools.db.DatabaseUtil; @@ -64,6 +68,9 @@ private ExpensiveGoodsInstanceManager expensiveGoodsInstanceManager; + @Resource + private SerialNumManager serialNumManager; + public void setExpensiveGoodsInstanceManager( ExpensiveGoodsInstanceManager expensiveGoodsInstanceManager) { this.expensiveGoodsInstanceManager = expensiveGoodsInstanceManager; @@ -325,22 +332,52 @@ */ @Override public void saveExpensiveGoodsBill(ExpensiveGoodsBill expensiveGoodsBill,boolean committedStatus,Map result) { - if(CollectionUtils.isNotEmpty( expensiveGoodsBill.getItems())){ + if(CollectionUtils.isNotEmpty(expensiveGoodsBill.getItems())){ //检查发票号是否唯一 checkSerialNumber(expensiveGoodsBill.getSerialNumber()); if(committedStatus){ //若提交 保存并结算发票 saveAndBillExpensiveGoodsBill(expensiveGoodsBill,result); }else{ //若暂存 暂存发票 - saveOrUpdate(expensiveGoodsBill); + saveBill(expensiveGoodsBill); +// saveOrUpdate(expensiveGoodsBill); } }else{ throw new IllegalArgumentException("发票明细不能为空!"); } } /** + * 发票单号是否唯一 + * @param serialNumber + */ + private void checkSerialNumber(String serialNumber){ + if(StringUtils.isEmpty(serialNumber)){ + throw new IllegalArgumentException("发票单号不能为空!"); + }else{ + List expensiveGoodsBill = this.getByProperty("serialNumber", serialNumber); + if(CollectionUtils.isNotEmpty(expensiveGoodsBill)){ + throw new IllegalArgumentException("已有发票单号为:"+serialNumber+"的发票!"); + } + } + } + + /** + * 保存发票对象 + * @param ExpensiveGoodsBill Bill + */ + private void saveBill(ExpensiveGoodsBill Bill){ + //发票流水号 + if(StringUtils.isBlank(Bill.getSerialNumberByAuto())){ + Bill.setSerialNumberByAuto(serialNumManager.getSerialNumberStr(SerialNum.TYPE_EXPENSIVEGOODS_BILL)); + } + //计算总价 + Bill.calculateTotalPrice(); + objectDao.saveOrUpdate(Bill); + } + + /** * 保存并结算发票 */ private void saveAndBillExpensiveGoodsBill(ExpensiveGoodsBill expensiveGoodsBill,Map result){ @@ -353,7 +390,8 @@ expensiveGoodsBill.setCommittedStatus(true); } //保存发票单 - this.saveOrUpdate(expensiveGoodsBill); + saveBill(expensiveGoodsBill); +// this.saveOrUpdate(expensiveGoodsBill); //修改高值耗材实例 List itemList = expensiveGoodsBill.getItems(); for (ExpensiveGoodsBillItem billItem : itemList) { @@ -364,8 +402,10 @@ for (ExpensiveGoodsInstance expensiveGoodsInstance : GoodsInstanceList) { //高值耗材实例结算状态改为以结算 expensiveGoodsInstance.setSettledStatus(ExpensiveGoodsInstance.STATUS_SETTLED); + //高值耗材实例的发票单赋值 + expensiveGoodsInstance.setExpensiveGoodsBill(expensiveGoodsBill); //高值耗材实例的发票单id赋值 - expensiveGoodsInstance.setExpensiveGoodsBillId(expensiveGoodsBill.getId()); +// expensiveGoodsInstance.setExpensiveGoodsBillId(expensiveGoodsBill.getId()); //高值耗材实例的发票明细id赋值 expensiveGoodsInstance.setExpensiveGoodsBillItemId(expensiveGoodsBillItemId); objectDao.update(expensiveGoodsInstance); @@ -490,7 +530,7 @@ Date settledTime; try { // time = new SimpleDateFormat(DateTools.COMMON_DATE_HM).parse(timeStr); - settledTime = new SimpleDateFormat(DateTools.COMMON_DATE_HM).parse(settledTimeStr); + settledTime = new SimpleDateFormat(DateTools.COMMON_DATE_ONLY).parse(settledTimeStr); } catch (ParseException e) { e.printStackTrace(); throw new RuntimeException("日期格式错误!"); @@ -589,7 +629,7 @@ JSONArray jsonArray = new JSONArray(); List expensiveGoodsInstanceList = new ArrayList(); String hql = String.format( - "select po from ExpensiveGoodsInstance po where po.expensiveGoodsBillId = %s order by po.expensiveGoods.id",id); + "select po from ExpensiveGoodsInstance po where po.expensiveGoodsBill.id = %s order by po.expensiveGoods.id",id); expensiveGoodsInstanceList = objectDao.findByHql(hql); //返回高值耗材实例详细 if(CollectionUtils.isNotEmpty(expensiveGoodsInstanceList)){ @@ -780,21 +820,6 @@ return null; } - /** - * 发票单号是否唯一 - * @param serialNumber - */ - private void checkSerialNumber(String serialNumber){ - if(StringUtils.isEmpty(serialNumber)){ - throw new IllegalArgumentException("发票单号不能为空!"); - }else{ - List expensiveGoodsBill = this.getByProperty("serialNumber", serialNumber); - if(CollectionUtils.isNotEmpty(expensiveGoodsBill)){ - throw new IllegalArgumentException("已有发票单号为:"+serialNumber+"的发票!"); - } - } - } - @Override public JSONArray getExpensiveGoodsInstanceDtailByExpensiveGoodsIdsAndTime(List expensiveGoodsIdList,Long supplierId ,String startUseEnteringDateStr,String endUseEnteringDateStr,String startInvoicePlanDateStr,String endInvoicePlanDateStr) { @@ -931,7 +956,7 @@ //3、创建发票打印信息 JSONObject printBillVo = new JSONObject(); printBillVo.put("settledTimeStr", ForgonDateUtils.safelyFormatDate(bill.getSettledTime(), Constants.DATEFORMAT_YYYYMMDD, ""));//开票时间 - printBillVo.put("billId", bill.getId().toString());//单据编号 + printBillVo.put("billId", bill.getSerialNumberByAuto());//发票编号 printBillVo.put("serialNumber", bill.getSerialNumber());//发票号 printBillVo.put("supplierName", bill.getSupplierName());//供应商名称 printBillVo.put("goods", PrintBillitemsVO);//明细 @@ -953,14 +978,16 @@ List billItems = bill.getItems(); if(CollectionUtils.isNotEmpty(billItems)){ // 1、 获得该发票下:结算实例有不同型号的发票明细id(根据该发票下高值耗材id相同且型号不同的高值耗材实例) - String sql = String.format("po.expensiveGoodsBillId = %s and po.expensiveGoods.id in " - + "(select expensiveGoods.id from ExpensiveGoodsInstance where expensiveGoodsBillId = %s " + String sql = String.format("po.expensiveGoodsBill.id = %s and po.expensiveGoods.id in " + + "(select expensiveGoods.id from ExpensiveGoodsInstance where expensiveGoodsBill.id = %s " + "group by expensiveGoods.id having count(distinct expensiveGoodsModelId)>1)" ,bill.getId(),bill.getId()); List egiManyModelByBillID = expensiveGoodsInstanceManager.getByHql(sql); List billitemId_ManyModel = egiManyModelByBillID.stream().map(ExpensiveGoodsInstance::getExpensiveGoodsBillItemId).collect(Collectors.toList()); + //去重 + billitemId_ManyModel = billitemId_ManyModel.stream().distinct().collect(Collectors.toList()); //2、 获得该发票下:发票明细id对应结算的实例的集合 - List instanceList = expensiveGoodsInstanceManager.getByProperty("expensiveGoodsBillId", bill.getId()); + List instanceList = expensiveGoodsInstanceManager.getByProperty("expensiveGoodsBill.id", bill.getId()); Map billitemIdToEgi= new HashMap(); for (ExpensiveGoodsInstance egi : instanceList) { if(billitemIdToEgi.containsKey(egi.getExpensiveGoodsBillItemId())){ Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.jsp (revision 23729) @@ -0,0 +1,133 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@page import="com.forgon.Constants"%> +<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.ExpensiveGoodsInstance"%> + + + + +高值耗材实例 + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ include file="/common/includeExtJs4_2.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceInfoTab.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceInfoTab.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceInfoTab.js (revision 23729) @@ -0,0 +1,909 @@ +/** + * 显示高值耗材实例的追溯信息 + * + * @param instanceId 高值耗材实例id + * @param expensiveGoodsName 高值耗材物品名称 + */ +function showExpensiveInstanceInfo(id, expensiveGoodsName){ +// console.log(id); +// console.log(expensiveGoodsName); + /** + * 取消实例追溯信息窗口的按钮 + * + */ + this.cancelButton = { + text : '取消', + handler : function() { + expensiveInstanceWindow.close(); //这里不能用this,因为这里的this指向这个按钮对象 + } + }; + + /*********************1-1***********************/ + /** + * 获取Tab的子元素 + */ + this.getTabsItemArray = function() { + var tabsItemArr = []; + //申请记录 + tabsItemArr.push({ + title: '申请记录', + layout : 'fit', + items:[ + new top.Ext.FormPanel({ + height : 350, + width : 900, + frame : true, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 50px', + labelAlign : 'right', + items : [{ + layout : 'column', + items : [{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoicePlan_applicant', + name : 'invoicePlan_applicant', + xtype : 'textfield', + fieldLabel : '申请人', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoicePlan_applicationTime', + name : 'invoicePlan_applicationTime', + xtype : 'textfield', + fieldLabel : '申请时间', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoicePlan_type', + name : 'invoicePlan_type', + xtype : 'textfield', + fieldLabel : '申请单类型', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoicePlan_serialNum', + name : 'invoicePlan_serialNum', + xtype : 'textfield', + fieldLabel : '申请单号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoicePlan_depart', + name : 'invoicePlan_depart', + xtype : 'textfield', + fieldLabel : '申请科室', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoicePlan_patient', + name : 'invoicePlan_patient', + xtype : 'textfield', + fieldLabel : '病人', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }] + }], + buttons : [this.cancelButton] + })] + }); + + //审核记录 + tabsItemArr.push({ + title: '审核记录', + layout : 'fit', + items:[ + new top.Ext.grid.GridPanel({ + id : 'workFlowApprovalTaskRecord', + store : new Ext.data.Store({ + reader : new Ext.data.JsonReader({ + fields : [ + {name : 'title'}, + {name : 'createTaskTime'}, + {name : 'taskName'}, + {name : 'handler'}, + {name : 'handleTime'}, + {name : 'handleOpinion'}, + {name : 'approvalResult'}, + {name : 'isProvinceProduct'}, + {name : 'isHospitalProduct'}, + {name : 'isPlatformAuthorizedEnterprise'} + ] + }) + }), + cm : new Ext.grid.ColumnModel([ + {header : "标题",dataIndex : 'title',width : 150, menuDisabled: true}, + {header : "任务名称",dataIndex : 'taskName',width : 100, menuDisabled: true}, + {header : "处理人",dataIndex : 'handler',width : 80, menuDisabled: true}, + {header : "处理结果",dataIndex : 'approvalResult',width : 70, menuDisabled: true,renderer: renderApprovalResult}, + {header : "省平台产品",dataIndex : 'isProvinceProduct',width : 70, menuDisabled: true}, + {header : "院内目录产品",dataIndex : 'isHospitalProduct',width : 70, menuDisabled: true }, + {header : "平台授权配送企业",dataIndex : 'isPlatformAuthorizedEnterprise',width : 70, menuDisabled: true }, + {header : "处理意见",dataIndex : 'handleOpinion',width : 70, menuDisabled: true }, + {header : "处理时间",dataIndex : 'handleTime',width : 150, menuDisabled: true,renderer : rendererTransitionTime}, + {id : 'createTaskTime',header : "创建任务时间",dataIndex : 'createTaskTime',width : 150, menuDisabled: true,renderer : rendererTransitionTime} + ]), + enableHdMenu : false, + width : 900, + autoHeight : true, + autoExpandColumn : 'createTaskTime', + frame : false, + viewConfig: { + forceFit:true + } + }) + ] + }); + + //入库记录 + tabsItemArr.push({ + title: '入库记录', + layout : 'fit', + items:[new top.Ext.FormPanel({ + frame : true, + bodyStyle : 'padding:5px 5px 0px 50px', + labelSeparator : ':', + labelAlign : 'right', + items : [{ + layout : 'column', + autoHeight : true, + items : [{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodown_time', + name : 'inGodown_time', + xtype : 'textfield', + fieldLabel : '入库时间', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodown_invoiceSerialNum', + name : 'inGodown_invoiceSerialNum', + xtype : 'textfield', + fieldLabel : '绑定的申请单号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodown_subType', + name : 'inGodown_subType', + xtype : 'textfield', + fieldLabel : '入库类型', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodown_operator', + name : 'inGodown_operator', + xtype : 'textfield', + fieldLabel : '入库操作人', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodown_supplierName', + name : 'inGodown_supplierName', + xtype : 'textfield', + fieldLabel : '供应商', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodown_warehouseName', + name : 'inGodown_warehouseName', + xtype : 'textfield', + fieldLabel : '仓库', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodownItem_model', + name : 'inGodownItem_model', + xtype : 'textfield', + fieldLabel : '型号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodownItem_manufacturerName', + name : 'inGodownItem_manufacturerName', + xtype : 'textfield', + fieldLabel : '生产厂家', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'inGodownItem_cost', + name : 'inGodownItem_cost', + xtype : 'textfield', + fieldLabel : '入库单价', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }] + }], + buttons : [this.cancelButton] + })] + }); + + //发货记录 + tabsItemArr.push({ + title: '发货记录', + layout : 'fit', + items:[ + new top.Ext.FormPanel({ + frame : true, + bodyStyle : 'padding:5px 5px 0px 50px', + labelSeparator : ':', + labelAlign : 'right', + items : [{ + layout : 'column', + autoHeight : true, + items : [{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoice_serialNum', + name : 'invoice_serialNum', + xtype : 'textfield', + fieldLabel : '发货流水号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoice_depart', + name : 'invoice_depart', + xtype : 'textfield', + fieldLabel : '申请科室', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoice_settleAccountsDepart', + name : 'invoice_settleAccountsDepart', + xtype : 'textfield', + fieldLabel : '结算科室', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoice_sourceWarehouseName', + name : 'invoice_sourceWarehouseName', + xtype : 'textfield', + fieldLabel : '发货仓库', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'invoice_sendTime', + name : 'invoice_sendTime', + xtype : 'textfield', + fieldLabel : '发货时间', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }] + }], + buttons : [this.cancelButton] + })] + }); + + //使用记录 + tabsItemArr.push({ + title: '使用记录', + layout:'fit', + items:[new top.Ext.FormPanel({ + frame : true, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 50px', + labelAlign : 'right', + items : [{ + layout : 'column', + autoHeight : true, + items : [{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'hospitalNumForTab', + name : 'hospitalNumForTab', + xtype : 'textfield', + fieldLabel : '住院号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'treatmentNumForTab', + name : 'treatmentNumForTab', + xtype : 'textfield', + fieldLabel : '诊疗号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'patientNameForTab', + name : 'patientNameForTab', + xtype : 'textfield', + fieldLabel : '病人姓名', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'patientIDCardForTab', + name : 'patientIDCardForTab', + xtype : 'textfield', + fieldLabel : '病人身份证', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'enteringTimeForTab', + name : 'enteringTimeForTab', + xtype : 'textfield', + fieldLabel : '录入日期', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + columnWidth : .5, + layout : 'form', + cls:'edit-part2-labelwidth', + items : [{ + id : 'doctorNameForTab', + name : 'doctorNameForTab', + xtype : 'textfield', + fieldLabel : '医生', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'operationForTab', + name : 'operationForTab', + xtype : 'textfield', + fieldLabel : '手术名称', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'operatorForTab', + name : 'operatorForTab', + xtype : 'textfield', + fieldLabel : '操作员', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'circuitNurseForTab', + name : 'circuitNurseForTab', + xtype : 'textfield', + fieldLabel : sstsConfig.circuitNurseLabelName ? sstsConfig.circuitNurseLabelName : '巡回护士', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }] + }], + buttons : [this.cancelButton] + })] + }); + + //发票结算记录 + tabsItemArr.push({ + title: '发票结算记录', + layout : 'fit', + items:[new top.Ext.FormPanel({ + frame : true, + bodyStyle : 'padding:5px 5px 0px 50px', + labelSeparator : ':', + labelAlign : 'right', + items : [{ + layout : 'column', + autoHeight : true, + items : [{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'bill_settledTime', + name : 'bill_settledTime', + xtype : 'textfield', + fieldLabel : '开票时间', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'bill_serialNumber', + name : 'bill_serialNumber', + xtype : 'textfield', + fieldLabel : '发票号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'bill_supplierName', + name : 'bill_supplierName', + xtype : 'textfield', + fieldLabel : '供应商', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'billitem_manufacturerName', + name : 'billitem_manufacturerName', + xtype : 'textfield', + fieldLabel : '生产厂家', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'billitem_price', + name : 'billitem_price', + xtype : 'textfield', + fieldLabel : '结算单价', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }] + }], + buttons : [this.cancelButton] + })] + }); + + //退库记录 + tabsItemArr.push({ + title: '退库记录', + layout : 'fit', + items:[new top.Ext.FormPanel({ + frame : true, + bodyStyle : 'padding:5px 5px 0px 50px', + labelSeparator : ':', + labelAlign : 'right', + items : [{ + layout : 'column', + autoHeight : true, + items : [{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'outGodown_time', + name : 'outGodown_time', + xtype : 'textfield', + fieldLabel : '退库时间', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'outGodown_operator', + name : 'outGodown_operator', + xtype : 'textfield', + fieldLabel : '操作员', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'outGodown_serialNumber', + name : 'outGodown_serialNumber', + xtype : 'textfield', + fieldLabel : '退库单号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'instance_supplierName', + name : 'instance_supplierName', + xtype : 'textfield', + fieldLabel : '供应商', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'instance_model', + name : 'instance_model', + xtype : 'textfield', + fieldLabel : '型号', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', + columnWidth : .5, + cls:'edit-part2-labelwidth', + items : [{ + id : 'instance_price', + name : 'instance_price', + xtype : 'textfield', + fieldLabel : '实例单价', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }] + }], + buttons : [this.cancelButton] + })] + }); + + return tabsItemArr; + + }; + + /*********************2-2************/ + /** + * 设置实例的追溯信息 + */ + this.setExpensiveInstanceInfo = function() { + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!getExpensiveGoodsInstanceInfoById.do?expensiveGoodsInstanceId='+id, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if (result && result.success) { + //高值耗材实例 + var instance = result.expensiveGoodsInstanceJSON; + + //申请单记录 + var invoicePlanJSON = result.invoicePlanJSON; + if(invoicePlanJSON && JSON.stringify(invoicePlanJSON) != "{}"){ +// console.log(invoicePlanJSON); + top.Ext.getCmp('invoicePlan_applicationTime').setValue(invoicePlanJSON.invoicePlan_applicationTime);//申请时间 + top.Ext.getCmp('invoicePlan_serialNum').setValue(invoicePlanJSON.invoicePlan_serialNum); //申请单号 + top.Ext.getCmp('invoicePlan_applicant').setValue(invoicePlanJSON.invoicePlan_applicant); //申请人 + top.Ext.getCmp('invoicePlan_type').setValue(invoicePlanJSON.invoicePlan_type); //申请单类型 + top.Ext.getCmp('invoicePlan_depart').setValue(invoicePlanJSON.invoicePlan_depart); //申请单科室 + top.Ext.getCmp('invoicePlan_patient').setValue(invoicePlanJSON.invoicePlan_patient); //申请单病人 + } + + //流程审核记录 + var taskRecordInfoArray = result.taskRecordInfoArrayInfoJSONs; + if(taskRecordInfoArray && JSON.stringify(taskRecordInfoArray) != "{}"){ +// console.log(taskRecordInfoArray); + for(var j = 0;j < taskRecordInfoArray.length ; j++){ + var taskRecordInfo = taskRecordInfoArray[j]; + var taskRecord = new Ext.data.Record({ + title : taskRecordInfo.title, //标题 + taskName : taskRecordInfo.taskName, //任务名称 + handler : taskRecordInfo.handler, //处理人 + approvalResult : taskRecordInfo.approvalResult, //处理结果 + isProvinceProduct : taskRecordInfo.isProvinceProduct, //省平台产品 + isHospitalProduct : taskRecordInfo.isHospitalProduct, //院内目录产品 + isPlatformAuthorizedEnterprise : taskRecordInfo.isPlatformAuthorizedEnterprise, //平台授权配送企业 + handleOpinion : taskRecordInfo.handleOpinion, //处理意见 + handleTime : taskRecordInfo.handleTime, //处理时间 + createTaskTime : taskRecordInfo.createTaskTime //创建任务时间 + }); + top.Ext.getCmp('workFlowApprovalTaskRecord').getStore().add(taskRecord); + } + } + + //入库记录 + var expensiveGoodsGodownJSON = result.expensiveGoodsGodownJSON; + if (expensiveGoodsGodownJSON && JSON.stringify(expensiveGoodsGodownJSON) != "{}") { +// console.log(expensiveGoodsGodownJSON); + top.Ext.getCmp('inGodown_time').setValue(expensiveGoodsGodownJSON.inGodown_time); //入库时间 + top.Ext.getCmp('inGodown_invoiceSerialNum').setValue(expensiveGoodsGodownJSON.inGodown_invoiceSerialNum); //绑定的申请单号 + top.Ext.getCmp('inGodown_subType').setValue(expensiveGoodsGodownJSON.inGodown_subType); //入库类型 + top.Ext.getCmp('inGodown_operator').setValue(expensiveGoodsGodownJSON.inGodown_operator); //入库员 + top.Ext.getCmp('inGodown_supplierName').setValue(expensiveGoodsGodownJSON.inGodown_supplierName); //供应商 + top.Ext.getCmp('inGodown_warehouseName').setValue(expensiveGoodsGodownJSON.inGodown_warehouseName);//仓库 + top.Ext.getCmp('inGodownItem_model').setValue(expensiveGoodsGodownJSON.inGodownItem_model); //型号 + top.Ext.getCmp('inGodownItem_manufacturerName').setValue(expensiveGoodsGodownJSON.inGodownItem_manufacturerName); //生产厂家 + top.Ext.getCmp('inGodownItem_cost').setValue(expensiveGoodsGodownJSON.inGodownItem_cost); //入库单价 + } + + //发货记录 + var invoiceInfo = result.invoiceJSON; + if(invoiceInfo && JSON.stringify(invoiceInfo) != "{}"){ +// console.log(invoiceInfo); + top.Ext.getCmp('invoice_serialNum').setValue(invoiceInfo.invoice_serialNum); //发货记录_流水号 + top.Ext.getCmp('invoice_depart').setValue(invoiceInfo.invoice_depart); //发货记录_申请科室 + top.Ext.getCmp('invoice_settleAccountsDepart').setValue(invoiceInfo.invoice_settleAccountsDepart); //发货记录_结算科室 + top.Ext.getCmp('invoice_sourceWarehouseName').setValue(invoiceInfo.invoice_sourceWarehouseName); //发货记录_仓库 + if(invoiceInfo.invoice_sendTime != null){//发货记录_发货时间 + top.Ext.getCmp('invoice_sendTime').setValue(Ext.util.Format.date(new Date(invoiceInfo.invoice_sendTime.time), 'Y-m-d H:i:s')); + } + } + + //使用记录 + var useRecord = result.useRecord; + if(useRecord && JSON.stringify(useRecord) != "{}"){ +// console.log(useRecord) + top.Ext.getCmp('hospitalNumForTab').setValue(useRecord.hospitalNum); //使用记录_住院号 + top.Ext.getCmp('treatmentNumForTab').setValue(useRecord.treatmentNum); //使用记录_诊疗号 + top.Ext.getCmp('patientNameForTab').setValue(useRecord.patientName); //使用记录_病人姓名 + top.Ext.getCmp('patientIDCardForTab').setValue(useRecord.patientIDCard); //使用记录_病人身份证 + if(useRecord.enteringDate != null){ + top.Ext.getCmp('enteringTimeForTab').setValue(Ext.util.Format.date(new Date(useRecord.enteringDate.time), 'Y-m-d H:i')); //使用记录_录入日期 + } + top.Ext.getCmp('doctorNameForTab').setValue(useRecord.doctorName); //使用记录_医生 + top.Ext.getCmp('operationForTab').setValue(useRecord.operation); //使用记录_手术名称 + top.Ext.getCmp('operatorForTab').setValue(useRecord.operator); //使用记录_操作员 + top.Ext.getCmp('circuitNurseForTab').setValue(useRecord.circuitNurse); //使用记录_巡回护士 + } + + //发票结算记录 + var expensiveGoodsBillJSON = result.expensiveGoodsBillJSON; + if (expensiveGoodsBillJSON && JSON.stringify(expensiveGoodsBillJSON) != "{}") { +// console.log(expensiveGoodsBillJSON); + top.Ext.getCmp('bill_settledTime').setValue(expensiveGoodsBillJSON.bill_settledTime); //开票时间 + top.Ext.getCmp('bill_serialNumber').setValue(expensiveGoodsBillJSON.bill_serialNumber); //发票号 + top.Ext.getCmp('bill_supplierName').setValue(expensiveGoodsBillJSON.bill_supplierName); //供应商 + top.Ext.getCmp('billitem_manufacturerName').setValue(expensiveGoodsBillJSON.billitem_manufacturerName); //生产厂家 + top.Ext.getCmp('billitem_price').setValue(expensiveGoodsBillJSON.billitem_price); //结算单价 + } + + //退库记录 + var outGodownEntryJSON = result.outGodownEntryJSON; + if (outGodownEntryJSON && JSON.stringify(outGodownEntryJSON) != "{}") { +// console.log(outGodownEntryJSON); + top.Ext.getCmp('outGodown_time').setValue(outGodownEntryJSON.outGodown_time); //退库时间 + top.Ext.getCmp('outGodown_operator').setValue(outGodownEntryJSON.outGodown_operator); //操作员 + top.Ext.getCmp('outGodown_serialNumber').setValue(outGodownEntryJSON.outGodown_serialNumber); //退库单号 + top.Ext.getCmp('instance_supplierName').setValue(instance.instance_supplierName); //实例供应商 + top.Ext.getCmp('instance_model').setValue(instance.instance_model); //实例型号 + top.Ext.getCmp('instance_price').setValue(instance.instance_price); //实例单价 + } + }else{ + showResult('加载失败,请联系系统管理员。'); + } + }, + failure : function(response, options) { + alert(response.responseText); + showResult('加载失败,请联系系统管理员。'); + } + }); + }; + + /*********************3-3************/ + + /* 重新渲染时间字段. + * @param value + */ + function rendererTransitionTime(value) { + if (value) { + return new Date(value.time).format("Y-m-d H:i:s"); + } else { + return ''; + } + } + + /** + * 重新计算“处理结果”的值(待处理-默认值) 2(通过) 3(不通过) 4(回退) 5(提交) 6(通知起单人) + * @param value + * @param metaData + * @param record + * @param rowIndex + * @param colIndex + * @param store + * @param view + * @returns {String} + */ + function renderApprovalResult(value, metaData, record, rowIndex, colIndex, store, view) { + if (value == 1) { + return '待处理'; + } else if(value == 2) { + return '通过'; + }else if(value==3){ + return '不通过'; + }else if(value==4){ + return "回退"; + }else if(value==5){ + return "提交"; + }else if(value==6){ + return "通知起单人"; + }else if(value==7){ + return "通知起单人"; + } + } + + /** + * 计算TabPanel的宽度 + */ + this.calculateTabPanelWidth = function() { + var width = 900; + return width; + } + + /** + * 器械包实例追溯信息窗口 + */ + this.expensiveInstanceWindow = new top.Ext.Window({ + layout : 'fit', + title : '[' + expensiveGoodsName + '] 追溯信息', + autoWidth : true, + border : false, + modal : true, + autoHeight : true, + plain : true, + items : new top.Ext.TabPanel({ + width : this.calculateTabPanelWidth(), + height : 350, + plain : true, + activeTab : 0, + deferredRender : false, + enableTabScroll : true, + defaults : {autoScroll : true}, + items : this.getTabsItemArray() + }) + }); + this.expensiveInstanceWindow.show(); + this.setExpensiveInstanceInfo(); +} + Fisheye: Tag 23729 refers to a dead (removed) revision in file `ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstanceView.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: ssts-web/src/main/webapp/expensivegoodshomepage/menuconfigure.js =================================================================== diff -u -r23638 -r23729 --- ssts-web/src/main/webapp/expensivegoodshomepage/menuconfigure.js (.../menuconfigure.js) (revision 23638) +++ ssts-web/src/main/webapp/expensivegoodshomepage/menuconfigure.js (.../menuconfigure.js) (revision 23729) @@ -17,7 +17,7 @@ children:[ {hidden :SSTS_ExpensiveGoods_Hidden_Menu || SSTS_ExpensiveGoodsDefinition_Hidden_Manager,text:"高值耗材定义管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoodsImport_Hidden_Menu,text:"导入高值耗材",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/importExpensiveGoods.mhtml',hrefTarget:linkTarget,leaf:true}, - {hidden :SSTS_ViewExpensiveGoodsInstance_Hidden_Menu,text:"高值耗材实例列表",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstanceView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :SSTS_ViewExpensiveGoodsInstance_Hidden_Menu,text:"高值耗材实例列表",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsInstance/expensiveGoodsInstanceView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoods_Hidden_Menu || SSTS_ExpensiveGoodsStockEntry_Hidden_Manager,text:"高值耗材库存",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsStockView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoodsApplication_Manager,text:"高值耗材申请单",href:WWWROOT+'/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationView.jsp',hrefTarget:linkTarget,leaf:true}, //{hidden :SSTS_ExpensiveGoods_Hidden_Menu,text:"高值耗材出入库记录",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/storageRecordView.jsp',hrefTarget:linkTarget,leaf:true},