Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionForm.js =================================================================== diff -u -r32934 -r33456 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionForm.js (.../foreignProxyDisinfectionForm.js) (revision 32934) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/foreignProxyDisinfectionForm.js (.../foreignProxyDisinfectionForm.js) (revision 33456) @@ -1,39 +1,39 @@ var foreignItemStore; var mustScanBasketForForeignProxy = true; //外部代理灭菌是否必须扫描灭菌筐(配置为true或未配置此项时则为true,否则为false) -if(sstsConfig.mustScanBasketForForeignProxy != true){ +if (sstsConfig.mustScanBasketForForeignProxy != true) { mustScanBasketForForeignProxy = false; } -if(sstsConfig.mustScanBasketForForeignProxy == null){ +if (sstsConfig.mustScanBasketForForeignProxy == null) { mustScanBasketForForeignProxy = true; } -function removeForeignProxyGridItem(id){ +function removeForeignProxyGridItem(id) { var rows = top.Ext.getCmp('foreignProxyDisinfectionGrid').getSelectionModel().getSelections();// 返回值为 if (rows) { - for ( var i = 0; i < rows.length; i++) { + for (var i = 0; i < rows.length; i++) { foreignItemStore.remove(rows[i]); } } } var foreignProxyJsonReader = new Ext.data.JsonReader({ - fields : [ - {name : 'id'}, - {name : 'packageType'}, - {name : 'tousseType'}, - {name : 'sterilingType'}, - {name : 'basketName'}, - {name : 'basketBarcode'}, - {name : 'count'}, - {name : 'tousseName'} + fields: [ + { name: 'id' }, + { name: 'packageType' }, + { name: 'tousseType' }, + { name: 'sterilingType' }, + { name: 'basketName' }, + { name: 'basketBarcode' }, + { name: 'count' }, + { name: 'tousseName' } ] }); //获取扫描的物品 function getEditerGridData() { var array = []; - for ( var i = 0; i < foreignItemStore.getCount(); i++) { + for (var i = 0; i < foreignItemStore.getCount(); i++) { var record = foreignItemStore.getAt(i); var obj = {}; obj.id = record.get('id'); @@ -50,14 +50,14 @@ } //tousseName, packageType, sterileType 当三项同时存在某一个记录里isExist才是true -function checkItemIsRepeat(tousseName, packageType, sterilingType, currentRecordId){ +function checkItemIsRepeat(tousseName, packageType, sterilingType, currentRecordId) { var isExist = false; - for(var i=0,len=foreignItemStore.getCount(); i'; + if (record.raw.showCameraPhoto && SSTS_ShowCameraPhotoAndVideo) { + newV += ''; } var id = record.raw.tousseDefinitionID; var tousseType = record.raw.tousseType + '图片'; newV += "" + v + ""; return newV; - }else { + } else { var id = record.data.tousseDefinitionID; var tousseType = record.data.tousseType + '图片'; newV += "" + v + ""; return newV; } } -function addForeignProxyDisinfectionItem(){ +function addForeignProxyDisinfectionItem() { var name = top.Ext.getCmp('package1').getValue(); var count = top.Ext.getCmp('count1').getValue(); var tousseType = top.Ext.getCmp('tousseType1').getValue(); var packageType = top.Ext.getCmp('packageType1').getValue(); var sterilingType = top.Ext.getCmp('sterilingType1').getValue(); - if(name == ""){ - showResult("请输入器械包!"); + if (name == "") { + showResult("请输入器械包!"); top.Ext.getCmp('package1').setValue(""); top.Ext.getCmp('package1').focus(); - }else if(packageType == ""){ + } else if (packageType == "") { showResult("请输入包装类型!"); top.Ext.getCmp('packageType1').focus(); - }else if(sterilingType == ""){ + } else if (sterilingType == "") { showResult("请输入灭菌程序!"); top.Ext.getCmp('sterilingType1').focus(); - }else if(count == ""){ + } else if (count == "") { showResult("请输入数量,数量必须大于0!"); top.Ext.getCmp('count1').focus(); - }else if(count > 9999){ + } else if (count > 9999) { showResult("请输入数量,数量不能大于9999!"); top.Ext.getCmp('count1').focus(); - }else{ - addItemToGrid(top.Ext.getCmp('package1').getRawValue(),count,packageType,sterilingType,top.Ext.getCmp('tousseType1').getValue()); + } else { + addItemToGrid(top.Ext.getCmp('package1').getRawValue(), count, packageType, sterilingType, top.Ext.getCmp('tousseType1').getValue()); //光标操作 top.Ext.getCmp('package1').setValue(""); top.Ext.getCmp('tousseType1').setValue(""); @@ -157,729 +157,729 @@ } var addTousseInstance = Ext.data.Record.create([ - {name : 'id'}, - {name : 'count'}, - {name : 'tousseName'}, - {name : 'tousseType'}, - {name : 'packageType'}, - {name : 'sterilingType'} + { name: 'id' }, + { name: 'count' }, + { name: 'tousseName' }, + { name: 'tousseType' }, + { name: 'packageType' }, + { name: 'sterilingType' } ]); -function loadBasketBarcode(barcode){ - ForeignProxyDisinfectionTableManager.getResultJsonStrByBarcode(barcode,"外部代理灭菌",function(jsonStr){ +function loadBasketBarcode(barcode) { + ForeignProxyDisinfectionTableManager.getResultJsonStrByBarcode(barcode, "外部代理灭菌", function (jsonStr) { var obj = Ext.util.JSON.decode(jsonStr); var returnType = obj.returnType; - if(returnType == "basketUsed"){ - showResult("无法录入篮筐,篮筐正处于[" + obj.status + "]状态。"); - }else if(returnType == "containerSuccess"){ + if (returnType == "basketUsed") { + showResult("无法录入篮筐,篮筐正处于[" + obj.status + "]状态。"); + } else if (returnType == "containerSuccess") { top.Ext.getCmp("basketName").setValue(obj.containerName); top.Ext.getCmp("basketBarcode1").setValue(barcode); var remark = top.Ext.getCmp("remark").getValue(); - remark = barcode+";"+remark; + remark = barcode + ";" + remark; top.Ext.getCmp("remark").setValue(remark); - }else{ + } else { showResult("找不到该篮筐。"); } top.Ext.getCmp('scanBarcode').setValue(''); }); } -var userReader = new Ext.data.JsonReader( { - fields : [ - {name : 'id'}, - {name : 'fullName'}, - {name : 'orgUnitName'} +var userReader = new Ext.data.JsonReader({ + fields: [ + { name: 'id' }, + { name: 'fullName' }, + { name: 'orgUnitName' } ] }); var foreignProxyTousseStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getExternalTousseDefinitionData.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getExternalTousseDefinitionData.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'tousseType',mapping : 'tousseType'}, - {name : 'packageType',mapping : 'packageType'}, - {name : 'sterilingMethod',mapping : 'sterilingMethod'}] + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'name', mapping: 'name' }, + { name: 'tousseType', mapping: 'tousseType' }, + { name: 'packageType', mapping: 'packageType' }, + { name: 'sterilingMethod', mapping: 'sterilingMethod' }] ), sortInfo: { - field: 'spelling', - direction: 'ASC' // or 'DESC' + field: 'spelling', + direction: 'ASC' // or 'DESC' } }); function addAndEditForeignProxyDisinfection(id) { - + var foldersJsonStore = new Ext.data.SimpleStore({ - fields : [ 'id','typeName' ], - url : WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getSterilizerType.do' + fields: ['id', 'typeName'], + url: WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getSterilizerType.do' }); var packTypeStore = new Ext.data.SimpleStore({ - fields : [ 'typeName' ], - url : WWWROOT + '/disinfectSystem/baseData/expirationDateInfoAction!getPackageType.do' + fields: ['typeName'], + url: WWWROOT + '/disinfectSystem/baseData/expirationDateInfoAction!getPackageType.do' }); foreignItemStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/foreignProxyDisinfectionAction!loadForeignItemsById.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/foreignProxyDisinfectionAction!loadForeignItemsById.do', + method: 'POST' }), - reader : foreignProxyJsonReader + reader: foreignProxyJsonReader }); var departUsersStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/systemmanage/user/userAction!loadUsersBySearchString.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/systemmanage/user/userAction!loadUsersBySearchString.do', + method: 'POST' }), - reader : userReader + reader: userReader }); - + var applyDepartStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ] + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] ) }); var settleAccountsDepartStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ] + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] ) }); - + var foreignProxyHandleDepartStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/systemmanage/getCssdsByApplyDepartAndType.do', - method : 'POST' - }), - reader : new Ext.data.JsonReader({ - root : 'data' - },[ - /*{name : 'cssdOrgUnitId',mapping : 'cssdOrgUnitId'},*/ - {name : 'cssdOrgUnitCode',mapping : 'cssdOrgUnitCode'}, - {name : 'name',mapping : 'cssdOrgUnitName'} - ] - ), - listeners:{ - beforeload : function(store,option) { - if(top.Ext.getCmp('departCoding').getValue() == ''){ - alert('请先选择申请科室!'); - return false; - } - option.params['applyDepartCode'] = top.Ext.getCmp('departCoding').getValue(); - }, - load : function(store,option) { - //如果结果只有一个,默认选中第一条 - if(store.getCount() == 1){ - top.Ext.getCmp('handleDepart').setValue(store.getAt(0).data.name); - top.Ext.getCmp('handleDepartCoding').setValue(store.getAt(0).data.cssdOrgUnitCode); - } - } - } + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/systemmanage/getCssdsByApplyDepartAndType.do', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + /*{name : 'cssdOrgUnitId',mapping : 'cssdOrgUnitId'},*/ + { name: 'cssdOrgUnitCode', mapping: 'cssdOrgUnitCode' }, + { name: 'name', mapping: 'cssdOrgUnitName' } + ] + ), + listeners: { + beforeload: function (store, option) { + if (top.Ext.getCmp('departCoding').getValue() == '') { + alert('请先选择申请科室!'); + return false; + } + option.params['applyDepartCode'] = top.Ext.getCmp('departCoding').getValue(); + }, + load: function (store, option) { + //如果结果只有一个,默认选中第一条 + if (store.getCount() == 1) { + top.Ext.getCmp('handleDepart').setValue(store.getAt(0).data.name); + top.Ext.getCmp('handleDepartCoding').setValue(store.getAt(0).data.cssdOrgUnitCode); + } + } + } }); foreignItemStore.removeAll(); - if(id){//修改 - foreignItemStore.on("beforeload", function(thiz, options) { + if (id) {//修改 + foreignItemStore.on("beforeload", function (thiz, options) { thiz.baseParams["id"] = id; }); foreignItemStore.load(); } var cm = new top.Ext.grid.ColumnModel([{ - id : 'id', - dataIndex : 'id', - hidden : true - },{ - header : "物品", - dataIndex : 'tousseName', - width : 180, - menuDisabled: true, - renderer: showTousseInfoDiv - },{ - id : 'count', - header : "数量", - dataIndex : 'count', - width : 80, - menuDisabled: true, - editor : new top.Ext.form.NumberField({ - minValue : 1, - maxValue : 9999, - allowBlank : false, - allowDecimals : false, - style : 'text-align: left', - allowNegative : false, - listeners : { - focus : function(thiz){ - thiz.selectText(); - } + id: 'id', + dataIndex: 'id', + hidden: true + }, { + header: "物品", + dataIndex: 'tousseName', + width: 180, + menuDisabled: true, + renderer: showTousseInfoDiv + }, { + id: 'count', + header: "数量", + dataIndex: 'count', + width: 80, + menuDisabled: true, + editor: new top.Ext.form.NumberField({ + minValue: 1, + maxValue: 9999, + allowBlank: false, + allowDecimals: false, + style: 'text-align: left', + allowNegative: false, + listeners: { + focus: function (thiz) { + thiz.selectText(); } - }) - },{ - id : 'packageTypeCM', - header : "包装类型", - dataIndex : 'packageType', - width : 200, - menuDisabled: true, - editor : new top.Ext.form.ComboBox({ - xtype : 'combo', - fieldLabel : '默认包装类型', - id : 'packageTypeCombo', - name : 'packageTypeCombo', - valueField : 'typeName', - displayField : 'typeName', - store : packTypeStore, - forceSelection : true, - lazyInit : false, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - anchor : '95%', - listeners : { - select : function(combo, record, index) { - var selectedRecord = top.Ext.getCmp('foreignProxyDisinfectionGrid').getSelectionModel().getSelected(); - var currentPackageType = selectedRecord.data.packageType; - if(checkItemIsRepeat(selectedRecord.data.tousseName, record.data.typeName, selectedRecord.data.sterilingType, selectedRecord.id)){ - showResult("此记录项在"+entityName+"单明细中已存在"); - combo.setValue(currentPackageType); - }else{ - combo.setValue(record.data.typeName); - } + } + }) + }, { + id: 'packageTypeCM', + header: "包装类型", + dataIndex: 'packageType', + width: 200, + menuDisabled: true, + editor: new top.Ext.form.ComboBox({ + xtype: 'combo', + fieldLabel: '默认包装类型', + id: 'packageTypeCombo', + name: 'packageTypeCombo', + valueField: 'typeName', + displayField: 'typeName', + store: packTypeStore, + forceSelection: true, + lazyInit: false, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + anchor: '95%', + listeners: { + select: function (combo, record, index) { + var selectedRecord = top.Ext.getCmp('foreignProxyDisinfectionGrid').getSelectionModel().getSelected(); + var currentPackageType = selectedRecord.data.packageType; + if (checkItemIsRepeat(selectedRecord.data.tousseName, record.data.typeName, selectedRecord.data.sterilingType, selectedRecord.id)) { + showResult("此记录项在" + entityName + "单明细中已存在"); + combo.setValue(currentPackageType); + } else { + combo.setValue(record.data.typeName); } } - }) - },{ - id : 'sterilingTypeCM', - header : "灭菌程序", - dataIndex : 'sterilingType', - width : 200, - menuDisabled: true, - editor : new top.Ext.form.ComboBox({ - xtype : 'combo', - id : 'sterilingTypeCombo', - name : 'sterilingTypeCombo', - valueField : 'typeName', - displayField : 'typeName', - store : foldersJsonStore, - forceSelection : true, - lazyInit : false, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - anchor : '95%', - listeners : { - select : function(combo, record, index) { - var selectedRecord = top.Ext.getCmp('foreignProxyDisinfectionGrid').getSelectionModel().getSelected(); - var currentSterilingType = selectedRecord.data.sterilingType; - if(checkItemIsRepeat(selectedRecord.data.tousseName, selectedRecord.data.packageType, record.data.typeName, selectedRecord.id)){ - showResult("此记录项在"+entityName+"单明细中已存在"); - combo.setValue(currentSterilingType); - }else{ - combo.setValue(record.data.typeName); - } + } + }) + }, { + id: 'sterilingTypeCM', + header: "灭菌程序", + dataIndex: 'sterilingType', + width: 200, + menuDisabled: true, + editor: new top.Ext.form.ComboBox({ + xtype: 'combo', + id: 'sterilingTypeCombo', + name: 'sterilingTypeCombo', + valueField: 'typeName', + displayField: 'typeName', + store: foldersJsonStore, + forceSelection: true, + lazyInit: false, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + anchor: '95%', + listeners: { + select: function (combo, record, index) { + var selectedRecord = top.Ext.getCmp('foreignProxyDisinfectionGrid').getSelectionModel().getSelected(); + var currentSterilingType = selectedRecord.data.sterilingType; + if (checkItemIsRepeat(selectedRecord.data.tousseName, selectedRecord.data.packageType, record.data.typeName, selectedRecord.id)) { + showResult("此记录项在" + entityName + "单明细中已存在"); + combo.setValue(currentSterilingType); + } else { + combo.setValue(record.data.typeName); } } - }) - },{ - id : 'deleteItem', - header : '删除操作', - menuDisabled: true, - dataIndex : 'button', - renderer : function(v, p, record) { - var str = ""; - return str; } + }) + }, { + id: 'deleteItem', + header: '删除操作', + menuDisabled: true, + dataIndex: 'button', + renderer: function (v, p, record) { + var str = ""; + return str; + } }]); - - - var form = new top.Ext.FormPanel( { - id : 'proxyDisinfectionForm', - frame : true, - border : 0, - labelSeparator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - labelAlign:'right', - autoHeight : true, - autoScroll : true, - items : [{ - xtype:"fieldset", - layout:'column', - title :'基础信息', - autoHeight:true, - items:[{ - layout : 'column', - items : [{ - xtype : 'hidden', - name : 'id', - id : 'id' - },{ - xtype : 'hidden', - name : 'serialNumber', - id : 'serialNumber' - },{ - xtype : 'hidden', - name : 'sterilizationUser', - id : 'sterilizationUser' - },{ - xtype : 'hidden', - name : 'itemIds', - id : 'itemIds' - },{ - xtype : 'hidden', - name : 'departCoding', - id : 'departCoding' - },{ - xtype : 'hidden', - name : 'settleAccountsDepartCoding', - id : 'settleAccountsDepartCoding' - },{ - xtype : 'hidden', - name : 'handleDepartCoding', - id : 'handleDepartCoding' - },{ - xtype : 'hidden', - name : 'applicantCode', - id : 'applicantCode', - value:$Id('userCode').value + + + var form = new top.Ext.FormPanel({ + id: 'proxyDisinfectionForm', + frame: true, + border: 0, + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + labelAlign: 'right', + autoHeight: true, + autoScroll: true, + items: [{ + xtype: "fieldset", + layout: 'column', + title: '基础信息', + autoHeight: true, + items: [{ + layout: 'column', + items: [{ + xtype: 'hidden', + name: 'id', + id: 'id' }, { - columnWidth : .5, - layout : 'form', - labelWidth : 70, - items : [{ - xtype : 'combo', - fieldLabel : '申请科室', - id : 'depart', - name : 'depart', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : applyDepartStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : false, - anchor : '100%', - listeners:{ - select:function(combo, record, index){ - top.Ext.getCmp("depart").setValue(record.data.name); - top.Ext.getCmp("departCoding").setValue(record.data.id); - - top.Ext.getCmp('settleAccountsDepart').setValue(record.data.name); - top.Ext.getCmp('settleAccountsDepartCoding').setValue(record.data.id); - - //simon-update:根据"申请科室"值,查询对应设置的"结算科室" - DWREngine.setAsync(false); - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', - params : {'orgUnitCode':record.data.id,'type':3}, - timeout : 600000, - success : function(response, options) { - var result= Ext4.JSON.decode(response.responseText); - //simon-add:如果申请科室配置的默认结算科室不为空,那么设置此值为页面结算科室默认值 - if(!isUndefinedOrNullOrEmpty(result.settleAccountsDepart)&&!isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)){ - top.Ext.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); - top.Ext.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); - } - }, - failure : function(response, opts) { - showResult(response.responseText); + xtype: 'hidden', + name: 'serialNumber', + id: 'serialNumber' + }, { + xtype: 'hidden', + name: 'sterilizationUser', + id: 'sterilizationUser' + }, { + xtype: 'hidden', + name: 'itemIds', + id: 'itemIds' + }, { + xtype: 'hidden', + name: 'departCoding', + id: 'departCoding' + }, { + xtype: 'hidden', + name: 'settleAccountsDepartCoding', + id: 'settleAccountsDepartCoding' + }, { + xtype: 'hidden', + name: 'handleDepartCoding', + id: 'handleDepartCoding' + }, { + xtype: 'hidden', + name: 'applicantCode', + id: 'applicantCode', + value: $Id('userCode').value + }, { + columnWidth: .5, + layout: 'form', + labelWidth: 70, + items: [{ + xtype: 'combo', + fieldLabel: '申请科室', + id: 'depart', + name: 'depart', + queryParam: 'spell', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: applyDepartStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: false, + anchor: '100%', + listeners: { + select: function (combo, record, index) { + top.Ext.getCmp("depart").setValue(record.data.name); + top.Ext.getCmp("departCoding").setValue(record.data.id); + + top.Ext.getCmp('settleAccountsDepart').setValue(record.data.name); + top.Ext.getCmp('settleAccountsDepartCoding').setValue(record.data.id); + + //simon-update:根据"申请科室"值,查询对应设置的"结算科室" + DWREngine.setAsync(false); + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', + params: { 'orgUnitCode': record.data.id, 'type': 3 }, + timeout: 600000, + success: function (response, options) { + var result = Ext4.JSON.decode(response.responseText); + //simon-add:如果申请科室配置的默认结算科室不为空,那么设置此值为页面结算科室默认值 + if (!isUndefinedOrNullOrEmpty(result.settleAccountsDepart) && !isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)) { + top.Ext.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); + top.Ext.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); } - }); - DWREngine.setAsync(true); - - - // foreignProxyHandleDepartStore.proxy.extraParams.applyDepartCode = record.data.id; - // foreignProxyHandleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType_Tousse; - foreignProxyHandleDepartStore.load({ - params : { - tousseType : invoicePlanForTousseType_Tousse, - applyDepartCode : record.data.id - }, - callback: function(records, operation, success) { - var record = records; - if (records.length == 1){ - record = records[0]; - top.Ext.getCmp("handleDepartCoding").setValue(record.data.cssdOrgUnitCode); - top.Ext.getCmp('handleDepart').setValue(record.data.name); - } + }, + failure: function (response, opts) { + showResult(response.responseText); + } + }); + DWREngine.setAsync(true); + + + // foreignProxyHandleDepartStore.proxy.extraParams.applyDepartCode = record.data.id; + // foreignProxyHandleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType_Tousse; + foreignProxyHandleDepartStore.load({ + params: { + tousseType: invoicePlanForTousseType_Tousse, + applyDepartCode: record.data.id + }, + callback: function (records, operation, success) { + var record = records; + if (records.length == 1) { + record = records[0]; + top.Ext.getCmp("handleDepartCoding").setValue(record.data.cssdOrgUnitCode); + top.Ext.getCmp('handleDepart').setValue(record.data.name); } - }); - } + } + }); } + } }] }, { - columnWidth : .5, - layout : 'form', - labelWidth : 70, - items : [{ - xtype : 'combo', - fieldLabel : '结算科室', - id : 'settleAccountsDepart', - name : 'settleAccountsDepart', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : settleAccountsDepartStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : false, - anchor : '100%', - listeners:{ - select:function(combo, record, index){ - top.Ext.getCmp("settleAccountsDepart").setValue(record.data.name); - top.Ext.getCmp("settleAccountsDepartCoding").setValue(record.data.id); - } + columnWidth: .5, + layout: 'form', + labelWidth: 70, + items: [{ + xtype: 'combo', + fieldLabel: '结算科室', + id: 'settleAccountsDepart', + name: 'settleAccountsDepart', + queryParam: 'spell', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: settleAccountsDepartStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: false, + anchor: '100%', + listeners: { + select: function (combo, record, index) { + top.Ext.getCmp("settleAccountsDepart").setValue(record.data.name); + top.Ext.getCmp("settleAccountsDepartCoding").setValue(record.data.id); } + } }] - },{ - columnWidth : .5, - layout : 'form', - labelWidth : 70, - items : [ + }, { + columnWidth: .5, + layout: 'form', + labelWidth: 70, + items: [ { - xtype : 'combo', - fieldLabel : '处理科室', - id : 'handleDepart', - name : 'handleDepart', - queryParam : 'spell', - minChars : 0, - valueField : 'cssdOrgUnitCode', - displayField : 'name', - store : foreignProxyHandleDepartStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - editable : false, - anchor : '100%', - listeners:{ - select:function(combo, record, index){ + xtype: 'combo', + fieldLabel: '处理科室', + id: 'handleDepart', + name: 'handleDepart', + queryParam: 'spell', + minChars: 0, + valueField: 'cssdOrgUnitCode', + displayField: 'name', + store: foreignProxyHandleDepartStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + editable: false, + anchor: '100%', + listeners: { + select: function (combo, record, index) { var handleDepartCoding = top.Ext.getCmp("handleDepart").getValue(); top.Ext.getCmp("handleDepartCoding").setValue(handleDepartCoding); //截取科室名称 var handleDepart = top.Ext.getCmp("handleDepart").getRawValue(); - if(handleDepart != ""){ + if (handleDepart != "") { this.setValue(handleDepart); } }, - focus : function(thiz){ + focus: function (thiz) { thiz.selectText(); } } } - ] - },{ - columnWidth : .5, - layout : 'form', - labelWidth : 70, - items : [{ - xtype : 'textfield', - fieldLabel : '申请人', - maxLength : '16', - anchor : '100%', - id : 'applicant', - name : 'applicant', - allowBlank : false, - value : $Id('userName').value, - readOnly : true, - fieldCls : 'fieldReadOnlyNoRemoveAndTop' - }] - },{ - columnWidth : .5, - layout : 'form', - labelWidth : 70, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '申请时间', - id : 'applicationTimeStr', - name : 'applicationTimeStr', + ] + }, { + columnWidth: .5, + layout: 'form', + labelWidth: 70, + items: [{ + xtype: 'textfield', + fieldLabel: '申请人', + maxLength: '16', + anchor: '100%', + id: 'applicant', + name: 'applicant', allowBlank: false, - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - editable : false, - format : 'Y-m-d H:i', - anchor : '100%' + value: $Id('userName').value, + readOnly: true, + fieldCls: 'fieldReadOnlyNoRemoveAndTop' }] }, { - columnWidth : 1, - layout : 'form', - labelWidth : 70, - items : [{ - xtype : 'textarea', - height : 45, - fieldLabel : '备注', - id : 'remark', - name : 'remark', - allowBlank : true, - anchor : '100%' + columnWidth: .5, + layout: 'form', + labelWidth: 70, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '申请时间', + id: 'applicationTimeStr', + name: 'applicationTimeStr', + allowBlank: false, + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + editable: false, + format: 'Y-m-d H:i', + anchor: '100%' }] + }, { + columnWidth: 1, + layout: 'form', + labelWidth: 70, + items: [{ + xtype: 'textarea', + height: 45, + fieldLabel: '备注', + id: 'remark', + name: 'remark', + allowBlank: true, + anchor: '100%' + }] }] }] - },{ - xtype:"fieldset", - layout:'column', - title :entityName+'单明细', - autoHeight:true, - items:[{ - layout : 'form', - columnWidth : 1, - items :[new top.Ext.grid.EditorGridPanel({ - id : 'foreignProxyDisinfectionGrid', - store : foreignItemStore, - bodyStyle : 'border:1px solid #afd7af', - cm : cm, - width :720, - height : 200, + }, { + xtype: "fieldset", + layout: 'column', + title: entityName + '单明细', + autoHeight: true, + items: [{ + layout: 'form', + columnWidth: 1, + items: [new top.Ext.grid.EditorGridPanel({ + id: 'foreignProxyDisinfectionGrid', + store: foreignItemStore, + bodyStyle: 'border:1px solid #afd7af', + cm: cm, + width: 720, + height: 200, viewConfig: { - forceFit: true - }, - border : true, - frame : false, - clicksToEdit : 1,// 设置点击几次才可编辑 - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false + forceFit: true + }, + border: true, + frame: false, + clicksToEdit: 1,// 设置点击几次才可编辑 + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false }), - tbar : [{ - text : '物品名称:' - },{ - xtype : 'combo', - id : 'package1', - name : 'package1', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'name', - width : (fontSizeScale == 1)?200:180/fontSizeScale, - store : foreignProxyTousseStore, - forceSelection : true, - lazyInit : true, - editable:true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : true, - anchor : '97%', - listeners : { - specialkey : function(field, ee) { + tbar: [{ + text: '物品名称:' + }, { + xtype: 'combo', + id: 'package1', + name: 'package1', + queryParam: 'spell', + minChars: 0, + valueField: 'id', + displayField: 'name', + width: (fontSizeScale == 1) ? 200 : 180 / fontSizeScale, + store: foreignProxyTousseStore, + forceSelection: true, + lazyInit: true, + editable: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: true, + anchor: '97%', + listeners: { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { top.Ext.getCmp('packageType1').focus(); } }, - select : function(combo, record, index) { + select: function (combo, record, index) { top.Ext.getCmp('packageType1').setValue(record.data.packageType); top.Ext.getCmp('sterilingType1').setValue(record.data.sterilingMethod); top.Ext.getCmp('tousseType1').setValue(record.data.tousseType); } } - },{ - xtype : 'hidden', - name : 'tousseType1', - id : 'tousseType1' - },{ - text : '包装类型:' - },{ - xtype : 'combo', - id : 'packageType1', - name : 'packageType1', - valueField : 'typeName', - displayField : 'typeName', - store : packTypeStore, - width : (fontSizeScale == 1)?80:100/fontSizeScale, - editable:false, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : true, - anchor : '97%', - listeners : { - specialkey : function(field, ee) { + }, { + xtype: 'hidden', + name: 'tousseType1', + id: 'tousseType1' + }, { + text: '包装类型:' + }, { + xtype: 'combo', + id: 'packageType1', + name: 'packageType1', + valueField: 'typeName', + displayField: 'typeName', + store: packTypeStore, + width: (fontSizeScale == 1) ? 80 : 100 / fontSizeScale, + editable: false, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: true, + anchor: '97%', + listeners: { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { top.Ext.getCmp('sterilingType1').focus(); } } } - },{ - text : '灭菌程序:' - },{ - xtype : 'combo', - id : 'sterilingType1', - name : 'sterilingType1', - valueField : 'typeName', - displayField : 'typeName', - store : foldersJsonStore, - width : (fontSizeScale == 1)?80:100/fontSizeScale, - editable:false, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : true, - anchor : '97%', - listeners : { - specialkey : function(field, ee) { + }, { + text: '灭菌程序:' + }, { + xtype: 'combo', + id: 'sterilingType1', + name: 'sterilingType1', + valueField: 'typeName', + displayField: 'typeName', + store: foldersJsonStore, + width: (fontSizeScale == 1) ? 80 : 100 / fontSizeScale, + editable: false, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: true, + anchor: '97%', + listeners: { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { top.Ext.getCmp('count1').focus(); } } } - },{ - text : '数量:' - },{ - xtype : 'numberfield', - id : 'count1', - name : 'count1', - style : 'text-align: left', - anchor : '95%', - maxValue:9999, - width : (fontSizeScale == 1)?50:50/fontSizeScale, - allowNegative : false, - allowDecimals : false, - listeners : { - specialkey : function(field, ee) { + }, { + text: '数量:' + }, { + xtype: 'numberfield', + id: 'count1', + name: 'count1', + style: 'text-align: left', + anchor: '95%', + maxValue: 9999, + width: (fontSizeScale == 1) ? 50 : 50 / fontSizeScale, + allowNegative: false, + allowDecimals: false, + listeners: { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { addForeignProxyDisinfectionItem(); } } } - },{ - text : '添加', - id : 'addTousseBt', - iconCls : 'btn_ext_add', - handler : function() { + }, { + text: '添加', + id: 'addTousseBt', + iconCls: 'btn_ext_add', + handler: function () { addForeignProxyDisinfectionItem(); } }] })] - }] + }] }], - buttonAlign :'center', - buttons : [{ - id :'saveBtn', - text : '提交', - hidden:(id==""?false:true), - handler : function(){ - top.Ext.MessageBox.confirm("请确认","是否提交"+entityName+"单信息?",function(btn) { - if(btn=='yes') { - if(!form.getForm().isValid()){ + buttonAlign: 'center', + buttons: [{ + id: 'saveBtn', + text: '提交', + hidden: (id == "" ? false : true), + handler: function () { + top.Ext.MessageBox.confirm("请确认", "是否提交" + entityName + "单信息?", function (btn) { + if (btn == 'yes') { + if (!form.getForm().isValid()) { showResult('请正确填写表单各值'); return false; } - - if(foreignItemStore.getCount()<1){ - showResult(entityName+'物品列表不能为空'); + + if (foreignItemStore.getCount() < 1) { + showResult(entityName + '物品列表不能为空'); return false; } - + //获取grid数据 getEditerGridData(); - + var submitActionUrl = WWWROOT + '/disinfectSystem/foreignProxyDisinfectionAction!saveForeignProxyDisinfection.do'; form.form.submit({ - url : submitActionUrl, - method : 'POST', - timeout : 10000000, - waitMsg : '正在后台进行处理,请稍候', - waitTitle : '提交表单', - success : function(form, action) { - if(!action.result.failure){ + url: submitActionUrl, + method: 'POST', + timeout: 10000000, + waitMsg: '正在后台进行处理,请稍候', + waitTitle: '提交表单', + success: function (form, action) { + if (!action.result.failure) { showResult("保存成功。"); window.close(); grid.dwrReload(); - }else{ + } else { showResult(action.result.msg); } }, - failure : function(form, action) { + failure: function (form, action) { showResult(action.result.msg); } }); } }); } - },{ - id :'printBtn', - text : '打印', - hidden:false, - handler : function(){ + }, { + id: 'printBtn', + text: '打印', + hidden: false, + handler: function () { top.Ext.MessageBox.confirm("请确认", "要打印本申请单吗?", - function(btn) { - if (btn == 'yes') { - var depart = top.Ext.getCmp("depart").getValue(); - batchPrintForeignProxyDisinfectionApplications(id,depart ,0,""); - } - }); + function (btn) { + if (btn == 'yes') { + var depart = top.Ext.getCmp("depart").getValue(); + batchPrintForeignProxyDisinfectionApplications(id, depart, 0, ""); + } + }); } - },{ - text : '取消', - handler : function() { + }, { + text: '取消', + handler: function () { window.close(); } }] }); - - var window = new top.Ext.Window( { - id : 'foreignProxyDisinfectionWin', - layout : 'fit', - title : entityName + '单信息', - width : 760, - modal : true, - border : false, - autoHeight : true, - plain : true, - items : [ form ] + + var window = new top.Ext.Window({ + id: 'foreignProxyDisinfectionWin', + layout: 'fit', + title: entityName + '单信息', + width: 760, + modal: true, + border: false, + autoHeight: true, + plain: true, + items: [form] }); - + window.show(); - if(id){ - form.form.load( { - url : WWWROOT + '/disinfectSystem/foreignProxyDisinfectionAction!loadForeignProxyDisinfection.do', - method : 'GET', - waitMsg : '正在加载数据,请稍候', - success : function(form, action) { + if (id) { + form.form.load({ + url: WWWROOT + '/disinfectSystem/foreignProxyDisinfectionAction!loadForeignProxyDisinfection.do', + method: 'GET', + waitMsg: '正在加载数据,请稍候', + success: function (form, action) { top.Ext.getCmp('applicationTimeStr').setValue(formatDateYear(action.result.data.applicationTime)); }, - failure : function(form, action) { + failure: function (form, action) { }, - params : { - id : id + params: { + id: id } }); } - - if(!id){ + + if (!id) { var depart = $Id('depart').value; var departCoding = $Id('departCoding').value; top.Ext.getCmp('depart').setValue(depart); @@ -888,40 +888,40 @@ top.Ext.getCmp('settleAccountsDepartCoding').setValue(departCoding); //simon-add:根据申请科室编码查找此申请科室设置的默认结算科室;如果没有配置默认的结算科室,那么结算科室默认显示为可结算的申请科室 DWREngine.setAsync(false); - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', - params : {'orgUnitCode':departCoding,'type':3}, - timeout : 600000, - success : function(response, options) { - var result= Ext4.JSON.decode(response.responseText); - if(!isUndefinedOrNullOrEmpty(result.settleAccountsDepart)&&!isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)){ - top.Ext.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSupplyRoomConfigByCoding.do', + params: { 'orgUnitCode': departCoding, 'type': 3 }, + timeout: 600000, + success: function (response, options) { + var result = Ext4.JSON.decode(response.responseText); + if (!isUndefinedOrNullOrEmpty(result.settleAccountsDepart) && !isUndefinedOrNullOrEmpty(result.settleAccountsDepartCoding)) { + top.Ext.getCmp('settleAccountsDepart').setValue(result.settleAccountsDepart); top.Ext.getCmp('settleAccountsDepartCoding').setValue(result.settleAccountsDepartCoding); } }, - failure : function(response, opts) { + failure: function (response, opts) { showResult(response.responseText); } }); DWREngine.setAsync(true); -// top.Ext.getCmp('applicationTimeStr').setValue(Ext.util.Format.date(new Date(), 'Y-m-d H:i')); + // top.Ext.getCmp('applicationTimeStr').setValue(Ext.util.Format.date(new Date(), 'Y-m-d H:i')); setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'applicationTimeStr'); //(设置申请时间,取服务器时间 cjr) - + // foreignProxyHandleDepartStore.proxy.extraParams.applyDepartCode = $Id('departCoding').value; // foreignProxyHandleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType_Tousse; foreignProxyHandleDepartStore.load({ - params : { - applyDepartCode : $Id('departCoding').value, - tousseType : invoicePlanForTousseType_Tousse + params: { + applyDepartCode: $Id('departCoding').value, + tousseType: invoicePlanForTousseType_Tousse }, - callback: function(records, operation, success) { + callback: function (records, operation, success) { var record = records; - if (records.length == 1){ + if (records.length == 1) { record = records[0]; } } }); - + //光标定位到“物品名称combo” top.Ext.getCmp("package1").focus('', 10); }