Browse Source

nsy update 添加启用经销商功能

ningsy 3 years ago
parent
commit
ec030cac0e

+ 127 - 0
suishenbang-order/src/main/java/com/dgtly/order/controller/CustomersStartController.java

@@ -0,0 +1,127 @@
+package com.dgtly.order.controller;
+
+import java.util.List;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.dgtly.common.annotation.Log;
+import com.dgtly.common.enums.BusinessType;
+import com.dgtly.order.domain.CustomersStart;
+import com.dgtly.order.service.ICustomersStartService;
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.utils.poi.ExcelUtil;
+import com.dgtly.common.core.page.TableDataInfo;
+
+/**
+ * 经销商启用Controller
+ * 
+ * @author nsy
+ * @date 2021-01-18
+ */
+@Controller
+@RequestMapping("/order/customersStart")
+public class CustomersStartController extends BaseController
+{
+    private String prefix = "order/customersStart";
+
+    @Autowired
+    private ICustomersStartService customersStartService;
+
+    @RequiresPermissions("order:customersStart:view")
+    @GetMapping()
+    public String customersStart()
+    {
+        return prefix + "/customersStart";
+    }
+
+    /**
+     * 查询经销商启用列表
+     */
+    @RequiresPermissions("order:customersStart:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(CustomersStart customersStart)
+    {
+        startPage();
+        List<CustomersStart> list = customersStartService.selectCustomersStartList(customersStart);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出经销商启用列表
+     */
+    @RequiresPermissions("order:customersStart:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(CustomersStart customersStart)
+    {
+        List<CustomersStart> list = customersStartService.selectCustomersStartList(customersStart);
+        ExcelUtil<CustomersStart> util = new ExcelUtil<CustomersStart>(CustomersStart.class);
+        return util.exportExcel(list, "启用经销商");
+    }
+
+    /**
+     * 新增经销商启用
+     */
+    @RequiresPermissions("order:customersStart:add")
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存经销商启用
+     */
+    @RequiresPermissions("order:customersStart:add")
+    @PostMapping("/addCustomersStart")
+    @ResponseBody
+    public AjaxResult addCustomersStart(String ids) {
+        if (ids == null) {
+            return AjaxResult.error("参数缺失,不支持操作");
+        }
+        return toAjax(customersStartService.addCustomersStart(ids));
+    }
+
+    /**
+     * 修改经销商启用
+     */
+    @GetMapping("/edit/{customersCode}")
+    public String edit(@PathVariable("customersCode") String customersCode, ModelMap mmap)
+    {
+        CustomersStart customersStart = customersStartService.selectCustomersStartById(customersCode);
+        mmap.put("customersStart", customersStart);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存经销商启用
+     */
+    @RequiresPermissions("order:customersStart:edit")
+    @Log(title = "经销商启用", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(CustomersStart customersStart)
+    {
+        return toAjax(customersStartService.updateCustomersStart(customersStart));
+    }
+
+    /**
+     * 删除经销商启用
+     */
+    @RequiresPermissions("order:customersStart:remove")
+    @Log(title = "经销商启用", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(customersStartService.deleteCustomersStartByIds(ids));
+    }
+}

+ 22 - 1
suishenbang-order/src/main/java/com/dgtly/order/controller/OrderCustomersController.java

@@ -6,8 +6,10 @@ package com.dgtly.order.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.dgtly.common.core.page.TableDataInfo;
 import com.dgtly.common.utils.MapDataUtil;
 import com.dgtly.order.domain.OrderCustomers;
+import com.dgtly.order.service.ICustomersStartService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -23,7 +25,7 @@ import com.dgtly.common.core.controller.BaseController;
 import org.springframework.web.client.RestTemplate;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.Map;
+import java.util.List;
 
 /**
  * 经销商Controller
@@ -37,6 +39,10 @@ public class OrderCustomersController extends BaseController
 {
     private String prefix = "order/customers";
 
+    @Autowired
+    private ICustomersStartService customersStartService;
+
+
     @Autowired
     private RestTemplate restTemplate;
 
@@ -123,4 +129,19 @@ public class OrderCustomersController extends BaseController
     }
 
 
+    /**
+     * 返回经销商列表,根据进销商编号去重
+     * @param customers
+     * @return
+     */
+    @PostMapping("/customersList")
+    @ResponseBody
+    public TableDataInfo customersList(OrderCustomers customers)
+    {
+        customers.setIsDelete("0");
+        startPage();
+        List<OrderCustomers> usercustomersList = customersStartService.selectcustomersList(customers);
+        return getDataTable(usercustomersList);
+    }
+
 }

+ 52 - 0
suishenbang-order/src/main/java/com/dgtly/order/domain/CustomersStart.java

@@ -0,0 +1,52 @@
+package com.dgtly.order.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+/**
+ * 经销商启用对象 customers_start
+ * 
+ * @author nsy
+ * @date 2021-01-18
+ */
+public class CustomersStart extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 经销商编号 */
+    @Excel(name = "经销商编号")
+    private String customersCode;
+
+    /** 经销商名称 */
+    @Excel(name = "经销商名称")
+    private String customersName;
+
+    public void setCustomersCode(String customersCode) 
+    {
+        this.customersCode = customersCode;
+    }
+
+    public String getCustomersCode() 
+    {
+        return customersCode;
+    }
+    public void setCustomersName(String customersName) 
+    {
+        this.customersName = customersName;
+    }
+
+    public String getCustomersName() 
+    {
+        return customersName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("customersCode", getCustomersCode())
+            .append("customersName", getCustomersName())
+            .toString();
+    }
+}

+ 72 - 0
suishenbang-order/src/main/java/com/dgtly/order/mapper/CustomersStartMapper.java

@@ -0,0 +1,72 @@
+package com.dgtly.order.mapper;
+
+import com.dgtly.order.domain.CustomersStart;
+import com.dgtly.order.domain.OrderCustomers;
+
+import java.util.List;
+
+/**
+ * 经销商启用Mapper接口
+ * 
+ * @author nsy
+ * @date 2021-01-18
+ */
+public interface CustomersStartMapper 
+{
+    /**
+     * 查询经销商启用
+     * 
+     * @param customersCode 经销商启用ID
+     * @return 经销商启用
+     */
+    public CustomersStart selectCustomersStartById(String customersCode);
+
+    /**
+     * 查询经销商启用列表
+     * 
+     * @param customersStart 经销商启用
+     * @return 经销商启用集合
+     */
+    public List<CustomersStart> selectCustomersStartList(CustomersStart customersStart);
+
+    /**
+     * 新增经销商启用
+     * 
+     * @param customersStart 经销商启用
+     * @return 结果
+     */
+    public int insertCustomersStart(CustomersStart customersStart);
+
+    /**
+     * 修改经销商启用
+     * 
+     * @param customersStart 经销商启用
+     * @return 结果
+     */
+    public int updateCustomersStart(CustomersStart customersStart);
+
+    /**
+     * 删除经销商启用
+     * 
+     * @param customersCode 经销商启用ID
+     * @return 结果
+     */
+    public int deleteCustomersStartById(String customersCode);
+
+    /**
+     * 批量删除经销商启用
+     * 
+     * @param customersCodes 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteCustomersStartByIds(String[] customersCodes);
+
+    /**
+     * 返回经销商列表,根据进销商编号去重
+     * @param customers
+     * @return
+     */
+    List<OrderCustomers> selectcustomersList(OrderCustomers customers);
+
+    OrderCustomers selectCustomersById(Long id);
+}

+ 77 - 0
suishenbang-order/src/main/java/com/dgtly/order/service/ICustomersStartService.java

@@ -0,0 +1,77 @@
+package com.dgtly.order.service;
+
+import com.dgtly.order.domain.CustomersStart;
+import com.dgtly.order.domain.OrderCustomers;
+
+import java.util.List;
+
+/**
+ * 经销商启用Service接口
+ * 
+ * @author nsy
+ * @date 2021-01-18
+ */
+public interface ICustomersStartService 
+{
+    /**
+     * 查询经销商启用
+     * 
+     * @param customersCode 经销商启用ID
+     * @return 经销商启用
+     */
+    public CustomersStart selectCustomersStartById(String customersCode);
+
+    /**
+     * 查询经销商启用列表
+     * 
+     * @param customersStart 经销商启用
+     * @return 经销商启用集合
+     */
+    public List<CustomersStart> selectCustomersStartList(CustomersStart customersStart);
+
+    /**
+     * 新增经销商启用
+     * 
+     * @param customersStart 经销商启用
+     * @return 结果
+     */
+    public int insertCustomersStart(CustomersStart customersStart);
+
+    /**
+     * 修改经销商启用
+     * 
+     * @param customersStart 经销商启用
+     * @return 结果
+     */
+    public int updateCustomersStart(CustomersStart customersStart);
+
+    /**
+     * 批量删除经销商启用
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteCustomersStartByIds(String ids);
+
+    /**
+     * 删除经销商启用信息
+     * 
+     * @param customersCode 经销商启用ID
+     * @return 结果
+     */
+    public int deleteCustomersStartById(String customersCode);
+
+    /**
+     * 查询经销商列表,根据进销商编号去重
+     * @param customers
+     * @return
+     */
+    List<OrderCustomers> selectcustomersList(OrderCustomers customers);
+
+    /**
+     * 新增保存经销商启用
+     * @param ids
+     * @return
+     */
+    int addCustomersStart(String ids);
+}

+ 137 - 0
suishenbang-order/src/main/java/com/dgtly/order/service/impl/CustomersStartServiceImpl.java

@@ -0,0 +1,137 @@
+package com.dgtly.order.service.impl;
+
+import java.util.List;
+
+import com.dgtly.order.domain.OrderCustomers;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.dgtly.order.mapper.CustomersStartMapper;
+import com.dgtly.order.domain.CustomersStart;
+import com.dgtly.order.service.ICustomersStartService;
+import com.dgtly.common.core.text.Convert;
+
+import javax.annotation.Resource;
+
+/**
+ * 经销商启用Service业务层处理
+ * 
+ * @author nsy
+ * @date 2021-01-18
+ */
+@Service
+public class CustomersStartServiceImpl implements ICustomersStartService 
+{
+    @Resource
+    private CustomersStartMapper customersStartMapper;
+
+    /**
+     * 查询经销商启用
+     * 
+     * @param customersCode 经销商启用ID
+     * @return 经销商启用
+     */
+    @Override
+    public CustomersStart selectCustomersStartById(String customersCode)
+    {
+        return customersStartMapper.selectCustomersStartById(customersCode);
+    }
+
+    /**
+     * 查询经销商启用列表
+     * 
+     * @param customersStart 经销商启用
+     * @return 经销商启用
+     */
+    @Override
+    public List<CustomersStart> selectCustomersStartList(CustomersStart customersStart)
+    {
+        return customersStartMapper.selectCustomersStartList(customersStart);
+    }
+
+    /**
+     * 新增经销商启用
+     * 
+     * @param customersStart 经销商启用
+     * @return 结果
+     */
+    @Override
+    public int insertCustomersStart(CustomersStart customersStart)
+    {
+        CustomersStart customersS = customersStartMapper.selectCustomersStartById(customersStart.getCustomersCode());
+        if(customersS != null) return 1;
+        return customersStartMapper.insertCustomersStart(customersStart);
+    }
+
+    /**
+     * 修改经销商启用
+     * 
+     * @param customersStart 经销商启用
+     * @return 结果
+     */
+    @Override
+    public int updateCustomersStart(CustomersStart customersStart)
+    {
+        return customersStartMapper.updateCustomersStart(customersStart);
+    }
+
+    /**
+     * 删除经销商启用对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteCustomersStartByIds(String ids)
+    {
+        return customersStartMapper.deleteCustomersStartByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除经销商启用信息
+     * 
+     * @param customersCode 经销商启用ID
+     * @return 结果
+     */
+    @Override
+    public int deleteCustomersStartById(String customersCode)
+    {
+        return customersStartMapper.deleteCustomersStartById(customersCode);
+    }
+
+    /**
+     * 返回经销商列表,根据进销商编号去重
+     * @param customers
+     * @return
+     */
+    @Override
+    public List<OrderCustomers> selectcustomersList(OrderCustomers customers) {
+        return customersStartMapper.selectcustomersList(customers);
+    }
+
+    /**
+     * 新增保存经销商启用
+     * @param ids
+     * @return
+     */
+    @Override
+    public int addCustomersStart(String ids) {
+        int state = 0;
+        String[] indexIds = Convert.toStrArray(ids);
+        for (String id: indexIds) {
+            OrderCustomers customers = customersStartMapper.selectCustomersById(Long.valueOf(id));
+            if(customers != null){
+                String chainsCode = customers.getChainsCode();
+                String chainsName = customers.getChainsName();
+                CustomersStart customersStart = customersStartMapper.selectCustomersStartById(chainsCode);
+                if(customersStart == null){
+                    customersStart = new CustomersStart();
+                    customersStart.setCustomersCode(chainsCode);
+                    customersStart.setCustomersName(chainsName);
+                    state = customersStartMapper.insertCustomersStart(customersStart);
+                }
+                continue;
+            }
+        }
+        return state;
+    }
+}

+ 81 - 0
suishenbang-order/src/main/resources/mapper/order/CustomersStartMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dgtly.order.mapper.CustomersStartMapper">
+    
+    <resultMap type="com.dgtly.order.domain.CustomersStart" id="CustomersStartResult">
+        <result property="customersCode"    column="customers_code"    />
+        <result property="customersName"    column="customers_name"    />
+    </resultMap>
+
+    <sql id="selectCustomersStartVo">
+        select customers_code, customers_name from customers_start
+    </sql>
+
+    <select id="selectCustomersStartList" parameterType="com.dgtly.order.domain.CustomersStart" resultMap="CustomersStartResult">
+        <include refid="selectCustomersStartVo"/>
+        <where>  
+            <if test="customersCode != null  and customersCode != ''"> and customers_code like concat('%', #{customersCode}, '%')</if>
+            <if test="customersName != null  and customersName != ''"> and customers_name like concat('%', #{customersName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectCustomersStartById" parameterType="String" resultMap="CustomersStartResult">
+        <include refid="selectCustomersStartVo"/>
+        where customers_code = #{customersCode}
+    </select>
+    <select id="selectcustomersList" resultType="com.dgtly.order.domain.OrderCustomers" parameterType="com.dgtly.order.domain.OrderCustomers">
+        select id, chains_code as chainsCode, chains_name as chainsName from customers
+        where is_delete = 0
+        and chains_code is not null
+        and chains_name is not null
+        <if test="chainsCode != null and chainsCode != ''">
+            AND chains_code like concat('%', #{chainsCode}, '%')
+        </if>
+        <if test="chainsName != null and chainsName != ''">
+            AND chains_name like concat('%', #{chainsName}, '%')
+        </if>
+        GROUP BY chains_code
+    </select>
+    <select id="selectCustomersById" resultType="com.dgtly.order.domain.OrderCustomers" parameterType="Long">
+         select id, chains_name as chainsName, chains_code as chainsCode, state_name as stateName, city_name as cityName
+         from customers
+         where is_delete = 0
+         and chains_code is not null
+         and chains_name is not null
+         and id = #{id}
+    </select>
+
+    <insert id="insertCustomersStart" parameterType="com.dgtly.order.domain.CustomersStart">
+        insert into customers_start
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="customersCode != null  and customersCode != ''">customers_code,</if>
+            <if test="customersName != null  and customersName != ''">customers_name,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="customersCode != null  and customersCode != ''">#{customersCode},</if>
+            <if test="customersName != null  and customersName != ''">#{customersName},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCustomersStart" parameterType="com.dgtly.order.domain.CustomersStart">
+        update customers_start
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="customersName != null  and customersName != ''">customers_name = #{customersName},</if>
+        </trim>
+        where customers_code = #{customersCode}
+    </update>
+
+    <delete id="deleteCustomersStartById" parameterType="String">
+        delete from customers_start where customers_code = #{customersCode}
+    </delete>
+
+    <delete id="deleteCustomersStartByIds" parameterType="String">
+        delete from customers_start where customers_code in 
+        <foreach item="customersCode" collection="array" open="(" separator="," close=")">
+            #{customersCode}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 84 - 0
suishenbang-order/src/main/resources/templates/order/customersStart/add.html

@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('分配选择销售')" />
+</head>
+
+<body class="gray-bg">
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="role-form">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            经销商编号:<input type="text" name="chainsCode"/>
+                        </li>
+                        <li>
+                            经销商名称:<input type="text" name="chainsName"/>
+                        </li>
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
+
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
+        </div>
+    </div>
+</div>
+<th:block th:include="include :: footer" />
+<script th:inline="javascript">
+    var datas = [[${@dict.getType('sys_normal_disable')}]];
+    var prefix = ctx + "order/customers/customersList";
+    var prefix1 = ctx + "order/customersStart";
+    $(function() {
+        var options = {
+            url: prefix,
+            sortName: "createTime",
+            sortOrder: "desc",
+            modalName: "用户",
+            showSearch: false,
+            showRefresh: false,
+            showToggle: false,
+            showColumns: false,
+            clickToSelect: true,
+            rememberSelected: true,
+            columns: [{
+                field: 'state',
+                checkbox: true
+            },
+                {
+                    field: 'id',
+                    title: '经销商ID',
+                    visible: false
+                },
+                {
+                    field: 'chainsCode',
+                    title: '经销商编码'
+                },
+                {
+                    field: 'chainsName',
+                    title: '经销商姓名'
+                }]
+        };
+        $.table.init(options);
+    });
+
+    /* 添加用户-选择用户-提交 */
+    function submitHandler() {
+        var rows = $.table.selectFirstColumns();
+        if (rows.length == 0) {
+            $.modal.alertWarning("请至少选择一条记录");
+            return;
+        }
+        var data = {"ids": rows.join() };
+        $.operate.save(prefix1 + "/addCustomersStart", data);
+    }
+</script>
+</body>
+</html>

+ 89 - 0
suishenbang-order/src/main/resources/templates/order/customersStart/customersStart.html

@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('经销商启用列表')" />
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <p>经销商编号:</p>
+                                <input type="text" name="customersCode"/>
+                            </li>
+                            <li>
+                                <p>经销商名称:</p>
+                                <input type="text" name="customersName"/>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="add()" shiro:hasPermission="order:customersStart:add">
+                    <i class="fa fa-plus"></i> 启用经销商
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="order:customersStart:remove">
+                    <i class="fa fa-remove"></i> 停用经销商
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="order:customersStart:export">
+                    <i class="fa fa-download"></i> 导出
+                 </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('order:customersStart:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('order:customersStart:remove')}]];
+        var prefix = ctx + "order/customersStart";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "经销商启用",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field : 'customersCode', 
+                    title : '经销商编号'
+                },
+                {
+                    field : 'customersName', 
+                    title : '经销商名称'
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.customersCode + '\')"><i class="fa fa-remove"></i>停用</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+        function add() {
+            var url = prefix + '/add';
+            $.modal.open('启用经销商', url);
+        }
+    </script>
+</body>
+</html>