作者 金洪杰

签名

@@ -319,19 +319,16 @@ class Ajax extends TeacherBase @@ -319,19 +319,16 @@ class Ajax extends TeacherBase
319 $teacher_name = $this->auth['username']; 319 $teacher_name = $this->auth['username'];
320 $teacher_id = $this->auth['id']; 320 $teacher_id = $this->auth['id'];
321 $detail = Db::table('fa_project_register')->where(['id' => $id])->find(); 321 $detail = Db::table('fa_project_register')->where(['id' => $id])->find();
322 - if ($detail['review_stage'] != 0) $this->error('用户项目数据不在立项评审阶段');  
323 - if ($detail['project_approval_status'] != 0) $this->error('用户项目数据不在立项审核阶段'); 322 + if ($detail['review_stage'] != 0) $this->error('用户项目数据已审核过');
  323 + if ($detail['project_approval_status'] != 0) $this->error('用户项目数据已审核过');
324 if (!$detail) $this->error('项目数据异常'); 324 if (!$detail) $this->error('项目数据异常');
325 //判断是否是审核成员 325 //判断是否是审核成员
326 $member_ids = Db::table('fa_members') 326 $member_ids = Db::table('fa_members')
327 - ->alias('m')  
328 -// ->field('m.container_id,m.member_id')  
329 -// ->join('fa_project_register p','m.container_id = p.container_id and m.item_id = p.id','LEFT')  
330 - ->where(['m.member_type' => 2 ,'m.member_source' => 2,'m.item_id' => $id]) 327 + ->where(['member_type' => 2 ,'member_source' => 2,'item_id' => $id])
331 ->column('member_id'); 328 ->column('member_id');
332 if (!in_array($teacher_id,$member_ids)) $this->error('当前用户不是该项目审核人员'); 329 if (!in_array($teacher_id,$member_ids)) $this->error('当前用户不是该项目审核人员');
333 $opinion = input('opinion');//意见 330 $opinion = input('opinion');//意见
334 - $type = input('type');//审核 1:通过 2:退回 331 + $project_type = input('type');//审核 1:通过 2:退回
335 $imgbase64 = input('imgbase64'); 332 $imgbase64 = input('imgbase64');
336 $file_url = ''; 333 $file_url = '';
337 //图片上传 334 //图片上传
@@ -355,7 +352,7 @@ class Ajax extends TeacherBase @@ -355,7 +352,7 @@ class Ajax extends TeacherBase
355 //通过:project_approval_status => 1 退回:project_status => 2 352 //通过:project_approval_status => 1 退回:project_status => 2
356 $data['signature_url'] = $file_url; 353 $data['signature_url'] = $file_url;
357 $data['updatetime'] = time(); 354 $data['updatetime'] = time();
358 - if ($type == 2){ 355 + if ($project_type == 2){
359 $data['project_status'] = 2; 356 $data['project_status'] = 2;
360 $msg = '退回'; 357 $msg = '退回';
361 }else{ 358 }else{
@@ -401,7 +398,6 @@ class Ajax extends TeacherBase @@ -401,7 +398,6 @@ class Ajax extends TeacherBase
401 ]); 398 ]);
402 } 399 }
403 400
404 -  
405 $this->success('操作成功',$file_url); 401 $this->success('操作成功',$file_url);
406 } 402 }
407 $this->view->assign('id',$id); 403 $this->view->assign('id',$id);
@@ -34,14 +34,14 @@ @@ -34,14 +34,14 @@
34 </body> 34 </body>
35 35
36 <script> 36 <script>
37 - function sureWriteCallback(imageBase64){ 37 + function sureWriteCallback(imageBase64,type){
38 // 签名完成后的的逻辑代码 38 // 签名完成后的的逻辑代码
39 $.ajax({ 39 $.ajax({
40 type : "POST", //提交方式 40 type : "POST", //提交方式
41 url : "canvas",//路径 41 url : "canvas",//路径
42 data : { 42 data : {
43 "imgbase64" : imageBase64, 43 "imgbase64" : imageBase64,
44 - 'type' : 1, 44 + 'type' : type,
45 'id' : $('#id').val(), 45 'id' : $('#id').val(),
46 'opinion' : $('#opinion').val() 46 'opinion' : $('#opinion').val()
47 },//数据,这里使用的是Json格式进行传输 47 },//数据,这里使用的是Json格式进行传输
@@ -55,10 +55,12 @@ @@ -55,10 +55,12 @@
55 } 55 }
56 }) 56 })
57 } 57 }
  58 +
