xiaoyong931011
2021-03-12 8c32fe69d8a0cd12617e1487f5aff689814faaaa
分销员后台0312
2 files added
8 files modified
606 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java 45 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java 5 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java 23 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java 48 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java 3 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml 28 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html 284 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html 163 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java
@@ -1,15 +1,22 @@
package com.matrix.system.fenxiao.action;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
import com.matrix.system.fenxiao.dto.AddSaleManApplyDto;
import com.matrix.system.fenxiao.dto.ExamineSaleManApplyDto;
import com.matrix.system.fenxiao.dto.ShopSalesmanAppliingDto;
import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.service.ShopSalesmanApplyService;
import com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo;
import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo;
@@ -29,6 +36,10 @@
    
    @Autowired
    private ShopSalesmanApplyService shopSalesmanApplyService;
    @Autowired
    private ShopSalesmanApplyDao shopSalesmanApplyDao;
    @Autowired
    private BizUserDao bizUserDao;
    /**
     * 查询分销员审核记录
@@ -47,7 +58,6 @@
            shopSalesmanApplyDto.setSort("create_time");
            shopSalesmanApplyDto.setOrder("desc");
        }
        Page<ShopSalesmanApplyVo> page = new Page(shopSalesmanApplyDto.getPageNum(), shopSalesmanApplyDto.getPageSize());
        IPage<ShopSalesmanApplyVo> rows = shopSalesmanApplyService.findShopSalesmanApplyList(page,shopSalesmanApplyDto);
        AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal());
@@ -108,5 +118,38 @@
        shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getUserId(),addSaleManApplyDto.getGradeId());
        return result;
    }
    /**
     *审核分销员
     */
    @ApiOperation(value = "审核分销员")
    @PostMapping(value = "/examineSaleManApply")
    public @ResponseBody
    AjaxResult examineSaleManApply(@RequestBody ExamineSaleManApplyDto examineSaleManApplyDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(examineSaleManApplyDto);
        String userId = examineSaleManApplyDto.getUserId();
        //待审核状态才允许提交
        QueryWrapper<ShopSalesmanApply> queryWrapperOrepool = new QueryWrapper<>();
        queryWrapperOrepool.eq("user_id", userId);
        queryWrapperOrepool.eq("company_id", examineSaleManApplyDto.getCompanyId());
        ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectOne(queryWrapperOrepool);
        if(ObjectUtil.isEmpty(shopSalesmanApply)) {
            return  AjaxResult.buildFailInstance("当前记录有误");
        }
        BizUser bizUser = bizUserDao.findByOpenId(userId);
        if(ObjectUtil.isEmpty(bizUser)) {
            return  AjaxResult.buildFailInstance("当前记录有误");
        }
        Integer applyStatus = shopSalesmanApply.getApplyStatus();
        if(ObjectUtil.isNotEmpty(applyStatus) && ShopSalesmanApply.APPLY_STATUS_DSH == applyStatus) {
            Integer applyState = examineSaleManApplyDto.getApplyState();
            shopSalesmanApplyService.examineSaleManApply(shopSalesmanApply,applyState);
            return AjaxResult.buildSuccessInstance("审核成功");
        }else{
            return  AjaxResult.buildFailInstance("当前记录不是待审核状态");
        }
    }
}
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java
@@ -4,10 +4,13 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "AddSaleManApplyDto", description = "查询参数")
public class AddSaleManApplyDto {
    @NotNull
    @ApiModelProperty(value ="会员ID")
    private String userId;
    
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java
New file
@@ -0,0 +1,23 @@
package com.matrix.system.fenxiao.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "ExamineSaleManApplyDto", description = "查询参数")
public class ExamineSaleManApplyDto {
    @NotNull
    @ApiModelProperty(value ="会员ID")
    private String userId;
    @ApiModelProperty(value ="审核状态   2:同意 3:不同意")
    private Integer applyState;
    @ApiModelProperty(hidden = true)
    private Long companyId;
}
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanApplyDto.java
@@ -12,6 +12,11 @@
    
    @ApiModelProperty(value ="审核状态")
    private Integer shenheState;
    @ApiModelProperty(value ="分销员等级")
    private Long salemanGrade;
    @ApiModelProperty(value ="会员姓名")
    private String userName;
    
    @ApiModelProperty(hidden = true)
    private Long companyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
