- 浏览: 88793 次
- 性别:
- 来自: 武汉
文章分类
- 全部博客 (97)
- java (23)
- 自定义标签 (3)
- struts (7)
- SSI (0)
- SSH (6)
- IBATIS (14)
- hibernate (2)
- spring (2)
- ssl认证 (1)
- jstl (2)
- jstl中list嵌套map (0)
- ajax (2)
- lucene (2)
- js (5)
- servlet (1)
- jquery (0)
- javascript (7)
- struts1 (1)
- sql (7)
- 公司面试心得 (3)
- jdk (1)
- ERP行业必备的工具 (1)
- 数据库连接池 (1)
- 日志配置问题 (1)
- 呵呵 (0)
- DOJO (1)
- WS (0)
- 工作流JBPM (1)
- 開發工具準備 (1)
- 注解 (0)
- fdsfsdf (0)
- 分页 (0)
- oracle (1)
最新评论
-
kongchuijian:
System.out.println(Arrays.toStr ...
java中数组的问题 -
wyr123789:
你上面已经定义成字节型的为什么还要强转啊?还有你那个'z'-i ...
新手入门 -
ipanel420:
居然是茁壮的同事
SSH2整合+分页+ajax+js校验用户名 -
yemengfan:
楼主能不能把你这个项目发给我啊。我想看看! yemengfa ...
SSH2整合+分页+ajax+js校验用户名
dojo.provide("com.suning.ipd.rtcex.web.ui.page.DailyRelease");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dijit.form.DateTextBox");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.FilteringSelect");
dojo.require("com.ibm.team.repository.web.transport.ServiceResponseHandler");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit.form.ComboBox");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dojox.grid.DataGrid");
dojo.require("dijit.form.Textarea");
dojo.require("dojo.parser");
dojo.require("com.suning.ipd.rtcex.web.ui.page.common.CreateWidget");
dojo.require("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupSysPubDialog");
dojo.require("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog");
(function(){
var pub=null;
_URL = net.jazz.ajax.BootstrapProperties.FRONTSIDE_URL+"/service/com.suning.ipd.rtcex.service.ws.IRawMessageService/";
_ACTION = "dailyrelease.";
var PickupUserDialog=com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog;
var PlatformUI = net.jazz.ajax.ui.PlatformUI;
dojo.declare("com.suning.ipd.rtcex.web.ui.page.DailyRelease", [dijit._Widget, dijit._Templated], {
templatePath: dojo.moduleUrl("com.suning.ipd.rtcex.web", "ui/templates/DailyRelease.html"),
msgRequest:{"workflowargs":{},"bizfieldvalue":{"baseInfo":{},"resourceList":{}}},
msgResponse:{"workflowargs":{},"bizfieldvalue":{"baseInfo":{},"resourceList":{}}},
requestMessage:{"workflowargs":{},"bizfieldvalue":{"baseInfo":{}}},
//首先要执行的方法
postCreate: function(){
var ActionRegistry = PlatformUI.getWorkbench().getActionRegistry();
ActionRegistry.registerAction("com.suning.ipd.rtcex.web.dailyrelease.open", this, "_init");
},
_handleSaveClick: function(){
this.setHeaderMessage('保存成功!');
},
_handleHeaderMessageClick: function(e) {
},
clearValidationMessage: function() {
dojox.xml.parser.removeChildren(this.validationMessage);
this.validationMessageSpan.className= "validationMessageEmpty";
},
setHeaderMessage: function(messageText) {
this.clearValidationMessage();
this.validationMessageSpan.className= "validationMessageError";
dojox.xml.parser.removeChildren(this.validationMessage);
var messagesSpan= document.createElement("SPAN");
var div= document.createElement("DIV");
div.appendChild(document.createTextNode(messageText));
messagesSpan.appendChild(div);
this.validationMessage.appendChild(messagesSpan);
window.scrollTo(0,0); // show message
},
//显示页面
_init: function(args){
this.msgRequest.workflowargs = dojo.fromJson(decodeURIComponent(args.wfParams));
console.dir({"this.workflowargs":this.workflowargs});
console.dir({"this.msgRequest":this.msgRequest});
this.getInitData();
},
//从后台获取数据来初始化出面数据
getInitData: function(){
//从后台获取数据来初始化出面数据
var parent = this;
jazz.client.xhrGet({
url: _URL,
content: {
action: "dailyrelease.DailyReleaseInitAction", method: "Action", handleAs: "json", timeout: 50000,
args: dojo.toJson(this.msgRequest)
},
load:function(result) {
console.dir({result:dojo.fromJson(result)});
parent.msgResponse = dojo.fromJson(result);
parent.msgRequest.workflowargs = parent.msgResponse.workflowargs;
parent.msgRequest.bizfieldvalue = parent.msgResponse.bizfieldvalue;
console.dir({"parent.msgResponse":parent.msgResponse});
console.dir({"parent.msgRequest":parent.msgRequest});
//初始化页面
parent._initPage();
},
error:function(errorObj) {
return errorObj; // for other handlers in the chain
}
});
},
_initPage: function(args){
var step = window.workflow.workflowParams.get("currentStep")+"";
var bc = window.workflow.workflowParams.get("businessCode")+"";
var cidw = new CreateWidget();
//提交按钮
this._addBtn = cidw.createButton(this,this._addBtn,'提交',this.onSubmit);
//保存按钮
this._saveBtn = cidw.createButton(this,this._saveBtn,'保存',this.onSave)
alert(this.msgRequest.workflowargs.currentStep+'HHHHHHHHHHHHHHHHHH');
if(this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep=="S60"||this.msgRequest.workflowargs.currentStep=="S50"||this.msgRequest.workflowargs.currentStep==""||this.msgRequest.workflowargs.currentStep=="S10"){
this._saveBtn.set('disabled',false);
}else{
this._saveBtn.set('disabled',true);
}
//日常发布编号
var BILL_ID= new dijit.form.ValidationTextBox({name:"BILL_ID",id:"BILL_ID"});
this.BILL_ID.appendChild(BILL_ID.domNode);
this.BILL_ID=BILL_ID;
this.BILL_ID.setValue(bc);
BILL_ID.set('disabled',true);
//申请人
var APPLICANT = new dijit.form.ValidationTextBox({name:"APPLICANT",id:"APPLICANT"});
this.APPLICANT.appendChild(APPLICANT.domNode);
this.APPLICANT= APPLICANT;
APPLICANT.set('disabled',true);
//申请时间
var APPLY_TIME = new dijit.form.DateTextBox({name:"APPLY_TIME",id:"APPLY_TIME",value: new Date()});
this.APPLY_TIME.appendChild(APPLY_TIME.domNode);
this.APPLY_TIME=APPLY_TIME;
APPLY_TIME.set('disabled',true);
//发布级别
var PUB_LEVEL = {
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"一般"},
{hrFrom:"out", id:"紧急"}
]
};
var _sourceFromStore = new dojo.data.ItemFileReadStore({data: PUB_LEVEL});
var filterSourceFrom = new dijit.form.ComboBox({
name: "PUB_LEVEL",id:"PUB_LEVEL",
value:"一般",
store: _sourceFromStore,
searchAttr: "id"
},this.PUB_LEVEL);
this.PUB_LEVEL= filterSourceFrom;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
filterSourceFrom.set('disabled',false);
}else{
filterSourceFrom.set('disabled',true);
}
//申请部门
var APPLY_DEPT = new dijit.form.ValidationTextBox({name:"APPLY_DEPT",id:"APPLY_DEPT"});
this.APPLY_DEPT.appendChild(APPLY_DEPT.domNode);
this.APPLY_DEPT = APPLY_DEPT;
APPLY_DEPT.set('disabled',true);
//申请组
var APPLY_GROUP = new dijit.form.ValidationTextBox({name:"APPLY_GROUP",id:"APPLY_GROUP"});
this.APPLY_GROUP.appendChild(APPLY_GROUP.domNode);
this.APPLY_GROUP =APPLY_GROUP;
APPLY_GROUP.set('disabled',true);
//涉及系统
var REFER_SYSTEM = new dijit.form.ValidationTextBox({name:"REFER_SYSTEM",id:"REFER_SYSTEM"});
this.REFER_SYSTEM.appendChild(REFER_SYSTEM.domNode);
this.REFER_SYSTEM =REFER_SYSTEM;
var pickupUserBtn = new dijit.form.Button({label: "选择用户"});
this._usersConntiner2.appendChild(pickupUserBtn.domNode);
dojo.connect(pickupUserBtn, "onClick", this, "_handlePickupSystem");
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REFER_SYSTEM.set('disabled',false);
pickupUserBtn.set('disabled',false)
}else{
REFER_SYSTEM.set('disabled',true);
pickupUserBtn.set('disabled',true);
}
//请求号
var REQUEST_NO = new dijit.form.ValidationTextBox({name:"REQUEST_NO",id:"REQUEST_NO"});
this.REQUEST_NO.appendChild(REQUEST_NO.domNode);
this.REQUEST_NO = REQUEST_NO;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REQUEST_NO.set('disabled',false);
}else{
REQUEST_NO.set('disabled',true);
}
//请求释放
var REQUEST_RELEASE = new dijit.form.ValidationTextBox({name:"REQUEST_RELEASE",id:"REQUEST_RELEASE"});
this.REQUEST_RELEASE.appendChild(REQUEST_RELEASE.domNode);
this.REQUEST_RELEASE =REQUEST_RELEASE;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REQUEST_RELEASE.set('disabled',false);
}else{
REQUEST_RELEASE.set('disabled',true);
}
//计划发布时间
var PLAN_PUB_TIME = new dijit.form.DateTextBox({name:"PLAN_PUB_TIME",id:"PLAN_PUB_TIME",value: new Date()});
this.PLAN_PUB_TIME.appendChild(PLAN_PUB_TIME.domNode);
this.PLAN_PUB_TIME =PLAN_PUB_TIME;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
PLAN_PUB_TIME.set('disabled',false);
}else{
PLAN_PUB_TIME.set('disabled',true);
}
//请求描述
var REQUEST_DESC = new dijit.form.Textarea({
name: "REQUEST_DESC",id:"REQUEST_DESC",
value: "",
style: "width:100%;min-height:6em"
},this.REQUEST_DESC);
this.REQUEST_DESC =REQUEST_DESC;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REQUEST_DESC.set('disabled',false);
}else{
REQUEST_DESC.set('disabled',true);
}
//发布要求
var PUB_REQUIRE= new dijit.form.Textarea({
name: "PUB_REQUIRE",id: "PUB_REQUIRE",
value: "",
style: "width:100%;min-height:6em"
},this.PUB_REQUIRE);
this.PUB_REQUIRE=PUB_REQUIRE;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
PUB_REQUIRE.set('disabled',false);
}else{
PUB_REQUIRE.set('disabled',true);
}
//实际开始时间
var REAL_START_DATE = new dijit.form.DateTextBox({name:"REAL_START_DATE",id:"REAL_START_DATE",value: new Date()});
this.REAL_START_DATE.appendChild(REAL_START_DATE.domNode);
this.REAL_START_DATE =REAL_START_DATE;
if(this.msgRequest.workflowargs.currentStep=="S50"){
REAL_START_DATE.set('disabled',false);
}else{
REAL_START_DATE.set('disabled',true);
}
//实际结束时间
var REAL_END_DATE = new dijit.form.DateTextBox({name:"REAL_END_DATE",id:"REAL_END_DATE",value: new Date()});
this.REAL_END_DATE.appendChild(REAL_END_DATE.domNode);
this.REAL_END_DATE =REAL_END_DATE;
if(this.msgRequest.workflowargs.currentStep=="S50"){
REAL_END_DATE.set('disabled',false);
}else{
REAL_END_DATE.set('disabled',true);
}
//是否发布成功
var IS_FINISHED ={
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"否"},
{hrFrom:"out", id:"是"}
]
};
var _sourceFromStore = new dojo.data.ItemFileReadStore({data: IS_FINISHED});
var filterSourceFrom = new dijit.form.ComboBox({
name: "IS_FINISHED",id:"IS_FINISHED",
value:"是",
store: _sourceFromStore,
searchAttr: "id"
},this.IS_FINISHED);
this.IS_FINISHED = filterSourceFrom;
if(this.msgRequest.workflowargs.currentStep=="S50"){
filterSourceFrom.set('disabled',false);
}else{
filterSourceFrom.set('disabled',true);
}
//实施情况说明
var IMPL_DESC= new dijit.form.Textarea({
name: "IMPL_DESC",id:"IMPL_DESC",
value: "",
style: "width:200%;min-height:6em"
},this.IMPL_DESC);
this.IMPL_DESC=IMPL_DESC;
if(this.msgRequest.workflowargs.currentStep=="S50"){
IMPL_DESC.set('disabled',false);
}else{
IMPL_DESC.set('disabled',true);
}
// 验证时间
var PUB_CHECK_TIME=new dijit.form.DateTextBox({name:"PUB_CHECK_TIME",id:"PUB_CHECK_TIME",value: new Date()});
this.PUB_CHECK_TIME.appendChild(PUB_CHECK_TIME.domNode);
this.PUB_CHECK_TIME =PUB_CHECK_TIME;
if(this.msgRequest.workflowargs.currentStep=="S60"){
PUB_CHECK_TIME.set('disabled',false);
}else{
PUB_CHECK_TIME.set('disabled',true);
}
// 是否通过
var IS_PASSED = {
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"否"},
{hrFrom:"out", id:"是"}
]
};
var _sourceFromStore = new dojo.data.ItemFileReadStore({data:IS_PASSED});
var filterSourceFrom = new dijit.form.ComboBox({
name: "IS_PASSED",id:"IS_PASSED",
value:"是",
store: _sourceFromStore,
searchAttr: "id"
},this.IS_PASSED);
var xiao=this.msgRequest.workflowargs.currentStep;
this.connect(filterSourceFrom,'onChange',function(newValue){
if(newValue == '是'){
this.ACCIDENT_HOLDER.set('disabled',true);
this.CHECK_CONTENT.set('disabled',true);
this.PUB_FAIL_REASON.set('disabled',true);
this.PUB_FAIL_EFFECT.set('disabled',true);
this.SOLUTION.set('disabled',true);
}else if(newValue == '否'){
this.ACCIDENT_HOLDER.set('disabled',false);
this.CHECK_CONTENT.set('disabled',false);
this.PUB_FAIL_REASON.set('disabled',false);
this.PUB_FAIL_EFFECT.set('disabled',false);
this.SOLUTION.set('disabled',false);
}
});
this.IS_PASSED = filterSourceFrom;
if(this.msgRequest.workflowargs.currentStep=="S60"){
filterSourceFrom.set('disabled',false);
}else{
filterSourceFrom.set('disabled',true);
}
//事故责任人
var ACCIDENT_HOLDER=new dijit.form.ValidationTextBox({name:"ACCIDENT_HOLDER",id:"ACCIDENT_HOLDER"});
this.ACCIDENT_HOLDER.appendChild(ACCIDENT_HOLDER.domNode);
this.ACCIDENT_HOLDER =ACCIDENT_HOLDER;
if(this.msgRequest.workflowargs.currentStep=="S60"){
ACCIDENT_HOLDER.set('disabled',false);
}else{
ACCIDENT_HOLDER.set('disabled',true);
}
// 验证内容_check
var CHECK_CONTENT=new dijit.form.Textarea({
name: "CHECK_CONTENT",id:"CHECK_CONTENT",
value: "",
style: "width:100%;min-height:6em"
},this.CHECK_CONTENT);
this.CHECK_CONTENT=CHECK_CONTENT;
if(this.msgRequest.workflowargs.currentStep=="S60"){
CHECK_CONTENT.set('disabled',false);
}else{
CHECK_CONTENT.set('disabled',true);
}
// 发布失败原因
var PUB_FAIL_REASON= new dijit.form.Textarea({
name: "PUB_FAIL_REASON",id:"PUB_FAIL_REASON",
value: "",
style: "width:100%;min-height:6em"
},this.PUB_FAIL_REASON);
this.PUB_FAIL_REASON=PUB_FAIL_REASON;
if(this.msgRequest.workflowargs.currentStep=="S60"){
PUB_FAIL_REASON.set('disabled',false);
}else{
PUB_FAIL_REASON.set('disabled',true);
}
//发布失败影响
var PUB_FAIL_EFFECT= new dijit.form.Textarea({
name: "PUB_FAIL_EFFECT",id:"PUB_FAIL_EFFECT",
value: "",
style: "width:100%;min-height:6em"
},this.PUB_FAIL_EFFECT);
this.PUB_FAIL_EFFECT=PUB_FAIL_EFFECT;
if(this.msgRequest.workflowargs.currentStep=="S60"){
PUB_FAIL_EFFECT.set('disabled',false);
}else{
PUB_FAIL_EFFECT.set('disabled',true);
}
//解决方案
var SOLUTION= new dijit.form.Textarea({
name: "SOLUTION",id:"SOLUTION",
value: "",
style: "width:100%;min-height:6em"
},this.SOLUTION);
this.SOLUTION=SOLUTION;
if(this.msgRequest.workflowargs.currentStep=="S60"){
SOLUTION.set('disabled',false);
}else{
SOLUTION.set('disabled',true);
}
//主数据优化部负责人
var DEPT_MGR=new dijit.form.ValidationTextBox({name:"DEPT_MGR",id:"DEPT_MGR"});
this.DEPT_MGR.appendChild(DEPT_MGR.domNode);
this.DEPT_MGR =DEPT_MGR;
if(this.msgRequest.workflowargs.currentStep=="S20"){
DEPT_MGR.set('disabled',false);
}else{
DEPT_MGR.set('disabled',true);
}
//发布管理专员
var PUB_ADMIN=new dijit.form.ValidationTextBox({name:"PUB_ADMIN",id:"PUB_ADMIN"});
this.PUB_ADMIN.appendChild(PUB_ADMIN.domNode);
this.PUB_ADMIN =PUB_ADMIN;
if(this.msgRequest.workflowargs.currentStep=="S30"){
PUB_ADMIN.set('disabled',false);
}else{
PUB_ADMIN.set('disabled',true);
}
//运维管理中心负责人
var MAINTAIN_MGR=new dijit.form.ValidationTextBox({name:"MAINTAIN_MGR",id:"MAINTAIN_MGR"});
this.MAINTAIN_MGR.appendChild(MAINTAIN_MGR.domNode);
this.MAINTAIN_MGR =MAINTAIN_MGR;
//_usersConntinerwm
var _usersConnt = new dijit.form.Button({label: "选择用户"});
this._usersConntinerwm.appendChild(_usersConnt.domNode);
dojo.connect(_usersConnt, "onClick", this, "_handlePickupBtnClicked");
if(this.msgRequest.workflowargs.currentStep=="S30"&&this.msgResponse.bizfieldvalue.baseInfo['PUB_LEVEL']=="紧急"){
MAINTAIN_MGR.set('disabled',false);
_usersConnt.set('disabled',false);
}else{
MAINTAIN_MGR.set('disabled',true);
_usersConnt.set('disabled',true);
}
//系统发布专员
var SYS_PUBLISHER=new dijit.form.ValidationTextBox({name:"SYS_PUBLISHER",id:"SYS_PUBLISHER"});
this.SYS_PUBLISHER.appendChild(SYS_PUBLISHER.domNode);
this.SYS_PUBLISHER =SYS_PUBLISHER;
var pickupUserBtm = new dijit.form.Button({label: "选择用户"});
this._usersConntiner3.appendChild(pickupUserBtm.domNode);
dojo.connect(pickupUserBtm, "onClick", this, "_handlePickupUserBtnClicked");
if((this.msgRequest.workflowargs.currentStep=="S30"&&this.msgResponse.bizfieldvalue.baseInfo['PUB_LEVEL']=="一般")||this.msgRequest.workflowargs.currentStep=="S40"){
SYS_PUBLISHER.set('disabled',false);
pickupUserBtm.set('disabled',false);
}else{
SYS_PUBLISHER.set('disabled',true);
pickupUserBtm.set('disabled',true);
}
// 审批结果
var WANG_XIE = {
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"同意"},
{hrFrom:"out", id:"不同意"}
]
};
var _sourceMainSystem = new dojo.data.ItemFileReadStore({data:WANG_XIE});
var filterSourceSystem = new dijit.form.ComboBox({
name: "WANG_XIE",id:"WANG_XIE",
value:"同意",
store: _sourceMainSystem,
searchAttr: "id"
},this.WANG_XIE);
this.WANG_XIE = filterSourceSystem;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
filterSourceSystem.set('disabled',true);
}else{
filterSourceSystem.set('disabled',false);
}
//审批历史
var WANG_XIEPP=new dijit.form.ValidationTextBox({name:"WANG_XIEPP",id:"WANG_XIEPP"});
this.WANG_XIEPP.appendChild(WANG_XIEPP.domNode);
this.WANG_XIEPP =WANG_XIEPP;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
WANG_XIEPP.set('disabled',true);
}else{
WANG_XIEPP.set('disabled',false);
}
//初始化参数
this._titleTextSpan.innerHTML = "日常发布<" + this.msgResponse.bizfieldvalue.baseInfo.BILL_ID + ">";
this._summary.value = "关于XX的日常发布";
this.setFormData();
},
//回填数据 通过id和name组成map对象 PUB_LEVEL
setFormData:function(){
for(var key in this.msgResponse.bizfieldvalue.baseInfo){
if(key == 'PUB_LEVEL'){
var pub=this.msgResponse.bizfieldvalue.baseInfo[key];
}
var value = this.msgResponse.bizfieldvalue.baseInfo[key];
var control = dijit.byId(key);
if(control && value) {
var dojoType = control.declaredClass;
if(dojoType=="dijit.form.DateTextBox") {
control.set('value', new Date(value));
} else {
control.set('value', value);
}
}
}
},
//根据Form数据设置Store
getFormData:function(){
//将响应消息中的部分数据复制到请求消息中
this.msgRequest.bizfieldvalue.baseInfo = this.msgResponse.bizfieldvalue.baseInfo;
for(var key in this.msgResponse.bizfieldvalue.baseInfo){
var control = dojo.byId(key);
if(control && control.value) {
var value = control.value;
this.msgRequest.bizfieldvalue.baseInfo[key] = value;
}
}
},
//提交方法
onSubmit: function(){
this.msgRequest.workflowargs.save = "false";
//设置业务相关的参数,供分支选择使用
this.msgRequest.workflowargs.varPassed = "true";
this.pushPage();
},
//保存方法
onSave: function(){
this.msgRequest.workflowargs.save = "true";
//设置业务相关的参数,供分支选择使用
this.msgRequest.workflowargs.varPassed = "true";
this.pushPage();
},
pushPage: function(){
this.getFormData();
console.dir({"tadaye":this.msgRequest});
/**
* 根据流程节点确定Action
*/
var save = this.msgRequest.workflowargs.save;
var action;
//如果是首次申请页面 保存
if(this.msgRequest.workflowargs.currentStep==""){
action = "DailyReleaseApplySaveAction";
}
// 草稿修改和被驳回需要修改
if(this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep=="S10"){
action = "DailyReleaseApplyUpDateAction";
}
//主数据优化部负责人S20
if(this.msgRequest.workflowargs.currentStep=="S20"){
this.msgRequest.workflowargs["varXIEPANPAN"] = this.WANG_XIE.value;
action = "DailyReleaseApplyUpDateAction";
}
//发布管理专员 S30
if(this.msgRequest.workflowargs.currentStep=="S30"){
this.msgRequest.workflowargs["varSYS_PUBLISHER"] = this.SYS_PUBLISHER.value;
this.msgRequest.workflowargs["varPUB_LEVEL"]=this.PUB_LEVEL.value;
this.msgRequest.workflowargs["varXIEPANPAN"]=this.WANG_XIE.value;
action="DailyReleaseApplyUpDateAction";
}
//运维管理中心S40
if(this.msgRequest.workflowargs.currentStep=="S40"){
this.msgRequest.workflowargs["varSYS_PUBLISHER"] = this.SYS_PUBLISHER.value;
this.msgRequest.workflowargs["varXIEPANPAN"]=this.WANG_XIE.value;
action="DailyReleaseApplyUpDateAction";
}
//系统发布专员S50
if(this.msgRequest.workflowargs.currentStep=="S50"){
this.msgRequest.workflowargs["varXIEPANPAN"]=this.WANG_XIE.value;
action="DailyReleaseApplyUpDateAction";
}
//发布验证
if(this.msgRequest.workflowargs.currentStep=="S60"){
action="DailyReleaseApplyUpDateAction";
}
console.dir({xxxx:this.msgRequest});
var self = this;
jazz.client.xhrGet({
url: _URL,
content:{
action: _ACTION+action, method: "Action", handleAs: "json", timeout: 50000000,
args: dojo.toJson(this.msgRequest)
},
load:function(result) {
var json = dojo.fromJson(result);
if(json && json.id && json.id==200) {
self.setHeaderMessage('操作成功!');
} else {
self.setHeaderMessage("操作失败!");
}
// console.dir({"parent.msgRequest":parent.msgRequest});
self.msgResponse.bizfieldvalue = dojo.clone(self.msgRequest.bizfieldvalue);
self._saveBtn.setDisabled(true);
self._addBtn.setDisabled(true);
return result; // for other handlers in the chain
},
error:function(errorObj) {
return errorObj; // for other handlers in the chain
}
});
},
_handlePickupSystem:function(){
var dialog = new PickupUserDialog();
this._dialogs.push(dialog);
this.connect(dialog,"onOk","performPickupsystem");
},
performPickupsystem: function (users) {
if (users != null && users.length > 0) {
var userids='';
for (var i=0; i < users.length-1; i++) {
if (users[i].userId != null) {
if (users.length >1)
userids = userids+users[i].userId+',';
}
}
userids = userids+ users[users.length-1].userId;
this.REFER_SYSTEM.set("value",userids);
}
},
_handlePickupBtnClicked:function(){
var dialog = new PickupUserDialog();
//this._dialogs.push(dialog);
this.connect(dialog,"onOk","performPick");
},
performPick: function (users) {
if (users != null && users.length > 0) {
var userids='';
for (var i=0; i < users.length-1; i++) {
if (users[i].userId != null) {
if (users.length >1)
userids = userids+users[i].userId+',';
}
}
userids = userids+ users[users.length-1].userId;
this.MAINTAIN_MGR.set("value",userids);
}
},
_handlePickupUserBtnClicked:function(){
var dialog = new PickupUserDialog();
//this._dialogs.push(dialog);
this.connect(dialog,"onOk","performPickup");
},
performPickup: function (users) {
if (users != null && users.length > 0) {
var userids='';
for (var i=0; i < users.length-1; i++) {
if (users[i].userId != null) {
if (users.length >1)
userids = userids+users[i].userId+',';
}
}
userids = userids+ users[users.length-1].userId;
this.SYS_PUBLISHER.set("value",userids);
}
},
});
})();
html
<div class="com-ibm-ipd-content">
<div class="headpanel">
<div class="editorHeader">
<div class="firstRow">
<span class="CommandArea" style="float: right; padding-left:10px;">
<div class="Button" dojoattachpoint="_saveBtn" ></div>
</span>
<span style="float:left; padding-right:10px">
<img dojoAttachPoint="typeIcon" class="typeIcon" src="web/com.suning.ipd.rtcex.web/ui/graphics/template/capability.gif"></img>
<span class="typeText" dojoAttachPoint="_titleTextSpan">日常发布</span>
</span>
<div class="validationMessage" dojoAttachPoint="validationMessageSpan">
<a dojoAttachPoint="validationMessage" class="validationMessageAnchor" dojoAttachEvent="onclick: _handleHeaderMessageClick" href="#"></a>
</div>
<table style="float: right; padding-left:10px;">
<tr>
<td>
<div class="Button" dojoattachpoint="_addBtn" ></div>
</td>
<td>
<div class="Button" dojoattachpoint="_saveBtn" ></div>
</td>
</tr>
</table>
</div>
<div class="summaryRow">
<div class="summaryLabel">摘要:</div>
<div class = "nameInputContainer">
<input class="nameInput" dojoAttachPoint="_summary"/>
</div>
</div>
</div>
</div>
<div>
<div class="bodypanel" dojoAttachPoint="_resultsColumn">
<div class="Section">
<div class="sectionTitle">
【基本信息】
</div>
<div class="sectionContent">
<table class="actionTable" >
<tr class="TR">
<td class="QuarterLabelColumn">
日常发布编号
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="BILL_ID" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
申请人
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLICANT" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
申请时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLY_TIME" class="QuarterField"/>
<td class="QuarterLabelColumn">
发布级别
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="PUB_LEVEL" class="QuarterField"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn">
申请部门
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLY_DEPT" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
申请组
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLY_GROUP" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
计划发布时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="PLAN_PUB_TIME" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
请求号
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REQUEST_NO" class="QuarterField"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn">
请求释放
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REQUEST_RELEASE" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
涉及系统
</td>
<td class="QuarterColumn">
<div dojoattachpoint="REFER_SYSTEM" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntiner2" />
</td>
</tr>
<tr class="TR">
<td >
请求描述
</td>
<td colspan="3">
<div dojoAttachpoint="REQUEST_DESC" />
</td>
<td colspan="0" >
发布要求
</td>
<td colspan="3">
<div dojoAttachpoint="PUB_REQUIRE" />
</td>
</tr>
<tr>
</tr>
</table>
</div>
</div>
<div class="Section" >
<div class="bodypanel" dojoAttachPoint="_resultsColumn">
<div class="sectionTitle">
【发布实施】
</div>
<div class="sectionContent">
<table class="actionTable" >
<tr >
<td class="QuarterLabelColumn">
实际开始时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REAL_START_DATE" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
实际结束时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REAL_END_DATE" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
是否发布成功
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="IS_FINISHED" class="QuarterField"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn"> 实施情况说明 </td>
<td class="QuarterColumn" colspan="2">
<div dojoAttachpoint="IMPL_DESC" />
</td>
</tr>
</table>
</div>
</div>
<div class="bodypanel" dojoAttachPoint="_resultsColumn">
<div class="sectionTitle">
【发布验证】
</div>
<div class="sectionContent">
<table class="actionTable">
<tr>
<td class="QuarterLabelColumn">
验证时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="PUB_CHECK_TIME"/>
</td>
<td class="QuarterLabelColumn">
是否通过
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="IS_PASSED"/>
</td>
<td class="QuarterLabelColumn">
事故责任人
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="ACCIDENT_HOLDER" />
</td>
<td> </td>
</tr>
<tr class="TR">
</tr>
<tr class="TR">
<td class="QuarterColumn" colspan="3">
验证内容
</td>
<td class="QuarterColumn" colspan="3">
发布失败原因
</td>
</tr>
<tr>
<td colspan="3">
<div dojoAttachpoint="CHECK_CONTENT" />
</td>
<td class="Column" colspan="3" wedding=2>
<div dojoAttachpoint="PUB_FAIL_REASON"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterColumn" colspan="3">
发布失败影响
</td>
<td class="QuarterColumn" colspan="3">
解决方案
</td>
</tr>
<tr>
<td class="Column" colspan="3" wedding=2>
<div dojoAttachpoint="PUB_FAIL_EFFECT" style="width:98%" />
</td>
<td class="Column" colspan="3" wedding=2>
<div dojoAttachpoint="SOLUTION" style="width:98%" />
</td>
</tr>
</table>
</div>
</div>
<div class="bodypanel" dojoAttachPoint="_resultsColumn" >
<div class="sectionTitle" >
【审批人员】
</div>
<div class="sectionContent">
<table class="actionTable" >
<tr class="TR">
<td class="QuarterLabelColumn">
*主数据优化部负责人
</td>
<td class="Column" >
<div dojoAttachpoint="DEPT_MGR" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntinerx" />
</td>
</tr>
<tr class="TR" >
<td class="QuarterLabelColumn">
*发布管理专员
</td>
<td class="Column" >
<div dojoAttachpoint="PUB_ADMIN" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntinerp" />
</td>
</tr>
<tr class="TR" >
<td class="QuarterLabelColumn">
*运维管理中心负责人
</td>
<td class="Column" >
<div dojoAttachpoint="MAINTAIN_MGR" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntinerwm" />
</td>
<td></td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn">
*系统发布专员
</td>
<td class="Column">
<div dojoAttachpoint="SYS_PUBLISHER" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntiner3" />
</td>
</tr>
<tr>
<td class="QuarterLabelColumn">
审批结果
</td>
<td class="QuarterLabelColumn">
<div dojoAttachpoint="WANG_XIE" style="width:98%" class="QuarterColumn"/>
</td>
</tr>
<tr>
<td class="QuarterLabelColumn">审批意见 </td>
<td class="QuarterLabelColumn">
<div dojoAttachpoint="WANG_XIEPP" style="width:98%" class="QuarterColumn"/>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
js :
dojo.provide("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dojox.xml.parser");
dojo.require("dojo.i18n");
dojo.require("jazz.ui.Dialog");
(function(){
var _URL = net.jazz.ajax.BootstrapProperties.FRONTSIDE_URL+"/service/com.suning.ipd.rtcex.service.ws.IRawMessageService/";
function addOption(selectList, option){
if (dojo.isIE) {
var newOption = new Option(option.text, option.value);
newOption.EMPLOYEEID = option.EMPLOYEEID;
var newIndex = selectList.options.length;
selectList[newIndex] = newOption;
}
else {
option.selected = false;
var inserted = false;
for (i = 0; i < selectList.options.length; i++) {
if (selectList.options[i].text > option.text) {
selectList.insertBefore(option, selectList.options[i]);
inserted = true;
break;
}
}
if (!inserted) {
selectList.appendChild(option);
}
}
}
function removeOption(selectList, option){
if (dojo.isIE) {
var index = selectList.options.length;
for (var i = 0; i < selectList.options.length; i++) {
if (selectList.options[i] === option) {
index = i;
break;
}
}
selectList.remove(index);
}
else {
try {
selectList.removeChild(option);
}
catch (err) {
// don't throw an error if the option wasn't in the list to begin with
}
}
}
dojo.declare("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog", [dijit._Widget, dijit._Templated], {
templatePath: dojo.moduleUrl("com.suning.ipd.rtcex.web", "ui/page/projectpublish/templates/PickupUserDialog.html"),
constructor: function(args){
if (args == null) {
args = {};
}
this.width = args.width || "450px";
var properties = {
"width": "450px",
"removeUsersOnAdd": true,
"searchLimit": 50
};
this.selectedUsersList = [];
},
postCreate: function(){
this.userSelector.size = 12;
this.userSelector.multiple = true;
this.selectedUsers.size = 6;
this.selectedUsers.multiple = true;
this.dialog = new jazz.ui.Dialog({
contentNode: this.contentNode,
primaryTitle: '选择用户对话框',
width: this.width,
closable: this.closable
});
this.connect(this.searchButton, "onclick", "_runSearch");
this.connect(this.selectButton, "onclick", "_runSelect");
this.connect(this.deselectButton, "onclick", "_runDeselect");
this.connect(this.cancelButton, "onclick", function(e){
dojo.stopEvent(e);
this.dialog.close();
});
this.connect(this.okButton, "onclick", "_onOk");
this.connect(this.userSelector, "ondblclick", "_runSelect");
this.connect(this.userSelector, "onchange", "_handleSelectorChange");
this.connect(this.selectedUsers, "onchange", "_handleSelectedChange");
this.connect(this.dialog, "onClose", "onClose");
this.searchText.focus();
},
_runSearch: function(e, query){
if (e != null) {
dojo.stopEvent(e);
}
if (this.searchText.value != "") {
var args1 = {
searchText: query == null ? this.searchText.value : query,
};
this.lastQueryTerm = args1.searchText;
this._setStatusMessage('正在查询...');
var self = this;
jazz.client.xhrGet({
url: _URL,
content: {
action: "biz.PickupUserAction",
method: "action",
args: dojo.toJson(args1)
},
headers: {
accept: "text/json"
},
handleAs: "json",
load:function(result) {
self.runSearchCallback(result);
},
error:function(errorObj) {
self._queryError(errorObj);
}
});
}
},
runSearchCallback: function(data){
this._clearStatusMessage();
var users = data.bizfieldvalue.userlist;
if (dojo.isIE) {
this.userSelector.options.length = 0;
}
else {
dojox.xml.parser.removeChildren(this.userSelector);
}
if (users != null) {
var selectedUserMap = {};
for (var i = 0; i < this.selectedUsers.options.length; i++) {
selectedUserMap[this.selectedUsers.options[i].value] = true;
}
users.sort();
// users.sort(function(a, b){
// if (a.EMPLOYEENAME == null || a.EMPLOYEENAME.length === 0) {
// return 1;
// }
// else
// if (b.EMPLOYEENAME == null || b.EMPLOYEENAME.length === 0) {
// return -1;
// }
// else {
// return a.EMPLOYEENAME[0] === b.EMPLOYEENAME[0] ? 0 : a.EMPLOYEENAME[0] > b.EMPLOYEENAME[0] ? 1 : -1;
// }
// });
for (i = 0; i < users.length; i++) {
// filter out users that do not have a name or do not have exactly one user ID
if (users[i].EMPLOYEENAME != null && users[i].EMPLOYEENAME.length > 0 &&
users[i].EMPLOYEEID != null &&
users[i].EMPLOYEEID.length > 0) {
if (selectedUserMap[users[i].EMPLOYEEID]) {
continue;
}
var option = new Option(users[i].EMPLOYEENAME+' - <' +users[i].EMPLOYEEID+'>', users[i].EMPLOYEEID);
if (dojo.isIE) {
this.userSelector.options[this.userSelector.options.length] = option;
}
else {
this.userSelector.appendChild(option);
}
}
}
}
this._handleSelectedChange();
},
_runSelect: function(e){
dojo.stopEvent(e);
for (var i = 0; i < this.userSelector.options.length; i++) {
if (this.userSelector.options[i].selected) {
var option = this.userSelector.options[i];
addOption(this.selectedUsers, option);
removeOption(this.userSelector, option);
i--;
}
}
this._handleSelectorChange();
this._handleSelectedChange();
},
_runDeselect: function(e){
dojo.stopEvent(e);
for (var i = 0; i < this.selectedUsers.options.length; i++) {
if (this.selectedUsers.options[i].selected) {
var option = this.selectedUsers.options[i];
removeOption(this.selectedUsers, option);
i--;
}
}
this._runSearch(e, this.lastQueryTerm);
},
_onOk: function(e){
dojo.stopEvent(e);
var users = [];
for (var i = 0; i < this.selectedUsers.options.length; i++) {
users.push({
name: this.selectedUsers.options[i].text,
userId: this.selectedUsers.options[i].value,
userId1: this.selectedUsers.options[i].EMPLOYEEID
});
}
this.onOk(users);
},
_handleSelectorChange: function(e){
var count = 0;
var selected = null;
for (var i = 0; i < this.userSelector.options.length; i++) {
if (this.userSelector.options[i].selected) {
selected = this.userSelector.options[i];
count++;
}
}
this.selectButton.disabled = (count === 0);
dojox.xml.parser.removeChildren(this.userInfoDiv);
if (count === 1) {
if (selected.EMPLOYEEID != null) {
this.userInfoDiv.appendChild(document.createTextNode(selected.EMPLOYEEID));
}
}
else
if (count > 1) {
this.userInfoDiv.appendChild(document.createTextNode(count + this.messages.selected));
}
},
_handleSelectedChange: function(e){
var selected = false;
for (var i = 0; i < this.selectedUsers.options.length; i++) {
if (this.selectedUsers.options[i].selected) {
selected = true;
}
}
this.deselectButton.disabled = !selected;
this.okButton.disabled = this.selectedUsers.options.length === 0;
},
onOk: function(selectedUsers){
this.dialog.close();
},
onClose: function(){
},
_queryError: function(err){
this._setStatusMessage(err.message, true);
},
_clearStatusMessage: function(){
this.searchStatus.style.visibility = "hidden";
},
_setStatusMessage: function(msg, isError){
this.searchStatus.style.visibility = "visible";
dojox.xml.parser.replaceChildren(this.searchStatus, document.createTextNode(msg));
this.searchStatus.className = isError ? "ErrorStatus" : "NormalStatus";
}
});
})();
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dijit.form.DateTextBox");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.FilteringSelect");
dojo.require("com.ibm.team.repository.web.transport.ServiceResponseHandler");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit.form.ComboBox");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dojox.grid.DataGrid");
dojo.require("dijit.form.Textarea");
dojo.require("dojo.parser");
dojo.require("com.suning.ipd.rtcex.web.ui.page.common.CreateWidget");
dojo.require("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupSysPubDialog");
dojo.require("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog");
(function(){
var pub=null;
_URL = net.jazz.ajax.BootstrapProperties.FRONTSIDE_URL+"/service/com.suning.ipd.rtcex.service.ws.IRawMessageService/";
_ACTION = "dailyrelease.";
var PickupUserDialog=com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog;
var PlatformUI = net.jazz.ajax.ui.PlatformUI;
dojo.declare("com.suning.ipd.rtcex.web.ui.page.DailyRelease", [dijit._Widget, dijit._Templated], {
templatePath: dojo.moduleUrl("com.suning.ipd.rtcex.web", "ui/templates/DailyRelease.html"),
msgRequest:{"workflowargs":{},"bizfieldvalue":{"baseInfo":{},"resourceList":{}}},
msgResponse:{"workflowargs":{},"bizfieldvalue":{"baseInfo":{},"resourceList":{}}},
requestMessage:{"workflowargs":{},"bizfieldvalue":{"baseInfo":{}}},
//首先要执行的方法
postCreate: function(){
var ActionRegistry = PlatformUI.getWorkbench().getActionRegistry();
ActionRegistry.registerAction("com.suning.ipd.rtcex.web.dailyrelease.open", this, "_init");
},
_handleSaveClick: function(){
this.setHeaderMessage('保存成功!');
},
_handleHeaderMessageClick: function(e) {
},
clearValidationMessage: function() {
dojox.xml.parser.removeChildren(this.validationMessage);
this.validationMessageSpan.className= "validationMessageEmpty";
},
setHeaderMessage: function(messageText) {
this.clearValidationMessage();
this.validationMessageSpan.className= "validationMessageError";
dojox.xml.parser.removeChildren(this.validationMessage);
var messagesSpan= document.createElement("SPAN");
var div= document.createElement("DIV");
div.appendChild(document.createTextNode(messageText));
messagesSpan.appendChild(div);
this.validationMessage.appendChild(messagesSpan);
window.scrollTo(0,0); // show message
},
//显示页面
_init: function(args){
this.msgRequest.workflowargs = dojo.fromJson(decodeURIComponent(args.wfParams));
console.dir({"this.workflowargs":this.workflowargs});
console.dir({"this.msgRequest":this.msgRequest});
this.getInitData();
},
//从后台获取数据来初始化出面数据
getInitData: function(){
//从后台获取数据来初始化出面数据
var parent = this;
jazz.client.xhrGet({
url: _URL,
content: {
action: "dailyrelease.DailyReleaseInitAction", method: "Action", handleAs: "json", timeout: 50000,
args: dojo.toJson(this.msgRequest)
},
load:function(result) {
console.dir({result:dojo.fromJson(result)});
parent.msgResponse = dojo.fromJson(result);
parent.msgRequest.workflowargs = parent.msgResponse.workflowargs;
parent.msgRequest.bizfieldvalue = parent.msgResponse.bizfieldvalue;
console.dir({"parent.msgResponse":parent.msgResponse});
console.dir({"parent.msgRequest":parent.msgRequest});
//初始化页面
parent._initPage();
},
error:function(errorObj) {
return errorObj; // for other handlers in the chain
}
});
},
_initPage: function(args){
var step = window.workflow.workflowParams.get("currentStep")+"";
var bc = window.workflow.workflowParams.get("businessCode")+"";
var cidw = new CreateWidget();
//提交按钮
this._addBtn = cidw.createButton(this,this._addBtn,'提交',this.onSubmit);
//保存按钮
this._saveBtn = cidw.createButton(this,this._saveBtn,'保存',this.onSave)
alert(this.msgRequest.workflowargs.currentStep+'HHHHHHHHHHHHHHHHHH');
if(this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep=="S60"||this.msgRequest.workflowargs.currentStep=="S50"||this.msgRequest.workflowargs.currentStep==""||this.msgRequest.workflowargs.currentStep=="S10"){
this._saveBtn.set('disabled',false);
}else{
this._saveBtn.set('disabled',true);
}
//日常发布编号
var BILL_ID= new dijit.form.ValidationTextBox({name:"BILL_ID",id:"BILL_ID"});
this.BILL_ID.appendChild(BILL_ID.domNode);
this.BILL_ID=BILL_ID;
this.BILL_ID.setValue(bc);
BILL_ID.set('disabled',true);
//申请人
var APPLICANT = new dijit.form.ValidationTextBox({name:"APPLICANT",id:"APPLICANT"});
this.APPLICANT.appendChild(APPLICANT.domNode);
this.APPLICANT= APPLICANT;
APPLICANT.set('disabled',true);
//申请时间
var APPLY_TIME = new dijit.form.DateTextBox({name:"APPLY_TIME",id:"APPLY_TIME",value: new Date()});
this.APPLY_TIME.appendChild(APPLY_TIME.domNode);
this.APPLY_TIME=APPLY_TIME;
APPLY_TIME.set('disabled',true);
//发布级别
var PUB_LEVEL = {
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"一般"},
{hrFrom:"out", id:"紧急"}
]
};
var _sourceFromStore = new dojo.data.ItemFileReadStore({data: PUB_LEVEL});
var filterSourceFrom = new dijit.form.ComboBox({
name: "PUB_LEVEL",id:"PUB_LEVEL",
value:"一般",
store: _sourceFromStore,
searchAttr: "id"
},this.PUB_LEVEL);
this.PUB_LEVEL= filterSourceFrom;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
filterSourceFrom.set('disabled',false);
}else{
filterSourceFrom.set('disabled',true);
}
//申请部门
var APPLY_DEPT = new dijit.form.ValidationTextBox({name:"APPLY_DEPT",id:"APPLY_DEPT"});
this.APPLY_DEPT.appendChild(APPLY_DEPT.domNode);
this.APPLY_DEPT = APPLY_DEPT;
APPLY_DEPT.set('disabled',true);
//申请组
var APPLY_GROUP = new dijit.form.ValidationTextBox({name:"APPLY_GROUP",id:"APPLY_GROUP"});
this.APPLY_GROUP.appendChild(APPLY_GROUP.domNode);
this.APPLY_GROUP =APPLY_GROUP;
APPLY_GROUP.set('disabled',true);
//涉及系统
var REFER_SYSTEM = new dijit.form.ValidationTextBox({name:"REFER_SYSTEM",id:"REFER_SYSTEM"});
this.REFER_SYSTEM.appendChild(REFER_SYSTEM.domNode);
this.REFER_SYSTEM =REFER_SYSTEM;
var pickupUserBtn = new dijit.form.Button({label: "选择用户"});
this._usersConntiner2.appendChild(pickupUserBtn.domNode);
dojo.connect(pickupUserBtn, "onClick", this, "_handlePickupSystem");
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REFER_SYSTEM.set('disabled',false);
pickupUserBtn.set('disabled',false)
}else{
REFER_SYSTEM.set('disabled',true);
pickupUserBtn.set('disabled',true);
}
//请求号
var REQUEST_NO = new dijit.form.ValidationTextBox({name:"REQUEST_NO",id:"REQUEST_NO"});
this.REQUEST_NO.appendChild(REQUEST_NO.domNode);
this.REQUEST_NO = REQUEST_NO;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REQUEST_NO.set('disabled',false);
}else{
REQUEST_NO.set('disabled',true);
}
//请求释放
var REQUEST_RELEASE = new dijit.form.ValidationTextBox({name:"REQUEST_RELEASE",id:"REQUEST_RELEASE"});
this.REQUEST_RELEASE.appendChild(REQUEST_RELEASE.domNode);
this.REQUEST_RELEASE =REQUEST_RELEASE;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REQUEST_RELEASE.set('disabled',false);
}else{
REQUEST_RELEASE.set('disabled',true);
}
//计划发布时间
var PLAN_PUB_TIME = new dijit.form.DateTextBox({name:"PLAN_PUB_TIME",id:"PLAN_PUB_TIME",value: new Date()});
this.PLAN_PUB_TIME.appendChild(PLAN_PUB_TIME.domNode);
this.PLAN_PUB_TIME =PLAN_PUB_TIME;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
PLAN_PUB_TIME.set('disabled',false);
}else{
PLAN_PUB_TIME.set('disabled',true);
}
//请求描述
var REQUEST_DESC = new dijit.form.Textarea({
name: "REQUEST_DESC",id:"REQUEST_DESC",
value: "",
style: "width:100%;min-height:6em"
},this.REQUEST_DESC);
this.REQUEST_DESC =REQUEST_DESC;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
REQUEST_DESC.set('disabled',false);
}else{
REQUEST_DESC.set('disabled',true);
}
//发布要求
var PUB_REQUIRE= new dijit.form.Textarea({
name: "PUB_REQUIRE",id: "PUB_REQUIRE",
value: "",
style: "width:100%;min-height:6em"
},this.PUB_REQUIRE);
this.PUB_REQUIRE=PUB_REQUIRE;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
PUB_REQUIRE.set('disabled',false);
}else{
PUB_REQUIRE.set('disabled',true);
}
//实际开始时间
var REAL_START_DATE = new dijit.form.DateTextBox({name:"REAL_START_DATE",id:"REAL_START_DATE",value: new Date()});
this.REAL_START_DATE.appendChild(REAL_START_DATE.domNode);
this.REAL_START_DATE =REAL_START_DATE;
if(this.msgRequest.workflowargs.currentStep=="S50"){
REAL_START_DATE.set('disabled',false);
}else{
REAL_START_DATE.set('disabled',true);
}
//实际结束时间
var REAL_END_DATE = new dijit.form.DateTextBox({name:"REAL_END_DATE",id:"REAL_END_DATE",value: new Date()});
this.REAL_END_DATE.appendChild(REAL_END_DATE.domNode);
this.REAL_END_DATE =REAL_END_DATE;
if(this.msgRequest.workflowargs.currentStep=="S50"){
REAL_END_DATE.set('disabled',false);
}else{
REAL_END_DATE.set('disabled',true);
}
//是否发布成功
var IS_FINISHED ={
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"否"},
{hrFrom:"out", id:"是"}
]
};
var _sourceFromStore = new dojo.data.ItemFileReadStore({data: IS_FINISHED});
var filterSourceFrom = new dijit.form.ComboBox({
name: "IS_FINISHED",id:"IS_FINISHED",
value:"是",
store: _sourceFromStore,
searchAttr: "id"
},this.IS_FINISHED);
this.IS_FINISHED = filterSourceFrom;
if(this.msgRequest.workflowargs.currentStep=="S50"){
filterSourceFrom.set('disabled',false);
}else{
filterSourceFrom.set('disabled',true);
}
//实施情况说明
var IMPL_DESC= new dijit.form.Textarea({
name: "IMPL_DESC",id:"IMPL_DESC",
value: "",
style: "width:200%;min-height:6em"
},this.IMPL_DESC);
this.IMPL_DESC=IMPL_DESC;
if(this.msgRequest.workflowargs.currentStep=="S50"){
IMPL_DESC.set('disabled',false);
}else{
IMPL_DESC.set('disabled',true);
}
// 验证时间
var PUB_CHECK_TIME=new dijit.form.DateTextBox({name:"PUB_CHECK_TIME",id:"PUB_CHECK_TIME",value: new Date()});
this.PUB_CHECK_TIME.appendChild(PUB_CHECK_TIME.domNode);
this.PUB_CHECK_TIME =PUB_CHECK_TIME;
if(this.msgRequest.workflowargs.currentStep=="S60"){
PUB_CHECK_TIME.set('disabled',false);
}else{
PUB_CHECK_TIME.set('disabled',true);
}
// 是否通过
var IS_PASSED = {
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"否"},
{hrFrom:"out", id:"是"}
]
};
var _sourceFromStore = new dojo.data.ItemFileReadStore({data:IS_PASSED});
var filterSourceFrom = new dijit.form.ComboBox({
name: "IS_PASSED",id:"IS_PASSED",
value:"是",
store: _sourceFromStore,
searchAttr: "id"
},this.IS_PASSED);
var xiao=this.msgRequest.workflowargs.currentStep;
this.connect(filterSourceFrom,'onChange',function(newValue){
if(newValue == '是'){
this.ACCIDENT_HOLDER.set('disabled',true);
this.CHECK_CONTENT.set('disabled',true);
this.PUB_FAIL_REASON.set('disabled',true);
this.PUB_FAIL_EFFECT.set('disabled',true);
this.SOLUTION.set('disabled',true);
}else if(newValue == '否'){
this.ACCIDENT_HOLDER.set('disabled',false);
this.CHECK_CONTENT.set('disabled',false);
this.PUB_FAIL_REASON.set('disabled',false);
this.PUB_FAIL_EFFECT.set('disabled',false);
this.SOLUTION.set('disabled',false);
}
});
this.IS_PASSED = filterSourceFrom;
if(this.msgRequest.workflowargs.currentStep=="S60"){
filterSourceFrom.set('disabled',false);
}else{
filterSourceFrom.set('disabled',true);
}
//事故责任人
var ACCIDENT_HOLDER=new dijit.form.ValidationTextBox({name:"ACCIDENT_HOLDER",id:"ACCIDENT_HOLDER"});
this.ACCIDENT_HOLDER.appendChild(ACCIDENT_HOLDER.domNode);
this.ACCIDENT_HOLDER =ACCIDENT_HOLDER;
if(this.msgRequest.workflowargs.currentStep=="S60"){
ACCIDENT_HOLDER.set('disabled',false);
}else{
ACCIDENT_HOLDER.set('disabled',true);
}
// 验证内容_check
var CHECK_CONTENT=new dijit.form.Textarea({
name: "CHECK_CONTENT",id:"CHECK_CONTENT",
value: "",
style: "width:100%;min-height:6em"
},this.CHECK_CONTENT);
this.CHECK_CONTENT=CHECK_CONTENT;
if(this.msgRequest.workflowargs.currentStep=="S60"){
CHECK_CONTENT.set('disabled',false);
}else{
CHECK_CONTENT.set('disabled',true);
}
// 发布失败原因
var PUB_FAIL_REASON= new dijit.form.Textarea({
name: "PUB_FAIL_REASON",id:"PUB_FAIL_REASON",
value: "",
style: "width:100%;min-height:6em"
},this.PUB_FAIL_REASON);
this.PUB_FAIL_REASON=PUB_FAIL_REASON;
if(this.msgRequest.workflowargs.currentStep=="S60"){
PUB_FAIL_REASON.set('disabled',false);
}else{
PUB_FAIL_REASON.set('disabled',true);
}
//发布失败影响
var PUB_FAIL_EFFECT= new dijit.form.Textarea({
name: "PUB_FAIL_EFFECT",id:"PUB_FAIL_EFFECT",
value: "",
style: "width:100%;min-height:6em"
},this.PUB_FAIL_EFFECT);
this.PUB_FAIL_EFFECT=PUB_FAIL_EFFECT;
if(this.msgRequest.workflowargs.currentStep=="S60"){
PUB_FAIL_EFFECT.set('disabled',false);
}else{
PUB_FAIL_EFFECT.set('disabled',true);
}
//解决方案
var SOLUTION= new dijit.form.Textarea({
name: "SOLUTION",id:"SOLUTION",
value: "",
style: "width:100%;min-height:6em"
},this.SOLUTION);
this.SOLUTION=SOLUTION;
if(this.msgRequest.workflowargs.currentStep=="S60"){
SOLUTION.set('disabled',false);
}else{
SOLUTION.set('disabled',true);
}
//主数据优化部负责人
var DEPT_MGR=new dijit.form.ValidationTextBox({name:"DEPT_MGR",id:"DEPT_MGR"});
this.DEPT_MGR.appendChild(DEPT_MGR.domNode);
this.DEPT_MGR =DEPT_MGR;
if(this.msgRequest.workflowargs.currentStep=="S20"){
DEPT_MGR.set('disabled',false);
}else{
DEPT_MGR.set('disabled',true);
}
//发布管理专员
var PUB_ADMIN=new dijit.form.ValidationTextBox({name:"PUB_ADMIN",id:"PUB_ADMIN"});
this.PUB_ADMIN.appendChild(PUB_ADMIN.domNode);
this.PUB_ADMIN =PUB_ADMIN;
if(this.msgRequest.workflowargs.currentStep=="S30"){
PUB_ADMIN.set('disabled',false);
}else{
PUB_ADMIN.set('disabled',true);
}
//运维管理中心负责人
var MAINTAIN_MGR=new dijit.form.ValidationTextBox({name:"MAINTAIN_MGR",id:"MAINTAIN_MGR"});
this.MAINTAIN_MGR.appendChild(MAINTAIN_MGR.domNode);
this.MAINTAIN_MGR =MAINTAIN_MGR;
//_usersConntinerwm
var _usersConnt = new dijit.form.Button({label: "选择用户"});
this._usersConntinerwm.appendChild(_usersConnt.domNode);
dojo.connect(_usersConnt, "onClick", this, "_handlePickupBtnClicked");
if(this.msgRequest.workflowargs.currentStep=="S30"&&this.msgResponse.bizfieldvalue.baseInfo['PUB_LEVEL']=="紧急"){
MAINTAIN_MGR.set('disabled',false);
_usersConnt.set('disabled',false);
}else{
MAINTAIN_MGR.set('disabled',true);
_usersConnt.set('disabled',true);
}
//系统发布专员
var SYS_PUBLISHER=new dijit.form.ValidationTextBox({name:"SYS_PUBLISHER",id:"SYS_PUBLISHER"});
this.SYS_PUBLISHER.appendChild(SYS_PUBLISHER.domNode);
this.SYS_PUBLISHER =SYS_PUBLISHER;
var pickupUserBtm = new dijit.form.Button({label: "选择用户"});
this._usersConntiner3.appendChild(pickupUserBtm.domNode);
dojo.connect(pickupUserBtm, "onClick", this, "_handlePickupUserBtnClicked");
if((this.msgRequest.workflowargs.currentStep=="S30"&&this.msgResponse.bizfieldvalue.baseInfo['PUB_LEVEL']=="一般")||this.msgRequest.workflowargs.currentStep=="S40"){
SYS_PUBLISHER.set('disabled',false);
pickupUserBtm.set('disabled',false);
}else{
SYS_PUBLISHER.set('disabled',true);
pickupUserBtm.set('disabled',true);
}
// 审批结果
var WANG_XIE = {
identifier:"hrFrom",
label: "id",
items:[
{hrFrom:"in", id:"同意"},
{hrFrom:"out", id:"不同意"}
]
};
var _sourceMainSystem = new dojo.data.ItemFileReadStore({data:WANG_XIE});
var filterSourceSystem = new dijit.form.ComboBox({
name: "WANG_XIE",id:"WANG_XIE",
value:"同意",
store: _sourceMainSystem,
searchAttr: "id"
},this.WANG_XIE);
this.WANG_XIE = filterSourceSystem;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
filterSourceSystem.set('disabled',true);
}else{
filterSourceSystem.set('disabled',false);
}
//审批历史
var WANG_XIEPP=new dijit.form.ValidationTextBox({name:"WANG_XIEPP",id:"WANG_XIEPP"});
this.WANG_XIEPP.appendChild(WANG_XIEPP.domNode);
this.WANG_XIEPP =WANG_XIEPP;
if(this.msgRequest.workflowargs.currentStep=="S10"||this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep==""){
WANG_XIEPP.set('disabled',true);
}else{
WANG_XIEPP.set('disabled',false);
}
//初始化参数
this._titleTextSpan.innerHTML = "日常发布<" + this.msgResponse.bizfieldvalue.baseInfo.BILL_ID + ">";
this._summary.value = "关于XX的日常发布";
this.setFormData();
},
//回填数据 通过id和name组成map对象 PUB_LEVEL
setFormData:function(){
for(var key in this.msgResponse.bizfieldvalue.baseInfo){
if(key == 'PUB_LEVEL'){
var pub=this.msgResponse.bizfieldvalue.baseInfo[key];
}
var value = this.msgResponse.bizfieldvalue.baseInfo[key];
var control = dijit.byId(key);
if(control && value) {
var dojoType = control.declaredClass;
if(dojoType=="dijit.form.DateTextBox") {
control.set('value', new Date(value));
} else {
control.set('value', value);
}
}
}
},
//根据Form数据设置Store
getFormData:function(){
//将响应消息中的部分数据复制到请求消息中
this.msgRequest.bizfieldvalue.baseInfo = this.msgResponse.bizfieldvalue.baseInfo;
for(var key in this.msgResponse.bizfieldvalue.baseInfo){
var control = dojo.byId(key);
if(control && control.value) {
var value = control.value;
this.msgRequest.bizfieldvalue.baseInfo[key] = value;
}
}
},
//提交方法
onSubmit: function(){
this.msgRequest.workflowargs.save = "false";
//设置业务相关的参数,供分支选择使用
this.msgRequest.workflowargs.varPassed = "true";
this.pushPage();
},
//保存方法
onSave: function(){
this.msgRequest.workflowargs.save = "true";
//设置业务相关的参数,供分支选择使用
this.msgRequest.workflowargs.varPassed = "true";
this.pushPage();
},
pushPage: function(){
this.getFormData();
console.dir({"tadaye":this.msgRequest});
/**
* 根据流程节点确定Action
*/
var save = this.msgRequest.workflowargs.save;
var action;
//如果是首次申请页面 保存
if(this.msgRequest.workflowargs.currentStep==""){
action = "DailyReleaseApplySaveAction";
}
// 草稿修改和被驳回需要修改
if(this.msgRequest.workflowargs.currentStep=="S11"||this.msgRequest.workflowargs.currentStep=="S10"){
action = "DailyReleaseApplyUpDateAction";
}
//主数据优化部负责人S20
if(this.msgRequest.workflowargs.currentStep=="S20"){
this.msgRequest.workflowargs["varXIEPANPAN"] = this.WANG_XIE.value;
action = "DailyReleaseApplyUpDateAction";
}
//发布管理专员 S30
if(this.msgRequest.workflowargs.currentStep=="S30"){
this.msgRequest.workflowargs["varSYS_PUBLISHER"] = this.SYS_PUBLISHER.value;
this.msgRequest.workflowargs["varPUB_LEVEL"]=this.PUB_LEVEL.value;
this.msgRequest.workflowargs["varXIEPANPAN"]=this.WANG_XIE.value;
action="DailyReleaseApplyUpDateAction";
}
//运维管理中心S40
if(this.msgRequest.workflowargs.currentStep=="S40"){
this.msgRequest.workflowargs["varSYS_PUBLISHER"] = this.SYS_PUBLISHER.value;
this.msgRequest.workflowargs["varXIEPANPAN"]=this.WANG_XIE.value;
action="DailyReleaseApplyUpDateAction";
}
//系统发布专员S50
if(this.msgRequest.workflowargs.currentStep=="S50"){
this.msgRequest.workflowargs["varXIEPANPAN"]=this.WANG_XIE.value;
action="DailyReleaseApplyUpDateAction";
}
//发布验证
if(this.msgRequest.workflowargs.currentStep=="S60"){
action="DailyReleaseApplyUpDateAction";
}
console.dir({xxxx:this.msgRequest});
var self = this;
jazz.client.xhrGet({
url: _URL,
content:{
action: _ACTION+action, method: "Action", handleAs: "json", timeout: 50000000,
args: dojo.toJson(this.msgRequest)
},
load:function(result) {
var json = dojo.fromJson(result);
if(json && json.id && json.id==200) {
self.setHeaderMessage('操作成功!');
} else {
self.setHeaderMessage("操作失败!");
}
// console.dir({"parent.msgRequest":parent.msgRequest});
self.msgResponse.bizfieldvalue = dojo.clone(self.msgRequest.bizfieldvalue);
self._saveBtn.setDisabled(true);
self._addBtn.setDisabled(true);
return result; // for other handlers in the chain
},
error:function(errorObj) {
return errorObj; // for other handlers in the chain
}
});
},
_handlePickupSystem:function(){
var dialog = new PickupUserDialog();
this._dialogs.push(dialog);
this.connect(dialog,"onOk","performPickupsystem");
},
performPickupsystem: function (users) {
if (users != null && users.length > 0) {
var userids='';
for (var i=0; i < users.length-1; i++) {
if (users[i].userId != null) {
if (users.length >1)
userids = userids+users[i].userId+',';
}
}
userids = userids+ users[users.length-1].userId;
this.REFER_SYSTEM.set("value",userids);
}
},
_handlePickupBtnClicked:function(){
var dialog = new PickupUserDialog();
//this._dialogs.push(dialog);
this.connect(dialog,"onOk","performPick");
},
performPick: function (users) {
if (users != null && users.length > 0) {
var userids='';
for (var i=0; i < users.length-1; i++) {
if (users[i].userId != null) {
if (users.length >1)
userids = userids+users[i].userId+',';
}
}
userids = userids+ users[users.length-1].userId;
this.MAINTAIN_MGR.set("value",userids);
}
},
_handlePickupUserBtnClicked:function(){
var dialog = new PickupUserDialog();
//this._dialogs.push(dialog);
this.connect(dialog,"onOk","performPickup");
},
performPickup: function (users) {
if (users != null && users.length > 0) {
var userids='';
for (var i=0; i < users.length-1; i++) {
if (users[i].userId != null) {
if (users.length >1)
userids = userids+users[i].userId+',';
}
}
userids = userids+ users[users.length-1].userId;
this.SYS_PUBLISHER.set("value",userids);
}
},
});
})();
html
<div class="com-ibm-ipd-content">
<div class="headpanel">
<div class="editorHeader">
<div class="firstRow">
<span class="CommandArea" style="float: right; padding-left:10px;">
<div class="Button" dojoattachpoint="_saveBtn" ></div>
</span>
<span style="float:left; padding-right:10px">
<img dojoAttachPoint="typeIcon" class="typeIcon" src="web/com.suning.ipd.rtcex.web/ui/graphics/template/capability.gif"></img>
<span class="typeText" dojoAttachPoint="_titleTextSpan">日常发布</span>
</span>
<div class="validationMessage" dojoAttachPoint="validationMessageSpan">
<a dojoAttachPoint="validationMessage" class="validationMessageAnchor" dojoAttachEvent="onclick: _handleHeaderMessageClick" href="#"></a>
</div>
<table style="float: right; padding-left:10px;">
<tr>
<td>
<div class="Button" dojoattachpoint="_addBtn" ></div>
</td>
<td>
<div class="Button" dojoattachpoint="_saveBtn" ></div>
</td>
</tr>
</table>
</div>
<div class="summaryRow">
<div class="summaryLabel">摘要:</div>
<div class = "nameInputContainer">
<input class="nameInput" dojoAttachPoint="_summary"/>
</div>
</div>
</div>
</div>
<div>
<div class="bodypanel" dojoAttachPoint="_resultsColumn">
<div class="Section">
<div class="sectionTitle">
【基本信息】
</div>
<div class="sectionContent">
<table class="actionTable" >
<tr class="TR">
<td class="QuarterLabelColumn">
日常发布编号
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="BILL_ID" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
申请人
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLICANT" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
申请时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLY_TIME" class="QuarterField"/>
<td class="QuarterLabelColumn">
发布级别
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="PUB_LEVEL" class="QuarterField"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn">
申请部门
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLY_DEPT" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
申请组
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="APPLY_GROUP" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
计划发布时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="PLAN_PUB_TIME" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
请求号
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REQUEST_NO" class="QuarterField"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn">
请求释放
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REQUEST_RELEASE" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
涉及系统
</td>
<td class="QuarterColumn">
<div dojoattachpoint="REFER_SYSTEM" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntiner2" />
</td>
</tr>
<tr class="TR">
<td >
请求描述
</td>
<td colspan="3">
<div dojoAttachpoint="REQUEST_DESC" />
</td>
<td colspan="0" >
发布要求
</td>
<td colspan="3">
<div dojoAttachpoint="PUB_REQUIRE" />
</td>
</tr>
<tr>
</tr>
</table>
</div>
</div>
<div class="Section" >
<div class="bodypanel" dojoAttachPoint="_resultsColumn">
<div class="sectionTitle">
【发布实施】
</div>
<div class="sectionContent">
<table class="actionTable" >
<tr >
<td class="QuarterLabelColumn">
实际开始时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REAL_START_DATE" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
实际结束时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="REAL_END_DATE" class="QuarterField"/>
</td>
<td class="QuarterLabelColumn">
是否发布成功
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="IS_FINISHED" class="QuarterField"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn"> 实施情况说明 </td>
<td class="QuarterColumn" colspan="2">
<div dojoAttachpoint="IMPL_DESC" />
</td>
</tr>
</table>
</div>
</div>
<div class="bodypanel" dojoAttachPoint="_resultsColumn">
<div class="sectionTitle">
【发布验证】
</div>
<div class="sectionContent">
<table class="actionTable">
<tr>
<td class="QuarterLabelColumn">
验证时间
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="PUB_CHECK_TIME"/>
</td>
<td class="QuarterLabelColumn">
是否通过
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="IS_PASSED"/>
</td>
<td class="QuarterLabelColumn">
事故责任人
</td>
<td class="QuarterColumn">
<div dojoAttachpoint="ACCIDENT_HOLDER" />
</td>
<td> </td>
</tr>
<tr class="TR">
</tr>
<tr class="TR">
<td class="QuarterColumn" colspan="3">
验证内容
</td>
<td class="QuarterColumn" colspan="3">
发布失败原因
</td>
</tr>
<tr>
<td colspan="3">
<div dojoAttachpoint="CHECK_CONTENT" />
</td>
<td class="Column" colspan="3" wedding=2>
<div dojoAttachpoint="PUB_FAIL_REASON"/>
</td>
</tr>
<tr class="TR">
<td class="QuarterColumn" colspan="3">
发布失败影响
</td>
<td class="QuarterColumn" colspan="3">
解决方案
</td>
</tr>
<tr>
<td class="Column" colspan="3" wedding=2>
<div dojoAttachpoint="PUB_FAIL_EFFECT" style="width:98%" />
</td>
<td class="Column" colspan="3" wedding=2>
<div dojoAttachpoint="SOLUTION" style="width:98%" />
</td>
</tr>
</table>
</div>
</div>
<div class="bodypanel" dojoAttachPoint="_resultsColumn" >
<div class="sectionTitle" >
【审批人员】
</div>
<div class="sectionContent">
<table class="actionTable" >
<tr class="TR">
<td class="QuarterLabelColumn">
*主数据优化部负责人
</td>
<td class="Column" >
<div dojoAttachpoint="DEPT_MGR" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntinerx" />
</td>
</tr>
<tr class="TR" >
<td class="QuarterLabelColumn">
*发布管理专员
</td>
<td class="Column" >
<div dojoAttachpoint="PUB_ADMIN" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntinerp" />
</td>
</tr>
<tr class="TR" >
<td class="QuarterLabelColumn">
*运维管理中心负责人
</td>
<td class="Column" >
<div dojoAttachpoint="MAINTAIN_MGR" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntinerwm" />
</td>
<td></td>
</tr>
<tr class="TR">
<td class="QuarterLabelColumn">
*系统发布专员
</td>
<td class="Column">
<div dojoAttachpoint="SYS_PUBLISHER" class="QuarterColumn"/>
</td>
<td class="QuarterLabelColumn"></td>
<td class="QuarterColumn">
<div dojoattachpoint="_usersConntiner3" />
</td>
</tr>
<tr>
<td class="QuarterLabelColumn">
审批结果
</td>
<td class="QuarterLabelColumn">
<div dojoAttachpoint="WANG_XIE" style="width:98%" class="QuarterColumn"/>
</td>
</tr>
<tr>
<td class="QuarterLabelColumn">审批意见 </td>
<td class="QuarterLabelColumn">
<div dojoAttachpoint="WANG_XIEPP" style="width:98%" class="QuarterColumn"/>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
js :
dojo.provide("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dojox.xml.parser");
dojo.require("dojo.i18n");
dojo.require("jazz.ui.Dialog");
(function(){
var _URL = net.jazz.ajax.BootstrapProperties.FRONTSIDE_URL+"/service/com.suning.ipd.rtcex.service.ws.IRawMessageService/";
function addOption(selectList, option){
if (dojo.isIE) {
var newOption = new Option(option.text, option.value);
newOption.EMPLOYEEID = option.EMPLOYEEID;
var newIndex = selectList.options.length;
selectList[newIndex] = newOption;
}
else {
option.selected = false;
var inserted = false;
for (i = 0; i < selectList.options.length; i++) {
if (selectList.options[i].text > option.text) {
selectList.insertBefore(option, selectList.options[i]);
inserted = true;
break;
}
}
if (!inserted) {
selectList.appendChild(option);
}
}
}
function removeOption(selectList, option){
if (dojo.isIE) {
var index = selectList.options.length;
for (var i = 0; i < selectList.options.length; i++) {
if (selectList.options[i] === option) {
index = i;
break;
}
}
selectList.remove(index);
}
else {
try {
selectList.removeChild(option);
}
catch (err) {
// don't throw an error if the option wasn't in the list to begin with
}
}
}
dojo.declare("com.suning.ipd.rtcex.web.ui.page.projectpublish.PickupUserDialog", [dijit._Widget, dijit._Templated], {
templatePath: dojo.moduleUrl("com.suning.ipd.rtcex.web", "ui/page/projectpublish/templates/PickupUserDialog.html"),
constructor: function(args){
if (args == null) {
args = {};
}
this.width = args.width || "450px";
var properties = {
"width": "450px",
"removeUsersOnAdd": true,
"searchLimit": 50
};
this.selectedUsersList = [];
},
postCreate: function(){
this.userSelector.size = 12;
this.userSelector.multiple = true;
this.selectedUsers.size = 6;
this.selectedUsers.multiple = true;
this.dialog = new jazz.ui.Dialog({
contentNode: this.contentNode,
primaryTitle: '选择用户对话框',
width: this.width,
closable: this.closable
});
this.connect(this.searchButton, "onclick", "_runSearch");
this.connect(this.selectButton, "onclick", "_runSelect");
this.connect(this.deselectButton, "onclick", "_runDeselect");
this.connect(this.cancelButton, "onclick", function(e){
dojo.stopEvent(e);
this.dialog.close();
});
this.connect(this.okButton, "onclick", "_onOk");
this.connect(this.userSelector, "ondblclick", "_runSelect");
this.connect(this.userSelector, "onchange", "_handleSelectorChange");
this.connect(this.selectedUsers, "onchange", "_handleSelectedChange");
this.connect(this.dialog, "onClose", "onClose");
this.searchText.focus();
},
_runSearch: function(e, query){
if (e != null) {
dojo.stopEvent(e);
}
if (this.searchText.value != "") {
var args1 = {
searchText: query == null ? this.searchText.value : query,
};
this.lastQueryTerm = args1.searchText;
this._setStatusMessage('正在查询...');
var self = this;
jazz.client.xhrGet({
url: _URL,
content: {
action: "biz.PickupUserAction",
method: "action",
args: dojo.toJson(args1)
},
headers: {
accept: "text/json"
},
handleAs: "json",
load:function(result) {
self.runSearchCallback(result);
},
error:function(errorObj) {
self._queryError(errorObj);
}
});
}
},
runSearchCallback: function(data){
this._clearStatusMessage();
var users = data.bizfieldvalue.userlist;
if (dojo.isIE) {
this.userSelector.options.length = 0;
}
else {
dojox.xml.parser.removeChildren(this.userSelector);
}
if (users != null) {
var selectedUserMap = {};
for (var i = 0; i < this.selectedUsers.options.length; i++) {
selectedUserMap[this.selectedUsers.options[i].value] = true;
}
users.sort();
// users.sort(function(a, b){
// if (a.EMPLOYEENAME == null || a.EMPLOYEENAME.length === 0) {
// return 1;
// }
// else
// if (b.EMPLOYEENAME == null || b.EMPLOYEENAME.length === 0) {
// return -1;
// }
// else {
// return a.EMPLOYEENAME[0] === b.EMPLOYEENAME[0] ? 0 : a.EMPLOYEENAME[0] > b.EMPLOYEENAME[0] ? 1 : -1;
// }
// });
for (i = 0; i < users.length; i++) {
// filter out users that do not have a name or do not have exactly one user ID
if (users[i].EMPLOYEENAME != null && users[i].EMPLOYEENAME.length > 0 &&
users[i].EMPLOYEEID != null &&
users[i].EMPLOYEEID.length > 0) {
if (selectedUserMap[users[i].EMPLOYEEID]) {
continue;
}
var option = new Option(users[i].EMPLOYEENAME+' - <' +users[i].EMPLOYEEID+'>', users[i].EMPLOYEEID);
if (dojo.isIE) {
this.userSelector.options[this.userSelector.options.length] = option;
}
else {
this.userSelector.appendChild(option);
}
}
}
}
this._handleSelectedChange();
},
_runSelect: function(e){
dojo.stopEvent(e);
for (var i = 0; i < this.userSelector.options.length; i++) {
if (this.userSelector.options[i].selected) {
var option = this.userSelector.options[i];
addOption(this.selectedUsers, option);
removeOption(this.userSelector, option);
i--;
}
}
this._handleSelectorChange();
this._handleSelectedChange();
},
_runDeselect: function(e){
dojo.stopEvent(e);
for (var i = 0; i < this.selectedUsers.options.length; i++) {
if (this.selectedUsers.options[i].selected) {
var option = this.selectedUsers.options[i];
removeOption(this.selectedUsers, option);
i--;
}
}
this._runSearch(e, this.lastQueryTerm);
},
_onOk: function(e){
dojo.stopEvent(e);
var users = [];
for (var i = 0; i < this.selectedUsers.options.length; i++) {
users.push({
name: this.selectedUsers.options[i].text,
userId: this.selectedUsers.options[i].value,
userId1: this.selectedUsers.options[i].EMPLOYEEID
});
}
this.onOk(users);
},
_handleSelectorChange: function(e){
var count = 0;
var selected = null;
for (var i = 0; i < this.userSelector.options.length; i++) {
if (this.userSelector.options[i].selected) {
selected = this.userSelector.options[i];
count++;
}
}
this.selectButton.disabled = (count === 0);
dojox.xml.parser.removeChildren(this.userInfoDiv);
if (count === 1) {
if (selected.EMPLOYEEID != null) {
this.userInfoDiv.appendChild(document.createTextNode(selected.EMPLOYEEID));
}
}
else
if (count > 1) {
this.userInfoDiv.appendChild(document.createTextNode(count + this.messages.selected));
}
},
_handleSelectedChange: function(e){
var selected = false;
for (var i = 0; i < this.selectedUsers.options.length; i++) {
if (this.selectedUsers.options[i].selected) {
selected = true;
}
}
this.deselectButton.disabled = !selected;
this.okButton.disabled = this.selectedUsers.options.length === 0;
},
onOk: function(selectedUsers){
this.dialog.close();
},
onClose: function(){
},
_queryError: function(err){
this._setStatusMessage(err.message, true);
},
_clearStatusMessage: function(){
this.searchStatus.style.visibility = "hidden";
},
_setStatusMessage: function(msg, isError){
this.searchStatus.style.visibility = "visible";
dojox.xml.parser.replaceChildren(this.searchStatus, document.createTextNode(msg));
this.searchStatus.className = isError ? "ErrorStatus" : "NormalStatus";
}
});
})();
相关推荐
Dojo 是一个强大的JavaScript工具库,它为Web开发提供了丰富的功能和组件,涵盖了从DOM操作、事件处理到AJAX通信等多个方面。Dojo的核心在于它的模块化系统,这使得开发者可以按需加载代码,提高应用的性能和可维护...
### Dojo常用方法总结 Dojo是一个开源的JavaScript框架,用于构建高性能的富客户端Web应用程序。它提供了一系列功能强大的工具和API,可以帮助开发者更轻松地处理DOM操作、AJAX调用、用户界面组件构建等任务。本文...
Dojo 是一个功能丰富的 JavaScript 库,它提供了一系列模块化、面向对象的工具,用于构建高性能的 Web 应用程序。在 Dojo 中,模块和包的概念是核心组成部分,它们帮助开发者组织和管理代码,使其更易于维护和重用。...
DOJO中文手册是针对JavaScript库Dojo的详细指南,源自中国的本地化版本,旨在帮助开发者理解和使用这个强大的工具包。Dojo是一个开源的DHTML工具集,由nWidgets、Burstlib和f(m)等多个项目的合并发展而来,因此被...
《dojo中文文档-dojo手册》提供了全面而深入的Dojo框架知识,这是一份非常有价值的资源,对于想要理解和掌握Dojo JavaScript库的开发者来说至关重要。Dojo是一个强大的JavaScript工具包,它提供了丰富的功能,包括...
Dojo是一个非常强大的、面向对象的、开源的JavaScript工具箱,它为开发富客户端Ajax应用提供了一套完整的小部件和一些特效操作。曾经有人这样说:“对于一个Web开发者而言,如果没有Dojo,他将是一个“残废”的...
手册中列举了一些常用的Dojo包,如dojo.io用于不同类型的IO传输,dojo.dnd提供拖放功能的API,dojo.string提供了字符串处理方法,dojo.date帮助解析和操作日期,dojo.event处理事件驱动和AOP开发,dojo.back管理撤销...
Dojo事件处理框架是JavaScript库Dojo Toolkit中的一个重要组成部分,它提供了一种统一的方式来管理和处理DOM事件以及JavaScript对象之间的交互。这个系统深受面向切面编程(AOP)思想的影响,尤其是其advice机制,...
Struts2-dojo-plugin-2.2.1.jar 是一个针对Apache Struts2框架的扩展插件,主要用于增强Struts2应用的用户界面交互性,特别是通过集成Dojo JavaScript库来提供丰富的AJAX功能和用户体验。这个插件是Struts2与Dojo ...
Dojo 是一个强大的JavaScript工具库,它为Web开发提供了丰富的功能和组件,涵盖了从DOM操作、事件处理到AJAX通信,再到复杂的用户界面构建。在深入探讨Dojo的知识点之前,我们先简单了解一下Dojo的核心概念。 1. **...
Dojo 是一个强大的 JavaScript 库,它提供了丰富的功能,包括对国际化的支持。在Dojo中,国际化(i18n)使得应用可以适应不同语言和文化环境,从而为全球用户提供一致的体验。以下是Dojo国际化的主要方面: 一、...
《dojo快速入门(中文版)》 dojo Toolkit是一个开源的JavaScript工具包,旨在简化Web应用的构建过程,提供高效且设计精良的API。它的轻量级特性(约26kb)和强大的功能集使得dojo在各种项目中都能灵活运用。核心功能...
Dojo 是一个强大的JavaScript工具库,它为Web开发提供了丰富的功能和组件,支持现代浏览器以及对旧版浏览器的兼容。这个包下载包含了四个主要的文件目录:dijit、dojo、dojox 和 util,这些都是Dojo框架的核心部分。...
Dojo 是一个强大的JavaScript工具库,它为开发者提供了丰富的功能,包括对Array对象的处理。在Dojo中,数组操作是一大亮点,因为它们提供了一系列高效且易用的方法,使得处理数组变得更加便捷。 首先,`dojo....
Dojo 是一个强大的JavaScript工具库,它为Web开发提供了丰富的功能和组件,包括AJAX、DOM操作、动画效果、事件处理、数据存储等。标题提到的"dojo1.8.chm"是Dojo 1.8版本的离线帮助文档,通常包含API参考、教程和...
Dojo 是一个强大的JavaScript工具库,它为Web开发提供了丰富的功能和组件,涵盖了从DOM操作、事件处理到AJAX通信、动画效果等各个方面。在深入理解Dojo之前,我们需要了解JavaScript在网页开发中的核心地位以及它...
### Dojo 快速入门知识点详解 #### 一、Dojo 概览 Dojo 是一个功能强大且灵活的开源 JavaScript 库,主要用于构建高性能的富客户端 Web 应用程序。Dojo 提供了一系列工具和组件,使得开发者能够轻松创建交互式 Web...
Dojo 是一个强大的JavaScript工具库,专为构建富互联网应用程序(RIA)而设计。它提供了一个全面的开发框架,包括AJAX、DOM操作、动画效果、数据存储、模块化代码管理等多个方面,使得Web开发者能够更高效地创建交互...
dojo文档 dojo文档 dojo文档 dojo文档 dojo文档 dojo文档 dojo文档 dojo文档 dojo文档 dojo文档 dojo文档 dojo文档