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