|
@@ -5,6 +5,11 @@
|
|
|
'use strict'
|
|
|
|
|
|
const DFT_ROLE_NAME = '';
|
|
|
+const NORMAL_SIGN_STR = 'normal_sign';
|
|
|
+const COMPANY_SIGN_STR = 'company_stamp';
|
|
|
+const PRIVATE_SIGN_STR = 'private_stamp';
|
|
|
+const STD_STAMP_SIZE_WIDTH = 4.2 * 96 / 2.54; // 公章大小:宽度(4.2CM)
|
|
|
+const STD_STAMP_SIZE_HEIGHT = 4.2 * 96 / 2.54; // 公章大小:高度(4.2CM)
|
|
|
|
|
|
let rptSignatureHelper = {
|
|
|
currentSelectedESignAccDom: null,
|
|
@@ -128,6 +133,7 @@ let rptSignatureHelper = {
|
|
|
if (dftDate !== '' && dftDate.length > 20) {
|
|
|
dftDate = (new Date(dftDate)).Format('yyyy-MM-dd');
|
|
|
}
|
|
|
+ let roleRel = null;
|
|
|
if (directAcc) {
|
|
|
rptSignatureHelper.pushDomElementByUser(elementsStrArr, userAcc.name, userAcc.role);
|
|
|
// 还有ROLE_REL_LIST
|
|
@@ -140,8 +146,12 @@ let rptSignatureHelper = {
|
|
|
roleRelObj.user_name = userAcc.name;
|
|
|
roleRelObj.acc_id = userAcc.id;
|
|
|
roleRelObj.type = '用户';
|
|
|
+ roleRelObj.sign_output = [NORMAL_SIGN_STR]; // 默认是签字(还有:COMPANY_SIGN_STR:单位章, PRIVATE_SIGN_STR:个人章)
|
|
|
+ roleRelObj.company_stamp_path = rptSignatureHelper._getCompanySign(directAcc.company);
|
|
|
+ roleRelObj.private_stamp_path = (userAcc.stamp_path && userAcc.stamp_path !== '') ? userAcc.stamp_path : '';
|
|
|
roleRelObj.role = (userAcc.role === '')?DFT_ROLE_NAME:userAcc.role;
|
|
|
ROLE_REL_LIST.push(roleRelObj);
|
|
|
+ roleRel = roleRelObj;
|
|
|
} else if (roleAcc) {
|
|
|
// 创建相关dom元素
|
|
|
rptSignatureHelper.pushDomElementByRole(elementsStrArr, roleAcc.name, userAcc.name);
|
|
@@ -154,13 +164,17 @@ let rptSignatureHelper = {
|
|
|
roleRelObj.sign_date_format = 'yyyy年M月d日';
|
|
|
roleRelObj.user_name = userAcc.name;
|
|
|
roleRelObj.acc_id = userAcc.id;
|
|
|
+ roleRelObj.sign_output = [NORMAL_SIGN_STR]; // 默认是签字(还有:COMPANY_SIGN_STR:单位章, PRIVATE_SIGN_STR:个人章)
|
|
|
+ roleRelObj.company_stamp_path = rptSignatureHelper._getCompanySign(userAcc.company);
|
|
|
+ roleRelObj.private_stamp_path = (userAcc.stamp_path && userAcc.stamp_path !== '') ? userAcc.stamp_path : null;
|
|
|
roleRelObj.type = '角色';
|
|
|
roleRelObj.role = (userAcc.role === '')?DFT_ROLE_NAME:userAcc.role;
|
|
|
roleRelObj.role_name = roleAcc.name;
|
|
|
ROLE_REL_LIST.push(roleRelObj);
|
|
|
+ roleRel = roleRelObj;
|
|
|
}
|
|
|
// elementsStrArr.push('');
|
|
|
- rptSignatureHelper.pushDatePickerDom(elementsStrArr, userAcc.id);
|
|
|
+ rptSignatureHelper.pushDatePickerDom(elementsStrArr, userAcc, roleRel);
|
|
|
$(rptSignatureHelper.currentSelectedESignAccDom).append(elementsStrArr.join(' '));
|
|
|
//.appendChild(pNode);
|
|
|
//*/
|
|
@@ -235,18 +249,11 @@ let rptSignatureHelper = {
|
|
|
//角色
|
|
|
rptSignatureHelper.pushDomElementByRole(elementsStrArr, role_rel.role_name, role_rel.user_name);
|
|
|
}
|
|
|
- const idSuffixStr = 'dtp_' + role_rel.signature_name + '_' + signatureDivId;
|
|
|
- elementsStrArr.push('<div class="">');
|
|
|
- if (role_rel.sign_date !== '') {
|
|
|
- const dt = new Date(role_rel.sign_date);
|
|
|
- const dtVal = dt.Format('yyyy-MM-dd');
|
|
|
- //elementsStrArr.push('<input class="datepicker-here form-control form-control-sm mt-0" placeholder="选择签名日期" data-language="zh" type="text" value="' + (new Date(role_rel.sign_date)).Format('yyyy-M-d') + '">');
|
|
|
- // elementsStrArr.push('<input id="' + idSuffixStr + '" class="datepicker-here form-control form-control-sm mt-0" placeholder="选择签名日期" data-language="zh" type="text" readonly="true" value="' + dtVal + '"');
|
|
|
- elementsStrArr.push('<input id="' + idSuffixStr + '" class="form-control form-control-sm mt-0" placeholder="选择签名日期" type="date" value="' + dtVal + '"');
|
|
|
- } else {
|
|
|
- // elementsStrArr.push('<input id="' + idSuffixStr + '" class="datepicker-here form-control form-control-sm mt-0" placeholder="选择签名日期" data-language="zh" type="text" readonly="true"');
|
|
|
- elementsStrArr.push('<input id="' + idSuffixStr + '" class="form-control form-control-sm mt-0" placeholder="选择签名日期" type="date"');
|
|
|
- }
|
|
|
+ const userAcc = rptSignatureHelper.getUserAccount(role_rel.acc_id);
|
|
|
+ role_rel.private_stamp_path = (userAcc.stamp_path && userAcc.stamp_path !== '') ? userAcc.stamp_path : '';
|
|
|
+ role_rel.company_stamp_path = rptSignatureHelper._getCompanySign(userAcc.company);
|
|
|
+
|
|
|
+ rptSignatureHelper.pushDatePickerDom(elementsStrArr, userAcc, role_rel);
|
|
|
hasPic = true;
|
|
|
break;
|
|
|
}
|
|
@@ -281,74 +288,72 @@ let rptSignatureHelper = {
|
|
|
elementsStrArr.push('<p class=" d-flex justify-content-between m-0"><span>' + userName +
|
|
|
'-<small class="text-muted">' + ((userRole === '')?DFT_ROLE_NAME:userRole) +
|
|
|
'</small></span><a onclick="rptSignatureHelper.removeSignature(this)" class="text-danger"><i class="fa fa-remove" title="移除签名"></i></a></p>');
|
|
|
- // rptSignatureHelper.pushDatePickerDom(elementsStrArr);
|
|
|
},
|
|
|
pushDomElementByRole: function (elementsStrArr, roleName, userName) {
|
|
|
elementsStrArr.push('<p class=" d-flex justify-content-between m-0"><span><i class="fa fa-user" title="角色"> ' + roleName +
|
|
|
'</i>-<small class="text-muted">' + userName +
|
|
|
'</small></span><a onclick="rptSignatureHelper.removeSignature(this)" class="text-danger"><i class="fa fa-remove" title="移除签名"></i></a></p>');
|
|
|
- // rptSignatureHelper.pushDatePickerDom(elementsStrArr);
|
|
|
},
|
|
|
- pushDatePickerDom: function (elementsStrArr, userAccId) {
|
|
|
+ pushDatePickerDom: function (elementsStrArr, userAcc, role_rel) {
|
|
|
let idSuffixStr = 'dtp_' + rptSignatureHelper.currentSelectedESignAccName + '_' + rptSignatureHelper.currentSelectedESignParentDivId;
|
|
|
- elementsStrArr.push('<div class="">');
|
|
|
- // 日期控件存在页面高度不过高无法选中bug,先不用
|
|
|
- // elementsStrArr.push('<input id="' + idSuffixStr + '" class="datepicker-here form-control form-control-sm mt-0" placeholder="选择签名日期" data-language="zh" data-position="right bottom" type="text" readonly="true"');
|
|
|
- //*
|
|
|
- let dftDate = _getSignDateByAllScenarios(userAccId);
|
|
|
+ elementsStrArr.push('<div class="mt-3">');
|
|
|
+ elementsStrArr.push('<div class="row">');
|
|
|
+ //-------------------------------------------------
|
|
|
+ if (!Array.isArray(role_rel.sign_output)) {
|
|
|
+ role_rel.sign_output = [NORMAL_SIGN_STR];
|
|
|
+ }
|
|
|
+ const normalSignChkStr = (role_rel.sign_output.indexOf(NORMAL_SIGN_STR) >= 0) ? 'checked' : '';
|
|
|
+ const companySignChkStr = (role_rel.sign_output.indexOf(COMPANY_SIGN_STR) >= 0) ? 'checked' : '';
|
|
|
+ const privateSignChkStr = (role_rel.sign_output.indexOf(PRIVATE_SIGN_STR) >= 0) ? 'checked' : '';
|
|
|
+ // 1. 签章类型:签字 单位章 个人章....
|
|
|
+ elementsStrArr.push('<div class="col-6">');
|
|
|
+ elementsStrArr.push(' <div class="form-control form-control-sm d-inline pt-2">');
|
|
|
+ elementsStrArr.push(' <div class="form-check form-check-inline px-2">');
|
|
|
+ elementsStrArr.push(` <input class="form-check-input" type="checkbox" id="${idSuffixStr}_sign1" value="option1" ${normalSignChkStr} onchange="rptSignatureHelper._changeSignType(this, ${userAcc.id}, '${NORMAL_SIGN_STR}')" >`);
|
|
|
+ elementsStrArr.push(` <label class="form-check-label" for="${idSuffixStr}_sign1">签字</label>`);
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
+ const hasIndividualStamp = (userAcc.stamp_path && userAcc.stamp_path !== ''); //用户账号的stamp_path是属于用户自己的私章,不是公司章
|
|
|
+ let chkType = hasIndividualStamp ? 'radio' : 'checkbox';
|
|
|
+ if (hasIndividualStamp) {
|
|
|
+ elementsStrArr.push(' <div class="form-check form-check-inline mx-1">');
|
|
|
+ elementsStrArr.push(' <div class="form-group">');
|
|
|
+ elementsStrArr.push(' <div class="form-check form-check-inline px-1">');
|
|
|
+ elementsStrArr.push(` <input class="form-check-input" type="${chkType}" id="${idSuffixStr}_sign2" value="companyStamp" name="${idSuffixStr}" onchange="rptSignatureHelper._changeSignType(this, ${userAcc.id}, '${COMPANY_SIGN_STR}')" ${companySignChkStr}>`);
|
|
|
+ elementsStrArr.push(` <label class="form-check-label" for="${idSuffixStr}_rdSign1">单位章</label>`);
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
+ elementsStrArr.push(' <div class="form-check form-check-inline">');
|
|
|
+ elementsStrArr.push(` <input class="form-check-input" type="${chkType}" id="${idSuffixStr}_sign3" value="individualStamp" name="${idSuffixStr}" onchange="rptSignatureHelper._changeSignType(this, ${userAcc.id}, '${PRIVATE_SIGN_STR}')" ${privateSignChkStr}>`);
|
|
|
+ elementsStrArr.push(` <label class="form-check-label" for="${idSuffixStr}_sign3">个人章</label>`);
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
+ } else {
|
|
|
+ elementsStrArr.push(' <div class="form-check form-check-inline px-2">');
|
|
|
+ elementsStrArr.push(` <input class="form-check-input" type="${chkType}" id="${idSuffixStr}_sign2" value="option2" onchange="rptSignatureHelper._changeSignType(this, ${userAcc.id}, '${COMPANY_SIGN_STR}')" ${companySignChkStr}>`);
|
|
|
+ elementsStrArr.push(` <label class="form-check-label" for="${idSuffixStr}_sign2">单位章</label>`);
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
+ }
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
+ elementsStrArr.push('</div>');
|
|
|
+ // 2. 日期
|
|
|
+ elementsStrArr.push('<div class="col-6">');
|
|
|
+ let dftDate = _getSignDateByAllScenarios(userAcc.id);
|
|
|
if (dftDate !== '' && dftDate.length > 20) {
|
|
|
dftDate = (new Date(dftDate)).Format('yyyy-MM-dd');
|
|
|
}
|
|
|
- /*/
|
|
|
- let dftDate = '';
|
|
|
- let hasAudit = false;
|
|
|
- if (STAGE_AUDIT && STAGE_AUDIT.length > 0) {
|
|
|
- for (const stga of STAGE_AUDIT) {
|
|
|
- if (stga.aid === userAccId) {
|
|
|
- hasAudit = true;
|
|
|
- if (stga.status === 3 && stga.end_time && stga.end_time !== '' && stga.end_time.length > 20) {
|
|
|
- //只有在审批人通过后才获取审批时间
|
|
|
- // let dt = new Date(stga.end_time);
|
|
|
- dftDate = (new Date(stga.end_time)).Format('yyyy-MM-dd');
|
|
|
- } else {
|
|
|
- dftDate = '';
|
|
|
- }
|
|
|
- // break; // 实际情况:有可能会有多次审核,要取最后一次
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- let isOrgRpt = false;
|
|
|
- for (const stg of STAGE_LIST) {
|
|
|
- if (stg.id === current_stage_id) {
|
|
|
- if (stg.user_id === userAccId) {
|
|
|
- isOrgRpt = true;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (isOrgRpt && !hasAudit && STAGE_AUDIT_ORG && STAGE_AUDIT_ORG.length > 0) {
|
|
|
- if (STAGE_AUDIT_ORG[0].begin_time && STAGE_AUDIT_ORG[0].begin_time !== '' && STAGE_AUDIT_ORG[0].begin_time.length > 20) {
|
|
|
- dftDate = (new Date(STAGE_AUDIT_ORG[0].begin_time)).Format('yyyy-MM-dd');
|
|
|
- }
|
|
|
- }
|
|
|
- if (!isOrgRpt && !hasAudit) {
|
|
|
- //非审批流程人员以及非原报,则显示期截至时间
|
|
|
- for (const stg of STAGE_LIST) {
|
|
|
- if (stg.id === current_stage_id && stg.period) {
|
|
|
- const period = stg.period.split(' ~ ');
|
|
|
- if (period.length === 2) {
|
|
|
- dftDate = period[1];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //*/
|
|
|
+ elementsStrArr.push('<div class="input-group input-group-sm margin-inputbox">');
|
|
|
+ elementsStrArr.push(' <div class="input-group-prepend">');
|
|
|
+ elementsStrArr.push(' <span class="input-group-text height-inputbox" id="inputGroup-sizing-sm"><i class="fa fa-calendar" title="添加签名日期"></i></span>');
|
|
|
+ elementsStrArr.push(' </div>');
|
|
|
if (dftDate !== '') {
|
|
|
- elementsStrArr.push('<input id="' + idSuffixStr + '" class="form-control form-control-sm mt-0" placeholder="选择签名日期" type="date" value="' + dftDate + '"');
|
|
|
+ elementsStrArr.push(`<input id="${idSuffixStr}" type="text" class="form-control datepicker-here height-inputbox" aria-label="Small" aria-describedby="inputGroup-sizing-sm" data-language="zh" value="${dftDate}"></input>`);
|
|
|
} else {
|
|
|
- elementsStrArr.push('<input id="' + idSuffixStr + '" class="form-control form-control-sm mt-0" placeholder="选择签名日期" type="date"');
|
|
|
+ elementsStrArr.push(`<input id="${idSuffixStr}" type="text" class="form-control datepicker-here height-inputbox" aria-label="Small" aria-describedby="inputGroup-sizing-sm" data-language="zh"></input>`);
|
|
|
}
|
|
|
elementsStrArr.push('</div>');
|
|
|
+ //-------------------------------------------------
|
|
|
+ elementsStrArr.push('</div>');
|
|
|
+ elementsStrArr.push('</div>');
|
|
|
},
|
|
|
removeSignature: function (dom) {
|
|
|
let accTxtName = $(dom.parentNode.parentNode.parentNode.parentNode.parentNode).find('label')[0].innerText;
|
|
@@ -480,10 +485,15 @@ let rptSignatureHelper = {
|
|
|
rptSignatureHelper.resetSignAudit();
|
|
|
if (current_stage_status === 3) {
|
|
|
//1. 重刷page
|
|
|
+ let hasStamp = false;
|
|
|
for (const page of zTreeOprObj.currentRptPageRst.items) {
|
|
|
if (page.signature_cells) {
|
|
|
- for (const sCell of page.signature_cells) {
|
|
|
- if (sCell.hasOwnProperty('pre_path')) {
|
|
|
+ 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;
|
|
|
}
|
|
@@ -528,6 +538,7 @@ let rptSignatureHelper = {
|
|
|
rptSignatureHelper.mergeSignDate(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, true);
|
|
|
rptSignatureHelper.mergeSignature(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST);
|
|
|
rptSignatureHelper.mergeSignAudit(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, STAGE_AUDIT);
|
|
|
+ zTreeOprObj.showPage(zTreeOprObj.currentPage, zTreeOprObj.canvas);
|
|
|
}
|
|
|
} else {
|
|
|
// CURRENT_ROLE_REL_ID = -1;
|
|
@@ -620,20 +631,62 @@ let rptSignatureHelper = {
|
|
|
}
|
|
|
return rst;
|
|
|
},
|
|
|
+ _getCompanySign: function(companyName) {
|
|
|
+ let rst = '';
|
|
|
+ for (const cUnit of CONSTRUCT_UNIT_LIST) {
|
|
|
+ if (cUnit.name === companyName) {
|
|
|
+ rst = cUnit.sign_path;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ },
|
|
|
mergeSignature: function (pageData, currRoleRelList, setPic = false) {
|
|
|
for (const page of pageData.items) {
|
|
|
if (page.signature_cells) {
|
|
|
+ const adHocScells = [];
|
|
|
for (const sCell of page.signature_cells) {
|
|
|
for (const role_rel of currRoleRelList) {
|
|
|
if (role_rel.signature_name === sCell.signature_name) {
|
|
|
- sCell.path = role_rel.sign_path;
|
|
|
- sCell.pre_path = role_rel.sign_path;
|
|
|
- if (setPic) {
|
|
|
- sCell.pic = role_rel.sign_pic; // 有些场景(如:批量归档)需要直接设置签名数据
|
|
|
+ // 处理签章
|
|
|
+ if (!Array.isArray(role_rel.sign_output)) {
|
|
|
+ role_rel.sign_output = [];
|
|
|
+ role_rel.sign_output.push(NORMAL_SIGN_STR);
|
|
|
+ }
|
|
|
+ for (const signType of role_rel.sign_output) {
|
|
|
+ switch (signType) {
|
|
|
+ case NORMAL_SIGN_STR:
|
|
|
+ sCell.path = role_rel.sign_path;
|
|
|
+ sCell.pre_path = role_rel.sign_path;
|
|
|
+ if (setPic) {
|
|
|
+ sCell.pic = role_rel.sign_pic; // 有些场景(如:批量归档)需要直接设置签名数据
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case COMPANY_SIGN_STR:
|
|
|
+ case PRIVATE_SIGN_STR:
|
|
|
+ /*
|
|
|
+ const stampPath = (signType === COMPANY_SIGN_STR) ? role_rel.company_stamp_path : role_rel.private_stamp_path;
|
|
|
+ // 生成一个新的dummy cell(类似草图)
|
|
|
+ const newStampCell = _createDummyCell();
|
|
|
+ newStampCell.signature_name = JV.SIGNATURE_NAME_DUMMY;
|
|
|
+ newStampCell.path = OSS_PATH + stampPath;
|
|
|
+ newStampCell.control = sCell.control;
|
|
|
+ newStampCell.style = sCell.style;
|
|
|
+ newStampCell.isStamp = true; // 这个标记纯属为了刷新用,其他sign cell是没有的
|
|
|
+ // 设置坐标
|
|
|
+ rptSignatureHelper._resetStampPos(sCell, newStampCell, pageData[JV.NODE_CONTROL_COLLECTION]);
|
|
|
+ // 加到cells去
|
|
|
+ adHocScells.push(newStampCell);
|
|
|
+ //*/
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ page.signature_cells = page.signature_cells.concat(adHocScells);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -740,7 +793,65 @@ let rptSignatureHelper = {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ _changeSignType: function(dom, acc_id, chkStr) {
|
|
|
+ for (const roleRel of ROLE_REL_LIST) {
|
|
|
+ if (roleRel.acc_id === acc_id) {
|
|
|
+ if (dom.checked) {
|
|
|
+ if (roleRel.sign_output.indexOf(chkStr) < 0) {
|
|
|
+ roleRel.sign_output.push(chkStr);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let idx = roleRel.sign_output.indexOf(chkStr);
|
|
|
+ if (idx >= 0) {
|
|
|
+ roleRel.sign_output.splice(idx, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (chkStr === COMPANY_SIGN_STR) {
|
|
|
+ let idx = roleRel.sign_output.indexOf(PRIVATE_SIGN_STR);
|
|
|
+ if (idx >= 0) {
|
|
|
+ roleRel.sign_output.splice(idx, 1);
|
|
|
+ }
|
|
|
+ } else if (chkStr === PRIVATE_SIGN_STR) {
|
|
|
+ let idx = roleRel.sign_output.indexOf(COMPANY_SIGN_STR);
|
|
|
+ if (idx >= 0) {
|
|
|
+ roleRel.sign_output.splice(idx, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ _resetStampPos: function(orgCell, targetCell, controls) {
|
|
|
+ const ctrl = controls[orgCell.control];
|
|
|
+ let pLeft = orgCell.area.Left, pTop = orgCell.area.Top;
|
|
|
+ switch(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_HORIZON]]) {
|
|
|
+ case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_LEFT]:
|
|
|
+ pLeft = orgCell.area.Left;
|
|
|
+ break;
|
|
|
+ case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_CENTER]:
|
|
|
+ pLeft = (orgCell.area.Left + orgCell.area.Right - STD_STAMP_SIZE_WIDTH) / 2 ;
|
|
|
+ break;
|
|
|
+ case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_RIGHT]:
|
|
|
+ pLeft = orgCell.area.Right - STD_STAMP_SIZE_WIDTH;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ switch(ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]]) {
|
|
|
+ case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_TOP]:
|
|
|
+ pTop = orgCell.area.Top;
|
|
|
+ break;
|
|
|
+ case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_CENTER]:
|
|
|
+ pTop = (orgCell.area.Top + orgCell.area.Bottom - STD_STAMP_SIZE_HEIGHT) / 2 ;
|
|
|
+ break;
|
|
|
+ case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_BOTTOM]:
|
|
|
+ pTop = orgCell.area.Bottom - STD_STAMP_SIZE_HEIGHT;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ targetCell.area.Left = pLeft;
|
|
|
+ targetCell.area.Top = pTop;
|
|
|
+ targetCell.area.Right = pLeft + STD_STAMP_SIZE_WIDTH;
|
|
|
+ targetCell.area.Bottom = pTop + STD_STAMP_SIZE_HEIGHT;
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
function _getSignDateByAllScenarios(userAccId) {
|
|
@@ -789,6 +900,17 @@ function _getSignDateDftName() {
|
|
|
return ' 年 月 日';
|
|
|
}
|
|
|
|
|
|
+function _createDummyCell() {
|
|
|
+ const rst = {
|
|
|
+ font: 'Footer',
|
|
|
+ control: 'Footer',
|
|
|
+ style: 'Default_None',
|
|
|
+ Value: '',
|
|
|
+ area: { Left: 0, Right: 0, Top: 0, Bottom: 0 },
|
|
|
+ };
|
|
|
+ return rst;
|
|
|
+}
|
|
|
+
|
|
|
function resetTextSignature(pageData) {
|
|
|
for (const page of pageData.items) {
|
|
|
for (let sCell of page.signature_cells) {
|
|
@@ -826,4 +948,4 @@ function resetTextSignature(pageData) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|