From d388e2788b7ef088d7cd40f901b0acdcec460bc3 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Thu, 01 Apr 2021 00:19:23 +0800
Subject: [PATCH] modify

---
 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html |  247 +++++++++++++++++++++++++++++++++---------------
 1 files changed, 169 insertions(+), 78 deletions(-)

diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
index ddfd73b..f9966e4 100644
--- a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
+++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
@@ -23,17 +23,43 @@
     <script type="text/javascript" charset="utf-8"
             th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script>
     <style>
+        .panel-body{
+            overflow: hidden;
+        }
         .paginationStyle{
             background: #ffffff;
             padding: 10px 10px;
             margin: 0px 0px 10px 0px;
             text-align: right;
         }
+        .avatar-uploader .el-upload {
+            border: 1px dashed #d9d9d9;
+            border-radius: 6px;
+            cursor: pointer;
+            position: relative;
+            overflow: hidden;
+        }
+        .avatar-uploader .el-upload:hover {
+            border-color: #409EFF;
+        }
+        .avatar-uploader-icon {
+            font-size: 28px;
+            color: #8c939d;
+            width: 178px;
+            height: 178px;
+            line-height: 178px;
+            text-align: center;
+        }
+        .avatar {
+            width: 178px;
+            height: 178px;
+            display: block;
+        }
     </style>
 </head>
 
 <body>
-<div class="ibox-content" id="app" v-cloak>
+<div class="panel-body" id="app" v-cloak>
         <el-row>
             <el-tabs v-model="activeName" >
                 <el-tab-pane label="分销员管理" name="first">
@@ -76,19 +102,25 @@
                                         type="selection">
                                 </el-table-column>
                                 <el-table-column
-                                        label="分销员">
+                                        label="分销员"
+                                        show-overflow-tooltip
+                                        width="150">
                                     <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="parentUser"
-                                        label="邀请人" width="100">
+                                        prop="parentUserNow"
+                                        label="当前上级">
                                 </el-table-column>
                                 <el-table-column
                                         prop="lowerLevelNum"
-                                        label="下级客户数" width="100">
+                                        label="推广客户">
+                                </el-table-column>
+                                <el-table-column
+                                        prop="invitedNum"
+                                        label="邀请下级">
                                 </el-table-column>
                                 <el-table-column
                                         prop="totalRevenue"
@@ -105,6 +137,7 @@
                                 <el-table-column
                                         prop="createTime"
                                         label="加入时间"
+                                        show-overflow-tooltip
                                         :formatter="formatDate">
                                 </el-table-column>
                                 <el-table-column
@@ -115,6 +148,10 @@
                                         <span v-if="scope.row.applyStatus == 3">未通过</span>
                                         <span v-if="scope.row.applyStatus == 4">系统删除</span>
                                     </template>
+                                </el-table-column>
+                                <el-table-column
+                                        prop="parentUser"
+                                        label="注册邀请人">
                                 </el-table-column>
                                 <el-table-column
                                         label="来源">
@@ -131,7 +168,7 @@
                                             <el-button type="primary" v-if="scope.row.applyStatus == 1" size="mini" @click="openExamineSaleManApply(scope.row)">审核</el-button>
                                             <el-button type="primary" v-if="scope.row.applyStatus == 2" size="mini" @click="openUpdateSaleManGrade(scope.row)">修改等级</el-button>
                                             <el-button type="primary" size="mini" @click="openUpdateSaleManGrade(scope.row)">详情</el-button>
-                                            <el-button type="primary" v-if="scope.row.applyStatus == 2" size="mini" @click="delSaleManGradeApply(scope.row)">删除</el-button>
+                                            <el-button type="danger" v-if="scope.row.applyStatus == 2" size="mini" @click="delSaleManGradeApply(scope.row)">删除</el-button>
                                         </el-row>
                                     </template>
                                 </el-table-column>
@@ -164,14 +201,14 @@
                                     prop="sealesCommission"
                                     label="推广提成 %">
                                 <template slot-scope="scope">
-                                    <el-input class="edit-input" v-model="scope.row.sealesCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="推广提成 %"></el-input>
+                                    <el-input class="edit-input" v-model="scope.row.sealesCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="推广提成"></el-input>
                                 </template>
                             </el-table-column>
                             <el-table-column
                                     prop="invitationCommission"
                                     label="邀请提成 %">
                                 <template slot-scope="scope">
