canvas.html
6.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no,viewport-fit=cover">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta charset="utf-8">
<title>项目审核</title>
<link rel="stylesheet" href="http://i.gtimg.cn/vipstyle/frozenui/2.0.0/css/frozen.css">
<style>
[v-cloak] {
display: none;
}
canvas{
width: 100vh;
}
* {
margin: 0;
padding: 0;
}
html,
body {
width: 100%;
height: 100%;
text-align: center;
background-color: #FFFFFF;
}
canvas {
max-width: 100%;
border: 2px dotted #ccc;
}
.opinion {
width: 100%;
height: 235px;
font-size: 16px;
border: 1px solid #000;
}
.opinion::-webkit-input-placeholder {
line-height: 235px;
text-align: center;
}
/* 使用webkit内核的浏览器 */
.opinion:-moz-placeholder {
line-height: 235px;
text-align: center;
}
/* Firefox版本4-18 */
.opinion::-moz-placeholder {
line-height: 235px;
text-align: center;
}
/* Firefox版本19+ */
.opinion:-ms-input-placeholder {
line-height: 235px;
text-align: center;
}
/*elmeentui文本 textarea字体*/
.is-disabled .el-input__inner {
font-weight: bold !important;
font-size: 14px !important;
color: #4A5560 !important;
}
.is-disabled .el-textarea__inner {
font-weight: bold !important;
font-size: 14px !important;
color: #4A5560 !important;
}
.el-form-item__label {
color: black !important;
font-weight: bold !important;
}
</style>
</head>
<body>
<script src="__CDN__/assets/js/jquery-3.4.1.min.js"></script>
<script src="/assets/js/index.js"></script>
<script src="/assets/ele/vue.js"></script>
<link rel="stylesheet" href="__CDN__/assets/ele/element/element.css">
<script src="__CDN__/assets/ele/element/element.js"></script>
<script src="__CDN__/assets/ele/Sortable.min.js"></script>
<script src="__CDN__/assets/ele/vuedraggable.js"></script>
<script src="__CDN__/assets/ele/moment.js"></script>
<div id="app">
<input type="hidden" name="id" id="id" value="{$id}">
<div v-if="step==1" style="padding:0 15px;margin-top: 25px;">
<el-form size="mini">
<div>
<el-form-item label="审核状态">
<div>
<el-radio v-model="v_status" label="1" border>通过</el-radio>
<el-radio v-model="v_status" label="2" border>退回</el-radio>
</div>
</el-form-item>
</div>
<div>
<el-form-item label="审核意见">
<el-input type="textarea" rows="8" v-model="option"></el-input>
</el-form-item>
</div>
</el-form>
<button @click="draw" class="ui-btn-lg ui-btn-primary">确认</button>
</div>
<div v-if="step==3" class="buttons" style="position: absolute;left:15px;bottom:100px;">
<button type="button" style="width:40px;height:130px;background-color:#C2C7CC;" @click="clear" class="ui-btn clear">重签</button>
<button type="button" @click="toDetail" style="width:40px;height:130px;margin-top:8px" class="ui-btn ui-btn-primary ouput back">项目详情</button>
<button type="button" @click="pass" style="width:40px;height:130px;margin-top:10px" class="ui-btn ui-btn-primary ouput pass">确认签名</button>
</div>
</div>
<script>
new Vue({
el: '#app',
data: {
step: 1,
sign : null,
id : "{$id}",
option:'',
v_status:'1',
},
mounted(){
var _this = this;
},
methods:{
clear:function(){
this.sign.clear();
},
draw :function(){
this.step = 3;
//初始化
this.sign = sign = new Draw({
lineWidth: 10, // 线条宽度
width: 400, // canvas 宽
height: window.screen.height, //canvas 高
strokeStyle: '#333333' // 线条颜色
});
},
toDetail(){
var _this = this;
_this.sign.destroyed();
$('canvas').remove();
window.location.href = '/teacher/container/container_detail/detail_view?id=' + _this.id;
},
pass:function(){
var img = new Image();
img.style.width = '200px';
img.src = this.sign.ouput();
this.sureWriteCallback(this.sign.ouput(), 1);
},
sureWriteCallback:function(imageBase64, type) {
// 签名完成后的的逻辑代码
if(this.sign.state.undopath.length <= 0){
alert("还没有签名");
return false;
}
var _this = this;
$.ajax({
type: "POST", //提交方式
url: "canvas", //路径
data: {
"imgbase64": imageBase64,
'type': _this.v_status,
'id': _this.id,
'opinion': _this.option,
'status':_this.v_status
}, //数据,这里使用的是Json格式进行传输
success: function(data) {
alert(data.msg)
window.location.href = '/teacher/container/container_detail/detail_view?id=' + _this.id;
},
error: function(data) {
alert(data.msg)
}
})
}
}
})
</script>
</body>
</html>