/*目的是为了手机也可通用此脚本.*/
var init;
var wcDesc;
var tks;
var aths;
var SignType; //签名的人员.有两个列 No, SignType,
var nodeid = GetQueryString("FK_Node");
var fk_flow = GetQueryString("FK_Flow");
var workid = GetQueryString("WorkID");
var fid = GetQueryString("FID");
//是否是手机端.
var isMobile = GetQueryString("IsMobile");
//是否只读?
var isReadonly = GetQueryString("IsReadonly");
if (isReadonly != "1")
isReadonly = "0";
var enName = GetQueryString("EnName");
function getWorkCheck() {
var node = new Entity("BP.WF.Node", nodeid);
var data;
var handler = new HttpHandler("BP.WF.HttpHandler.WF_WorkOpt");
handler.AddJson(pageData);
handler.AddPara("IsReadonly", isReadonly);
if (node.FWCVer == 0 || node.FWCVer == "" || node.FWCVer == undefined)
data = handler.DoMethodReturnString("WorkCheck_Init");
else
data = handler.DoMethodReturnString("WorkCheck_Init2019");
if (data.indexOf('err@') != -1) {
alert(data);
return;
}
init = cceval('(' + data + ')');
wcDesc = init.WF_FrmWorkCheck[0];
tks = init.Tracks;
aths = init.Aths;
SignType = init.SignType; //签名的人员 No,SignType 列, SignType=0 不签名, 1=图片签名, 2=电子签名。
var html = '';
if (tks.length == 0) {
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
}
$.each(tks, function () {
var subaths = GetSubAths(this.NodeID);
//仅显示自己的审核意见
if (wcDesc.FWCMsgShow == "1" && this.NodeID == nodeid && this.IsDoc == false) {
return true;
}
//自由模式
html += "
";
var tdWidth = "120px";
if (isMobile == "1")
tdWidth = "20%;";
html += "
";
var nodeName = this.NodeName;
nodeName = nodeName.replace('(会签)', ' (会签)');
html += nodeName;
html += "
";
var fwcs = new Entities("BP.WF.Template.FrmWorkChecks");
fwcs.Retrieve("NodeID", this.NodeID);
//获取自定义常用短语
var DuanYu = fwcs[0].FWCNewDuanYu;
if (DuanYu != null && DuanYu != undefined) {
var NewDuanYu = DuanYu.split("@");
} else {
var NewDuanYu = "";
}
var isEditWorkCheck = this.IsDoc == "1" && isReadonly == false ? true : false;
//审核意见
if (isEditWorkCheck == true) {
html += "
";
html += "
";
var msg = this.Msg;
if (msg == null)
msg = "";
while (msg.indexOf(' ') >= 0) {
msg = msg.replace(' ', '\t\n');
}
html += "";
//加入常用短语.
html += "
"
html += "";
html += "
";
if (wcDesc.FWCAth == 1) {
html += "";
}
html += "
";
html += "
";
}
else {
var returnMsg = this.ActionType == 2 ? "退回原因:" : "";
var val = this.Msg.split("WorkCheck@");
if (val.length == 2)
this.Msg = val[1];
html += '
';
html += '' + this.Msg + '';
html += '
';
}
html += '
';
//附件
if (subaths.length > 0) {
var tdid = this.IsDoc ? ("id='aths_" + this.NodeID + "'") : "";
html += "
";
html += "
";
html += "附件: " + subaths;
html += "
";
html += "
";
}
//输出签名.
if (SignType == null || SignType == undefined) {
var rdt = this.RDT.substring(0, 16);
if (rdt == "") {
var dt = new Date();
rdt = dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate(); // new Date().toString("yyyy-MM-dd HH:mm");
}
//签名,日期.
html += "
";
html += "
签名:";
if (wcDesc.SigantureEnabel == "0")
html += GetUserSmallIcon(this.EmpFrom, this.EmpFromT);
else if (wcDesc.SigantureEnabel == "1")
html += GetUserSiganture(this.EmpFrom, this.EmpFromT);
else if (wcDesc.SigantureEnabel == "2")
html += GetUserHandWriting(this, isEditWorkCheck, this.EmpFromT);
html += "
";
html += "
";
html += "日期:" + rdt;
html += "
";
html += "
";
html += "
";
} else {
for (var idx = 0; idx < SignType.length; idx++) {
var st = SignType[idx];
if (st.No != this.EmpFrom)
continue;
if (st.SignType == 0 || st.SignType == 2 || st.SignType == null) {
var rdt = this.RDT.substring(0, 16);
html += "