935090232@qq.com
2021-03-14 b0ee5ab18f8242d0ca81966c07db00e0c6274831
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
@@ -22,105 +22,130 @@
    </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-form label-width="120px" >
        <el-row>
            <el-tabs v-model="activeName" >
                <el-tab-pane label="门店积分规则" name="first">
                        <form class="form-inline" id="serchform">
                            <el-row style="display:flex;align-items: center;">
                                <el-col>
                                    <el-button type="primary" @click="submits()">新增分销员</el-button>
                                </el-col>
                                <el-col style="display:flex;align-items: center;">
                                    <el-select v-model="shenheState" placeholder="审核状态">
                                        <el-option label="已审核" value="1"></el-option>
                                        <el-option label="未审核" value="2"></el-option>
                <el-tab-pane label="分销员管理" name="first">
                    <el-row style="display:flex;align-items: center;">
                        <el-col>
                            <el-button type="primary" @click="addSaleMan()">新增分销员</el-button>
                        </el-col>
                        <el-col>
                            <el-form ref="form" :model="form" inline >
                                <el-form-item label="审核状态" prop="shenheState">
                                    <el-select v-model="form.shenheState" placeholder="请选择">
                                        <el-option
                                                v-for="item in shenheStateList"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value"
                                        >
                                        </el-option>
                                    </el-select>
                                    <el-select v-model="fenxiaoGrade" placeholder="分销员等级">
                                        <el-option label="初始等级" value="1"></el-option>
                                        <el-option label="合伙人" value="2"></el-option>
                                </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-button type="primary" @click="submits()">搜索</el-button>
                                    <el-button type="primary" @click="submits()">重置</el-button>
                                </el-col>
                            </el-row>
                        </form>
                        <template>
                            <el-table
                                    ref="multipleTable"
                                    :data="tableData"
                                    tooltip-effect="dark"
                                    style="width: 100%"
                                    @selection-change="handleSelectionChange">
                                </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 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="name"
                                        label="分销员姓名"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="分销员姓名"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="邀请人"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="下级客户数"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="累计收益"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="待结算"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="等级"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="date"
                                        label="加入时间"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="状态"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        prop="name"
                                        label="来源"
                                        width="180">
                                </el-table-column>
                                <el-table-column
                                        fixed="right"
                                        label="操作"
                                        width="100">
                                        label="头像" width="100">
                                    <template slot-scope="scope">
                                        <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
                                       @size-change="changePageSize"
                                       @current-change="changeCurrentPage"
                                       :current-page="fxyList.currentPage"
                                       :page-sizes="[10, 20, 30, 50]"
                                       :page-size="fxyList.pageSize"
                                       layout="total, sizes, prev, pager, next, jumper"
                                       :total="fxyList.total">
                        </el-pagination>
                    </el-row>
                </el-tab-pane>
                <el-tab-pane label="分佣方案" name="second">
                    <template>
@@ -169,9 +194,29 @@
                        <el-button type="primary" @click="submit()">保存</el-button>
                    </el-row>
                </el-tab-pane>
                <el-tab-pane label="分享图片上传" name="fourth">
                    <el-row>
                        <div class="ibox-content">
                            <form class="form-horizontal" id="dataform"
                                  onsubmit="javascripr:return false;">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">门店照片</label>
                                    <div class="col-sm-8">
                                        <input autocomplete="off"   v-model="fxtp.paramValue" name="shopImag" id="info6"
                                               class="form-control  upload-input" type="text" /> <a
                                            class="btn btn-primary radius upload-a">选择图片
                                    </a>
                                    </div>
                                </div>
                                <el-row justify="center" type="flex">
                                    <el-button type="primary" @click="submittp(paramValue)">保存</el-button>
                                </el-row>
                            </form>
                        </div>
                    </el-row>
                </el-tab-pane>
            </el-tabs>
        </el-row>
    </el-form>
</div>
</body>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
@@ -180,27 +225,62 @@
<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>
    //百度编辑器
    MUI.initImgUpload(".upload-input");
    var ue = {};
    var app = new Vue({
        el: '#app',
        data: {
            shenheState: "",
            fxy:[],
            fenxiaoGrade: "",
            tableData:[],
            tgwa: "",
            activeName: 'first',
            multipleSelection: [],
            jfyxq:[],
            fxtp:{},
            jfdxj:[],
            mdjf:[],
            scjf:[],
            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();
            window.addEventListener("keydown", this.keydown);
            //初始化编辑器
            ue = UE.getEditor('description');
            //百度编辑器
            MUI.initImgUpload(".upload-input");
        },
        mounted: function () {
        },
@@ -209,6 +289,10 @@
            loadInfo() {
                let _this = this;
                _this.loadParamSetting();
                _this.getSalemanGradeList();
            },
            submittp(paramValue) {
                alert(paramValue);
            },
            toggleSelection(rows) {
                if (rows) {
@@ -227,14 +311,136 @@
            },
            loadParamSetting() {
                let _this = this;
                //加载配置
                let data=_this.getRequestParam();
                data.pageSize=_this.fxyList.pageSize;
                data.pageNum=_this.fxyList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data: {},
                    url: basePath + '/score/ruleSetting/selectScoreRule',
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanApplyList',
                    callback: function (data) {
                        _this.jfyxq = data.mapInfo.jfyxq;
                        console.log("over");
                        _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();
            },
            keydown(evt){
                if(evt.keyCode==13) {
                    this.search();
                }
            },
            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(row){
                layer.full(layer.open({
                    type: 2,
                    title: "修改等级",
                    maxmin: true,
                    area: [MUI.SIZE_L, '500px'],
                    content : [ basePath + '/admin/redirect/fenxiao/fenxiao-update?userId=' + row.userId ]
                }));
            },
            //审核
            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();
                    }
                });
            },