Index: ssts-web/src/main/webapp/systemmanage/orgUnitExt.js =================================================================== diff -u -r38880 -r41593 --- ssts-web/src/main/webapp/systemmanage/orgUnitExt.js (.../orgUnitExt.js) (revision 38880) +++ ssts-web/src/main/webapp/systemmanage/orgUnitExt.js (.../orgUnitExt.js) (revision 41593) @@ -1,565 +1,659 @@ -var isNotRepeatCoding = true; -var isNotRepeatName = true; //(陈家儒改) +var isNotRepeatCoding = true; +var isNotRepeatName = true; //(陈家儒改) var oldName = null; //打开用户选择界面,GGSRMYY-129问题后,负责人,分管领导,包含用户都用同一个公共的方法去维护 -function changeUser(action){ +function changeUser(action) { var userIdsElement; var userNamesElement; - if(action == 'includeUsers'){ + if (action == 'includeUsers') { userIdsElement = Ext.getCmp("userIds") || top.Ext.getCmp("userIds"); userNamesElement = Ext.getCmp("userNames") || top.Ext.getCmp("userNames"); - }else if(action == 'leader'){ + } else if (action == 'leader') { userIdsElement = Ext.getCmp(action + "Ids") || top.Ext.getCmp(action + "Ids"); userNamesElement = Ext.getCmp(action + "Names") || top.Ext.getCmp(action + "Names"); - }else { + } else { userIdsElement = Ext.getCmp("userIds") || top.Ext.getCmp("userIds"); userNamesElement = Ext.getCmp("principal") || top.Ext.getCmp("principal"); } var params = { - userIdsElement:userIdsElement, - userNamesElement:userNamesElement, - action:action + userIdsElement: userIdsElement, + userNamesElement: userNamesElement, + action: action } openSelectUser(params); } -Ext.onReady(function(){ +Ext.onReady(function () { Ext.QuickTips.init(); - var id = getURLParameter('id',''); - var parentId = getURLParameter('parentId','0'); + + var getAllChasDeptStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/web/chasOrgUnitController/getAllChasDept.mhtml', + method: 'POST' + }), + reader: new top.Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'chasDeptCode' }, + { name: 'chasDeptName' } + ]) + }); + var id = getURLParameter('id', ''); + var parentId = getURLParameter('parentId', '0'); var formObj = new Ext.FormPanel({ labelAlign: 'left', - frame:true, - labelSeparator:':', + frame: true, + labelSeparator: ':', title: '组织机构管理', - bodyStyle:'padding:5px 5px 0px 25px', + bodyStyle: 'padding:5px 5px 0px 25px', width: 600, - labelWidth:90, + labelWidth: 90, items: [{ - xtype:'hidden', - id:'id', - name: 'id' - },{ - xtype:'hidden', - id:'parentId', - name: 'parentId' - },{ - xtype:'hidden', - id:'userIds', + xtype: 'hidden', + id: 'id', + name: 'id' + }, { + xtype: 'hidden', + id: 'parentId', + name: 'parentId' + }, { + xtype: 'hidden', + id: 'userIds', name: 'userIds' - },{ - xtype:'hidden', - id:'leaderIds', - name:'leaderIds' - },{ - xtype:'hidden', - id:'leaderIds', - name:'leaderIds' - },{ - xtype:'hidden', - id:'type', - name:'type', - value : '科室' - },{ - xtype: 'textfield', + }, { + xtype: 'hidden', + id: 'leaderIds', + name: 'leaderIds' + }, { + xtype: 'hidden', + id: 'leaderIds', + name: 'leaderIds' + }, { + xtype: 'hidden', + id: 'type', + name: 'type', + value: '科室' + }, { + xtype: 'textfield', fieldLabel: '上级组织机构', name: 'nodePath', id: 'nodePath', width: 400, - allowBlank:false, - blankText:'', - readOnly : true, - cls:'fieldReadOnlyNoRemove', - msgTarget:'side' - },{ + allowBlank: false, + blankText: '', + readOnly: true, + cls: 'fieldReadOnlyNoRemove', + msgTarget: 'side' + }, { fieldLabel: '负责人', width: 400, - xtype : 'trigger', - name: 'principal', + xtype: 'trigger', + name: 'principal', id: 'principal', - readOnly:true, - onTriggerClick : function(){changeUser("principal")}, - triggerClass : 'x-form-search-trigger' - },{ + readOnly: true, + onTriggerClick: function () { changeUser("principal") }, + triggerClass: 'x-form-search-trigger' + }, { fieldLabel: '分管领导', width: 400, - xtype : 'trigger', - name: 'leaderNames', + xtype: 'trigger', + name: 'leaderNames', id: 'leaderNames', - readOnly:true, - onTriggerClick : function(){changeUser("leader")}, - triggerClass : 'x-form-search-trigger' - },{ + readOnly: true, + onTriggerClick: function () { changeUser("leader") }, + triggerClass: 'x-form-search-trigger' + }, { fieldLabel: '包含用户', width: 400, - xtype : 'trigger', - readOnly:true, - name: 'userNames', + xtype: 'trigger', + readOnly: true, + name: 'userNames', id: 'userNames', - onTriggerClick : function(){changeUser('includeUsers')}, - triggerClass : 'x-form-search-trigger' - },{ - layout:'column',//两列 - items:[{ - columnWidth:.5, - layout: 'form', + onTriggerClick: function () { changeUser('includeUsers') }, + triggerClass: 'x-form-search-trigger' + }, { + layout: 'column',//两列 + items: [{ + columnWidth: .5, + layout: 'form', defaultType: 'textfield', - labelSeparator:':', + labelSeparator: ':', items: [{ - xtype: 'textfield', + xtype: 'textfield', fieldLabel: '名称', name: 'name', id: 'name', width: 150, - allowBlank:false, - blankText:'', - invalidText:'名称不能为空!', - msgTarget:'side', - disabled:(enableEditBtn && !enableSaveBtn), + allowBlank: false, + blankText: '', + invalidText: '名称不能为空!', + msgTarget: 'side', + disabled: (enableEditBtn && !enableSaveBtn), listeners: { - 'render': function(c) { - c.getEl().on('keyup', function(key) { - screenSpecialKeyByExt(key, "name"); - }, c); - } - } - }] - },{ - columnWidth:.5, + 'render': function (c) { + c.getEl().on('keyup', function (key) { + screenSpecialKeyByExt(key, "name"); + }, c); + } + } + }] + }, { + columnWidth: .5, layout: 'form', defaultType: 'textfield', - labelWidth:80, - labelSeparator:':', + labelWidth: 80, + labelSeparator: ':', hidden: sstsConfig.enableThirdPartyDepartmentCoding, - items: [{ - xtype: 'textfield', + items: [{ + xtype: 'textfield', fieldLabel: '部门编码', name: 'orgUnitCoding', id: 'orgUnitCoding', width: 130, - allowBlank:sstsConfig.enableThirdPartyDepartmentCoding || false, - blankText:'', - invalidText:'部门编码不能为空!', - msgTarget:'side', - disabled:(enableEditBtn && !enableSaveBtn), + allowBlank: sstsConfig.enableThirdPartyDepartmentCoding || false, + blankText: '', + invalidText: '部门编码不能为空!', + msgTarget: 'side', + disabled: (enableEditBtn && !enableSaveBtn), listeners: { - 'render': function(c) { - c.getEl().on('keyup', function(key) { - screenSpecialKeyByExt(key,"orgUnitCoding"); - }, c); - } - } - }] - },{ - columnWidth:.5, + 'render': function (c) { + c.getEl().on('keyup', function (key) { + screenSpecialKeyByExt(key, "orgUnitCoding"); + }, c); + } + } + }] + }, { + columnWidth: .5, layout: 'form', defaultType: 'textfield', - labelWidth:80, - labelSeparator:':', + labelWidth: 80, + labelSeparator: ':', hidden: !sstsConfig.enableThirdPartyDepartmentCoding, - items: [{ - xtype: 'textfield', + items: [{ + xtype: 'textfield', fieldLabel: '部门编码', name: 'orgForeignKey', id: 'orgForeignKey', width: 130, - allowBlank:!sstsConfig.enableThirdPartyDepartmentCoding, - blankText:'', - invalidText:'部门编码不能为空!', - msgTarget:'side', - disabled:(enableEditBtn && !enableSaveBtn), + allowBlank: !sstsConfig.enableThirdPartyDepartmentCoding, + blankText: '', + invalidText: '部门编码不能为空!', + msgTarget: 'side', + disabled: (enableEditBtn && !enableSaveBtn), listeners: { - 'render': function(c) { - c.getEl().on('keyup', function(key) { - screenSpecialKeyByExt(key,"orgForeignKey"); - }, c); - } - } - }] + 'render': function (c) { + c.getEl().on('keyup', function (key) { + screenSpecialKeyByExt(key, "orgForeignKey"); + }, c); + } + } + }] }] - },{ - layout:'column',// - items:[{ - columnWidth:.5, + }, { + layout: 'column',// + items: [{ + columnWidth: .5, layout: 'form', defaultType: 'textfield', - labelSeparator:':', - items: [{ - xtype: 'textfield', + labelSeparator: ':', + items: [{ + xtype: 'textfield', fieldLabel: '联系电话', name: 'phoneNo', id: 'phoneNo', width: 150, - allowBlank:true, - blankText:'', - msgTarget:'side' - }] - },{ - columnWidth:.5, + allowBlank: true, + blankText: '', + msgTarget: 'side' + }] + }, { + columnWidth: .5, layout: 'form', defaultType: 'textfield', - labelSeparator:':', - labelWidth:80, - items: [{ - xtype: 'textfield', + labelSeparator: ':', + labelWidth: 80, + items: [{ + xtype: 'textfield', fieldLabel: '条码', name: 'barcode', id: 'barcode', width: 130, - allowBlank:true, - readOnly : true, - cls:'fieldReadOnlyNoRemove', - blankText:'', - msgTarget:'side' - }] + allowBlank: true, + readOnly: true, + cls: 'fieldReadOnlyNoRemove', + blankText: '', + msgTarget: 'side' + }] }] - },{ - layout:'column',// - items:[{ - columnWidth:.5, - layout: 'form', + }, { + layout: 'column',// + items: [{ + columnWidth: .5, + layout: 'form', defaultType: 'textfield', - labelSeparator:':', - items: [{ - xtype: 'textfield', + labelSeparator: ':', + items: [{ + xtype: 'textfield', fieldLabel: '传真', name: 'fax', id: 'fax', width: 150, - allowBlank:true, - blankText:'', - msgTarget:'side' - }] - },{ - columnWidth:.5, - layout: 'form', - labelWidth:60, - labelSeparator:':', + allowBlank: true, + blankText: '', + msgTarget: 'side' + }] + }, { + columnWidth: .5, + layout: 'form', + labelWidth: 60, + labelSeparator: ':', items: [ - new Ext.form.Radio({ - fieldLabel:'类型', - hideLabel:false, - name:'orgType', - itemCls:'float-left', - clearCls:'allow-float', - inputValue:1, - boxLabel:'公司' - }), - new Ext.form.Radio({ - name: 'orgType', - clearCls:'stop-float', - hideLabel:true, - inputValue:0, - checked:true, - boxLabel:'部门' - })] + new Ext.form.Radio({ + fieldLabel: '类型', + hideLabel: false, + name: 'orgType', + itemCls: 'float-left', + clearCls: 'allow-float', + inputValue: 1, + boxLabel: '公司' + }), + new Ext.form.Radio({ + name: 'orgType', + clearCls: 'stop-float', + hideLabel: true, + inputValue: 0, + checked: true, + boxLabel: '部门' + })] }] - },{ - layout:'column', - items:[ - { - columnWidth:.5, - layout: 'form', - labelSeparator:':', - items: [{ - xtype: 'textfield', - fieldLabel: '部门简码', - name: 'brevityCode', - id: 'brevityCode', - width: 150, - readOnly:true, - allowBlank:true - }] - } + }, { + layout: 'column', + items: [ + { + columnWidth: .5, + layout: 'form', + labelSeparator: ':', + items: [{ + xtype: 'textfield', + fieldLabel: '部门简码', + name: 'brevityCode', + id: 'brevityCode', + width: 150, + readOnly: true, + allowBlank: true + }] + } ] - },{ - layout:'column', - items:[ - { - columnWidth:.5, - layout: 'form', - labelSeparator:':', - items: [{ - xtype: 'textfield', - fieldLabel: '拼音码', - name: 'spelling', - id: 'spelling', - width: 150, - readOnly:true, - allowBlank:true - }] - },{ - columnWidth:.5, - layout: 'form', - labelSeparator:':', - items: [{ - xtype: 'textfield', - fieldLabel: '五笔码', - name: 'wbCode', - width: 125, - readOnly:true, - id: 'wbCode' - }] - } - ] - },{ - layout:'column', - items:[ - { - columnWidth:.5, - layout: 'form', - labelSeparator:':', - items: [{ - xtype: 'numberfield', - fieldLabel: '一次性物品价格浮动系数', - name: 'disposablePriceFluctuation', - id: 'disposablePriceFluctuation', - width: 150, - readOnly:true, - allowBlank : true, - allowNegative : false, - minValue :0.0001, - decimalPrecision: 4, - style : 'text-align: left', - allowDecimals : true - }] - } - ] }, { - xtype:'textarea', - name:'description', - id:'description', - fieldLabel:'职能', - height:60, + layout: 'column', + items: [{ + columnWidth: .5, + layout: 'form', + labelSeparator: ':', + items: [{ + xtype: 'textfield', + fieldLabel: '拼音码', + name: 'spelling', + id: 'spelling', + width: 150, + readOnly: true, + allowBlank: true + }] + }, { + columnWidth: .5, + layout: 'form', + labelSeparator: ':', + items: [{ + xtype: 'textfield', + fieldLabel: '五笔码', + name: 'wbCode', + width: 125, + readOnly: true, + id: 'wbCode' + }] + }] + }, { + layout: 'column', + items: [{ + columnWidth: .5, + layout: 'form', + labelSeparator: ':', + items: [{ + xtype: 'numberfield', + fieldLabel: '一次性物品价格浮动系数', + name: 'disposablePriceFluctuation', + id: 'disposablePriceFluctuation', + width: 150, + readOnly: true, + allowBlank: true, + allowNegative: false, + minValue: 0.0001, + decimalPrecision: 4, + style: 'text-align: left', + allowDecimals: true + }] + }] + }, { + layout: 'column', + hidden: !sstsConfig.enableChasSystemTagPush, + items: [{ + columnWidth: .5, + layout: 'form', + labelSeparator: ':', + items: [{ + xtype: 'combo', + fieldLabel: 'CHAS 管控标识', + name: 'chasControlTag', + id: 'chasControlTag', + valueField: 'value', + displayField: 'value', + editable: false, + store: new Ext.data.SimpleStore({ + fields: ['value'], + data: [['是'], ['否']] + }), + forceSelection: true, + mode: 'local', + triggerAction: 'all', + value: '否', + anchor: '96%', + listeners: { + select: function (combo, record, index) { + if (record.data.value == '是') { + Ext.getCmp('chasDeptNameBox').show(); + } else { + Ext.getCmp('chasDeptNameBox').hide(); + Ext.getCmp('chasDeptName').setValue(''); + Ext.getCmp('chasDeptCode').setValue(''); + } + } + } + }] + }] + }, { + layout: 'column', + hidden: !sstsConfig.enableChasSystemTagPush, + id: 'chasDeptNameBox', + items: [{ + columnWidth: .5, + layout: 'form', + labelSeparator: ':', + items: [{ + xtype: 'combo', + fieldLabel: 'CHAS 管控科室名称', + name: 'chasDeptName', + id: 'chasDeptName', + minChars: 0, + valueField: 'chasDeptName', + displayField: 'chasDeptName', + store: getAllChasDeptStore, + forceSelection: false, + lazyInit: true, + triggerAction: 'all', + typeAhead: false, + anchor: '96%', + listeners: { + select: function (combo, record, index) { + Ext.getCmp('chasDeptCode').setValue(record.data.chasDeptCode) + } + } + }] + }, { + columnWidth: .5, + layout: 'form', + labelSeparator: ':', + items: [{ + xtype: 'textfield', + fieldLabel: 'CHAS 管控科室编码', + id: 'chasDeptCode', + name: 'chasDeptCode', + readOnly: true + }] + }] + }, { + xtype: 'textarea', + name: 'description', + id: 'description', + fieldLabel: '职能', + height: 60, width: 400 }], buttons: [{ text: '打印预览', - handler: function(){printBarcode('',1)} - },{ + handler: function () { printBarcode('', 1) } + }, { text: '编辑', hidden: !enableEditBtn, handler: edit }, { - id:'saveAndPrint', + id: 'saveAndPrint', text: '保存并打印', hidden: !enableSaveBtn, handler: saveAndPrint - },{ - id:'saveBtn', + }, { + id: 'saveBtn', text: '保存', hidden: !enableSaveBtn, handler: save - },{ + }, { text: '保存并新建', - id:'saveAndNewBtn', + id: 'saveAndNewBtn', hidden: !enableSaveBtn, handler: saveAndNew - },{ + }, { text: '取消', - handler:gohistory + handler: gohistory }] }); formObj.render("formDiv"); formObj.form.load({ - url:WWWROOT+'/systemmanage/orgUnit/loadForm.do', - method:'GET', - waitMsg:'正在加载数据,请稍候', - success:function(form,action){ + url: WWWROOT + '/systemmanage/orgUnit/loadForm.do', + method: 'GET', + waitMsg: '正在加载数据,请稍候', + success: function (form, action) { + if (action.result.data) { + if (action.result.data.chasControlTag == '是' && sstsConfig.enableChasSystemTagPush) { + Ext.getCmp('chasDeptNameBox').show(); + } else { + Ext.getCmp('chasDeptNameBox').hide(); + } + } }, - failure:function(form, action){ + failure: function (form, action) { }, - params:{id:id,parentId:parentId} + params: { id: id, parentId: parentId } }); - - if(!enableSaveBtn){ - FormUtils.setReadOnly(formObj.form.el.dom, true); + + if (!enableSaveBtn) { + FormUtils.setReadOnly(formObj.form.el.dom, true); } - - function printBarcode(barcodeStr,type){ - var barcode = Ext.getCmp('barcode').getValue(); - if(barcode != null && barcode != ""){ - barcodeStr = barcode; - } - - var orgUnitName = Ext.getCmp('name').getValue(); - var name = ""; - DWREngine.setAsync(false); - SupplyRoomConfigTableManager.getUnitName(function(unitName){ - if(unitName != null && unitName != ""){ - name = unitName; - } - }); - DWREngine.setAsync(true); - printOrgUnitInfo(barcodeStr,orgUnitName,name,type); + + function printBarcode(barcodeStr, type) { + var barcode = Ext.getCmp('barcode').getValue(); + if (barcode != null && barcode != "") { + barcodeStr = barcode; + } + + var orgUnitName = Ext.getCmp('name').getValue(); + var name = ""; + DWREngine.setAsync(false); + SupplyRoomConfigTableManager.getUnitName(function (unitName) { + if (unitName != null && unitName != "") { + name = unitName; + } + }); + DWREngine.setAsync(true); + printOrgUnitInfo(barcodeStr, orgUnitName, name, type); } - - function save(){ - this.disable(); - if(!formObj.form.isValid()){ - Ext.MessageBox.show({title:'错误提示', msg:'请正确填写表单各值。',buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); - this.enable(); - return false; - } - if(!validateOrgCode()){ //如果此部门编码存在不给添加 - this.enable(); + + function save() { + this.disable(); + if (!formObj.form.isValid()) { + Ext.MessageBox.show({ title: '错误提示', msg: '请正确填写表单各值。', buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR }); + this.enable(); return false; } - formObj.form.submit({ - timeout:3*60, - url:WWWROOT+'/systemmanage/orgUnit/save.do', - method:'POST', - waitMsg:'正在保存数据,请稍候', - waitTitle:'提交表单', - scope : this, - success:function(form,action){ - history.go(-1); + if (!validateOrgCode()) { //如果此部门编码存在不给添加 + this.enable(); + return false; + } + formObj.form.submit({ + timeout: 3 * 60, + url: WWWROOT + '/systemmanage/orgUnit/save.do', + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + scope: this, + success: function (form, action) { + history.go(-1); }, - failure:function(form, action){ - showResult('保存失败!请联系系统管理员'); - this.enable(); + failure: function (form, action) { + showResult('保存失败!请联系系统管理员'); + this.enable(); } }); } - function saveAndPrint(){ - this.disable(); - if(!formObj.form.isValid()){ - Ext.MessageBox.show({title:'错误提示', msg:'请正确填写表单各值。',buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); - this.enable(); - return false; - } - if(!validateOrgCode()){ //如果此部门编码存在不给添加 - this.enable(); + function saveAndPrint() { + this.disable(); + if (!formObj.form.isValid()) { + Ext.MessageBox.show({ title: '错误提示', msg: '请正确填写表单各值。', buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR }); + this.enable(); return false; } - formObj.form.submit({ - timeout:3*60, - url:WWWROOT+'/systemmanage/orgUnit/save.do', - method:'POST', - waitMsg:'正在保存数据,请稍候', - waitTitle:'提交表单', - scope : this, - success:function(form,action){ - var barcodeStr = action.result.barcode; - history.go(-1); - printBarcode(barcodeStr,0); + if (!validateOrgCode()) { //如果此部门编码存在不给添加 + this.enable(); + return false; + } + formObj.form.submit({ + timeout: 3 * 60, + url: WWWROOT + '/systemmanage/orgUnit/save.do', + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + scope: this, + success: function (form, action) { + var barcodeStr = action.result.barcode; + history.go(-1); + printBarcode(barcodeStr, 0); }, - failure:function(form, action){ - showResult('保存失败!请联系系统管理员'); - this.enable(); + failure: function (form, action) { + showResult('保存失败!请联系系统管理员'); + this.enable(); } - }); - + }); + } - - function saveAndNew(){ - this.disable(); - if(!formObj.form.isValid()){ - Ext.MessageBox.show({title:'错误提示', msg:'请正确填写表单各值。',buttons:Ext.Msg.OK,icon:Ext.Msg.ERROR}); + + function saveAndNew() { + this.disable(); + if (!formObj.form.isValid()) { + Ext.MessageBox.show({ title: '错误提示', msg: '请正确填写表单各值。', buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR }); this.enable(); return false; } - if(!validateOrgCode()){ //如果此部门编码存在不给添加 - this.enable(); + if (!validateOrgCode()) { //如果此部门编码存在不给添加 + this.enable(); return false; } formObj.form.submit({ - timeout:3*60, - url:WWWROOT+'/systemmanage/orgUnit/save.do', - method:'POST', - waitMsg:'正在保存数据,请稍候', - waitTitle:'提交表单', - scope : this, - success:function(form,action){ - location.href=WWWROOT + "/systemmanage/orgUnitExt.jsp?parentId="+parentId+"&editMode=true"; + timeout: 3 * 60, + url: WWWROOT + '/systemmanage/orgUnit/save.do', + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + scope: this, + success: function (form, action) { + location.href = WWWROOT + "/systemmanage/orgUnitExt.jsp?parentId=" + parentId + "&editMode=true"; }, - failure:function(form, action){ - showResult('保存失败!请联系系统管理员'); - this.enable(); + failure: function (form, action) { + showResult('保存失败!请联系系统管理员'); + this.enable(); } }); } - - function edit(){ - oldName = Ext.getCmp('name').getValue(); //如果用户要更新则先把旧的部门名称接收起来 - this.setVisible(false); - Ext.getCmp('saveBtn').setVisible(true); - Ext.getCmp('saveAndNewBtn').setVisible(true); - Ext.getCmp('saveAndPrint').setVisible(true); - FormUtils.setReadOnly(formObj.form.el.dom, false); - if(sstsConfig.enableThirdPartyDepartmentCoding){ + + function edit() { + oldName = Ext.getCmp('name').getValue(); //如果用户要更新则先把旧的部门名称接收起来 + this.setVisible(false); + Ext.getCmp('saveBtn').setVisible(true); + Ext.getCmp('saveAndNewBtn').setVisible(true); + Ext.getCmp('saveAndPrint').setVisible(true); + FormUtils.setReadOnly(formObj.form.el.dom, false); + if (sstsConfig.enableThirdPartyDepartmentCoding) { Ext.getCmp('orgForeignKey').addClass('fieldReadOnlyNoRemove'); Ext.getCmp('orgForeignKey').disable(); - }else { + } else { Ext.getCmp('orgUnitCoding').addClass('fieldReadOnlyNoRemove'); Ext.getCmp('orgUnitCoding').disable(); } Ext.getCmp('name').enable(); - FormUtils.setSpecificElReadOnly(formObj.form.el.dom,['userNames'], true); - FormUtils.setSpecificElReadOnly(formObj.form.el.dom,['principal','subLeadName'], true); - FormUtils.setSpecificElReadOnly(formObj.form.el.dom,['wbCode','spelling'], true); - FormUtils.setSpecificElReadOnly(formObj.form.el.dom,['barcode','nodePath'], true); + FormUtils.setSpecificElReadOnly(formObj.form.el.dom, ['userNames'], true); + FormUtils.setSpecificElReadOnly(formObj.form.el.dom, ['principal', 'subLeadName'], true); + FormUtils.setSpecificElReadOnly(formObj.form.el.dom, ['wbCode', 'spelling'], true); + FormUtils.setSpecificElReadOnly(formObj.form.el.dom, ['barcode', 'nodePath'], true); + FormUtils.setSpecificElReadOnly(formObj.form.el.dom, ['chasDeptCode'], true); - Ext.getCmp('wbCode').addClass('fieldReadOnlyNoRemove'); - Ext.getCmp('spelling').addClass('fieldReadOnlyNoRemove'); + Ext.getCmp('wbCode').addClass('fieldReadOnlyNoRemove'); + Ext.getCmp('spelling').addClass('fieldReadOnlyNoRemove'); } - + //科室编码不可以相同,科室名称可以相同(下面注释掉的的方法两者都不可以相同) - function validateOrgCode(){ - if(StringUtils.isBlank(id)){ //新添加的操作,验证部门编码即可 - DWREngine.setAsync(false); - if(sstsConfig.enableThirdPartyDepartmentCoding){ - OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgForeignKey').getValue().Trim(),setIsRepeatCoding); - }else { - OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgUnitCoding').getValue().Trim(),setIsRepeatCoding); + function validateOrgCode() { + if (StringUtils.isBlank(id)) { //新添加的操作,验证部门编码即可 + DWREngine.setAsync(false); + if (sstsConfig.enableThirdPartyDepartmentCoding) { + OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgForeignKey').getValue().Trim(), setIsRepeatCoding); + } else { + OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgUnitCoding').getValue().Trim(), setIsRepeatCoding); } - DWREngine.setAsync(true); - } - - if (!isNotRepeatCoding){ - alert("部门编码已经存在,请重新输入!"); + DWREngine.setAsync(true); + } + + if (!isNotRepeatCoding) { + alert("部门编码已经存在,请重新输入!"); return false; } else { - return true; + return true; } - } - -// function validateOrgCodeAndName(){ -// if(StringUtils.isBlank(id)){ //新添加的操作,验证部门编码和部门名称 -// DWREngine.setAsync(false); -// OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgUnitCoding').getValue().Trim(),setIsRepeatCoding); -// OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); -// DWREngine.setAsync(true); -// } else { //更新的操作,就只验证部门名称就可以了 -// if (oldName != Ext.getCmp('name').getValue().Trim()) { //如果改部门的名称就要去后台验证此部门是不是已经存在 -// DWREngine.setAsync(false); -// OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); -// DWREngine.setAsync(true); -// } else { -// isNotRepeatName = true; -// } -// } -// -// if (isNotRepeatCoding){ -// if (isNotRepeatName) { //加一个校验如果存在这个名称的科室,也不给添加(陈家儒改) -// return true; -// } else { -// alert('部门名称已经存在,请重新输入!'); -// return false; -// } -// } else { -// alert("部门编码已经存在,请重新输入!"); -// return false; -// } -// } - - function setIsRepeatCoding(isRepeat){ + } + + // function validateOrgCodeAndName(){ + // if(StringUtils.isBlank(id)){ //新添加的操作,验证部门编码和部门名称 + // DWREngine.setAsync(false); + // OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgUnitCoding').getValue().Trim(),setIsRepeatCoding); + // OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); + // DWREngine.setAsync(true); + // } else { //更新的操作,就只验证部门名称就可以了 + // if (oldName != Ext.getCmp('name').getValue().Trim()) { //如果改部门的名称就要去后台验证此部门是不是已经存在 + // DWREngine.setAsync(false); + // OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); + // DWREngine.setAsync(true); + // } else { + // isNotRepeatName = true; + // } + // } + // + // if (isNotRepeatCoding){ + // if (isNotRepeatName) { //加一个校验如果存在这个名称的科室,也不给添加(陈家儒改) + // return true; + // } else { + // alert('部门名称已经存在,请重新输入!'); + // return false; + // } + // } else { + // alert("部门编码已经存在,请重新输入!"); + // return false; + // } + // } + + function setIsRepeatCoding(isRepeat) { isNotRepeatCoding = isRepeat; } - - - function setIsRepeatName(isRepeat){ - isNotRepeatName = isRepeat; - } + + + function setIsRepeatName(isRepeat) { + isNotRepeatName = isRepeat; + } });