|
@@ -512,32 +512,32 @@ let rptSignatureHelper = {
|
|
|
let me = rptSignatureHelper;
|
|
|
rptSignatureHelper.resetSignDate(signatureDivId);
|
|
|
rptSignatureHelper.resetSignAudit();
|
|
|
- if (current_stage_status === 3) {
|
|
|
- //1. 重刷page
|
|
|
- // let hasStamp = false;
|
|
|
- for (const page of zTreeOprObj.currentRptPageRst.items) {
|
|
|
- if (page.signature_cells) {
|
|
|
- for (let cIdx = page.signature_cells.length - 1; cIdx >= 0; cIdx--) {
|
|
|
- const sCell = page.signature_cells[cIdx];
|
|
|
- if (sCell.isStamp) {
|
|
|
- page.signature_cells.splice(cIdx);
|
|
|
- // hasStamp = true;
|
|
|
- } else if (sCell.hasOwnProperty('pre_path')) {
|
|
|
- sCell.path = sCell.pre_path;
|
|
|
- delete sCell.pre_path;
|
|
|
- }
|
|
|
- for (let role of ROLE_REL_LIST) {
|
|
|
+ //1. 重刷page
|
|
|
+ // let hasStamp = false;
|
|
|
+ for (const page of zTreeOprObj.currentRptPageRst.items) {
|
|
|
+ if (page.signature_cells) {
|
|
|
+ for (let cIdx = page.signature_cells.length - 1; cIdx >= 0; cIdx--) {
|
|
|
+ const sCell = page.signature_cells[cIdx];
|
|
|
+ if (sCell.isStamp) {
|
|
|
+ page.signature_cells.splice(cIdx);
|
|
|
+ // hasStamp = true;
|
|
|
+ } else if (sCell.hasOwnProperty('pre_path')) {
|
|
|
+ sCell.path = sCell.pre_path;
|
|
|
+ delete sCell.pre_path;
|
|
|
+ }
|
|
|
+ for (let role of ROLE_REL_LIST) {
|
|
|
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- resetStampSignature(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST);
|
|
|
- if (PAGE_SHOW.isTextSignature) {
|
|
|
- resetTextSignature(zTreeOprObj.currentRptPageRst);
|
|
|
- }
|
|
|
- // zTreeOprObj.showPage(zTreeOprObj.currentPage, zTreeOprObj.canvas);
|
|
|
}
|
|
|
+ resetStampSignature(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, current_stage_status !== 3);
|
|
|
+ if (PAGE_SHOW.isTextSignature) {
|
|
|
+ resetTextSignature(zTreeOprObj.currentRptPageRst, current_stage_status !== 3);
|
|
|
+ }
|
|
|
+ zTreeOprObj.showPage(zTreeOprObj.currentPage, zTreeOprObj.canvas);
|
|
|
+ // if (current_stage_status === 3) {
|
|
|
+ // }
|
|
|
//2. 更新数据
|
|
|
const params = {};
|
|
|
params.id = CURRENT_ROLE_REL_ID;
|
|
@@ -745,12 +745,14 @@ let rptSignatureHelper = {
|
|
|
let passAuditChk = true;
|
|
|
if (checkAudit) {
|
|
|
passAuditChk = false;
|
|
|
- for (const role_rel of roleRel) {
|
|
|
- if (role_rel.signature_name === signatureCell.signatureName) {
|
|
|
- // signatureName(非signature_name)是印章cell特意给的属性,还有isStamp属性
|
|
|
- if (rptSignatureHelper._chkIfAudit(role_rel)) {
|
|
|
- passAuditChk = true;
|
|
|
- break;
|
|
|
+ if (roleRel) {
|
|
|
+ for (const role_rel of roleRel) {
|
|
|
+ if (role_rel.signature_name === signatureCell.signatureName) {
|
|
|
+ // signatureName(非signature_name)是印章cell特意给的属性,还有isStamp属性
|
|
|
+ if (rptSignatureHelper._chkIfAudit(role_rel)) {
|
|
|
+ passAuditChk = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1048,7 +1050,7 @@ function _createDummyCell() {
|
|
|
return rst;
|
|
|
}
|
|
|
|
|
|
-function resetStampSignature(pageData, roleRelList) {
|
|
|
+function resetStampSignature(pageData, roleRelList, checkAudit = false) {
|
|
|
const dupPicPaths = [];
|
|
|
const _getMaxRect = function(page) {
|
|
|
const rect = [100000000, 100000000, 0, 0];
|
|
@@ -1076,39 +1078,41 @@ function resetStampSignature(pageData, roleRelList) {
|
|
|
for (let scIdx = 0; scIdx < page.signature_cells.length; scIdx++) {
|
|
|
const sCell = page.signature_cells[scIdx];
|
|
|
for (const role_rel of roleRelList) {
|
|
|
- if (sCell.signature_name === role_rel.signature_name) {
|
|
|
- if (Array.isArray(role_rel.sign_output) && role_rel.sign_output.length > 0) {
|
|
|
- for (const signType of role_rel.sign_output) {
|
|
|
- switch (signType) {
|
|
|
- case COMPANY_SIGN_STR:
|
|
|
- case PRIVATE_SIGN_STR:
|
|
|
- // 创建一个新的cell
|
|
|
- let stampPath = (signType === COMPANY_SIGN_STR) ? role_rel.company_stamp_path : role_rel.private_stamp_path;
|
|
|
- stampPath = OSS_PATH + stampPath;
|
|
|
- if (dupPicPaths.indexOf(stampPath) < 0) {
|
|
|
- dupPicPaths.push(stampPath);
|
|
|
- }
|
|
|
- // 签字信息中如果有签章位置信息,则直接用位置信息
|
|
|
- let signatureArea;
|
|
|
- if(role_rel.areaData&&role_rel.areaData[signType]){
|
|
|
- signatureArea = role_rel.areaData[signType]
|
|
|
- }
|
|
|
- const newStampCell = {
|
|
|
- signature_name: JV.SIGNATURE_NAME_DUMMY,
|
|
|
- control: sCell.control,
|
|
|
- style: sCell.style,
|
|
|
- path: stampPath,
|
|
|
- isStamp: true,
|
|
|
- maxRect,
|
|
|
- orgArea: sCell.area,
|
|
|
- area: signatureArea || {Left: sCell.area.Left, Right: sCell.area.Right, Top: sCell.area.Top, Bottom: sCell.area.Bottom},
|
|
|
- signatureName: role_rel.signature_name, // 节点名称
|
|
|
- signType, // 签章信息
|
|
|
- isSaveSignature: !!signatureArea, // 是否有签章位置信息
|
|
|
- };
|
|
|
- newStampCells.push(newStampCell);
|
|
|
- break;
|
|
|
- default: break;
|
|
|
+ if (!checkAudit || rptSignatureHelper._chkIfAudit(role_rel)) {
|
|
|
+ if (sCell.signature_name === role_rel.signature_name) {
|
|
|
+ if (Array.isArray(role_rel.sign_output) && role_rel.sign_output.length > 0) {
|
|
|
+ for (const signType of role_rel.sign_output) {
|
|
|
+ switch (signType) {
|
|
|
+ case COMPANY_SIGN_STR:
|
|
|
+ case PRIVATE_SIGN_STR:
|
|
|
+ // 创建一个新的cell
|
|
|
+ let stampPath = (signType === COMPANY_SIGN_STR) ? role_rel.company_stamp_path : role_rel.private_stamp_path;
|
|
|
+ stampPath = OSS_PATH + stampPath;
|
|
|
+ if (dupPicPaths.indexOf(stampPath) < 0) {
|
|
|
+ dupPicPaths.push(stampPath);
|
|
|
+ }
|
|
|
+ // 签字信息中如果有签章位置信息,则直接用位置信息
|
|
|
+ let signatureArea;
|
|
|
+ if(role_rel.areaData&&role_rel.areaData[signType]){
|
|
|
+ signatureArea = role_rel.areaData[signType]
|
|
|
+ }
|
|
|
+ const newStampCell = {
|
|
|
+ signature_name: JV.SIGNATURE_NAME_DUMMY,
|
|
|
+ control: sCell.control,
|
|
|
+ style: sCell.style,
|
|
|
+ path: stampPath,
|
|
|
+ isStamp: true,
|
|
|
+ maxRect,
|
|
|
+ orgArea: sCell.area,
|
|
|
+ area: signatureArea || {Left: sCell.area.Left, Right: sCell.area.Right, Top: sCell.area.Top, Bottom: sCell.area.Bottom},
|
|
|
+ signatureName: role_rel.signature_name, // 节点名称
|
|
|
+ signType, // 签章信息
|
|
|
+ isSaveSignature: !!signatureArea, // 是否有签章位置信息
|
|
|
+ };
|
|
|
+ newStampCells.push(newStampCell);
|
|
|
+ break;
|
|
|
+ default: break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1122,7 +1126,7 @@ function resetStampSignature(pageData, roleRelList) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function resetTextSignature(pageData) {
|
|
|
+function resetTextSignature(pageData, checkAudit = false) {
|
|
|
for (const page of pageData.items) {
|
|
|
for (let sCell of page.signature_cells) {
|
|
|
if (!sCell.isStamp) {
|
|
@@ -1149,16 +1153,18 @@ function resetTextSignature(pageData) {
|
|
|
} else {
|
|
|
// 要创建新的文本签名cell
|
|
|
for (let role of ROLE_REL_LIST) {
|
|
|
- if (sCell.signature_name === role.signature_name && role.sign_output && role.sign_output.indexOf(NORMAL_SIGN_STR) >= 0) {
|
|
|
- const newCell = {
|
|
|
- font: 'Footer',
|
|
|
- control: sCell.control,
|
|
|
- style: sCell.style,
|
|
|
- Value: role.user_name,
|
|
|
- area: { Left: sCell.area.Left, Right: sCell.area.Right, Top: sCell.area.Top, Bottom: sCell.area.Bottom },
|
|
|
- };
|
|
|
- page.cells.push(newCell);
|
|
|
- break;
|
|
|
+ if (!checkAudit || rptSignatureHelper._chkIfAudit(role)) {
|
|
|
+ if (sCell.signature_name === role.signature_name && role.sign_output && role.sign_output.indexOf(NORMAL_SIGN_STR) >= 0) {
|
|
|
+ const newCell = {
|
|
|
+ font: 'Footer',
|
|
|
+ control: sCell.control,
|
|
|
+ style: sCell.style,
|
|
|
+ Value: role.user_name,
|
|
|
+ area: { Left: sCell.area.Left, Right: sCell.area.Right, Top: sCell.area.Top, Bottom: sCell.area.Bottom },
|
|
|
+ };
|
|
|
+ page.cells.push(newCell);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|