@@ -24,6 +24,7 @@
import com.matrix.system.fenxiao.vo.ShopSalesmanGradeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@@ -41,7 +42,7 @@
    BusParameterSettingsDao busParameterSettingsDao;
    @Autowired
    ShopSalesmanApplyDao salesmanApplyDao;
    ShopSalesmanApplyDao shopSalesmanApplyDao;
    
    @Autowired
    ShopSalesmanGradeDao shopSalesmanGradeDao;
@@ -58,13 +59,13 @@
     * @param invitationId
     * @return
     */
    public ShopSalesmanApply applyToBeAnSalesman(String openId,String gradeId,String invitationId) {
    public ShopSalesmanApply applyToBeAnSalesman(String openId,String gradeId,String invitationId,int applyWay) {
        BizUser loginUser=bizUserDao.findByOpenId(openId);
        //校验审核状态,和是否重复发起
        QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id",loginUser.getOpenId());
        ShopSalesmanApply checkApply = salesmanApplyDao.selectOne(queryWrapper);
        ShopSalesmanApply checkApply = shopSalesmanApplyDao.selectOne(queryWrapper);
        if(checkApply==null||
                checkApply.getApplyStatus()==ShopSalesmanApply.APPLY_STATUS_WTG){
@@ -96,7 +97,8 @@
                ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool);
                shopSalesmanApply.setGradeId(shopSalesmanGrade.getId());
            }
            shopSalesmanApply.setApplyWay(applyWay);
            BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_AUDIT_METHOD, loginUser.getCompanyId());
            if(busParameterSettings!=null
                    &&busParameterSettings.getParamValue().equals("1")){
@@ -107,7 +109,7 @@
            }else{
                shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH);
            }
            salesmanApplyDao.insert(shopSalesmanApply);
            shopSalesmanApplyDao.insert(shopSalesmanApply);
            return  shopSalesmanApply;
        }else{
            throw  new GlobleException("不能重复申请");
@@ -116,29 +118,49 @@
    }
    public IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page, ShopSalesmanApplyDto shopSalesmanApplyDto) {
        return salesmanApplyDao.findShopSalesmanApplyList(page,shopSalesmanApplyDto);
        return shopSalesmanApplyDao.findShopSalesmanApplyList(page,shopSalesmanApplyDto);
    }
    public IPage<ShopSalesmanAppliingVo> findShopSalesmanAppliingList(Page<ShopSalesmanAppliingVo> page,
            ShopSalesmanAppliingDto shopSalesmanAppliingDto) {
        return salesmanApplyDao.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto);
        return shopSalesmanApplyDao.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto);
    }
    public IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page, ShopSalesmanAppliingDto shopSalesmanAppliingDto) {
        return salesmanApplyDao.selectBizUserApplyList(page,shopSalesmanAppliingDto);
        return shopSalesmanApplyDao.selectBizUserApplyList(page,shopSalesmanAppliingDto);
    }
    public List<ShopSalesmanGradeVo> getShopSalesmanGradeVo(Long companyId) {
        return shopSalesmanGradeDao.getShopSalesmanGradeVo(companyId);
    }
    @Transactional(rollbackFor = Exception.class)
    public void addSaleManApply(String userId,String gradeId) {
        BizUser user = bizUserDao.selectById(userId);
        applyToBeAnSalesman(user.getOpenId(),gradeId, "");
        applyToBeAnSalesman(user.getOpenId(),gradeId, "",ShopSalesmanApply.APPLY_WAY_HAND_ADD);
    }
    @Transactional(rollbackFor = Exception.class)
    public void examineSaleManApply(ShopSalesmanApply shopSalesmanApply, Integer applyState) {
        String userId = shopSalesmanApply.getUserId();
        String parentUserId = shopSalesmanApply.getParentUserId();
        BizUser bizUser = bizUserDao.selectById(userId);
        //修改审核记录
        if(ShopSalesmanApply.APPLY_STATUS_TG == applyState) {
            shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG);
            bizUser.setIsSales(BizUser.IS_SALES);
        }else {
            shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_WTG);
            bizUser.setIsSales(BizUser.NOT_SALES);
        }
        shopSalesmanApplyDao.updateById(shopSalesmanApply);
        //修改USER的状态
        bizUser.setParentOpenId(parentUserId);
        bizUser.setBindingParentTime(new Date());
        bizUserDao.updateByModel(bizUser);
    }
    
    
    
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanApplyVo.java
@@ -67,6 +67,8 @@
    
    @ApiModelProperty(value = "分销员")
    private String nickname;
    @ApiModelProperty(value = "头像")
    private String avatarUrl;
    @ApiModelProperty(value = "邀请人")
    private String parentUser;
    @ApiModelProperty(value = "下级客户数")
