";
}
//身份证件解析增加一个
if (attr.UIContralType == 13 && attr.KeyOfEn == "IDCardName") {
html_string += "
";
html_string += InitEleAth(frmData, attr.Name, attr.FK_MapData, attr.KeyOfEn);
} else if (attr.UIIsEnable == "0") {
html_string += "
";
}
return html_string;
},
CreateTBInt: function (attr) {
var mustInput = attr.UIIsInput == 1 ? '
";
else
inputHtml += " name=\"TB_" + attr.KeyOfEn + "\" id=\"TB_" + attr.KeyOfEn + "\" placeholder='0' />";
return inputHtml;
},
CreateTBFloat: function (attr) {
var attrdefVal = attr.DefVal;
var bit;
if (attrdefVal != null && attrdefVal !== "" && attrdefVal.indexOf(".") >= 0)
bit = attrdefVal.substring(attrdefVal.indexOf(".") + 1).length;
else
bit = 2;
var event = "";
if (attr.UIIsEnable == "1" && pageData.IsReadonly != 1) {
if (attr.MyDataType == 8)
event = " onkeyup=\"valitationAfter(this, 'money');limitLength(this," + bit + "); FormatMoney(this, " + bit + ", ',')\"";
else
event = " onkeyup=\"valitationAfter(this, 'float');if(isNaN(value)) execCommand('undo');limitLength(this," + bit + ");\"" + " onafterpaste=\"valitationAfter(this, 'float');if(isNaN(value))execCommand('undo');\"";
}
var mustInput = attr.UIIsInput == 1 ? '
";
if (attr.UIIsEnable == "1" && pageData.IsReadonly != 1) {
var step = GetPara(attr.AtPara, "NumStepLength");
step = step == null || step == undefined ? 0.1 : parseFloat(step);
var minNum = GetPara(attr.AtPara, "NumMin") || "";
var maxNum = GetPara(attr.AtPara, "NumMax") || "";
var dataInfo = "";
if (minNum != "")
dataInfo = " data-numbox-min='" + minNum + "'";
if (maxNum != "")
dataInfo += " data-numbox-max='" + maxNum + "'";
inputHtml += "
";
}
return inputHtml;
},
CreateTBDate: function (attr) {
var mustInput = attr.UIIsInput == 1 ? '
";
}
return inputHtml;
},
CreateTBDateTime: function (attr) {
var mustInput = attr.UIIsInput == 1 ? '
";
}
return inputHtml;
},
CreateCBBoolean: function (attr) {
var checkBoxVal = "";
var keyOfEn = attr.KeyOfEn;
var CB_Html = "";
CB_Html += "
";
else
CB_Html += "
";
CB_Html += "
";
CB_Html += "
";
//CB_Html += "
";
return CB_Html;
},
CreateDDLEnum: function (attr) {
//下拉框和单选都使用下拉框实现
var mustInput = attr.UIIsInput == 1 ? '
*' : "";
var ctrl_ID = "DDL_" + attr.KeyOfEn;
var html_Select = "
";
html_Select += "
";
return html_Select;
},
CreateDDLPK: function (attr) {
var mustInput = attr.UIIsInput == 1 ? '
*' : "";
var html_Select = "
";
html_Select += "
";
return html_Select;
},
CreateMapPin: function (attr) {
loadScript("http://api.map.baidu.com/api?v=2.0&ak=rgwS2tQzfT9dX21CvZkyTE2eQ1D0vDWh&Version=" + Math.random());
loadScript("http://developer.baidu.com/map/jsdemo/demo/convertor.js?Version=" + Math.random());
var html_MapPin = "
";
//展示内容
html_MapPin += "
";
if (this.Enable == false) {
html_MapPin += "
";
} else {
html_MapPin += "
";
}
html_MapPin += "
";
html_MapPin += "
";
//数据控件
html_MapPin += "
";
//地图定位
return html_MapPin;
},
CreateMicHot: function (attr) {
var html_MicHot = "
";
var bDelete = this.Enable;
//展示内容
html_MicHot += "
";
if (this.Enable == false) {
html_MicHot += "
";
} else {
html_MicHot += "
";
}
html_MicHot += "
";
html_MicHot += "
";
html_MicHot += "
";
html_MicHot += "
";
//获取历史语音
var args = new RequestArgs();
var keyOfEn = attr.KeyOfEn;
html_MicHot += "
";
//语音
return html_MicHot;
}
};
function InitMapAttrOfCtrl(mapAttr) {
var eleHtml = '';
if (mapAttr.UIVisible == 1) {//是否显示
var str = '';
var defValue = ConvertDefVal(workNodeData, mapAttr.DefVal, mapAttr.KeyOfEn);
var isInOneRow = false; //是否占一整行
var islabelIsInEle = false; //
eleHtml += '';
if (mapAttr.UIContralType != 6) {
if (mapAttr.LGType == 2) {
//多选下拉框
var isMultiSele = "";
var isMultiSeleClass = "";
// if (mapAttr.UIIsMultiple != undefined && mapAttr.UIIsMultiple == 1) {
// isMultiSele = ' multiple data-live-search="false" ';
// isMultiSeleClass = " selectpicker show-tick form-control ";
// }
eleHtml += "
";
} else {
//添加文本框 ,日期控件等
//AppString
if (mapAttr.MyDataType == "1" && mapAttr.LGType != "2") {//不是外键
if (mapAttr.UIContralType == "1") {//DDL 下拉列表框
//多选下拉框
var isMultiSele = "";
var isMultiSeleClass = "";
// if (mapAttr.UIIsMultiple != undefined && mapAttr.UIIsMultiple == 1) {
// isMultiSele = ' multiple data-live-search="false" ';
// isMultiSeleClass = " selectpicker show-tick form-control ";
// }
eleHtml +=
"
";
} else { //文本区域
if (mapAttr.UIHeight <= 23 || 1 == 1) {
eleHtml +=
"
"
;
}
}
} //AppDate
else if (mapAttr.MyDataType == 6) {//AppDate
var enableAttr = '';
if (mapAttr.UIIsEnable == 0) {
enableAttr = "disabled='disabled'";
}
var inputHtml = "
";
//inputHtml += "";
eleHtml += inputHtml;
}
else if (mapAttr.MyDataType == 7) {// AppDateTime = 7
var enableAttr = '';
if (mapAttr.UIIsEnable == 1) {
// enableAttr = 'onfocus="WdatePicker({dateFmt:' + "'yyyy-MM-dd HH:mm'})" + '";';
enableAttr = '';
} else {
enableAttr = "disabled='disabled'";
}
eleHtml += "
";
}
else if (mapAttr.MyDataType == 4) { // AppBoolean = 7
var CB_Html = "
";
eleHtml += CB_Html;
}
if (mapAttr.MyDataType == 2 && mapAttr.LGType == 1) { //AppInt Enum
if (mapAttr.UIContralType == 1) { //DDL
eleHtml += "
";
}
}
// AppDouble AppFloat
if (mapAttr.MyDataType == 5 || mapAttr.MyDataType == 3) {
var enableAttr = '';
if (mapAttr.UIIsEnable == 1) {
} else {
enableAttr = "disabled='disabled'";
}
eleHtml += "
";
}
if ((mapAttr.MyDataType == 2 && mapAttr.LGType != 1)) {//AppInt
var enableAttr = '';
if (mapAttr.UIIsEnable == 1) {
} else {
enableAttr = "disabled='disabled'";
}
eleHtml += "
";
}
//AppMoney AppRate
if (mapAttr.MyDataType == 8) {
var enableAttr = '';
if (mapAttr.UIIsEnable == 1) {
} else {
enableAttr = "disabled='disabled'";
}
eleHtml += "
";
}
}
} else {
//展示附件信息 FREE 不需要
return;
// var atParamObj = AtParaToJson(mapAttr.AtPara);
// if (atParamObj.AthRefObj != undefined) {//扩展设置为附件展示
// eleHtml += "
" + "";
// defValue = defValue != undefined && defValue != '' ? defValue : ' ';
// if (defValue.indexOf('@AthCount=') == 0) {
// defValue = "附件" + "
" + defValue.substring('@AthCount='.length, defValue.length) + "个";
// } else {
// defValue = defValue;
// }
// eleHtml += "
" + defValue + "
";
// }
}
if (islabelIsInEle == false) {
//eleHtml = '
" +
//(mapAttr.UIIsInput == 1 ? '*' : "")
//+ "
" + eleHtml;
//先把 必填项的 * 写到元素后面 可能写到标签后面更合适
//eleHtml += mapAttr.UIIsInput == 1 ? '
*' : "";
}
} else {
var value = ConvertDefVal(workNodeData, mapAttr.DefVal, mapAttr.KeyOfEn);
if (value == undefined) {
value = '';
} else {
//value = value.toString().replace(/:/g, ':').replace(/【/g, '[').replace(/】/g, ']').replace(/(/g, '(').replace(/)/g, ')').replace(/{/g, '{').replace(/}/g, '}');
}
//hiddenHtml += "
";
}
//eleHtml = "
" + eleHtml + "
";
return eleHtml;
// alert(eleHtml);
eleHtml = $('
' + eleHtml + '
');
eleHtml.children(0).css('width', mapAttr.UIWidth).css('height', mapAttr.UIHeight);
//eleHtml.css('position', 'absolute').css('top', mapAttr.Y - 10).css('left', mapAttr.X);
if (mapAttr.UIIsEnable == "0") {
enableAttr = eleHtml.find('[name=TB_' + mapAttr.KeyOfEn + ']').attr('disabled', true);
enableAttr = eleHtml.find('[name=DDL_' + mapAttr.KeyOfEn + ']').attr('disabled', true);
}
return eleHtml;
}
//初始化下拉列表框的OPERATION
function InitDDLOperation(frmData, mapAttr, defVal) {
var operations = '';
var data = frmData[mapAttr.KeyOfEn];
if (data == undefined)
data = frmData[mapAttr.UIBindKey];
if (data == undefined) {
//枚举类型的.
if (mapAttr.LGType == 1) {
var enums = frmData.Sys_Enum;
enums = $.grep(enums, function (value) {
return value.EnumKey == mapAttr.UIBindKey;
});
if (mapAttr.DefVal == -1)
operations += "
";
$.each(enums, function (i, obj) {
operations += "
";
});
}
return operations;
}
if (data == undefined) {
return operations;
}
$.each(data, function (i, obj) {
operations += "
";
});
return operations;
}
//填充默认数据
function ConvertDefVal(workNodeData, defVal, keyOfEn) {
var pageParams = getQueryString();
var pageParamObj = {};
$.each(pageParams, function (i, pageParam) {
if (pageParam.indexOf('@') == 0) {
var pageParamArr = pageParam.split('=');
pageParamObj[pageParamArr[0].substring(1, pageParamArr[0].length)] = pageParamArr[1];
}
});
var result = defVal;
//通过MAINTABLE返回的参数
for (var ele in workNodeData.MainTable[0]) {
if (keyOfEn == ele && workNodeData.MainTable[0] != '') {
result = workNodeData.MainTable[0][ele];
break;
}
}
var result = unescape(result);
if (result == "null")
result = "";
return result;
}
var workNodeData = {};
//将#FF000000 转换成 #FF0000
function TranColorToHtmlColor(color) {
if (color != undefined && color.indexOf('#') == 0 && color.length == 9) {
color = color.substring(0, 7);
}
return color;
}
function analysisFontStyle(ele, fontStyle, isBold, isItalic) {
if (fontStyle != undefined && fontStyle.indexOf(':') > 0) {
var fontStyleArr = fontStyle.split(';');
$.each(fontStyleArr, function (i, fontStyleObj) {
ele.css(fontStyleObj.split(':')[0], TranColorToHtmlColor(fontStyleObj.split(':')[1]));
});
}
else {
if (isBold == 1) {
ele.css('font-weight', 'bold');
}
if (isItalic == 1) {
ele.css('font-style', 'italic')
}
}
}
function ImgAth(url, athMyPK) {
var v = window.showModalDialog(url, 'ddf', 'dialogHeight: 650px; dialogWidth: 950px;center: yes; help: no');
if (v == null)
return;
document.getElementById('Img' + athMyPK).setAttribute('src', v);
}
//初始化 IMAGE附件
function figure_Template_ImageAth(frmImageAth) {
var isEdit = frmImageAth.IsEdit;
var eleHtml = $("
");
var img = $("
");
var imgSrc = "/WF/Data/Img/LogH.PNG";
//获取数据
if (workNodeData.Sys_FrmImgAthDB) {
$.each(workNodeData.Sys_FrmImgAthDB, function (i, obj) {
if (obj.FK_FrmImgAth == frmImageAth.MyPK) {
imgSrc = obj.FileFullName;
}
});
}
//设计属性
img.attr('id', 'Img' + frmImageAth.MyPK).attr('name', 'Img' + frmImageAth.MyPK);
img.attr("src", imgSrc).attr('onerror', "this.src='/WF/Data/Img/LogH.PNG'");
img.css('width', frmImageAth.W).css('height', frmImageAth.H).css('padding', "0px").css('margin', "0px").css('border-width', "0px");
//不可编辑
if (isEdit == "1") {
var fieldSet = $("
");
var length = $("
");
var a = $("
");
var url = "/WF/CCForm/ImgAth.aspx?W=" + frmImageAth.W + "&H=" + frmImageAth.H + "&FK_MapData=ND" + pageData.FK_Node + "&MyPK=" + pageData.WorkID + "&ImgAth=" + frmImageAth.MyPK;
a.attr('href', "javascript:ImgAth('" + url + "','" + frmImageAth.MyPK + "');").html("编辑");
length.css('font-style', 'inherit').css('font-weight', 'bold').css('font-size', '12px');
fieldSet.append(length);
length.append(a);
fieldSet.append(img);
eleHtml.append(fieldSet);
} else {
eleHtml.append(img);
}
eleHtml.css('position', 'absolute').css('top', frmImageAth.Y).css('left', frmImageAth.X);
return eleHtml;
}
//初始化 附件.
function figure_Template_Attachment(frmAttachment) {
var eleHtml = '';
var ath = frmAttachment;
if (ath.UploadType == 0) {//单附件上传 L4204
return $('');
}
var src = "";
if (pageData.IsReadonly)
src = "./CCForm/AttachmentUpload.htm?PKVal=" + pageData.WorkID + "&Ath=" + ath.NoOfObj + "&FK_MapData=" + ath.FK_MapData + "&FK_FrmAttachment=" + ath.MyPK + "&IsReadonly=1";
else
src = "./CCForm/AttachmentUpload.htm?PKVal=" + pageData.WorkID + "&Ath=" + ath.NoOfObj + "&FK_MapData=" + ath.FK_MapData + "&FK_FrmAttachment=" + ath.MyPK;
eleHtml += '
' + "" + '
';
eleHtml = $(eleHtml);
eleHtml.css('position', 'absolute').css('top', ath.Y).css('left', ath.X).css('width', ath.W).css('height', ath.H);
return eleHtml;
}
function addLoadFunction(id, eventName, method) {
var js = "";
js = "";
return $(js);
}
var appPath = "../../";
var DtlsCount = " + dtlsCount + "; //应该加载的明细表数量
//初始化从表
function figure_Template_Dtl(frmDtl) {
var eleHtml = $("
");
var paras = this.pageData;
var strs = "";
for (var str in paras) {
if (str == "EnsName" || str == "RefPKVal" || str == "IsReadonly")
continue
else
strs += "&" + str + "=" + paras[str];
}
var src = "";
var href = GetHrefUrl();
var urlParam = href.substring(href.indexOf('?') + 1, href.length);
urlParam = urlParam.replace('&DoType=', '&DoTypeDel=xx');
if (frmDtl.DtlShowModel == "0") {
if (pageData.IsReadonly) {
src = "./CCForm/Dtl.htm?EnsName=" + frmDtl.No + "&RefPKVal=" + this.pageData.WorkID + "&IsReadonly=1&" + urlParam + "&Version=" + load.Version;
} else {
src = "./CCForm/Dtl.htm?EnsName=" + frmDtl.No + "&RefPKVal=" + this.pageData.WorkID + "&IsReadonly=0&" + urlParam + "&Version=" + load.Version;
}
}
else if (frmDtl.DtlShowModel == "1") {
if (pageData.IsReadonly)
src = appPath + "WF/CCForm/DtlCard.htm?EnsName=" + frmDtl.No + "&RefPKVal=" + this.pageData.WorkID + "&IsReadonly=1" + strs;
else
src = appPath + "WF/CCForm/DtlCard.htm?EnsName=" + frmDtl.No + "&RefPKVal=" + this.pageData.WorkID + "&IsReadonly=0" + strs;
}
var eleIframe = '
';
eleIframe = $("
");
if (pageData.IsReadonly) {
} else {
if (frmDtl.DtlSaveModel == 0) {
eleHtml.append(addLoadFunction(frmDtl.No, "blur", "SaveDtl"));
eleIframe.attr('onload', frmDtl.No + "load()");
}
}
eleHtml.append(eleIframe);
//added by liuxc,2017-1-10,此处前台JS中增加变量DtlsLoadedCount记录明细表的数量,用于加载完全部明细表的判断
var js = "";
if (!pageData.IsReadonly) {
js = "";
eleHtml.append($(js));
}
return eleHtml;
}
//初始化轨迹图
function figure_Template_FigureFlowChart(wf_node) {
//轨迹图
var sta = wf_node.FrmTrackSta;
var x = wf_node.FrmTrack_X;
var y = wf_node.FrmTrack_Y;
var h = wf_node.FrmTrack_H;
var w = wf_node.FrmTrack_W;
if (sta == 0) {
return $('');
}
if (sta == undefined) {
return;
}
var src = "./WorkOpt/OneWork/OneWork.htm?CurrTab=Track";
src += '&FK_Flow=' + pageData.FK_Flow;
src += '&FK_Node=' + pageData.FK_Node;
src += '&WorkID=' + pageData.WorkID;
src += '&FID=' + pageData.FID;
var eleHtml = '
' + "" + '
';
eleHtml = $(eleHtml);
eleHtml.css('position', 'absolute').css('top', y).css('left', x).css('width', w).css('height', h);
return eleHtml;
}
//审核组件
function figure_Template_FigureFrmCheck(wf_node) {
var sta = wf_node.FWCSta;
if (sta == 0)
return $('');
var src = "./WorkOpt/WorkCheck.htm?s=2";
var fwcOnload = "";
var paras = '';
paras += "&FID=" + pageData["FID"];
paras += "&OID=" + pageData["WorkID"];
paras += '&FK_Flow=' + pageData.FK_Flow;
paras += '&FK_Node=' + pageData.FK_Node;
paras += '&WorkID=' + pageData.WorkID;
if (sta == 2)//只读
{
src += "&DoType=View";
}
else {
fwcOnload = "onload= 'WC" + wf_node.NodeID + "load();'";
$('body').append(addLoadFunction("WC" + wf_node.NodeID, "blur", "SaveDtl"));
}
src += "&r=q" + paras;
var eleHtml = '
' + "" + '
';
eleHtml = $(eleHtml);
return eleHtml;
}
//子流程
function figure_Template_FigureSubFlowDtl(wf_node) {
var sta = wf_node.SFSta;
var h = wf_node.SF_H;
if (sta == 0)
return $('');
var src = "./WorkOpt/SubFlow.htm?s=2";
var fwcOnload = "";
var paras = '';
paras += "&FID=" + pageData["FID"];
paras += "&OID=" + pageData["WorkID"];
paras += '&FK_Flow=' + pageData.FK_Flow;
paras += '&FK_Node=' + pageData.FK_Node;
paras += '&WorkID=' + pageData.WorkID;
if (sta == 2)//只读
{
src += "&DoType=View";
}
else {
fwcOnload = "onload= 'WC" + wf_node.NodeID + "load();'";
$('body').append(addLoadFunction("WC" + wf_node.NodeID, "blur", "SaveDtl"));
}
src += "&r=q" + paras;
var eleHtml = '
' + "" + '
';
eleHtml = $(eleHtml);
return eleHtml;
}
//初始化框架
function figure_Template_IFrame(fram) {
var eleHtml = '';
var src = dealWithUrl(fram.src) + "IsReadOnly=0";
eleHtml = $('
' + '
');
var iframe = $("
");
eleHtml.append(iframe);
return eleHtml;
}
var colVisibleJsonStr = ''
var jsonStr = '';
$(function () {
initPageParam(); //初始化参数
GenerFrm(); //表单数据.ajax
});
function BackToHome() {
SetHref('../CCMobilePortal/Home.htm?UserNo=' + GetQueryString('UserNo') + "&Token=" + GetQueryString("Token"));
}
function BackToTodolist() {
SetHref('../CCMobilePortal/Todolist.htm?UserNo=' + GetQueryString('UserNo') + "&Token=" + GetQueryString("Token"));
}
function BackToStart() {
SetHref('../CCMobilePortal/Start.htm?UserNo=' + GetQueryString('UserNo') + "&Token=" + GetQueryString("Token"));
}