Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
cbe24048
Commit
cbe24048
authored
May 07, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
2255a40d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
938 additions
and
4 deletions
+938
-4
bpo-admin/app/base/controller/impl/entcontractCtl.js
+24
-0
bpo-admin/app/base/db/metadata/apps/platform.js
+9
-0
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/entcontractall2.js
+26
-0
bpo-admin/app/base/service/impl/entcontractSve.js
+61
-3
bpo-admin/app/base/service/impl/utilesignbaoSve.js
+147
-0
bpo-admin/app/config/localsettings.js
+1
-1
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.html
+228
-0
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.js
+442
-0
No files found.
bpo-admin/app/base/controller/impl/entcontractCtl.js
View file @
cbe24048
...
...
@@ -63,6 +63,24 @@ class EntcontractCtl extends CtlBase {
}
}
async
allList2
(
queryobj
,
obj
,
req
)
{
var
params
=
obj
.
search
||
{};
var
ecompanyId
=
params
.
ecompany_id
;
if
(
ecompanyId
)
{
params
.
ecompanyIds
=
[
ecompanyId
];
delete
params
.
ecompany_id
;
}
params
.
eflowstatusList
=
[
'1'
];
this
.
doTimeCondition
(
params
,
[
"signBegin"
,
"signEnd"
]);
try
{
var
page
=
await
this
.
service
.
listByCondition
(
params
);
return
system
.
getResult2
(
page
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
);
}
}
async
allExport
(
queryobj
,
req
,
res
)
{
var
params
=
JSON
.
parse
(
queryobj
.
search
);
params
.
currentPage
=
1
;
...
...
@@ -499,6 +517,11 @@ class EntcontractCtl extends CtlBase {
}
}
async
yzReSign
(
q
,
obj
,
req
)
{
let
res
=
await
this
.
service
.
yzMerchantReSign
(
obj
);
return
res
;
}
}
module
.
exports
=
EntcontractCtl
;
\ No newline at end of file
bpo-admin/app/base/db/metadata/apps/platform.js
View file @
cbe24048
...
...
@@ -944,6 +944,14 @@ module.exports = {
"bizConfig"
:
null
,
"path"
:
""
},
{
"code"
:
"zc_entcontractall2"
,
"label"
:
"手动签约"
,
"isMenu"
:
true
,
"bizCode"
:
"entcontractall2"
,
"bizConfig"
:
null
,
"path"
:
""
},
],
},
...
...
@@ -1620,6 +1628,7 @@ module.exports = {
"entcompanyadmin"
:
{
"title"
:
"企业管理"
,
"config"
:
null
,
"path"
:
"/entcompanyadmin"
,
"comname"
:
"entcompanyadmin"
},
"enttemplateadmin"
:
{
"title"
:
"模板管理"
,
"config"
:
null
,
"path"
:
"/enttemplateadmin"
,
"comname"
:
"enttemplateadmin"
},
"entcontractall"
:
{
"title"
:
"签约管理"
,
"config"
:
null
,
"path"
:
"/entcontractall"
,
"comname"
:
"entcontractall"
},
"entcontractall2"
:
{
"title"
:
"签约管理"
,
"config"
:
null
,
"path"
:
"/entcontractall2"
,
"comname"
:
"entcontractall2"
},
// 企业电子签-个人
"entcompanymy"
:
{
"title"
:
"企业管理"
,
"config"
:
null
,
"path"
:
"/entcompanymy"
,
"comname"
:
"entcompanymy"
},
...
...
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/entcontractall2.js
0 → 100644
View file @
cbe24048
module
.
exports
=
{
"bizName"
:
"entcontractall2"
,
"list"
:{
columnMetaData
:[
]
},
"form"
:[
],
"search"
:[
],
"auth"
:{
"add"
:[
],
"edit"
:[
],
"delete"
:[
// {"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
],
"common"
:[
],
}
}
bpo-admin/app/base/service/impl/entcontractSve.js
View file @
cbe24048
...
...
@@ -327,9 +327,7 @@ class EntcontractService extends ServiceBase {
[
"id"
,
'desc'
]
];
var
attributes
=
[
`id`
,
`name`
,
`fileurl`
,
`eflowstatus`
,
`eflowstatusname`
,
`completed_at`
,
`end_at`
,
`user_id`
,
`usereaccount_id`
,
`entcompany_id`
,
`enttemplate_id`
];
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
,
attributes
);
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
);
if
(
page
&&
page
.
rows
)
{
for
(
var
row
of
page
.
rows
)
{
this
.
handleDate
(
row
,
[
"completed_at"
,
"end_at"
],
null
);
...
...
@@ -932,6 +930,66 @@ class EntcontractService extends ServiceBase {
this
.
ejobapplySve
.
addMessage
(
id
,
"零工签约"
,
"成功签约"
);
}
async
yzMerchantReSign
(
params
)
{
let
id
=
params
.
id
;
let
econtract
=
this
.
dao
.
findById
(
id
);
if
(
!
econtract
)
{
return
this
.
returnjson
(
-
1
,
"协议不存在"
);
}
if
(
econtract
.
eflowstatus
==
'2'
)
{
return
this
.
returnjson
(
-
1
,
"商户已经签约成功"
);
}
// enttemplate 模板查询
let
enttemplate
=
await
this
.
enttemplateSve
.
findById
(
econtract
.
enttemplate_id
);
// entcompany
let
entcompany
=
await
this
.
entcompanyDao
.
findById
(
econtract
.
entcompany_id
);
// p_user
let
user
=
await
this
.
userDao
.
findById
(
econtract
.
user_id
);
let
eaccount
=
await
this
.
usereaccountDao
.
findById
(
econtract
.
usereaccount_id
);
var
sealId
=
entcompany
.
sealId
;
let
today
=
new
Date
().
Format
(
"yyyy"
)
+
"年"
+
new
Date
().
Format
(
"MM"
)
+
"月"
+
new
Date
().
Format
(
"dd"
)
+
"日"
;
var
signParams
=
{
templateId
:
enttemplate
.
templateid
,
//模板id,由创建模板接口调用返回的templateId 必填
name
:
enttemplate
.
name
,
//合同模板名称 必填
simpleFormFields
:
{
nameA
:
params
.
merchantName
,
//甲方 必填
addressA
:
params
.
merchantAddr
,
//甲方地址
representA
:
params
.
merchantLegal
,
//甲方法定代表人
agentA
:
params
.
idName
,
//甲方联系人
agentMobileA
:
params
.
mobile
,
//甲方 联系电话
nameB
:
entcompany
.
name
,
//乙方 必填
addressB
:
entcompany
.
addr
,
//乙方 地址
representB
:
entcompany
.
legal
,
//乙方 法定代表人
agentB
:
entcompany
.
contactName
,
//乙方 联系人
agentMobileB
:
entcompany
.
contactMobile
,
//乙方 联系电话
// bankNameB: entcompany.bankAccount,//账户名称
// bank: entcompany.bankName,//开户行
// bankNumB: entcompany.bankNo,//账号
signDate
:
today
,
//签约时间
signDateA
:
today
,
//甲方签约日期 必填
signDateB
:
today
//乙方签约日期 必填
}
};
var
ebaoAccountId
=
eaccount
.
eaccountid
;
//签署人账户id-- 必填
var
thirdOrderNo
=
"ent_"
+
entcontract
.
id
;
//第三方流水号,通知回调使用---选填
var
eBaoRedirectBossUrl
=
""
;
var
tt
=
await
this
.
utilesignbaoSve
.
userSignContractNoTemplaterEversalSeal
(
signParams
,
ebaoAccountId
,
thirdOrderNo
,
eBaoRedirectBossUrl
,
"econtractSve"
,
sealId
);
console
.
log
(
tt
,
"-============= result ==========================="
);
if
(
tt
&&
tt
.
code
==
1
)
{
econtract
.
eflowid
=
tt
.
data
.
flowId
;
econtract
.
edocid
=
tt
.
data
.
docId
;
econtract
.
esignUrl
=
tt
.
data
.
signUrl
;
await
econtract
.
save
();
return
system
.
getResult2
(
tt
.
data
,
null
);
}
return
this
.
returnjson
(
-
1
,
tt
.
message
||
"签约失败"
,
tt
.
code
);
}
async
syncContract
(
id
)
{
var
contract
=
null
;
var
account
=
null
;
...
...
bpo-admin/app/base/service/impl/utilesignbaoSve.js
View file @
cbe24048
...
...
@@ -5,6 +5,7 @@ const logCtl = System.getObject("web.oplogCtl");
const
crypto
=
require
(
'crypto'
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
fs
=
require
(
"fs"
);
const
axios
=
require
(
"axios"
);
//工商查询操作
class
UtilESignBaoService
{
constructor
()
{
...
...
@@ -731,6 +732,103 @@ class UtilESignBaoService {
return
result
;
}
/*
seal 位置反转
*/
async
userSignContractNoTemplaterEversalSeal
(
params
,
ebaoAccountId
,
thirdOrderNo
,
eSignBaoRedirectBossUrl
,
opName
,
sealId
)
{
//用户签署合同-------调用此方法
//日志记录
logCtl
.
info
({
optitle
:
"e签宝===>创建用户签署合同信息info"
,
op
:
"app/base/service/impl/utilesignbaoSve/userSignContractNoTemplate"
,
content
:
"参数:ebaoAccountId="
+
ebaoAccountId
+
",thirdOrderNo="
+
thirdOrderNo
+
",eSignBaoRedirectBossUrl="
+
eSignBaoRedirectBossUrl
+
",请求params参数:"
+
JSON
.
stringify
(
params
),
clientIp
:
""
});
/*
1.合同模板创建合同 5.4.2
2.创建合同签署流程 5.5.1
3.发起对接平台自动签署 5.5.2
4.发起个人手动签署 5.5.4
*/
var
result
=
{
code
:
1
,
message
:
"success"
,
data
:
{}
};
if
(
ebaoAccountId
==
null
||
ebaoAccountId
==
""
||
ebaoAccountId
==
"undefined"
)
{
result
.
code
=
-
100
;
result
.
message
=
"ebaoAccountId参数有误"
;
return
result
;
}
var
tThirdOrderNo
=
thirdOrderNo
==
null
||
thirdOrderNo
==
""
||
thirdOrderNo
==
"undefined"
?
""
:
thirdOrderNo
var
self
=
this
;
//1.合同模板创建合同 5.4.2
var
createTemplate
=
await
self
.
createByTemplate
(
params
,
opName
,
result
);
if
(
createTemplate
.
code
!=
1
)
{
return
result
;
}
var
tDocId
=
createTemplate
.
data
.
docId
;
var
addProcessParams
=
{
businessScene
:
params
.
name
,
//业务场景名称-- 必填
initiatorAccountId
:
""
,
//发起方账户id,默认对接平台,--使用默认的,不用填写
signValidity
:
""
,
//签署截止时间戳毫秒值-- 选填
payer
:
""
,
//签署付费方,默认对接平台-- 选填
signPlatform
:
"1"
,
//指定用户签署的平台,空值表示不限平台(1:H5签2:支付宝生活号签3:微信小程序签(后续版本支持))-- 选填
noticeType
:
""
,
//用户接收签署任务通知的方式,空值不通知,1短信,2邮箱,格式"1,2"
redirectUrl
:
eSignBaoRedirectBossUrl
,
//页面签署完成后跳转地址
docId
:
tDocId
,
//合同id
docName
:
""
//合同名称,默认使用创建合同时的名称-- 选填
};
//2.创建合同签署流程 5.5.1
var
createAddProcess
=
await
self
.
addProcess
(
addProcessParams
,
opName
,
result
);
if
(
createAddProcess
.
code
!=
1
)
{
return
result
;
}
var
tFlowId
=
createAddProcess
.
data
.
flowId
;
var
platformSignTaskParams
=
{
flowId
:
tFlowId
,
//流程id-- 必填
thirdOrderNo
:
tThirdOrderNo
,
//第三方流水号,通知回调使用
posList
:
[{
signType
:
1
,
//盖章位置定位方式,1关键字定位-- 必填
key
:
"sealB"
//-- 必填
}]
};
if
(
sealId
)
{
//印章id,不传时使用账户默认印章
platformSignTaskParams
.
sealId
=
sealId
;
}
//3.发起对接平台自动签署 5.5.2
var
platformSignTaskResult
=
await
self
.
platformSignTask
(
platformSignTaskParams
,
opName
,
result
);
if
(
platformSignTaskResult
.
code
!=
1
)
{
return
result
;
}
var
handPersonSignTaskParams
=
{
flowId
:
tFlowId
,
//流程id-- 必填
accountId
:
ebaoAccountId
,
//签署人账户id-- 必填
thirdOrderNo
:
tThirdOrderNo
,
//第三方流水号,通知回调使用
sealType
:
"0"
,
//印章类型, 指定签署印章类型,0:手绘印章;1:模板印章-- 必填 ?????????????????????????????
posList
:
[{
signType
:
1
,
//盖章位置定位方式,1关键字定位-- 必填
key
:
"sealA"
//-- 必填
}]
};
//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
;
}
/*参数说明:
var params = {
templateId: "2c98d5446734acf5016827d168a6013b", //模板id,由创建模板接口调用返回的templateId 必填
...
...
@@ -997,10 +1095,59 @@ class UtilESignBaoService {
return
result
;
}
//-------------------------------------------------------------------------签署成功后归档-----结束--------------
// async returnResult(params, reqUrl, opClassName, opMethod, result) {
// var data = JSON.stringify(params);
// var rtn = null;
// try {
// rtn = await this.restClient.execPostESignBao(data, reqUrl);
// console.log(rtn, "rtn---------------------------------e签宝--------execPostESignBao---------------->>>>>>>>>>>>>>>>");
// if (rtn.stdout == null || rtn.stdout == "" || rtn.stdout == "undefined") {
// result.errCode = -100;
// result.code = -100;
// result.message = "请求结果返回为空";
// return result;
// }
// return JSON.parse(rtn.stdout);
// } catch (e) {
// console.log(e.stack);
// //日志记录
// logCtl.error({
// optitle: "e签宝opClassName=" + opClassName + ",opMethod=" + opMethod + "操作异常异常error",
// op: "base/service/impl/utilesignbaoSve/returnResult,请求url:" + reqUrl,
// content: "请求参数:" + data + ",返回结果参数rtn.stdout:" + rtn.stdout + ",异常信息error:" + e.stack,
// clientIp: ""
// });
// result.errCode = -200;
// result.code = -200;
// result.message = "操作异常"
// return result;
// }
// }
async
returnResult
(
params
,
reqUrl
,
opClassName
,
opMethod
,
result
)
{
var
data
=
JSON
.
stringify
(
params
);
var
rtn
=
null
;
try
{
if
(
settings
.
env
==
'dev'
)
{
let
rs
=
await
axios
({
method
:
'post'
,
url
:
reqUrl
,
data
:
params
,
headers
:
{
'X-Tsign-Open-App-Id'
:
'5111588557'
,
'X-Tsign-Open-App-Secret'
:
'1595787e8d5b7d19f7b6798f16f41fc2'
},
});
console
.
log
(
rs
);
if
(
rs
.
data
.
errCode
!=
0
)
{
result
.
code
=
-
110
;
result
.
message
=
"接口请求错误"
;
return
result
;
}
result
.
errCode
=
0
;
result
.
data
=
rs
.
data
.
data
;
return
result
;
}
rtn
=
await
this
.
restClient
.
execPostESignBao
(
data
,
reqUrl
);
console
.
log
(
rtn
,
"rtn---------------------------------e签宝--------execPostESignBao---------------->>>>>>>>>>>>>>>>"
);
if
(
rtn
.
stdout
==
null
||
rtn
.
stdout
==
""
||
rtn
.
stdout
==
"undefined"
)
{
...
...
bpo-admin/app/config/localsettings.js
View file @
cbe24048
...
...
@@ -9,7 +9,7 @@ var settings = {
// dbname : "bpo",
// user : "write",
// password : "write",
dbname
:
"bpo
2
"
,
dbname
:
"bpo"
,
user
:
"write"
,
password
:
"write"
,
config
:
{
...
...
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.html
0 → 100644
View file @
cbe24048
<gsb-pcpage>
<div
style=
"padding:10px 20px;"
>
<div
style=
"height: auto; max-width: 1500px;"
>
<el-card
style=
"background-color: #FFFFFF;padding:10px 10px 30px 10px;margin-top: 20px;"
>
<div
style=
"width:100%;line-height: 40px;"
>
<div
style=
"float:left;width: auto;"
>
<span
style=
"color:2F2F2F;font-size: 14px;"
>
所属企业:
</span>
<el-select
v-model=
"selname"
filterable
remote
clearable
reserve-keyword
style=
"width:200px;"
placeholder=
"请搜索公司名称"
@
change=
"nameChange"
:remote-method=
"getCompanyNames"
:loading=
"nameLoading"
>
<el-option
v-for=
"item in nameList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.name"
>
<span
style=
"float: left;width:150px;"
>
{{ item.name }}
</span>
</el-option>
</el-select>
</div>
<div
style=
"float:left;width: auto;margin-left: 40px;"
>
<span
style=
"color:2F2F2F;font-size: 14px;"
>
客户姓名:
</span>
<el-input
v-model=
"search.accountName"
maxlength=
"50"
clearable
style=
"width:160px;height: 36px;"
></el-input>
</div>
<div
style=
"float:left;width: auto;margin-left: 40px;"
>
<span
style=
"color:2F2F2F;font-size: 14px;"
>
身份证:
</span>
<el-input
v-model=
"search.accountIdno"
maxlength=
"50"
clearable
style=
"width:160px;height: 36px;"
></el-input>
</div>
</div>
<div
style=
"clear:both;height:20px;"
></div>
<div
style=
"width:100%;line-height: 40px;"
>
<div
style=
"float:left;width: auto;"
>
<span
style=
"color:2F2F2F;font-size: 14px;"
>
客户手机:
</span>
<el-input
v-model=
"search.accountMobile"
maxlength=
"50"
clearable
style=
"width:200px;height: 36px;"
></el-input>
</div>
<div
style=
"float:left;width: 400px;margin-left: 40px;"
>
<span
style=
"color:2F2F2F;font-size: 14px; float:left;"
>
签约日期:
</span>
<el-date-picker
v-model=
"search.signBegin"
type=
"date"
placeholder=
"开始时间"
style=
"width:140px;height: 36px;float:left;"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
default-value=
""
>
</el-date-picker>
<el-date-picker
v-model=
"search.signEnd"
type=
"date"
style=
"width:140px;height: 36px;margin-left: 16px;float:left;"
placeholder=
"结束时间"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
default-value=
""
>
</el-date-picker>
</div>
<div
style=
"float:left;margin-top:5px;margin-left: 40px;"
>
<el-button
@
click=
"resetSearch"
style=
"float:right;width:68px;height:36px;background-color: #54C4A7;color: #FFFFFF;font-size: 14px;padding-top:10px;"
>
重置
</el-button>
<el-button
@
click=
"opSearch"
style=
"float:right;width:68px;height:36px;background-color: #54C4A7;color: #FFFFFF;font-size: 14px;padding-top:10px;margin-right: 10px;"
>
搜索
</el-button>
</div>
</div>
</el-card>
<el-card
style=
"background-color: #FFFFFF;padding:10px 10px 30px 10px;margin-top: 20px;"
>
<div
style=
"margin-top: -15px;"
>
<div
style=
"line-height: 36px;padding-bottom: 20px;"
>
<span
style=
"float:left;color:#2F2F2F;font-size: 14px;"
>
共{{search.total}}条记录
</span>
<el-button
@
click=
"exportList()"
style=
"float:right;width:100px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px"
>
导出签约
</el-button>
<!-- <el-button @click="autoOpenEdit()" style="float:right;width:120px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px">批量签约</el-button>-->
</div>
<div
style=
"margin-top: 15px;"
>
<el-table
stripe
fix=
"true"
:data=
"search.list"
style=
"width: 100%;margin-top: 23px;min-height: 500px;"
empty-text=
"暂无申请"
tooltip-effect=
"light"
header-cell-style=
"background-color: #F5F5F5;color: #2F2F2F;font-size: 14px;font-weight:400;"
row-style=
"height:50px;"
>
<el-table-column
prop=
"id"
label=
"id"
:formatter=
"onColFormater"
align=
"center"
></el-table-column>
<el-table-column
prop=
"name"
label=
"公司名称"
:formatter=
"onColFormater"
align=
"center"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"esignUrl"
label=
"手动签署"
:formatter=
"onColFormater"
align=
"center"
show-overflow-tooltip
></el-table-column>
<!-- <el-table-column prop="template.nameA" label="签约主体" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>-->
<el-table-column
prop=
"eaccount.userName"
label=
"姓名"
:formatter=
"onColFormater"
align=
"center"
></el-table-column>
<el-table-column
prop=
"eaccount.mobile"
label=
"手机号"
:formatter=
"onColFormater"
align=
"center"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop=
"eaccount.personsSign"
label=
"身份证"
:formatter=
"onColFormater"
align=
"center"
></el-table-column>
<el-table-column
prop=
"eflowstatusname"
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=
"操作"
>
<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>
</template>
</el-table-column>
</el-table>
<div
style=
"width:100%;text-align: center;margin-top: 20px"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"search.currentPage"
:page-sizes=
"[10, 20, 50, 100]"
:page-size=
"search.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"search.total"
>
</el-pagination>
</div>
</div>
</div>
</el-card>
<el-dialog
width=
"730px"
:visible
.
sync=
"showEdit"
>
<div
slot=
"title"
>
<span
style=
"margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;"
>
录入协议
</span>
<div
style=
"width: 730px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"
></div>
</div>
<el-form
:model=
"aggreement"
:rules=
"rules"
ref=
"aggreement"
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;"
>
签约信息
</span>
</div>
<el-form-item
label=
"公司名称:"
prop=
"ecompanyName"
>
<el-select
v-model=
"aggreement.ecompanyName"
filterable
remote
clearable
reserve-keyword
style=
"width:340px;"
placeholder=
"请搜索公司名称"
@
change=
"nameChange2"
:remote-method=
"getCompanyNames2"
:loading=
"nameLoading2"
>
<el-option
v-for=
"item in nameList2"
:key=
"item.id"
:label=
"item.name"
:value=
"item.name"
>
<span
style=
"float: left;width:150px;"
>
{{ item.name }}
</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"姓名:"
prop=
"userName"
>
<el-input
v-model=
"aggreement.userName"
placeholder=
"请输入姓名"
maxlength=
"20"
style=
"width:340px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"手机号:"
prop=
"mobile"
>
<el-input
v-model=
"aggreement.mobile"
placeholder=
"请输入手机号"
maxlength=
"20"
style=
"width:340px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"身份证:"
prop=
"personsSign"
>
<el-input
v-model=
"aggreement.personsSign"
placeholder=
"请输入手机号"
maxlength=
"30"
style=
"width:340px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"银行卡号:"
prop=
"bankno"
>
<el-input
v-model=
"aggreement.bankno"
placeholder=
"请输入手机号"
maxlength=
"50"
style=
"width:340px;"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"签约协议:"
prop=
"fileurl"
>
<gsb-upload3
ref=
"upload3"
v-model=
"uploadResult"
@
uploadsuccess=
"uploadsuccess"
filetype=
"pdf"
></gsb-upload3>
</el-form-item>
</el-form>
<div
style=
"margin-left: 226px;"
>
<el-button
:loading=
"submitLoading"
@
click=
"save"
style=
"width:120px;height:36px; background:#54C4A7; border-radius:4px;color: #FFFFFF;font-size: 16px;padding-top: 10px;"
>
保存
</el-button>
</div>
</el-dialog>
<el-dialog
width=
"730px"
:visible
.
sync=
"showAutoEdit"
>
<div
slot=
"title"
>
<span
style=
"margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;"
>
批量签约
</span>
<div
style=
"width: 730px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"
></div>
</div>
<el-form
:model=
"autoAggreement"
:rules=
"rules"
ref=
"autoAggreement"
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;"
>
签约信息
</span>
</div>
<el-form-item
label=
"模板名称:"
prop=
"etemplateName"
>
<el-select
v-model=
"autoAggreement.etemplateName"
filterable
remote
clearable
reserve-keyword
style=
"width:340px;"
placeholder=
"请搜索模板名称"
@
change=
"autoNameChange2"
:remote-method=
"getTemplateNames2"
:loading=
"autoNameLoading2"
>
<el-option
v-for=
"item in autoNameList2"
:key=
"item.id"
:label=
"item.name"
:value=
"item.name"
>
<span
style=
"float: left;width:150px;"
>
{{ item.name }}
</span>
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="签约协议:" prop="fileurl">
<gsb-upload3 ref="upload3" v-model="autoUploadResult" @uploadsuccess="autoUpload" filetype="pdf"></gsb-upload3>
</el-form-item> -->
<el-form-item
label=
"签约人员:"
prop=
"fileFourElement"
>
<gsb-upload3
ref=
"upload4"
v-model=
"autoUploadResult"
@
uploadsuccess=
"autoUploadFourElement"
filetype=
"xlsx"
></gsb-upload3>
<a
href=
"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_887156480901876320193131018763autosign.xlsx"
download=
"四要素.xlsx"
target=
"_blank"
>
下载模板
</a>
</el-form-item>
</el-form>
</el-form>
<div
style=
"margin-left: 226px;"
>
<el-button
:loading=
"submitLoading"
@
click=
"autoSave"
style=
"width:120px;height:36px; background:#54C4A7; border-radius:4px;color: #FFFFFF;font-size: 16px;padding-top: 10px;"
>
保存
</el-button>
</div>
</el-dialog>
</div>
</gsb-pcpage>
\ No newline at end of file
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.js
0 → 100644
View file @
cbe24048
{
template
:
'${tmpl}'
,
data
:
function
()
{
var
validMethod
=
(
rule
,
value
,
callback
)
=>
{
return
this
.
validfileds
(
rule
,
value
,
callback
);
};
return
{
showDetail
:
false
,
showEdit
:
false
,
showAutoEdit
:
false
,
selname
:
""
,
submitLoading
:
false
,
isFirstEdit
:
true
,
eduTypeList
:
[],
search
:
{
list
:
[],
currentPage
:
1
,
pageSize
:
20
,
total
:
0
,
ecompany_id
:
''
,
accountName
:
''
,
accountMobile
:
''
,
accountIdno
:
''
,
signBegin
:
''
,
signEnd
:
''
,
},
rules
:
{
ecompanyName
:
[
{
required
:
true
,
message
:
'请输入公司名称'
,
trigger
:
'blur'
},
{
validator
:
validMethod
,
trigger
:
'blur'
}
],
userName
:
[
{
required
:
true
,
message
:
'请输入姓名'
,
trigger
:
'blur'
},
],
mobile
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validMethod
,
trigger
:
'blur'
}
],
personsSign
:
[
{
required
:
true
,
message
:
'请输入身份证'
,
trigger
:
'blur'
},
],
bankno
:
[
{
required
:
true
,
message
:
'请输入银行卡'
,
trigger
:
'blur'
},
],
fileurl
:
[
{
required
:
true
,
message
:
'请上传签约协议'
,
trigger
:
'blur'
},
],
fileFourElement
:
[
{
required
:
true
,
message
:
'请上传签约人员'
,
trigger
:
'blur'
},
],
a
:
[],
etemplateName
:
[
{
required
:
true
,
message
:
'请输入模板名称'
,
trigger
:
'blur'
},
{
validator
:
validMethod
,
trigger
:
'blur'
}
],
},
nameLoading
:
false
,
nameList
:
[],
nameMap
:[],
nameLoading2
:
false
,
nameList2
:
[],
nameMap2
:[],
uploadResult
:
null
,
autoNameLoading2
:
false
,
autoNameList2
:
[],
autoNameMap2
:[],
aggreement
:
{},
autoAggreement
:
{},
autoUploadResult
:
null
,
}
},
mounted
:
function
()
{
this
.
resetSearch
();
},
created
:
function
()
{},
methods
:
{
getEmptySearch
()
{
return
{
list
:
[],
currentPage
:
1
,
pageSize
:
20
,
total
:
0
,
ecompany_id
:
''
,
accountName
:
''
,
accountMobile
:
''
,
accountIdno
:
''
,
signBegin
:
''
,
signEnd
:
''
,
}
},
resetSearch
()
{
this
.
search
=
this
.
getEmptySearch
();
this
.
selname
=
""
;
this
.
getList
();
},
tableHeaderColor
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
rowIndex
===
0
)
{
return
'background-color: #F5F5F5;color: #2F2F2F;font-size: 14px;font-weight:400;'
}
},
opSearch
()
{
this
.
getList
();
},
getList
()
{
var
self
=
this
;
this
.
$root
.
postReq
(
"/web/entcontractCtl/allList2"
,
{
search
:
self
.
getParams
()
}).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
self
.
search
.
list
=
d
.
data
.
rows
||
[];
self
.
search
.
total
=
d
.
data
.
count
||
0
;
}
else
{}
});
},
getParams
()
{
var
params
=
{};
for
(
var
f
in
this
.
search
)
{
if
(
f
==
"list"
)
{
continue
;
}
params
[
f
]
=
this
.
search
[
f
];
}
return
params
;
},
exportList
()
{
window
.
open
(
"/web/entcontractCtl/allExport"
+
this
.
getExportParams
());
},
getExportParams
()
{
var
params
=
{};
for
(
var
f
in
this
.
search
)
{
if
(
f
==
"list"
)
{
continue
;
}
params
[
f
]
=
this
.
search
[
f
];
}
return
"?search="
+
encodeURIComponent
(
JSON
.
stringify
(
params
));
},
onColFormater
(
row
,
column
,
cellValue
,
index
)
{
return
cellValue
||
"---"
;
},
handleSizeChange
(
val
)
{
this
.
search
.
pageSize
=
val
;
this
.
resetSearch
();
},
handleCurrentChange
(
val
)
{
this
.
search
.
currentPage
=
val
;
this
.
getList
();
},
validfileds
(
rule
,
value
,
callback
)
{
var
self
=
this
;
if
(
rule
.
field
==
'name'
)
{
if
(
!
self
.
intention
.
name
)
{
return
callback
(
new
Error
(
"请输入客户名称"
));
}
self
.
$root
.
postReq
(
"/web/eintentionCtl/validName"
,
{
name
:
self
.
intention
.
name
}).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
return
callback
();
}
else
{
return
callback
(
new
Error
(
d
.
msg
));
}
});
}
else
{
return
callback
();
}
if
(
rule
.
field
==
"ecompanyName"
)
{
if
(
!
self
.
aggreement
.
ecompany_id
)
{
return
callback
(
new
Error
(
"请重新选择公司名称"
));
}
}
if
(
rule
.
field
==
"mobile"
)
{
if
(
!
/^
(
1
)\d{10}
$/
.
text
(
self
.
aggreement
.
mobile
))
{
return
callback
(
new
Error
(
"请输入公司名称"
));
}
}
},
changeStatus
()
{
this
.
curStatus
=
this
.
search
.
applyStatus
;
this
.
search
.
currentPage
=
1
;
this
.
search
.
pageSize
=
20
;
this
.
search
.
total
=
0
;
this
.
getList
();
},
openEdit
()
{
var
self
=
this
;
self
.
nameList
=
[];
self
.
aggreement
=
{};
self
.
showEdit
=
true
;
if
(
self
.
isFirstEdit
)
{
self
.
isFirstEdit
=
false
;
}
else
{
self
.
$refs
.
aggreement
.
resetFields
();
self
.
clearUpload
();
}
},
autoOpenEdit
()
{
var
self
=
this
;
self
.
autoAggreement
=
{};
self
.
showAutoEdit
=
true
;
self
.
autoClearUpload
();
},
nameChange
(
val
)
{
console
.
log
(
val
,
"------------------------- "
);
var
self
=
this
;
var
item
=
self
.
nameMap
[
val
];
self
.
search
.
entcompany_id
=
(
item
||
{}).
id
||
""
;
},
nameChange2
(
val
)
{
var
self
=
this
;
var
item
=
self
.
nameMap2
[
val
];
self
.
aggreement
.
entcompany_id
=
(
item
||
{}).
id
||
""
;
console
.
log
(
val
,
self
.
aggreement
.
entcompany_id
,
"------------------------- "
);
},
autoNameChange2
(
val
)
{
var
self
=
this
;
var
item
=
self
.
autoNameMap2
[
val
];
self
.
autoAggreement
.
etemplate_id
=
(
item
||
{}).
id
||
""
;
console
.
log
(
val
,
self
.
autoAggreement
.
etemplate_id
,
"---------22222222222---------------- "
);
},
save
()
{
var
self
=
this
;
self
.
submitLoading
=
true
;
self
.
$refs
.
aggreement
.
validate
((
valid
)
=>
{
if
(
valid
)
{
setTimeout
(()
=>
{
self
.
submitLoading
=
false
;
},
5000
);
self
.
$root
.
postReq
(
"/web/entcontractCtl/saveOffline"
,
self
.
aggreement
).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
self
.
getList
();
self
.
$confirm
(
"保存成功,继续录入下一条?"
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'success'
}).
then
(()
=>
{
self
.
aggreement
=
{};
self
.
clearUpload
();
}).
catch
(()
=>
{
self
.
showEdit
=
false
;
});
}
else
{
self
.
$alert
(
d
.
msg
||
'保存失败'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{}
});
}
self
.
submitLoading
=
false
;
});
}
else
{
self
.
submitLoading
=
false
;
return
false
;
}
});
},
autoSave
()
{
var
self
=
this
;
self
.
submitLoading
=
true
;
self
.
$refs
.
autoAggreement
.
validate
((
valid
)
=>
{
self
.
submitLoading
=
false
;
if
(
valid
)
{
var
list
=
self
.
autoAggreement
.
autoExcel
||
[];
var
d
=
3
*
list
.
length
;
const
loading
=
self
.
$loading
({
lock
:
true
,
text
:
'正在签约,请耐心等待,大约需要'
+
d
+
'秒后签约完成'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.7)'
});
self
.
$root
.
postReq
(
"/web/entcontractCtl/autoSaveOffline"
,
self
.
autoAggreement
).
then
(
function
(
d
)
{
loading
.
close
();
if
(
d
.
status
==
0
)
{
self
.
getList
();
self
.
autoClearUpload
();
self
.
showAutoEdit
=
false
;
self
.
$alert
(
'批量录入成功'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{}
});
}
else
{
self
.
$alert
(
d
.
msg
||
'保存失败'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{}
});
}
});
}
else
{
return
false
;
}
});
},
getCompanyNames
(
query
)
{
var
self
=
this
;
self
.
nameLoading
=
true
;
self
.
$root
.
postReq
(
"/web/ecompanyCtl/suggest"
,
{
name
:
query
}).
then
(
function
(
d
)
{
self
.
nameLoading
=
false
;
self
.
nameList
=
d
.
data
||
[];
self
.
nameMap
=
[];
for
(
var
item
of
self
.
nameList
)
{
self
.
nameMap
[
item
.
name
]
=
item
;
}
});
setTimeout
(()
=>
{
self
.
nameLoading
=
false
;
},
15000
);
},
getCompanyNames2
(
query
)
{
var
self
=
this
;
self
.
nameLoading2
=
true
;
self
.
$root
.
postReq
(
"/web/ecompanyCtl/suggest"
,
{
name
:
query
}).
then
(
function
(
d
)
{
self
.
nameLoading2
=
false
;
self
.
nameList2
=
d
.
data
||
[];
self
.
nameMap2
=
[];
for
(
var
item
of
self
.
nameList2
)
{
self
.
nameMap2
[
item
.
name
]
=
item
;
}
});
setTimeout
(()
=>
{
self
.
nameLoading2
=
false
;
},
15000
);
},
getTemplateNames2
(
query
)
{
var
self
=
this
;
self
.
autoNameLoading2
=
true
;
self
.
$root
.
postReq
(
"/web/etemplateCtl/getListByName"
,
{
name
:
query
}).
then
(
function
(
d
)
{
self
.
autoNameLoading2
=
false
;
self
.
autoNameList2
=
d
.
data
||
[];
self
.
autoNameMap2
=
[];
for
(
var
item
of
self
.
autoNameList2
)
{
self
.
autoNameMap2
[
item
.
name
]
=
item
;
}
});
setTimeout
(()
=>
{
self
.
autoNameLoading2
=
false
;
},
15000
);
},
clearUpload
()
{
var
self
=
this
;
self
.
uploadResult
=
null
;
self
.
aggreement
.
fileurl
=
""
;
if
(
self
.
$refs
.
upload3
&&
self
.
$refs
.
upload3
.
$refs
&&
self
.
$refs
.
upload3
.
$refs
.
upload
)
{
self
.
$refs
.
upload3
.
$refs
.
upload
.
clearFiles
();
}
},
autoClearUpload
()
{
var
self
=
this
;
self
.
autoUploadResult
=
null
;
self
.
autoAggreement
.
fileurl
=
""
;
self
.
autoAggreement
.
fileFourElement
=
""
;
self
.
$refs
.
upload3
.
$refs
.
upload
.
clearFiles
();
self
.
$refs
.
upload4
.
$refs
.
upload
.
clearFiles
();
},
uploadsuccess
(
v
)
{
if
(
!
v
||
!
v
[
0
]
||
!
v
[
0
].
url
)
{
this
.
$message
.
warning
(
"上传失败"
);
return
;
}
this
.
aggreement
.
fileurl
=
v
[
0
].
url
;
},
autoUpload
(
v
)
{
if
(
!
v
||
!
v
[
0
]
||
!
v
[
0
].
url
)
{
this
.
$message
.
warning
(
"上传失败"
);
return
;
}
this
.
autoAggreement
.
fileurl
=
v
[
0
].
url
;
},
autoUploadFourElement
(
v
)
{
if
(
!
v
||
!
v
[
0
]
||
!
v
[
0
].
url
)
{
this
.
$message
.
warning
(
"上传失败"
);
return
;
}
this
.
autoAggreement
.
fileFourElement
=
v
[
0
].
url
;
this
.
parseExcel
();
},
parseExcel
()
{
var
self
=
this
;
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
'正在解析签约人员'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.7)'
});
self
.
$root
.
postReq
(
"/web/usereaccountCtl/parseItems"
,
{
url
:
self
.
autoAggreement
.
fileFourElement
}).
then
(
function
(
d
)
{
loading
.
close
();
if
(
d
.
status
==
0
)
{
var
itemlist
=
(
d
.
data
||
{}).
list
;
self
.
autoAggreement
.
autoExcel
=
itemlist
;
console
.
log
(
itemlist
,
"************22222222222222*****************"
);
}
else
{
/* self.autoClearUpload();*/
self
.
$alert
(
d
.
msg
||
"文件解析失败"
,
'提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{}
});
}
});
},
downloadContractUrl
(
id
)
{
var
self
=
this
;
self
.
$root
.
postReq
(
"/web/entcontractCtl/downloadContractUrl"
,
{
id
:
id
}).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
&&
d
.
data
)
{
window
.
open
(
d
.
data
);
}
else
{
self
.
$message
.
warning
(
d
.
msg
||
"上传失败"
);
}
});
},
toHand
(
id
)
{
alert
(
id
);
},
},
vname
:
"gsb-econtractall2"
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment