From 14d0524041e26c34f997db1192e85a4c25d98282 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 24 Sep 2021 11:05:15 +0800
Subject: [PATCH] 20210924

---
 src/main/resources/templates/febs/views/modules/order/refundList.html |   62 ++++++++++++++++++------------
 1 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/order/refundList.html b/src/main/resources/templates/febs/views/modules/order/refundList.html
index e0e3301..6670c4c 100644
--- a/src/main/resources/templates/febs/views/modules/order/refundList.html
+++ b/src/main/resources/templates/febs/views/modules/order/refundList.html
@@ -85,23 +85,36 @@
         table.on('tool(orderRefundTable)', function (obj) {
             var data = obj.data,
                 layEvent = obj.event;
-            if (layEvent === 'deliverGoods') {
-                febs.modal.open('发货', 'modules/order/deliverGoods/' + data.id, {
-                    btn: ['确认', '取消'],
-                    yes: function (index, layero) {
-                        $('#deliver-update').find('#submit').trigger('click');
-                    },
-                    btn2: function () {
-                        layer.closeAll();
-                    }
-                });
-            }
-            if (layEvent === 'seeOrder') {
-                febs.modal.open( '订单详情', 'modules/order/orderDetail/' + data.id, {
+            if (layEvent === 'refunding') {
+                febs.modal.open( '退款进度', 'modules/order/seeRefund/' + data.id, {
                     maxmin: true,
                 });
             }
+            if (layEvent === 'agree') {
+                febs.modal.confirm('同意', '同意此次退款申请?', function () {
+                    agreeRefund(data.id);
+                });
+            }
+            if (layEvent === 'disagree') {
+                febs.modal.confirm('拒绝', '拒绝此次退款申请?', function () {
+                    disagreeRefund(data.id);
+                });
+            }
         });
+
+        function agreeRefund(id) {
+            febs.get(ctx + 'admin/order/agreeRefund/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $query.click();
+            });
+        }
+
+        function disagreeRefund(id) {
+            febs.get(ctx + 'admin/order/disagreeRefund/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $query.click();
+            });
+        }
 
         // 查询按钮
         $query.on('click', function () {
@@ -114,10 +127,6 @@
             $searchForm[0].reset();
             sortObject.type = 'null';
             tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
-        });
-
-        $add.on('click', function () {
-            febs.view.tab.change("/modules/goods/goodsAddNew/");
         });
 
         function initTable() {
@@ -157,14 +166,17 @@
                     //             }
                     //         }, minWidth: 80,align:'center'},
                     //     {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'},
-                    // {title: '操作',
-                    //     templet: function (d) {
-                    //         if (d.status === 1) {
-                    //             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>'
-                    //         }else{
-                    //             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>'
-                    //         }
-                    //     },minWidth: 300,align:'center'}
+                    {title: '操作',
+                        templet: function (d) {
+                        if(d.status === 1){
+                            return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">同意</button>'
+                                +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>'
+                                +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>'
+                        }else{
+                            return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>'
+                        }
+
+                        },minWidth: 300,align:'center'}
                 ]]
             });
         }

--
Gitblit v1.9.1