@@ -78,6 +80,7 @@
    private BigDecimal balance;
    @ApiModelProperty(value = "等级")
    private String grade;
    @ApiModelProperty(value = "加入时间")
    private Date createTime;
    @ApiModelProperty(value = "状态")
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
@@ -85,7 +85,7 @@
    public AjaxResult applyToBeAnSalesman(@RequestBody Map<String,String> param) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        String invitationId = param.get("invitationId");
        ShopSalesmanApply shopSalesmanApply= shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(),"",invitationId);
        ShopSalesmanApply shopSalesmanApply= shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(),"",invitationId,ShopSalesmanApply.APPLY_WAY_SELF);
        loginUser=bizUserDao.selectById(loginUser.getUserId());
        redisUserLoginUtils.updateUserInfo(loginUser);
        return AjaxResult.buildSuccessInstance(shopSalesmanApply);
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
@@ -61,16 +61,34 @@
    <select id="findShopSalesmanApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo">
        SELECT
        a.user_id userId,
        b.avatar_url avatarUrl,
        b.nick_name nickname,
        (SELECT s.nick_name from biz_user s where s.user_id = a.parent_user_id) parentUser,
        (SELECT s.nick_name FROM biz_user s
        WHERE s.open_id = a.parent_user_id ) parentUser,
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales != 1 ) lowerLevelNum,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
        WHERE user_id = a.user_id AND order_status = 2 AND sales_user_id = a.user_id ) totalRevenue,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
        WHERE user_id = a.user_id AND order_status = 1 AND sales_user_id = a.user_id ) balance,
        g.NAME grade,
        a.create_time createTime,
        a.apply_status applyStatus,
        a.apply_way applyWay
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON a.user_id = b.user_id
        LEFT JOIN shop_salesman_grade g ON b.salesman_grade = g.id
        LEFT JOIN biz_user b ON a.user_id = b.open_id
        LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id
        <where>
             a.company_id=#{record.companyId}
            <if test="record.shenheState != null and record.shenheState != ''">
                and a.apply_status=#{record.shenheState}
            </if>
            <if test="record.salemanGrade != null and record.salemanGrade != ''">
                and a.grade_id=#{record.salemanGrade}
            </if>
            <if test="record.userName != null and record.userName != ''">
                and b.nick_name like concat('%',#{record.userName},'%')
            </if>
        </where>
        <if test="record.sort !=null">
@@ -99,11 +117,11 @@
    </select>
    <select id="selectBizUserApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo">
        SELECT
        a.user_id userId,
        a.open_id userId,
        a.nick_name nickName
        FROM
        biz_user a
        LEFT JOIN shop_salesman_apply b ON a.user_id = b.user_id
        LEFT JOIN shop_salesman_apply b ON a.open_id = b.user_id
        <where>
            a.company_id = #{record.companyId}
            and a.is_sales != 1
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html
New file
@@ -0,0 +1,284 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
    <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
    <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
    <!-- 富文本编辑器 -->
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/ueditor.config.js}"></script>
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/ueditor.all.js}">
    </script>
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script>
    <style>
        .paginationStyle{
            background: #ffffff;
            padding: 10px 10px;
            margin: 0px 0px 10px 0px;
            text-align: right;
        }
    </style>
