xiaoyong931011
2021-03-14 000e2719d57fd6cfc94fb340730ab3722d6c47cb
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html
@@ -55,7 +55,8 @@
                    <span style="font-size: 20px;">{{basicdetail.nickname}} </span>
                </el-col>
                <el-col :span="3">
                    <el-select v-model="basicdetail.grade" @focus="getDatalist()" placeholder="请选择" filterable allow-create>
                    <el-select v-model="basicdetail.grade" @focus="getDatalist()" @change="changeSaleManGrade(basicdetail.grade)" 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-col>
@@ -129,14 +130,11 @@
                                type="selection">
                        </el-table-column>
                        <el-table-column
                                label="头像" width="100">
                                label="客户">
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                {{scope.row.nickName}}
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="nickname"
                                label="分销员" width="100">
                        </el-table-column>
                        <el-table-column
                                prop="createTime"
@@ -154,12 +152,14 @@
                        <el-table-column
                                label="客户状态">
                            <template slot-scope="scope">
                                <span v-if="scope.row.doneNum == 0">已成交</span>
                                <span v-if="scope.row.doneNum > 0">未成交</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="openExamineSsaleManApply(scope.row)">解绑</el-button>
                                    <el-button type="primary" size="mini" @click="openExaminesaleMan(scope.row)">解绑</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
@@ -195,14 +195,11 @@
                                type="selection">
                        </el-table-column>
                        <el-table-column
                                label="头像" width="100">
                                label="客户">
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                {{scope.row.nickName}}
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="nickname"
                                label="分销员" width="100">
                        </el-table-column>
                        <el-table-column
                                prop="createTime"
@@ -217,15 +214,10 @@
                                <span v-if="scope.row.applyWay == 4">手动添加</span>
                            </template>
                        </el-table-column>
                        <el-table-column
                                label="客户状态">
                            <template slot-scope="scope">
                            </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="openExamineSsaleManApply(scope.row)">解绑</el-button>
                                    <el-button type="primary" size="mini" @click="openExaminesaleMan(scope.row)">解绑</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
@@ -240,6 +232,86 @@
                                   :page-size="lowLevelList.pageSize"
                                   layout="total, sizes, prev, pager, next, jumper"
                                   :total="lowLevelList.total">
                    </el-pagination>
                </el-row>
            </el-tab-pane>
            <el-tab-pane label="收益订单" name="third">
                <el-row style="display:flex;align-items: center;">
                    <el-form ref="formOrder" :model="formOrder" inline >
                        <el-form-item label="结算状态" prop="orderType">
                            <el-select v-model="formOrder.orderType" placeholder="请选择">
                                <el-option
                                        v-for="item in orderTypeList"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                >
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item prop="userName">
                            <el-input v-model="formOrder.userName" placeholder="请输入会员姓名"></el-input>
                        </el-form-item>
                        <el-button type="primary" @click="searchFormOrder" >搜索</el-button>
                        <el-button @click="resetFormOrder('formOrder')">重置</el-button>
                    </el-form>
                </el-row>
                <el-row class="table-style" >
                    <el-table id="proj" :data="orderLevelList.rows"  :height="height" stripe:true  @sort-change="sortChange">
                        <el-table-column
                                prop="orderNo"
                                label="订单编号">
                        </el-table-column>
                        <el-table-column
                                prop="orderMoney"
                                label="实付金额">
                        </el-table-column>
                        <el-table-column
                                prop="storeName"
                                label="下单门店">
                        </el-table-column>
                        <el-table-column
                                label="客户">
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                                {{scope.row.nickName}}
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="createTime"
                                label="时间">
                        </el-table-column>
                        <el-table-column
                                label="收益类型">
                            <template slot-scope="scope">
                                <span v-if="scope.row.revenueType == 1">推广收益</span>
                                <span v-if="scope.row.revenueType == 2">邀请收益</span>
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="amount"
                                label="收益金额">
                        </el-table-column>
                        <el-table-column
                                label="结算状态">
                            <template slot-scope="scope">
                                <span v-if="scope.row.orderStatus == 1">待结算</span>
                                <span v-if="scope.row.orderStatus == 2">已结算</span>
                                <span v-if="scope.row.orderStatus == 3">已退款</span>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-row>
                <el-row class="paginationStyle"  >
                    <el-pagination background
                                   @size-change="changePageSizeOrder"
                                   @current-change="changeCurrentPageOrder"
                                   :current-page="orderLevelList.currentPage"
                                   :page-sizes="[10, 20, 30, 50]"
                                   :page-size="orderLevelList.pageSize"
                                   layout="total, sizes, prev, pager, next, jumper"
                                   :total="orderLevelList.total">
                    </el-pagination>
                </el-row>
            </el-tab-pane>
