|

楼主 |
发表于 2016-9-6 11:02:46
|
显示全部楼层
Model.prototype.newOrgBtnClick = function(event) {
var row = this.comp("treeData").getCurrentRow();
var parentID = null;
if (row) {
parentID = this.comp("treeData").getCurrentRowID();
var parentName = row.row.CLASS_NAME.value.latestValue;
} else
var parentName = null;
this.comp("dicDialog").open({
data : {
"openMode" : "new",
"parentID" : parentID,
"parentName" : parentName
}
});
};
Model.prototype.dicDialogReceive = function(event) {
this.comp("treeData").refreshData();
this.comp("DicData").refreshData();
};
这个是主界面代码
Model.prototype.windowReceiverReceive = function(event) {
var orgData = this.comp("orgData");
this._params = event.data;
this.openMode.set(this._params.openMode || "view");
if (this._params.openMode == "new") {
orgData.clear();
orgData.newData();
orgData.setValue("UPPER_CODE", this._params.parentID);
orgData.setValue("PARENT_NAME", this._params.parentName);
}
else{
orgData.setFilter("filter1", "Base_class_dict='" + event.data.parentID + "'");
orgData.refreshData();
}
};
Model.prototype.okBtnClick = function(event) {
$this = this;
var orgData = this.comp("orgData");
var row = orgData.getCurrentRow();
var className = orgData.getValue("CLASS_NAME", row);
var classCode = orgData.getValue("CLASS_CODE", row);
var upCode = orgData.getValue("UPPER_CODE", row);
var params = new biz.Request.ActionParam();
params.setString('className', className);
params.setString('classCode', classCode);
params.setString('upCode', upCode);
biz.Request.sendBizRequest({
dataType : "application/json",
context : this.getContext(),
action : 'unikType',
parameters : params,
callback : function(result) {
if (result.state) {
if (result.response == false) {
if (orgData.saveData()) {
if ($this._params.openMode == "new") {
$this._params.orgID = orgData.getRowID();
}
$this.comp("windowReceiver").windowEnsure(
$this._params);
}
} else {
justep.Util.hint("字典类别或者字典代码已经存在,请更改!");
}
}
else{
throw new Error("调用失败");
}
}
});
};
这个是对话框JS代码
|
|