</head>
<body>
<div class="ibox-content" id="app" v-cloak>
    <el-row>
        <p class="el-big-title">个人详情</p>
    </el-row>
    <el-row>
        <el-col>
            <template>
                <img :src="detailVo.avatarUrl" width="50" height="50" class="head_pic"/>
            </template>
        </el-col>
        <el-col>
            <div>张三</div>
            <div>
                <el-form-item label="分销员等级" prop="salemanGrade">
                    <el-select v-model="form.salemanGrade"  placeholder="请选择" filterable allow-create>
                        <el-option v-for="item in salemanGradeList " :key="item.id" :label="item.name" :value="item.id">
                        </el-option>
                    </el-select>
                </el-form-item>
            </div>
        </el-col>
    </el-row>
    <el-row>
        <el-col>
            <div>手机号码:</div>
            <div>加入时间:</div>
            <div>邀请人:</div>
            <div>来源:</div>
        </el-col>
    </el-row>
    <el-row>
        <el-row>
            <el-col :span="24">
                <el-form-item>
                    <el-col class="line" :span="6" style="text-align: center">绑定客户</el-col>
                    <el-col class="line" :span="6" style="text-align: center">邀请下级</el-col>
                    <el-col class="line" :span="6" style="text-align: center">累计收益</el-col>
                    <el-col class="line" :span="6" style="text-align: center">待结算</el-col>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="24">
                <el-form-item>
                    <el-col class="line" :span="6" style="text-align: center">0</el-col>
                    <el-col class="line" :span="6" style="text-align: center">0</el-col>
                    <el-col class="line" :span="6" style="text-align: center">0</el-col>
                    <el-col class="line" :span="6" style="text-align: center">0</el-col>
                </el-form-item>
            </el-col>
        </el-row>
    </el-row>
</div>
</body>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            activeName: 'first',
            shenheAgreeType : 2,
            shenheDisagreeType : 3,
            form:{
                shenheState:'',
                salemanGrade:'',
                userName:'',
                order:'',
                sort:''
            },
            //条件查询审核状态
            shenheStateList:[
                {value:'',label:'全部'},
                {value:1,label:'未审核'},
                {value:2,label:'通过'},
                {value:3,label:'未通过'}
            ],
            //条件查询分销员等级
            salemanGradeList:[],
            fxyList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
            height:'calc(100vh - 240px)',
        },
        created: function () {
            this.loadInfo();
        },
        mounted: function () {
        },
        methods: {
            //加载分类
            loadInfo() {
                let _this = this;
                //_this.loadParamSetting();
                //_this.getSalemanGradeList();
            },
            loadParamSetting() {
                let _this = this;
                let data=_this.getRequestParam();
                data.pageSize=_this.fxyList.pageSize;
                data.pageNum=_this.fxyList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanApplyList',
                    callback: function (data) {
                        _this.fxyList.rows = data.rows;
                        _this.fxyList.total=data.total;
                    }
                });
            },
            // 下拉框数据源---分销员等级
            getSalemanGradeList() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data:[],
                    url: basePath + '/fenXiao/fenXiaoUser/getShopSalesmanGrade',
                    callback: function (data) {
                        _this.salemanGradeList = data.mapInfo.salesGrade;
                    }
                });
            },
            getRequestParam(){
                let _this = this;
                return   {
                    shenheState:_this.form.shenheState,
                    salemanGrade:_this.form.salemanGrade,
                    userName:_this.form.userName,
                    order:_this.form.order,
                    sort:_this.form.sort,
                }
            },
            search:function(){
                this.fxyList.currentPage=1;
                this.loadInfo();
            },
            resetForm(formName) {
                this.$refs[formName].resetFields();
            },
            sortChange:function (column){
                if(column.order){
                    if(column.order.indexOf("desc")){
                        this.form.order="desc";
                    }else{
                        this.form.order="asc";
                    }
                    this.form.sort=column.prop;
                    this.loadInfo();
                }
            },
            changePageSize(val) {
                this.table.pageSize = val;
                this.loadData();
            },
            changeCurrentPage(val) {
                this.table.currentPage = val;
                this.loadData();
            },
            //时间格式化
            formatDate(row,column){
                let data = row[column.property]
                if (data ===null) {
                    return ''
                }
                let dt = new Date(data)
                return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' ' + dt.getHours() + ':' + dt.getMinutes()
            },
            //新增分销员页面
            addSaleMan(){
                layer.full(layer.open({
                    type: 2,
                    title: "选择会员",
                    maxmin: true,
                    area: [MUI.SIZE_L, '500px'],
                    content : [ basePath + '/admin/redirect/fenxiao/fenxiao-apply']
                }));
            },
            //修改等级
            openUpdateSaleManGrade(){
                layer.full(layer.open({
                    type: 2,
                    title: "修改等级",
                    maxmin: true,
                    area: [MUI.SIZE_L, '500px'],
                    content : [ basePath + '/admin/redirect/fenxiao/fenxiao-update']
                }));
            },
            //审核
            openExamineSaleManApply(row) {
                this.$confirm('是否通过?', '审核', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '通过',
                    cancelButtonText: '不通过',
                    type: 'info'
                }).then(() => {
                    //通过
                    this.examineSaleManApply(row,this.shenheAgreeType);
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        this.examineSaleManApply(row,this.shenheDisagreeType);
                    }else{
                        //关闭按钮
                        console.log("close");
                        //this.$message({type: 'info',message: ''})
                    }
                });
            },
            examineSaleManApply(row,type){
                let _this = this;
                let userId = row.userId;
                let obj = {
                    userId: userId,
                    applyState: type,
                }
                AjaxProxy.requst({
                    app: _this,
                    data:obj,
                    url: basePath + '/fenXiao/fenXiaoUser/examineSaleManApply',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        this.loadData();
                    }
                });
            },
            submit() {
            }
        }
    })
