|
楼主 |
发表于 2017-5-27 14:14:15
|
显示全部楼层
已解决
Model.prototype.orgDialogPC1Receive = function(event){
debugger;
var orgData = this.comp("orgData");
var mainData = this.comp("mainData");
if (event.data.length == 0){
return;
}
//(人员code、人员名称、部门code、岗位code)
var sCodes = [],sNames = [],deptIDs = [],postIDs = [];
for (var i = 0; i < event.data.length; i++) {
//SA_OPOrg的ID
var sID = event.data.getID();
//人员code
var sCode = event.data.val("sCode");
sCodes.push(sCode);
//人员名称
var sName = event.data.val("sName");
sNames.push(sName);
//人员fullID
var sFID = event.data.val("sFID");
//将fullID以‘/’分开
var arr = sFID.split("/");
var arrIndex = 0;
var postID = "";
var postCode = "";
var deptID = "";D
var deptCode = "";
for (var a = (arr.length - 1); a >= 0; a--) {
if (arr[a].indexOf(".pos") != -1) {
arrIndex = a;//
var index = arr[a].indexOf(".pos");
postID = arr[a].substring(0, index);
postCode = orgData.getValueByID("sCode", postID);
}
if (arr[a].indexOf(".dpt") != -1 ) {
arrIndex = a;//
var index = arr[a].indexOf(".dpt");
deptID = arr[a].substring(0, index);
deptCode = orgData.getValueByID("sCode", deptID);
if(postID){
postIDs.push(postCode);
}else{
postIDs.push("");
}
deptIDs.push(deptCode);
break;
}
if (arr[a].indexOf(".ogn") != -1) {
arrIndex = a;
var index = arr[a].indexOf(".ogn");
deptID = arr[a].substring(0, index);
deptCode = orgData.getValueByID("sCode", deptID);
if(postID){
postIDs.push(postCode);
}else{
postIDs.push("");
}
deptIDs.push(deptCode);
break;
}
}
}
// alert("人员code:" + sCodes);
// alert("人员名称:" + sNames);
// alert("人员岗位:" + postIDs.join(","));
// alert("人员部门:" + deptIDs.join(",")); |
|