lvhao 4 месяцев назад
Родитель
Сommit
104beb11a2
2 измененных файлов с 47 добавлено и 2 удалено
  1. 23 1
      core/CoreApp/controllers/Zzququeu9.php
  2. 24 1
      template/erp/zzququeu9.html

+ 23 - 1
core/CoreApp/controllers/Zzququeu9.php

@@ -54,6 +54,10 @@ class Zzququeu9 extends Start_Controller {
           {
                $this->_mcindex();
           }
+          elseif($arg == 'scdel')//删除
+          {
+               $this->_del($arg_array);
+          }
           else
           {
                $this->_index();
@@ -251,7 +255,8 @@ class Zzququeu9 extends Start_Controller {
                          //'bzsh_no'=>$bzsh_no,
                         
                          'create_time'=>date("Y-m-d H:i:s",$v['create_time']),
-                         'update_time'=>date("Y-m-d H:i:s",$v['update_time'])
+                         'update_time'=>date("Y-m-d H:i:s",$v['update_time']),
+                         'operate'=>"<span data-action='dr' data-id='".$v['id']."' onclick='doDel(this)' style='background-color:red'>删除</span>"
                     ];
                }
 
@@ -924,4 +929,21 @@ class Zzququeu9 extends Start_Controller {
       }
      
     }
+
+    private function _del($arg_array){
+          $id = $arg_array[0];
+          $user = $this->user->get_api($_SESSION['api']);
+          if(!in_array($user['userid'],['ceshi','admin'])){
+               echo json_encode(array('msg'=>'权限不足,禁止删除!','success'=>false));
+          }
+          $info = $this->zzquque_u9->read($id);
+          //目前只删除小单的  在途的单子 不管对错都不处理留痕
+          if(($info['dc_status'] < 3) && ($info['type'] == 10)){
+               $this->zzquque_u9->remove($id);
+               echo json_encode(array('msg'=>'删除成功','success'=>true));
+          }else{
+               echo json_encode(array('msg'=>'不满足删除条件','success'=>true));
+          }
+          
+    }
 }

+ 24 - 1
template/erp/zzququeu9.html

@@ -80,6 +80,7 @@
                     <!-- <td>标准收货单</td> -->
                     <td>添加时间</td>
                     <td>最后更新时间</td>
+                    <td>操作</td>
                 </tr>
             </table>
         </div>
@@ -250,7 +251,29 @@
         window.location.href = url
     }
 
-     
+    function doDel(that){
+        let id = $(that).data("id")
+        layx.load('loadId','提交中,请稍后',{shadable:0.6});
+            $.ajax({
+                url:"/zzququeu9/scdel/"+id,
+                data:{},
+                type:"get",
+                dataType:"json",
+                success:function(a){
+                    layx.destroy('loadId');
+                    if (a && a.success) {
+                        $(".systemwindow div p:eq(0)").html(a.msg);
+                        $(".systemwindow div p:eq(1)").html("<font  onclick='doCheck()'>确 定</font>");
+                        $(".systemwindow").show();
+                    }else{
+                        $(".systemwindow div p:eq(0)").text(a.msg);
+                        $(".systemwindow div p:eq(1)").html("<p><font onclick='doCheck()'>确 定</font></p>");
+                        $(".systemwindow").show();
+                    }
+                }
+            })
+        
+    } 
     </script>
     <script type="text/javascript" src="{$theme}js/laydate.js"></script>
     <script type="text/javascript" src="{$theme}js/print.js?v=202007160001"></script>