Browse Source

Merge branch 'master' of https://git.7in6.com/wuwenqiang/dm-v3.7in6.com

曹鹤洋 1 year ago
parent
commit
0519ae7e27

+ 36 - 0
application/admin/controller/Deliver.php

@@ -442,6 +442,8 @@ class Deliver extends Backend
     public function apply_del($ids)
     {
         $export = new QcodeExport();
+        $userinfo = Session::get('admin');
+        $large = new QcodeLarge();
         if (empty($ids)){
             $this->error('请求错误');
         }
@@ -449,6 +451,14 @@ class Deliver extends Backend
         if ($res === false){
             $this->error('删除失败');
         }
+        $large_list = $export->where('_id',$ids)->find();
+        $large_id = explode(',',$large_list['large_str']);
+        foreach ($large_id as $v){
+            $result = $large->name($userinfo['company'].'_'.'qcode_large')->where('_id',$v)->update(['l_status'=>0]);
+            if ($result === 0){
+                $this->error('删除失败');
+            }
+        }
         $this->success('成功');
     }
 
@@ -664,6 +674,9 @@ class Deliver extends Backend
                 $good_list['qrcode_add'] = $this->Qrcode($good_list['shdh']);
                 $goods->where('_id',$id)->update(['qrcode_add'=>$good_list['qrcode_add']]);
             }
+            if ($good_list['note'] == 'NULL'){
+                $good_list['note'] = '';
+            }
             return json(['code'=>1,'data'=>$good_list]);
         }
     }
@@ -692,6 +705,29 @@ class Deliver extends Backend
         return json($matter_name);
     }
 
+    /**
+     * 发货单删除
+     * @param $ids
+     * @return void
+     */
+    public function dispatch_del($ids)
+    {
+        $goods = new QcodeGoods();
+        $export = new QcodeExport();
+        if (empty($ids)){
+            $this->error('参数错误');
+        }
+        $res = $goods->where('_id',$ids)->update(['delete_time'=>date('Y-m-d H:i:s',time())]);
+        if ($res === false){
+            $this->error('删除失败');
+        }
+        $export_id = $goods->where('_id',$ids)->find();
+        $result = $export->where('_id',$export_id['export_id'])->update(['status'=>0]);
+        if ($result === false){
+            $this->error('删除失败');
+        }
+        $this->success('成功');
+    }
 
     public function receive()
     {

+ 1 - 1
application/admin/view/deliver/goods.html

@@ -21,7 +21,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">输入车牌号</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-plate_number" class="form-control" name="plate_number" type="text" >
+            <input id="c-plate_number" class="form-control" data-rule="required" name="plate_number" type="text" >
         </div>
     </div>
     <div class="form-group">

+ 1 - 1
application/admin/view/deliver/lager.html

@@ -7,7 +7,7 @@
                         <div id="toolbar" class="toolbar">
                             <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                             <a href="javascript:;" class="btn btn-success  btn-print btn-disabled disabled {:$auth->check('deliver/print')?'':'hide'}" title="导出发货" ><i class="glyphicon glyphicon-export"></i>导出发货</a>
-                            <a href="javascript:;" class="btn btn-success  btn-disabled disabled {:$auth->check('')?'':'hide'}" title="新增大件" ><i class="fa fa-pencil"></i>新增大件</a>
+<!--                            <a href="javascript:;" class="btn btn-success  btn-disabled disabled {:$auth->check('')?'':'hide'}" title="新增大件" ><i class="fa fa-pencil"></i>新增大件</a>-->
                         </div>
                         <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                                width="100%">

+ 10 - 4
public/assets/js/backend/deliver.js

@@ -131,7 +131,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
                 pk: 'id',
-                height:500,
+                height:400,
                 sortName: 'id',
                 searchFormVisible:true,
                 search:false,
@@ -150,7 +150,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'large_num', title: '大件数量', operate: false},
                         {field: 'small_num', title: '小件数量', operate: false},
                         {field: 'create_time', title: '创建时间', operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime},
-                        {field: 'file_dir', title: '下载路径', operate: false},
+                        {field: 'file_dir', title: '下载路径', operate: false,formatter: function (value,row,index) {
+                                if (row.status == 0){
+                                    return "<a href=/"+value+">点击下载</a>";
+                                }else {
+                                    return "不支持下载";
+                                }
+                            }},
                         {field: 'status', title: '状态', operate: 'LIKE',searchList: {"0":'待发货',"1":'已删除'}, formatter: Table.api.formatter.status},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
@@ -208,7 +214,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                },function (data,res) {
                    parent.Toastr.success("成功");
                    Fast.api.close();
-                   parent.Fast.api.refreshmenu();
+                   window.parent.location.reload();
                    return false;
                },function (data) {
                    parent.Toastr.error('失败');
@@ -234,7 +240,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
                 pk: 'id',
-                height:500,
+                height:400,
                 sortName: 'id',
                 searchFormVisible:true,
                 showToggle:false,