feature_0521
郑皇 6 years ago
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>

@ -206,10 +206,13 @@ export default {
{
title: "活动码",
key: "activityCode",
render(h) {
render(h, p) {
return h(
"Button",
{ props: { type: "primary", size: "small" } },
{
props: { type: "primary", size: "small" },
on: { click: () => _this.navigateCode(p.row) },
},
"查看详情"
);
},
@ -317,6 +320,12 @@ export default {
this.showUse = true;
store.commit("SET_useData", instance);
},
navigateCode(instance) {
this.$router.push({
path: "/activity/plan/code",
query: { instanceId: instance.id },
});
},
searchTable(params = {}) {
this.loading = true;
if (

@ -0,0 +1,9 @@
<template> </template>
<script>
export default {
name: "GuideCode",
};
</script>
<style></style>

@ -42,7 +42,11 @@
</Form-item>
</div>
<FormItem label="活动类型" prop="activityStyle">
<RadioGroup v-model="formValidate.activityStyle" vertical>
<RadioGroup
@on-change="onChange"
v-model="formValidate.activityStyle"
vertical
>
<Radio
:border="true"
v-for="(item, index) in schedule.params"
@ -103,11 +107,20 @@ export default {
schedule: Object,
},
created() {
let _this = this;
this.formValidate = store.getters.useData;
this.formValidate.activityStyle = "";
if (this.formValidate.params) {
this.formValidate.params.forEach((item) => {
_this.formValidate.activityStyle = item.id;
});
}
console.log(22, this.formValidate);
},
watch: {
["formValidate.activityStyle"]() {
methods: {
onChange(e) {
let _this = this;
this.formValidate.activityStyle = e;
let type = {};
this.schedule.params.forEach((item) => {
if (item.id == _this.formValidate.activityStyle) {
@ -116,8 +129,6 @@ export default {
});
store.getters.useData.params = [type];
},
},
methods: {
storeStartDate(date) {
store.getters.useData.beginTime = date;
},

@ -56,10 +56,17 @@ export default {
mounted() {
this.getCompanyInfo();
let _this = this;
console.log(111, store.getters.useData);
if (store.getters.useData.company) {
store.getters.useData.company.forEach((item) => {
_this.checkCompanys.push(item.id);
});
} else if (store.getters.useData.stores) {
store.getters.useData.stores.forEach((item) => {
if (item.companyId) {
_this.checkCompanys.push(item.companyId);
}
});
}
},
methods: {

File diff suppressed because it is too large Load Diff

@ -1,14 +1,14 @@
<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">
@ -17,29 +17,67 @@
<span class="title-font">用户信息</span>
</div>
<div style="text-align: left;margin-top: 20px">
<Form style="text-align: left" :model="modifyFrom" :rules="modifyValidate" ref="modifyFrom">
<Form
style="text-align: left"
:model="modifyFrom"
:rules="modifyValidate"
ref="modifyFrom"
>
<Form-Item prop="userName">
<span class="name-font" style="width: 80px;display: inline-block">用户名</span>
<i-input placeholder="请输入用户名" style="width: 300px;" v-model="modifyFrom.userName"/>
<span class="name-font" style="width: 80px;display: inline-block"
>用户名</span
>
<i-input
placeholder="请输入用户名"
style="width: 300px;"
v-model="modifyFrom.userName"
/>
</Form-Item>
<Form-Item prop="account">
<span class="name-font" style="width: 80px;display: inline-block">账号</span>
<i-input disabled placeholder="请输入账号" style="width: 300px;" v-model="modifyFrom.account"/>
<span class="name-font" style="width: 80px;display: inline-block"
>账号</span
>
<i-input
disabled
placeholder="请输入账号"
style="width: 300px;"
v-model="modifyFrom.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="modifyFrom.mobil"/>
<span class="name-font" style="width: 80px;display: inline-block"
>手机号</span
>
<i-input
placeholder="请输入手机号"
style="width: 300px;"
v-model="modifyFrom.mobil"
/>
</Form-Item>
<Form-Item prop="password">
<span class="name-font" style="width: 80px;display: inline-block" >密码</span>
<i-input placeholder="请输入密码" style="width: 300px;" v-model="modifyFrom.password" @on-change="check" type="password"/>
<span class="name-font" style="width: 80px;display: inline-block"
>密码</span
>
<i-input
placeholder="请输入密码"
style="width: 300px;"
v-model="modifyFrom.password"
@on-change="check"
type="password"
/>
</Form-Item>
<Form-Item prop="confirmPassword">
<span class="name-font" style="width: 80px;display: inline-block">确认密码</span>
<i-input placeholder="请确认密码" style="width: 300px;" v-model="modifyFrom.confirmPassword" type="password"/>
<span class="name-font" style="width: 80px;display: inline-block"
>确认密码</span
>
<i-input
placeholder="请确认密码"
style="width: 300px;"
v-model="modifyFrom.confirmPassword"
type="password"
/>
</Form-Item>
</Form>
</div>
<!--角色-->
@ -47,275 +85,313 @@
<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="modifyFrom.roleId" style="margin-left: 15px" @on-change="roleChange(item)">
<Radio :label="item.id">{{item.name}}</Radio>
<RadioGroup
v-for="item in roleList"
:key="item.id"
v-model="modifyFrom.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="shopSelectDisplay">
<span class="name-font" style="width: 80px;display: inline-block">店铺</span>
<Select class="select-head" style="width: 300px;" clearable v-model="modifyFrom.shopId" placeholder="请选择店铺" filterable>
<Option v-for="item in this.shopList" :value="item.id" :key="item.id">{{item.name}}</Option>
<span class="name-font" style="width: 80px;display: inline-block"
>店铺</span
>
<Select
class="select-head"
style="width: 300px;"
clearable
v-model="modifyFrom.shopId"
placeholder="请选择店铺"
filterable
>
<Option v-for="item in this.shopList" :value="item.id" :key="item.id">{{
item.name
}}</Option>
</Select>
</div>
<div style="margin-top: 40px" v-if="companySelectDisplay">
<span class="name-font" style="width: 80px;display: inline-block">零售公司</span>
<Select v-model="modifyFrom.companyId" filterable style="width: 300px;">
<Option v-for="item in companyList" :value="item.id" :key="item.id">{{ item.name }}</Option>
<span class="name-font" style="width: 80px;display: inline-block"
>零售公司</span
>
<Select v-model="modifyFrom.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">
<Button type="primary" style="height: 39px;width: 101px" @click="modifyAccountConfirm()" >完成</Button>
<Button style="height: 39px;width: 101px;border: 0" @click="modifyAccountcancel()"></Button>
<Button
type="primary"
style="height: 39px;width: 101px"
@click="modifyAccountConfirm()"
>完成</Button
>
<Button
style="height: 39px;width: 101px;border: 0"
@click="modifyAccountcancel()"
>返回</Button
>
</div>
</row>
</template>
<script>
import accountManagementModify from '../../services/account/AccountManagementModify'
import accountManagement from '../../services/account/AccountManagement'
import IncreaseData from "../../services/generalize/IncreaseData";
export default {
import accountManagementModify from "../../services/account/AccountManagementModify";
import accountManagement from "../../services/account/AccountManagement";
import IncreaseData from "../../services/generalize/IncreaseData";
data() {
return {
companyList: [],
companySelectDisplay:false,
name: "accountManagementModify",
modifyFrom: {
accountId: this.$route.query.accountId,
userId: this.$route.query.userId,
userName: this.$route.query.userName,
account: this.$route.query.account,
password: this.$route.query.password,
confirmPassword: this.$route.query.password,
roleId: this.$route.query.roleId,
shopId: this.$route.query.shopId,
type:this.$route.query.type,
companyId: this.$route.query.companyId,
mobil: this.$route.query.mobil,
export default {
data() {
return {
companyList: [],
companySelectDisplay: false,
name: "accountManagementModify",
modifyFrom: {
accountId: this.$route.query.accountId,
userId: this.$route.query.userId,
userName: this.$route.query.userName,
account: this.$route.query.account,
password: this.$route.query.password,
confirmPassword: this.$route.query.password,
roleId: this.$route.query.roleId,
shopId: this.$route.query.shopId,
type: this.$route.query.type,
companyId: this.$route.query.companyId,
mobil: this.$route.query.mobil,
},
passwordCheck: [
{ required: true, message: "密码不能为空", trigger: "blur" },
{ min: 6, max: 18, message: "长度在 6 到 18 个字符", trigger: "blur" },
{
pattern: /^[0-9a-zA-Z]*$/g,
message: "只可以输入数字和字母",
trigger: "blur",
},
],
confirmPasswordCheck: [
{ required: true, message: "确认密码不能为空", trigger: "blur" },
{ min: 6, max: 18, message: "长度在 6 到 18 个字符", trigger: "blur" },
{
pattern: /^[0-9a-zA-Z]*$/g,
message: "只可以输入数字和字母",
trigger: "blur",
},
],
modifyValidate: {
mobil: [
{ pattern: /^[0-9]*$/g, message: "只可以输入数字", trigger: "blur" },
],
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",
},
passwordCheck:[
{required:true,message:'密码不能为空',trigger:'blur'},
{ min: 6, max: 18, message: '长度在 6 到 18 个字符', trigger: 'blur' },
{ pattern: /^[0-9a-zA-Z]*$/g, message: '只可以输入数字和字母',trigger: 'blur'},
],
confirmPasswordCheck:[
{required:true,message:'确认密码不能为空',trigger:'blur'},
{ min: 6, max: 18, message: '长度在 6 到 18 个字符', trigger: 'blur' },
{ pattern: /^[0-9a-zA-Z]*$/g, message: '只可以输入数字和字母',trigger: 'blur'},
],
modifyValidate: {
mobil: [
{pattern: /^[0-9]*$/g, message: '只可以输入数字', trigger: 'blur'},
],
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'},
],
password:null,
confirmPassword:null,
],
account: [
{ required: true, message: "账号不能为空", trigger: "blur" },
{ min: 2, max: 8, message: "长度在 2 到 8 个字符", trigger: "blur" },
{
pattern: /^[0-9a-zA-Z]*$/g,
message: "只可以输入数字和字母",
trigger: "blur",
},
selectRole: this.$route.query.roleId,
roleList: [],
//
shopList: [],
//
shopSelectDisplay: false,
}
],
password: null,
confirmPassword: null,
},
mounted: function () {
if(this.$route.query.roleCode === 'DZ-DIANZHANG'){
this.shopSelectDisplay = true;
this.modifyFrom.type = 1;
this.modifyFrom.companyId = null;
this.listShop();
} else if(this.$route.query.roleCode === "DG-DAOGOU"){
this.shopSelectDisplay = true;
this.modifyFrom.type = 4;
this.modifyFrom.companyId = null;
this.listShop();
}else if(this.$route.query.roleCode === 'DG-YUNYING'){
this.companySelectDisplay = true;
this.shopSelectDisplay = false;
this.modifyFrom.type = 2;
this.allCompany();
selectRole: this.$route.query.roleId,
roleList: [],
//
shopList: [],
//
shopSelectDisplay: false,
};
},
mounted: function() {
if (this.$route.query.roleCode === "DZ-DIANZHANG") {
this.shopSelectDisplay = true;
this.modifyFrom.type = 1;
this.modifyFrom.companyId = null;
this.listShop();
} else if (this.$route.query.roleCode === "DG-DAOGOU") {
this.shopSelectDisplay = true;
this.modifyFrom.type = 4;
this.modifyFrom.companyId = null;
this.listShop();
} else if (this.$route.query.roleCode === "DG-YUNYING") {
this.companySelectDisplay = true;
this.shopSelectDisplay = false;
this.modifyFrom.type = 2;
this.allCompany();
}
this.listRole();
},
methods: {
//
listRole() {
let that = this;
that.roleList = [];
accountManagement.listRoleInfoApi({}, function(data) {
data = data.data;
if (data.code === "0001") {
that.$Message.error("查询失败");
return;
}
this.listRole();
},
methods: {
//
listRole() {
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]);
}
}
});
},
//
modifyAccountConfirm : function () {
if(this.modifyFrom.userName){
this.modifyFrom.userName = this.modifyFrom.userName.trim();
}
if(this.modifyFrom.password){
this.modifyFrom.password = this.modifyFrom.password.trim();
if (data.code === "0000") {
let row = data.results;
for (let i = 0; i < row.length; i++) {
that.roleList.push(row[i]);
}
if(this.modifyFrom.confirmPassword){
this.modifyFrom.confirmPassword = this.modifyFrom.confirmPassword.trim();
}
});
},
//
modifyAccountConfirm: function() {
if (this.modifyFrom.userName) {
this.modifyFrom.userName = this.modifyFrom.userName.trim();
}
if (this.modifyFrom.password) {
this.modifyFrom.password = this.modifyFrom.password.trim();
}
if (this.modifyFrom.confirmPassword) {
this.modifyFrom.confirmPassword = this.modifyFrom.confirmPassword.trim();
}
if (this.modifyFrom.account) {
this.modifyFrom.account = this.modifyFrom.account.trim();
}
//
this.$refs["modifyFrom"].validate((valid) => {
if (!valid) {
return;
}
if (this.shopSelectDisplay && !this.modifyFrom.shopId) {
this.$Message.info("必须选择店铺");
return;
}
if (!this.modifyFrom.roleId) {
this.$Message.info("必须选择角色");
return;
}
if (this.modifyFrom.confirmPassword !== this.modifyFrom.password) {
this.$Message.info("两次输入密码必须一致");
return;
}
let that = this;
let request = {
modifyForm: JSON.stringify(that.modifyFrom),
};
accountManagementModify.modifyAccountApi(request, function(data) {
data = data.data;
if (data.code === "0001") {
that.$Message.error("修改账号失败");
return;
}
if(this.modifyFrom.account){
this.modifyFrom.account = this.modifyFrom.account.trim();
if (data.code === "0002") {
that.$Message.info("账号已经存在(登录账号不能重复)");
return;
}
//
this.$refs["modifyFrom"].validate((valid) => {
if (!valid) {
return;
if (data.code === "0000") {
if (data.results == "0001") {
that.$Message.error("添加失败!");
} else if (data.results == 3) {
that.$Message.error("该手机号已经被使用!");
} else if (data.results == 2) {
that.$Message.error("该手机号已经被使用!");
} else if (data.results == 1) {
that.$Message.error("该账号已经被使用!");
} else if (data.results == 0) {
that.$Message.success("修改账号成功");
that.$router.push({ path: "/account/manager" });
}
if(this.shopSelectDisplay && !this.modifyFrom.shopId) {
this.$Message.info("必须选择店铺");
return;
}
if(!this.modifyFrom.roleId) {
this.$Message.info("必须选择角色");
return;
}
if(this.modifyFrom.confirmPassword !== this.modifyFrom.password) {
this.$Message.info("两次输入密码必须一致");
return;
}
let that = this;
let request = {
modifyForm: JSON.stringify(that.modifyFrom)
};
accountManagementModify.modifyAccountApi(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 == 3){
that.$Message.error('该手机号已经被使用!');
}else if (data.results == 2){
that.$Message.error('该手机号已经被使用!');
}else if (data.results == 1){
that.$Message.error('该账号已经被使用!');
}else if(data.results == 0){
that.$Message.success("修改账号成功");
that.$router.push({path:'/account/manager'});
}
}
})
});
},
//
modifyAccountcancel : function () {
this.$router.push({path:'/account/manager'});
},
//
roleChange(roleBean) {
if(roleBean.code === 'DZ-DIANZHANG'){
this.shopSelectDisplay = true;
this.modifyFrom.type = 1;
this.companySelectDisplay = false;
this.modifyFrom.companyId = null;
this.listShop();
} else if(roleBean.code === "DG-DAOGOU"){
this.shopSelectDisplay = true;
this.modifyFrom.type = 4;
this.companySelectDisplay = false;
this.modifyFrom.companyId = null;
this.listShop();
}else if(roleBean.code === 'DG-YUNYING'){
this.companySelectDisplay = true;
this.shopSelectDisplay = false;
this.modifyFrom.type = 2;
this.allCompany();
}else if(roleBean.code === 'GL-YUNYING'){
this.companySelectDisplay = false;
this.shopSelectDisplay = false;
this.addFrom.type = 2;
} else {
this.shopSelectDisplay = false;
this.modifyFrom.shopId = null;
this.modifyFrom.companyId = null;
}
},
//
listShop() {
let that = this;
that.shopList = [];
accountManagementModify.listShopApi({}, 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]);
}
}
});
},
check(){
this.modifyValidate.password = this.passwordCheck;
this.modifyValidate.confirmPassword = this.confirmPasswordCheck;
},
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);
})
}
})
},
});
});
},
//
modifyAccountcancel: function() {
this.$router.push({ path: "/account/manager" });
},
//
roleChange(roleBean) {
if (roleBean.code === "DZ-DIANZHANG") {
this.shopSelectDisplay = true;
this.modifyFrom.type = 1;
this.companySelectDisplay = false;
this.modifyFrom.companyId = null;
this.listShop();
} else if (roleBean.code === "DG-DAOGOU") {
this.shopSelectDisplay = true;
this.modifyFrom.type = 4;
this.companySelectDisplay = false;
this.modifyFrom.companyId = null;
this.listShop();
} else if (roleBean.code === "DG-YUNYING") {
this.companySelectDisplay = true;
this.shopSelectDisplay = false;
this.modifyFrom.type = 2;
this.allCompany();
} else if (roleBean.code === "GL-YUNYING") {
this.companySelectDisplay = false;
this.shopSelectDisplay = false;
this.addFrom.type = 2;
} else {
this.shopSelectDisplay = false;
this.modifyFrom.shopId = null;
this.modifyFrom.companyId = null;
}
}
},
//
listShop() {
let that = this;
that.shopList = [];
accountManagementModify.listShopApi({}, 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]);
}
}
});
},
check() {
this.modifyValidate.password = this.passwordCheck;
this.modifyValidate.confirmPassword = this.confirmPasswordCheck;
},
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,404 +1,457 @@
<template>
<div class="div-page">
<template>
<Row class="search-row">
<i-col span="18">
<span class="search-span">账户名</span>
<i-input placeholder="搜索用户名/账户" class="search-select" v-model="searchContent"/>
<span class="search-span">角色</span>
<Select filterable placeholder="请选择角色" v-model="changeRoleId" class="left-15 search-select">
<Option v-for="item in roleList" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
<span class="search-span">店铺</span>
<Select filterable placeholder="请选择店铺" v-model="changeShopId" class="left-15 search-select">
<Option v-for="item in shopList" :value="item.id" :key="item.name">{{ item.name }}</Option>
</Select>
<Button type="primary" class="search-btn" @click="listAccountInfoFunction"></Button>
</i-col>
<i-col span="6" class="search-btn-add-row">
<Button type="primary"
@click="addOneAccount()">+添加账户
</Button>
<!-- <Button type="primary" ghost style="margin-bottom: 20px;margin-right: 20px;float:right;margin-top: 25px"-->
<!-- @click="uploadAccount">批量导入账户-->
<!-- </Button>-->
</i-col>
</Row>
</template>
<Table :loading="loading" :columns="columns1" :data="data1" class="table-account" size="small"></Table>
<Page :total="totalSize" :current="pageNum" :page-size="pageSize" show-elevator show-total
placement="top" @on-change="handlePage" class-name="ks-page"></Page>
<Modal
v-model="modal13"
title="删除提示"
@on-cancel="cancel" align="center">
<p style="margin-top: 20px;margin-bottom: 20px">确定要删除此账户吗删除后不可恢复</p>
<div slot="footer" style="text-align: center;margin-bottom: 10px;margin-top: 10px">
<Button style="width: 100px;" @click="modal13 = false">取消删除</Button>
<Button type="error" style="width: 100px;margin-left: 20px" @click="ok"></Button>
</div>
</Modal>
</div>
<div class="div-page">
<template>
<Row class="search-row">
<i-col span="18">
<span class="search-span">账户名</span>
<i-input
placeholder="搜索用户名/账户"
class="search-select"
v-model="searchContent"
/>
<span class="search-span">角色</span>
<Select
filterable
placeholder="请选择角色"
v-model="changeRoleId"
class="left-15 search-select"
>
<Option v-for="item in roleList" :value="item.id" :key="item.id">{{
item.name
}}</Option>
</Select>
<span class="search-span">店铺</span>
<Select
filterable
placeholder="请选择店铺"
v-model="changeShopId"
class="left-15 search-select"
>
<Option
v-for="item in shopList"
:value="item.id"
:key="item.name"
>{{ item.name }}</Option
>
</Select>
<Button
type="primary"
class="search-btn"
@click="listAccountInfoFunction"
>查询</Button
>
</i-col>
<i-col span="6" class="search-btn-add-row">
<Button type="primary" @click="addOneAccount()">+ </Button>
<!-- <Button type="primary" ghost style="margin-bottom: 20px;margin-right: 20px;float:right;margin-top: 25px"-->
<!-- @click="uploadAccount">批量导入账户-->
<!-- </Button>-->
</i-col>
</Row>
</template>
<Table
:loading="loading"
:columns="columns1"
:data="data1"
class="table-account"
size="small"
></Table>
<Page
:total="totalSize"
:current="pageNum"
:page-size="pageSize"
show-elevator
show-total
placement="top"
@on-change="handlePage"
class-name="ks-page"
></Page>
<Modal
v-model="modal13"
title="删除提示"
@on-cancel="cancel"
align="center"
>
<p style="margin-top: 20px;margin-bottom: 20px">
确定要删除此账户吗删除后不可恢复
</p>
<div
slot="footer"
style="text-align: center;margin-bottom: 10px;margin-top: 10px"
>
<Button style="width: 100px;" @click="modal13 = false">取消删除</Button>
<Button type="error" style="width: 100px;margin-left: 20px" @click="ok"
>确认删除</Button
>
</div>
</Modal>
</div>
</template>
<script>
import accountManagement from "../../services/account/AccountManagement";
import accountManagement from "../../services/account/AccountManagement";
export default {
data() {
return {
loading: false,
modal13: false,
roleList: [
{
id: '0',
name: '全部',
},
{
id: '1',
name: '系统管理员',
},
{
id: '2',
name: '运营人员',
},
{
id: '3',
name: '店长',
},
{
id: '4',
name: '导购',
},
],
shopList: [
],
columns1: [
{
type: 'index2',
width: 80,
title: "序号",
align: 'center',
render: (h, params) => {
return h('span', params.index + (this.pageNum- 1) * this.pageSize + 1);
}
},
{
title: '用户名',
key: 'userName'
},
{
title: '别名',
key: 'abbreviation'
},
{
title: '系统账号',
key: 'account'
},
{
title: '手机号',
key: 'mobil',
},
{
title: '系统角色',
key: 'roleName'
},
{
title: '零售公司',
key: 'companyName'
},
{
title: '店铺',
key: 'shopName'
},
{
title: '店铺编码',
key: 'shopCode'
export default {
data() {
return {
loading: false,
modal13: false,
roleList: [
{
id: "0",
name: "全部",
},
{
id: "1",
name: "系统管理员",
},
{
id: "2",
name: "运营人员",
},
{
id: "3",
name: "店长",
},
{
id: "4",
name: "导购",
},
],
shopList: [],
columns1: [
{
type: "index2",
width: 80,
title: "序号",
align: "center",
render: (h, params) => {
return h(
"span",
params.index + (this.pageNum - 1) * this.pageSize + 1
);
},
},
{
title: "用户名",
key: "userName",
},
{
title: "别名",
key: "abbreviation",
},
{
title: "系统账号",
key: "account",
},
{
title: "手机号",
key: "mobil",
},
{
title: "系统角色",
key: "roleName",
},
{
title: "零售公司",
key: "companyName",
},
{
title: "店铺",
key: "shopName",
},
{
title: "店铺编码",
key: "shopCode",
},
{
title: "操作",
key: "operation",
render: (h, params) => {
let that = this;
return h("div", [
h(
"span",
{
style: {
background: "white",
border: "0",
color: "#3496EB",
marginRight: "15px",
cursor: "pointer",
},
on: {
click: () => {
this.$router.push({
path: "/account/management/modify",
query: {
accountId: params.row.accountId,
userId: params.row.userId,
userName: params.row.userName,
account: params.row.account,
password: params.row.password,
confirmPassword: params.row.confirmPassword,
roleId: params.row.roleId,
roleCode: params.row.roleCode,
shopId: params.row.shopId,
companyId: params.row.orgId,
mobil: params.row.mobil,
},
});
},
{
title: '操作',
key: 'operation',
render: (h, params) => {
let that = this;
return h('div', [
h('span', {
style: {
background: 'white',
border: '0',
color: '#3496EB',
marginRight: '15px',
cursor: 'pointer'
},
on: {
click: () => {
this.$router.push({
path: '/account/management/modify',
query: {
accountId: params.row.accountId,
userId: params.row.userId,
userName: params.row.userName,
account: params.row.account,
password: params.row.password,
confirmPassword: params.row.confirmPassword,
roleId: params.row.roleId,
roleCode: params.row.roleCode,
shopId: params.row.shopId,
companyId: params.row.orgId,
mobil: params.row.mobil,
}
});
}
}
}, '修改'),
h('span', {
style: {
background: 'white',
border: '0',
color: 'red',
marginRight: '15px',
cursor: 'pointer'
},
on: {
click: () => {
that.modal13 = true;
that.updateAccountId = that.data1[params.index].accountId;
that.updateUserId = that.data1[params.index].userId;
}
}
}, '删除')
])
}
},
},
"修改"
),
h(
"span",
{
style: {
background: "white",
border: "0",
color: "red",
marginRight: "15px",
cursor: "pointer",
},
on: {
click: () => {
that.modal13 = true;
that.updateAccountId = that.data1[params.index].accountId;
that.updateUserId = that.data1[params.index].userId;
},
],
data1: [
],
roleId: '',
shopId: '',
//
totalSize: 0,
pageNum: 1,
pageSize: 10,
//
searchContent: null,
changeShopId: null,
changeRoleId: null,
updateAccountId: 0,
updateUserId: 0,
item: null,
}
},
mounted: function () {
this.listRoleInfo();
this.listOfShop();
// enter
this.enterKeyup();
},
},
"删除"
),
]);
},
},
methods: {
//
handlePage: function (value) {
this.pageNum = value;
this.listAccountInfoFunction();
},
//
addOneAccount() {
this.$router.push({
path: '/account/management/add',
});
},
//
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') {
data = data.results;
that.roleList.push({
id: "0",
name: "全部"
});
for (let i = 0; i < data.length; i++) {
let row = data[i];
that.roleList.push(row);
}
if (that.$route.query != null) {
that.item = that.$route.query;
//
if (that.item.id === undefined) {
that.changeRoleId = "0";
} else {
that.changeRoleId = that.item.id;
}
} else {
that.changeRoleId = "0";
}
that.listAccountInfoFunction();
}
})
},
//
listOfShop() {
let that = this;
this.loading = true;
that.shopList = [];
let request = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
};
accountManagement.listAllShopApi(request, function (data) {
data = data.data;
that.loading = false;
if (data.code === '0001') {
that.$Message.error("查询店铺失败!");
return;
}
if (data.code === '0000') {
that.shopList.push({
id: '-1',
name: "全部"
});
that.changeShopId = '-1';
data = data.results;
for (let i = 0; i < data.length; i++) {
let row = data[i];
that.shopList.push(row);
}
}
}, function () {
that.loading = false;
});
},
//
listAccountInfoFunction: function () {
let that = this;
let roleId = that.changeRoleId;
if (that.changeRoleId === "0") {
roleId = null;
}
let shopId = that.changeShopId;
if (that.changeShopId === "-1") {
shopId = null;
}
let request = {
searchContent: that.searchContent,
pageNum: that.pageNum,
pageSize: that.pageSize,
roleId: roleId,
shopId: shopId
};
accountManagement.listAccountInfoApi(request, function (data) {
that.data1 = [];
data = data.data;
if (data.code === '0001') {
that.$Message.error("系统繁忙!");
return
}
if (data.code === '0000') {
if (data) {
let row = data.results.records;
that.totalSize = data.results.total;
for (let i = 0; i < row.length; i++) {
let entity = row[i];
if (!entity.channel) {
entity.channel = '--';
}
if (!entity.account) {
entity.account = '--';
}
if (!entity.userName) {
entity.userName = '--';
}
if (!entity.roleName) {
entity.roleName = '--';
}
if (!entity.shopName) {
entity.shopName = '--';
}
that.data1.push(entity);
}
if (row === null || row.length === 0) {
that.totalSize = 0;
}
}
}
})
},
//
remove() {
let that = this;
let request = {
accountId: that.updateAccountId,
userId: that.updateUserId
};
accountManagement.removeAccountApi(request, function (data) {
if (data.data.code === '0001') {
that.$Message.info("删除失败");
return
}
if (data.data.code === '0000') {
that.$Message.info("删除成功");
that.pageNum = 1;
that.listAccountInfoFunction();
}
})
},
cancel() {
},
ok() {
this.modal13 = false;
this.remove();
},
enterKeyup() {
document.addEventListener("keyup", this.buttonOperation);
},
buttonOperation() {
const code = event.keyCode
? event.keyCode
: event.which
? event.which
: event.charCode;
if (code === 13) {
this.pageNum = 1;
this.listAccountInfoFunction();
} else if (code !== 13 && code === 1) {
this.pageNum = 1;
this.listAccountInfoFunction();
}
},
],
data1: [],
roleId: "",
shopId: "",
//
totalSize: 0,
pageNum: 1,
pageSize: 10,
//
searchContent: null,
changeShopId: null,
changeRoleId: null,
updateAccountId: 0,
updateUserId: 0,
item: null,
};
},
mounted: function() {
this.listRoleInfo();
this.listOfShop();
// enter
this.enterKeyup();
},
methods: {
//
handlePage: function(value) {
this.pageNum = value;
this.listAccountInfoFunction();
},
//
addOneAccount() {
this.$router.push({
path: "/account/management/add",
});
},
//
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") {
data = data.results;
that.roleList.push({
id: "0",
name: "全部",
});
for (let i = 0; i < data.length; i++) {
let row = data[i];
that.roleList.push(row);
}
if (that.$route.query != null) {
that.item = that.$route.query;
//
if (that.item.id === undefined) {
that.changeRoleId = "0";
} else {
that.changeRoleId = that.item.id;
}
} else {
that.changeRoleId = "0";
}
that.listAccountInfoFunction();
}
});
},
//
listOfShop() {
let that = this;
this.loading = true;
that.shopList = [];
let request = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
};
accountManagement.listAllShopApi(
request,
function(data) {
data = data.data;
that.loading = false;
if (data.code === "0001") {
that.$Message.error("查询店铺失败!");
return;
}
if (data.code === "0000") {
that.shopList.push({
id: "-1",
name: "全部",
});
that.changeShopId = "-1";
data = data.results;
for (let i = 0; i < data.length; i++) {
let row = data[i];
that.shopList.push(row);
}
}
},
}
function() {
that.loading = false;
}
);
},
//
listAccountInfoFunction: function() {
let that = this;
let roleId = that.changeRoleId;
if (that.changeRoleId === "0") {
roleId = null;
}
let shopId = that.changeShopId;
if (that.changeShopId === "-1") {
shopId = null;
}
let request = {
searchContent: that.searchContent,
pageNum: that.pageNum,
pageSize: that.pageSize,
roleId: roleId,
shopId: shopId,
};
accountManagement.listAccountInfoApi(request, function(data) {
that.data1 = [];
data = data.data;
if (data.code === "0001") {
that.$Message.error("系统繁忙!");
return;
}
if (data.code === "0000") {
if (data) {
let row = data.results.list;
that.totalSize = data.results.total;
for (let i = 0; i < row.length; i++) {
let entity = row[i];
if (!entity.channel) {
entity.channel = "--";
}
if (!entity.account) {
entity.account = "--";
}
if (!entity.userName) {
entity.userName = "--";
}
if (!entity.roleName) {
entity.roleName = "--";
}
if (!entity.shopName) {
entity.shopName = "--";
}
that.data1.push(entity);
}
if (row === null || row.length === 0) {
that.totalSize = 0;
}
}
}
});
},
//
remove() {
let that = this;
let request = {
accountId: that.updateAccountId,
userId: that.updateUserId,
};
accountManagement.removeAccountApi(request, function(data) {
if (data.data.code === "0001") {
that.$Message.info("删除失败");
return;
}
if (data.data.code === "0000") {
that.$Message.info("删除成功");
that.pageNum = 1;
that.listAccountInfoFunction();
}
});
},
cancel() {},
ok() {
this.modal13 = false;
this.remove();
},
enterKeyup() {
document.addEventListener("keyup", this.buttonOperation);
},
buttonOperation() {
const code = event.keyCode
? event.keyCode
: event.which
? event.which
: event.charCode;
if (code === 13) {
this.pageNum = 1;
this.listAccountInfoFunction();
} else if (code !== 13 && code === 1) {
this.pageNum = 1;
this.listAccountInfoFunction();
}
},
},
};
</script>
<style scoped>
.div-page {
margin-top: 20px;
margin-left: 20px;
}
.div-page {
margin-top: 20px;
margin-left: 20px;
}
.search-row{
background-color: #F7F8FA;
line-height: 80px;
}
.search-row {
background-color: #f7f8fa;
line-height: 80px;
}
.search-btn {
margin-left: 30px;
}
.search-btn {
margin-left: 30px;
}
.search-btn-add-row {
text-align: right;
padding-right: 20px;
}
.search-btn-add-row {
text-align: right;
padding-right: 20px;
}
.table-account{
margin-top: 30px;
}
.table-account {
margin-top: 30px;
}
</style>

@ -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…
Cancel
Save