</script>
</body>
</html>
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
@@ -54,35 +54,86 @@
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="分销员等级" prop="salemanGrade">
                                    <el-select v-model="form.salemanGrade"  placeholder="请选择" filterable allow-create>
                                        <el-option v-for="item in salemanGradeList " :key="item.id" :label="item.name" :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item prop="userName">
                                    <el-input v-model="form.userName" placeholder="请输入会员姓名"></el-input>
                                </el-form-item>
                                <el-button type="primary" @click="search" >搜索</el-button>
                                <el-button @click="resetForm('form')">重置</el-button>
                            </el-form>
                        </el-col>
                    </el-row>
                    <el-row>
                        <template>
                            <el-table id="proj" :data="fxyList.rows"  :height="height" stripe @sort-change="sortChange">
                    <el-row class="table-style" >
                            <el-table id="proj" :data="fxyList.rows"  :height="height" stripe:true  @sort-change="sortChange">
                                <el-table-column
                                        type="selection"
                                        width="55">
                                        type="selection">
                                </el-table-column>
                                <el-table-column
                                        prop="userId"
                                        label="id"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        fixed="right"
                                        label="操作"
                                        width="auto">
                                        label="头像" width="100">
                                    <template slot-scope="scope">
                                        <el-button type="text" size="small" @click="addSaleManApply(scope.row)">审核</el-button>
                                        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                                        <el-button type="text" size="small">编辑</el-button>
                                        <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                        prop="nickname"
                                        label="分销员" width="100">
                                </el-table-column>
                                <el-table-column
                                        prop="parentUser"
                                        label="邀请人" width="100">
                                </el-table-column>
                                <el-table-column
                                        prop="lowerLevelNum"
                                        label="下级客户数" width="100">
                                </el-table-column>
                                <el-table-column
                                        prop="totalRevenue"
                                        label="累计收益">
                                </el-table-column>
                                <el-table-column
                                        prop="balance"
                                        label="待结算">
                                </el-table-column>
                                <el-table-column
                                        prop="grade"
                                        label="等级">
                                </el-table-column>
                                <el-table-column
                                        prop="createTime"
                                        label="加入时间"
                                        :formatter="formatDate">
                                </el-table-column>
                                <el-table-column
                                        label="状态">
                                    <template slot-scope="scope">
                                        <span v-if="scope.row.applyStatus == 1">待审核</span>
                                        <span v-if="scope.row.applyStatus == 2">通过</span>
                                        <span v-if="scope.row.applyStatus == 3">未通过</span>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                        label="来源">
                                    <template slot-scope="scope">
                                        <span v-if="scope.row.applyWay == 1">自主申请</span>
                                        <span v-if="scope.row.applyWay == 2">自动添加</span>
                                        <span v-if="scope.row.applyWay == 3">上级邀请</span>
                                        <span v-if="scope.row.applyWay == 4">手动添加</span>
                                    </template>
                                </el-table-column>
                                <el-table-column label="操作" width="240">
                                    <template slot-scope="scope">
                                        <el-row style="display:flex;">
                                            <el-button type="primary" size="mini" @click="openExamineSaleManApply(scope.row)">审核</el-button>
                                            <el-button type="primary" size="mini" @click="openUpdateSaleManGrade(scope.row)">修改等级</el-button>
                                        </el-row>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </template>
                    </el-row>
                    <el-row class="paginationStyle"  >
                        <el-pagination background
