Browse Source

导出excel跳转

曹鹤洋 2 years ago
parent
commit
572cac6c59
2 changed files with 33 additions and 17 deletions
  1. 14 0
      application/admin/controller/QcodeBach.php
  2. 19 17
      public/assets/js/backend/qcode_bach.js

+ 14 - 0
application/admin/controller/QcodeBach.php

@@ -611,6 +611,20 @@ class QcodeBach extends Backend
 
     }
 
+    /**
+     * 跳转
+     */
+    public function exp()
+    {
+        //获取产品配置菜单id
+        $bool = db('auth_rule')->field('id')->where('title','发货管理')->find();
+        if ($bool){
+            $this->success('成功','',$bool);
+        }else{
+            $this->error('未获取到菜单','',$bool);
+        }
+    }
+
     /**
      * 新增
      */

+ 19 - 17
public/assets/js/backend/qcode_bach.js

@@ -9,18 +9,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'LodopFuncs'], functi
 
 
             //绑定
-            // $('#exp').click(function (e) {
-            //     // var ids = $('#table1').bootstrapTable('getSelections')[0]['id'];
-            //
-            //     $.get('qcode_bach/vo2',{},function (data) {
-            //         // if(data.code==1){
-            //         //     Toastr.success(data.msg)
-            //         //     $('#table2').bootstrapTable('refresh');
-            //         // }else{
-            //         //     Toastr.error(data.msg)
-            //         // }
-            //     },'json');
+            $('#exp').click(function (e) {
 
+                $.get('qcode_bach/exp', {}, function (data) {
+                    if(data.code==1){
+                        top.window.$('[addtabs="'+data.data.id+'"]').trigger("click");
+                    }else{
+                        Toastr.error(data.msg)
+                    }
+                }, 'json');
+            })
+                // var ids = $('#table1').bootstrapTable('getSelections')[0]['id'];
                 // layer.confirm('确定提交选中的 1 项?!', {
                 //     btn: ['确定', '取消'],
                 //     cancel: function(index, layero) {
@@ -203,13 +202,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'LodopFuncs'], functi
                         ]
                     ],
                     onLoadSuccess:function(data){
-                        if(data.rows[0].l_num == null || data.rows[0].l_num == 0){
-                            $("#table2").bootstrapTable("hideColumn", "l_num"); // 设置隐藏列
-                            $("#table2").bootstrapTable("showColumn", "l_weight"); // 设置显示列
-                        }else{
-                            $("#table2").bootstrapTable("hideColumn", "l_weight"); // 设置隐藏列
-                            $("#table2").bootstrapTable("showColumn", "l_num"); // 设置显示列
+                        if (data.rows[0]!=undefined){
+                            if(data.rows[0].l_num == null || data.rows[0].l_num == 0){
+                                $("#table2").bootstrapTable("hideColumn", "l_num"); // 设置隐藏列
+                                $("#table2").bootstrapTable("showColumn", "l_weight"); // 设置显示列
+                            }else{
+                                $("#table2").bootstrapTable("hideColumn", "l_weight"); // 设置隐藏列
+                                $("#table2").bootstrapTable("showColumn", "l_num"); // 设置显示列
+                            }
                         }
+
                     },
                 });