Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product
commit
711b61ca25
|
@ -53,11 +53,7 @@ export function exportUserExcel(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 用户状态修改
|
// 用户状态修改
|
||||||
export function changeUserStatus(id, status) {
|
export function changeUserStatus(data) {
|
||||||
const data = {
|
|
||||||
id,
|
|
||||||
status
|
|
||||||
}
|
|
||||||
return request({
|
return request({
|
||||||
url: '/member/user/update-status',
|
url: '/member/user/update-status',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
|
|
@ -2,12 +2,23 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||||
<el-form-item label="组织id" prop="orgId">
|
<el-form-item label="所属组织" prop="orgId">
|
||||||
<el-input v-model="queryParams.orgId" placeholder="请输入组织id" clearable @keyup.enter.native="handleQuery"/>
|
<treeselect style="width: 240px;" v-model="queryParams.orgId" :options="deptOptions" :show-count="true"
|
||||||
|
:clearable="false"
|
||||||
|
placeholder="请选择所属组织" :normalizer="normalizer"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="会员id" prop="userId">
|
<el-form-item label="启用状态" prop="status">
|
||||||
<el-input v-model="queryParams.userId" placeholder="请输入会员id" clearable @keyup.enter.native="handleQuery"/>
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||||
|
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="推广员名称" prop="nickname">
|
||||||
|
<el-input v-model="queryParams.nickname" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号" prop="mobile">
|
||||||
|
<el-input v-model="queryParams.mobile" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
|
@ -19,38 +30,41 @@
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||||
v-hasPermi="['member:promoter:create']">新增</el-button>
|
v-hasPermi="['member:promoter:create']">新增
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport"
|
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport"
|
||||||
v-hasPermi="['system:user:import']">导入</el-button>
|
v-hasPermi="['system:user:import']">导入
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
<!-- <el-col :span="1.5">-->
|
||||||
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"-->
|
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"-->
|
||||||
<!-- v-hasPermi="['member:promoter:export']">导出</el-button>-->
|
<!-- v-hasPermi="['member:promoter:export']">导出</el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
<el-table-column label="编号" align="center" prop="id"/>
|
||||||
<el-table-column label="推广员名称" align="center" prop="nickname" />
|
<el-table-column label="推广员名称" align="center" prop="nickname"/>
|
||||||
<el-table-column label="手机号" align="center" prop="mobile" />
|
<el-table-column label="手机号" align="center" prop="mobile"/>
|
||||||
<el-table-column label="所属组织" align="center" prop="orgName" />
|
<el-table-column label="所属组织" align="center" prop="orgName"/>
|
||||||
<el-table-column label="启用状态" align="center" prop="status" >
|
<el-table-column label="启用状态" align="center" prop="status">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)" />
|
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1"
|
||||||
|
@change="handleStatusChange(scope.row)"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['member:promoter:update']">修改</el-button>
|
v-hasPermi="['member:promoter:update']">修改
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
</el-button>
|
||||||
v-hasPermi="['member:promoter:delete']">修改密码</el-button>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleUpdatePassword(scope.row)"
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleStatusChange(scope.row)"
|
v-hasPermi="['member:promoter:delete']">修改密码
|
||||||
v-hasPermi="['member:promoter:delete']">禁用</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -60,12 +74,24 @@
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="组织id" prop="orgId">
|
<el-form-item label="所属组织" prop="orgId">
|
||||||
<el-input v-model="form.orgId" placeholder="请输入组织id" />
|
<treeselect style="width: 240px;" v-model="form.orgId" :options="deptOptions" :show-count="true"
|
||||||
|
:clearable="false"
|
||||||
|
placeholder="请选择所属组织" :normalizer="normalizer"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="会员id" prop="userId">
|
<el-form-item label="启用状态" prop="status">
|
||||||
<el-input v-model="form.userId" placeholder="请输入会员id" />
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value" :label="parseInt(dict.value)">{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="推广员姓名" prop="nickname">
|
||||||
|
<el-input v-model="form.nickname" placeholder="请输入"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="推广员手机号" prop="mobile">
|
||||||
|
<el-input v-model="form.mobile" placeholder="请输入"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -81,11 +107,13 @@
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
<div class="el-upload__tip text-center" slot="tip">
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
<!-- <div class="el-upload__tip" slot="tip">-->
|
<!-- <div class="el-upload__tip" slot="tip">-->
|
||||||
<!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据-->
|
<!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||||
|
@click="importTemplate">下载模板
|
||||||
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -93,30 +121,62 @@
|
||||||
<el-button @click="upload.open = false">取 消</el-button>
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 修改密码 -->
|
||||||
|
<el-dialog title="修改密码" :visible.sync="updatePassword.show" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="updatePasswordForm" :rules="passwrodRules" label-width="80px">
|
||||||
|
<el-form-item label="密码" prop="title">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="确认密码" prop="picUrl">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="updatePassword.show = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createPromoter, updatePromoter, deletePromoter, getPromoter, getPromoterPage, importTemplate,exportPromoterExcel } from "@/api/member/promoter";
|
import {
|
||||||
|
createPromoter,
|
||||||
|
updatePromoter,
|
||||||
|
deletePromoter,
|
||||||
|
getPromoter,
|
||||||
|
getPromoterPage,
|
||||||
|
importTemplate,
|
||||||
|
exportPromoterExcel
|
||||||
|
} from '@/api/member/promoter';
|
||||||
import {
|
import {
|
||||||
changeUserStatus
|
changeUserStatus
|
||||||
} from "@/api/member/user";
|
} from '@/api/member/user';
|
||||||
import {getBaseHeader} from "@/utils/request";
|
import {listSimpleDepts} from '@/api/system/dept';
|
||||||
import {CommonStatusEnum} from "@/utils/constants";
|
import {listSimplePosts} from '@/api/system/post';
|
||||||
import {DICT_TYPE} from "@/utils/dict";
|
import {getBaseHeader} from '@/utils/request';
|
||||||
|
import {CommonStatusEnum} from '@/utils/constants';
|
||||||
|
import {DICT_TYPE} from '@/utils/dict';
|
||||||
|
import Treeselect from '@riophae/vue-treeselect';
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
|
||||||
|
import ImageUpload from '@/components/ImageUpload/index.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Promoter",
|
name: 'Promoter',
|
||||||
computed: {
|
computed: {
|
||||||
DICT_TYPE() {
|
DICT_TYPE() {
|
||||||
return DICT_TYPE
|
return DICT_TYPE
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
ImageUpload,
|
||||||
|
Treeselect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
|
deptOptions: undefined,
|
||||||
// 导出遮罩层
|
// 导出遮罩层
|
||||||
exportLoading: false,
|
exportLoading: false,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
|
@ -126,7 +186,7 @@ export default {
|
||||||
// 推广员列表
|
// 推广员列表
|
||||||
list: [],
|
list: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: '',
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 用户导入参数
|
// 用户导入参数
|
||||||
|
@ -134,7 +194,7 @@ export default {
|
||||||
// 是否显示弹出层(用户导入)
|
// 是否显示弹出层(用户导入)
|
||||||
open: false,
|
open: false,
|
||||||
// 弹出层标题(用户导入)
|
// 弹出层标题(用户导入)
|
||||||
title: "推广员导入",
|
title: '推广员导入',
|
||||||
// 是否禁用上传
|
// 是否禁用上传
|
||||||
isUploading: false,
|
isUploading: false,
|
||||||
// 是否更新已经存在的用户数据
|
// 是否更新已经存在的用户数据
|
||||||
|
@ -144,6 +204,11 @@ export default {
|
||||||
// 上传的地址
|
// 上传的地址
|
||||||
url: process.env.VUE_APP_BASE_API + '/admin-api/member/promoter/import'
|
url: process.env.VUE_APP_BASE_API + '/admin-api/member/promoter/import'
|
||||||
},
|
},
|
||||||
|
updatePassword: {
|
||||||
|
show: false,
|
||||||
|
userId: ''
|
||||||
|
},
|
||||||
|
updatePasswordForm: {},
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
|
@ -155,15 +220,71 @@ export default {
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
orgId: [{ required: true, message: "组织id不能为空", trigger: "blur" }],
|
orgId: [{
|
||||||
userId: [{ required: true, message: "会员id不能为空", trigger: "blur" }],
|
required: true,
|
||||||
|
message: '请选择所属组织',
|
||||||
|
trigger: 'blur'
|
||||||
|
}],
|
||||||
|
status: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择状态',
|
||||||
|
trigger: 'blur'
|
||||||
|
}],
|
||||||
|
nickname: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}],
|
||||||
|
mobile: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入手机号',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||||
|
message: '请输入正确的手机号码',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getTreeselect();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 格式化部门的下拉框
|
||||||
|
normalizer(node) {
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.name,
|
||||||
|
children: node.children
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询部门下拉树结构 + 岗位下拉 */
|
||||||
|
getTreeselect() {
|
||||||
|
listSimpleDepts().then(response => {
|
||||||
|
// 处理 deptOptions 参数
|
||||||
|
this.deptOptions = [];
|
||||||
|
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
||||||
|
});
|
||||||
|
listSimplePosts().then(response => {
|
||||||
|
// 处理 postOptions 参数
|
||||||
|
this.postOptions = [];
|
||||||
|
this.postOptions.push(...response.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 筛选节点
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.name.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
// 节点单击事件
|
||||||
|
handleNodeClick(data) {
|
||||||
|
this.queryParams.deptId = data.id;
|
||||||
|
},
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -179,6 +300,11 @@ export default {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.reset();
|
this.reset();
|
||||||
},
|
},
|
||||||
|
handleUpdatePassword(row) {
|
||||||
|
this.updatePasswordForm = {}
|
||||||
|
this.updatePassword.show = true
|
||||||
|
this.updatePassword.userId = row.userId
|
||||||
|
},
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
|
@ -186,7 +312,7 @@ export default {
|
||||||
orgId: undefined,
|
orgId: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm('form');
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
@ -195,35 +321,32 @@ export default {
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm('queryForm');
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加推广员";
|
this.title = '添加推广员';
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id;
|
this.form = row
|
||||||
getPromoter(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改推广员";
|
this.title = '修改推广员';
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updatePromoter(this.form).then(response => {
|
updatePromoter(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess('修改成功');
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
|
@ -231,7 +354,7 @@ export default {
|
||||||
}
|
}
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
createPromoter(this.form).then(response => {
|
createPromoter(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
|
@ -240,21 +363,26 @@ export default {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
this.$modal.confirm('是否确认删除推广员编号为"' + id + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除推广员编号为"' + id + '"的数据项?').then(function () {
|
||||||
return deletePromoter(id);
|
return deletePromoter(id);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess('删除成功');
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 用户状态修改
|
// 用户状态修改
|
||||||
handleStatusChange(row) {
|
handleStatusChange(row) {
|
||||||
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "禁用";
|
console.log('row', row)
|
||||||
this.$modal.confirm('您确认要"' + text + '""' + row.nickname + '"推广员吗?').then(function() {
|
let text = row.status === CommonStatusEnum.ENABLE ? '启用' : '禁用';
|
||||||
return changeUserStatus(row.user_id, row.status);
|
this.$modal.confirm('您确认要"' + text + '""' + row.nickname + '"推广员吗?').then(function () {
|
||||||
|
return changeUserStatus({
|
||||||
|
id: row.userId,
|
||||||
|
status: row.status
|
||||||
|
});
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$modal.msgSuccess(text + "成功");
|
this.$modal.msgSuccess(text + '成功');
|
||||||
}).catch(function() {
|
}).catch(function () {
|
||||||
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
|
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
|
||||||
: CommonStatusEnum.ENABLE;
|
: CommonStatusEnum.ENABLE;
|
||||||
});
|
});
|
||||||
|
@ -271,11 +399,12 @@ export default {
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.$download.excel(response, '推广员.xls');
|
this.$download.excel(response, '推广员.xls');
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 导入按钮操作 */
|
/** 导入按钮操作 */
|
||||||
handleImport() {
|
handleImport() {
|
||||||
this.upload.title = "推广员导入";
|
this.upload.title = '推广员导入';
|
||||||
this.upload.open = true;
|
this.upload.open = true;
|
||||||
},
|
},
|
||||||
/** 下载模板操作 */
|
/** 下载模板操作 */
|
||||||
|
@ -307,7 +436,7 @@ export default {
|
||||||
for (const username in data.failureUsernames) {
|
for (const username in data.failureUsernames) {
|
||||||
text += '<br /> ' + username + ':' + data.failureUsernames[username];
|
text += '<br /> ' + username + ':' + data.failureUsernames[username];
|
||||||
}
|
}
|
||||||
this.$alert(text, "导入结果", { dangerouslyUseHTMLString: true });
|
this.$alert(text, '导入结果', {dangerouslyUseHTMLString: true});
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
// 提交上传文件
|
// 提交上传文件
|
||||||
|
|
|
@ -271,6 +271,10 @@ export default {
|
||||||
required: true,
|
required: true,
|
||||||
message: '店铺负责人号码不能为空',
|
message: '店铺负责人号码不能为空',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
|
},{
|
||||||
|
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||||
|
message: '请输入正确的手机号码',
|
||||||
|
trigger: 'blur'
|
||||||
}],
|
}],
|
||||||
introduction: [{
|
introduction: [{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -279,12 +283,16 @@ export default {
|
||||||
}],
|
}],
|
||||||
serviceTime: [{
|
serviceTime: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '服务不能为空',
|
message: '服务时间不能为空',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}],
|
}],
|
||||||
serviceMobile: [{
|
serviceMobile: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '服务不能为空',
|
message: '服务电话不能为空',
|
||||||
|
trigger: 'blur'
|
||||||
|
},{
|
||||||
|
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||||
|
message: '请输入正确的手机或座机号码',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue