Ver código fonte

修改选中导出

lvhao 6 meses atrás
pai
commit
f23a91d58b

+ 4 - 0
core/CoreApp/controllers/Returngoodsexcel.php

@@ -50,6 +50,7 @@ class Returngoodsexcel extends Start_Controller {
         $cate_two = $this->input->post('cate_two',true);
         $number = $this->input->post('number',true);
         $recorder = $this->input->post('recorder',true);
+        $sid = $this->input->post('sid',true);
         $where = " 1 = 1 ";
         try{
 
@@ -91,6 +92,9 @@ class Returngoodsexcel extends Start_Controller {
             {
                 $where  .= " and cate_two = '$cate_two'";
             }
+            if($sid){
+                $where = "id in (".implode(",",$sid).")";
+            }
             //数据排序
             $order_str = "id asc";
 

+ 12 - 1
template/erp/returngoods.html

@@ -289,7 +289,18 @@ function finish(that){
 function excelexport(){
     layx.load('loadId','请求中',{shadable:0.6});
    // return console.log($("form").serialize())
-   $.post("/returngoodsexcel/excel",$("form").serialize(),function(a){
+   
+   let select_list = [];
+   $("input[name=check]").each(function(){
+        if($(this).prop('checked')){
+            select_list.push($(this).val())
+        }
+   })
+   let form_data = $("form").serialize();
+   if(select_list.length > 0){
+        form_data = {sid:select_list}
+   }
+   $.post("/returngoodsexcel/excel",form_data,function(a){
         layx.destroy('loadId');
         if (a && a.success) {
                 if (a.data.length > 0){