Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/expensivegoodsapplication/action/ExpensiveGoodsApplicationAction.java =================================================================== diff -u -r22243 -r22307 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/expensivegoodsapplication/action/ExpensiveGoodsApplicationAction.java (.../ExpensiveGoodsApplicationAction.java) (revision 22243) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/expensivegoodsapplication/action/ExpensiveGoodsApplicationAction.java (.../ExpensiveGoodsApplicationAction.java) (revision 22307) @@ -12,14 +12,19 @@ import org.apache.struts2.convention.annotation.ParentPackage; import com.forgon.disinfectsystem.entity.expensivegoodsapplication.ExpensiveGoodsApplication; +import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.expensivegoodsapplication.service.ExpensiveGoodsApplicationManager; +import com.forgon.entity.ExtJsEntity; import com.forgon.tools.StrutsParamUtils; import com.forgon.tools.StrutsResponseUtils; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.json.JSONUtil; import com.forgon.tools.string.StringTools; +import com.forgon.tools.util.ExtJsUtil; import com.forgon.tools.util.ForgonDateUtils; +import com.forgon.util.ExtGridUtils; +import com.forgon.workflow.model.NodeDefinition; import com.forgon.workflow.model.WorkFlowApprovalTask; import com.forgon.workflow.vo.WorkFlowApprovalTaskVO; import com.opensymphony.xwork2.ModelDriven; @@ -34,12 +39,15 @@ @Action(value = "expensiveGoodsApplicationAction") public class ExpensiveGoodsApplicationAction implements Preparable, ModelDriven{ - - private ExpensiveGoodsApplication expensiveGoodsApplication; + private ExpensiveGoodsApplication expensiveGoodsApplication; + private ExtGridUtils extGridUtils; private ExpensiveGoodsApplicationManager expensiveGoodsApplicationManager; - + public void setExtGridUtils(ExtGridUtils extGridUtils) { + this.extGridUtils = extGridUtils; + } + public void setExpensiveGoodsApplicationManager( ExpensiveGoodsApplicationManager expensiveGoodsApplicationManager) { this.expensiveGoodsApplicationManager = expensiveGoodsApplicationManager; @@ -61,6 +69,18 @@ } /** + * 加载高值耗材申请单 + */ + public void loadExpensiveGoodsApplicationList() { + String select = "select ip.id,ip.serialNumber,ip.depart,ip.settleAccountsDepart,ip.applicant,ip.applicationTime,ip.committedStatus,ip.deliverStatus,ip.remark "; + String where = String.format("from ExpensiveGoodsApplication ega join InvoicePlan ip on ip.id=ega.id where 1=1"); + ExtJsEntity entity = ExtJsUtil.buildSQLEntity(select, where, ""); + JSONObject result = extGridUtils.getPagedResult(entity); + StrutsResponseUtils.output(result); + } + + + /** * 保存或者修改高值耗材申请单. */ public void saveOrUpdateExpensiveGoodsApplication() { @@ -186,11 +206,14 @@ if (CollectionUtils.isNotEmpty(applicationItems)) { for (TousseItem tousseItem : applicationItems) { JSONObject item = new JSONObject(); + item.put("nodeId", String.format("%s-%s", tousseItem.getExpensiveGoodsId(), tousseItem.getExpensiveGoodsModelId())); //节点id用于标识此节点的唯一 item.put("id", tousseItem.getId()); item.put("amount", tousseItem.getAmount()); item.put("expensiveGoodsId", tousseItem.getExpensiveGoodsId()); item.put("showName", tousseItem.getTousseName()); item.put("supplierName", tousseItem.getSupplierName()); + item.put("expensiveGoodsModelId", tousseItem.getExpensiveGoodsModelId()); //高值耗材型号id + item.put("expensiveGoodsModelName", tousseItem.getExpensiveGoodsModelName()); //高值耗材型号名称 item.put("referencePrice", tousseItem.getPrice()); items.add(item); } Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r22295 -r22307 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 22295) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 22307) @@ -335,6 +335,7 @@ {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_ExpensiveGoods_Hidden_Menu,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}, {hidden :SSTS_ExpensiveGoods_Hidden_Menu || SSTS_ExpensiveGoodsPurchaseGodownEntry_Hidden_Manager,text:"高值耗材自购入库单管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsGodownEntryView.jsp?entryType=' + entryTypePurchase,hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoods_Hidden_Menu || SSTS_ExpensiveGoodsPrepareGodownEntry_Hidden_Manager,text:"高值耗材预入库单管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsGodownEntryView.jsp?entryType=' + entryTypePrepareIn,hrefTarget:linkTarget,leaf:true}, Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationFormForApproval.js =================================================================== diff -u -r22166 -r22307 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationFormForApproval.js (.../expensiveGoodsApplicationFormForApproval.js) (revision 22166) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationFormForApproval.js (.../expensiveGoodsApplicationFormForApproval.js) (revision 22307) @@ -1,662 +1,4 @@ -var formObj = null; -//高值耗材的store -var expensiveGoodsStore = null; -//高值耗材申请项Ext4.tree.Panel的数据仓库 -var treePanelStore = null; - - Ext4.onReady(function() { eidtExpensiveGoodsApplicationForApproval(expensiveGoodsApplicationId, allowChanges); }); - -/** - * 审批高值耗材申请单时对申请单的修改. - * @param id 高值耗材申请单id - * @param allowChanges 允许修改 - */ -function eidtExpensiveGoodsApplicationForApproval(id, allowChanges) { - if (!id) { - showResult('高值耗材申请单id不能为空!'); - return false; - } - //是否不允许修改 - var notAllowChanges = !allowChanges; - - /** - * 申请的物品模型 - */ - Ext4.define('ExpensiveGoodsModel', { - extend : 'Ext4.data.Model', - idProperty: 'expensiveGoodsId', //指定id属性 - fields: [ - {name : 'id'}, //申请项的id - {name : 'amount'}, //申请项的数量 - {name : 'expensiveGoodsId'}, //高值耗材id - {name : 'showName'}, //高值耗材的显示名称(即:名称[规格]) - {name : 'name'}, //高值耗材的名称 - {name : 'specification'}, //高值耗材的规格 - {name : 'supplierName'}, //高值耗材的生产厂家 - {name : 'referencePrice'} //高值耗材的参考价 - ]}); - - expensiveGoodsStore = new Ext4.data.Store({ - pageSize: 100, - fields: [ - {name : 'id'}, //高值耗材id - {name : 'showName'}, //高值耗材的显示名称(即:名称[规格]) - {name : 'name'}, //高值耗材的名称 - {name : 'specification'}, //高值耗材的规格 - {name : 'referencePrice'} //高值耗材的参考价 - ], - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!searchExpensiveGoods.do', - reader : { - type : 'json', - totalProperty : 'totalCount', - root : 'data' - } - }, - listeners: { - beforeload : function(store, operation, eOpts){ - var rawValue = Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); - var value = Ext4.getCmp('expensiveGoodsSupplier').getValue(); - if (rawValue && value) { - store.proxy.extraParams.supplierId = value; - } else { - showResult('请先选择生产厂家!'); - return false; - } - } - } - }); - - //高值耗材生产厂家的store - var expensiveGoodsSupplierStore = new Ext4.data.Store({ - fields: [ - {name : 'id'}, //高值耗材生产厂家的id - {name : 'name'} //高值耗材生产厂家的名称 - ], - proxy : { - extraParams : {supplierType : '生产厂家'}, - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierData.do', - reader : { - type : 'json', - totalProperty : 'totalCount', - root : 'data' - } - } - }); - - /** - * 常用医生的store - */ - var commonlyUsedDoctorJsonStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/commonlyUsedDoctorAction!getDoctorBykeyWord.do', - reader : { - type : 'json', - root : 'data' - } - }, - fields : [{name : 'id',mapping : 'id'}, - {name : 'doctor',mapping : 'doctor'} - ] - }); - - treePanelStore = Ext4.create('Ext4.data.TreeStore', { - autoLoad : true, - clearOnLoad : true, - model : 'ExpensiveGoodsModel', - proxy : { - type : 'memory', - reader : { - type : 'json', - root : 'children' - } - } - }); - - /** - * 高值耗材申请项Ext4.tree.Panel - */ - Ext4.define('expensiveGoodsApplicationTreeGrid', { - extend: 'Ext4.tree.Panel', - xtype: 'tree-grid', - useArrows: true, - rootVisible: false, - multiSelect: false, - columnLines: true, - rowLines: true, - cls: 'no-leaf-icons', - columns : [{ - dataIndex: 'id', hidden: true - },{ - dataIndex: 'expensiveGoodsId', hidden: true - },{ - dataIndex: 'name', hidden: true - },{ - dataIndex: 'specification', hidden: true - },{ - header: '生产厂家',dataIndex: 'supplierName', width: 200 - },{ - header: '名称', dataIndex: 'showName', width: 250 - },{ - header: '申请数量', dataIndex : 'amount', width: 100, align: 'center', sortable: false, - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - maxValue: 9999, - listeners: { - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - //阻止按Tab,因为这里的CellEditing按了tab会有bug - event.stopEvent(); - } - } - }, - readOnly: notAllowChanges - } - },{ - header: '价格',dataIndex: 'referencePrice', width: 70 - }], - viewConfig : { - toggleOnDblClick: false, - markDirty:false - }, - initComponent: function() { - this.cellEditing = new Ext4.grid.plugin.CellEditing({ - clicksToEdit: 2, - listeners: { - beforeedit: function(editor, context, eOpts){ - var record = context.record; - - }, - edit:function(editor, context, eOpts){ - - } - } - }); - Ext4.apply(this, { - plugins: [this.cellEditing] - }); - this.superclass.initComponent.call(this); - } - }); - - formObj = Ext4.create('Ext4.form.Panel', { - //title: '高值耗材申请单', - width : 990, - height : 425, - frame : true, - renderTo: Ext4.getBody(), - border : 0, - labelSeparator : ':', - bodyPadding : '5 5 0', - autoScroll : true, - buttonAlign : 'center', - fieldDefaults : { - labelAlign : 'right' - }, - items : [ - {xtype: 'hidden', name: 'id', id : 'id', value: id}, - {xtype: 'hidden', name: 'tousseItems', id : 'tousseItems'}, - - { - xtype: 'fieldset', - title: '基本信息', - layout: 'column', - width: '100%', - height: 195, - items: [{ - xtype : 'textfield', - fieldLabel : '流水号', - maxLength : '41', - id : 'serialNumber', - name : 'serialNumber', - allowBlank : true, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - },{ - xtype : 'textfield', - fieldLabel : '申请人', - maxLength : '255', - id : 'applicant', - name : 'applicant', - allowBlank : false, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - },{ - xtype : 'textfield', - fieldLabel : '时间', - id : 'applicationTimeStr', - name : 'applicationTimeStr', - allowBlank : false, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - },{ - xtype : 'textfield', - fieldLabel : '申请科室', - id : 'depart', - name : 'depart', - allowBlank : false, - readOnly : true - },{ - xtype : 'textfield', - fieldLabel : '结算科室', - id : 'settleAccountsDepart', - name : 'settleAccountsDepart', - allowBlank : false, - readOnly : true - },{ - xtype : 'textfield', - fieldLabel : '处理科室', - id : 'handleDepart', - name : 'handleDepart', - allowBlank : false, - readOnly : true - },{ - xtype : 'textfield', - fieldLabel : '住院号', - id : 'hospitalNumber', - name : 'hospitalNumber', - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '诊疗号', - id : 'clinicNumber', - name : 'clinicNumber', - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '病人姓名', - id : 'patient', - name : 'patient', - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '病区', - maxLength : '50', - id : 'patientArea', - name : 'patientArea', - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '病室', - maxLength : '50', - id : 'roomNumber', - name : 'roomNumber', - hidden : sstsConfig.hideRoomNumber, - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '床位', - maxLength : '50', - id : 'bedNumber', - name : 'bedNumber', - hidden : sstsConfig.hideRoomNumber, - readOnly : notAllowChanges - },{ - xtype : 'numberfield', - id : 'patientAge', - name : 'patientAge', - fieldLabel : '年龄', - maxValue: 255, - minValue: 1, - allowNegative : false, - allowDecimals : false, - readOnly: notAllowChanges - },{ - xtype : 'combo', - fieldLabel : '性别', - valueField : 'typeName', - displayField : 'typeName', - id : 'patientSex', - name : 'patientSex', - mode : 'local', - triggerAction : 'all', - forceSelection : true, - editable : false, - store : new Ext4.data.SimpleStore({ - fields : ['typeName'], - data : [['男'],['女']] - }), - readOnly: notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '病人所属科室', - maxLength : '16', - id : 'ascriptionDepartment', - name : 'ascriptionDepartment', - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '手术名称', - id : 'surgery', - name : 'surgery', - readOnly : notAllowChanges - },{ - xtype : 'datefield', - fieldLabel : '手术时间', - id : 'operationTime', - name : 'operationTime', - selectOnFocus :true, - format : 'Y-m-d H:i', - readOnly : notAllowChanges - },{ - fieldLabel : '医生', - xtype : 'combo', - id : 'doctor', - name : 'doctor', - flex : 1, - queryParam : 'spell', - minChars : 0, - displayField : 'doctor', - listConfig: {width: 300}, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : true, - forceSelection:false, - store : commonlyUsedDoctorJsonStore, - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '手术间', - id : 'operationRoom', - name : 'operationRoom', - readOnly : notAllowChanges - },{ - xtype : 'textfield', - fieldLabel : '外来器械包名称', - id : 'foreignTousseName', - name : 'foreignTousseName', - readOnly : notAllowChanges - },{ - xtype : 'textfield', - width: 760, - fieldLabel : '备注', - id : 'remark', - name : 'remark', - readOnly : notAllowChanges - }] - },{ - xtype: 'container', - width: '100%', - height: 170, - layout: 'fit', - items: { - xtype : 'tree-grid', - store : treePanelStore, - tbar:[{ - text: "生产厂家:", - hidden: notAllowChanges - },{ - xtype: 'combo', - id : 'expensiveGoodsSupplier', - name : 'expensiveGoodsSupplier', - queryParam : 'supplierName', - minChars : 0, - valueField : 'id', - displayField : 'name', - matchFieldWidth: false, - width : 200, - listConfig: {width : 200}, - store : expensiveGoodsSupplierStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - listeners: { - select: function(combo, records, index) { - expensiveGoodsStore.load(); - Ext4.getCmp('expensiveGoods').setValue(''); - } - }, - hidden: notAllowChanges - },{ - text: "物品名称:", - hidden: notAllowChanges - },{ - xtype: 'combo', - id : 'expensiveGoods', - name : 'expensiveGoods', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'showName', - matchFieldWidth: false, - width : 300, - listConfig: {width : 300}, - store : expensiveGoodsStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - pageSize:100, - listeners: { - focus: function(thiz, the, eOpts) { - var rawValue = Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); - if (!rawValue) { - showResult('请先选择生产厂家!'); - Ext4.getCmp('expensiveGoodsSupplier').focus(); - } - } - }, - hidden: notAllowChanges - },{ - text:"数量:", - hidden: notAllowChanges - },{ - xtype : 'numberfield', - id : 'amount', - name : 'amount', - style : 'text-align: left', - width : 60, - maxValue: 9999, - minValue: 1, - allowNegative : false, - allowDecimals : false, - listeners : { - specialkey : function(field, ee) { - if (ee.getKey() == Ext4.EventObject.ENTER) { - addExpensiveGoods(); - } - } - }, - hidden: notAllowChanges - },{ - xtype:'button', - id : 'addTousseBt', - iconCls : 'icon-add2', - handler : function() { - addExpensiveGoods(); - }, - hidden: notAllowChanges - }] - } - }] -// , //此按钮测试可以打开 -// buttons : [{ -// id : 'saveBtn', -// text : '提交', -// handler : function() { -// updateExpensiveGoodsApplicationByPass(); -// } -// }] - }); - - if (id) { - formObj.form.load({ - url : WWWROOT + '/disinfectSystem/expensivegoodsapplication/expensiveGoodsApplicationAction!loadExpensiveGoodsApplication.do', - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - success : function(form, action) { - var data = action.result.data; - - //1、“手术时间” - var operationTime = data.operationTime; - if(operationTime){ - Ext4.getCmp("operationTime").setValue(operationTime); - } - - //2、设置申请项 - treePanelStore.proxy.data = {children: data.tousseItems}; - treePanelStore.load(); - }, - params : { - id : id - } - }); - } - -} - -/** - * 添加高值耗材到申请物品列表. - * @returns {Boolean} - */ -function addExpensiveGoods() { - var amount = Ext4.getCmp('amount').getValue(); - var id = Ext4.getCmp('expensiveGoods').getValue(); - var showName = Ext4.getCmp('expensiveGoods').getRawValue(); - var expensiveGoodsSupplier = Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); - - //1、先校验物品和数量 - if (!id || !showName) { - showResult('请选择要添加的物品!'); - return false; - } - if (!expensiveGoodsSupplier) { - showResult('物品的生产厂家不能为空!'); - return false; - } - - if (isNaN(amount) || amount <= 0) { - showResult('申请数量必须大于0!'); - return false; - } - - //2、如果申请列表已经存在此物则提示“此物已经存在!”(即:同一种物品并且数量大于0) - var findNode = treePanelStore.getNodeById(id); - if (findNode && findNode.get('amount')) { - showResult('此物已经存在!'); - return false; - } else { - if (findNode) { - findNode.set('amount', amount); - } else { - var selectRecord = expensiveGoodsStore.findRecord('id', id); - var node = Ext4.create('ExpensiveGoodsModel', { - id : 0, - amount: amount, - expensiveGoodsId : selectRecord.get('id'), - showName : selectRecord.get('showName'), - name : selectRecord.get('name'), - specification : selectRecord.get('specification'), - supplierName : expensiveGoodsSupplier, - referencePrice : selectRecord.get('referencePrice') - }); - treePanelStore.getRootNode().appendChild(node); - } - Ext4.getCmp('expensiveGoodsSupplier').setValue(); - Ext4.getCmp('expensiveGoods').setValue(); - Ext4.getCmp('amount').setValue(); - } -} - - -/** - * 设置申请项信息. - * @param treeStore - * @returns {Boolean} 申请项为空则返回false,否则返回true - */ -function setApplyItems(){ - var nodes = treePanelStore.getRootNode().childNodes; - - var items = []; - for (var i=0; i 0) { - var item = { - id: node.get('id'), - amount: node.get('amount'), - expensiveGoodsId: node.get('expensiveGoodsId'), - showName: node.get('showName'), - name: node.get('name'), - specification: node.get('specification'), - supplierName : node.get('supplierName'), - referencePrice : node.get('referencePrice') - }; - items.push(item); - } - } - - if (items.length > 0) { - Ext4.getCmp('tousseItems').setValue(JSON.stringify(items)); - return true; - } else { - return false; - } -} - - -/** - * 流程审批(审批通过、审批不通过、回退、提交、起单人的知会操作) - * @param workFlowApprovalTaskVO 流程处理的一些参数对象 - */ -function updateExpensiveGoodsApplicationByApproval(workFlowApprovalTaskVO) { - var result = {}; - if (!formObj.getForm().isValid()) { - return {success:false,message:'请正确填写表单各值!'}; - } - //设置申请项信息 - if (setApplyItems()) { - Ext4.Ajax.request({ - async: false, - url : WWWROOT + '/disinfectSystem/expensivegoodsapplication/expensiveGoodsApplicationAction!updateExpensiveGoodsApplicationForApproval.do', - method : 'POST', - params: { - workFlowApprovalTaskVO: JSON.stringify(workFlowApprovalTaskVO), - id: Ext4.getCmp('id').getValue(), - hospitalNumber: Ext4.getCmp('hospitalNumber').getValue(), - clinicNumber: Ext4.getCmp('clinicNumber').getValue(), - patient: Ext4.getCmp('patient').getValue(), - patientArea: Ext4.getCmp('patientArea').getValue(), - roomNumber: Ext4.getCmp('roomNumber').getValue(), - bedNumber: Ext4.getCmp('bedNumber').getValue(), - patientAge: Ext4.getCmp('patientAge').getValue(), - patientSex: Ext4.getCmp('patientSex').getValue(), - ascriptionDepartment: Ext4.getCmp('ascriptionDepartment').getValue(), - surgery: Ext4.getCmp('surgery').getValue(), - operationTime: Ext4.getCmp('operationTime').getValue(), - doctor: Ext4.getCmp('doctor').getValue(), - operationRoom: Ext4.getCmp('operationRoom').getValue(), - foreignTousseName: Ext4.getCmp('foreignTousseName').getValue(), - remark: Ext4.getCmp('remark').getValue(), - tousseItems: Ext4.getCmp('tousseItems').getValue() - }, - success : function(response, options) { - result = Ext4.JSON.decode(response.responseText); - }, - failure : function(response, options) { - result = Ext4.JSON.decode(response.responseText); - //result = {success:false,message:'审批失败!'}; - } - }); - } else { - result = {success:false,message:'请填写申请的物品!'}; - } - return result; -} Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationView.js (revision 22307) @@ -0,0 +1,100 @@ +var grid = null; +var entityName = '高值耗材申请单列表'; + +/** + * 重新渲染时间字段. + * @param value + * @param metaData + * @param record + * @param rowIndex + * @param colIndex + * @param store + * @param view + * @returns + */ +function rendererTime(value, metaData, record, rowIndex, colIndex, store, view) { + if (value) { + return Ext4.Date.format(new Date(value.time), 'Y-m-d H:i:s'); + } else { + return ''; + } +} + + + +Ext4.onReady(function() { + var columns = [{ + header: '流水号', dataIndex: 'serialNumber', width: 100, filterable: true, filter: {type: 'string'}, + renderer : function(value, metaData, record, rowIndex, colIndex, store, view) { + var id = record.data.id; + return "" + value + ""; + } + },{ + header: '申请科室', dataIndex: 'depart', width: 150, filterable: true, filter: {type: 'string'} + },{ + header: '结算科室', dataIndex: 'settleAccountsDepart', width: 150, filterable: true, filter: {type: 'string'} + },{ + header: '申请人', dataIndex: 'applicant', width: 70, filterable: true, filter: {type: 'string'} + },{ + header: '申请时间', dataIndex: 'applicationTime', width: 150, filterable: true, filter: {type: 'date'}, renderer: rendererTime + },{ + header: '已提交', dataIndex: 'committedStatus', width: 50, renderer: function(value, metaData, record, rowIndex, colIndex, store, view) { + var color = ""; + var status = '否'; + if(value){ + status = "是"; + }else{ + color = "#A5A8AB"; + } + return "

" + status + "

"; + } + },{ + header: '发货状态', dataIndex: 'deliverStatus', width: 70, filterable: true, filter: {type: 'string'} + },{ + header: '备注', dataIndex: 'remark', width: 300, filterable: true, filter: {type: 'string'} + }]; + + var fields = [{ + name : 'serialNumber', mapping : 'serialNumber' + },{ + name : 'depart', mapping : 'depart' + },{ + name : 'settleAccountsDepart', mapping : 'settleAccountsDepart' + },{ + name : 'applicant', mapping : 'applicant' + },{ + name : 'applicationTime', mapping : 'applicationTime' + },{ + name : 'committedStatus', mapping : 'committedStatus' + },{ + name : 'deliverStatus', mapping : 'deliverStatus' + },{ + name : 'remark', mapping : 'remark' + }]; + + var tbar = [{ + text : '添加', + iconCls : 'btn_add', + handler : function() { + addOrEidtExpensiveGoodsApplicationForApply(null); + } + }]; + + grid = Ext4.create('ExtJs.forgon4.Grid', { + title : entityName, + dataUrl : WWWROOT + '/disinfectSystem/expensivegoodsapplication/expensiveGoodsApplicationAction!loadExpensiveGoodsApplicationList.do', + fields : fields, + columns : columns, + tbar: tbar, + sorters : {property : 'id', direction: 'DESC'}, + extraParams : {}, //如果你要自定义参数,这里一定要先给一个空的对象,要不然会报空异常 + showRightClick : false + }); + + var viewport = Ext4.create('Ext4.Viewport', { + layout : 'fit', + items : grid + }); + + +}); \ No newline at end of file Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/expensivegoodsapplication/service/ExpensiveGoodsApplicationManagerImpl.java =================================================================== diff -u -r22282 -r22307 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/expensivegoodsapplication/service/ExpensiveGoodsApplicationManagerImpl.java (.../ExpensiveGoodsApplicationManagerImpl.java) (revision 22282) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/expensivegoodsapplication/service/ExpensiveGoodsApplicationManagerImpl.java (.../ExpensiveGoodsApplicationManagerImpl.java) (revision 22307) @@ -234,6 +234,8 @@ tousseItem.setPrice(jsonObj.optDouble("referencePrice")); //高值耗材的参考价 tousseItem.setTousseType(ExpensiveGoods.TYPE_NAME); tousseItem.setDiposable(com.forgon.Constants.STR_NO); + tousseItem.setExpensiveGoodsModelId(jsonObj.optLong("expensiveGoodsModelId")); //高值耗材型号id + tousseItem.setExpensiveGoodsModelName(jsonObj.optString("expensiveGoodsModelName")); //高值耗材型号名称 tousseItem.setInvoicePlan(expensiveGoodsApplication); tousseItem.setInvoicePlanID(expensiveGoodsApplication.getId()); objectDao.save(tousseItem); Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/tousseitem/TousseItem.java =================================================================== diff -u -r22203 -r22307 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/tousseitem/TousseItem.java (.../TousseItem.java) (revision 22203) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/tousseitem/TousseItem.java (.../TousseItem.java) (revision 22307) @@ -258,7 +258,18 @@ * 高值耗材id */ private Long expensiveGoodsId; + /** + * 高值耗材的型号id(注意:0或者空为无效) + */ + private Long expensiveGoodsModelId; + + /** + * 高值耗材的型号名称 + */ + private String expensiveGoodsModelName; + + /** * 是否快速发货 */ private String expressInvoice; @@ -879,4 +890,21 @@ public void setErrorDamageQmKey(String errorDamageQmKey) { this.errorDamageQmKey = errorDamageQmKey; } + + public Long getExpensiveGoodsModelId() { + return expensiveGoodsModelId; + } + + public void setExpensiveGoodsModelId(Long expensiveGoodsModelId) { + this.expensiveGoodsModelId = expensiveGoodsModelId; + } + + public String getExpensiveGoodsModelName() { + return expensiveGoodsModelName; + } + + public void setExpensiveGoodsModelName(String expensiveGoodsModelName) { + this.expensiveGoodsModelName = expensiveGoodsModelName; + } + } Index: ssts-web/src/main/webapp/systemmanage/workFlow/workFlowApprovalTaskRecord.js =================================================================== diff -u --- ssts-web/src/main/webapp/systemmanage/workFlow/workFlowApprovalTaskRecord.js (revision 0) +++ ssts-web/src/main/webapp/systemmanage/workFlow/workFlowApprovalTaskRecord.js (revision 22307) @@ -0,0 +1,149 @@ +/** + * 重新渲染时间字段. + * @param value + * @param metaData + * @param record + * @param rowIndex + * @param colIndex + * @param store + * @param view + * @returns + */ +function rendererTransitionTime(value, metaData, record, rowIndex, colIndex, store, view) { + if (value) { + return Ext4.Date.format(new Date(value.time), 'Y-m-d H:i:s'); + } else { + return ''; + } +} + +/** + * 重新计算响应时间. + * @param value + * @param metaData + * @param record + * @param rowIndex + * @param colIndex + * @param store + * @param view + * @returns {String} + */ +function rendererResponseTime(value, metaData, record, rowIndex, colIndex, store, view) { + var cTime=record.data['createTaskTime'].time; + var hTime=0; + if(record.data['handleTime']!=null) //得判断,不然少cell + hTime=record.data['handleTime'].time; + + if((typeof(hTime)!="undefined" && hTime!=0)&&(typeof(cTime)!="undefined" && cTime!=0)){ + var responseTimeMinutes= Math.floor(parseInt(hTime - cTime) / 1000 / 60); + var responseTimeHours=Math.floor(parseInt(hTime - cTime) / 1000 / 60 / 60); + var responseTimeDays=Math.floor(parseInt(hTime - cTime) / 1000 / 60 / 60/24); + if(responseTimeDays>0){ + return responseTimeDays+'天'+Math.floor((parseInt(hTime - cTime)-responseTimeDays*1000*60*60*24)/ 1000 / 60 / 60)+'小时'; + } + if(responseTimeHours>0){ + return responseTimeHours+'小时'+Math.floor((parseInt(hTime - cTime)-responseTimeHours*1000*60*60)/ 1000 / 60)+'分钟'; + } + if(responseTimeMinutes==0) + return '1分钟'; + return responseTimeMinutes+'分钟'; + }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 "通知起单人"; + } +} + + + +/** + * 根据申请单的id,创建审批历史记录的grid视图. + * @param formId 申请单id + */ +function createWorkFlowApprovalTaskGrid(formId) { + //审批历史记录grid的store + var workFlowApprovalTaskRecordListStore = Ext4.create('Ext.data.Store',{ + autoLoad : true, + fields: [{ + name: 'id',mapping: 'id' + },{ + name: 'title',mapping: 'title' + },{ + name: 'createTaskTime',mapping: 'createTaskTime' + },{ + name: 'taskName',mapping: 'taskName' + },{ + name: 'handler',mapping: 'handler' + },{ + name: 'handleTime',mapping: 'handleTime' + },{ + name: 'handleOpinion',mapping: 'handleOpinion' + },{ + name: 'approvalResult',mapping: 'approvalResult' + }], + sorters : { + property : 'createTaskTime', + direction : 'ASC' + }, + proxy : { + type : 'ajax', + extraParams : {formId:formId}, + url : WWWROOT+ '/disinfectSystem/workFlowApprovalTaskAction!loadWorkFlowApprovalTaskRecordList.do', + reader : { + root : "rows" + } + } + }); + + var approvalRecordGrid= Ext4.create('Ext.grid.Panel', { +// height: 250, + autoScroll: true, + title: '审批日志', + columnLines: true, + store: workFlowApprovalTaskRecordListStore, + columns: [{ + header: '标题',dataIndex: 'title',width: 250,filterable: true,filter: {type: 'string'} + },{ + header: '任务名称',dataIndex: 'taskName',width: 250,filterable: true,filter: {type: 'string'} + },{ + header: '处理人',dataIndex: 'handler',width: 250,filterable: true,filter: {type: 'string'} + },{ + header: '处理结果',dataIndex: 'approvalResult',width: 250,filterable: true,filter: {type: 'string'},renderer: renderApprovalResult + },{ + header: '处理意见',dataIndex: 'handleOpinion',width: 250,filterable: true,filter: {type: 'string'} + },{ + header: '处理时间',dataIndex: 'handleTime',width: 250,filterable: true,filter: {type: 'date'},renderer: rendererTransitionTime + },{ + header: '创建任务时间',dataIndex: 'createTaskTime',width: 250,filterable: true,filter: {type: 'date'},renderer: rendererTransitionTime + },{ + header: '响应时间',dataIndex: 'createTaskTime',width: 250,filterable: true,filter: {type: 'string'},renderer: rendererResponseTime + }] + }); + return approvalRecordGrid; +} Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationFormForApproval.jsp =================================================================== diff -u -r22040 -r22307 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationFormForApproval.jsp (.../expensiveGoodsApplicationFormForApproval.jsp) (revision 22040) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationFormForApproval.jsp (.../expensiveGoodsApplicationFormForApproval.jsp) (revision 22307) @@ -2,8 +2,7 @@ <%-- 引入JSP标签 --%> <%@include file="/common/taglibs.jsp"%> <%-- 引入ExtJs4.2.5框架 --%> -<%@include file="/common/include_ForgonGrid4.2.5_css.jsp"%> -<%@include file="/common/include_ForgonGrid4.2.5_Js.jsp"%> +<%@include file="/common/include_Ext425JsAndCss.jsp"%> <% request.setAttribute("expensiveGoodsApplicationId", request.getParameter("expensiveGoodsApplicationId")); request.setAttribute("allowChanges", request.getParameter("allowChanges")); @@ -14,6 +13,8 @@ + + + + + + + + + + 高值耗材申请单列表 + + + + + \ No newline at end of file Index: ssts-web/src/main/webapp/systemmanage/workFlow/workFlowApprovalTaskForm.js =================================================================== diff -u -r22303 -r22307 --- ssts-web/src/main/webapp/systemmanage/workFlow/workFlowApprovalTaskForm.js (.../workFlowApprovalTaskForm.js) (revision 22303) +++ ssts-web/src/main/webapp/systemmanage/workFlow/workFlowApprovalTaskForm.js (.../workFlowApprovalTaskForm.js) (revision 22307) @@ -401,6 +401,7 @@ approvalFormObj = Ext4.create('Ext4.form.Panel', { frame : true, + height: 600, border : 0, labelSeparator : ': ', bodyPadding : '5 5 5 5', @@ -447,29 +448,16 @@ labelAlign : 'right', labelWidth : 80 }, - items : - [{ + items :[{ xtype: 'container', width: '100%', - height: 426, + height: 600, layout: 'fit', - items : - new Ext4.Panel( { + items : new Ext4.Panel({ fitToFrame: true, html: '' }) // formIframe - },{ - xtype: 'container', - width: '100%', - height: 250, - layout: 'fit', - items : - new Ext4.Panel( { - fitToFrame: true, - html: '' - }) - //workFlowApprovalTaskRecordIframe }] }); @@ -479,7 +467,7 @@ autoScroll:true, title : '审批信息', width : 1030, - height : 605, + height : 660, resizable : false, modal : true, border : false, Index: forgon-core/src/main/java/com/forgon/workflow/service/WorkFlowManagerImpl.java =================================================================== diff -u -r22294 -r22307 --- forgon-core/src/main/java/com/forgon/workflow/service/WorkFlowManagerImpl.java (.../WorkFlowManagerImpl.java) (revision 22294) +++ forgon-core/src/main/java/com/forgon/workflow/service/WorkFlowManagerImpl.java (.../WorkFlowManagerImpl.java) (revision 22307) @@ -61,6 +61,9 @@ public JSONArray getAllUserByformType(String formType) { NodeDefinition firstNodeDefinition=nodeDefinitionManager.getFirstNodeDefinition(formType); JSONArray jSONArray=new JSONArray(); + if (firstNodeDefinition == null) { + return jSONArray; + } if(firstNodeDefinition.getAllowNoticeFormMan()==true){ LoginUserData user = AcegiHelper.getLoginUser(); JSONObject jSONObject=new JSONObject(); Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationForm.js =================================================================== diff -u -r22282 -r22307 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationForm.js (.../expensiveGoodsApplicationForm.js) (revision 22282) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationForm.js (.../expensiveGoodsApplicationForm.js) (revision 22307) @@ -1,16 +1,36 @@ -var windowObj = null; -var formObj = null; //高值耗材的store var expensiveGoodsStore = null; -//高值耗材申请项top.Ext4.tree.Panel的数据仓库 +//高值耗材申请项Ext4.tree.Panel的数据仓库 var treePanelStore = null; -var chooseNextOneWindowObj = null; /** - * 添加或者修改高值耗材申请单. - * @param id 高值耗材申请单id + * 审批高值耗材申请单时对申请单的修改. + * @param id 高值耗材申请单id + * @param allowChanges 是否允许修改 */ -function addOrEidtExpensiveGoodsApplicationForm (id) { +function eidtExpensiveGoodsApplicationForApproval(id, allowChanges) { + if (!id) { + showResult('高值耗材申请单id不能为空!'); + return false; + } + addOrEidtExpensiveGoodsApplication(id, !allowChanges, true); +} + +/** + * 申领时对高值耗材申请单的新增或者修改. + * @param id 高值耗材申请单的id + */ +function addOrEidtExpensiveGoodsApplicationForApply(id) { + addOrEidtExpensiveGoodsApplication(id, false, false); +} + +/** + * 新增或者修改高值耗材申请单. + * @param id 高值耗材申请单id + * @param notAllowChanges 是否不允许修改 + * @param isApproval 是否为审批高值耗材申请单时对申请单的修改 + */ +function addOrEidtExpensiveGoodsApplication(id, notAllowChanges, isApproval) { /** * 申请科室的store */ @@ -70,30 +90,32 @@ listeners: { load : function(thiz, records, successful, eOpts) { if (records.length > 0) { - top.Ext4.getCmp('handleDepart').setValue(records[0].data.departmentName); - top.Ext4.getCmp('handleDepartCoding').setValue(records[0].data.departmentCode); - top.Ext4.getCmp('handleDepartment').setValue(records[0].data.departmentCode); + Ext4.getCmp('handleDepart').setValue(records[0].data.departmentName); + Ext4.getCmp('handleDepartCoding').setValue(records[0].data.departmentCode); + Ext4.getCmp('handleDepartment').setValue(records[0].data.departmentCode); } } } }); - /** * 申请的物品模型 */ Ext4.define('ExpensiveGoodsModel', { extend : 'Ext4.data.Model', - idProperty: 'expensiveGoodsId', //指定id属性 + idProperty: 'nodeId', //指定id属性 fields: [ - {name : 'id'}, //申请项的id - {name : 'amount'}, //申请项的数量 - {name : 'expensiveGoodsId'}, //高值耗材id - {name : 'showName'}, //高值耗材的显示名称(即:名称[规格]) - {name : 'name'}, //高值耗材的名称 - {name : 'specification'}, //高值耗材的规格 - {name : 'supplierName'}, //高值耗材的生产厂家 - {name : 'referencePrice'} //高值耗材的参考价 + {name : 'nodeId'}, //此节点的id(高值耗材的id-高值耗材型号id) + {name : 'id'}, //申请项的id + {name : 'amount'}, //申请项的数量 + {name : 'expensiveGoodsId'}, //高值耗材id + {name : 'showName'}, //高值耗材的显示名称(即:名称[规格]) + {name : 'name'}, //高值耗材的名称 + {name : 'specification'}, //高值耗材的规格 + {name : 'supplierName'}, //高值耗材的生产厂家 + {name : 'expensiveGoodsModelId'}, //高值耗材的型号id + {name : 'expensiveGoodsModelName'}, //高值耗材的型号名称 + {name : 'referencePrice'} //高值耗材的参考价 ]}); expensiveGoodsStore = new Ext4.data.Store({ @@ -116,8 +138,8 @@ }, listeners: { beforeload : function(store, operation, eOpts){ - var rawValue = top.Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); - var value = top.Ext4.getCmp('expensiveGoodsSupplier').getValue(); + var rawValue = Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); + var value = Ext4.getCmp('expensiveGoodsSupplier').getValue(); if (rawValue && value) { store.proxy.extraParams.supplierId = value; } else { @@ -128,35 +150,57 @@ } }); - //高值耗材生产厂家的store - var expensiveGoodsSupplierStore = new Ext4.data.Store({ + + /** + * 型号的store + */ + var expensiveGoodsModelStore = new Ext4.data.Store({ + pageSize: 100, fields: [ - {name : 'id'}, //高值耗材生产厂家的id - {name : 'name'} //高值耗材生产厂家的名称 + {name : 'id'}, //型号的id + {name : 'model'} //型号名称 ], proxy : { - extraParams : {supplierType : '生产厂家'}, type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierData.do', + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!getExpensiveGoodsModelList.do', reader : { type : 'json', totalProperty : 'totalCount', root : 'data' } + }, + listeners: { + beforeload : function(store, operation, eOpts){ + var rawValue = Ext4.getCmp('expensiveGoods').getRawValue(); + var value = Ext4.getCmp('expensiveGoods').getValue(); + if (rawValue && value) { + store.proxy.extraParams.expensiveGoodsID = value; + } else { + showResult('请先选择物品!'); + return false; + } + } } }); + //高值耗材生产厂家的store + var expensiveGoodsSupplierStore = new Ext4.data.Store({ + fields: [ + {name : 'id'}, //高值耗材生产厂家的id + {name : 'name'} //高值耗材生产厂家的名称 + ], + proxy : { + extraParams : {supplierType : '生产厂家'}, + type : 'ajax', + url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierData.do', + reader : { + type : 'json', + totalProperty : 'totalCount', + root : 'data' + } + } + }); - var workFlowApprovalTaskRecordJsp=""; - if(id){ - workFlowApprovalTaskRecordJsp = WWWROOT+'/systemmanage/workFlow/workFlowApprovalTaskRecord.jsp?formId='+id; - }else{ - workFlowApprovalTaskRecordJsp = WWWROOT+'/systemmanage/workFlow/workFlowApprovalTaskRecord.jsp?formId=0'; - } - var workFlowApprovalTaskRecordIframe = new top.Ext4.Component({ - html : '' - }); - /** * 常用医生的store */ @@ -188,75 +232,80 @@ }); /** - * 高值耗材申请项top.Ext4.tree.Panel + * 高值耗材申请项Ext4.tree.Panel */ - top.Ext4.define('expensiveGoodsApplicationTreeGrid', { - extend: 'top.Ext4.tree.Panel', - xtype: 'tree-grid', - useArrows: true, - rootVisible: false, - multiSelect: false, - columnLines: true, - rowLines: true, - cls: 'no-leaf-icons', - columns : [{ - dataIndex: 'id', hidden: true + Ext4.define('expensiveGoodsApplicationTreeGrid', { + extend: 'Ext4.tree.Panel', + xtype: 'tree-grid', + useArrows: true, + rootVisible: false, + multiSelect: false, + columnLines: true, + rowLines: true, + cls: 'no-leaf-icons', + columns : [{ + dataIndex: 'id', hidden: true + },{ + dataIndex: 'expensiveGoodsId', hidden: true + },{ + dataIndex: 'name', hidden: true + },{ + dataIndex: 'specification', hidden: true + },{ + header: '生产厂家',dataIndex: 'supplierName', width: 250 + },{ + header: '名称', dataIndex: 'showName', width: 250 + },{ + header: '型号', dataIndex: 'expensiveGoodsModelName', width: 180 },{ - dataIndex: 'expensiveGoodsId', hidden: true - },{ - dataIndex: 'name', hidden: true - },{ - dataIndex: 'specification', hidden: true - },{ - header: '生产厂家',dataIndex: 'supplierName', width: 200 - },{ - header: '名称', dataIndex: 'showName', width: 250 - },{ - header: '申请数量', dataIndex : 'amount', width: 100, align: 'center', sortable: false, - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - maxValue: 9999, - listeners: { - specialkey: function(field, event, eOpts) { - if (event.getKey() === event.TAB) { - //阻止按Tab,因为这里的CellEditing按了tab会有bug - event.stopEvent(); - } - } - } - } - },{ - header: '价格',dataIndex: 'referencePrice', width: 70 - }], - viewConfig : { - toggleOnDblClick: false, - markDirty:false - }, - initComponent: function() { - this.cellEditing = new top.Ext4.grid.plugin.CellEditing({ - clicksToEdit: 2, - listeners: { - beforeedit: function(editor, context, eOpts){ - var record = context.record; - - }, - edit:function(editor, context, eOpts){ - - } - } - }); - Ext4.apply(this, { - plugins: [this.cellEditing] - }); - this.superclass.initComponent.call(this); - } - }); + header: '申请数量', dataIndex : 'amount', width: 70, align: 'center', sortable: false, + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals :false, + minValue: 0, + maxValue: 9999, + listeners: { + specialkey: function(field, event, eOpts) { + if (event.getKey() === event.TAB) { + //阻止按Tab,因为这里的CellEditing按了tab会有bug + event.stopEvent(); + } + } + }, + readOnly: notAllowChanges + } + },{ + header: '价格',dataIndex: 'referencePrice', width: 70 + }], + viewConfig : { + toggleOnDblClick: false, + markDirty:false + }, + initComponent: function() { + this.cellEditing = new Ext4.grid.plugin.CellEditing({ + clicksToEdit: 2, + listeners: { + beforeedit: function(editor, context, eOpts){ + var record = context.record; + }, + edit:function(editor, context, eOpts){} + } + }); + Ext4.apply(this, { + plugins: [this.cellEditing] + }); + this.superclass.initComponent.call(this); + } + }); - formObj = new top.Ext4.form.Panel({ + var windowObj = null; + var formObj = Ext4.create('Ext4.form.Panel', { + id: 'expensiveGoodsApplicationForm', + width : 990, + height : 600, frame : true, + renderTo: Ext4.getBody(), border : 0, labelSeparator : ':', bodyPadding : '5 5 0', @@ -265,361 +314,299 @@ fieldDefaults : { labelAlign : 'right' }, - layout : { - type : 'vbox' - }, items : [ - {xtype: 'hidden', name: 'id', id : 'id', value: id}, - {xtype: 'hidden', name: 'depart', id : 'depart'}, - {xtype: 'hidden', name: 'departCoding', id : 'departCoding'}, - {xtype: 'hidden', name: 'settleAccountsDepart', id : 'settleAccountsDepart'}, - {xtype: 'hidden', name: 'settleAccountsDepartCoding', id : 'settleAccountsDepartCoding'}, - {xtype: 'hidden', name: 'handleDepart', id : 'handleDepart'}, - {xtype: 'hidden', name: 'handleDepartCoding', id : 'handleDepartCoding'}, - {xtype: 'hidden', name: 'applicantCode', id : 'applicantCode'}, - {xtype: 'hidden', name: 'tousseItems', id : 'tousseItems'}, + {xtype: 'hidden', name: 'id', id : 'id', value: id}, //申请单id + {xtype: 'hidden', name: 'depart', id : 'depart'}, //申请科室名称 + {xtype: 'hidden', name: 'departCoding', id : 'departCoding'}, //申请科室编码 + {xtype: 'hidden', name: 'settleAccountsDepart', id : 'settleAccountsDepart'}, //结算科室名称 + {xtype: 'hidden', name: 'settleAccountsDepartCoding', id : 'settleAccountsDepartCoding'}, //结算科室编码 + {xtype: 'hidden', name: 'handleDepart', id : 'handleDepart'}, //处理科室名称 + {xtype: 'hidden', name: 'handleDepartCoding', id : 'handleDepartCoding'}, //处理科室编码 + {xtype: 'hidden', name: 'applicantCode', id : 'applicantCode'}, //申请人编码 + {xtype: 'hidden', name: 'tousseItems', id : 'tousseItems'}, //申请项 { xtype: 'fieldset', title: '基本信息', layout: 'column', - height : 225, width: '100%', - items: [{ //流水号、申请人、时间 - xtype : 'container', - layout : {type : 'hbox'}, - height: 25, - items : [{ - xtype : 'textfield', - fieldLabel : '流水号', - maxLength : '41', - flex : 1, - id : 'serialNumber', - name : 'serialNumber', - allowBlank : true, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - },{ - xtype : 'textfield', - fieldLabel : '申请人', - maxLength : '255', - flex : 1, - id : 'applicant', - name : 'applicant', - allowBlank : false, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - },{ - xtype : 'textfield', - fieldLabel : '时间', - flex : 1, - id : 'applicationTimeStr', - name : 'applicationTimeStr', - allowBlank : false, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - }] - },{ //申请科室、结算科室、处理的供应室 - xtype : 'container', - layout : {type : 'hbox'}, - height: 25, - items : [{ - xtype : 'combo', - flex : 1, - fieldLabel: '申请科室', - id : 'department', - name : 'department', - valueField : 'departmentCode', - displayField : 'departmentName', - store : applyDepartmentStore, - queryParam : 'spell', - pageSize : 100, - minChars : 0, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - matchFieldWidth: false, - listConfig: {width: 300}, - allowBlank : false, - flex : 1, - listeners: { - focus : function(thiz){ - thiz.selectText(); - }, - select : function(_this, records, index) { - var record = transformRecords(records); - var departmentName = record.data.departmentName; - var departmentCode = record.data.departmentCode; - - //1、设置申请科室 - formObj.getForm().findField('depart').setValue(departmentName); - formObj.getForm().findField('departCoding').setValue(departmentCode); - - //2、设置结算科室 - setSettleAccountsDepartmentByApplyDepartment(settleAccountsDepartmentStore, departmentCode, departmentName); - } + height: 195, + items: [{ + xtype : 'textfield', + fieldLabel : '流水号', + maxLength : '41', + id : 'serialNumber', + name : 'serialNumber', + allowBlank : true, + readOnly : true, + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + },{ + xtype : 'textfield', + fieldLabel : '申请人', + maxLength : '255', + id : 'applicant', + name : 'applicant', + allowBlank : false, + readOnly : true, + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + },{ + xtype : 'textfield', + fieldLabel : '时间', + id : 'applicationTimeStr', + name : 'applicationTimeStr', + allowBlank : false, + readOnly : true, + fieldCls : 'fieldReadOnlyNoRemoveAndTop' + },{ + xtype : 'combo', + fieldLabel: '申请科室', + id : 'department', + name : 'department', + valueField : 'departmentCode', + displayField : 'departmentName', + store : applyDepartmentStore, + queryParam : 'spell', + pageSize : 100, + minChars : 0, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + matchFieldWidth: false, + listConfig: {width: 300}, + allowBlank : false, + listeners: { + focus : function(thiz){ + thiz.selectText(); + }, + select : function(_this, records, index) { + var record = transformRecords(records); + var departmentName = record.data.departmentName; + var departmentCode = record.data.departmentCode; + + //1、设置申请科室 + Ext4.getCmp('depart').setValue(departmentName); + Ext4.getCmp('departCoding').setValue(departmentCode); + + //2、设置结算科室 + setSettleAccountsDepartmentByApplyDepartment(settleAccountsDepartmentStore, departmentCode, departmentName); } - },{ - xtype : 'combo', - flex : 1, - fieldLabel: '结算科室', - id : 'settleAccountsDepartment', - name : 'settleAccountsDepartment', - valueField : 'departmentCode', - displayField : 'departmentName', - store : settleAccountsDepartmentStore, - queryParam : 'spell', - minChars : 0, - matchFieldWidth: false, - listConfig: {width: 300}, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : false, - listeners: { - focus : function(thiz){ - thiz.selectText(); - }, - select : function(_this, records, index) { - var record = transformRecords(records); - top.Ext4.getCmp('settleAccountsDepart').setValue(record.data.departmentName); - top.Ext4.getCmp('settleAccountsDepartCoding').setValue(record.data.departmentCode); - } + }, + readOnly: notAllowChanges + },{ + xtype : 'combo', + fieldLabel: '结算科室', + id : 'settleAccountsDepartment', + name : 'settleAccountsDepartment', + valueField : 'departmentCode', + displayField : 'departmentName', + store : settleAccountsDepartmentStore, + queryParam : 'spell', + minChars : 0, + matchFieldWidth: false, + listConfig: {width: 300}, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : false, + listeners: { + focus : function(thiz){ + thiz.selectText(); + }, + select : function(_this, records, index) { + var record = transformRecords(records); + Ext4.getCmp('settleAccountsDepart').setValue(record.data.departmentName); + Ext4.getCmp('settleAccountsDepartCoding').setValue(record.data.departmentCode); } - },{ - xtype : 'combo', - flex : 1, - fieldLabel: '处理科室', - id : 'handleDepartment', - name : 'handleDepartment', - valueField : 'departmentCode', - displayField : 'departmentName', - store : handleDepartmentStore, - queryParam : 'spell', - matchFieldWidth: false, - listConfig: {width: 300}, - forceSelection : true, - triggerAction : 'all', - hideTrigger : true, - allowBlank : false, - listeners: { - focus : function(thiz){ - thiz.selectText(); - }, - select : function(_this, records, index) { - var record = transformRecords(records) - top.Ext4.getCmp('handleDepart').setValue(record.data.departmentName); - top.Ext4.getCmp('handleDepartCoding').setValue(record.data.departmentCode); - } + }, + readOnly: notAllowChanges + },{ + xtype : 'combo', + fieldLabel: '处理科室', + id : 'handleDepartment', + name : 'handleDepartment', + valueField : 'departmentCode', + displayField : 'departmentName', + store : handleDepartmentStore, + queryParam : 'spell', + matchFieldWidth: false, + listConfig: {width: 300}, + forceSelection : true, + triggerAction : 'all', + hideTrigger : true, + allowBlank : false, + listeners: { + focus : function(thiz){ + thiz.selectText(); + }, + select : function(_this, records, index) { + var record = transformRecords(records) + Ext4.getCmp('handleDepart').setValue(record.data.departmentName); + Ext4.getCmp('handleDepartCoding').setValue(record.data.departmentCode); } - }] - },{ //住院号、诊疗号、病人姓名 - xtype : 'container', - layout : {type : 'hbox'}, - height: 25, - items : [{ - xtype : 'textfield', - fieldLabel : '住院号', - maxLength : '50', - id : 'hospitalNumber', - name : 'hospitalNumber', - allowBlank : true, - enableKeyEvents : true, - listeners : { - specialkey : function(field, ee) { - if (ee.getKey() == Ext4.EventObject.ENTER) { - var jsonStr = "{\"patientNum\":\"" + field.value - + "\",\"numType\":\"hospitalNum\",\"sourcePage\":\"0\"}"; - loadPatientInfoByValAndType(jsonStr); - } + }, + readOnly: notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '住院号', + id : 'hospitalNumber', + name : 'hospitalNumber', + enableKeyEvents : true, + listeners : { + specialkey : function(field, ee) { + if (ee.getKey() == Ext4.EventObject.ENTER) { + var jsonStr = "{\"patientNum\":\"" + field.value + + "\",\"numType\":\"hospitalNum\",\"sourcePage\":\"0\"}"; + loadPatientInfoByValAndType(jsonStr); + } + } + }, + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '诊疗号', + id : 'clinicNumber', + name : 'clinicNumber', + enableKeyEvents : true, + listeners : { + specialkey : function(field, ee) { + if (ee.getKey() == Ext4.EventObject.ENTER) { + var jsonStr = "{\"patientNum\":\"" + field.value + + "\",\"numType\":\"treatmentNum\",\"sourcePage\":\"0\"}"; + loadPatientInfoByValAndType(jsonStr); } - }, - flex : 1 - },{ - xtype : 'textfield', - fieldLabel : '诊疗号', - maxLength : '100', - id : 'clinicNumber', - name : 'clinicNumber', - allowBlank : true, - enableKeyEvents : true, - listeners : { - specialkey : function(field, ee) { - if (ee.getKey() == Ext4.EventObject.ENTER) { - var jsonStr = "{\"patientNum\":\"" + field.value - + "\",\"numType\":\"treatmentNum\",\"sourcePage\":\"0\"}"; - loadPatientInfoByValAndType(jsonStr); - } - } - }, - flex : 1 - },{ - xtype : 'textfield', - fieldLabel : '病人姓名', - maxLength : '50', - id : 'patient', - name : 'patient', - allowBlank : true, - flex : 1 - }] - },{ //病区、病室、床位 - xtype : 'container', - layout : {type : 'hbox'}, - height: 25, - hidden : sstsConfig.hidePatientArea, - flex : 1, - height: 25, - items : [{ - xtype : 'textfield', - fieldLabel : '病区', - maxLength : '50', - id : 'patientArea', - name : 'patientArea', - allowBlank : true, - flex : 1 - },{ - xtype : 'textfield', - fieldLabel : '病室', - maxLength : '50', - id : 'roomNumber', - name : 'roomNumber', - allowBlank : true, - hidden : sstsConfig.hideRoomNumber, - flex : 1 - }, { - xtype : 'textfield', - fieldLabel : '床位', - maxLength : '50', - id : 'bedNumber', - name : 'bedNumber', - allowBlank : true, - hidden : sstsConfig.hideRoomNumber, - flex : 1 } - ] - },{ //年龄、性别、病人所属科室 - xtype : 'container', - layout : {type : 'hbox'}, - height: 25, - items : [{ - xtype : 'numberfield', - id : 'patientAge', - name : 'patientAge', - fieldLabel : '年龄', - maxValue: 255, - minValue: 1, - allowNegative : false, - allowDecimals : false, - flex : 1 - },{ - xtype : 'combo', - fieldLabel : '性别', - valueField : 'typeName', - displayField : 'typeName', - id : 'patientSex', - name : 'patientSex', - mode : 'local', - triggerAction : 'all', - forceSelection : true, - editable : false, - store : new top.Ext4.data.SimpleStore({ - fields : [ 'typeName' ], - data : [['男'],['女']] - }), - flex : 1 - },{ - xtype : 'textfield', - fieldLabel : '病人所属科室', - maxLength : '16', - id : 'ascriptionDepartment', - name : 'ascriptionDepartment', - allowBlank : true, - flex : 1 - }] - },{ //手术名称、手术时间、医生 - xtype : 'container', - layout : {type : 'hbox'}, - height: 25, - items : [{ - xtype : 'textfield', - fieldLabel : '手术名称', - id : 'surgery', - name : 'surgery', - allowBlank : true, - flex : 1 - },{ - xtype : 'datefield', - fieldLabel : '手术时间', - id : 'operationTime', - name : 'operationTime', - selectOnFocus :true, - format : 'Y-m-d H:i', - allowBlank : true, - flex : 1 - },{ - fieldLabel : '医生', - xtype : 'combo', - id : 'doctor', - name : 'doctor', - flex : 1, - queryParam : 'spell', - minChars : 0, - displayField : 'doctor', - listConfig: {width: 300}, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : true, - forceSelection:false, - store : commonlyUsedDoctorJsonStore - }] - },{ //手术间、外来器械包名称 - xtype : 'container', - layout : {type : 'hbox'}, - width:790, - height: 25, - items : [{ - xtype : 'textfield', - fieldLabel : '手术间', - id : 'operationRoom', - name : 'operationRoom', - allowBlank : true - },{ - xtype : 'textfield', - fieldLabel : '外来器械包名称', - id : 'foreignTousseName', - name : 'foreignTousseName', - allowBlank : true - }] - },{ //备注 - xtype : 'container', - layout : {type : 'hbox'}, - width:790, - height: 25, - items: [{ - xtype : 'textfield', - fieldLabel : '备注', - id : 'remark', - name : 'remark', - flex : 3 - }] + }, + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '病人姓名', + id : 'patient', + name : 'patient', + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '病区', + maxLength : '50', + id : 'patientArea', + name : 'patientArea', + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '病室', + maxLength : '50', + id : 'roomNumber', + name : 'roomNumber', + hidden : sstsConfig.hideRoomNumber, + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '床位', + maxLength : '50', + id : 'bedNumber', + name : 'bedNumber', + hidden : sstsConfig.hideRoomNumber, + readOnly : notAllowChanges + },{ + xtype : 'numberfield', + id : 'patientAge', + name : 'patientAge', + fieldLabel : '年龄', + maxValue: 255, + minValue: 1, + allowNegative : false, + allowDecimals : false, + readOnly: notAllowChanges + },{ + xtype : 'combo', + fieldLabel : '性别', + valueField : 'typeName', + displayField : 'typeName', + id : 'patientSex', + name : 'patientSex', + mode : 'local', + triggerAction : 'all', + forceSelection : true, + editable : false, + store : new Ext4.data.SimpleStore({ + fields : ['typeName'], + data : [['男'],['女']] + }), + readOnly: notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '病人所属科室', + maxLength : '16', + id : 'ascriptionDepartment', + name : 'ascriptionDepartment', + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '手术名称', + id : 'surgery', + name : 'surgery', + readOnly : notAllowChanges + },{ + xtype : 'datefield', + fieldLabel : '手术时间', + id : 'operationTime', + name : 'operationTime', + selectOnFocus :true, + format : 'Y-m-d H:i', + readOnly : notAllowChanges + },{ + fieldLabel : '医生', + xtype : 'combo', + id : 'doctor', + name : 'doctor', + flex : 1, + queryParam : 'spell', + minChars : 0, + displayField : 'doctor', + listConfig: {width: 300}, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + forceSelection:false, + store : commonlyUsedDoctorJsonStore, + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '手术间', + id : 'operationRoom', + name : 'operationRoom', + readOnly : notAllowChanges + },{ + xtype : 'textfield', + fieldLabel : '外来器械包名称', + id : 'foreignTousseName', + name : 'foreignTousseName', + readOnly : notAllowChanges + },{ + xtype : 'textfield', + width: 760, + fieldLabel : '备注', + id : 'remark', + name : 'remark', + readOnly : notAllowChanges }] },{ xtype: 'container', width: '100%', - height: 290, + height: 170, layout: 'fit', items: { xtype : 'tree-grid', store : treePanelStore, tbar:[{ - text: "生产厂家:" + text: "生产厂家:", + hidden: notAllowChanges },{ xtype: 'combo', id : 'expensiveGoodsSupplier', @@ -629,8 +616,8 @@ valueField : 'id', displayField : 'name', matchFieldWidth: false, - width : 200, - listConfig: {width : 200}, + width : 180, + listConfig: {width : 180}, store : expensiveGoodsSupplierStore, forceSelection : true, lazyInit : true, @@ -640,11 +627,13 @@ listeners: { select: function(combo, records, index) { expensiveGoodsStore.load(); - top.Ext4.getCmp('expensiveGoods').setValue('') + Ext4.getCmp('expensiveGoods').setValue(''); } - } + }, + hidden: notAllowChanges },{ - text: "物品名称:" + text: "物品名称:", + hidden: notAllowChanges },{ xtype: 'combo', id : 'expensiveGoods', @@ -654,8 +643,8 @@ valueField : 'id', displayField : 'showName', matchFieldWidth: false, - width : 300, - listConfig: {width : 300}, + width : 260, + listConfig: {width : 260}, store : expensiveGoodsStore, forceSelection : true, lazyInit : true, @@ -665,16 +654,53 @@ pageSize:100, listeners: { focus: function(thiz, the, eOpts) { - var rawValue = top.Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); + var rawValue = Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); if (!rawValue) { showResult('请先选择生产厂家!'); - top.Ext4.getCmp('expensiveGoodsSupplier').focus(); + Ext4.getCmp('expensiveGoodsSupplier').focus(); } + }, + select: function(combo, records, index) { + expensiveGoodsModelStore.load(); + Ext4.getCmp('expensiveGoodsModel').setValue(''); } - } + }, + hidden: notAllowChanges },{ - text:"数量:" + text: '型号:', + hidden: notAllowChanges },{ + xtype: 'combo', + id : 'expensiveGoodsModel', + name : 'expensiveGoodsModel', + queryParam : 'spell', + minChars : 0, + valueField : 'id', + displayField : 'model', + matchFieldWidth: false, + width : 180, + listConfig: {width : 180}, + store : expensiveGoodsModelStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + pageSize:100, + listeners: { + focus: function(thiz, the, eOpts) { + var rawValue = Ext4.getCmp('expensiveGoods').getRawValue(); + if (!rawValue) { + showResult('请先选择物品!'); + Ext4.getCmp('expensiveGoods').focus(); + } + } + }, + hidden: notAllowChanges + },{ + text:"数量:", + hidden: notAllowChanges + },{ xtype : 'numberfield', id : 'amount', name : 'amount', @@ -686,60 +712,71 @@ allowDecimals : false, listeners : { specialkey : function(field, ee) { - if (ee.getKey() == Ext.EventObject.ENTER) { + if (ee.getKey() == Ext4.EventObject.ENTER) { addExpensiveGoods(); } } - } + }, + hidden: notAllowChanges },{ xtype:'button', id : 'addTousseBt', - iconCls : 'btn_ext_add', + iconCls : 'icon-add2', handler : function() { addExpensiveGoods(); - } + }, + hidden: notAllowChanges }] } },{ xtype: 'container', width: '100%', - height: 250, + height: 200, layout: 'fit', - items : workFlowApprovalTaskRecordIframe + items: createWorkFlowApprovalTaskGrid(id) }], buttons : [{ id : 'temporarySave', text : '暂存', handler : function() { - submitOrTemporarySaveExpensiveGoodsApplication(false); - } + submitOrTemporarySave(false); + }, + hidden: isApproval },{ id : 'saveBtn', text : '提交', handler : function() { - submitOrTemporarySaveExpensiveGoodsApplication(true); - } + submitOrTemporarySave(true); + }, + hidden: isApproval },{ + id : 'cancelBtn', text : '取消', handler : function() { - if(chooseNextOneWindowObj!=null|| typeof(reValue) != "undefined" ) - chooseNextOneWindowObj.hide(); - windowObj.close(); - } + if (windowObj) { + windowObj.close(); + } + }, + hidden: isApproval }] }); - windowObj = new top.Ext4.window.Window({ - layout : 'fit', - title : '申请高值耗材', - width : 1030, - height : 600, - resizable :false, - modal : true, - border : false, - plain : true, - items : formObj - }); - windowObj.show(); + + if (!isApproval) { + windowObj = new Ext4.window.Window({ + id: 'expensiveGoodsApplicationWindow', + autoShow: true, + layout : 'fit', + title : '申请高值耗材', + width : 1030, + height : 600, + resizable :false, + modal : true, + border : false, + plain : true, + items : formObj + }); + } + if (id) { formObj.form.load({ url : WWWROOT + '/disinfectSystem/expensivegoodsapplication/expensiveGoodsApplicationAction!loadExpensiveGoodsApplication.do', @@ -756,56 +793,65 @@ var settleAccountsDepartCoding = data.settleAccountsDepartCoding; var handleDepart = data.handleDepart; - //1、设置“申请科室”、“结算科室”、“处理科室”、“手术时间”combo的显示值 + //1、设置“申请科室”、“结算科室”、“处理科室”combo的显示值 setDepartment(applyDepartmentStore, departCoding, depart); setSettleAccountsDepartmentByApplyDepartment(settleAccountsDepartmentStore, settleAccountsDepartCoding, settleAccountsDepart); handleDepartmentStore.load({ params: {spell: handleDepart} }); - var operationTime = data.operationTime; - if(operationTime){ - top.Ext4.getCmp("operationTime").setValue(operationTime); - } //2、设置申请项 treePanelStore.proxy.data = {children: data.tousseItems}; treePanelStore.load(); //3、已经提交则把隐藏“暂存”和“提交”两个按钮 if (committedStatus) { - top.Ext4.getCmp('temporarySave').hide(); - top.Ext4.getCmp('saveBtn').hide(); + Ext4.getCmp('temporarySave').hide(); + Ext4.getCmp('saveBtn').hide(); } + + + + + + //1、“手术时间” + var operationTime = data.operationTime; + if(operationTime){ + Ext4.getCmp("operationTime").setValue(operationTime); + } + + //2、设置申请项 + treePanelStore.proxy.data = {children: data.tousseItems}; + treePanelStore.load(); }, - failure : function(form, action) { - }, params : { id : id } }); - } else { //新加 - //1、设置默认的“申请人”、“申请人编码”、“申请时间” - top.Ext4.getCmp('applicant').setValue(curUserName); - top.Ext4.getCmp('applicantCode').setValue(userCode); - getServerTime('yyyy-MM-dd HH:mm',top.Ext4,'applicationTimeStr'); + } else { + //1、设置默认的“申请人”、“申请时间” + Ext4.getCmp('applicant').setValue(userName); + Ext4.getCmp('applicantCode').setValue(userCode); + getServerTime('yyyy-MM-dd HH:mm',Ext4,'applicationTimeStr'); //2、设置默认的“申请科室”、“结算科室”、“处理科室” - setDepartment(applyDepartmentStore, dirOrgCode, currentOrgUnitName); - setSettleAccountsDepartmentByApplyDepartment(settleAccountsDepartmentStore, dirOrgCode, currentOrgUnitName); + setDepartment(applyDepartmentStore, currentOrgUnitCode, currentOrgUnitName); + setSettleAccountsDepartmentByApplyDepartment(settleAccountsDepartmentStore, currentOrgUnitCode, currentOrgUnitName); handleDepartmentStore.load(); } - } /** * 添加高值耗材到申请物品列表. * @returns {Boolean} */ function addExpensiveGoods() { - var amount = top.Ext4.getCmp('amount').getValue(); - var id = top.Ext4.getCmp('expensiveGoods').getValue(); - var showName = top.Ext4.getCmp('expensiveGoods').getRawValue(); - var expensiveGoodsSupplier = top.Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); + var amount = Ext4.getCmp('amount').getValue(); + var id = Ext4.getCmp('expensiveGoods').getValue(); + var showName = Ext4.getCmp('expensiveGoods').getRawValue(); + var expensiveGoodsSupplier = Ext4.getCmp('expensiveGoodsSupplier').getRawValue(); + var expensiveGoodsModelId = Ext4.getCmp('expensiveGoodsModel').getValue(); //型号id + var expensiveGoodsModelName = Ext4.getCmp('expensiveGoodsModel').getRawValue(); //型号名称 //1、先校验物品和数量 if (!id || !showName) { @@ -822,8 +868,9 @@ return false; } - //2、如果申请列表已经存在此物则提示“此物已经存在!”(即:同一种物品并且数量大于0) - var findNode = treePanelStore.getNodeById(id); + //2、如果申请列表已经存在此物则提示“此物已经存在!”(即:同一种物品同一型号并且数量大于0) + var nodeId = (id + '-' + expensiveGoodsModelId); + var findNode = treePanelStore.getNodeById(nodeId); if (findNode && findNode.get('amount')) { showResult('此物已经存在!'); return false; @@ -833,213 +880,28 @@ } else { var selectRecord = expensiveGoodsStore.findRecord('id', id); var node = Ext4.create('ExpensiveGoodsModel', { + nodeId: nodeId, id : 0, amount: amount, expensiveGoodsId : selectRecord.get('id'), showName : selectRecord.get('showName'), name : selectRecord.get('name'), specification : selectRecord.get('specification'), supplierName : expensiveGoodsSupplier, + expensiveGoodsModelId: expensiveGoodsModelId, + expensiveGoodsModelName: expensiveGoodsModelName, referencePrice : selectRecord.get('referencePrice') }); treePanelStore.getRootNode().appendChild(node); } - top.Ext4.getCmp('expensiveGoodsSupplier').setValue(); - top.Ext4.getCmp('expensiveGoods').setValue(); - top.Ext4.getCmp('amount').setValue(); + Ext4.getCmp('expensiveGoodsSupplier').setValue(); + Ext4.getCmp('expensiveGoods').setValue(); + Ext4.getCmp('amount').setValue(); + Ext4.getCmp('expensiveGoodsModel').setValue(); } } -var chooseNextOneJsp=encodeURI(WWWROOT+'/systemmanage/workFlow/workFlowApprovalTaskChooseNextOne.jsp?formType=高值耗材申请单'); -var chooseNextOneIframe = new top.Ext4.Component({ - html : '' - ,height : 150 - }); -/** - * 提交或者暂存高值耗材申请单. - * @param commit 是否提交操作(为true则为提交操作,否则为暂存操作) - */ -function submitOrTemporarySaveExpensiveGoodsApplication(commit) { - if (!formObj.getForm().isValid()) { - showResult('请正确填写表单各值'); - return false; - } - /** - * 获取当前表单类型的第一个流程节点 - */ - var fNodeDefinitionUserStore=null; - Ext4.Ajax.request({ - async:false, - url : WWWROOT + '/disinfectSystem/workFlowAction!getFirstNodeDefinitionUser.do', - params : {formType : '高值耗材申请单'}, - success : function(response, options) { - var result = Ext4.decode(response.responseText,true); // 此处返回的有可能不是json字符串,因为注销之后,会被acegi拦截,返回html - if(result.success){ - fNodeDefinitionUserStore=result.rows; - }else{ - showResult(result.message); - } - }, - failure : function(response, options) { - result = Ext4.JSON.decode(response.responseText); - showResult(result.message); - } - }); - var firstNodeDefinitionUserStore=new Ext4.data.JsonStore({ - fields : [ - {name:'fullName', type: 'string'}, - {name:'userId', type:'long'} - ], - data:fNodeDefinitionUserStore - }); - - var chooseNextOneFormObj =new top.Ext4.form.Panel({// Ext4.create('Ext4.form.Panel', { - frame : true, - border : 0, - labelSeparator : ': ', - bodyPadding : '5 5 5 5', - autoScroll : true, - buttonAlign : 'center', - buttons : [{ - text : '保存', - handler : function() { - saveNextOne(); - } - }, { - text : '取消', - handler : function() { - chooseNextOneWindowObj.hide(); - } - } ], - fieldDefaults : { - labelAlign : 'right', - labelWidth : 80 - }, - items : - [{ - xtype: 'container', - width: '100%', - height: 150, - layout: 'fit', - items : chooseNextOneIframe - }] - }); - - //设置申请项信息 - if (setApplyItems()){ - if(commit){ - //暂时版本可能不兼容,导致添加完第一次出现后,马上添加第二个出现js错误,导致选择下一个执行人窗口弹不出【原因:重新创建窗口的组件不能重新生成,暂时解决方法是添加完后不关闭,先隐藏】 - if(chooseNextOneWindowObj){ - chooseNextOneWindowObj = new top.Ext4.window.Window({ - layout : 'fit', - autoScroll:true, - title : '审批信息', - width : 350, - height : 250, - resizable : false, - modal : true, - border : false, - items : chooseNextOneFormObj - }); - chooseNextOneWindowObj.show(); - }else{ - chooseNextOneWindowObj = new top.Ext4.window.Window({ - layout : 'fit', - autoScroll:true, - title : '审批信息', - width : 350, - height : 250, - resizable : false, - modal : true, - border : false, - items : chooseNextOneFormObj - }); - chooseNextOneWindowObj.show(); - } - }else{ //暂存 - var msgBox = new top.Ext4.window.MessageBox(); - msgBox.confirm({ - title: '温馨提示', - padding: '0 10 10 10', - msg: '确认提交吗?', - fn: function(btn){ - if (btn == 'yes'){ - top.Ext4.getCmp('temporarySave').disable(); - top.Ext4.getCmp('saveBtn').disable(); - formObj.form.submit({ - url : WWWROOT + '/disinfectSystem/expensivegoodsapplication/expensiveGoodsApplicationAction!saveOrUpdateExpensiveGoodsApplication.do', - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - params : { - commit: commit - }, - success : function(form, action) { - windowObj.close(); - grid.dwrReload(); - showResult(action.result.message); - }, - failure : function(form, action) { - top.Ext4.getCmp('temporarySave').enable(); - top.Ext4.getCmp('saveBtn').enable(); - showResult(action.result.message); - } - }); - } - }, - buttons: Ext4.Msg.YESNO, - icon: Ext4.Msg.QUESTION - }); - } - } else { - showResult("请填写申请的物品!"); - return; - } - - function saveNextOne(){ - var sub = top.Ext4.getDom('chooseNextOneIframe').contentWindow; - if(!sub) return false; - var userID = sub.document.getElementsByName("userID")[0].value; - if((userID==""||userID==null)&&commit){ - showResult("请选择下一个执行用户!"); - return false; - } - var firstNodeDefinitionUserLenght = firstNodeDefinitionUserStore.data.length; - for (var i=0; i 0) { - top.Ext4.getCmp('tousseItems').setValue(JSON.stringify(items)); + Ext4.getCmp('tousseItems').setValue(JSON.stringify(items)); return true; } else { return false; } } + /** + * 提交或者暂存高值耗材申请单. + * @param commit 是否提交操作(为true则为提交操作,否则为暂存操作) + */ +function submitOrTemporarySave(commit) { + var windowObj = Ext4.getCmp('expensiveGoodsApplicationWindow'); + var formObj = Ext4.getCmp('expensiveGoodsApplicationForm'); + if (!formObj.isValid()) { + showResult('请正确填写表单各值!'); + return false; + } + + //设置申请项信息 + if (setApplyItems()){ + if (commit) { + var nextNodeHandlerWindow = null; + var nextNodeHandlerForm = null; + /** + * 下一个节点的处理人的store + */ + var nextNodeHandlerStore = new Ext4.data.Store({ + autoLoad: true, + proxy : { + type : 'ajax', + url : WWWROOT + '/disinfectSystem/workFlowAction!searchFirstNodeDefinitionHandler.do', + reader : { + type : 'json', + totalProperty : 'totalCount', + root : 'data' + } + }, + fields : [ + {name : 'fullName',mapping : 'fullName'}, + {name : 'userId',mapping : 'userId'} + ], + listeners:{ + beforeload : function(store, operation, eOpts){ + store.proxy.extraParams.formType = '高值耗材申请单'; + }, + load : function(thiz, records, successful, eOpts){ + if (records && records.length > 0) { + Ext4.getCmp('nextNodeHandler').setValue(records[0].data.userId); + } + } + } + }); + + nextNodeHandlerForm = Ext4.create('Ext4.form.Panel', { + id: 'nextNodeHandlerForm', + width : 990, + height : 600, + frame : true, + renderTo: Ext4.getBody(), + border : 0, + labelSeparator : ':', + bodyPadding : '5 5 0', + autoScroll : true, + buttonAlign : 'center', + fieldDefaults : { + labelAlign : 'right', + labelWidth : 120 + }, + items : [{ + xtype : 'textfield', + width: 300, + fieldLabel : '下一个节点名称', + id : 'nextNodeName', + name : 'nextNodeName', + readOnly: true + },{ + xtype : 'combo', + width: 300, + listConfig: {width: 200}, + fieldLabel: '下一个节点处理人', + id : 'nextNodeHandler', + name : 'nextNodeHandler', + valueField : 'userId', + displayField : 'fullName', + store : nextNodeHandlerStore, + queryParam : 'spell', + minChars : 0, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + matchFieldWidth: false + }], + buttons : [{ + id : 'nextNodeSaveBtn', + text : '提交', + handler : function() { + submitOrTemporarySaveExpensiveGoodsApplication(commit, Ext4.getCmp('nextNodeHandler').getValue()); + } + },{ + id : 'nextNodeCancelBtn', + text : '取消', + handler : function() { + nextNodeHandlerWindow.close(); + } + }] + }); + + nextNodeHandlerWindow = new Ext4.window.Window({ + id: 'nextNodeHandlerWindow', + autoShow: true, + layout : 'fit', + title : '申请高值耗材', + width : 350, + height : 250, + resizable :false, + modal : true, + border : false, + plain : true, + items : nextNodeHandlerForm + }); + + //获取第一个审批节点的名称 + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/workFlowAction!getFirstNodeDefinitionNameByFormType.do', + params: {formType: '高值耗材申请单'}, + success : function(response, options){ + var result = Ext4.decode(response.responseText); + if(result.success){ + Ext4.getCmp('nextNodeName').setValue(result.message); + } + } + }); + } else { + submitOrTemporarySaveExpensiveGoodsApplication(commit, null); + } + } else { + showResult("请填写申请的物品!"); + return false; + } +} + +/** + * 提交或者暂存高值耗材申请单. + * @param commit 是否提交 + * @param userId 下一个审批节点的指定的处理人 + */ +function submitOrTemporarySaveExpensiveGoodsApplication(commit, userId) { + var nextNodeHandlerWindow = Ext4.getCmp('nextNodeHandlerWindow'); + var windowObj = Ext4.getCmp('expensiveGoodsApplicationWindow'); + var formObj = Ext4.getCmp('expensiveGoodsApplicationForm'); + var msgBox = new Ext4.window.MessageBox(); + msgBox.confirm({ + title: '温馨提示', + padding: '0 10 10 10', + msg: '确认提交吗?', + fn: function(btn){ + if (btn == 'yes'){ + Ext4.getCmp('temporarySave').disable(); + Ext4.getCmp('saveBtn').disable(); + formObj.form.submit({ + url : WWWROOT + '/disinfectSystem/expensivegoodsapplication/expensiveGoodsApplicationAction!saveOrUpdateExpensiveGoodsApplication.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + params : { + commit: commit, + userId: userId + }, + success : function(form, action) { + if (nextNodeHandlerWindow) { + nextNodeHandlerWindow.close(); + } + windowObj.close(); + grid.reloadData(); + showResult(action.result.message); + }, + failure : function(form, action) { + Ext4.getCmp('temporarySave').enable(); + Ext4.getCmp('saveBtn').enable(); + showResult(action.result.message); + } + }); + } + }, + buttons: Ext4.Msg.YESNO, + icon: Ext4.Msg.QUESTION + }); +} + + +/** + * 流程审批(审批通过、审批不通过、回退、提交、起单人的知会操作) + * @param workFlowApprovalTaskVO 流程处理的一些参数对象 + */ +function updateExpensiveGoodsApplicationByApproval(workFlowApprovalTaskVO) { + var result = {}; + if (!Ext4.getCmp('expensiveGoodsApplicationForm').isValid()) { + return {success:false,message:'请正确填写表单各值!'}; + } + //设置申请项信息 + if (setApplyItems()) { + Ext4.Ajax.request({ + async: false, + url : WWWROOT + '/disinfectSystem/expensivegoodsapplication/expensiveGoodsApplicationAction!updateExpensiveGoodsApplicationForApproval.do', + method : 'POST', + params: { + workFlowApprovalTaskVO: JSON.stringify(workFlowApprovalTaskVO), + id: Ext4.getCmp('id').getValue(), + hospitalNumber: Ext4.getCmp('hospitalNumber').getValue(), + clinicNumber: Ext4.getCmp('clinicNumber').getValue(), + patient: Ext4.getCmp('patient').getValue(), + patientArea: Ext4.getCmp('patientArea').getValue(), + roomNumber: Ext4.getCmp('roomNumber').getValue(), + bedNumber: Ext4.getCmp('bedNumber').getValue(), + patientAge: Ext4.getCmp('patientAge').getValue(), + patientSex: Ext4.getCmp('patientSex').getValue(), + ascriptionDepartment: Ext4.getCmp('ascriptionDepartment').getValue(), + surgery: Ext4.getCmp('surgery').getValue(), + operationTime: Ext4.getCmp('operationTime').getValue(), + doctor: Ext4.getCmp('doctor').getValue(), + operationRoom: Ext4.getCmp('operationRoom').getValue(), + foreignTousseName: Ext4.getCmp('foreignTousseName').getValue(), + remark: Ext4.getCmp('remark').getValue(), + tousseItems: Ext4.getCmp('tousseItems').getValue() + }, + success : function(response, options) { + result = Ext4.JSON.decode(response.responseText); + }, + failure : function(response, options) { + result = Ext4.JSON.decode(response.responseText); + //result = {success:false,message:'审批失败!'}; + } + }); + } else { + result = {success:false,message:'请填写申请的物品!'}; + } + return result; +} + +/** * 同步HRP病人信息 * @param patientInfo */ function showPatientInfo(patientInfo){ - top.Ext4.getCmp('patient').setValue(patientInfo.patientName); - top.Ext4.getCmp('patientAge').setValue(patientInfo.patientAge); + Ext4.getCmp('patient').setValue(patientInfo.patientName); + Ext4.getCmp('patientAge').setValue(patientInfo.patientAge); if(patientInfo.patientSex == '男'){ - top.Ext4.getCmp('patientSex').setValue('男'); + Ext4.getCmp('patientSex').setValue('男'); }else if(patientInfo.patientSex == '女'){ - top.Ext4.getCmp('patientSex').setValue('女'); + Ext4.getCmp('patientSex').setValue('女'); }else{ - top.Ext4.getCmp('patientSex').setValue(''); + Ext4.getCmp('patientSex').setValue(''); } - top.Ext4.getCmp('patientArea').setValue(patientInfo.patientArea); - top.Ext4.getCmp('roomNumber').setValue(patientInfo.roomNumber); - top.Ext4.getCmp('bedNumber').setValue(patientInfo.bedNumber); - top.Ext4.getCmp('doctor').setValue(patientInfo.doctorName); - top.Ext4.getCmp('surgery').setValue(patientInfo.operation); + Ext4.getCmp('patientArea').setValue(patientInfo.patientArea); + Ext4.getCmp('roomNumber').setValue(patientInfo.roomNumber); + Ext4.getCmp('bedNumber').setValue(patientInfo.bedNumber); + Ext4.getCmp('doctor').setValue(patientInfo.doctorName); + Ext4.getCmp('surgery').setValue(patientInfo.operation); //手术时间需要特殊处理,需要将年和月之间的-符替换成/ if(patientInfo.operationTime){ try{ - top.Ext4.getCmp('operationTime').setValue(new Date(patientInfo.operationTime.replace("-","/"))); + Ext4.getCmp('operationTime').setValue(new Date(patientInfo.operationTime.replace("-","/"))); }catch(e){ } } - top.Ext4.getCmp('ascriptionDepartment').setValue(patientInfo.ascriptionDepartment); - top.Ext4.getCmp('operationRoom').setValue(patientInfo.opRoomId); - top.Ext4.getCmp('remark').setValue(patientInfo.remark); + Ext4.getCmp('ascriptionDepartment').setValue(patientInfo.ascriptionDepartment); + Ext4.getCmp('operationRoom').setValue(patientInfo.opRoomId); + Ext4.getCmp('remark').setValue(patientInfo.remark); } - /** * 设置申请科室. * @param applyDepartmentStore 结算科室的store @@ -1119,9 +1218,9 @@ params: {spell: departmentName}, callback: function(records, operation, success) { if (records && records.length > 0 && records[0].data.departmentCode == departmentCode) { - top.Ext4.getCmp("depart").setValue(departmentName); //科室名称 - top.Ext4.getCmp("departCoding").setValue(departmentCode); //科室编码 - top.Ext4.getCmp('department').setValue(departmentCode); //科室的combo(主要用于显示) + Ext4.getCmp("depart").setValue(departmentName); //科室名称 + Ext4.getCmp("departCoding").setValue(departmentCode); //科室编码 + Ext4.getCmp('department').setValue(departmentCode); //科室的combo(主要用于显示) } } }); @@ -1138,9 +1237,9 @@ params: {spell: departmentName}, callback: function(records, operation, success) { if (records && records.length > 0 && records[0].data.departmentCode == departmentCode) { - top.Ext4.getCmp("settleAccountsDepart").setValue(departmentName); //科室名称 - top.Ext4.getCmp("settleAccountsDepartCoding").setValue(departmentCode); //科室编码 - top.Ext4.getCmp('settleAccountsDepartment').setValue(departmentCode); //科室的combo(主要用于显示) + Ext4.getCmp("settleAccountsDepart").setValue(departmentName); //科室名称 + Ext4.getCmp("settleAccountsDepartCoding").setValue(departmentCode); //科室编码 + Ext4.getCmp('settleAccountsDepartment').setValue(departmentCode); //科室的combo(主要用于显示) } } }); Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp =================================================================== diff -u -r22140 -r22307 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 22140) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 22307) @@ -491,9 +491,6 @@ .script("${ctx}/dwr/interface/DataSynchronizationTableManager.js") .script("${ctx}/disinfectsystem/foreigntousseapplication/foreignTousseInfoForm.js") - - .script("${ctx}/disinfectsystem/recyclingApplication/expensiveGoodsApplication/expensiveGoodsApplicationForm.js") - .script("${ctx}/disinfectsystem/basedatamanager/tousse/customTousseForm.js") Index: forgon-core/src/main/java/com/forgon/workflow/action/WorkFlowAction.java =================================================================== diff -u -r22282 -r22307 --- forgon-core/src/main/java/com/forgon/workflow/action/WorkFlowAction.java (.../WorkFlowAction.java) (revision 22282) +++ forgon-core/src/main/java/com/forgon/workflow/action/WorkFlowAction.java (.../WorkFlowAction.java) (revision 22307) @@ -112,6 +112,23 @@ } /** + * 通过申请单类型获取第一个审批节点的名称. + */ + public void getFirstNodeDefinitionNameByFormType(){ + String formType = StrutsParamUtils.getPraramValue("formType", ""); + JSONObject result = JSONUtil.buildJsonObject(false, "找不到第一个审批节点!"); + try { + NodeDefinition firstNodeDefinition = nodeDefinitionManager.getFirstNodeDefinition(formType); + if (firstNodeDefinition != null) { + result = JSONUtil.buildJsonObject(true, firstNodeDefinition.getName()); + } + } catch (Exception e) { + result = JSONUtil.buildJsonObject(false, e.getMessage()); + } + StrutsResponseUtils.output(result); + } + + /** * 判断当前流程是否被申请单使用 * @param nodeDefinitionName 节点名字 * @param id 流程id