view.get("#dsProduct").getData().insert();
或者view.get("#dsProduct").insert();
view.get("#dsProduct.data").insert();推荐使用
#dsProduct.data”表示拿到数据对象
var record = this.get("#dsProduct.data:#");
if (record) {
dorado.MessageBox.confirm("确认要删除当前记录吗?", function(){
record.remove();
});
}
else {
dorado.MessageBox.alert("当前没有数据可以删除!");
}
//获得当前dataset的字段,并赋值(dorado7升级包,特别注意)
var aaa = view.get("#dsProduct.data:#").get("xxx");
view.get("#dsProduct").set("parameter",{
aaa: aaa,
org:"test"
});
//含有下级Reference
view.get("#dsPrCenter").getData("#").getData("#stmain");
view.get("#dsPrCenter").getData("#.#stmain");
view.get("#dsProduct.data:#").cancel();
view.id("dialogEdit").show();
view.get("#dialogEdit").show();
view.get("#dialogEdit").hide();
var entity = this.get("#autoForm1.entity");//保证json对象内部的参数与后台接受的parameter参数名相同
view.get("#dsProduct") .set("parameter",entity).flushAsync();
//获得AutoForm中的entity内容
var entity = view.id("recAutoForm").get("entity");
alert(entity.length+" "+entity.width);
dorado.MessageBox.alert(view.get("#dsProduct.data:#.productName"));
view.set("#dsProduct.data:#.productName","testValue");
view.set("#autoForm1.entity", {
productName: null,
unitsInStock: null
});
//升级版本
view.get("#themeDetailForm.entity").set("REASON_MEMO","");//设定当前编辑框值为空
view.get("#themeDetailForm.entity").set("parameter",{
productName: null,
unitsInStock: null
});//设定当前编辑框值为空
ListDropDown ==》self.set("value",1);系统直接会将数值1赋给文本域
AutoMappingDropDown ==》self.set("value",1);系统会根据对应的文本域的属性mapValues绑定的Entity进行映射显示。
例如这里映射的Entity对象为1 男,0 女。在这里文本域会根据设置显示为“男”
var node = self. get("currentNode");
if(node.get("level")==3){
//获得当前节点对应的数据实体对象
var entity = self.get("currentNode.data");
//通过实体对象名称.属性获得指定的属性值
var id = entity.get("example.id");
//刷新对应的dataset
this.get("#dsExample").set("parameter",id).flushAsync();
}
// 通过tab的name属性切换
view.get("#tabControl").set("currentTab","tab2");
// 通过tab的索引(index)属性切换
view.get("#tabControl").set("currentIndex",1);
//根据名字切换tab
var tab = self.get("currentTab").get("name");
if(tab!="tab4"){
view.id("tabControl").disableTab("tab4");
}
var element = view.get("#themeDetailForm").getElement("REASON_MEMO");
element.set("readOnly",false);
view.get("#procTopicHeaderForm").getElement("TOTAL_SCORE").set("visible",false);
//是否显示
view.get("#btnPrint").set("visible",true);
//是否控制
view.get("#btnPrint").set("disable",true);
var datas = view.id("dsHeader").getData("#.detail");
datas.each(function(entity){
alert(entity.get("RIGHT_MODE"));
alert(entity.get("RIGHT_ITEM"));
});
//获取当前选择的项
var datas = view.get("#dgProcZperright").get("selection");
var flag = false;
//遍历选择项,判断当前被遍历的数据是否包含已生成试卷的项
datas.each(function(entity){
var isCreatePaper = entity.get("IS_CREATE_PAPER");
//若有调整,若无执行生成过程
if(isCreatePaper=="1"){
flag = true;
return false;
}else{
flag;
}
});
//若有调整,若无执行生成过程
if(flag==true){
dorado.MessageBox.alert("当前选择项包含已生成试卷的项,请调整!");
}else{
}
//选择项是否选择(false代表未选中,true代表被选中)
view.id("sourceGrid").set("selection","false");
alert(view.id("sourceGrid").get("selection"));
//设定为单项选择项
view.get("#sourceGrid").set("selectionMode","singleRow");
//判断选择的项数量
var entity = view.id("sourceGrid").get("selection");
if(entity.length>1){
}
var entity = view.id("dsHeader").getData("#.#detail");
alert(entity.get("RIGHT_MODE"));
var entity = view.get("#dataSetGroup.data:#.#users");
alert(entity.get("username"));
//由于RIGHT_MODE字段的无法保存数据,使用了自定义字段MODE替代,传递后台保存数据
var entity = view.id("dsHeader").getData("#.#detail");
var right_mode = entity.get("RIGHT_MODE");
if(right_mode!=null){
entity.set("MODE",right_mode);
}
view.id("customDropDown").close(value);
var entity = view.get("#dataSetGroup.data:#.rp_confield_desc");
var entity = view.id("dataSetGroup").getData("#.rp_confield_desc");
var entity = view.get("#dataSetGroup.data:#");
var a = entity.get("rp_confield_desc");
var entity = view.get("#dataSetGroup.data:#").get("rp_confield_desc");
var rightMode = "";
view.id("actGetPatter").set("parameter",{
"tableName" : tableName,
"fieldName" : fieldName
}).execute(function(result){
rightMode = result.RIGHT_MODE;
});
后台对应的方法
public Map<String, Object> getPatter(String tableName, String fieldName) {};
或者
public Map<String, Object> getPatter( Map<String, Object> map ) {
String tableName =(String )map.get("tableName");
String tableName =(String )map.get("fieldName");
Map<Object, Object> returnMap1 = new HashMap<>(16);
returnMap1.put("RIGHT_MODE","tableName ");
}
bdf.JasperReports.prototype.showReport=function(jasperFile,parameters){}
bdf.JasperReports.prototype.downloadReport=function(jasperFile,type,parameters){}
var entity1 = view.get("#dataSetUser.data:#");
var entityList = view.get("#dataSetUser.data");
view.get("#dataSetUser").set("pageNo",2);
view.get("#dataSetUser").flushAsync();
//entityList.first();
entityList.each(function(entity){
if(entity1.get("username")==entity.get("username")){
entityList.setCurrent(entity);
}
});
self.resetUserPhoto = function(){}
window.changeUserPhoto = function(img){}
window.self 功能:是对当前窗口自身的引用。它和window属性是等价的。语法:window.self。注:window、self、window.self是等价的。
window.top 功能:返回顶层窗口,即浏览器窗口。 语法:window.top 注:如果窗口本身就是顶层窗口,top属性返回的是对自身的引用。
window.parent 功能:返回父窗口。语法:window.parent 注:如果窗口本身是顶层窗口,parent属性返回的是对自身的引用。
this.createButton = function(){
view.addChild(new dorado.widget.Button({
id: "saveButton",
caption: "中途提交",
action: "SavePersResult",
icon: "url(>skin>common/icons.gif) -20px 0px",
onClick: function(self,arg){
view.id("SavePersResult").execute();
//关闭父页面
window.parent.$id("dialogTopicDetail").objects[0].hide();
} }));
}
将控件添加到AufoForm中
this.createMidButton = function(){
view.id("form").addElement(new dorado.widget.Button({
id: "saveMidButton",
caption: "中途提交",
action: "SavePersResult",
icon: "url(>skin>common/icons.gif) -20px 0px",
onClick: function(self,arg){
view.id("SavePersResult").execute();
if (window.parent.$id("dsTopicList").objects[0].getData("#").get("IS_CREATE_PAPER") == "0") {
window.parent.$id("dsTopicList").objects[0].getData("#").set("IS_CREATE_PAPER","1");
window.parent.$id("updateAction1").objects[0].execute();
}
//关闭父页面
window.parent.$id("dialogTopicDetail").objects[0].hide();
} }));
}
在onRefreshDmo添加
$(self.getDom().firstChild).css("color","yellow");
var oHead = oHtml.firstChild;
var oBody = oHtml.lastChild;
var oHead = oHtml.childNodes.item(0);
view.set("#text.style",{
"border": "1px #FC3737 solid",
color: "red"
});
var grid = view.id("dgPrStitem");
var entity = grid.getCurrentItem();
var row = grid.get("itemModel").getItemIndex(entity)+1;
alert(row);
//datagrid中数据向下移动一行(向上移动的效果思路一致)
//思路:
//1. 首先获得当前移动的数据entity,并且将光标移到到下一行move(1);
//2. 其次记录移动后光标定位的数据eneity,并且将上一行的数据remove掉;
//3. 最后将原本的entity数据insert到光标定位到当前行的后面。
//这样整体上形成的效果就是数据向下移动
var grid = view.id("dgPrStitem");
var entity = view.id("dsPrStitem").getData("#");
var entityList = view.id("dsPrStitem").getData();
entityList.move(1);
entityList.remove(entity);
//获得当前数据的序列号,修改移动后数据的序列号
var currentity = view.id("dsPrStitem").getData("#");
var rown = grid.get("itemModel").getItemIndex(currentity)+1;
currentity.set("RANK_ORDER",rown);
//添加的数据,并修改序列号
entityList.insert(entity,"after",currentity);
var insertentity = view.id("dsPrStitem").getData("#");
var rowns = grid.get("itemModel").getItemIndex(insertentity)+1;
insertentity.set("RANK_ORDER",rowns);
insertentity.setState(dorado.Entity.STATE_MODIFIED);
view.id("actStItem").execute();
保存界面
var componentProfile = new bdf.ComponentProfile.DataGrid();
componentProfile.saveGridSet(this,"gridMain");
重置界面
var componentProfile = new bdf.ComponentProfile.DataGrid();
componentProfile.resetGrid(this,"gridMain");
不考虑在默认支持此功能,给两个解决办法:
1. 使用exClassName
比如为CheckBox定义一个exClassName是d-checkbox-multiline,然后这么定义CSS:
.d-checkbox-multiline {
height: auto;
}
.d-checkbox-multiline .caption{
white-space: normal;
}
RadioButton类似。
2. 既然使用了HtmlContainer,就使用原生的Html中的CheckBox和RadioGroup。
onRenderHeaderCell 事件中写
arg.dom.innerHTML="1<br>2<br>3";
var dom = jQuery(arg.dom);
dom.empty();
dom.xCreate({
tagName: "Button",
content: "打印",
onclick: function(){
alert(11);
}
});
在控件的onCreateDom()中添加
arg.dom.onmouseover = function(){
//这里面处理
dorado.widget.NotifyTipManager.notify("鼠标移动到我上面时,会自动出现提示信息!");
}
添加style cursor:pointer
/**
* 获得所有的顶级节点
*/
//根节点,此节点时树状列表内部的顶层节点
var root = self.get("root");
var nodes = root.get("nodes");
//节点记录的变量
var labels = "", label = "", childLabels = "", rootLabel="", childNodes, childChecked, count = 0;
//遍历根节点
nodes.each(function(node){
var checked = node.get("checked");
//checked包含三种状态,选中(true)、半选中(null)、不选中(false)。当为true、null时表示选中
if(checked!=false){
count++; //父节点计数器
rootLabel = node.get("label"); //父节点
label = getChildNode(node); //子节点
if(childLabels){
childLabels="";
}
//拼接label字符串
labels += count+"."+rootLabel +": "+ label+"; ";
}
});
//将拼接的label赋值给label
view.id("label4").set("text",labels);
/**
* 处理递归子节点的函数
* @param {Object} node
*/
function getChildNode(node){
//判断当前选中节点是否展开,并是否包含被选中的子节点
if(node.get("expanded")==true){
childNodes = node.get("nodes");
childNodes.each(function(childNode){
childChecked = childNode.get("checked");
if(childChecked!=false){
if(childLabels){
childLabels += ","+childNode.get("label");
}else{
childLabels+=childNode.get("label");
}
//递归函数调用
getChildNode(childNode);
}
});
return childLabels;
}
}
/**
* 获得所有的顶级节点
*/
//根节点,此节点时树状列表内部的顶层节点
var root = self.get("root");
var nodes = root.get("nodes");
//节点记录的变量
var labels = "", label = "", childLabels = "", rootLabel="", childNodes, childChecked, count = 0;
//遍历根节点
nodes.each(function(node){
var checked = node.get("checked");
//checked包含三种状态,选中(true)、半选中(null)、不选中(false)。当为true、null时表示选中
if(checked!=false){
count++; //父节点计数器
rootLabel = node.get("label"); //父节点
label = getChildNode(node); //子节点
if(childLabels){
childLabels="";
}
//拼接label字符串
labels += count+"."+rootLabel +": "+ label+"; ";
}
});
//将拼接的label赋值给label
view.id("label4").set("text",labels);
/**
* 处理递归子节点的函数
* @param {Object} node
*/
function getChildNode(node){
//判断当前选中节点是否展开,并是否包含被选中的子节点
if(node.get("expanded")==true){
childNodes = node.get("nodes");
childNodes.each(function(childNode){
childChecked = childNode.get("checked");
if(childChecked!=false){
if(childLabels){
childLabels += ","+childNode.get("label");
}else{
childLabels+=childNode.get("label");
}
//递归函数调用
getChildNode(childNode);
}
});
return childLabels;
}
}
36.Label内容加粗
style添加font-weight=bold
//获得鼠标的位置
var clientX = arg.event.clientX;
var clientY = arg.event.clientY;
//指定画中机关在指定区域内显示,否则隐藏
if ((clientY > 20) && (clientX > 300)) {
view.id("floatPanel1").set("visible",true);
view.id("floatPanel2").set("visible",true);
view.id("floatPanel3").set("visible",true);
}else {
view.id("floatPanel1").set("visible",false);
view.id("floatPanel2").set("visible",false);
view.id("floatPanel3").set("visible",false);
}
arg.dom.onmousemove = function(){
view.id("floatPanel1").set("visible",true);
view.id("floatPanel2").set("visible",true);
view.id("floatPanel3").set("visible",true);
}
arg.dom.onmouseout = function(){
view.id("floatPanel1").set("visible",false);
view.id("floatPanel2").set("visible",false);
view.id("floatPanel3").set("visible",false);
}
var windows = view.id("iframe1").get("iFrameWindow");
var container = windows.$id("containerA").objects[0];
if (arg.property == "whCode") {
// 由code拿到name
var key = arg.entity.get("whCode");
var value = arg.entity.getPropertyDef("whCode").getMappedValue(key);
arg.entity.set("whAbbr", value);
}
var row = self.get("itemModel").getItemIndex(arg.data)+1;
if(row%2==0){
arg.dom.style.background = "red";
}else{
arg.dom.style.background = "";
}
functions = {
/*两个时间相差天数兼容火狐和谷歌*/
"dateDifference": function dateDifference(date1, date2){
if (date1 > date2) {
dorado.MessageBox.alert("开始日期大于结束日期,请重新填写!");
}
else
if (date1 === date2) {
return 1;
}
else {
date11 = Date.parse(date1);
date22 = Date.parse(date2);
var dateSpan = Math.abs(date22 - date11);
var days = Math.ceil(dateSpan / (24 * 3600 * 1000));//向上取整
return days;
}
},
/*按钮控制*/
"btnAdjust": function(){
var data = view.get("#dsExample1.data:#");
if (data) {
var pk = data.get("dsExample1");
if (pk) {
var status = data.get("applyStatus");//某个状态
switch (status) {
//根据状态的不一样进行不同的按钮控制。最好将所有要控制的按钮都展现,防止出现错误
case "A1": //
view.get("#btnAdd").set("disabled", false); //新建
view.get("#btnEdit").set("disabled", false); //保存
break;
case "A2": //
view.get("#btnAdd").set("disabled", false); //新建
view.get("#btnEdit").set("disabled", false); //保存
break;
case "B": //
view.get("#btnAdd").set("disabled", false); //新建
view.get("#btnEdit").set("disabled", true); //保存
break;
case "D": //
view.get("#btnAdd").set("disabled", false); //新建
view.get("#btnEdit").set("disabled", true); //保存
break;
}
}
else {
view.get("#btnAdd").set("disabled", false); //新建
view.get("#btnEdit").set("disabled", false); //保存
}
}
else {
view.get("#btnAdd").set("disabled", false); //新建
view.get("#btnEdit").set("disabled", true); //保存
}
},
/*查询*/
"queryClick": function(){
var entity = view.get("#dsQuery.data:#");//获取搜索条件中的每一个数据
var compId = entity.get("compId"); //公司别
var expenseApplyNo = entity.get("expenseApplyNo"); //报支单号
var expenser = entity.get("expenser"); //报支人
var applyStatus = entity.get("applyStatus"); //单据状态
var expenseDate = entity.get("expenseDate"); //报支日期
//进行刷新
dsFmer1101.set("parameter", {
compId: compId,
expenseApplyNo: expenseApplyNo,
expenser: expenser,
applyStatus: applyStatus,
expenseDate: expenseDate
}).flushAsync(function(datas){
if (datas.entityCount > 0) {
//如果dsFmer1101有数据,进行多表查询,查询dsFmer1102
var fmer1101 = view.get("#dsFmer1101.data:#");
dsFmer1102.set("parameter", {
compId: fmer1101.get("compId"), //公司别
expenseApplyNo: fmer1101.get("expenseApplyNo") //报支单号
}).flushAsync(function(){
//按钮控制
functions["btnAdjust"]();
});
}
else {
dorado.MessageBox.alert("没有您要查询的数据!");
}
});
},
/*新建报支单*/
"newClick": function(){
window.loginUserName = "${loginUsername}";//获取登录者的名字
view.get("#dsFmer1101").flushAsync(function(){
dsFmer1101.insert({
"proposer": loginUserName, //填单人:当前登录人(不可修改)
"expenser": loginUserName //报支人:当前登录人(可修改)
});
//因为dsFmer1101与dsFmer1102是父子表,所以新增的时候要清空绑定的子表
dsFmer1102.clear();
functions["btnAdjust"]();
});
},
/*保存*/
"saveClick": function(){
var er1101 = view.get("#dsFmer1101.data:#");
var er1102s = view.get("#dsFmer1102.data");
var flag = 0;
if (er1102s.entityCount > 0) {
var categoryNo = er1101.get("categoryNo");
//报销总金额
var totalAmt = 0;
er1102s.each(function(er1102){
var itemNo = er1102.get("itemNo");
var seqno = er1102.get("seqno");
var expenseAmt = er1102.get("expenseAmt");
var taxAmt = er1102.get("taxAmt");
var noTaxAmt = er1102.get("noTaxAmt");
expenseAmt = expenseAmt.toFixed(2) * 1;
var sumAmt = taxAmt + noTaxAmt;
if (sumAmt != expenseAmt) {
if (seqno) {
dorado.MessageBox.alert("明细序号为" + seqno + "的数据中报销金额不等于不含税金额 + 税额");
}
else {
dorado.MessageBox.alert("新增的数据中报销金额不等于不含税金额 + 税额");
}
flag = 1;
}
totalAmt = totalAmt + expenseAmt;
view.id("getCategoryNo").set("parameter", {
itemNo: itemNo
}).execute(function(data){
if (data != categoryNo) {
if (seqno) {
dorado.MessageBox.alert("无法进行保存," + "明细序号为" + seqno + "的费用项目与主档费用大类需一致!!");
}
else {
dorado.MessageBox.alert("无法进行保存," + "新增的费用项目与主档费用大类需一致!!");
flag = 1;
}
}
});
});
totalAmt = totalAmt.toFixed(2) * 1;
if (flag == 0) {
var pk = er1101.get("fmer1101Id");
if (pk == undefined | pk == null) {//新增
saveAction.set("parameter", {
totalAmt: totalAmt
}).execute(function(msg){
if (msg) {
dorado.MessageBox.alert(msg);
}
else {
//dsFmer1101.flushAsync();
functions["btnAdjust"]();
dorado.MessageBox.alert("保存成功!");
}
});
}
else {//修改
er1101.state = 2;
saveAction.set("parameter", {
totalAmt: totalAmt
}).execute(function(msg){
if (msg) {
dorado.MessageBox.alert(msg);
}
else {
//dsFmer1101.flushAsync();
functions["btnAdjust"]();
dorado.MessageBox.alert("保存成功!");
//info.doSet("text","修改成功...");
}
});
}
}
}//如果count为0
else {
dorado.MessageBox.alert("报支明细不能为空!");
}
},
/*删除*/
"deleteClick": function(){
var options = {
callback: function(){
var er1101 = view.get("#dsFmer1101.data:#");
var er1102s = view.get("#dsFmer1102.data");
//主表删除的时候,明细表一并删除
er1101.remove();
er1102s.each(function(er1102){
er1102.remove();
});
saveAction.execute(function(msg){
if (msg) {
dorado.MessageBox.alert(msg);
}
else {
dsFmer1101.flushAsync();
dsFmer1102.flushAsync();
functions["btnAdjust"]();
dorado.MessageBox.alert("已删除!");
}
});
},
icon: "WARNING"
};
dorado.MessageBox.confirm("您确定要删除当前报销主档和明细档信息吗?", options);
},
/*送审*/
"submitClick": function(){
var er1101 = view.get("#dsFmer1101.data:#");
//er1101.set("applyStatus", "B");//单据状态:审核中
//每个数据又0,1,2,3四种状态
//0,未改变,1,新增,2,修改,3,删除
//如果是0,则不能保存,所以设置为2
er1101.state = 2;
submitAction.set("parameter", {
pk: er1101.get("fmer1101Id")
}).execute(function(msg){
if (msg) {
dorado.MessageBox.alert(msg)
}
else {
//dsFmer1101.flushAsync();
functions["btnAdjust"]();
dorado.MessageBox.alert("送审成功!");
//info.doSet("text","送审成功...");
}
});
},
/*撤回*/
"cancelSubClick": function(){
var er1101 = view.get("#dsFmer1101.data:#");
er1101.set("applyStatus", "A1");//单据状态:新增
cancelSubAction.set("parameter", {
pk: er1101.get("fmer1101Id")
}).execute(function(msg){
if (msg) {
dorado.MessageBox.alert(msg)
}
else {
//dsFmer1101.flushAsync();
functions["btnAdjust"]();
dorado.MessageBox.alert("撤回成功!");
});
},
/*上传附件*/
"uploadAnnexClick": function(){
// dialog弹窗页面展示
dlUploadAnnex.show();
},
/*打印*/
/*
"printMake":function(){
var entity=view.get("#dsEr1101.data:#");
var reimBurseMentNo=entity.get("reimBurseMentNo");
view.get("#getCategory").set("parameter",{
reimBurseMentNo:reimBurseMentNo
}).execute();
},
*/
/*新增一条明细*/
"addDetailed": function(){
var fmer1101 = view.get("#dsFmer1101.data:#");
if (fmer1101) {
view.id("getManageDeptId").set("parameter", {
empId: loginUserName
}).execute(function(data){
dsFmer1102.insert({
"proposer": loginUserName,
"expenser": loginUserName,
"expenseDept": data
});
});
//var expenseType = fmer1101.get("expenseType");
//dsEr0001.set("parameter",{
// "expenseType":expenseType
//}).flushAsync();
}
else {
dorado.MessageBox.alert("请先新建主档信息!");
}
},
/*删行,删除一条明细*/
"delDetailed": function(){
var fmer1102 = view.get("#dsFmer1102.data:#");
if (fmer1102) {
fmer1102.remove();
/*
deleteEr002.set("parameter",{
"pkEr1102":fmer1102.get("pkEr1102")
}).execute(function(data){
var er1102 = view.get("#dsEr1102.data");
var er1101 = view.get("#dsEr1101.data:#");
var amt = 0 ;
er1102.each(function(er1102B){
amt = amt + er1102B.get("expenseAmt");
})
er1101.set("expenseAmt",amt);
takeEr001.execute();
dorado.MessageBox.alert(data);
});
*/
}
},
/*辅助核算弹框数据行双击/确认事件*/
"doSelectAssist": function(data){
var no = data.get("auxiliaryNo"); //辅助核算编码
var name = data.get("auxiliaryName"); //辅助核算名称
var entity = view.get("#dsFmer1101.data:#");
entity.set("costCenterNo", no);
entity.set("costCenterName", name);
},
"setCent": function(){
return 'COST_CENTER';
},
/*员工挑选框*/
"chooseEmp1": function(data){
var empId = data.get("empId");
view.get("#dsQuery").getData("#").set("expenser", empId);
},
"chooseEmp2": function(data){
var empId = data.get("empId");
view.id("getManageDeptId").set("parameter", {
empId: empId
}).execute(function(data){
view.get("#dsFmer1101").getData("#").set("mainDeptNo", data);
});
view.get("#dsFmer1101").getData("#").set("expenser", empId);
},
/*明细档费用垫付人挑选*/
"chooseQueryExpenser": function(data){
var empId = data.get("jobNumber");
var empName = data.get("empName");
view.get("#dsQuery").getData("#").set("expenser", empId);
},
/*主档报支人挑选*/
"chooseMainExpenser": function(data){
var empId = data.get("jobNumber");
var empName = data.get("empName");
view.get("#dsFmer1101").getData("#").set("expenser", empId);
},
/*明细档费用发生人挑选*/
"chooseDetailProposer": function(data){
var empId = data.get("jobNumber");
var empName = data.get("empName");
view.get("#dsFmer1102").getData("#").set("proposer", empId);
view.id("getManageDeptId").set("parameter", {
empId: empId
}).execute(function(data){
//view.get("#dsFmer1102").getData("#").set("proposer", empId);
view.get("#dsFmer1102").getData("#").set("expenseDept", data);
});
},
/*明细档费用垫付人挑选*/
"chooseDetailExpenser": function(data){
var empId = data.get("jobNumber");
var empName = data.get("empName");
view.get("#dsFmer1102").getData("#").set("expenser", empId);
},
/*部门挑选框数据行双击事件*/
"chooseCostCenterNo": function(data){
var costCenterNo = data.get("costCenterNo");
var costCenterName = data.get("costCenterName");
view.get("#dsFmer1102").getData("#").set("costCenterNo", costCenterNo);
},
/*费用项目弹框数据行双击事件*/
"getCostItems": function(data){
//var data = view.get("#dsCostItems.data:#");
if (data) {
var no = data.get("itemNo"); //费用项目编码
var name = data.get("itemName"); //费用项目名称
var entity = view.get("#dsFmer1102.data:#");
entity.set("itemNo", no);
entity.set("itemName", name);
view.get("#dialogCostItems").hide();
}
},
//挑选查询客户弹框
"tb01Show": function(){
diaCustNo01.show();
},
//双击弹出查询的客户资料
"tbcm01DoubleClick": function(){
var entity = view.get("#dsTbcm.data:#");
var custNo = entity.get("custNo");
var dsQuery = view.get("#dsQuery.data:#");
dsQuery.set("expenseEmpNo", entity.get("custName"));
view.get("#diaCustNo01").hide();
},
//挑选新增客户弹框
"tb02Show": function(){
dsTbcm.flushAsync(function(){
info.doSet("text", "客户查询成功 ...");
});
},
//双击弹出新增的客户资料
"tbcm02DoubleClick": function(){
var dsEr01 = view.get("#dsEr1101.data:#");
var entity = view.get("#dsSysUser.data:#");
var username = entity.get("username");
var baseDeptId = entity.get("userprofile.baseDeptId");
dsEr01.set("expenseEmpNo", username);
dsEr01.set("expenseDeptNo", baseDeptId);
view.get("#dialogGetSysUser").hide();
},
//获取报支第二层
"getexpType": function(){
var entity = view.get("#dsEr1101.data:#");
if (entity) {
var expenseType = entity.get("expenseType");
view.get("#dsEr0001P").set("parameter", {
"expenseType": expenseType
}).flushAsync(function(){
diaExSort.show();
});
}
},
//将第值塞入明细中
"getSecondEx": function(){
var entity = view.get("#dsEr0001P.data:#");
var ditail = view.get("#dsEr1102.data:#");
if (entity) {
ditail.set("expenseType", entity.get("categoryNo"));
ditail.set("expenseTypName", entity.get("categoryName"));
}
diaExSort.hide();
},
"setCustCategery": function(){
var entity = view.get("#dsEr0001P.data:#");
new dorado.widget.AjaxAction({
parameter: {
deptNo:entity.get(" deptNo")
},
service: "glBusinessUtil#getCostCenterCode"
}).execute(function(data){
view.get("#dsSelectAssist.data:#").set("auxiliaryTypeNo", data)
});
},
}
var date= view.get("#dsQuery.data:#").get("date");
var yearMonthDay.format0();
``
常见错误:
1.无法在"XXXXX"类中查找到唯一匹配的"XXXX"方法
DataSet pageSize可能没写,确认类型和方法名存在
2.Unknown ExposedService [xxxxxx#xxxx]
AJaxAction里面的Service可能没写相应的类名和方法名,或者说传的参数有问题
3.如果 通过tab的索引(index)属性切换失败,可能是因为把属性名写到了ID上面
## 第一次整理dorado插件的一些东西,如果有什么错误,请指出来,欢迎大家补充