Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3be41f24
authored
2023-08-28 17:23:05 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:证书预览
1 parent
38c90d66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
43 deletions
src/views/workflow/components/dialog/zsdy.vue
src/views/workflow/components/dialog/zsyl.vue
src/views/workflow/components/dialog/zsdy.vue
View file @
3be41f2
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-08-28 1
4:14:09
* @LastEditTime: 2023-08-28 1
7:22:23
-->
<
template
>
<div>
...
...
@@ -30,7 +30,7 @@
</el-tabs>
<el-empty
description=
"暂无数据"
v-if=
"headTabBdcqz.length == 0 && noData"
></el-empty>
<div
class=
"zs-content"
style=
"width:1180px;"
>
<div
class=
"zs-content"
>
<canvas
ref=
"zs"
width=
"1000"
v-show=
"headTabBdcqz[0]&&headTabBdcqz[0].bdcqzlx==1"
height=
"700"
></canvas>
<canvas
ref=
"zm"
width=
"1180"
v-show=
"headTabBdcqz[0]&&headTabBdcqz[0].bdcqzlx!=1"
height=
"780"
></canvas>
</div>
...
...
@@ -417,7 +417,49 @@
context
.
fillText
(
this
.
bdcqz
.
qlr
?
this
.
bdcqz
.
qlr
:
''
,
775
,
228
);
// 义务人
context
.
fillText
(
this
.
bdcqz
.
ywr
?
this
.
bdcqz
.
ywr
:
''
,
775
,
275
);
context
.
fillText
(
this
.
bdcqz
.
zl
?
this
.
bdcqz
.
zl
:
''
,
775
,
325
);
// context.fillText(this.bdcqz.zl ? this.bdcqz.zl : '', 775, 325);
let
lines2
=
this
.
bdcqz
.
zl
?
this
.
bdcqz
.
zl
.
split
(
' '
)
:
[];
if
(
getByteLen
(
this
.
bdcqz
.
zl
)
>
41
)
{
lines2
.
forEach
((
line
,
index
)
=>
{
const
y
=
315
+
(
index
*
20
);
// 每行文本的垂直位置
let
currentLine
=
''
;
let
arr
=
[];
for
(
let
word
of
line
)
{
const
testLine
=
currentLine
+
word
;
const
lineWidth
=
context
.
measureText
(
testLine
).
width
;
if
(
lineWidth
<=
295
)
{
currentLine
=
testLine
;
}
else
{
arr
.
push
(
currentLine
);
currentLine
=
word
;
}
}
arr
.
push
(
currentLine
);
arr
.
forEach
((
line
,
index
)
=>
{
context
.
fillText
(
line
,
775
,
y
+
(
index
*
20
));
// 调整行高
})
})
}
else
{
lines2
.
forEach
((
line
,
index
)
=>
{
const
y
=
325
+
(
index
*
20
);
// 每行文本的垂直位置
let
currentLine
=
''
;
let
arr
=
[];
for
(
let
word
of
line
)
{
const
testLine
=
currentLine
+
word
;
const
lineWidth
=
context
.
measureText
(
testLine
).
width
;
if
(
lineWidth
<=
295
)
{
currentLine
=
testLine
;
}
else
{
arr
.
push
(
currentLine
);
currentLine
=
word
;
}
}
arr
.
push
(
currentLine
);
arr
.
forEach
((
line
,
index
)
=>
{
context
.
fillText
(
line
,
775
,
y
+
(
index
*
20
));
// 调整行高
})
})
}
// bdcdyh
this
.
bdcdyh
=
this
.
bdcqz
.
bdcdyh
.
slice
(
0
,
6
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
6
,
12
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
12
,
19
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
19
,
this
.
bdcqz
.
bdcdyh
.
length
)
...
...
@@ -519,24 +561,18 @@
if
(
this
.
bdcqz
.
bdcqzlx
==
1
)
{
getPrintTemplateByCode
({
tmpno
:
'zsdy'
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
getSlsqBdcqzList
({
bsmSlsq
:
this
.
formData
.
bsmSlsq
}).
then
(
infoRes
=>
{
if
(
infoRes
.
code
==
200
)
{
if
(
infoRes
.
result
&&
infoRes
.
result
.
length
>
0
)
{
//打开模板设计
let
LODOP
=
getLodop
(
document
.
getElementById
(
'LODOP_OB'
),
document
.
getElementById
(
'LODOP_EM'
));
LODOP
.
ADD_PRINT_DATA
(
"ProgramData"
,
res
.
result
.
tmpcontent
);
//装载模板
//打开模板设计
let
LODOP
=
getLodop
(
document
.
getElementById
(
'LODOP_OB'
),
document
.
getElementById
(
'LODOP_EM'
));
LODOP
.
ADD_PRINT_DATA
(
"ProgramData"
,
res
.
result
.
tmpcontent
);
//装载模板
infoRes
.
result
[
0
].
bdcdyh1
=
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
0
,
6
)
+
' '
+
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
6
,
12
)
+
' '
+
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
12
,
19
)
+
' '
+
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
19
,
infoRes
.
result
[
0
].
bdcdyh
.
length
)
//todo 调取后端接口获取数据 循环set
for
(
let
key
in
infoRes
.
result
[
0
])
{
LODOP
.
SET_PRINT_STYLEA
(
key
,
"CONTENT"
,
infoRes
.
result
[
0
][
key
]);
}
LODOP
.
PREVIEW
();
that
.
$popupCacel
()
}
}
})
this
.
bdcqz
.
bdcdyh1
=
this
.
bdcqz
.
bdcdyh
.
slice
(
0
,
6
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
6
,
12
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
12
,
19
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
19
,
this
.
bdcqz
.
bdcdyh
.
length
)
//todo 调取后端接口获取数据 循环set
for
(
let
key
in
this
.
bdcqz
)
{
LODOP
.
SET_PRINT_STYLEA
(
key
,
"CONTENT"
,
this
.
bdcqz
[
key
]);
}
LODOP
.
PREVIEW
();
that
.
$popupCacel
()
}
else
{
this
.
$message
.
error
(
res
.
message
)
}
...
...
@@ -544,28 +580,22 @@
}
else
{
getPrintTemplateByCode
({
tmpno
:
'zmdy'
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
getSlsqBdcqzList
({
bsmSlsq
:
this
.
formData
.
bsmSlsq
}).
then
(
infoRes
=>
{
if
(
infoRes
.
code
==
200
)
{
if
(
infoRes
.
result
&&
infoRes
.
result
.
length
>
0
)
{
//打开模板设计
let
LODOP
=
getLodop
(
document
.
getElementById
(
'LODOP_OB'
),
document
.
getElementById
(
'LODOP_EM'
));
LODOP
.
ADD_PRINT_DATA
(
"ProgramData"
,
res
.
result
.
tmpcontent
);
//装载模板
//打开模板设计
let
LODOP
=
getLodop
(
document
.
getElementById
(
'LODOP_OB'
),
document
.
getElementById
(
'LODOP_EM'
));
LODOP
.
ADD_PRINT_DATA
(
"ProgramData"
,
res
.
result
.
tmpcontent
);
//装载模板
// 年月日
infoRes
.
result
[
0
].
nian
=
infoRes
.
result
[
0
].
djsj
.
split
(
' '
)[
0
].
split
(
'/'
)[
0
]
infoRes
.
result
[
0
].
yue
=
infoRes
.
result
[
0
].
djsj
.
split
(
' '
)[
0
].
split
(
'/'
)[
1
]
infoRes
.
result
[
0
].
ri
=
infoRes
.
result
[
0
].
djsj
.
split
(
' '
)[
0
].
split
(
'/'
)[
1
]
infoRes
.
result
[
0
].
bdcdyh1
=
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
0
,
6
)
+
' '
+
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
6
,
12
)
+
' '
+
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
12
,
19
)
+
' '
+
infoRes
.
result
[
0
].
bdcdyh
.
slice
(
19
,
infoRes
.
result
[
0
].
bdcdyh
.
length
)
//todo 调取后端接口获取数据 循环set
for
(
let
key
in
infoRes
.
result
[
0
])
{
LODOP
.
SET_PRINT_STYLEA
(
key
,
"CONTENT"
,
infoRes
.
result
[
0
][
key
]);
}
LODOP
.
PREVIEW
();
that
.
$popupCacel
()
}
}
})
// 年月日
this
.
bdcqz
.
nian
=
this
.
bdcqz
.
djsj
.
split
(
' '
)[
0
].
split
(
'/'
)[
0
]
this
.
bdcqz
.
yue
=
this
.
bdcqz
.
djsj
.
split
(
' '
)[
0
].
split
(
'/'
)[
1
]
this
.
bdcqz
.
ri
=
this
.
bdcqz
.
djsj
.
split
(
' '
)[
0
].
split
(
'/'
)[
1
]
this
.
bdcqz
.
bdcdyh1
=
this
.
bdcqz
.
bdcdyh
.
slice
(
0
,
6
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
6
,
12
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
12
,
19
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
19
,
this
.
bdcqz
.
bdcdyh
.
length
)
//todo 调取后端接口获取数据 循环set
for
(
let
key
in
this
.
bdcqz
)
{
LODOP
.
SET_PRINT_STYLEA
(
key
,
"CONTENT"
,
this
.
bdcqz
[
key
]);
}
LODOP
.
PREVIEW
();
that
.
$popupCacel
()
}
else
{
this
.
$message
.
error
(
res
.
message
)
}
...
...
src/views/workflow/components/dialog/zsyl.vue
View file @
3be41f2
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-08-28 1
3:57:58
* @LastEditTime: 2023-08-28 1
7:18:19
-->
<
template
>
<div
class=
"from-clues loadingtext"
v-Loading=
"loading"
element-loading-text=
"拼命加载中..."
style=
"height:720px;text-align: center;"
>
...
...
@@ -388,7 +388,52 @@
context
.
fillText
(
this
.
bdcqz
.
qlr
?
this
.
bdcqz
.
qlr
:
''
,
775
,
228
);
// 义务人
context
.
fillText
(
this
.
bdcqz
.
ywr
?
this
.
bdcqz
.
ywr
:
''
,
775
,
275
);
context
.
fillText
(
this
.
bdcqz
.
zl
?
this
.
bdcqz
.
zl
:
''
,
775
,
325
);
// context.fillText(this.bdcqz.zl ? this.bdcqz.zl : '', 775, 325);
let
lines2
=
this
.
bdcqz
.
zl
?
this
.
bdcqz
.
zl
.
split
(
' '
)
:
[];
if
(
getByteLen
(
this
.
bdcqz
.
zl
)
>
41
)
{
lines2
.
forEach
((
line
,
index
)
=>
{
const
y
=
315
+
(
index
*
20
);
// 每行文本的垂直位置
let
currentLine
=
''
;
let
arr
=
[];
for
(
let
word
of
line
)
{
const
testLine
=
currentLine
+
word
;
const
lineWidth
=
context
.
measureText
(
testLine
).
width
;
if
(
lineWidth
<=
295
)
{
currentLine
=
testLine
;
}
else
{
arr
.
push
(
currentLine
);
currentLine
=
word
;
}
}
arr
.
push
(
currentLine
);
arr
.
forEach
((
line
,
index
)
=>
{
context
.
fillText
(
line
,
775
,
y
+
(
index
*
20
));
// 调整行高
})
})
}
else
{
lines2
.
forEach
((
line
,
index
)
=>
{
const
y
=
325
+
(
index
*
20
);
// 每行文本的垂直位置
let
currentLine
=
''
;
let
arr
=
[];
for
(
let
word
of
line
)
{
const
testLine
=
currentLine
+
word
;
const
lineWidth
=
context
.
measureText
(
testLine
).
width
;
if
(
lineWidth
<=
295
)
{
currentLine
=
testLine
;
}
else
{
arr
.
push
(
currentLine
);
currentLine
=
word
;
}
}
arr
.
push
(
currentLine
);
arr
.
forEach
((
line
,
index
)
=>
{
context
.
fillText
(
line
,
775
,
y
+
(
index
*
20
));
// 调整行高
})
})
}
// bdcdyh
this
.
bdcdyh
=
this
.
bdcqz
.
bdcdyh
.
slice
(
0
,
6
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
6
,
12
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
12
,
19
)
+
' '
+
this
.
bdcqz
.
bdcdyh
.
slice
(
19
,
this
.
bdcqz
.
bdcdyh
.
length
)
...
...
Please
register
or
sign in
to post a comment