From a24cea1b37de9ae98d7f25c13b60eecd0280f534 Mon Sep 17 00:00:00 2001
From: jyy <jyy>
Date: Tue, 13 Jul 2021 17:52:33 +0800
Subject: [PATCH] 修复bug

---
 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html |   90 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 68 insertions(+), 22 deletions(-)

diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html
index 5582db7..71bded8 100644
--- a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html
+++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html
@@ -18,12 +18,6 @@
         .panel-body{
             overflow: hidden;
         }
-        .rowPanel{
-            background: #ffffff;
-            padding: 0px 10px ;
-            padding-top: 10px;
-            margin: 0px 0px 10px 0px;
-        }
         .paginationStyle{
             background: #ffffff;
             padding: 10px 10px;
@@ -34,33 +28,50 @@
 </head>
 <body>
 <div class="panel-body" id="app">
-    <el-row class="rowPanel"  >
-        <el-form ref="form" :model="form" inline >
-            <el-form-item prop="nickName">
-                <el-input v-model="form.nickName" placeholder="请输入会员姓名"></el-input>
-            </el-form-item>
+    <el-row style="display:flex;align-items: center;text-align: right;">
+        <el-col>
+            <el-form ref="form" :model="form" inline >
+                <el-form-item prop="nickName">
+                    <el-input v-model="form.nickName" placeholder="请输入会员姓名"></el-input>
+                </el-form-item>
 
-            <el-button type="primary" @click="search" >搜索</el-button>
-            <el-button @click="resetForm('form')">重置</el-button>
-        </el-form>
+                <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-row class="table-style"  style="margin-left: 50px;">
         <el-table id="proj" :data="table.rows"  :height="height" stripe @sort-change="sortChange">
             <el-table-column
-                    prop="userId"
-                    label="订单号"
-                    width="180">
+                    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="分销员昵称"
+                    prop="phone"
+                    label="手机号码">
+            </el-table-column>
+            <el-table-column
+                    prop="createTime"
+                    label="注册时间">
+            </el-table-column>
+            <el-table-column
+                    prop="salesGrade"
+                    label="分销等级"
                     width="180">
+                <template slot-scope="scope">
+                    <el-select v-model="scope.row.proJbruserValue"  @focus="getDatalist(scope.row)" placeholder="请选择" filterable allow-create>
+                        <el-option v-for="item in salesGradeList " :key="item.id" :label="item.name" :value="item.id">
+                        </el-option>
+                    </el-select>
+                </template>
             </el-table-column>
             <el-table-column label="操作">
                 <template slot-scope="scope">
-                    <el-button type="text" size="small">设置为分销员</el-button>
+                    <el-button type="text" size="small" @click="addSaleManApply(scope.row)">设置为分销员</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -102,6 +113,8 @@
                 order:'',
                 sort:''
             },
+            proJbruserValue : "",
+            salesGradeList: [],
             height:'calc(100vh - 240px)',
         },
         created: function () {
@@ -109,6 +122,39 @@
             window.addEventListener("keydown", this.keydown);
         },
         methods: {
+            //设置为分销员
+            addSaleManApply(row){
+                let _this = this;
+                let userId = row.userId;
+                let openId = row.openId;
+                let gradeId = row.proJbruserValue;
+                let obj = {
+                    userId: userId,
+                    openId: openId,
+                    gradeId: gradeId,
+                }
+                AjaxProxy.requst({
+                    app: _this,
+                    data:obj,
+                    url: basePath + '/fenXiao/fenXiaoUser/addSaleManApply',
+                    callback: function (data) {
+                        _this.$message.success(data.info);
+                        this.loadData();
+                    }
+                });
+            },
+            // select下拉框获取焦点的时候查询对应的下拉框数据源
+            getDatalist(row) {
+                let _this = this;
+                AjaxProxy.requst({
+                    app: _this,
+                    data:[],
+                    url: basePath + '/fenXiao/fenXiaoUser/getShopSalesmanGrade',
+                    callback: function (data) {
+                        _this.salesGradeList = data.mapInfo.salesGrade;
+                    }
+                });
+            },
             changePageSize(val) {
                 this.table.pageSize = val;
                 this.loadData();

--
Gitblit v1.9.1