@@ -265,17 +337,8 @@
        el: '#app',
        data: {
            activeName: 'first',
            shenheAgreeType : 2,
            shenheDisagreeType : 3,
            //条件查询审核状态
            shenheStateList:[
                {value:'',label:'全部'},
                {value:1,label:'未审核'},
                {value:2,label:'通过'},
                {value:3,label:'未通过'}
            ],
            basicdetail:{},
            //条件查询分销员等级
            //绑定客户
            form:{
                userName:'',
                order:'',
@@ -288,13 +351,33 @@
                pageSize:10,
                currentPage:1,
            },
            //邀请下级
            formlow:{
                userName:'',
                order:'',
                sort:''
            },
            lowLevelList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
            //收益订单
            formOrder:{
                userName:'',
                orderType:'',
                order:'',
                sort:''
            },
            //条件查询结算状态
            orderTypeList:[
                {value:'',label:'全部'},
                {value:1,label:'待结算'},
                {value:2,label:'已结算'},
                {value:3,label:'已退款'}
            ],
            orderLevelList:{
                rows:[],
                total:0,
                pageSize:10,
@@ -314,7 +397,25 @@
                let _this = this;
                _this.loadParamSetting();
                _this.loadParamSettinglow();
                _this.loadParamSettingOrder();
                _this.getDatalist();
            },
            //修改等级
            changeSaleManGrade(id){
                let _this = this;
                let obj = {
                    userId: userId,
                    gradeId: id,
                }
                AjaxProxy.requst({
                    app: _this,
                    data:obj,
                    url: basePath + '/fenXiao/fenXiaoUser/changeSaleManGrade',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        this.loadInfo();
                    }
                });
            },
            //绑定客户
            loadParamSetting() {
@@ -346,7 +447,7 @@
            //查询
            search:function(){
                this.fxyList.currentPage=1;
                this.loadInfo();
                this.loadParamSetting();
            },
            //重置
            resetForm(formName) {
@@ -354,11 +455,11 @@
            },
            changePageSize(val) {
                this.fxyList.pageSize = val;
                this.loadInfo();
                this.loadParamSetting();
            },
            changeCurrentPage(val) {
                this.fxyList.currentPage = val;
                this.loadInfo();
                this.loadParamSetting();
            },
            //邀请下级
            loadParamSettinglow() {
@@ -390,7 +491,7 @@
            //查询
            searchlow:function(){
                this.lowLevelList.currentPage=1;
                this.loadInfo();
                this.loadParamSettinglow();
            },
            //重置
            resetFormlow(formName) {
@@ -398,11 +499,56 @@
            },
            changePageSizelow(val) {
                this.lowLevelList.pageSize = val;
                this.loadInfo();
                this.loadParamSettinglow();
            },
            changeCurrentPagelow(val) {
                this.lowLevelList.currentPage = val;
                this.loadInfo();
                this.loadParamSettinglow();
            },
            //收益订单
            loadParamSettingOrder() {
                let _this = this;
                let data=_this.getRequestParamOrder();
                data.pageSize=_this.orderLevelList.pageSize;
                data.pageNum=_this.orderLevelList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanDetail',
                    callback: function (data) {
                        _this.orderLevelList.rows = data.mapInfo.orderRecords;
                        _this.orderLevelList.total = data.mapInfo.orderTotal;
                    }
                });
            },
            //查询参数
            getRequestParamOrder(){
                let _this = this;
                return   {
                    userName:_this.formOrder.userName,
                    orderType:_this.formOrder.orderType,
                    order:_this.formOrder.order,
                    sort:_this.formOrder.sort,
                    userId:userId,
                }
            },
            //查询
            searchFormOrder:function(){
                this.orderLevelList.currentPage=1;
                this.loadParamSettingOrder();
            },
            //重置
            resetFormOrder(formName) {
                this.$refs[formName].resetFields();
            },
            changePageSizeOrder(val) {
                this.orderLevelList.pageSize = val;
                this.loadParamSettingOrder();
            },
            changeCurrentPageOrder(val) {
                this.orderLevelList.currentPage = val;
                this.loadParamSettingOrder();
            },
            // select下拉框获取焦点的时候下拉框数据源---分销员等级
@@ -428,67 +574,43 @@
                    this.loadInfo();
                }
            },
            //新增分销员页面
            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('是否通过?', '审核', {
            //解绑
            openExamineSaleMan(row) {
                this.$confirm('是否解绑?', '解绑', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '通过',
                    cancelButtonText: '不通过',
                    confirmButtonText: '同意',
                    cancelButtonText: '取消',
                    type: 'info'
                }).then(() => {
                    //通过
                    this.examineSaleManApply(row,this.shenheAgreeType);
                    console.log("conform");
                    this.unbundlingSaleMan(row);
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        this.examineSaleManApply(row,this.shenheDisagreeType);
                        console.log("cancel");
                    }else{
                        //关闭按钮
                        console.log("close");
                        //this.$message({type: 'info',message: ''})
                    }
                });
            },
            examineSaleManApply(row,type){
            unbundlingSaleMan(row){
                let _this = this;
                let userId = row.userId;
                let obj = {
                    userId: userId,
                    applyState: type,
                }
                AjaxProxy.requst({
                    app: _this,
                    data:obj,
                    url: basePath + '/fenXiao/fenXiaoUser/examineSaleManApply',
                    url: basePath + '/fenXiao/fenXiaoUser/unbundlingSaleMan',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        this.loadData();
                        this.loadInfo();
                    }
                });
            },
            submit() {
            }
        }
    })
</script>