-                                    <el-input class="edit-input" v-model="scope.row.invitationCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="邀请提成 %"></el-input>
+                                    <el-input class="edit-input" v-model="scope.row.invitationCommission" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="邀请提成"></el-input>
                                 </template>
                             </el-table-column>
                             <el-table-column
@@ -184,9 +221,9 @@
                             <el-table-column label="操作" width="240">
                                 <template slot-scope="scope">
                                     <el-row style="display:flex;">
-                                        <el-button type="primary" v-if="scope.row.isDefault == 1" size="mini" @click="addFyfa()">新增</el-button>
+                                        <el-button type="primary" v-if="scope.row.isDefault == 1" size="mini" @click="addFyfaReady()">新增</el-button>
                                         <el-button type="primary" size="mini" @click="updateFyfa(scope.row)">保存</el-button>
-                                        <el-button type="primary" v-if="scope.row.isDefault == 2" size="mini" @click="delFyfa(scope.row)">删除</el-button>
+                                        <el-button type="danger" v-if="scope.row.isDefault == 2" size="mini" @click="delFyfa(scope.row)">删除</el-button>
                                     </el-row>
                                 </template>
                             </el-table-column>
@@ -206,34 +243,32 @@
                 </el-tab-pane>
 
                 <el-tab-pane label="推广文案" name="third">
-                    <el-row>
-                        <script style="width: 100%; height: 500px" id="description" name="description"
-                                type="text/plain"></script>
+                    <p class="el-big-title">文案描述</p>
+                    <el-row justify="center" type="flex">
+                            <script style="height: 400px;width: 375px;" id="description" name="description"
+                                    type="text/plain">
+                            </script>
                     </el-row>
                     <el-row justify="center" type="flex">
-                        <el-button type="primary" @click="submit()">保存</el-button>
+                        <el-button type="primary" size="mini" @click="wamsSubmit()">保存</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-tab-pane label="推广图片" name="fourth">
+                    <p class="el-big-title">上传图片</p>
+                    <el-row justify="center" type="flex">
+                        <el-upload
+                                class="avatar-uploader"
+                                action="/admin/multipleUploadFile/doUpload"
+                                :show-file-list="false"
+                                :on-success="handleAvatarSuccess"
+                                :before-upload="beforeAvatarUpload">
+                            <img v-if="imageUrl" :src="imageUrl" class="avatar">
+                            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                    </el-row>
+                    <el-row justify="center" type="flex">
+                        <el-button type="primary" size="mini" @click="tgtpSubmit()">保存</el-button>
                     </el-row>
                 </el-tab-pane>
 
@@ -253,20 +288,19 @@
 
 <script>
     //百度编辑器
