Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java =================================================================== diff -u -r22283 -r22293 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 22283) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 22293) @@ -2452,10 +2452,18 @@ map.put(expensiveGoodsAuthorization.getAuthorizedCompanyId(), 1); ExpensiveGoodsSupplier expensiveGoodsSupplier = expensiveGoodsSupplierManager.getSupplierById(expensiveGoodsAuthorization.getAuthorizedCompanyId().toString()); if(expensiveGoodsSupplier != null){ + Date date = null; jsonObject.put("businessCertificate",expensiveGoodsSupplier.getBusinessCertificate()); - jsonObject.put("businessValidityTime",expensiveGoodsSupplier.getBusinessValidityTime().toString()); + date = expensiveGoodsSupplier.getBusinessValidityTime(); + if(date != null){ + jsonObject.put("businessValidityTime",date.toString()); + date = null; + } jsonObject.put("businessLicense",expensiveGoodsSupplier.getBusinessLicense()); - jsonObject.put("licenseValidityTime",expensiveGoodsSupplier.getBusinessValidityTime().toString()); + date = expensiveGoodsSupplier.getLicenseValidityTime(); + if(date != null){ + jsonObject.put("licenseValidityTime",date.toString()); + } } it.remove(); jsonArray.add(jsonObject); @@ -2482,10 +2490,18 @@ map.put(expensiveGoodsAuthorization.getAuthorizedCompanyId(), value+1); ExpensiveGoodsSupplier expensiveGoodsSupplier = expensiveGoodsSupplierManager.getSupplierById(expensiveGoodsAuthorization.getAuthorizedCompanyId().toString()); if(expensiveGoodsSupplier != null){ + Date date = null; jsonObject.put("businessCertificate",expensiveGoodsSupplier.getBusinessCertificate()); - jsonObject.put("businessValidityTime",expensiveGoodsSupplier.getBusinessValidityTime().toString()); + date = expensiveGoodsSupplier.getBusinessValidityTime(); + if(date != null){ + jsonObject.put("businessValidityTime",date.toString()); + date = null; + } jsonObject.put("businessLicense",expensiveGoodsSupplier.getBusinessLicense()); - jsonObject.put("licenseValidityTime",expensiveGoodsSupplier.getBusinessValidityTime().toString()); + date = expensiveGoodsSupplier.getLicenseValidityTime(); + if(date != null){ + jsonObject.put("licenseValidityTime",date.toString()); + } } it.remove(); hasRemoved = true; Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAction.java =================================================================== diff -u -r22286 -r22293 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAction.java (.../ExpensiveGoodsAction.java) (revision 22286) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAction.java (.../ExpensiveGoodsAction.java) (revision 22293) @@ -318,11 +318,13 @@ date = expensiveGoodsSupplier.getLicenseValidityTime(); if(date != null){ expensiveGoodsObj.put("licenseValidityTime",date.toString().substring(0,10)); + date = null; } expensiveGoodsObj.put("manufacturerProductionCertificate",expensiveGoodsSupplier.getProductionCertificate()); date = expensiveGoodsSupplier.getProductionValidityTime(); if(date != null){ expensiveGoodsObj.put("productionValidityTime",date.toString().substring(0,10)); + date = null; } expensiveGoodsObj.put("expensiveGoodsSupplierId",expensiveGoodsSupplier.getId()); date = registrationCertification.getValidityTime(); Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsDefinition.js =================================================================== diff -u -r22283 -r22293 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsDefinition.js (.../expensiveGoodsDefinition.js) (revision 22283) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsDefinition.js (.../expensiveGoodsDefinition.js) (revision 22293) @@ -7,6 +7,16 @@ var oldSelectSupplierId = null; var newSelectSupplierId = null; +function changeDateBackground(component,date){ + var color = getDateColor(date); + if(color != ''){ + component.inputEl.removeCls('fieldReadOnlyNoRemoveAndTop'); + component.setFieldStyle("background-color: '#FF7575'; background-image: none;border: 0;"); + }else{ + component.inputEl.addCls('fieldReadOnlyNoRemoveAndTop'); + } +} + function checkDate(v){ var date = new Date(); var currentDate = ""; @@ -23,13 +33,27 @@ return ''; } } -function compareDate(DateOne,DateTwo) { - var OneMonth = DateOne.substring(5,DateOne.lastIndexOf ("-")); - var OneDay = DateOne.substring(DateOne.length,DateOne.lastIndexOf ("-")+1); - var OneYear = DateOne.substring(0,DateOne.indexOf ("-")); - var TwoMonth = DateTwo.substring(5,DateTwo.lastIndexOf ("-")); - var TwoDay = DateTwo.substring(DateTwo.length,DateTwo.lastIndexOf ("-")+1); - var TwoYear = DateTwo.substring(0,DateTwo.indexOf ("-")); +function getDateColor(myDate){ + if(isUndefinedOrNullOrEmpty(myDate)) return ''; + var date = new Date(); + var currentDate = ""; + currentDate = date.getFullYear()+"-"; + currentDate += (date.getMonth()+1)+"-"; + currentDate += date.getDate(); + var color = ''; + if(!compareDate(myDate,currentDate)){ + color = "#FF7575"; + } + return color; +} + +function compareDate(dateOne,dateTwo) { + var OneMonth = dateOne.substring(5,dateOne.lastIndexOf ("-")); + var OneDay = dateOne.substring(dateOne.length,dateOne.lastIndexOf ("-")+1); + var OneYear = dateOne.substring(0,dateOne.indexOf ("-")); + var TwoMonth = dateTwo.substring(5,dateTwo.lastIndexOf ("-")); + var TwoDay = dateTwo.substring(dateTwo.length,dateTwo.lastIndexOf ("-")+1); + var TwoYear = dateTwo.substring(0,dateTwo.indexOf ("-")); if (Date.parse(OneMonth+"/"+OneDay+"/"+OneYear) >= Date.parse(TwoMonth+"/"+TwoDay+"/"+TwoYear)) { return true;//dataone>datetwo } else { @@ -60,10 +84,15 @@ if(oldSelectSupplierId != newSelectSupplierId){ if(registrationCertificationStore.count() == 1){ top.Ext4.getCmp("certification").setValue(registrationCertificationStore.first().data.certification); + top.Ext4.getCmp("certificationId").setValue(registrationCertificationStore.first().data.id); top.Ext4.getCmp("registrationCertificationValidityTime").setValue(registrationCertificationStore.first().data.validityTime); + + changeDateBackground(top.Ext4.getCmp("registrationCertificationValidityTime"),registrationCertificationStore.first().data.validityTime); }else{ top.Ext4.getCmp("certification").setValue(''); top.Ext4.getCmp("registrationCertificationValidityTime").setValue(''); + top.Ext4.getCmp("certificationId").setValue(''); + top.Ext4.getCmp("registrationCertificationValidityTime").inputEl.addCls('fieldReadOnlyNoRemoveAndTop'); } } } @@ -395,36 +424,40 @@ maxLength : '16', id : 'unit', name : 'unit' - },{ - xtype : 'combo', - id : 'expensiveGoodsSupplier', - name : 'expensiveGoodsSupplier', - fieldLabel : '厂家', - queryParam : 'supplierName', - minChars : 0, - valueField : 'id', - displayField : 'name', - // pageSize : 5, - store : manufacturerStore, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - allowBlank : false, - listeners : { - select : function(combo, record, index) { - oldSelectSupplierId = newSelectSupplierId; - newSelectSupplierId = record[0].data.id; - loadCertificationStoreByExpensiveGoodsSupplierId(record[0].data.id+''); - top.Ext4.getCmp('manufacturerBusinessLicense').setValue(record[0].data.businessLicense); - top.Ext4.getCmp('manufacturerProductionCertificate').setValue(record[0].data.productionCertificate); - top.Ext4.getCmp('licenseValidityTime').setValue(record[0].data.licenseValidityTime); - top.Ext4.getCmp('productionValidityTime').setValue(record[0].data.productionValidityTime); - - } - } } ]; +var columnOfManufaturer = { + xtype : 'combo', + id : 'expensiveGoodsSupplier', + name : 'expensiveGoodsSupplier', + fieldLabel : '厂家', + queryParam : 'supplierName', + minChars : 0, + valueField : 'id', + displayField : 'name', + // pageSize : 5, + store : manufacturerStore, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + allowBlank : false, + listeners : { + select : function(combo, record, index) { + oldSelectSupplierId = newSelectSupplierId; + newSelectSupplierId = record[0].data.id; + loadCertificationStoreByExpensiveGoodsSupplierId(record[0].data.id+''); + top.Ext4.getCmp('manufacturerBusinessLicense').setValue(record[0].data.businessLicense); + top.Ext4.getCmp('manufacturerProductionCertificate').setValue(record[0].data.productionCertificate); + top.Ext4.getCmp('licenseValidityTime').setValue(record[0].data.licenseValidityTime); + top.Ext4.getCmp('productionValidityTime').setValue(record[0].data.productionValidityTime); + + changeDateBackground(top.Ext4.getCmp("productionValidityTime"),record[0].data.productionValidityTime); + changeDateBackground(top.Ext4.getCmp("licenseValidityTime"),record[0].data.licenseValidityTime); + } + } + }; + //第二列的选项 var column2Items = [{ fieldLabel : '五笔码', @@ -513,6 +546,8 @@ select : function(combo, records, index) { top.Ext4.getCmp('certificationId').setValue(records[0].data.id); top.Ext4.getCmp('registrationCertificationValidityTime').setValue(records[0].data.validityTime); + + changeDateBackground(top.Ext4.getCmp("registrationCertificationValidityTime"),records[0].data.validityTime); } } },{ @@ -590,7 +625,7 @@ ], tbar : [{ text : '新增', - width : 70, +// width : 70, iconCls : 'btn_ext_add', handler : function() { newRow(); @@ -691,7 +726,18 @@ border : true, layout : 'column', items : [{ - columnWidth : 0.5, + columnWidth : 1, + defaultType : 'textfield', + border : false, + layout : 'form', +// frame : true, + bodyStyle: 'background:transparent;', + defaults : { + labelWidth : 106 + }, + items : columnOfManufaturer + },{ + columnWidth : 0.6, defaultType : 'textfield', layout : 'form', border : false, @@ -701,15 +747,15 @@ }, items : manufacturerColumn1Items },{ - columnWidth : 0.5, + columnWidth : 0.4, defaultType : 'textfield', layout : 'form', border : false, bodyStyle: 'background:transparent;', defaults : { labelAlign : 'right', labelWidth : 110, - fieldCls : 'fieldReadOnlyNoRemoveAndTop', +// fieldCls : 'fieldReadOnlyNoRemoveAndTop', readOnly : true }, items : manufacturerColumn2Items @@ -795,23 +841,15 @@ params : { id : selectedId}, success : function(form ,action){ var expensiveGoods = action.result.data; - var expensiveGoodsSupplier = expensiveGoods.expensiveGoodsSupplier; top.Ext4.getCmp("orginalName").setValue(expensiveGoods.name); loadCertificationStoreByExpensiveGoodsSupplierId(expensiveGoods.expensiveGoodsSupplierId); oldSelectSupplierId = newSelectSupplierId = expensiveGoods.expensiveGoodsSupplierId; fillexpensiveGoodsModelGridStore(expensiveGoods.expensiveGoodsModelLists); - - -// manufacturerStore.load({ -// params: {supplierName: expensiveGoodsSupplier}, -// callback: function(records, operation, success) { -// if (records && records.length > 0) { -// top.Ext4.getCmp("expensiveGoodsSupplier").setValue(expensiveGoodsSupplier); -// } -// } -// }); - - + + changeDateBackground(top.Ext4.getCmp("registrationCertificationValidityTime"),expensiveGoods.registrationCertificationValidityTime); + changeDateBackground(top.Ext4.getCmp("productionValidityTime"),expensiveGoods.productionValidityTime); + changeDateBackground(top.Ext4.getCmp("licenseValidityTime"),expensiveGoods.licenseValidityTime); + supplierStore.load({ params : { id : selectedId, Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.js =================================================================== diff -u -r22283 -r22293 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.js (.../expensiveGoodsView.js) (revision 22283) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsView.js (.../expensiveGoodsView.js) (revision 22293) @@ -246,9 +246,9 @@ //********* 2、ForgonGrid *********** var columns = [ - {header : "名称",width : 150,dataIndex : 'name', renderer : rendeColor}, + {header : "名称",width : 200,dataIndex : 'name', renderer : rendeColor}, {header : "单位",width : 50,dataIndex : 'unit'}, - {header : "注册证",width : 100,dataIndex : 'certification'}, + {header : "注册证",width : 150,dataIndex : 'certification'}, // {header : "规格",width : 100,dataIndex : 'specification'}, {header : "类别",width : 80,dataIndex : 'grade'}, {header : "类型",width : 80,dataIndex : 'type'}, @@ -263,8 +263,8 @@ {header : "最小库存",width : 60,dataIndex : 'minStorage'}, {header : "最大申请数量",width : 80,dataIndex : 'maxApplyAmount'}, {header : "最小申请数量",width : 80,dataIndex : 'minApplyAmount'}, - {header : "拼音码",width : 90,dataIndex : 'spelling'}, - {header : "五笔码",width : 90,dataIndex : 'wbCode'}, + {header : "拼音码",width : 150,dataIndex : 'spelling'}, + {header : "五笔码",width : 150,dataIndex : 'wbCode'}, // {header : "能否作为器械包材料",width : 120,dataIndex : 'isPartOfTousseMaterial'}, // {header : "能否被科室申请",width : 100,dataIndex : 'isApplicationMaterial'}, // {header : "是否消毒供应中心领用物品",width : 100,dataIndex : 'isSupplyRoomGoods'},