Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js =================================================================== diff -u -r31243 -r31260 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js (.../invoicePlanExtractedView.js) (revision 31243) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js (.../invoicePlanExtractedView.js) (revision 31260) @@ -541,7 +541,9 @@ } }, {header : "待发",dataIndex : 'count',width : 50, menuDisabled: true}, - {header : '加急',id : 'urgentAmount',dataIndex : 'urgentAmount',width : 50,value : 0, menuDisabled: true,renderer:getDefaultAmount} + {header : '加急',id : 'urgentAmount',dataIndex : 'urgentAmount',width : 50,value : 0, menuDisabled: true, renderer : function(v, p, record){ + return renderFunction(v, p, record, '加急'); + }}, ]); var rightGrid = new Ext.grid.EditorGridPanel({ Index: ssts-web/src/main/webapp/common/common.css =================================================================== diff -u -r31187 -r31260 --- ssts-web/src/main/webapp/common/common.css (.../common.css) (revision 31187) +++ ssts-web/src/main/webapp/common/common.css (.../common.css) (revision 31260) @@ -25,7 +25,7 @@ /*黄绿*/ .my_row_yellowGreen div{ - background-color: #99ff00 !important; + background-color: #99ff00 !important; } /*绿*/ @@ -68,6 +68,14 @@ background-color: #000000 !important; } +.my_row_color .x-grid3-cell-inner { + padding: 0; +} + +.my_row_color .x-grid3-cell-inner .item { + padding: 3px 3px 3px 5px; +} + .tousse_instance_background_yellow { background-color:yellow !important; } @@ -202,4 +210,8 @@ } .tousseName_background_1 { background: #BFEFFF !important; +} +/* GDSZYY-91:灰色 */ +.gridRowColor td{ + background: #eee !important; } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js =================================================================== diff -u -r31195 -r31260 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 31195) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 31260) @@ -73,39 +73,6 @@ currentScanMode = sstsConfig.invoicePageScanMode; } -function getDefaultAmount(v,p,record){ - if (v==null || v.length <= 0){ - return 0; - }else{ - return v; - } -} -function formatScannedAmount(v,p,record){ - var tousseAmount = 0; - if (v==null || v.length <= 0){ - tousseAmount = 0; - }else{ - tousseAmount = v; - } - var goodsType = record.get('goodsType'); - var isCleanedEntirely = record.get('isCleanedEntirely'); - var scannedMaterialAmount = record.get('scannedMaterialAmount'); - if (scannedMaterialAmount == null){ - scannedMaterialAmount = 0; - } - if((goodsType == '消毒物品') && (isCleanedEntirely == '否')){ - return tousseAmount+'('+scannedMaterialAmount+')'; - }else{ - return tousseAmount; - } -} -function formatStorage(v,p,record){ - if (v==null || v.length <= 0){ - return ''; - }else{ - return v; - } -} function sayGoods(record){ if(record && record.data){ speaker.speak(record.data.showTousseName + ",数量为" + record.data.count); @@ -183,6 +150,140 @@ } } +function getNewBackgroundColor(record){ + var rowClassName = ''; + var rowColor = ''; + //误差数量=已扫数量-待发数量 + if(record.data.errorAmount < 0){ + rowClassName = 'my_row_red'; + if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.overFulled + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.overFulled.className + ){ + rowClassName = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.overFulled.className; + rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.overFulled.color || ''; + } + }else if(record.data.errorAmount > 0 && record.data.errorAmount < record.data.count){ + rowClassName = 'my_row_blue'; + //已扫码但是未扫满的背景色 + if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanBeforeFull + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanBeforeFull.className + ){ + //由配置项自定义颜色 + rowClassName = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanBeforeFull.className; + rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanBeforeFull.color || ''; + } + }else if(record.data.errorAmount == 0){ + //扫码扫满的背景色 + rowClassName = 'my_row_green'; + if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanFulled + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanFulled.className + ){ + //由配置项自定义颜色 + rowClassName = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanFulled.className; + rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanFulled.color || ''; + } + }else{ + //加急 + if(record.json.maxUrgentLevel && record.json.maxUrgentLevel.colorCode !== ''){ + rowClassName = 'my_row_red'; + rowClassName = getClassNameForColor(record.json.maxUrgentLevel.colorCode,'_info'); + return { + rowClassName:rowClassName, + rowColor:rowColor + }; + } + //未扫码的背景色 + if(sstsConfig.colorChangeRuleOfInvoicPlanToSendGoodsList == '2'){ + if(record.json.status == '已灭菌'){ + rowClassName = 'my_row_blue'; + if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.sterilizedColor + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.sterilizedColor.className + ){ + rowClassName = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.sterilizedColor.className; + rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.sterilizedColor.color || ''; + } + }else { + rowClassName = 'my_row_yellow'; + if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.unsterilizedColor + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.unsterilizedColor.className + ){ + rowClassName = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.unsterilizedColor.className; + rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.unsterilizedColor.color || ''; + } + } + }else { + //判断是否全是今天申请的;如果同一种物品,内含今天申请的和非今天申请的,则为黄色,不然为白色(无底色) + if(record.json.beforeToday == true){ + rowClassName = 'my_row_yellow'; + if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.beforeToday + && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.beforeToday.className + ){ + //由配置项自定义颜色 + rowClassName = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.beforeToday.className; + rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.beforeToday.color || ''; + } + } + if(record.json.beforeToday == false){ + rowClassName = 'my_row_white'; + } + } + } + return { + rowClassName:rowClassName, + rowColor:rowColor + }; +} + +function renderFunction(v, p, record, name){ + var rowColor = getNewBackgroundColor(record).rowColor || ''; + var content = ''; + if(name == '紧急程度'){ + if(sstsConfig.enableUrgentFunction && record.json.maxUrgentLevel && record.json.maxUrgentLevel.colorCode != undefined){ + content = record.json.maxUrgentLevel.name; + }else { + content == ''; + } + }else if(name == '加急' || name == '误差' || name == '库存'){ + if (v == null || v.length <= 0){ + content == (name == '库存')?'':0 + }else{ + content == v; + } + }else if(name == '实发'){ + var tousseAmount = 0; + if (v ==null || v.length <= 0){ + tousseAmount = 0; + }else{ + tousseAmount = v; + } + var goodsType = record.get('goodsType'); + var isCleanedEntirely = record.get('isCleanedEntirely'); + var scannedMaterialAmount = record.get('scannedMaterialAmount'); + if (scannedMaterialAmount == null){ + scannedMaterialAmount = 0; + } + if((goodsType == '消毒物品') && (isCleanedEntirely == '否')){ + content == tousseAmount+'('+scannedMaterialAmount+')'; + }else{ + content == tousseAmount; + } + }else { + content = v || ''; + } + + if(rowColor == ''){ + return '
'+content+'
'; + }else { + return '
'+content+'
'; + } +} + /** * 修改某个一次性物品已扫数量或删除该一次性物品时,根据已扫的一次性物品名称重新计算该一次性物品的实发数量、误差数量 * @param disposableGoodsName 一次性物品名称 @@ -1689,23 +1790,35 @@ } var recyclingapplicationCm = new Ext.grid.ColumnModel([ - {header : "申请的物品",align:'center',dataIndex : 'showTousseName',width : width0,menuDisabled: true}, + {header : "申请的物品",align:'center',dataIndex : 'showTousseName',width : width0,menuDisabled: true, renderer : function(v, p, record){ + return renderFunction(v, p, record, '申请的物品'); + }}, {header : "name",dataIndex : 'name',hidden : true,menuDisabled: true}, - {header : "待发",dataIndex : 'count',align:'right',width : width2, menuDisabled: true}, + {header : "待发",dataIndex : 'count',align:'right',width : width2, menuDisabled: true, renderer : function(v, p, record){ + return renderFunction(v, p, record, '待发'); + }}, {header : "紧急程度",align:'center',dataIndex : 'topUrgentLevel',width : width1,menuDisabled: true, renderer : function(v, p, record){ - if(sstsConfig.enableUrgentFunction && record.json.maxUrgentLevel && record.json.maxUrgentLevel.colorCode != undefined){ - return record.json.maxUrgentLevel.name; - } + return renderFunction(v, p, record, '紧急程度'); } }, - {header : '加急',id : 'urgentAmount',align:'right',dataIndex : 'urgentAmount',width : width2,value : 0, menuDisabled: true,renderer:getDefaultAmount}, - {header : '实发',id : 'tempAmount',align:'right',dataIndex : 'tempAmount',width : width2,value : 0, menuDisabled: true,renderer:formatScannedAmount}, - {header : '误差',id : 'errorAmount',align:'right',dataIndex : 'errorAmount',width : width2,value : 0, menuDisabled: true,renderer:getDefaultAmount}, - {header : '库存',id : 'storage',align:'right',dataIndex : 'storage',width : width2,value : 0, menuDisabled: true,renderer:formatStorage}, + {header : '加急',id : 'urgentAmount',align:'right',dataIndex : 'urgentAmount',width : width2,value : 0, menuDisabled: true, renderer : function(v, p, record){ + return renderFunction(v, p, record, '加急'); + }}, + {header : '实发',id : 'tempAmount',align:'right',dataIndex : 'tempAmount',width : width2,value : 0, menuDisabled: true, renderer : function(v, p, record){ + return renderFunction(v, p, record, '实发'); + }}, + {header : '误差',id : 'errorAmount',align:'right',dataIndex : 'errorAmount',width : width2,value : 0, menuDisabled: true, renderer : function(v, p, record){ + return renderFunction(v, p, record, '误差'); + }}, + {header : '库存',id : 'storage',align:'right',dataIndex : 'storage',width : width2,value : 0, menuDisabled: true, renderer : function(v, p, record){ + return renderFunction(v, p, record, '库存'); + }}, {id : 'diposable',header : "是否一次性材料",dataIndex : 'diposable',hidden :true}, {id :'applicationAmount',header : "最大发货数量",dataIndex : 'applicationAmount',hidden : true,width :150}, - {header : "",dataIndex : '',width :10} + {header : "",dataIndex : '',width :10, renderer : function(v, p, record){ + return renderFunction(v, p, record, ''); + }} ]); var recyclingErrorCm = new Ext.grid.ColumnModel([ @@ -2689,81 +2802,9 @@ viewConfig: { forceFit:true, getRowClass : function(record,rowIndex,rowParams,store){ - var rowColor; - //误差数量=已扫数量-待发数量 - if(record.data.errorAmount < 0){ - rowColor = 'my_row_red'; - if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.overFulled - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.overFulled.className - ){ - rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.overFulled.className; - } - }else if(record.data.errorAmount > 0 && record.data.errorAmount < record.data.count){ - rowColor = 'my_row_blue'; - //已扫码但是未扫满的背景色 - if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanBeforeFull - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanBeforeFull.className - ){ - //由配置项自定义颜色 - rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanBeforeFull.className; - } - }else if(record.data.errorAmount == 0){ - //扫码扫满的背景色 - rowColor = 'my_row_green'; - if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanFulled - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanFulled.className - ){ - //由配置项自定义颜色 - rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.scanFulled.className; - } - }else{ - //加急 - if(record.json.maxUrgentLevel && record.json.maxUrgentLevel.colorCode !== ''){ - rowColor = 'my_row_red'; - rowColor = getClassNameForColor(record.json.maxUrgentLevel.colorCode,'_info'); - return rowColor; - } - //未扫码的背景色 - if(sstsConfig.colorChangeRuleOfInvoicPlanToSendGoodsList == '2'){ - if(record.json.status == '已灭菌'){ - rowColor = 'my_row_blue'; - if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.sterilizedColor - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.sterilizedColor.className - ){ - rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.sterilizedColor.className; - } - }else { - rowColor = 'my_row_yellow'; - if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.unsterilizedColor - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.unsterilizedColor.className - ){ - rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.unsterilizedColor.className; - } - } - }else { - //判断是否全是今天申请的;如果同一种物品,内含今天申请的和非今天申请的,则为黄色,不然为白色(无底色) - if(record.json.beforeToday == true){ - rowColor = 'my_row_yellow'; - if(sstsConfig.backgroudColorConfigOfInvoiceGoodsList - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.beforeToday - && sstsConfig.backgroudColorConfigOfInvoiceGoodsList.beforeToday.className - ){ - //由配置项自定义颜色 - rowColor = sstsConfig.backgroudColorConfigOfInvoiceGoodsList.beforeToday.className; - } - } - if(record.json.beforeToday == false){ - rowColor = 'my_row_white'; - } - } - } + var rowColor = getNewBackgroundColor(record).rowClassName; - return rowColor; + return 'my_row_color '+ rowColor; } }, clicksToEdit:1, @@ -2865,7 +2906,6 @@ {header : "数量",dataIndex : 'applicationAmount',width : 50, menuDisabled: true}, {header : "已发",dataIndex : 'sendAmount',width : 50, menuDisabled: true}, {header : "待发",dataIndex : 'count',width : 50, menuDisabled: true} - //{header : '加急',id : 'urgentAmount',dataIndex : 'urgentAmount',width : 50,value : 0, menuDisabled: true,renderer:getDefaultAmount} ]);