-    MUI.initImgUpload(".upload-input");
-    var ue = {};
+    var ue = {
+        initialFrameWidth :750
+    };
     var app = new Vue({
         el: '#app',
         data: {
             height:'calc(100vh - 240px)',
-            fxy:[],
-            fenxiaoGrade: "",
-            tgwa: "",
             activeName: 'first',
-            multipleSelection: [],
-            fxtp:{},
-            mdjf:[],
-            scjf:[],
+            fenxiaoGrade: "",
+            //推广文案
+            tgwa: {},
+            //图片上传
+            imageUrl: '',
             //分佣方案
             fyfaList:{
                 rows:[],
@@ -274,7 +308,6 @@
                 pageSize:10,
                 currentPage:1,
             },
-
             //分销员管理
             shenheAgreeType : 2,
             shenheDisagreeType : 3,
@@ -300,16 +333,12 @@
                 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 () {
         },
@@ -319,25 +348,84 @@
                 let _this = this;
                 _this.loadParamSetting();
                 _this.loadFyfaSetting();
+                _this.loadTgwaSetting();
+                _this.loadTgtpSetting();
                 _this.getSalemanGradeList();
             },
-            submittp(paramValue) {
-                alert(paramValue);
+            //推广文案
+            loadTgwaSetting() {
+                let _this = this;
+                AjaxProxy.requst({
+                    app: _this,
+                    data:[],
+                    url: basePath + '/fenXiao/fenXiaoUser/loadTgwaSetting',
+                    callback: function (data) {
+                        _this.tgwa = data.mapInfo.tgwa;
+                        var ue = UE.getEditor('description');
+                        ue.ready(function() {//编辑器初始化完成再赋值
+                            ue.setContent(_this.tgwa.paramValue3);  //赋值给UEditor
+                        });
+                    }
+                });
             },
-            toggleSelection(rows) {
-                if (rows) {
-                    rows.forEach(row => {
-                        this.$refs.multipleTable.toggleRowSelection(row);
-                    });
-                } else {
-                    this.$refs.multipleTable.clearSelection();
+            wamsSubmit(){
+                let _this = this;
+                let tgfa = ue.getContent();
+                let data= {
+                    tgfa:tgfa,
+                };
+                AjaxProxy.requst({
+                    app: _this,
+                    data:data,
+                    url: basePath + '/fenXiao/fenXiaoUser/updateTgjh',
+                    callback: function (data) {
+                        _this.$message.success(data.info);
+                        _this.loadTgwaSetting();
+                    }
+                });
+            },
+            //图片上传
+            loadTgtpSetting() {
+                let _this = this;
+                AjaxProxy.requst({
+                    app: _this,
+                    data:[],
+                    url: basePath + '/fenXiao/fenXiaoUser/loadTgtpSetting',
+                    callback: function (data) {
+                        _this.imageUrl = data.mapInfo.tgtp.paramValue;
+                    }
+                });
+            },
+            tgtpSubmit(){
+                let _this = this;
+                let imageUrl = _this.imageUrl;
+                let data= {
+                    imageUrl:imageUrl,
+                };
+                AjaxProxy.requst({
+                    app: _this,
+                    data:data,
+                    url: basePath + '/fenXiao/fenXiaoUser/updateTgtp',
+                    callback: function (data) {
+                        _this.$message.success(data.info);
+                        _this.loadTgtpSetting();
+                    }
+                });
+            },
+            handleAvatarSuccess(res, file) {
+                this.imageUrl = res.path;
+            },
+            beforeAvatarUpload(file) {
+                const isJPG = file.type === 'image/jpeg';
+                const isLt2M = file.size / 1024 / 1024 < 2;
+
+                if (!isJPG) {
+                    this.$message.error('上传头像图片只能是 JPG 格式!');
                 }
-            },
-            handleSelectionChange(val) {
-                this.multipleSelection = val;
-            },
-            handleClick(row) {
-                console.log(row);
+                if (!isLt2M) {
+                    this.$message.error('上传头像图片大小不能超过 2MB!');
+                }
+                return isJPG && isLt2M;
             },
             //分佣方案
             loadFyfaSetting() {
@@ -364,18 +452,23 @@
                 this.loadFyfaSetting();
             },
             //新增
-            addFyfa(){
+            addFyfaReady(){
                 let _this = this;
-                AjaxProxy.requst({
-                    app: _this,
-                    data:[],
-                    url: basePath + '/fenXiao/fenXiaoUser/addFyfa',
-                    callback: function (data) {
-                        _this.$message.success(data.info);
-                        _this.loadFyfaSetting();
-                    }
-                });
+                let fyfaReady = {};
+                _this.fyfaList.rows.push(fyfaReady);
             },
+            // addFyfa(){
+            //     let _this = this;
+            //     AjaxProxy.requst({
+            //         app: _this,
+            //         data:[],
+            //         url: basePath + '/fenXiao/fenXiaoUser/addFyfa',
+            //         callback: function (data) {
+            //             _this.$message.success(data.info);
+            //             _this.loadFyfaSetting();
+            //         }
+            //     });
+            // },
             updateFyfa(row){
                 let _this = this;
                 let id = row.id;
@@ -411,7 +504,7 @@
                 }).then(() => {
                     //通过
                     _this.delFyfaApply(row);
-                    _this.loadFyfaSetting();
+
                 }).catch(action => {
                     //不通过
                     if(action === 'cancel'){
@@ -435,6 +528,7 @@
                     url: basePath + '/fenXiao/fenXiaoUser/delFyfaApply',
                     callback: function (data) {
                         _this.$message.success(data.info);
+                        _this.loadFyfaSetting();
                     }
                 });
             },
@@ -500,11 +594,11 @@
                 }
             },
             changePageSize(val) {
-                this.table.pageSize = val;
+                this.fxyList.pageSize = val;
                 this.loadParamSetting();
             },
             changeCurrentPage(val) {
-                this.table.currentPage = val;
+                this.fxyList.currentPage = val;
                 this.loadParamSetting();
             },
             //时间格式化
@@ -614,9 +708,6 @@
                         _this.loadParamSetting();
                     }
                 });
-            },
-
-            submit() {
             }
         }
     })

--
Gitblit v1.9.1