@@ -196,8 +247,12 @@
            jfdxj:[],
            mdjf:[],
            scjf:[],
            shenheAgreeType : 2,
            shenheDisagreeType : 3,
            form:{
                shenheState:'',
                salemanGrade:'',
                userName:'',
                order:'',
                sort:''
            },
@@ -208,6 +263,8 @@
                {value:2,label:'通过'},
                {value:3,label:'未通过'}
            ],
            //条件查询分销员等级
            salemanGradeList:[],
            fxyList:{
                rows:[],
                total:0,
@@ -232,6 +289,7 @@
            loadInfo() {
                let _this = this;
                _this.loadParamSetting();
                _this.getSalemanGradeList();
            },
            submittp(paramValue) {
                alert(paramValue);
@@ -266,10 +324,24 @@
                    }
                });
            },
            // 下拉框数据源---分销员等级
            getSalemanGradeList() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data:[],
                    url: basePath + '/fenXiao/fenXiaoUser/getShopSalesmanGrade',
                    callback: function (data) {
                        _this.salemanGradeList = data.mapInfo.salesGrade;
                    }
                });
            },
            getRequestParam(){
                let _this = this;
                return   {
                    shenheState:_this.form.shenheState,
                    salemanGrade:_this.form.salemanGrade,
                    userName:_this.form.userName,
                    order:_this.form.order,
                    sort:_this.form.sort,
                }
@@ -305,6 +377,15 @@
                this.table.currentPage = val;
                this.loadData();
            },
            //时间格式化
            formatDate(row,column){
                    let data = row[column.property]
                    if (data ===null) {
                        return ''
                    }
                    let dt = new Date(data)
                    return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' ' + dt.getHours() + ':' + dt.getMinutes()
            },
            //新增分销员页面
            addSaleMan(){
                layer.full(layer.open({
@@ -315,6 +396,54 @@
                    content : [ basePath + '/admin/redirect/fenxiao/fenxiao-apply']
                }));
            },
            //修改等级
            openUpdateSaleManGrade(){
                layer.full(layer.open({
                    type: 2,
                    title: "修改等级",
                    maxmin: true,
                    area: [MUI.SIZE_L, '500px'],
                    content : [ basePath + '/admin/redirect/fenxiao/fenxiao-udpate']
                }));
            },
            //审核
            openExamineSaleManApply(row) {
                this.$confirm('是否通过?', '审核', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '通过',
                    cancelButtonText: '不通过',
                    type: 'info'
                }).then(() => {
                    //通过
                    this.examineSaleManApply(row,this.shenheAgreeType);
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        this.examineSaleManApply(row,this.shenheDisagreeType);
                    }else{
                        //关闭按钮
                        console.log("close");
                        //this.$message({type: 'info',message: ''})
                    }
                });
            },
            examineSaleManApply(row,type){
                let _this = this;
                let userId = row.userId;
                let obj = {
                    userId: userId,
                    applyState: type,
                }
                AjaxProxy.requst({
                    app: _this,
                    data:obj,
                    url: basePath + '/fenXiao/fenXiaoUser/examineSaleManApply',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        this.loadData();
                    }
                });
            },
            submit() {
            }