Index: ssts-web/src/main/webapp/systemmanage/orgUnitExtView.js
===================================================================
diff -u -r38878 -r41593
--- ssts-web/src/main/webapp/systemmanage/orgUnitExtView.js (.../orgUnitExtView.js) (revision 38878)
+++ ssts-web/src/main/webapp/systemmanage/orgUnitExtView.js (.../orgUnitExtView.js) (revision 41593)
@@ -1,130 +1,130 @@
//********* 按钮响应函数 ***********
-function addOrgUnit(){
- var parentId = $Id('parm_s_parentId').value;
- if(parentId.trim()==""){
- alert("请选择组织单位!");
- return false;
- }
- location.href=WWWROOT + "/systemmanage/orgUnitExt.jsp?parentId="+parentId+"&editMode=true";
+function addOrgUnit() {
+ var parentId = $Id('parm_s_parentId').value;
+ if (parentId.trim() == "") {
+ alert("请选择组织单位!");
+ return false;
+ }
+ location.href = WWWROOT + "/systemmanage/orgUnitExt.jsp?parentId=" + parentId + "&editMode=true";
}
-function deleteOrgUnit(){
- var ids = grid.getSelectedValues('id', ';');
- if(ids==""){
- alert("请选择要删除的组织单位!");
- return false;
- }
- Ext.MessageBox.confirm("请确认","是否确定要删除选中的组织机构?",function(button, text){
- if("yes" == button){
- OrgUnitTableManager.deleteOrgUnitByKeyIds(ids, function(result){
- if(result){
- var jsonObj = Ext.decode(result);
- if(jsonObj.success){
- reloadTreeAndTable();
- }else{
- showResult(jsonObj.message);
- }
- }
- });
+function deleteOrgUnit() {
+ var ids = grid.getSelectedValues('id', ';');
+ if (ids == "") {
+ alert("请选择要删除的组织单位!");
+ return false;
+ }
+ Ext.MessageBox.confirm("请确认", "是否确定要删除选中的组织机构?", function (button, text) {
+ if ("yes" == button) {
+ OrgUnitTableManager.deleteOrgUnitByKeyIds(ids, function (result) {
+ if (result) {
+ var jsonObj = Ext.decode(result);
+ if (jsonObj.success) {
+ reloadTreeAndTable();
+ } else {
+ showResult(jsonObj.message);
+ }
+ }
+ });
}
- });
+ });
}
// 停用/启用科室
-function disableOrEnableDefinition (isDisabled,grid) {
- var ids = grid.getSelectedValues('id', ';');
- Ext.Ajax.request({
- url: WWWROOT + '/systemmanage/disableOrEnableOrgUnit.do',
- params: {
- ids : ids,
- isDisabled : isDisabled
- },
- success: function(response ,options){
- var jsonObj = Ext.decode(response.responseText);
- if(jsonObj!=null && jsonObj.length!=0){
- if(jsonObj.success){
+function disableOrEnableDefinition(isDisabled, grid) {
+ var ids = grid.getSelectedValues('id', ';');
+ Ext.Ajax.request({
+ url: WWWROOT + '/systemmanage/disableOrEnableOrgUnit.do',
+ params: {
+ ids: ids,
+ isDisabled: isDisabled
+ },
+ success: function (response, options) {
+ var jsonObj = Ext.decode(response.responseText);
+ if (jsonObj != null && jsonObj.length != 0) {
+ if (jsonObj.success) {
alert(isDisabled + '成功!');
$Id("parm_s_status").value = 1;
root.reload();
- grid.dwrReload();
- }else{
- alert(isDisabled + '失败!');
- }
- }
- },
- failure: function(){
- alert(isDisabled + '失败!');
- }
- });
+ grid.dwrReload();
+ } else {
+ alert(isDisabled + '失败!');
+ }
+ }
+ },
+ failure: function () {
+ alert(isDisabled + '失败!');
+ }
+ });
}
-function search(searchText,searchId){
- if(searchText!=null && searchText.length!=0){
- var treePanel = viewport.findById('west-panel');
- Ext.Ajax.request({
- url: WWWROOT + '/systemmanage/loadOrgUnitById.do',
- params: {orgUnitId:searchId},
- success: function(response ,options){
+function search(searchText, searchId) {
+ if (searchText != null && searchText.length != 0) {
+ var treePanel = viewport.findById('west-panel');
+ Ext.Ajax.request({
+ url: WWWROOT + '/systemmanage/loadOrgUnitById.do',
+ params: { orgUnitId: searchId },
+ success: function (response, options) {
var jsonObj = Ext.decode(response.responseText);
- if(jsonObj!=null && jsonObj.length!=0){
- if(jsonObj.success){
- treePanel.expandPath(jsonObj.data,'id',function(bSuccess, oLastNode){
- if(!bSuccess) return;
- //focus 节点,并选中节点!,以下代码不可少
- oLastNode.on('click',function(node,event){
- reloadGrid(node.id);
- });
- oLastNode.ensureVisible();
- oLastNode.select();
- oLastNode.fireEvent('click', oLastNode);
- });
- }else{
- alert('没有找到相关的组织结构!');
- }
- }
- },
- failure: function(){
- alert('没有找到相关的组织结构!');
- }
- });
- }else{
- alert('请输入组织机构名称!');
- }
+ if (jsonObj != null && jsonObj.length != 0) {
+ if (jsonObj.success) {
+ treePanel.expandPath(jsonObj.data, 'id', function (bSuccess, oLastNode) {
+ if (!bSuccess) return;
+ //focus 节点,并选中节点!,以下代码不可少
+ oLastNode.on('click', function (node, event) {
+ reloadGrid(node.id);
+ });
+ oLastNode.ensureVisible();
+ oLastNode.select();
+ oLastNode.fireEvent('click', oLastNode);
+ });
+ } else {
+ alert('没有找到相关的组织结构!');
+ }
+ }
+ },
+ failure: function () {
+ alert('没有找到相关的组织结构!');
+ }
+ });
+ } else {
+ alert('请输入组织机构名称!');
+ }
}
-function moveOrgUnit(){
+function moveOrgUnit() {
var sourceOrgUnitKeyId = grid.getSelectedValues('id', ';');
- if(sourceOrgUnitKeyId==null||sourceOrgUnitKeyId==""){
- alert("请选择要移动的组织");
- return ;
+ if (sourceOrgUnitKeyId == null || sourceOrgUnitKeyId == "") {
+ alert("请选择要移动的组织");
+ return;
}
-
- var destinationOrgUnitKeyIdArray = openModalWindowForExt(WWWROOT + '/common/selOrgUnit.jsp?onlyOneOrg=yes','', '选择部门', '800', '400');
-
- if(destinationOrgUnitKeyIdArray == undefined){
+
+ var destinationOrgUnitKeyIdArray = openModalWindowForExt(WWWROOT + '/common/selOrgUnit.jsp?onlyOneOrg=yes', '', '选择部门', '800', '400');
+
+ if (destinationOrgUnitKeyIdArray == undefined) {
return;
- }else {
- var loop = setInterval(function() {
- if(destinationOrgUnitKeyIdArray.hidden) {
+ } else {
+ var loop = setInterval(function () {
+ if (destinationOrgUnitKeyIdArray.hidden) {
clearInterval(loop);
var returnValue = destinationOrgUnitKeyIdArray.returnValue || [];
- if(returnValue.length > 0){
+ if (returnValue.length > 0) {
var destinationOrgUnitKeyId = returnValue[0];
- if(sourceOrgUnitKeyId==destinationOrgUnitKeyId){
- alert("源组织不能与目标组织相同");
- return ;
+ if (sourceOrgUnitKeyId == destinationOrgUnitKeyId) {
+ alert("源组织不能与目标组织相同");
+ return;
}
- OrgUnitTableManager.moveOrgUnitByKeyIds(sourceOrgUnitKeyId,destinationOrgUnitKeyId,function(){reloadTreeAndTable();});
+ OrgUnitTableManager.moveOrgUnitByKeyIds(sourceOrgUnitKeyId, destinationOrgUnitKeyId, function () { reloadTreeAndTable(); });
}
- }
- },500);
+ }
+ }, 500);
}
}
-function moveUp(id){
- OrgUnitTableManager.moveUpOrgUnit(id, function(){reloadTreeAndTable();});
+function moveUp(id) {
+ OrgUnitTableManager.moveUpOrgUnit(id, function () { reloadTreeAndTable(); });
}
-function moveDown(id){
- OrgUnitTableManager.moveDownOrgUnit(id, function(){reloadTreeAndTable();});
+function moveDown(id) {
+ OrgUnitTableManager.moveDownOrgUnit(id, function () { reloadTreeAndTable(); });
}
@@ -135,142 +135,142 @@
*/
function handleSetAutoSyncOrgUnit(synWin, checkTimeId) {
var timeSet = Ext.getCmp(checkTimeId);
- if (!timeSet.isValid()){
+ if (!timeSet.isValid()) {
return;
}
DataSynchronizationTableManager.autoSync(timeSet.getValue(), 'orgUnit', {
- callback:function(data){
+ callback: function (data) {
showResult(data);
synWin.close();
reloadTreeAndTable();
},
- errorHandler:function(msg){
+ errorHandler: function (msg) {
showResult('设置主动同步科室发生异常');
synWin.close();
},
- timeout:240000//超时时间4分钟
+ timeout: 240000//超时时间4分钟
});
}
/**
* 自动同步用户
*/
-function autoSyncOrgUnit(){
+function autoSyncOrgUnit() {
var buttons = [
- {text: "确定", handler: function () {handleSetAutoSyncOrgUnit(synWin, 'timeSet');}},
- {text: "取消", handler: function (obj) {synWin.close();}}
+ { text: "确定", handler: function () { handleSetAutoSyncOrgUnit(synWin, 'timeSet'); } },
+ { text: "取消", handler: function (obj) { synWin.close(); } }
];
var synWin = new Ext.Window({
- title:"设置自动同步时间",
+ title: "设置自动同步时间",
width: 400,
height: 120,
// plain: true,
modal: true,
layout: "form",
bodyStyle: "padding-top: 10px; padding-left:10px;",
- items:[{
+ items: [{
xtype: "textfield",
- id : 'timeSet',
+ id: 'timeSet',
regex: /^[1-9]\d*$/,
regexText: '请输入大于零的整数!',
- fieldLabel : "时间(分)",
- emptyText : "输入分钟....",
+ fieldLabel: "时间(分)",
+ emptyText: "输入分钟....",
listeners: {
- specialkey: function(field, e){
+ specialkey: function (field, e) {
if (e.getKey() === e.ENTER) {
handleSetAutoSyncOrgUnit(synWin, 'timeSet');
}
}
}
}],
- showLock:false,
+ showLock: false,
buttons: buttons
});
synWin.show();
}
function syncOrgUnit() {
- Ext.MessageBox.confirm("请确认","是否确定要同步组织机构信息?",function(button, text){
- if("yes" == button){
+ Ext.MessageBox.confirm("请确认", "是否确定要同步组织机构信息?", function (button, text) {
+ if ("yes" == button) {
var mask = new Ext.LoadMask(Ext.getBody(), {
- msg : "同步组织机构中...由于数据量比较大,更新时间可能比较长,请耐心等待。如超过4分钟,页面还没有响应,请手动刷新页面!"
+ msg: "同步组织机构中...由于数据量比较大,更新时间可能比较长,请耐心等待。如超过4分钟,页面还没有响应,请手动刷新页面!"
});
mask.show();
DataSynchronizationTableManager.syncOrgUnit({
- callback:function(data){
- if (data == 'success') {
+ callback: function (data) {
+ if (data == 'success') {
showResult("同步成功");
reloadTreeAndTable();
} else if (data == 'error') {
- showResult("同步失败");
+ showResult("同步失败");
} else {
- showResult(data);
+ showResult(data);
}
mask.hide();
},
- errorHandler:function(msg){
- mask.hide();
+ errorHandler: function (msg) {
+ mask.hide();
},
- timeout:240000//超时时间4分钟
+ timeout: 240000//超时时间4分钟
});
-
+
//执行一次的定时器
- setTimeout(function(){
+ setTimeout(function () {
showResult("服务器正在处理中,请稍后刷新页面查看结果!");
mask.hide();
reloadTreeAndTable();
- },240000);//超时时间4分钟
+ }, 240000);//超时时间4分钟
}
});
}
function syncOrgUnitAndUser() {
- Ext.MessageBox.confirm("请确认","是否确定要同步组织机构与用户信息?",function(button, text){
- if("yes" == button){
+ Ext.MessageBox.confirm("请确认", "是否确定要同步组织机构与用户信息?", function (button, text) {
+ if ("yes" == button) {
var mask = new Ext.LoadMask(Ext.getBody(), {
- msg : "同步组织机构中...由于数据量比较大,更新时间可能比较长,请耐心等待。如超过4分钟,页面还没有响应,请手动刷新页面!"
+ msg: "同步组织机构中...由于数据量比较大,更新时间可能比较长,请耐心等待。如超过4分钟,页面还没有响应,请手动刷新页面!"
});
mask.show();
- //超时时间4分钟
+ //超时时间4分钟
var timeoutMillionSeconds = 240 * 1000;
DataSynchronizationTableManager.syncOrgUnitAndUser({
- callback:function(success){
- result = success;
- if (success) {
+ callback: function (success) {
+ result = success;
+ if (success) {
showResult("同步成功");
reloadTreeAndTable();
} else {
- showResult("同步失败");
+ showResult("同步失败");
}
mask.hide();
},
- errorHandler:function(msg){
- showResult("服务器正在处理中,请稍后刷新页面查看结果!");
- mask.hide();
+ errorHandler: function (msg) {
+ showResult("服务器正在处理中,请稍后刷新页面查看结果!");
+ mask.hide();
},
- timeout:timeoutMillionSeconds //超时时间4分钟
+ timeout: timeoutMillionSeconds //超时时间4分钟
});
}
});
}
-function reloadTreeAndTable(){
- root.reload();
-
- var treePanel = viewport.findById('west-panel');
- treePanel.expandPath(path);
+function reloadTreeAndTable() {
+ root.reload();
+
+ var treePanel = viewport.findById('west-panel');
+ treePanel.expandPath(path);
//树没有打开所有之前打开的节点,只打开了最近的一个。
$Id("parm_s_status").value = 1;
- grid.dwrReload();
+ grid.dwrReload();
}
-function reloadGrid(parentId){
- if(typeof(parentId) == "undefined" || typeof(parentId) == "object" || null == parentId || parentId == "" ){
- parentId = 0;
- }
+function reloadGrid(parentId) {
+ if (typeof (parentId) == "undefined" || typeof (parentId) == "object" || null == parentId || parentId == "") {
+ parentId = 0;
+ }
$Id("parm_s_parentId").value = parentId;
$Id("parm_s_status").value = 1;
- grid.dwrReload();
+ grid.dwrReload();
}
var entityName = "组织机构";
@@ -280,293 +280,329 @@
var path = '/0';
//组织机构Store
var orgJsonStore = new Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/systemmanage/getOrgNameBySpellingAndWB!getOrgNameBySpellingAndWB.do',
- method : 'POST'
+ proxy: new Ext.data.HttpProxy({
+ url: WWWROOT + '/systemmanage/getOrgNameBySpellingAndWB!getOrgNameBySpellingAndWB.do',
+ method: 'POST'
}),
- baseParams :{
- showDisableOrgUnit : false
- },
- reader : new Ext.data.JsonReader({
- root : 'data'
- },[
- {name : 'name',mapping : 'name',id:'id'}
- ]
+ baseParams: {
+ showDisableOrgUnit: false
+ },
+ reader: new Ext.data.JsonReader({
+ root: 'data'
+ }, [
+ { name: 'name', mapping: 'name', id: 'id' }
+ ]
)
});
-Ext.onReady(function(){
+Ext.onReady(function () {
Ext.QuickTips.init();
$Id("parm_s_status").value = 1;
-//********* 1、Tree ***********
+ //********* 1、Tree ***********
root = new Ext.tree.AsyncTreeNode({
- text:'组织机构',
- id:'0',
- draggable:false, //这棵树不可以拖动默认也是false
- listeners :{click: reloadGrid}
+ text: '组织机构',
+ id: '0',
+ draggable: false, //这棵树不可以拖动默认也是false
+ listeners: { click: reloadGrid }
});
-
- var myLoader = new Ext.tree.TreeLoader({dataUrl:WWWROOT + '/systemmanage/orgUnitTreeLoad.do?showDisableOrgUnit=false'});
-
- myLoader.on("beforeload", function(treeLoader, node){
+
+ var myLoader = new Ext.tree.TreeLoader({ dataUrl: WWWROOT + '/systemmanage/orgUnitTreeLoad.do?showDisableOrgUnit=false' });
+
+ myLoader.on("beforeload", function (treeLoader, node) {
treeLoader.baseParams.parentId = node.id;
- treeLoader.baseParams.showDisableOrgUnit = true;
+ treeLoader.baseParams.showDisableOrgUnit = true;
var nodePath = node.getPath();
- if(nodePath != '/0'){
- path = nodePath;
- }
+ if (nodePath != '/0') {
+ path = nodePath;
+ }
});
-
-//********* 2、布局 ***********
-
-//********* 2、ForgonGrid ***********
- function gotoPage(v, p, record){
- ///systemmanage/orgUnit.mhtml?id=54
- return "" + v + "";
+ //********* 2、布局 ***********
+
+
+ //********* 2、ForgonGrid ***********
+ function gotoPage(v, p, record) {
+ ///systemmanage/orgUnit.mhtml?id=54
+ return "" + v + "";
}
-
- function moveUpDown(v, p, record){
- var html = '';
- html += '
';
- html += '';
- html += '
';
- return html;
+
+ function moveUpDown(v, p, record) {
+ var html = '';
+ html += '
';
+ html += '';
+ html += '
';
+ return html;
}
-
+
var columns = [
- {id:'operationDescription', header: "名称", width: 150, dataIndex: 'name', renderer : gotoPage, sortable: false},
- {id :'barcode',header : '条码',width: 120, dataIndex: 'barcode', sortable: false},
- {header: "部门编码", width: 120, dataIndex: 'orgUnitCoding', sortable: false, menuDisabled: true,hidden:sstsConfig.enableThirdPartyDepartmentCoding},
- {header: "部门编码", width: 120, dataIndex: 'orgForeignKey', sortable: false, menuDisabled: true,hidden:!sstsConfig.enableThirdPartyDepartmentCoding},
- {header: "负责人", width: 120, dataIndex: 'principal', sortable: false, menuDisabled: true},
- {header: "分管领导", width: 120, dataIndex: 'subLeadName', sortable: false, menuDisabled: true},
- {header: "拼音码", width: 120, dataIndex: 'spelling', sortable: false, menuDisabled: true},
- {header: "五笔码", width: 120, dataIndex: 'wbCode', sortable: false, menuDisabled: true},
- {header: "数据来源", width: 100, dataIndex: 'source', sortable: false, menuDisabled: true}, //(陈家儒改)
- {header: "一次性物品价格浮动系数", width: 150, dataIndex: 'disposablePriceFluctuation', sortable: false, menuDisabled: true},
- {id : 'order',header: "排序操作", width: 150, dataIndex: 'id', renderer : moveUpDown, sortable: false, menuDisabled: true}
+ { id: 'operationDescription', header: "名称", width: 150, dataIndex: 'name', renderer: gotoPage, sortable: false },
+ { id: 'barcode', header: '条码', width: 120, dataIndex: 'barcode', sortable: false },
+ { header: "部门编码", width: 120, dataIndex: 'orgUnitCoding', sortable: false, menuDisabled: true, hidden: sstsConfig.enableThirdPartyDepartmentCoding },
+ { header: "部门编码", width: 120, dataIndex: 'orgForeignKey', sortable: false, menuDisabled: true, hidden: !sstsConfig.enableThirdPartyDepartmentCoding },
+ { header: "CHAS 管控标识", width: 120, dataIndex: 'chasControlTag', sortable: false, menuDisabled: true, hidden: !sstsConfig.enableChasSystemTagPush },
+ { header: "CHAS 管控科室名称", width: 120, dataIndex: 'chasDeptName', sortable: false, menuDisabled: true, hidden: !sstsConfig.enableChasSystemTagPush },
+ { header: "CHAS 管控科室编码", width: 120, dataIndex: 'chasDeptCode', sortable: false, menuDisabled: true, hidden: !sstsConfig.enableChasSystemTagPush },
+ { header: "负责人", width: 120, dataIndex: 'principal', sortable: false, menuDisabled: true },
+ { header: "分管领导", width: 120, dataIndex: 'subLeadName', sortable: false, menuDisabled: true },
+ { header: "拼音码", width: 120, dataIndex: 'spelling', sortable: false, menuDisabled: true },
+ { header: "五笔码", width: 120, dataIndex: 'wbCode', sortable: false, menuDisabled: true },
+ { header: "数据来源", width: 100, dataIndex: 'source', sortable: false, menuDisabled: true },
+ { header: "一次性物品价格浮动系数", width: 150, dataIndex: 'disposablePriceFluctuation', sortable: false, menuDisabled: true },
+ { id: 'order', header: "排序操作", width: 150, dataIndex: 'id', renderer: moveUpDown, sortable: false, menuDisabled: true }
];
-
+
var readerDetail = [
- {name: 'id'},
- {name: 'parentId'},
- {name: 'name'},
- {name: 'barcode'},
- {name: 'orgUnitCoding'},
- {name: 'orgForeignKey'},
- {name: 'principal'},
- {name: 'spelling'},
- {name: 'wbCode'},
- {name: 'source'},
- {name: 'disposablePriceFluctuation'},
- {name: 'subLeadName'}
+ { name: 'id' },
+ { name: 'parentId' },
+ { name: 'name' },
+ { name: 'barcode' },
+ { name: 'orgUnitCoding' },
+ { name: 'chasControlTag' },
+ { name: 'chasDeptName' },
+ { name: 'chasDeptCode' },
+ { name: 'orgForeignKey' },
+ { name: 'principal' },
+ { name: 'spelling' },
+ { name: 'wbCode' },
+ { name: 'source' },
+ { name: 'disposablePriceFluctuation' },
+ { name: 'subLeadName' }
];
-
+
var filters = new Ext.grid.GridFilters({
- filters:[
- {type: 'string', dataIndex: 'name'}
- ]});
-
- var tbar= [{
- text:"同步组织机构数据",
- tooltip : '同步组织机构数据',
- iconCls : 'icon_refresh',
- hidden : sstsConfig.hiddenOrgunitSyncButton,
- handler:function(){
+ filters: [
+ { type: 'string', dataIndex: 'name' }
+ ]
+ });
+
+ var tbar = [{
+ text: "同步组织机构数据",
+ tooltip: '同步组织机构数据',
+ iconCls: 'icon_refresh',
+ hidden: sstsConfig.hiddenOrgunitSyncButton,
+ handler: function () {
syncOrgUnit();
- }
- },'-',{
- text:"同步组织机构与用户数据",
- tooltip : '同步组织机构与用户数据',
- iconCls : 'icon_refresh',
- hidden : !sstsConfig.showOrgunitAndUserSyncButton,
- handler:function(){
- syncOrgUnitAndUser();
- }
- },'-',{
- text : '自动同步组织机构数据',
- tooltip:'自动同步组织机构数据',
- iconCls:'icon_refresh',
- hidden : !sstsConfig.showAutoSyn,
- handler:function(){
+ }
+ }, '-', {
+ text: "同步组织机构与用户数据",
+ tooltip: '同步组织机构与用户数据',
+ iconCls: 'icon_refresh',
+ hidden: !sstsConfig.showOrgunitAndUserSyncButton,
+ handler: function () {
+ syncOrgUnitAndUser();
+ }
+ }, '-', {
+ text: '自动同步组织机构数据',
+ tooltip: '自动同步组织机构数据',
+ iconCls: 'icon_refresh',
+ hidden: !sstsConfig.showAutoSyn,
+ handler: function () {
autoSyncOrgUnit();
}
- },'-',{
- text:'添加',
- tooltip:'添加'+entityName,
- iconCls:'btn_ext_add',
- hidden :false,
- handler:function(){addOrgUnit();}
}, '-', {
- text:'删除',
- tooltip:'删除选择'+entityName,
- iconCls:'btn_remove',
- hidden :false,
- handler:function (){deleteOrgUnit(grid);}
+ text: '添加',
+ tooltip: '添加' + entityName,
+ iconCls: 'btn_ext_add',
+ hidden: false,
+ handler: function () { addOrgUnit(); }
}, '-', {
- text:'移动',
- tooltip:'移动选择'+entityName,
- iconCls:'btn_ext_refresh',
- hidden :false,
- handler:function (){moveOrgUnit(grid);}
+ text: '删除',
+ tooltip: '删除选择' + entityName,
+ iconCls: 'btn_remove',
+ hidden: false,
+ handler: function () { deleteOrgUnit(grid); }
}, '-', {
- text:'打印标签',
- iconCls:'icon_print',
- hidden :false,
- handler:function (){
- var sm = grid.getSelectionModel(); // 获得grid的SelectionModel
- if(sm.getSelected()){
- var recs=sm.getSelections(); // 把所有选中项放入数组
- for(var i=0;i>
- Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function(){};
+ Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function () { };
grid = new Ext.ux.ForgonPageGrid({
- tbar:tbar,
- pageSize:30,
- defaultSortField:'parent.id , sequenceNumber',
- defaultSortDirection:'ASC',
- isCheckboxSelectionModel:true,
- plugins: filters,
- columns: columns,
- autoExpandColumn: 'order',
- searchDisableIndexes:['id','barcode'],
- rememberSelected:false,
- frame:true
- },
+ tbar: tbar,
+ pageSize: 30,
+ defaultSortField: 'parent.id , sequenceNumber',
+ defaultSortDirection: 'ASC',
+ isCheckboxSelectionModel: true,
+ plugins: filters,
+ columns: columns,
+ autoExpandColumn: 'order',
+ searchDisableIndexes: ['id', 'barcode'],
+ rememberSelected: false,
+ frame: true
+ },
readerDetail,
OrgUnitTableManager.findOrgUnitTableList,
dwrCallParams //这个参数只是占位作用
);
-
+
var store = grid.getStore();
- store.on("beforeload", function(thiz, options) {
- Ext.getBody().mask("正在加载中,请稍候...");
- });
-
- store.on("load", function(thiz, options) {
- Ext.getBody().unmask();
- });
-
+ store.on("beforeload", function (thiz, options) {
+ Ext.getBody().mask("正在加载中,请稍候...");
+ });
+
+ store.on("load", function (thiz, options) {
+ Ext.getBody().unmask();
+ });
+
viewport = new Ext.Viewport({
- layout:'border',
- items:[{ //西面的树
- region:'west',
- id:'west-panel',
- lines : false,
- margins : '0 0 5 5',
- cmargins : '0 0 0 0',
- layout : 'accordion',
- layoutConfig : {
- animate : true
+ layout: 'border',
+ items: [{ //西面的树
+ region: 'west',
+ id: 'west-panel',
+ lines: false,
+ margins: '0 0 5 5',
+ cmargins: '0 0 0 0',
+ layout: 'accordion',
+ layoutConfig: {
+ animate: true
},
collapsible: true, //允许折叠
- animCollapse:true, //折叠时是否有动画效果
+ animCollapse: true, //折叠时是否有动画效果
split: true, //是否允许拖动大小,与下面的折叠形式配合
- collapseMode:'mini', //折叠形式
+ collapseMode: 'mini', //折叠形式
width: 200,
- minSize : 100,
- maxSize : 400,
+ minSize: 100,
+ maxSize: 400,
xtype: 'treepanel',
loader: myLoader, //数据加载
autoScroll: true,
root: root,
- tbar:[
+ tbar: [
new Ext.Action({
text: '展开',
- handler: function(){
+ handler: function () {
var treePanel = viewport.findById('west-panel');
treePanel.expandAll();
}
- }),'-',
+ }), '-',
new Ext.Action({
text: '折叠',
- handler: function(){
+ handler: function () {
var treePanel = viewport.findById('west-panel');
treePanel.collapseAll();
}
- }),'-',
+ }), '-',
{
- xtype : 'combo',
- id : 'searchField',
- name : 'searchField',
- queryParam : 'spell',
- minChars : 0,
- emptyText:'输入组织机构名称查询',
- hideLabel :true,
- valueField : 'id',
- displayField : 'name',
- store : orgJsonStore,
- forceSelection : true,
- lazyInit : true,
- width:60,
- listWidth:200,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- anchor : '100%',
- listeners:{
- select:function(combo, record, index){
+ xtype: 'combo',
+ id: 'searchField',
+ name: 'searchField',
+ queryParam: 'spell',
+ minChars: 0,
+ emptyText: '输入组织机构名称查询',
+ hideLabel: true,
+ valueField: 'id',
+ displayField: 'name',
+ store: orgJsonStore,
+ forceSelection: true,
+ lazyInit: true,
+ width: 60,
+ listWidth: 200,
+ triggerAction: 'all',
+ hideTrigger: true,
+ typeAhead: false,
+ allowBlank: true,
+ anchor: '100%',
+ listeners: {
+ select: function (combo, record, index) {
Ext.getCmp('searchField').setValue(record.data.name);
Ext.getCmp('searchID').setValue(record.json.id);
- search(record.data.name,record.json.id);
- }
- }
- },{
- xtype : 'combo',
- id : 'searchID',
- name : 'searchID',
- hidden:true
- },{
- text:'查询',
- handler:function(){
+ search(record.data.name, record.json.id);
+ }
+ }
+ }, {
+ xtype: 'combo',
+ id: 'searchID',
+ name: 'searchID',
+ hidden: true
+ }, {
+ text: '查询',
+ handler: function () {
var searchText = Ext.getCmp('searchField').getValue();
var searchId = Ext.getCmp('searchID').getValue();
- search(searchText,searchId);
- }
+ search(searchText, searchId);
+ }
}
]
- },{ //中间的数据表格
- region:'center',
- xtype : 'panel',
- margins : '0 0 0 0',
-// autoScroll:true,
- layout:'fit',
- items:grid
+ }, { //中间的数据表格
+ region: 'center',
+ xtype: 'panel',
+ margins: '0 0 0 0',
+ // autoScroll:true,
+ layout: 'fit',
+ items: grid
}]
});
-//********* 4、完成 ***********
+ //********* 4、完成 ***********
root.expand(false, /*no anim*/ false);
-
+
});
\ No newline at end of file
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;
+ }
});