58 let params = { 59 let params = {
59 whiteBord:'whiteBord',//canvas标签的id名称 60 whiteBord:'whiteBord',//canvas标签的id名称
60 againWrite:'againWrite',//重写按钮id名 61 againWrite:'againWrite',//重写按钮id名
61 sureWrite:'sureWrite',//确认按钮id名 62 sureWrite:'sureWrite',//确认按钮id名
  63 + back:'back',//退回按钮id名
62 whiteBordPtions:{},//白板的配置项(空对象时取默认值) 64 whiteBordPtions:{},//白板的配置项(空对象时取默认值)
63 sureWriteCallback,// 签名完成后的回调函数 65 sureWriteCallback,// 签名完成后的回调函数
64 } 66 }
@@ -10,10 +10,11 @@ @@ -10,10 +10,11 @@
10 * @returns 签名的图片:格式base64 10 * @returns 签名的图片:格式base64
11 */ 11 */
12 function signature(params) { 12 function signature(params) {
13 - let {whiteBord,againWrite,sureWrite,whiteBordPtions,sureWriteCallback} = params 13 + let {whiteBord,againWrite,sureWrite,back,whiteBordPtions,sureWriteCallback} = params
14 let whiteBoardDom = document.getElementById(whiteBord); 14 let whiteBoardDom = document.getElementById(whiteBord);
15 let againWriteBtn = document.getElementById(againWrite) 15 let againWriteBtn = document.getElementById(againWrite)
16 let sureWriteBtn = document.getElementById(sureWrite) 16 let sureWriteBtn = document.getElementById(sureWrite)
  17 + let backBtn = document.getElementById(back)
17 18
18 let writeCanvas; 19 let writeCanvas;
19 let imageBase64='' 20 let imageBase64=''
@@ -21,7 +22,10 @@ function signature(params) { @@ -21,7 +22,10 @@ function signature(params) {
21 drawClear() 22 drawClear()
22 }) 23 })
23 sureWriteBtn.addEventListener('click', function () { 24 sureWriteBtn.addEventListener('click', function () {
24 - savePict() 25 + savePict(1)
  26 + })
  27 + backBtn.addEventListener('click', function () {
  28 + savePict(2)
25 }) 29 })
26 function WriteFont(options) { 30 function WriteFont(options) {
27 let obj = { 31 let obj = {
@@ -156,10 +160,10 @@ function signature(params) { @@ -156,10 +160,10 @@ function signature(params) {
156 */ 160 */
157 writeCanvas = new WriteFont('whiteBord', whiteBordPtions); 161 writeCanvas = new WriteFont('whiteBord', whiteBordPtions);
158 162
159 - function savePict() { 163 + function savePict(type) {
160 imageBase64 = whiteBoardDom.toDataURL("image/png"); //base64 164 imageBase64 = whiteBoardDom.toDataURL("image/png"); //base64
161 writeCanvas.option.control.clearCanvas(); 165 writeCanvas.option.control.clearCanvas();
162 - sureWriteCallback(imageBase64) 166 + sureWriteCallback(imageBase64,type)
163 } 167 }
164 function drawClear() { 168 function drawClear() {
165 writeCanvas.option.control.clearCanvas(); 169 writeCanvas.option.control.clearCanvas();