feature_0521
parent
c6f4005bfc
commit
ffb2a4ce39
@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div class="activity_code">
|
||||
<Table :loading="loading" border :columns="columns" :data="data"></Table>
|
||||
<Page
|
||||
:total="totalSize"
|
||||
:current="pageNum"
|
||||
:page-size="pageSize"
|
||||
show-elevator
|
||||
show-total
|
||||
placement="top"
|
||||
@on-change="handlePage"
|
||||
class-name="ks-page"
|
||||
></Page>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ActivityCode",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
totalSize: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
data: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handlePage(value) {
|
||||
this.pageNum = value;
|
||||
this.load();
|
||||
},
|
||||
load() {}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
@ -0,0 +1,9 @@
|
||||
<template> </template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "GuideCode",
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,327 +1,407 @@
|
||||
<style scoped>
|
||||
/deep/ .title-font {
|
||||
color: #4E5966;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/deep/ .name-font {
|
||||
font-size: 14px;
|
||||
color: #4E5966;
|
||||
}
|
||||
/deep/ .title-font {
|
||||
color: #4e5966;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/deep/ .name-font {
|
||||
font-size: 14px;
|
||||
color: #4e5966;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<row style="margin-left: 30px;margin-top: 30px">
|
||||
<!--表单-->
|
||||
<div style="text-align: left">
|
||||
<span class="title-font">用户信息</span>
|
||||
</div>
|
||||
<div style="text-align: left;margin-top: 20px">
|
||||
<Form style="text-align: left" :model="addFrom" :rules="addValidate" ref="addFrom">
|
||||
<Form-Item prop="userName">
|
||||
<span class="name-font" style="width: 80px;display: inline-block">用户名</span>
|
||||
<i-input placeholder="请输入用户名" style="width: 300px;" v-model="addFrom.userName"/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="account">
|
||||
<span class="name-font" style="width: 80px;display: inline-block">账号</span>
|
||||
<i-input placeholder="请输入账号" style="width: 300px;" v-model="addFrom.account"/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="mobil">
|
||||
<span class="name-font" style="width: 80px;display: inline-block">手机号</span>
|
||||
<i-input placeholder="请输入手机号" style="width: 300px;" v-model="addFrom.mobil"/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="password">
|
||||
<span class="name-font" style="width: 80px;display: inline-block">密码</span>
|
||||
<i-input type="text" placeholder="默认密码123456" style="width: 300px;" v-model="addFrom.password"/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="confirmPassword">
|
||||
<span class="name-font" style="width: 80px;display: inline-block">确认密码</span>
|
||||
<i-input type="text" placeholder="请确认密码" style="width: 300px;"
|
||||
v-model="addFrom.confirmPassword"/>
|
||||
</Form-Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
<!--角色-->
|
||||
<div style="text-align: left;margin-top: 30px">
|
||||
<span class="title-font">角色信息</span>
|
||||
</div>
|
||||
<div style="text-align: left;margin: 30px 0 0 30px">
|
||||
<RadioGroup v-for="item in roleList" :key="item.id" v-model="addFrom.roleId" style="margin-left: 15px"
|
||||
@on-change="roleChange(item)">
|
||||
<Radio :label="item.id">{{item.name}}</Radio>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
<row style="margin-left: 30px;margin-top: 30px">
|
||||
<!--表单-->
|
||||
<div style="text-align: left">
|
||||
<span class="title-font">用户信息</span>
|
||||
</div>
|
||||
<div style="text-align: left;margin-top: 20px">
|
||||
<Form
|
||||
style="text-align: left"
|
||||
:model="addFrom"
|
||||
:rules="addValidate"
|
||||
ref="addFrom"
|
||||
>
|
||||
<Form-Item prop="userName">
|
||||
<span class="name-font" style="width: 80px;display: inline-block"
|
||||
>用户名</span
|
||||
>
|
||||
<i-input
|
||||
placeholder="请输入用户名"
|
||||
style="width: 300px;"
|
||||
v-model="addFrom.userName"
|
||||
/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="account">
|
||||
<span class="name-font" style="width: 80px;display: inline-block"
|
||||
>账号</span
|
||||
>
|
||||
<i-input
|
||||
placeholder="请输入账号"
|
||||
style="width: 300px;"
|
||||
v-model="addFrom.account"
|
||||
/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="mobil">
|
||||
<span class="name-font" style="width: 80px;display: inline-block"
|
||||
>手机号</span
|
||||
>
|
||||
<i-input
|
||||
placeholder="请输入手机号"
|
||||
style="width: 300px;"
|
||||
v-model="addFrom.mobil"
|
||||
/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="password">
|
||||
<span class="name-font" style="width: 80px;display: inline-block"
|
||||
>密码</span
|
||||
>
|
||||
<i-input
|
||||
type="text"
|
||||
placeholder="默认密码123456"
|
||||
style="width: 300px;"
|
||||
v-model="addFrom.password"
|
||||
/>
|
||||
</Form-Item>
|
||||
<Form-Item prop="confirmPassword">
|
||||
<span class="name-font" style="width: 80px;display: inline-block"
|
||||
>确认密码</span
|
||||
>
|
||||
<i-input
|
||||
type="text"
|
||||
placeholder="请确认密码"
|
||||
style="width: 300px;"
|
||||
v-model="addFrom.confirmPassword"
|
||||
/>
|
||||
</Form-Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 40px" v-if="shopSelectDisplay">
|
||||
<span class="name-font" style="width: 80px;display: inline-block">店铺</span>
|
||||
<Select class="select-head" style="width: 300px;" clearable v-model="addFrom.shopId" placeholder="请选择店铺"
|
||||
filterable>
|
||||
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{item.name}}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<!--角色-->
|
||||
<div style="text-align: left;margin-top: 30px">
|
||||
<span class="title-font">角色信息</span>
|
||||
</div>
|
||||
<div style="text-align: left;margin: 30px 0 0 30px">
|
||||
<RadioGroup
|
||||
v-for="item in roleList"
|
||||
:key="item.id"
|
||||
v-model="addFrom.roleId"
|
||||
style="margin-left: 15px"
|
||||
@on-change="roleChange(item)"
|
||||
>
|
||||
<Radio :label="item.id">{{ item.name }}</Radio>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 40px" v-if="companySelectDisplay">
|
||||
<span class="name-font" style="width: 80px;display: inline-block">零售公司</span>
|
||||
<Select v-model="addFrom.companyId" filterable style="width: 300px;">
|
||||
<Option v-for="item in companyList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div style="margin-top: 40px" v-if="shopSelectDisplay">
|
||||
<span class="name-font" style="width: 80px;display: inline-block"
|
||||
>店铺</span
|
||||
>
|
||||
<Select
|
||||
class="select-head"
|
||||
style="width: 300px;"
|
||||
clearable
|
||||
v-model="addFrom.shopId"
|
||||
placeholder="请选择店铺"
|
||||
filterable
|
||||
>
|
||||
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{
|
||||
item.name
|
||||
}}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<!--确认返回-->
|
||||
<row style="margin-top: 40px">
|
||||
<Button type="primary" style="height:39px;width:101px" @click="addAccountConfirm()">完成</Button>
|
||||
<Button style="height:39px;width:101px;border:0" @click="addAccountCancel()">返回</Button>
|
||||
</row>
|
||||
<div style="margin-top: 40px" v-if="companySelectDisplay">
|
||||
<span class="name-font" style="width: 80px;display: inline-block"
|
||||
>零售公司</span
|
||||
>
|
||||
<Select v-model="addFrom.companyId" filterable style="width: 300px;">
|
||||
<Option v-for="item in companyList" :value="item.id" :key="item.id">{{
|
||||
item.name
|
||||
}}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<!--确认返回-->
|
||||
<row style="margin-top: 40px">
|
||||
<Button
|
||||
type="primary"
|
||||
style="height:39px;width:101px"
|
||||
@click="addAccountConfirm()"
|
||||
>完成</Button
|
||||
>
|
||||
<Button
|
||||
style="height:39px;width:101px;border:0"
|
||||
@click="addAccountCancel()"
|
||||
>返回</Button
|
||||
>
|
||||
</row>
|
||||
|
||||
|
||||
</row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import accountManagementAdd from '../../services/account/AccountManagementAdd'
|
||||
import accountManagement from "../../services/account/AccountManagement";
|
||||
import IncreaseData from "../../services/generalize/IncreaseData";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: "accountManagementAdd",
|
||||
addFrom: {
|
||||
userName: null,
|
||||
roleId: null,
|
||||
account: null,
|
||||
password: '123456',
|
||||
confirmPassword: '123456',
|
||||
shopId: null,
|
||||
type: null,
|
||||
companyId: null,
|
||||
mobil: null,
|
||||
},
|
||||
addValidate: {
|
||||
userName: [
|
||||
{required: true, message: '用户名不能为空', trigger: 'blur'},
|
||||
{min: 1, max: 8, message: '长度在 1 到 8 个字符', trigger: 'blur'},
|
||||
{pattern: /^[\u4e00-\u9fa5_0-9a-zA-Z]+$/, message: '只可以输入数字,字母,中文', trigger: 'blur'}
|
||||
],
|
||||
account: [
|
||||
{required: true, message: '账号不能为空', trigger: 'blur'},
|
||||
{min: 2, max: 8, message: '长度在 2 到 8 个字符', trigger: 'blur'},
|
||||
{pattern: /^[0-9a-zA-Z]*$/g, message: '只可以输入数字和字母', trigger: 'blur'},
|
||||
],
|
||||
mobil: [
|
||||
{pattern: /^[0-9]*$/g, message: '只可以输入数字', trigger: 'blur'},
|
||||
],
|
||||
password: [
|
||||
{required: true, message: '密码不能为空', trigger: 'blur'},
|
||||
{min: 6, max: 18, message: '长度在 6 到 18 个字符', trigger: 'blur'},
|
||||
{pattern: /^[0-9a-zA-Z]*$/g, message: '只可以输入数字和字母', trigger: 'blur'},
|
||||
],
|
||||
confirmPassword: [
|
||||
{required: true, message: '确认密码不能为空', trigger: 'blur'},
|
||||
{min: 6, max: 18, message: '长度在 6 到 18 个字符', trigger: 'blur'},
|
||||
{pattern: /^[0-9a-zA-Z]*$/g, message: '只可以输入数字和字母', trigger: 'blur'},
|
||||
],
|
||||
},
|
||||
roleList: [
|
||||
{
|
||||
id: 1,
|
||||
name: "系统管理员"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "运营人员"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "店长"
|
||||
},
|
||||
],
|
||||
//店铺下拉框
|
||||
shopList: [
|
||||
{
|
||||
id: 3,
|
||||
name: "店长"
|
||||
},
|
||||
],
|
||||
//控制店铺筛选框
|
||||
shopSelectDisplay: false,
|
||||
companyList: [],
|
||||
companySelectDisplay:false,
|
||||
}
|
||||
import accountManagementAdd from "../../services/account/AccountManagementAdd";
|
||||
import accountManagement from "../../services/account/AccountManagement";
|
||||
import IncreaseData from "../../services/generalize/IncreaseData";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: "accountManagementAdd",
|
||||
addFrom: {
|
||||
userName: null,
|
||||
roleId: null,
|
||||
account: null,
|
||||
password: "123456",
|
||||
confirmPassword: "123456",
|
||||
shopId: null,
|
||||
type: null,
|
||||
companyId: null,
|
||||
mobil: null,
|
||||
},
|
||||
addValidate: {
|
||||
userName: [
|
||||
{ required: true, message: "用户名不能为空", trigger: "blur" },
|
||||
{ min: 1, max: 8, message: "长度在 1 到 8 个字符", trigger: "blur" },
|
||||
{
|
||||
pattern: /^[\u4e00-\u9fa5_0-9a-zA-Z]+$/,
|
||||
message: "只可以输入数字,字母,中文",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
account: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 8, message: "长度在 2 到 8 个字符", trigger: "blur" },
|
||||
{
|
||||
pattern: /^[0-9a-zA-Z]*$/g,
|
||||
message: "只可以输入数字和字母",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
mobil: [
|
||||
{ pattern: /^[0-9]*$/g, message: "只可以输入数字", trigger: "blur" },
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: "密码不能为空", trigger: "blur" },
|
||||
{
|
||||
min: 6,
|
||||
max: 18,
|
||||
message: "长度在 6 到 18 个字符",
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
pattern: /^[0-9a-zA-Z]*$/g,
|
||||
message: "只可以输入数字和字母",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
confirmPassword: [
|
||||
{ required: true, message: "确认密码不能为空", trigger: "blur" },
|
||||
{
|
||||
min: 6,
|
||||
max: 18,
|
||||
message: "长度在 6 到 18 个字符",
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
pattern: /^[0-9a-zA-Z]*$/g,
|
||||
message: "只可以输入数字和字母",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
roleList: [
|
||||
{
|
||||
id: 1,
|
||||
name: "系统管理员",
|
||||
},
|
||||
mounted: function () {
|
||||
//设置面包屑
|
||||
this.bus.$emit('setHeader',{header:"添加账户"});
|
||||
//查询所有角色-下拉框
|
||||
this.listRoleInfo();
|
||||
|
||||
{
|
||||
id: 2,
|
||||
name: "运营人员",
|
||||
},
|
||||
methods: {
|
||||
//查询所有角色
|
||||
listRoleInfo() {
|
||||
let that = this;
|
||||
that.roleList = [];
|
||||
accountManagement.listRoleInfoApi({}, function (data) {
|
||||
data = data.data;
|
||||
if (data.code === '0001') {
|
||||
that.$Message.error("查询角色失败!");
|
||||
return;
|
||||
}
|
||||
if (data.code === '0000') {
|
||||
let row = data.results;
|
||||
for (let i = 0; i < row.length; i++) {
|
||||
that.roleList.push(row[i]);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加账号确定
|
||||
addAccountConfirm : function () {
|
||||
if(this.addFrom.userName){
|
||||
this.addFrom.userName = this.addFrom.userName.trim();
|
||||
}
|
||||
if(this.addFrom.password){
|
||||
this.addFrom.password = this.addFrom.password.trim();
|
||||
}
|
||||
if(this.addFrom.confirmPassword){
|
||||
this.addFrom.confirmPassword = this.addFrom.confirmPassword.trim();
|
||||
}
|
||||
if(this.addFrom.account){
|
||||
this.addFrom.account = this.addFrom.account.trim();
|
||||
}
|
||||
|
||||
this.$refs["addFrom"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.shopSelectDisplay && !this.addFrom.shopId) {
|
||||
this.$Message.info("店长必须选择店铺");
|
||||
return;
|
||||
}
|
||||
if(!this.addFrom.roleId) {
|
||||
this.$Message.info("必须选择角色");
|
||||
return;
|
||||
}
|
||||
if(this.addFrom.confirmPassword !== this.addFrom.password) {
|
||||
this.$Message.info("两次输入密码必须一致");
|
||||
return;
|
||||
}
|
||||
let that = this;
|
||||
//验证
|
||||
let request = {
|
||||
addFrom: JSON.stringify(that.addFrom)
|
||||
};
|
||||
accountManagementAdd.saveAccountInputApi(request, function (data) {
|
||||
data = data.data;
|
||||
if(data.code === '0001') {
|
||||
that.$Message.error("保存账号失败");
|
||||
return;
|
||||
}
|
||||
if(data.code === '0002') {
|
||||
that.$Message.info("账号已经存在(登录账号不能重复)");
|
||||
return;
|
||||
}
|
||||
if(data.code === '0000') {
|
||||
if (data.results == "0001"){
|
||||
that.$Message.error('添加失败!');
|
||||
}else if (data.results == "0002"){
|
||||
that.$Message.error('该工号已经被使用!');
|
||||
}else if (data.results == "0003"){
|
||||
that.$Message.error('该手机号已经被使用!');
|
||||
}else if (data.results == "0004"){
|
||||
that.$Message.error('该账号已经被使用!');
|
||||
}else if(data.results == "0000"){
|
||||
that.$Message.success("保存账号成功");
|
||||
that.$router.push({path:'/account/manager'});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
{
|
||||
id: 3,
|
||||
name: "店长",
|
||||
},
|
||||
],
|
||||
//店铺下拉框
|
||||
shopList: [
|
||||
{
|
||||
id: 3,
|
||||
name: "店长",
|
||||
},
|
||||
],
|
||||
//控制店铺筛选框
|
||||
shopSelectDisplay: false,
|
||||
companyList: [],
|
||||
companySelectDisplay: false,
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
//设置面包屑
|
||||
this.bus.$emit("setHeader", { header: "添加账户" });
|
||||
//查询所有角色-下拉框
|
||||
this.listRoleInfo();
|
||||
},
|
||||
methods: {
|
||||
//查询所有角色
|
||||
listRoleInfo() {
|
||||
let that = this;
|
||||
that.roleList = [];
|
||||
accountManagement.listRoleInfoApi({}, function(data) {
|
||||
data = data.data;
|
||||
if (data.code === "0001") {
|
||||
that.$Message.error("查询角色失败!");
|
||||
return;
|
||||
}
|
||||
if (data.code === "0000") {
|
||||
let row = data.results;
|
||||
for (let i = 0; i < row.length; i++) {
|
||||
that.roleList.push(row[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//添加账号确定
|
||||
addAccountConfirm: function() {
|
||||
if (this.addFrom.userName) {
|
||||
this.addFrom.userName = this.addFrom.userName.trim();
|
||||
}
|
||||
if (this.addFrom.password) {
|
||||
this.addFrom.password = this.addFrom.password.trim();
|
||||
}
|
||||
if (this.addFrom.confirmPassword) {
|
||||
this.addFrom.confirmPassword = this.addFrom.confirmPassword.trim();
|
||||
}
|
||||
if (this.addFrom.account) {
|
||||
this.addFrom.account = this.addFrom.account.trim();
|
||||
}
|
||||
|
||||
},
|
||||
// 添加账号取消
|
||||
addAccountCancel: function () {
|
||||
this.$router.push({path: '/account/manager'});
|
||||
},
|
||||
//角色改变
|
||||
roleChange(roleBean) {
|
||||
if (roleBean.code === 'DZ-DIANZHANG') {
|
||||
this.shopSelectDisplay = true;
|
||||
this.companySelectDisplay = false;
|
||||
this.addFrom.companyId = null;
|
||||
this.addFrom.type = 1;
|
||||
this.listOfShop();
|
||||
} else if(roleBean.code === "DG-DAOGOU"){
|
||||
this.shopSelectDisplay = true;
|
||||
this.companySelectDisplay = false;
|
||||
this.addFrom.companyId = null;
|
||||
this.addFrom.type = 4;
|
||||
this.listOfShop();
|
||||
}else if(roleBean.code === 'DG-YUNYING'){
|
||||
this.companySelectDisplay = true;
|
||||
this.shopSelectDisplay = false;
|
||||
this.addFrom.type = 3;
|
||||
this.allCompany();
|
||||
}else if(roleBean.code === 'GL-YUNYING'){
|
||||
this.companySelectDisplay = false;
|
||||
this.shopSelectDisplay = false;
|
||||
this.addFrom.type = 2;
|
||||
}else {
|
||||
this.shopSelectDisplay = false;
|
||||
this.addFrom.shopId = null;
|
||||
this.addFrom.companyId = null;
|
||||
}
|
||||
},
|
||||
//查询所有店铺
|
||||
listOfShop() {
|
||||
let that = this;
|
||||
that.shopList = [];
|
||||
let request = {
|
||||
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
|
||||
};
|
||||
accountManagement.listAllShopApi(request, function (data) {
|
||||
data = data.data;
|
||||
if (data.code === '0001') {
|
||||
that.$Message.error("查询店铺失败!");
|
||||
return;
|
||||
}
|
||||
if (data.code === '0000') {
|
||||
let row = data.results;
|
||||
for (let i = 0; i < row.length; i++) {
|
||||
that.shopList.push(row[i]);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
allCompany(){
|
||||
let that = this;
|
||||
let request = {
|
||||
userId:JSON.parse(sessionStorage.getItem("loginInfo")).userId
|
||||
};
|
||||
this.companyList = [];
|
||||
IncreaseData.listOfRetailCompany(request,function (data) {
|
||||
data = data.data;
|
||||
if (data.code === '0001') {
|
||||
that.$Message.error("查询零售公司出错!");
|
||||
return;
|
||||
}
|
||||
if (data.code === '0000') {
|
||||
data.results.forEach(da => {
|
||||
that.companyList.push(da);
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
this.$refs["addFrom"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (this.shopSelectDisplay && !this.addFrom.shopId) {
|
||||
this.$Message.info("店长必须选择店铺");
|
||||
return;
|
||||
}
|
||||
if (!this.addFrom.roleId) {
|
||||
this.$Message.info("必须选择角色");
|
||||
return;
|
||||
}
|
||||
if (this.addFrom.confirmPassword !== this.addFrom.password) {
|
||||
this.$Message.info("两次输入密码必须一致");
|
||||
return;
|
||||
}
|
||||
let that = this;
|
||||
//验证
|
||||
let request = {
|
||||
addFrom: JSON.stringify(that.addFrom),
|
||||
};
|
||||
accountManagementAdd.saveAccountInputApi(request, function(data) {
|
||||
data = data.data;
|
||||
if (data.code === "0001") {
|
||||
that.$Message.error("保存账号失败");
|
||||
return;
|
||||
}
|
||||
if (data.code === "0002") {
|
||||
that.$Message.info("账号已经存在(登录账号不能重复)");
|
||||
return;
|
||||
}
|
||||
if (data.code === "0000") {
|
||||
if (data.results == "0001") {
|
||||
that.$Message.error("添加失败!");
|
||||
} else if (data.results == "0002") {
|
||||
that.$Message.error("该工号已经被使用!");
|
||||
} else if (data.results == "0003") {
|
||||
that.$Message.error("该手机号已经被使用!");
|
||||
} else if (data.results == "0004") {
|
||||
that.$Message.error("该账号已经被使用!");
|
||||
} else if (data.results == "0000") {
|
||||
that.$Message.success("保存账号成功");
|
||||
that.$router.push({ path: "/account/manager" });
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 添加账号取消
|
||||
addAccountCancel: function() {
|
||||
this.$router.push({ path: "/account/manager" });
|
||||
},
|
||||
//角色改变
|
||||
roleChange(roleBean) {
|
||||
if (roleBean.code === "DZ-DIANZHANG") {
|
||||
this.shopSelectDisplay = true;
|
||||
this.companySelectDisplay = false;
|
||||
this.addFrom.companyId = null;
|
||||
this.addFrom.type = 1;
|
||||
this.listOfShop();
|
||||
} else if (roleBean.code === "DG-DAOGOU") {
|
||||
this.shopSelectDisplay = true;
|
||||
this.companySelectDisplay = false;
|
||||
this.addFrom.companyId = null;
|
||||
this.addFrom.type = 4;
|
||||
this.listOfShop();
|
||||
} else if (roleBean.code === "DG-YUNYING") {
|
||||
this.companySelectDisplay = true;
|
||||
this.shopSelectDisplay = false;
|
||||
this.addFrom.type = 3;
|
||||
this.allCompany();
|
||||
} else if (roleBean.code === "GL-YUNYING") {
|
||||
this.companySelectDisplay = false;
|
||||
this.shopSelectDisplay = false;
|
||||
this.addFrom.type = 2;
|
||||
} else {
|
||||
this.shopSelectDisplay = false;
|
||||
this.addFrom.shopId = null;
|
||||
this.addFrom.companyId = null;
|
||||
}
|
||||
},
|
||||
//查询所有店铺
|
||||
listOfShop() {
|
||||
let that = this;
|
||||
that.shopList = [];
|
||||
let request = {
|
||||
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
|
||||
};
|
||||
accountManagement.listAllShopApi(request, function(data) {
|
||||
data = data.data;
|
||||
if (data.code === "0001") {
|
||||
that.$Message.error("查询店铺失败!");
|
||||
return;
|
||||
}
|
||||
if (data.code === "0000") {
|
||||
let row = data.results;
|
||||
for (let i = 0; i < row.length; i++) {
|
||||
that.shopList.push(row[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
allCompany() {
|
||||
let that = this;
|
||||
let request = {
|
||||
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
|
||||
};
|
||||
this.companyList = [];
|
||||
IncreaseData.listOfRetailCompany(request, function(data) {
|
||||
data = data.data;
|
||||
if (data.code === "0001") {
|
||||
that.$Message.error("查询零售公司出错!");
|
||||
return;
|
||||
}
|
||||
if (data.code === "0000") {
|
||||
data.results.forEach((da) => {
|
||||
that.companyList.push(da);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
||||
@ -1,236 +1,247 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import Login from '@/pages/Login';
|
||||
import ExternalContact from '@/pages/ExternalContact';
|
||||
import Home from '@/pages/Home';
|
||||
import AccountManager from '@/pages/user/AccountManager';
|
||||
import AccountManagerAdd from '@/pages/user/AccountManagerAdd';
|
||||
import AccountManagementModify from '@/pages/user/AccountManagementModify';
|
||||
import AccountManagerUpload from '@/pages/user/AccountManagerUpload';
|
||||
import RoleManager from '@/pages/user/RoleManager';
|
||||
import IncreaseManager from '@/pages/shop/IncreaseManager';
|
||||
import Vue from "vue";
|
||||
import Router from "vue-router";
|
||||
import Login from "@/pages/Login";
|
||||
import ExternalContact from "@/pages/ExternalContact";
|
||||
import Home from "@/pages/Home";
|
||||
import AccountManager from "@/pages/user/AccountManager";
|
||||
import AccountManagerAdd from "@/pages/user/AccountManagerAdd";
|
||||
import AccountManagementModify from "@/pages/user/AccountManagementModify";
|
||||
import AccountManagerUpload from "@/pages/user/AccountManagerUpload";
|
||||
import RoleManager from "@/pages/user/RoleManager";
|
||||
import IncreaseManager from "@/pages/shop/IncreaseManager";
|
||||
import CustomerView from "@/pages/home/CustomerView";
|
||||
import TableAnalysis from "@/pages/TableAnalysis";
|
||||
import AddCustomerTable from "@/pages/analysis/AddCustomerTable";
|
||||
import ApplyCustomerTable from "@/pages/analysis/ApplyCustomerTable";
|
||||
import ZeroExtendDetail from "@/pages/home/ZeroExtendDetail";
|
||||
import CustomerDetail from "@/pages/home/CustomerDetail";
|
||||
import IncreaseData from '@/pages/shop/IncreaseData';
|
||||
import IncreaseDataCompany from '@/pages/shop/IncreaseDataCompany';
|
||||
import IncreaseDataStaff from '@/pages/shop/IncreaseDataStaff';
|
||||
import IncreaseDataStore from '@/pages/shop/IncreaseDataStore';
|
||||
import IncreaseStaffManager from '@/pages/shop/IncreaseStaffManager';
|
||||
import IncreaseStaffManagerBatchAdd from '@/pages/shop/IncreaseStaffManagerBatchAdd';
|
||||
import IncreaseStoreManager from '@/pages/shop/IncreaseStoreManager';
|
||||
import IncreaseConfigure from '@/pages/shop/IncreaseConfigure';
|
||||
import IncreaseGroupSendConfigure from '@/pages/shop/IncreaseGroupSendConfigure';
|
||||
import IncreaseWelcomeConfigure from '@/pages/shop/IncreaseWelcomeConfigure';
|
||||
import IncreaseGroupSendConfigureAdd from '@/pages/shop/IncreaseGroupSendConfigureAdd';
|
||||
import NoPermission from '@/pages/shop/NoPermission';
|
||||
import CustomerViewHome from '@/pages/home/CustomerViewHome';
|
||||
import IncreaseData from "@/pages/shop/IncreaseData";
|
||||
import IncreaseDataCompany from "@/pages/shop/IncreaseDataCompany";
|
||||
import IncreaseDataStaff from "@/pages/shop/IncreaseDataStaff";
|
||||
import IncreaseDataStore from "@/pages/shop/IncreaseDataStore";
|
||||
import IncreaseStaffManager from "@/pages/shop/IncreaseStaffManager";
|
||||
import IncreaseStaffManagerBatchAdd from "@/pages/shop/IncreaseStaffManagerBatchAdd";
|
||||
import IncreaseStoreManager from "@/pages/shop/IncreaseStoreManager";
|
||||
import IncreaseConfigure from "@/pages/shop/IncreaseConfigure";
|
||||
import IncreaseGroupSendConfigure from "@/pages/shop/IncreaseGroupSendConfigure";
|
||||
import IncreaseWelcomeConfigure from "@/pages/shop/IncreaseWelcomeConfigure";
|
||||
import IncreaseGroupSendConfigureAdd from "@/pages/shop/IncreaseGroupSendConfigureAdd";
|
||||
import NoPermission from "@/pages/shop/NoPermission";
|
||||
import CustomerViewHome from "@/pages/home/CustomerViewHome";
|
||||
import ActivityAnalysis from "@/pages/activity/ActivityAnalysis";
|
||||
import ActivityManager from "@/pages/activity/ActivityManager";
|
||||
import ActivityPlan from "@/pages/activity/ActivityPlan";
|
||||
|
||||
import ActivityCode from "@/pages/activity/ActivityCode";
|
||||
import GuideCode from "@/pages/activity/GuideCode";
|
||||
|
||||
Vue.use(Router);
|
||||
const router = new Router({
|
||||
mode: 'history',
|
||||
base: '/youke',
|
||||
mode: "history",
|
||||
base: "/youke",
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/login'
|
||||
path: "/",
|
||||
redirect: "/login",
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: Login
|
||||
path: "/login",
|
||||
name: "login",
|
||||
component: Login,
|
||||
},
|
||||
{
|
||||
path: '/external/contact',
|
||||
name: 'externalContact',
|
||||
component: ExternalContact
|
||||
path: "/external/contact",
|
||||
name: "externalContact",
|
||||
component: ExternalContact,
|
||||
},
|
||||
{
|
||||
path: '/home',
|
||||
name: 'Home',
|
||||
path: "/home",
|
||||
name: "Home",
|
||||
component: Home,
|
||||
children: [
|
||||
{
|
||||
path: '/activity/manager',
|
||||
name: 'ActivityManager',
|
||||
component: ActivityManager
|
||||
path: "/activity/manager",
|
||||
name: "ActivityManager",
|
||||
component: ActivityManager,
|
||||
},
|
||||
{
|
||||
path: "/activity/plan",
|
||||
name: "ActivityPlan",
|
||||
component: ActivityPlan,
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
path: "/activity/plan/code",
|
||||
name: "ActivityCode",
|
||||
component: ActivityCode,
|
||||
},
|
||||
{
|
||||
path: '/activity/plan',
|
||||
name: 'ActivityPlan',
|
||||
component: ActivityPlan
|
||||
path: "/activity/plan/GuideCode",
|
||||
name: "GuideCode",
|
||||
component: GuideCode,
|
||||
},
|
||||
{
|
||||
path: '/activity/analysis',
|
||||
name: 'ActivityAnalysis',
|
||||
component: ActivityAnalysis
|
||||
path: "/activity/analysis",
|
||||
name: "ActivityAnalysis",
|
||||
component: ActivityAnalysis,
|
||||
},
|
||||
{
|
||||
path: '/account/manager',
|
||||
name: 'AccountManager',
|
||||
component: AccountManager
|
||||
path: "/account/manager",
|
||||
name: "AccountManager",
|
||||
component: AccountManager,
|
||||
},
|
||||
{
|
||||
path: '/account/management/add',
|
||||
name: 'AccountManagerAdd',
|
||||
component: AccountManagerAdd
|
||||
path: "/account/management/add",
|
||||
name: "AccountManagerAdd",
|
||||
component: AccountManagerAdd,
|
||||
},
|
||||
{
|
||||
path: '/account/management/modify',
|
||||
name: 'AccountManagementModify',
|
||||
component: AccountManagementModify
|
||||
path: "/account/management/modify",
|
||||
name: "AccountManagementModify",
|
||||
component: AccountManagementModify,
|
||||
},
|
||||
{
|
||||
path: '/account/upload',
|
||||
name: 'AccountManagerUpload',
|
||||
component: AccountManagerUpload
|
||||
path: "/account/upload",
|
||||
name: "AccountManagerUpload",
|
||||
component: AccountManagerUpload,
|
||||
},
|
||||
{
|
||||
path: '/role/manager',
|
||||
name: 'RoleManager',
|
||||
component: RoleManager
|
||||
path: "/role/manager",
|
||||
name: "RoleManager",
|
||||
component: RoleManager,
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/manager',
|
||||
name: 'IncreaseManager',
|
||||
path: "/shop/increase/manager",
|
||||
name: "IncreaseManager",
|
||||
component: IncreaseManager,
|
||||
children: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/shop/increase/manager/store'
|
||||
path: "/",
|
||||
redirect: "/shop/increase/manager/store",
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/manager/store',
|
||||
name: 'IncreaseStoreManager',
|
||||
component: IncreaseStoreManager
|
||||
path: "/shop/increase/manager/store",
|
||||
name: "IncreaseStoreManager",
|
||||
component: IncreaseStoreManager,
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/manager/staff',
|
||||
name: 'IncreaseStaffManager',
|
||||
component: IncreaseStaffManager
|
||||
path: "/shop/increase/manager/staff",
|
||||
name: "IncreaseStaffManager",
|
||||
component: IncreaseStaffManager,
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/manager/staff/batch/add',
|
||||
name: 'IncreaseStaffManagerBatchAdd',
|
||||
component: IncreaseStaffManagerBatchAdd
|
||||
}
|
||||
]
|
||||
path: "/shop/increase/manager/staff/batch/add",
|
||||
name: "IncreaseStaffManagerBatchAdd",
|
||||
component: IncreaseStaffManagerBatchAdd,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/table/analysis',
|
||||
name: 'TableAnalysis',
|
||||
path: "/table/analysis",
|
||||
name: "TableAnalysis",
|
||||
component: TableAnalysis,
|
||||
children: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/table/analysis/customer/add'
|
||||
path: "/",
|
||||
redirect: "/table/analysis/customer/add",
|
||||
},
|
||||
{
|
||||
path: '/table/analysis/customer/add',
|
||||
name: 'AddCustomerTable',
|
||||
component: AddCustomerTable
|
||||
path: "/table/analysis/customer/add",
|
||||
name: "AddCustomerTable",
|
||||
component: AddCustomerTable,
|
||||
},
|
||||
{
|
||||
path: '/table/analysis/customer/apply',
|
||||
name: 'ApplyCustomerTable',
|
||||
component: ApplyCustomerTable
|
||||
}
|
||||
]
|
||||
path: "/table/analysis/customer/apply",
|
||||
name: "ApplyCustomerTable",
|
||||
component: ApplyCustomerTable,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/configure',
|
||||
name: 'IncreaseConfigure',
|
||||
path: "/shop/increase/configure",
|
||||
name: "IncreaseConfigure",
|
||||
component: IncreaseConfigure,
|
||||
children: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/shop/increase/configure/welcome'
|
||||
path: "/",
|
||||
redirect: "/shop/increase/configure/welcome",
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/configure/group',
|
||||
name: 'IncreaseGroupSendConfigure',
|
||||
component: IncreaseGroupSendConfigure
|
||||
path: "/shop/increase/configure/group",
|
||||
name: "IncreaseGroupSendConfigure",
|
||||
component: IncreaseGroupSendConfigure,
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/configure/welcome',
|
||||
name: 'IncreaseWelcomeConfigure',
|
||||
component: IncreaseWelcomeConfigure
|
||||
path: "/shop/increase/configure/welcome",
|
||||
name: "IncreaseWelcomeConfigure",
|
||||
component: IncreaseWelcomeConfigure,
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/configure/group/add',
|
||||
name: 'IncreaseGroupSendConfigureAdd',
|
||||
component: IncreaseGroupSendConfigureAdd
|
||||
path: "/shop/increase/configure/group/add",
|
||||
name: "IncreaseGroupSendConfigureAdd",
|
||||
component: IncreaseGroupSendConfigureAdd,
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/data',
|
||||
name: 'IncreaseData',
|
||||
path: "/shop/increase/data",
|
||||
name: "IncreaseData",
|
||||
component: IncreaseData,
|
||||
children: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/shop/increase/data/region'
|
||||
path: "/",
|
||||
redirect: "/shop/increase/data/region",
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/data/region',
|
||||
name: 'IncreaseDataCompany',
|
||||
component: IncreaseDataCompany
|
||||
path: "/shop/increase/data/region",
|
||||
name: "IncreaseDataCompany",
|
||||
component: IncreaseDataCompany,
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/data/store',
|
||||
name: 'IncreaseDataStore',
|
||||
component: IncreaseDataStore
|
||||
path: "/shop/increase/data/store",
|
||||
name: "IncreaseDataStore",
|
||||
component: IncreaseDataStore,
|
||||
},
|
||||
{
|
||||
path: '/shop/increase/data/staff',
|
||||
name: 'IncreaseDataStaff',
|
||||
component: IncreaseDataStaff
|
||||
path: "/shop/increase/data/staff",
|
||||
name: "IncreaseDataStaff",
|
||||
component: IncreaseDataStaff,
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/customer/view',
|
||||
name: 'CustomerView',
|
||||
path: "/customer/view",
|
||||
name: "CustomerView",
|
||||
component: CustomerView,
|
||||
},
|
||||
{
|
||||
path: '/zero/extend/detail',
|
||||
name: 'ZeroExtendDetail',
|
||||
component: ZeroExtendDetail
|
||||
path: "/zero/extend/detail",
|
||||
name: "ZeroExtendDetail",
|
||||
component: ZeroExtendDetail,
|
||||
},
|
||||
{
|
||||
path: '/customer/data/detail',
|
||||
name: 'CustomerDetail',
|
||||
path: "/customer/data/detail",
|
||||
name: "CustomerDetail",
|
||||
component: CustomerDetail,
|
||||
},
|
||||
{
|
||||
path: '/no/permission',
|
||||
name: 'NoPermission',
|
||||
path: "/no/permission",
|
||||
name: "NoPermission",
|
||||
component: NoPermission,
|
||||
},
|
||||
|
||||
]
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/customer/view/home',
|
||||
name: 'CustomerViewHome',
|
||||
path: "/customer/view/home",
|
||||
name: "CustomerViewHome",
|
||||
component: CustomerViewHome,
|
||||
},
|
||||
]
|
||||
],
|
||||
});
|
||||
/*
|
||||
* 跳转前的处理事件
|
||||
* */
|
||||
router.beforeEach(function (to, from, next) {
|
||||
* 跳转前的处理事件
|
||||
* */
|
||||
router.beforeEach(function(to, from, next) {
|
||||
next();
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
||||
Loading…
Reference in New Issue