Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignFormVersion2.js
===================================================================
diff -u
--- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignFormVersion2.js (revision 0)
+++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignFormVersion2.js (revision 26923)
@@ -0,0 +1,530 @@
+var invoiceSignGoodsWin;
+var invoiceSignAbnormalDetailGoodsStore;//异常物品列表参数
+var waitInvoiceSignGoodsStore;
+var scanGoodsStore;
+var form;
+var signRecordId = 0;
+var g_curRecord = null;
+/**
+ * 请求服务器,生成时间筛选对应的值
+ * @returns {[*,*,*,*,*]}
+ */
+function getTimeComboData() {
+ var dateHelper = new DateHelper();
+ var applyDateDataArray = [];
+ var format = 'yyyy-MM-dd';
+ var url = WWWROOT + '/system/serverTimeAction!getInvoicePlanComboTime.do';
+ dateHelper.getServerTimeByJQ(format, Ext, url, function (result) {
+ var time = result.time;
+ applyDateDataArray.push(['今天', time.todayTime]);
+ applyDateDataArray.push(['近二天', time.twoDayBeforeTodayTime]);
+ applyDateDataArray.push(['近三天', time.threeDayBeforeTodayTime]);
+ applyDateDataArray.push(['全部', "all"]);
+ });
+ return applyDateDataArray;
+}
+function getDefaultAmount(v,p,record){
+ if (v == null || v.length <= 0){
+ return 0;
+ }else{
+ return v;
+ }
+}
+//异常物品全部删除
+function deleteAllInvoiceSignAbnormal(){
+ invoiceSignAbnormalDetailGoodsStore.removeAll();
+}
+
+//异常物品列表删除选中的物品
+function removeSendOutAbnormalGoods(){
+ var abnormalGoodsNum = top.Ext.getCmp('invoiceSignAbnormalDetailGoods').getStore().data.keys;
+ var rows = top.Ext.getCmp('invoiceSignAbnormalDetailGoods').getSelectionModel().getSelections();// 返回值为
+ if(rows){
+ for( var i = 0; i < rows.length; i++){
+ invoiceSignAbnormalDetailGoodsStore.remove(rows[i]);
+ return ;
+ }
+ }
+}
+function findScanGoodsWithWaitInvoiceSignGoods(vo) {
+ for ( var i = 0; i < waitInvoiceSignGoodsStore.getCount(); i++) {
+ var record = waitInvoiceSignGoodsStore.getAt(i);
+ var name = record.get('tousseName');
+ if(name == vo.tousseName){
+ return record;
+ }
+ }
+ return null;
+}
+
+function updateWaitInvoiceSignAmount(record,count){
+ var amount = record.get('signAmount');
+ if(amount == null || amount.length <= 0){
+ amount = 0;
+ }
+ var newAmount = Number(count) + Number(amount);
+ record.set('signAmount',newAmount);//计算待签收数量
+ return false;
+
+}
+var addGridItem = Ext.data.Record.create([
+ {name : 'tousseName'},
+ {name : 'tousseBarcode'},
+ {name : 'sterialTime'},
+ {name : 'name'},
+ {name : 'count'}
+ ]);
+//异常物品列表
+var addAbnormalGridItem = Ext.data.Record.create([
+ {name : 'tousseName'},
+ {name : 'tousseBarcode'},
+ {name : 'status'},
+ {name : 'depart'}
+]);
+
+
+function safelyGetScanTime(r){
+ var scanTime = Number(r.get('signTime'));
+ if(scanTime){
+ return Number(scanTime);
+ }
+ return 0;
+}
+
+
+function sortFun(r1,r2){
+ var waitInvoiceSignAmount1= Number(r1.get('amount'));// 待签收
+ var waitInvoiceSignAmount2 = Number(r2.get('amount'));
+ var signAmount1 = Number(r1.get('signAmount'));// 已签收
+ var signAmount2 = Number(r2.get('signAmount'));
+ var scanTime1 = safelyGetScanTime(r1);// 扫描时间
+ var scanTime2 = safelyGetScanTime(r2);// 扫描时间
+ // 是否当前记录
+ if(r1 == g_curRecord){
+ return -1;
+ }else if(r2 == g_curRecord){
+ return 1;
+ }
+ // 已扫数量为0
+ if(signAmount1 == 0 && signAmount2 != 0){
+ return -1;
+ }else if(signAmount2 == 0 && signAmount1 != 0){
+ return 1;
+ }else if(signAmount2 == 0 && signAmount1 == 0){
+ if(waitInvoiceSignAmount1!= waitInvoiceSignAmount2){
+ return waitInvoiceSignAmount2 - waitInvoiceSignAmount1;
+ }
+ }
+
+ // 扫描时间。
+ return scanTime2 - scanTime1;
+}
+
+function resortWaitInvoiceSign(curRecord){
+ g_curRecord = curRecord;
+ var records = [];
+ for ( var i = 0; i < waitInvoiceSignGoodsStore.getCount(); i++) {
+ var record = waitInvoiceSignGoodsStore.getAt(i);
+ records.push(record);
+ }
+ curRecord.set('signTime',new Date().getTime());
+ records.sort(sortFun);
+ waitInvoiceSignGoodsStore.removeAll();
+ waitInvoiceSignGoodsStore.add(records);
+}
+function addInvoiceSignGoodsGrid(goods){
+ var count = 1;// 此次的发货数量
+ //扫描的包和待签收物品明细的包判断是否是同一个,是就返回待签收物品明细的包的信息
+ var record = findScanGoodsWithWaitInvoiceSignGoods(goods);
+ var newRecord = new addGridItem({
+ tousseName : goods.tousseName,
+ tousseBarcode : goods.tousseBarcode,
+ sterialTime : goods.sterialTime,
+ count : count
+ });
+ scanGoodsStore.insert(0,newRecord);
+ if(record != null){
+ updateWaitInvoiceSignAmount(record,count);
+ resortWaitInvoiceSign(record);
+ }
+
+}
+function addAbnormalInvoiceSignGoods(goods){
+ var newRecord = new addAbnormalGridItem({
+ tousseName : goods.tousseName,
+ tousseBarcode : goods.tousseBarcode,
+ status : goods.status,
+ depart : goods.depart
+ });
+ invoiceSignAbnormalDetailGoodsStore.insert(0,newRecord);
+}
+
+//扫描条码
+function scanInvoiceSignGoods(){
+ var barcode = top.Ext.getCmp("scanText").getValue().Trim();
+ // 开始查询条码信息
+ top.Ext.getCmp("scanGoods").getEl().mask("后台处理中,请稍候...");
+ Ext.Ajax.request({
+ url : WWWROOT + '/disinfectSystem/tousseInstanceAction!signTousseInstanceByBarcode.do',
+ params : {barcode : barcode,signRecordId:signRecordId},
+ async : false,
+ success : function(response, options) {
+ var result = Ext.decode(response.responseText);
+ top.Ext.getCmp("scanGoods").getEl().unmask();
+ if(result.success){
+ signRecordId = result.signRecordId;
+ for(var x = 0; x < result.arr.length; x++){
+ var goods = result.arr[x];
+ //正确的添加scanGoods表格
+ addInvoiceSignGoodsGrid(goods);
+ top.Ext.getCmp('scanText').setValue("");
+ top.Ext.getCmp('scanText').focus();
+ }
+ }else{
+ showResult(result.msg , null , sstsConfig.messagePauseTimeOnInvoiceplanPage);
+ top.Ext.getCmp('scanText').setValue("");
+ top.Ext.getCmp('scanText').focus();
+ //异常物品列表,给提示
+ if(result.arr.length > 0){
+ var barcodeVal = result.barcode;
+ //判断扫描的条码是否在异常物品列表中已存在,存在就不再添加到异常物品列表中
+ var flag = false;
+ for ( var i = 0; i < invoiceSignAbnormalDetailGoodsStore.getCount(); i++) {
+ var record = invoiceSignAbnormalDetailGoodsStore.getAt(i);
+ var barcodes = record.get('tousseBarcode');
+ if(record.get('tousseBarcode') == barcodeVal){
+ flag = true;
+ }
+ }
+ if(!flag){
+ addAbnormalInvoiceSignGoods(result.arr[0]);
+ }
+ }
+ }
+ },
+ failure : function(response, options) {
+ top.Ext.getCmp("scanGoods").getEl().unmask();
+ showResult('获取条码信息失败' , null , sstsConfig.messagePauseTimeOnInvoiceplanPage);
+ top.Ext.getCmp('scanText').setValue("");
+ top.Ext.getCmp('scanText').focus();
+ }
+
+ });
+}
+
+function addInvoiceSignGoods() {
+
+ //异常物品列表--Ext.data.Store
+ invoiceSignAbnormalDetailGoodsStore = new Ext.data.Store({
+ reader : new Ext.data.JsonReader({
+ fields : [
+ {name : 'id'},
+ {name : 'barcode'},
+ {name : 'name'},
+ {name : 'ttsName'},
+ {name : 'appRecord'},
+ {name : 'showTousseName'},
+ {name : 'status'},
+ {name : 'depart'},
+ {name : 'batchNumber'}
+ ]
+ })
+ });
+ // 签收物品
+ scanGoodsStore = new Ext.data.Store({
+ reader : new Ext.data.JsonReader({
+ fields : [
+ {name : 'tousseName'},
+ {name : 'tousseBarcode'},
+ {name : 'sterialTime'},
+ {name : 'count'}
+ ]
+ })
+ });
+
+ //待签收物品明细
+ waitInvoiceSignGoodsStore = new Ext.data.Store({
+ proxy : new Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/signRecordAction!getWaitSignTousseInstanceByDate.do',
+ method : 'POST'
+ }),
+ reader : new Ext.data.JsonReader({
+ root : 'data'
+ }, [
+ {name : 'tousseName'},
+ {name : 'amount'},
+ {name : 'signAmount'},
+ {name : 'signTime'}
+ ])
+ });
+ waitInvoiceSignGoodsStore.on("beforeload", function(thiz, options) {
+ // waitInvoiceSignGoodsStore.baseParams['endDate'] = timeArr[1];
+ });
+ waitInvoiceSignGoodsStore.load();
+
+ var waitInvoiceSignCm = new Ext.grid.ColumnModel([
+ {header : "物品名称",dataIndex : 'tousseName',width : 150,menuDisabled: true},
+ {header : "待签收",dataIndex : 'amount',width : 70,menuDisabled: true},
+ {header : "已签收",dataIndex : 'signAmount',width : 70, value:0,menuDisabled: true,renderer:getDefaultAmount}
+ ]);
+
+
+ //异常物品列表字段
+ var abnormalCm = new Ext.grid.ColumnModel([
+ {header : "物品名称",dataIndex : 'tousseName',width : 100,menuDisabled: true},
+ {header : "条码",dataIndex : 'tousseBarcode',width : 80,menuDisabled: true},
+ {header : "包状态",dataIndex : 'status',width : 80, menuDisabled: true},
+ {header : "收货科室",dataIndex : 'depart',width : 100, menuDisabled: true},
+ {id : 'deleteItem',header:'删除',width : 35, align:'center', menuDisabled: true,
+ renderer: function(v,p,record){
+ var str = "";
+ return str;
+ },
+ dataIndex:'button'
+ }
+ ]);
+ var cm = new Ext.grid.ColumnModel([
+ {header : "物品名称",dataIndex : 'tousseName',width:200,menuDisabled: true},
+ {header : "条码",dataIndex : 'tousseBarcode',width : 90,menuDisabled: true},
+ {header : "灭菌日期",dataIndex : 'sterialTime',width : 130,menuDisabled: true},
+ {header : "数量",dataIndex : 'count',width : 50,menuDisabled: true,id:"count"}
+ ]);
+
+ form = new top.Ext.FormPanel({
+ id : 'invoiceSignForm',
+ frame : true,
+ region: 'center',
+ labelSeparator : ':',
+ bodyStyle : 'padding:5px 5px 0px 5px',
+ width : 960,
+ height : top.screen.height > 800 ? 640 : 450,
+ autoHeight : true,
+ //autoScroll : true,
+ labelAlign:'right',
+ layout : 'form',
+ items : [{
+ xtype : 'hidden',
+ name : 'invoiceSignGoodsStoreData',
+ id : 'invoiceSignGoodsStoreData'
+ },{
+ layout:'column',
+ items:[{
+ layout : 'fit',
+ columnWidth : 0.57,
+ items:[
+ new top.Ext.grid.EditorGridPanel({
+ id : 'scanGoods',
+ store : scanGoodsStore,
+ cm : cm,
+ height : top.screen.height > 800 ? 570 : 440,
+ autoExpandColumn : 'count',
+ enableHdMenu : false,
+ frame : false,
+ bodyStyle : 'border:1px solid #afd7af',
+ viewConfig: {
+ autoFit:true
+ },
+ clicksToEdit : 1,// 设置点击几次才可编辑
+ selModel : new top.Ext.grid.RowSelectionModel({
+ singleSelect : false
+ }),
+ tbar : [{
+ text : "扫描条码:"
+ },{
+ xtype : 'textfield',
+ id : 'scanText',
+ name : 'scanText',
+ width : 200,
+ enableKeyEvents : true,
+ listeners : {
+ render : function(c) {
+ c.getEl().on('keypress',function(e) {
+ //扫码按下回车键
+ if (e.getKey() == 13) {// 输入;号键,grid重新加载
+ if(top.Ext.getCmp("scanText").getValue() != ''){
+ scanInvoiceSignGoods();
+ }else{
+ showResult("请扫描条码!" , null , sstsConfig.messagePauseTimeOnInvoiceplanPage);
+ }
+ }
+ });
+ c.getEl().on('focus',function(e) {
+ top.Ext.getCmp('scanText').setValue('');
+ });
+ }
+ }
+ }]
+ }
+ )]
+ },{
+ layout : 'fit',
+ columnWidth : 0.43,
+ items:[new top.Ext.grid.EditorGridPanel({
+ id : 'waitInvoiceSignGoods',
+ title : '待签收物品明细',
+ store : waitInvoiceSignGoodsStore,
+ cm : waitInvoiceSignCm,
+ enableHdMenu : false,
+ height : top.screen.height > 800 ? 570 : 440,
+ loadMask : true,
+ tbar:[{
+ text:'发货时间:',
+ height:35
+ },{
+ xtype : 'combo',
+ id : 'sendoutTime',
+ name : 'sendoutTime',
+ valueField : 'value',
+ displayField : 'key',
+ allowBlank : true,
+ editable : false,
+ height:35,
+ width : 120,
+ value:"今天",
+ mode:'local',
+ store : new Ext.data.SimpleStore({
+ data: getTimeComboData(),
+ fields:['key','value']
+ }),
+ forceSelection : true,
+ triggerAction : 'all',
+ listeners : {
+ select : function(combo, record, index){
+ var value = combo.getValue();
+ var timeArr = value.split(";");
+ waitInvoiceSignGoodsStore.baseParams['beginDate'] = timeArr[0];
+ waitInvoiceSignGoodsStore.baseParams['endDate'] = timeArr[1];
+ waitInvoiceSignGoodsStore.load();
+ scanGoodsStore.removeAll();
+ }
+ },
+ anchor : '95%'
+ }],
+ autoExpandColumn : 'signAmount',
+ frame : false,
+ bodyStyle : 'border:1px solid #afd7af',
+ viewConfig: {
+ forceFit:true,
+ getRowClass : function(record,rowIndex,rowParams,store){
+ var rowColor;
+ if(record.data.signAmount == 0){//未扫描
+ if(record.data.signTime == 0){//当天待签收的物品背景色为白色
+ rowColor = 'my_row_white';
+ }else if(record.data.signTime == 1){//昨天或昨天之前的背景色为黄色,如果全是今天发货的;如果同一种物品,内含今天发货的和非今天发货的,则为黄色
+ rowColor = 'my_row_yellow';
+ }
+ }else{//扫描以后
+ if(record.data.signAmount < record.data.amount){//已签收数量小于待签收数量时,物品的背景色为蓝色
+ rowColor = 'my_row_blue';
+ }else if(record.data.signAmount == record.data.amount){//已签收数量等于未签收数量时,显示绿色
+ rowColor = 'my_row_green';
+ }
+ }
+ return rowColor;
+ }
+ },
+ clicksToEdit:1,
+ selModel : new top.Ext.grid.RowSelectionModel({
+ singleSelect : false
+ })
+ })]
+ }]
+ }],
+ buttons : [{
+ text : '关闭',
+ id:'closeButton',
+ handler : function(){
+ closeinvoiceSignGoodsWindow();
+ }
+ }]
+ });
+
+
+
+ //异常物品列表Panel面板
+ var invoiceSignAbnormalDetail = new top.Ext.grid.EditorGridPanel({
+ tbar : [{
+ text : '全部删除',
+ iconCls : 'btn_ext_application_del',
+ handler : function() {
+ deleteAllInvoiceSignAbnormal();
+ }
+ }],
+ id : 'invoiceSignAbnormalDetailGoods',
+ bodyStyle : 'border:1px solid #afd7af',
+ frame :false,
+ width : 570,
+ height : top.screen.height > 800 ? 570 : 440,
+ viewConfig: {
+ forceFit:true
+ },
+ cm : abnormalCm,
+ store : invoiceSignAbnormalDetailGoodsStore,
+ selModel : new top.Ext.grid.RowSelectionModel({
+ singleSelect : false
+ }),
+ clicksToEdit: 1//设置点击几次才可编辑
+ })
+
+ var invoiceSignAbnormal_form = new top.Ext.FormPanel({
+ id : 'invoiceSignAbnormal_form',
+ frame : true,
+ region:'east',
+ columnWidth :.20,
+ labelSeparator : ':',
+ bodyStyle : 'padding:5px 5px 0px 5px',
+ width : 590,
+ height : top.screen.height > 800 ? 580 : 480,
+ autoScroll : true,
+ labelAlign:'right',
+ collapsible: true,
+ stateful: false,
+ collapsed: true,
+ title: '异常物品列表',
+ layout : 'form',
+ items : [ invoiceSignAbnormalDetail ]
+ });
+ invoiceSignGoodsWin = new top.Ext.Window({
+ id : 'invoiceSignGoodsWin',
+ layout : 'border',
+ title : '签收物品',
+ resizable: false,
+ width : 1000,
+ height : top.screen.height > 800 ? 660 : 520,
+ border : false,
+ modal : true,
+ plain : true,
+ stateful: false,
+ items : [form,invoiceSignAbnormal_form],
+ listeners:{
+ beforeclose:function(){
+ //异常物品处理完毕与否
+ var abnormalGoodsNum = top.Ext.getCmp('invoiceSignAbnormalDetailGoods').getStore().data.keys;
+ if(abnormalGoodsNum.length > 0){
+ showResult('请先处理签收扫描的异常物品' , null ,sstsConfig.messagePauseTimeOnInvoiceplanPage);
+ return false;
+ }
+ }
+ }
+ });
+
+ invoiceSignGoodsWin.on('close',function(w){
+ signRecordId = 0;
+ grid.dwrReload();//刷新签收记录列表
+ });
+
+ invoiceSignGoodsWin.show();
+ top.Ext.getCmp('scanText').focus(false,100);
+
+}
+function closeinvoiceSignGoodsWindow(){
+ //异常物品处理完毕与否
+ var abnormalGoodsNum = top.Ext.getCmp('invoiceSignAbnormalDetailGoods').getStore().data.keys;
+ if(abnormalGoodsNum.length > 0){
+ showResult('请先处理签收扫描的异常物品' , null ,sstsConfig.messagePauseTimeOnInvoiceplanPage);
+ return false;
+ }
+ invoiceSignGoodsWin.close();
+ signRecordId = 0;
+ grid.dwrReload();//刷新签收记录列表
+}
\ No newline at end of file
Index: ssts-web/src/main/webapp/homepage/portalPage.js
===================================================================
diff -u -r26799 -r26923
--- ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 26799)
+++ ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 26923)
@@ -845,6 +845,16 @@
return returnContent;
}
+ //如果当前图标是物品签收2,配置的是1或者未配置,隐藏图标
+ if(itemId == 'goodsReceiptVersion2' && (sstsConfig.signModuleVersion == 1 || !sstsConfig.signModuleVersion)){
+ return returnContent;
+ }
+
+ //如果当前图标是物品签收1,配置的是2,隐藏图标
+ if(itemId == 'goodsReceipt' && (sstsConfig.signModuleVersion == 2)){
+ return returnContent;
+ }
+
if(itemId != 'packing' && itemId != 'reviewPacking' && itemId !='sterilizationRecord'){
//region 只有临床用户且配了版本2或者3才能看到科室申领版本2或者3的图标还有申请单图标
//如果当前图标是科室申领的时候,如果该用户是临床科室且配了版本2或者3,隐藏该图标
Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignVersion2.jsp
===================================================================
diff -u
--- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignVersion2.jsp (revision 0)
+++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignVersion2.jsp (revision 26923)
@@ -0,0 +1,52 @@
+<%@page import="java.util.Collections"%>
+<%@page import="org.apache.velocity.runtime.directive.Foreach"%>
+<%@page import="net.sf.json.JSONArray"%>
+<%@ page contentType="text/html; charset=UTF-8"%>
+<%@ include file="/common/taglibs.jsp"%>
+<%@ include file="/common/includeExtJsAndCss.jsp"%>
+<%@ include file="/common/includeExtJs4_2.jsp"%>
+
+
+ + | +