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"%> + + + +物品签收 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + +
+ + Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js =================================================================== diff -u -r26412 -r26923 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 26412) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 26923) @@ -1869,6 +1869,7 @@ {header : "住院号",width : 70,dataIndex : 'hospitalNumber'}, {header : "签收人",width : 70,dataIndex : 'receiptor'}, {header : "签收时间",width : 120,dataIndex : 'receiptingTime',renderer : myDateFormatByMinute}, + {header : "签收状态",width : 100,dataIndex : 'signStatus'}, {header : "结算科室",width : 100,dataIndex : 'settleAccountsDepart'}, {header : "仓库",width : 100,dataIndex : 'warehouseName',id : 'warehouseName'}, {header : "总价",width : 70,dataIndex : 'totalPrice',align : 'right',renderer : formartPrice} @@ -1896,6 +1897,7 @@ {name : 'invoicePlan'}, {name : 'receiptor'}, {name : 'receiptingTime'}, + {name : 'signStatus'}, {name : 'personInCharge'}, {name : 'warehouseName'}, {name : 'applicant'}, @@ -1916,7 +1918,8 @@ {type : 'string',dataIndex : 'invoicePlanType'}, {type : 'numeric',dataIndex : 'totalPrice'}, {type : 'string',dataIndex : 'hospitalNumber'}, - {type : 'string',dataIndex : 'remark'} + {type : 'string',dataIndex : 'remark'}, + {type: 'list',dataIndex:'signStatus', phpMode:true ,options:receiptingStatusArr} ] }); Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.jsp =================================================================== diff -u -r26393 -r26923 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.jsp (.../invoiceView.jsp) (revision 26393) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.jsp (.../invoiceView.jsp) (revision 26923) @@ -91,9 +91,12 @@ SSTS_Invoice_updateTime = false; var today = '<%=request.getAttribute("today")%>'; +//签收状态数组 +var receiptingStatusArr = new Array(); +receiptingStatusArr.push('<%=Invoice.SIGNSTATUS_UNSIGNED%>'); +receiptingStatusArr.push('<%=Invoice.SIGNSTATUS_PARTSIGNED%>'); +receiptingStatusArr.push('<%=Invoice.SIGNSTATUS_SIGNED%>'); - - Index: ssts-web/src/main/resources/systemset/portalPage.xml =================================================================== diff -u -r26799 -r26923 --- ssts-web/src/main/resources/systemset/portalPage.xml (.../portalPage.xml) (revision 26799) +++ ssts-web/src/main/resources/systemset/portalPage.xml (.../portalPage.xml) (revision 26923) @@ -21,6 +21,7 @@ + Index: ssts-web/src/main/webapp/disinfectsystem/config/ggsrmyy/config.js =================================================================== diff -u -r26898 -r26923 --- ssts-web/src/main/webapp/disinfectsystem/config/ggsrmyy/config.js (.../config.js) (revision 26898) +++ ssts-web/src/main/webapp/disinfectsystem/config/ggsrmyy/config.js (.../config.js) (revision 26923) @@ -229,5 +229,9 @@ //核算月报报表科室下拉框格式 patternOfAccountingMonthlyReport : [{'optionText':'隐藏数量统计','reportName':'隐藏数量的核算月报'} ,{'optionText':'显示数量','reportName':'显示数量的核算月报'} - ,{'optionText':'按一次性物品类型分组统计','reportName':'按一次性物品类型分组统计的核算月报'}] + ,{'optionText':'按一次性物品类型分组统计','reportName':'按一次性物品类型分组统计的核算月报'}], + //本配置项控制PC端签收模块的版本,PC端签收模块有2个版本,没有配置或者值为1:第一个版本,值为2:第二个版本,具有待签收物品列表的版本 + signModuleVersion:2, + //本配置项控制PDA按器械包进行科室签收的版本。 没有配置或者值为1:PDA端,科室签收模块,选择或进入按器械包签收,功能采用第1个版本,即采用原来的版本 值为2:PDA端,科室签收模块,选择或进入按器械包签收,功能采用第2个版本 + departmentSignByTousseVersionForPDA:2 } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignViewVersion2.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignViewVersion2.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceSignViewVersion2.js (revision 26923) @@ -0,0 +1,245 @@ +var grid; +var invoiceSignDetailStore; +var goodsNameTotalStore; +var invoiceSignRecordId = null; + +function queryInvoiceSignRecord(){ + var startDate = Ext.getCmp('startDate').getRawValue(); + var endDate = Ext.getCmp('endDate').getRawValue(); + + if(startDate || endDate){ + if(!compareDate(startDate,endDate)){ + showResult("开始时间不能大于结束时间"); + return; + } + } + + $Id('parm_s_startDate').value = startDate; + $Id('parm_s_endDate').value = endDate; + grid.dwrReload(); +} +/** + * 修改记录 + * modifyRecord函数 触发modify函数调用,并传入当前列的值以及record.data对象 + * 页面中需要定义 modify(v,data) 函数 + */ +var loadFormData = function(grid) { + var records = grid.getSelectionModel().getSelections(); + + invoiceSignRecordId = records[0].data['id']; + invoiceSignDetailStore.removeAll(); + invoiceSignDetailStore.load(); + + goodsNameTotalStore.removeAll(); + goodsNameTotalStore.load(); +}; +function modify(v,data){ + loadFormData(grid); +} + +Ext.onReady(function() { + Ext4.tip.QuickTipManager.init(); + var readerDetail = [ + {name : 'id'}, + {name : 'signUserName'}, + {name : 'signAmount'}, + {name : 'signDate'}, + {name : 'signUserCode'}, + {name : 'departCode'} + ]; + var columns = [ + {header : "签收人",width : 150,dataIndex : 'signUserName',renderer : function(v,p,record){ + return modifyRecord(v,p,record); + } + }, + {header : "签收数量",width : 100,dataIndex : 'signAmount',menuDisabled : true,sortable: false}, + {header : "签收时间",width : 150,dataIndex : 'signDate',id:"signDate"} + ]; + var filters = new Ext.grid.GridFilters({ + filters : [ + {type : 'string',dataIndex : 'signUserName'}, + {type : 'date',dataIndex : 'signDate'} + ] + }); + grid = new Ext.ux.ForgonPageGrid({ + pageSize : 20, + defaultSortField : 'id', + defaultSortDirection : 'DESC', + //isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : false, + columns : columns, + autoExpandColumn : 'signDate', + renderTo : 'gridDiv', + frame : false, + title:"签收记录列表", + plugins : filters + }, readerDetail, + SignRecordTableManager.findSignRecordTableList, + null + ) + + //签收明细 + invoiceSignDetailStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/signRecordAction!getTousseInstanceBySignRecordId.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + }, [ + {name : 'tousseName'}, + {name : 'barcode'}, + {name : 'amount'} + ]) + }); + invoiceSignDetailStore.on("beforeload", function(thiz, options) { + thiz.baseParams["signRecordId"] = invoiceSignRecordId; + }); + + + var invoiceSignDetailStoreCm = new Ext.grid.ColumnModel([ + {header : "物品名称",dataIndex : 'tousseName',width : 180}, + {header : "器械包条码",dataIndex :'barcode',width : 100}, + {header : "数量",dataIndex : 'amount',width : 50, menuDisabled: true,id:"amount"} + ]); + + var centerGrid = new Ext.grid.EditorGridPanel({ + id : 'invoiceSignDetail', + title : '签收明细', + store : invoiceSignDetailStore, + cm : invoiceSignDetailStoreCm, + enableHdMenu : false, + width :423, + height :425, + loadMask : true, + autoExpandColumn : 'amount', + frame : false, + enableKeyEvents: true, + bodyStyle : 'border:1px solid #afd7af', + viewConfig: { + forceFit:true + } + }); + // 物品名称统计 + goodsNameTotalStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/signRecordAction!getSignRecordTousseNameAndAmount.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + }, [ + {name : 'tousseName'}, + {name : 'amount'} + ]) + }); + goodsNameTotalStore.on("beforeload", function(thiz, options) { + thiz.baseParams["signRecordId"] = invoiceSignRecordId; + }); + + var goodsNameTotalCm = new Ext.grid.ColumnModel([ + {header : "物品名称",dataIndex : 'tousseName',width : 180,menuDisabled: true}, + {header : "数量",dataIndex : 'amount',width : 50, menuDisabled: true,id:"amount"} + ]); + + var rightGrid = new Ext.grid.EditorGridPanel({ + id : 'goodsNameTotal', + title : '物品名称统计', + store : goodsNameTotalStore, + cm : goodsNameTotalCm, + enableHdMenu : false, + width :423, + height :425, + loadMask : true, + autoExpandColumn : 'amount', + frame : false, + enableKeyEvents: true, + bodyStyle : 'border:1px solid #afd7af', + viewConfig: { + forceFit:true + } + }); + var viewport = new Ext.Viewport({ + layout:'border', + items:[{ + id:'container_panel', + region:'center', + margins:'0 5 5 0', + xtype : 'panel', + autoScroll:true, + layout:'border', + items: [{ + region: 'west', + xtype : 'panel', + layout: 'fit', + width: "35%", + autoScroll:true, + items:grid + },{ + region:'center', + xtype : 'panel', + layout: 'fit', + width: "35%", + items:centerGrid + },{ + region:'east', + xtype : 'panel', + layout: 'fit', + width: "30%", + items:rightGrid + }], + tbar : [{ + text : '签收物品', + iconCls : 'btn_ext_application_add', + handler : function() { + addInvoiceSignGoods(); + } + }], + listeners: { + render : function() { + var tbar2 = new Ext.Toolbar ({ + items : [{ + text : '开始日期:' + },{ + xtype :'datefield', + fieldLabel : '开始日期', + name : 'startDate', + format :'Y-m-d', + id : 'startDate', + readOnly : false, + editable : false, + //value: new Date(), + width :200 + },{ + text : '结束日期:' + },{ + xtype :'datefield', + fieldLabel : '结束日期', + name : 'endDate', + id : 'endDate', + readOnly : false, + editable : false, + format :'Y-m-d', + //value: new Date(), + width :200 + },{ + xtype : 'button', + text : '查询', + minWidth : 70, + iconCls : 'icon_search', + handler : function() { + queryInvoiceSignRecord(); + } + } + ] + }); + var c = Ext.getCmp('container_panel'); + tbar2.render(c.tbar); + } + } + }] + }); +}); + +