xieruidong 2 年之前
父节点
当前提交
08d6702abc

+ 3 - 0
application/admin/controller/Orders.php

@@ -72,4 +72,7 @@ class Orders extends Backend
         return $this->view->fetch();
     }
 
+    public function send($ids){
+
+    }
 }

+ 1 - 0
application/admin/view/orders/index.html

@@ -25,6 +25,7 @@
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="0"
                            data-operate-del="0"
+                           data-operate-send="{:$auth->check('orders/send')}"
                            width="100%">
                     </table>
                 </div>

+ 1 - 1
application/api/controller/object/Index.php

@@ -74,7 +74,7 @@ class Index extends Api
      * @ApiParams (name=rec_time,description=收货时间)
      * @ApiParams (name=pay_type,description=支付方式1企业网银2微信3支付宝4银联5代付6线下支付)
      * @ApiParams (name=continue_expire_time,description=过期时间)
-     * @ApiParams (name=status,description="状态:0待支付10待收货20已完成30已取消40退款退货")
+     * @ApiParams (name=status,description="状态:0待支付5待发货10待收货20已完成30已取消40退款退货")
      * @ApiParams (name=info,type=array,description="子订单数组")
      * @ApiParams (name=info[0][order_id],type=array,description="订单ID")
      * @ApiParams (name=info[0][goods_id],type=array,description="商品ID")

+ 2 - 0
application/common/model/Orders.php

@@ -36,12 +36,14 @@ class Orders extends Model
     ];
 
     const S_WAIT_PAY=0;
+    const S_WAIT_SEND=5;
     const S_WAIT_REC=10;
     const S_OVER=20;
     const S_CANCEL=30;
     //const S_REFUND=40;
     public static $status=[
         self::S_WAIT_PAY=>'待支付',
+        self::S_WAIT_SEND=>'待发货',
         self::S_WAIT_REC=>'待收货',
         self::S_OVER=>'已完成',
         self::S_CANCEL=>'已取消',

+ 3 - 3
public/api.html

@@ -6830,7 +6830,7 @@
                                                         <td>status</td>
                                                         <td>string</td>
                                                         <td>是</td>
-                                                        <td>状态:0待支付10待收货20已完成30已取消40退款退货</td>
+                                                        <td>状态:0待支付5待发货10待收货20已完成30已取消40退款退货</td>
                                                     </tr>
                                                                                                         <tr>
                                                         <td>info</td>
@@ -7100,7 +7100,7 @@
                                                         </div>
                                                                                                                 <div class="form-group">
                                                             <label class="control-label" for="status">status</label>
-                                                            <input type="string" class="form-control input-sm" id="status" required placeholder="状态:0待支付10待收货20已完成30已取消40退款退货" name="status">
+                                                            <input type="string" class="form-control input-sm" id="status" required placeholder="状态:0待支付5待发货10待收货20已完成30已取消40退款退货" name="status">
                                                         </div>
                                                                                                                 <div class="form-group">
                                                             <label class="control-label" for="info">info</label>
@@ -11450,7 +11450,7 @@
 
                 </div>
                 <div class="col-md-6" align="right">
-                    Generated on 2022-09-27 10:08:22 <a href="./" target="_blank">后台管理</a>
+                    Generated on 2022-09-27 10:23:49 <a href="./" target="_blank">后台管理</a>
                 </div>
             </div>
 

+ 18 - 1
public/assets/js/backend/orders.js

@@ -40,7 +40,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         //{field: 'update_time', title: __('Update_time'),addClass:'datetimerange',formatter: Table.api.formatter.datetime,operate: 'range'},
                         {field: 'pay_type', title: __('Pay_type'),formatter: Table.api.formatter.label,searchList:payTypes},
                         {field: 'pay_time', title: __('支付时间'),addClass:'datetimerange',formatter: Table.api.formatter.datetime,operate: 'range'},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.buttons,buttons:[
+                                {
+                                    name: 'edit',
+                                    text: __('发货'),
+                                    title: __('发货'),
+                                    classname: 'btn btn-xs btn-info btn-dialog',
+                                    icon: 'fa',
+                                    url: 'orders/send',
+                                    callback: function (data) {
+                                        //Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
+                                        $('.btn-refresh').trigger('click')
+                                    },
+                                    visible: function (row) {
+                                        //返回true时按钮显示,返回false隐藏
+                                        return row.status===10 && table.data('operate-send');
+                                    }
+                                },
+                            ]}
                     ]
                 ]
             });