|
@@ -1,7 +1,14 @@
|
|
|
+<!--
|
|
|
+ * @Descripttion: 分销员管理
|
|
|
+ * @version: 1.0
|
|
|
+ * @Author: zzx
|
|
|
+ * @Date: 2024-11-09 16:08:16
|
|
|
+ * @LastEditors: zzx
|
|
|
+ * @LastEditTime: 2024-11-19 16:08:16
|
|
|
+-->
|
|
|
<template>
|
|
|
-
|
|
|
<div class="app-container">
|
|
|
- <el-card class="filter-container" shadow="never">
|
|
|
+ <el-card class="filter-container" shadow="hover">
|
|
|
<div>
|
|
|
<i class="el-icon-search"></i>
|
|
|
<span>筛选搜索</span>
|
|
@@ -22,13 +29,13 @@
|
|
|
<el-input v-model="listQuery.phone" class="input-width" placeholder="请输入手机号码"
|
|
|
clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="分销员层级:">
|
|
|
- <el-select v-model="listQuery.value" clearable placeholder="请选择">
|
|
|
+ <el-form-item label="分销员层级:">
|
|
|
+ <el-select v-model="listQuery.level" clearable placeholder="请选择">
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label"
|
|
|
:value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item> -->
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="更新时间:">
|
|
|
<el-date-picker v-model="date" size="small" value-format="yyyy-MM-dd"
|
|
|
class="item-width-350 ml10" type="datetimerange" range-separator="至"
|
|
@@ -38,7 +45,7 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
- <el-card class="operate-container" shadow="never">
|
|
|
+ <el-card class="operate-container" shadow="hover">
|
|
|
<i class="el-icon-tickets"></i>
|
|
|
<span>数据列表</span>
|
|
|
</el-card>
|
|
@@ -48,7 +55,7 @@
|
|
|
<el-table-column label="分销员姓名" align="center" prop="userName"></el-table-column>
|
|
|
<el-table-column label="分销员层级" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.type == 1" type="info">普通用户</el-tag>
|
|
|
+ <el-tag v-if="scope.row.type == 1 || scope.row.type == null" type="info">普通用户</el-tag>
|
|
|
<el-tag v-else-if="scope.row.type == 2" type="success">一级分销</el-tag>
|
|
|
<el-tag v-else="scope.row.type == 3" type="warning">二级分销</el-tag>
|
|
|
</template>
|
|
@@ -64,7 +71,8 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="primary" plain @click="checkQrCode(scope.row)">
|
|
|
查看二维码</el-button>
|
|
|
- <el-button size="mini" type="success" plain @click="checkJunior(scope.$index, scope.row)">查看下级</el-button>
|
|
|
+ <el-button size="mini" type="success" plain
|
|
|
+ @click="checkJunior(scope.$index, scope.row)">查看下级</el-button>
|
|
|
<el-button size="mini" type="info" plain @click="userEdit(scope.row)">编辑</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -85,12 +93,15 @@
|
|
|
<el-input v-model="admin.userName" style="width: 250px"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="分销员层级:">
|
|
|
- <el-input type="text" disabled v-if="admin.type == 1" value="普通用户" style="width: 250px"></el-input>
|
|
|
- <el-input type="text" disabled v-else-if="admin.type == 2" value="一级分销" style="width: 250px"></el-input>
|
|
|
- <el-input type="text" disabled v-else="admin.type == 3" value="二级分销" style="width: 250px"></el-input>
|
|
|
+ <el-input type="text" disabled v-if="admin.type == 1 || admin.type == null" value="普通用户"
|
|
|
+ style="width: 250px"></el-input>
|
|
|
+ <el-input type="text" disabled v-else-if="admin.type == 2" value="一级分销"
|
|
|
+ style="width: 250px"></el-input>
|
|
|
+ <el-input type="text" disabled v-else="admin.type == 3" value="二级分销"
|
|
|
+ style="width: 250px"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="手机号:">
|
|
|
- <el-input v-model="admin.phone" type="number" style="width: 250px"></el-input>
|
|
|
+ <el-input v-model="admin.phone" disabled type="number" style="width: 250px"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="身份证号码:">
|
|
|
<el-input v-model="admin.card" type="text" :rows="5" style="width: 250px"></el-input>
|
|
@@ -102,42 +113,30 @@
|
|
|
<el-input v-model="admin.depositBank" type="text" :rows="5" style="width: 250px"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="佣金比例:">
|
|
|
- <el-input disabled v-model="admin.level" type="text" :rows="5"
|
|
|
- style="width: 250px"></el-input>
|
|
|
+ <el-input disabled v-model="admin.level" type="text" :rows="5" style="width: 250px"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="forbiddenDialogVisible = false" size="small">取 消</el-button>
|
|
|
- <el-button type="primary" @click="handleDialogConfirm()" size="small">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="confirmEdit" size="small">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="查看下级分销员" :visible.sync="checkDialogVisible" width="80%">
|
|
|
- <el-table ref="adminTable" :data="juniorlist" style="width: 100%" v-loading="listLoading" border>
|
|
|
- <el-table-column label="分销员编号" width="100" align="center" prop="number"></el-table-column>
|
|
|
- <el-table-column label="分销员姓名" align="center" prop="userName"></el-table-column>
|
|
|
- <el-table-column label="分销员层级" align="center">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="手机号" align="center" prop="phone"></el-table-column>
|
|
|
- <el-table-column label="身份证号码" align="center" prop="card"></el-table-column>
|
|
|
- <el-table-column label="银行卡号" align="center" prop="bankCard"></el-table-column>
|
|
|
- <el-table-column label="开户行" align="center" prop="depositBank"></el-table-column>
|
|
|
- <el-table-column label="佣金比例%" align="center" prop="level"></el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="peoplePagination">
|
|
|
- <el-pagination background @size-change="juniorhandleSizeChange" @current-change="juniorhandleCurrentChange"
|
|
|
- layout="total, sizes,prev, pager, next,jumper" :current-page.sync="juniorQuery.pageNum"
|
|
|
- :page-size="juniorQuery.pageSize" :page-sizes="[10, 15, 20]" :total="juniorTotal">
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
<el-dialog title="查看二维码" :visible.sync="checkQrCodeDialogVisible" width="20%">
|
|
|
- <span>二维码</span>
|
|
|
- <el-button type="primary" @click="handleDialogConfirm()" size="mini">下载二维码</el-button>
|
|
|
+ <div style="text-align: center;">
|
|
|
+ <el-image class="qrCode" style="" :src="qrCodeImg">
|
|
|
+ <div slot="error" class="image-slot">
|
|
|
+ <i class="el-icon-loading"></i>
|
|
|
+ </div>
|
|
|
+ </el-image>
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center;margin-top: 20px;">
|
|
|
+ <el-button type="success" @click="downloadQrCode" lazy size="mini">下载二维码</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { peopleList,getJuniorList,getQrcode } from "@/api/distribution";
|
|
|
+import { peopleList, getJuniorList, getQrcode,peopleEdit } from "@/api/distribution";
|
|
|
import { formatDate } from "@/utils/date";
|
|
|
|
|
|
const defaultListQuery = {
|
|
@@ -147,12 +146,7 @@ const defaultListQuery = {
|
|
|
phone: null,
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
- value: ''
|
|
|
-};
|
|
|
-const juniorListQuery = {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- userId: null,
|
|
|
+ level: ''
|
|
|
};
|
|
|
const defaultAdmin = {
|
|
|
id: null,
|
|
@@ -164,28 +158,22 @@ const defaultAdmin = {
|
|
|
status: 1,
|
|
|
};
|
|
|
export default {
|
|
|
- name: "upCheck",
|
|
|
+ name: "peopleManage",
|
|
|
data() {
|
|
|
return {
|
|
|
date: "",
|
|
|
+ qrCodeImg: "",
|
|
|
listQuery: Object.assign({}, defaultListQuery),
|
|
|
- juniorQuery: Object.assign({}, juniorListQuery),
|
|
|
list: null,
|
|
|
- juniorlist: null,
|
|
|
total: null,
|
|
|
- juniorTotal: null,
|
|
|
listLoading: false,
|
|
|
admin: Object.assign({}, defaultAdmin),
|
|
|
forbiddenDialogVisible: false,
|
|
|
- checkDialogVisible: false,
|
|
|
checkQrCodeDialogVisible: false,
|
|
|
options: [{
|
|
|
- value: 1,
|
|
|
- label: '普通用户'
|
|
|
- }, {
|
|
|
value: 2,
|
|
|
label: '一级'
|
|
|
- },{
|
|
|
+ }, {
|
|
|
value: 3,
|
|
|
label: '二级'
|
|
|
}],
|
|
@@ -216,29 +204,58 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 编辑
|
|
|
- userEdit(row){
|
|
|
- this.forbiddenDialogVisible= true;
|
|
|
- this.admin=row;
|
|
|
+ userEdit(row) {
|
|
|
+ this.forbiddenDialogVisible = true;
|
|
|
+ this.admin = row;
|
|
|
+ },
|
|
|
+ confirmEdit(){
|
|
|
+ let data={
|
|
|
+ userName: this.admin.userName,
|
|
|
+ adminUserId: this.admin.adminUserId,
|
|
|
+ bankCard: this.admin.bankCard,
|
|
|
+ card: this.admin.card,
|
|
|
+ depositBank: this.admin.depositBank,
|
|
|
+ }
|
|
|
+ peopleEdit({...data}).then(res => {
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.forbiddenDialogVisible = false;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 查看二维码
|
|
|
- checkQrCode(row){
|
|
|
+ checkQrCode(row) {
|
|
|
this.checkQrCodeDialogVisible = true;
|
|
|
- getQrcode({adminUserId:row.adminUserId,userId:row.id}).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
-
|
|
|
- }
|
|
|
+ getQrcode({ adminUserId: row.adminUserId, userId: row.id }).then(res => {
|
|
|
+ const blob = new Blob([res.data], { type: 'image/png' });
|
|
|
+ const objectUrl = URL.createObjectURL(blob);
|
|
|
+ this.qrCodeImg = objectUrl;
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 下载
|
|
|
+ downloadQrCode() {
|
|
|
+ const a = document.createElement('a');
|
|
|
+ a.href = this.qrCodeImg;
|
|
|
+ a.download = '二维码.jpg'; // 下载后的文件名
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
+ },
|
|
|
+
|
|
|
// 查看下级
|
|
|
checkJunior(index, row) {
|
|
|
- this.juniorQuery.userId=row.id
|
|
|
- this.checkDialogVisible = true;
|
|
|
- getJuniorList(this.juniorQuery).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.juniorList = res.data.list;
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$router.push({
|
|
|
+ name: "junior",
|
|
|
+ query: {
|
|
|
+ adminUserId: row.adminUserId,
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
handleResetSearch() {
|
|
|
this.listQuery = Object.assign({}, defaultListQuery);
|
|
@@ -256,15 +273,6 @@ export default {
|
|
|
this.listQuery.pageNum = val;
|
|
|
this.getList();
|
|
|
},
|
|
|
- juniorhandleSizeChange(val) {
|
|
|
- this.juniorQuery.pageNum = 1;
|
|
|
- this.juniorQuery.pageSize = val;
|
|
|
- // this.getList();
|
|
|
- },
|
|
|
- juniorhandleCurrentChange(val) {
|
|
|
- this.juniorQuery.pageNum = val;
|
|
|
- // this.getList();
|
|
|
- },
|
|
|
getList() {
|
|
|
this.listLoading = true;
|
|
|
peopleList(this.listQuery).then((response) => {
|
|
@@ -277,9 +285,15 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
-.peoplePagination{
|
|
|
+.peoplePagination {
|
|
|
margin-top: 10px;
|
|
|
display: flex;
|
|
|
justify-content: right;
|
|
|
}
|
|
|
+
|
|
|
+.qrCode {
|
|
|
+ width: 110px;
|
|
|
+ height: 110px;
|
|
|
+ border-radius: 6px;
|
|
|
+}
|
|
|
</style>
|