Commit 773a78ea authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

openDocument.js - подписание через egov mobile

parent cf596461
...@@ -505,19 +505,27 @@ const openDialogSelectSignType = handler => { ...@@ -505,19 +505,27 @@ const openDialogSelectSignType = handler => {
}); });
} }
const signDocument = async (documentID, signButton) => { const signDocument = async (_doc, signButton) => {
try { try {
openDialogSelectSignType(async signType => { openDialogSelectSignType(async signType => {
switch (signType) { switch (signType) {
case 'egov': generateQRCodeEgov(documentID, 'sign'); break; case 'egov': {
generateQRCodeEgov({
documentID: _doc.documentID,
worktype: 'sign'
}, () => {
closeDocument(_doc);
});
break;
}
case 'ncalayer': { case 'ncalayer': {
NCALayer.sign('SIGN', documentID, async result => { NCALayer.sign('SIGN', _doc.documentID, async result => {
Cons.showLoader(); Cons.showLoader();
try { try {
const signResult = await AS.FORMS.ApiUtils.simpleAsyncPost("rest/api/docflow/sign", null, null, { const signResult = await AS.FORMS.ApiUtils.simpleAsyncPost("rest/api/docflow/sign", null, null, {
documentID, documentID: _doc.documentID,
rawdata: result.dataForSign, rawdata: result.dataForSign,
signdata: result.signedData, signdata: result.signedData,
certificate: result.certificate, certificate: result.certificate,
...@@ -993,7 +1001,7 @@ class ButtonsActions { ...@@ -993,7 +1001,7 @@ class ButtonsActions {
signButton.on('click', e => { signButton.on('click', e => {
e.preventDefault(); e.preventDefault();
e.target.blur(); e.target.blur();
signDocument(this._doc.documentID, signButton); signDocument(this._doc, signButton);
}); });
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment