ningsy 4 years ago
parent
commit
05a8437976

+ 18 - 4
suishenbang-order/src/main/java/com/dgtly/order/controller/OrderSalesDetailController.java

@@ -1,7 +1,11 @@
 package com.dgtly.order.controller;
 
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.dgtly.common.utils.MapDataUtil;
+import com.dgtly.order.domain.OrderCustomers;
+import com.dgtly.order.domain.OrderSalesDetail;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -9,11 +13,9 @@ import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.MediaType;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.MultiValueMap;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import com.dgtly.common.core.controller.BaseController;
 import org.springframework.web.client.RestTemplate;
 
@@ -62,6 +64,18 @@ public class OrderSalesDetailController extends BaseController
         return str;
     }
 
+    /**
+     * 查看经销商详情
+     */
+    @GetMapping("/info/{id}")
+    public String info(@PathVariable("id") Long id, ModelMap mmap)
+    {
+        String str = restTemplate.getForObject(cloudPath+"/order/orderSalesDetail/info/"+id,String.class);
+        OrderSalesDetail orderSalesDetail = JSONObject.toJavaObject(JSON.parseObject(str),OrderSalesDetail.class);
+        mmap.put("orderSalesDetail", orderSalesDetail);
+        return prefix + "/edit";
+    }
+
     /**
      * 导出销售目标达成列表
      */

+ 3 - 5
suishenbang-order/src/main/resources/templates/order/orderSalesDetail/orderSalesDetail.html

@@ -76,9 +76,8 @@
     </div>
     <th:block th:include="include :: footer" />
     <script th:inline="javascript">
-        var editFlag = [[${@permission.hasPermi('OrderSalesDetail:detail:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('OrderSalesDetail:detail:remove')}]];
-        var prefix = ctx + "OrderSalesDetail/detail";
+        var detailFlag = [[${@permission.hasPermi('order:orderSalesDetail:info')}]];
+        var prefix = ctx + "order/orderSalesDetail";
 
         $(function() {
             var options = {
@@ -181,8 +180,7 @@
                     align: 'center',
                     formatter: function(value, row, index) {
                         var actions = [];
-                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
                         return actions.join('');
                     }
                 }]