Commit a069bb3f by zhaoxiqing

gsb

parent 06a3491d
...@@ -934,6 +934,7 @@ class EntcontractService extends ServiceBase { ...@@ -934,6 +934,7 @@ class EntcontractService extends ServiceBase {
async yzMerchantReSign(params) { async yzMerchantReSign(params) {
let id = params.id; let id = params.id;
let ossurl = params.ossurl;
let econtract =await this.dao.findById(id); let econtract =await this.dao.findById(id);
if (!econtract) { if (!econtract) {
return this.returnjson(-1, "协议不存在"); return this.returnjson(-1, "协议不存在");
...@@ -951,8 +952,7 @@ class EntcontractService extends ServiceBase { ...@@ -951,8 +952,7 @@ class EntcontractService extends ServiceBase {
var yzparams = await this.yzmerchantsignedSve.findOne({entcontract_id:id}) var yzparams = await this.yzmerchantsignedSve.findOne({entcontract_id:id})
var yz = JSON.parse(yzparams.params); var yz = JSON.parse(yzparams.params);
// p_user // p_user_eaccount
let user = await this.userDao.findById(econtract.user_id);
let eaccount = await this.usereaccountDao.findById(econtract.usereaccount_id); let eaccount = await this.usereaccountDao.findById(econtract.usereaccount_id);
var sealId = entcompany.sealId; var sealId = entcompany.sealId;
...@@ -981,7 +981,7 @@ class EntcontractService extends ServiceBase { ...@@ -981,7 +981,7 @@ class EntcontractService extends ServiceBase {
var ebaoAccountId = eaccount.eaccountid; //签署人账户id-- 必填 var ebaoAccountId = eaccount.eaccountid; //签署人账户id-- 必填
var thirdOrderNo = "ent_"+ id; //第三方流水号,通知回调使用---选填 var thirdOrderNo = "ent_"+ id; //第三方流水号,通知回调使用---选填
var eBaoRedirectBossUrl = ""; var eBaoRedirectBossUrl = "";
var tt = await this.utilesignbaoSve.userSignContractNoTemplaterEversalSeal(signParams, ebaoAccountId, thirdOrderNo, eBaoRedirectBossUrl, "econtractSve", sealId); var tt = await this.utilesignbaoSve.userSignContractNoTemplaterEversalSeal(signParams, ebaoAccountId, thirdOrderNo, eBaoRedirectBossUrl, "econtractSve", sealId,ossurl,eaccount);
console.log(tt, "-============= result ==========================="); console.log(tt, "-============= result ===========================");
if (tt && tt.code == 1) { if (tt && tt.code == 1) {
econtract.eflowid = tt.data.flowId; econtract.eflowid = tt.data.flowId;
......
...@@ -125,7 +125,7 @@ class UtilESignBaoService { ...@@ -125,7 +125,7 @@ class UtilESignBaoService {
content: "参数:flowId=" + flowId + ",请求返回的参数:" + JSON.stringify(tResult), content: "参数:flowId=" + flowId + ",请求返回的参数:" + JSON.stringify(tResult),
clientIp: "" clientIp: ""
}); });
result.code = -110; result.code = -110;
result.errCode = tResult.errCode; result.errCode = tResult.errCode;
result.message = "获取文件接口请求错误"; result.message = "获取文件接口请求错误";
...@@ -306,6 +306,71 @@ class UtilESignBaoService { ...@@ -306,6 +306,71 @@ class UtilESignBaoService {
return result return result
} }
//-------------------------------------------------------------------------创建企业印章---结束---------------- //-------------------------------------------------------------------------创建企业印章---结束----------------
//-------------------------------------------------------------------------创建个人图片印章---开始----------------
async createPerSeal(sealUrl, accountId, aliasName, opName) {
//日志记录
logCtl.info({
optitle: "e签宝===>创建模板文件信息info",
op: "app/base/service/impl/utilesignbaoSve/createPerSeal",
content: "参数:sealUrl=" + sealUrl,
clientIp: ""
});
var result = {
code: 1,
message: "success",
data: {}
}
var templateFileResult = await this.downloadEntTemplateFile(sealUrl, result);
if (templateFileResult.code != 1) {
return result;
}
//操作的本地文件
const opFileAllName = templateFileResult.data.file_all_name;
//获取文件属性
var stats = await this.statpromise(opFileAllName);
var uploadFileResult = await this.uploadfileToeBao(opFileAllName, stats.size, result, opName);
if (uploadFileResult.code != 1) {
return result;
}
//e签宝返回的操作属性
const opFileKey = uploadFileResult.data.fileKey;
const opUploadFileUrl = uploadFileResult.data.uploadUrl;
const opContentMd5 = uploadFileResult.data.content_md5;
//日志记录
logCtl.info({
optitle: "e签宝===>curlUpResult模板到e签宝服务器请求参数信息info",
op: "app/base/service/impl/utilesignbaoSve/curlPutFileToeBao",
content: "请求参数:opFileKey=" + opFileKey + ",opUploadFileUrl=" + opUploadFileUrl + ",opFileAllName=" + opFileAllName + ",opContentMd5=" + opContentMd5,
clientIp: ""
});
//curl文件到e签宝
var curlUpResult = await this.curlPutFileToeBao(opFileAllName, opUploadFileUrl, opFileKey, opContentMd5, opName, result);
if (uploadFileResult.code != 1) {
return result;
}
var sealParams = {
accountId: accountId,
alias: aliasName,
color: "RED",
fileKey: opFileKey
}
var reqUrl = this.eSignBaoUrl + "/seal/create/image/person";
var tResult = await this.returnResult(sealParams, reqUrl, opName, "create organize", result);
if (tResult.errCode != 0) {
result.code = -110;
result.message = "接口请求错误";
return result;
}
// 创建印章id
result.data = {
fileKey: opFileKey,
sealId: tResult.data.sealId,
};
return result
}
//-------------------------------------------------------------------------创建个人图片印章---结束----------------
//-------------------------------------------------------------------------创建模板---开始---------------- //-------------------------------------------------------------------------创建模板---开始----------------
//创建模板文件 //创建模板文件
...@@ -735,7 +800,7 @@ class UtilESignBaoService { ...@@ -735,7 +800,7 @@ class UtilESignBaoService {
/* /*
seal 位置反转 seal 位置反转
*/ */
async userSignContractNoTemplaterEversalSeal(params, ebaoAccountId, thirdOrderNo, eSignBaoRedirectBossUrl, opName, sealId) { //用户签署合同-------调用此方法 async userSignContractNoTemplaterEversalSeal(params, ebaoAccountId, thirdOrderNo, eSignBaoRedirectBossUrl, opName, sealId,ossurl,eaccount) { //用户签署合同-------调用此方法
//日志记录 //日志记录
logCtl.info({ logCtl.info({
optitle: "e签宝===>创建用户签署合同信息info", optitle: "e签宝===>创建用户签署合同信息info",
...@@ -793,6 +858,7 @@ class UtilESignBaoService { ...@@ -793,6 +858,7 @@ class UtilESignBaoService {
}] }]
}; };
if (sealId) {//印章id,不传时使用账户默认印章 if (sealId) {//印章id,不传时使用账户默认印章
platformSignTaskParams.sealId = sealId; platformSignTaskParams.sealId = sealId;
} }
...@@ -802,31 +868,55 @@ class UtilESignBaoService { ...@@ -802,31 +868,55 @@ class UtilESignBaoService {
return result; return result;
} }
var handPersonSignTaskParams = { //4、创建用户图片印章
var sealKey = await this.createPerSeal(ossurl, ebaoAccountId, params.simpleFormFields.nameA, "entcontractCtl");
console.log("有赞创建个人印章================"sealKey.data);
if(sealKey.data){
console.log("有赞创建个人印章================"sealKey.data);
eaccount.sealId = sealKey.data.sealId;
eaccount.save();
}
var autoUserSignTaskParams = {
flowId: tFlowId, //流程id-- 必填 flowId: tFlowId, //流程id-- 必填
accountId: ebaoAccountId, //签署人账户id-- 必填 accountId: ebaoAccountId, //签署人账户id-- 必填
sealId:sealKey.data.sealId,
thirdOrderNo: tThirdOrderNo, //第三方流水号,通知回调使用 thirdOrderNo: tThirdOrderNo, //第三方流水号,通知回调使用
sealType: "0", //印章类型, 指定签署印章类型,0:手绘印章;1:模板印章-- 必填 ????????????????????????????? sealType: "1", //印章类型, 指定签署印章类型,0:手绘印章;1:模板印章-- 必填 ?????????????????????????????
posList: [{ posList: [{
signType: 1, //盖章位置定位方式,1关键字定位-- 必填 signType: 1, //盖章位置定位方式,1关键字定位-- 必填
key: "sealA" //-- 必填 key: "sealA" //-- 必填
}] }]
}; };
//4.发起个人手动签署 5.5.4 //5.发起用户自动签署 5.5.3
var handPersonSignTaskResult = await self.handPersonSignTask(handPersonSignTaskParams, opName, result); var autoUserSignTaskResult = await self.autoUserSignTask(autoUserSignTaskParams, opName, result);
if (handPersonSignTaskResult.code != 1) { if (autoUserSignTaskResult.code != 1) {
return result; return autoUserSignTaskResult;
} }
// 打开这行注释
await this.archiveProcess({flowId: tFlowId}, opName);
result.data = { result.data = {
flowId: tFlowId, //流程id flowId: tFlowId, //流程id
docId: tDocId, //合同id docId: tDocId, //合同id
signUrl: handPersonSignTaskResult.data.signUrl, //签署地址,用户可通过本地址跳转至 e 签宝签署页面进行签署,链接永久有效
signShortUrl: handPersonSignTaskResult.data.signShortUrl, //接口调用时传入的对接方业务流水号,用于支持对接方进行上下文关联
templateId: params.templateId //模板id,由创建模板接口调用返回的templateId templateId: params.templateId //模板id,由创建模板接口调用返回的templateId
}; };
return result; console.log(result);
// //4.发起个人手动签署 5.5.4
// var handPersonSignTaskResult = await self.handPersonSignTask(handPersonSignTaskParams, opName, result);
// if (handPersonSignTaskResult.code != 1) {
// return result;
// }
//
// result.data = {
// flowId: tFlowId, //流程id
// docId: tDocId, //合同id
// signUrl: handPersonSignTaskResult.data.signUrl, //签署地址,用户可通过本地址跳转至 e 签宝签署页面进行签署,链接永久有效
// signShortUrl: handPersonSignTaskResult.data.signShortUrl, //接口调用时传入的对接方业务流水号,用于支持对接方进行上下文关联
// templateId: params.templateId //模板id,由创建模板接口调用返回的templateId
// };
// return result;
} }
/*参数说明: /*参数说明:
...@@ -940,8 +1030,8 @@ class UtilESignBaoService { ...@@ -940,8 +1030,8 @@ class UtilESignBaoService {
/*创建企业印章: /*创建企业印章:
accountId:企业账号id, accountId:企业账号id,
aliasName:印章别名, aliasName:印章别名,
templateType: templateType:
模板类型: 模板类型:
1.ROUND_STAR 圆形有五角星章 1.ROUND_STAR 圆形有五角星章
...@@ -1173,4 +1263,4 @@ class UtilESignBaoService { ...@@ -1173,4 +1263,4 @@ class UtilESignBaoService {
} }
} }
} }
module.exports = UtilESignBaoService; module.exports = UtilESignBaoService;
\ No newline at end of file
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<el-table-column prop="completed_at" label="签约时间" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column> <el-table-column prop="completed_at" label="签约时间" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column label="操作" > <el-table-column label="操作" >
<template slot-scope="scope" align="center"> <template slot-scope="scope" align="center">
<a v-if="!scope.row.esignUrl" href="javascript:;" @click="toHand(scope.row.id)" style="float:left;text-decoration: none;color:#59C1A6;font-size: 14px;margin-left: 10px;">发起签约</a> <a v-if="!scope.row.esignUrl" href="javascript:;" @click="toshowDong(scope.row.id)" style="float:left;text-decoration: none;color:#59C1A6;font-size: 14px;margin-left: 10px;">发起签约</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -223,5 +223,24 @@ ...@@ -223,5 +223,24 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog width="862px" :visible.sync="showDong">
<div slot="title">
<div style="width: 862px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"></div>
</div>
<el-form :model="enttemplate" :rules="rulesd" ref="enttemplate" label-width="100px" label="right" style="padding:0px 100px;" >
<div style="0px 10px; line-height: 15px;padding-bottom:40px;">
<div style="width:2px;height:15px;float: left;background-color: #54C4A7">
</div>
<span style="font-size:15px;color: #333333;float: left;font-weight:bold;margin-left: 7px;">印章url</span>
</div>
<el-form-item label="印章url:" prop="url" >
<el-input v-model="url" placeholder="请输入地址" maxlength="200" style="width:468px;" clearable ></el-input>
</el-form-item>
</el-form>
<div style="margin-left: 200px;">
<el-button :loading="saveLoading" @click="toHand" style="width:120px;height:36px; background:#54C4A7; border-radius:4px;color: #FFFFFF;font-size: 16px;padding-top: 10px;">保存</el-button>
</div>
</el-dialog>
</div> </div>
</gsb-pcpage> </gsb-pcpage>
...@@ -73,6 +73,18 @@ ...@@ -73,6 +73,18 @@
aggreement: {}, aggreement: {},
autoAggreement: {}, autoAggreement: {},
autoUploadResult: null, autoUploadResult: null,
enttemplate: {},
showDong:false,
id:0,
url:null,
saveLoading: false,
rulesd: {
name : [
{ required: true, message: '请输入模板名称', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
},
} }
}, },
mounted: function () { mounted: function () {
...@@ -81,6 +93,34 @@ ...@@ -81,6 +93,34 @@
created: function () {}, created: function () {},
methods: { methods: {
saveTemplate() {
var self = this;
self.$refs.enttemplate.validate((valid) => {
if (valid) {
self.saveLoading = true;
setTimeout(() => {
self.saveLoading = false;
}, 15000);
self.$root.postReq("/web/enttemplateCtl/mysave", self.enttemplate).then(function (d) {
if (d.status == 0) {
self.$message.success(`保存成功`);
self.showEdit = false;
self.getList();
} else {
self.$alert(d.msg || '保存失败', '提示', {
confirmButtonText: '确定',
callback: action => {}
});
}
self.saveLoading = false;
});
} else {
self.saveLoading = false;
return false;
}
});
},
getEmptySearch() { getEmptySearch() {
return { return {
list: [], list: [],
...@@ -433,22 +473,28 @@ ...@@ -433,22 +473,28 @@
} }
}); });
}, },
toHand(id) { toHand() {
var self = this; var self = this;
self.$root.postReq("/web/entcontractCtl/yzReSign", { self.$root.postReq("/web/entcontractCtl/yzReSign", {
id: id ossurl:self.url,
id: self.id
}).then(function (d) { }).then(function (d) {
if (d.status == 0 && d.data) { if (d.status == 0 && d.data) {
// self.$alert("https://bpohhr.gongsibao.com/bpoent?entid="+id, '提示', {
// confirmButtonText: '确定',
// callback: action => {}
// });
self.$message.warning(d.msg || "签署成功"); self.$message.warning(d.msg || "签署成功");
self.showDong = true;
} else { } else {
self.$message.warning(d.msg || "签署失败"); self.$message.warning(d.msg || "签署失败");
} }
}); });
}, },
toshowDong(id) {
var self = this;
self.id = id;
self.showDong = true;
},
}, },
vname: "gsb-econtractall2" vname: "gsb-econtractall2"
} }
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