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: "活动码", title: "活动码",
key: "activityCode", key: "activityCode",
render(h) { render(h, p) {
return h( return h(
"Button", "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; this.showUse = true;
store.commit("SET_useData", instance); store.commit("SET_useData", instance);
}, },
navigateCode(instance) {
this.$router.push({
path: "/activity/plan/code",
query: { instanceId: instance.id },
});
},
searchTable(params = {}) { searchTable(params = {}) {
this.loading = true; this.loading = true;
if ( if (

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

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

@ -56,10 +56,17 @@ export default {
mounted() { mounted() {
this.getCompanyInfo(); this.getCompanyInfo();
let _this = this; let _this = this;
console.log(111, store.getters.useData);
if (store.getters.useData.company) { if (store.getters.useData.company) {
store.getters.useData.company.forEach((item) => { store.getters.useData.company.forEach((item) => {
_this.checkCompanys.push(item.id); _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: { methods: {

File diff suppressed because it is too large Load Diff

@ -1,14 +1,14 @@
<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 { /deep/.name-font {
font-size: 14px; font-size: 14px;
color: #4E5966; color: #4e5966;
} }
</style> </style>
<template> <template>
<row style="margin-left: 30px;margin-top: 30px"> <row style="margin-left: 30px;margin-top: 30px">
@ -17,29 +17,67 @@
<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="modifyFrom" :rules="modifyValidate" ref="modifyFrom"> <Form
style="text-align: left"
:model="modifyFrom"
:rules="modifyValidate"
ref="modifyFrom"
>
<Form-Item prop="userName"> <Form-Item prop="userName">
<span class="name-font" style="width: 80px;display: inline-block">用户名</span> <span class="name-font" style="width: 80px;display: inline-block"
<i-input placeholder="请输入用户名" style="width: 300px;" v-model="modifyFrom.userName"/> >用户名</span
>
<i-input
placeholder="请输入用户名"
style="width: 300px;"
v-model="modifyFrom.userName"
/>
</Form-Item> </Form-Item>
<Form-Item prop="account"> <Form-Item prop="account">
<span class="name-font" style="width: 80px;display: inline-block">账号</span> <span class="name-font" style="width: 80px;display: inline-block"
<i-input disabled placeholder="请输入账号" style="width: 300px;" v-model="modifyFrom.account"/> >账号</span
>
<i-input
disabled
placeholder="请输入账号"
style="width: 300px;"
v-model="modifyFrom.account"
/>
</Form-Item> </Form-Item>
<Form-Item prop="mobil"> <Form-Item prop="mobil">
<span class="name-font" style="width: 80px;display: inline-block">手机号</span> <span class="name-font" style="width: 80px;display: inline-block"
<i-input placeholder="请输入手机号" style="width: 300px;" v-model="modifyFrom.mobil"/> >手机号</span
>
<i-input
placeholder="请输入手机号"
style="width: 300px;"
v-model="modifyFrom.mobil"
/>
</Form-Item> </Form-Item>
<Form-Item prop="password"> <Form-Item prop="password">
<span class="name-font" style="width: 80px;display: inline-block" >密码</span> <span class="name-font" style="width: 80px;display: inline-block"
<i-input placeholder="请输入密码" style="width: 300px;" v-model="modifyFrom.password" @on-change="check" type="password"/> >密码</span
>
<i-input
placeholder="请输入密码"
style="width: 300px;"
v-model="modifyFrom.password"
@on-change="check"
type="password"
/>
</Form-Item> </Form-Item>
<Form-Item prop="confirmPassword"> <Form-Item prop="confirmPassword">
<span class="name-font" style="width: 80px;display: inline-block">确认密码</span> <span class="name-font" style="width: 80px;display: inline-block"
<i-input placeholder="请确认密码" style="width: 300px;" v-model="modifyFrom.confirmPassword" type="password"/> >确认密码</span
>
<i-input
placeholder="请确认密码"
style="width: 300px;"
v-model="modifyFrom.confirmPassword"
type="password"
/>
</Form-Item> </Form-Item>
</Form> </Form>
</div> </div>
<!--角色--> <!--角色-->
@ -47,275 +85,313 @@
<span class="title-font">角色信息</span> <span class="title-font">角色信息</span>
</div> </div>
<div style="text-align: left;margin: 30px 0 0 30px"> <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)"> <RadioGroup
<Radio :label="item.id">{{item.name}}</Radio> 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> </RadioGroup>
</div> </div>
<div style="margin-top: 40px" v-if="shopSelectDisplay"> <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 class="select-head" style="width: 300px;" clearable v-model="modifyFrom.shopId" placeholder="请选择店铺" filterable> >店铺</span
<Option v-for="item in this.shopList" :value="item.id" :key="item.id">{{item.name}}</Option> >
<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> </Select>
</div> </div>
<div style="margin-top: 40px" v-if="companySelectDisplay"> <div style="margin-top: 40px" v-if="companySelectDisplay">
<span class="name-font" style="width: 80px;display: inline-block">零售公司</span> <span class="name-font" style="width: 80px;display: inline-block"
<Select v-model="modifyFrom.companyId" filterable style="width: 300px;"> >零售公司</span
<Option v-for="item in companyList" :value="item.id" :key="item.id">{{ item.name }}</Option> >
<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> </Select>
</div> </div>
<!--确认返回--> <!--确认返回-->
<div style="margin-top: 40px"> <div style="margin-top: 40px">
<Button type="primary" style="height: 39px;width: 101px" @click="modifyAccountConfirm()" >完成</Button> <Button
<Button style="height: 39px;width: 101px;border: 0" @click="modifyAccountcancel()"></Button> type="primary"
style="height: 39px;width: 101px"
@click="modifyAccountConfirm()"
>完成</Button
>
<Button
style="height: 39px;width: 101px;border: 0"
@click="modifyAccountcancel()"
>返回</Button
>
</div> </div>
</row> </row>
</template> </template>
<script> <script>
import accountManagementModify from '../../services/account/AccountManagementModify' import accountManagementModify from "../../services/account/AccountManagementModify";
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 {
data() { export default {
return { data() {
companyList: [], return {
companySelectDisplay:false, companyList: [],
name: "accountManagementModify", companySelectDisplay: false,
modifyFrom: { name: "accountManagementModify",
accountId: this.$route.query.accountId, modifyFrom: {
userId: this.$route.query.userId, accountId: this.$route.query.accountId,
userName: this.$route.query.userName, userId: this.$route.query.userId,
account: this.$route.query.account, userName: this.$route.query.userName,
password: this.$route.query.password, account: this.$route.query.account,
confirmPassword: this.$route.query.password, password: this.$route.query.password,
roleId: this.$route.query.roleId, confirmPassword: this.$route.query.password,
shopId: this.$route.query.shopId, roleId: this.$route.query.roleId,
type:this.$route.query.type, shopId: this.$route.query.shopId,
companyId: this.$route.query.companyId, type: this.$route.query.type,
mobil: this.$route.query.mobil, 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'}, account: [
{ min: 6, max: 18, message: '长度在 6 到 18 个字符', trigger: 'blur' }, { required: true, message: "账号不能为空", trigger: "blur" },
{ pattern: /^[0-9a-zA-Z]*$/g, message: '只可以输入数字和字母',trigger: 'blur'}, { min: 2, max: 8, message: "长度在 2 到 8 个字符", trigger: "blur" },
], {
confirmPasswordCheck:[ 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'},
],
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,
}, },
selectRole: this.$route.query.roleId, ],
roleList: [], password: null,
// confirmPassword: null,
shopList: [],
//
shopSelectDisplay: false,
}
}, },
mounted: function () { selectRole: this.$route.query.roleId,
if(this.$route.query.roleCode === 'DZ-DIANZHANG'){ roleList: [],
this.shopSelectDisplay = true; //
this.modifyFrom.type = 1; shopList: [],
this.modifyFrom.companyId = null; //
this.listShop(); shopSelectDisplay: false,
} else if(this.$route.query.roleCode === "DG-DAOGOU"){ };
this.shopSelectDisplay = true; },
this.modifyFrom.type = 4; mounted: function() {
this.modifyFrom.companyId = null; if (this.$route.query.roleCode === "DZ-DIANZHANG") {
this.listShop(); this.shopSelectDisplay = true;
}else if(this.$route.query.roleCode === 'DG-YUNYING'){ this.modifyFrom.type = 1;
this.companySelectDisplay = true; this.modifyFrom.companyId = null;
this.shopSelectDisplay = false; this.listShop();
this.modifyFrom.type = 2; } else if (this.$route.query.roleCode === "DG-DAOGOU") {
this.allCompany(); 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(); if (data.code === "0000") {
}, let row = data.results;
methods: { for (let i = 0; i < row.length; i++) {
// that.roleList.push(row[i]);
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(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){ if (data.code === "0002") {
this.modifyFrom.account = this.modifyFrom.account.trim(); that.$Message.info("账号已经存在(登录账号不能重复)");
return;
} }
// if (data.code === "0000") {
this.$refs["modifyFrom"].validate((valid) => { if (data.results == "0001") {
if (!valid) { that.$Message.error("添加失败!");
return; } 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 = []; modifyAccountcancel: function() {
accountManagementModify.listShopApi({}, function (data) { this.$router.push({ path: "/account/manager" });
data = data.data; },
if(data.code === '0001') { //
that.$Message.error("查询店铺失败"); roleChange(roleBean) {
return; if (roleBean.code === "DZ-DIANZHANG") {
} this.shopSelectDisplay = true;
if(data.code === '0000') { this.modifyFrom.type = 1;
let row = data.results; this.companySelectDisplay = false;
for(let i = 0 ; i < row.length ; i++) { this.modifyFrom.companyId = null;
that.shopList.push(row[i]); this.listShop();
} } else if (roleBean.code === "DG-DAOGOU") {
} this.shopSelectDisplay = true;
}); this.modifyFrom.type = 4;
}, this.companySelectDisplay = false;
check(){ this.modifyFrom.companyId = null;
this.modifyValidate.password = this.passwordCheck; this.listShop();
this.modifyValidate.confirmPassword = this.confirmPasswordCheck; } else if (roleBean.code === "DG-YUNYING") {
}, this.companySelectDisplay = true;
allCompany(){ this.shopSelectDisplay = false;
let that = this; this.modifyFrom.type = 2;
let request = { this.allCompany();
userId:JSON.parse(sessionStorage.getItem("loginInfo")).userId } else if (roleBean.code === "GL-YUNYING") {
}; this.companySelectDisplay = false;
this.companyList = []; this.shopSelectDisplay = false;
IncreaseData.listOfRetailCompany(request,function (data) { this.addFrom.type = 2;
data = data.data; } else {
if (data.code === '0001') { this.shopSelectDisplay = false;
that.$Message.error("查询零售公司出错!"); this.modifyFrom.shopId = null;
return; this.modifyFrom.companyId = null;
}
if (data.code === '0000') {
data.results.forEach(da => {
that.companyList.push(da);
})
}
})
},
} }
},
} //
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> </script>
<style scoped> <style scoped></style>
</style>

@ -1,404 +1,457 @@
<template> <template>
<div class="div-page"> <div class="div-page">
<template> <template>
<Row class="search-row"> <Row class="search-row">
<i-col span="18"> <i-col span="18">
<span class="search-span">账户名</span> <span class="search-span">账户名</span>
<i-input placeholder="搜索用户名/账户" class="search-select" v-model="searchContent"/> <i-input
<span class="search-span">角色</span> placeholder="搜索用户名/账户"
<Select filterable placeholder="请选择角色" v-model="changeRoleId" class="left-15 search-select"> class="search-select"
<Option v-for="item in roleList" :value="item.id" :key="item.id">{{ item.name }}</Option> v-model="searchContent"
</Select> />
<span class="search-span">店铺</span> <span class="search-span">角色</span>
<Select filterable placeholder="请选择店铺" v-model="changeShopId" class="left-15 search-select"> <Select
<Option v-for="item in shopList" :value="item.id" :key="item.name">{{ item.name }}</Option> filterable
</Select> placeholder="请选择角色"
<Button type="primary" class="search-btn" @click="listAccountInfoFunction"></Button> v-model="changeRoleId"
</i-col> class="left-15 search-select"
<i-col span="6" class="search-btn-add-row"> >
<Button type="primary" <Option v-for="item in roleList" :value="item.id" :key="item.id">{{
@click="addOneAccount()">+添加账户 item.name
</Button> }}</Option>
<!-- <Button type="primary" ghost style="margin-bottom: 20px;margin-right: 20px;float:right;margin-top: 25px"--> </Select>
<!-- @click="uploadAccount">批量导入账户--> <span class="search-span">店铺</span>
<!-- </Button>--> <Select
</i-col> filterable
placeholder="请选择店铺"
v-model="changeShopId"
</Row> class="left-15 search-select"
</template> >
<Table :loading="loading" :columns="columns1" :data="data1" class="table-account" size="small"></Table> <Option
<Page :total="totalSize" :current="pageNum" :page-size="pageSize" show-elevator show-total v-for="item in shopList"
placement="top" @on-change="handlePage" class-name="ks-page"></Page> :value="item.id"
<Modal :key="item.name"
v-model="modal13" >{{ item.name }}</Option
title="删除提示" >
@on-cancel="cancel" align="center"> </Select>
<p style="margin-top: 20px;margin-bottom: 20px">确定要删除此账户吗删除后不可恢复</p> <Button
<div slot="footer" style="text-align: center;margin-bottom: 10px;margin-top: 10px"> type="primary"
<Button style="width: 100px;" @click="modal13 = false">取消删除</Button> class="search-btn"
<Button type="error" style="width: 100px;margin-left: 20px" @click="ok"></Button> @click="listAccountInfoFunction"
</div> >查询</Button
</Modal> >
</div> </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> </template>
<script> <script>
import accountManagement from "../../services/account/AccountManagement"; import accountManagement from "../../services/account/AccountManagement";
export default { export default {
data() { data() {
return { return {
loading: false, loading: false,
modal13: false, modal13: false,
roleList: [ roleList: [
{ {
id: '0', id: "0",
name: '全部', name: "全部",
}, },
{ {
id: '1', id: "1",
name: '系统管理员', name: "系统管理员",
}, },
{ {
id: '2', id: "2",
name: '运营人员', name: "运营人员",
}, },
{ {
id: '3', id: "3",
name: '店长', name: "店长",
}, },
{ {
id: '4', id: "4",
name: '导购', name: "导购",
}, },
], ],
shopList: [ shopList: [],
], columns1: [
columns1: [ {
{ type: "index2",
type: 'index2', width: 80,
width: 80, title: "序号",
title: "序号", align: "center",
align: 'center', render: (h, params) => {
render: (h, params) => { return h(
return h('span', params.index + (this.pageNum- 1) * this.pageSize + 1); "span",
} params.index + (this.pageNum - 1) * this.pageSize + 1
}, );
{ },
title: '用户名', },
key: 'userName' {
}, title: "用户名",
{ key: "userName",
title: '别名', },
key: 'abbreviation' {
}, title: "别名",
{ key: "abbreviation",
title: '系统账号', },
key: 'account' {
}, title: "系统账号",
{ key: "account",
title: '手机号', },
key: 'mobil', {
}, title: "手机号",
{ key: "mobil",
title: '系统角色', },
key: 'roleName' {
}, title: "系统角色",
{ key: "roleName",
title: '零售公司', },
key: 'companyName' {
}, title: "零售公司",
{ key: "companyName",
title: '店铺', },
key: 'shopName' {
}, title: "店铺",
{ key: "shopName",
title: '店铺编码', },
key: 'shopCode' {
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; h(
return h('div', [ "span",
h('span', { {
style: { style: {
background: 'white', background: "white",
border: '0', border: "0",
color: '#3496EB', color: "red",
marginRight: '15px', marginRight: "15px",
cursor: 'pointer' cursor: "pointer",
}, },
on: { on: {
click: () => { click: () => {
this.$router.push({ that.modal13 = true;
path: '/account/management/modify', that.updateAccountId = that.data1[params.index].accountId;
query: { that.updateUserId = that.data1[params.index].userId;
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;
}
}
}, '删除')
])
}
}, },
], },
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: { ],
// data1: [],
handlePage: function (value) { roleId: "",
this.pageNum = value; shopId: "",
this.listAccountInfoFunction(); //
}, totalSize: 0,
// pageNum: 1,
addOneAccount() { pageSize: 10,
this.$router.push({ //
path: '/account/management/add', searchContent: null,
}); changeShopId: null,
}, changeRoleId: null,
// updateAccountId: 0,
listRoleInfo() { updateUserId: 0,
let that = this; item: null,
that.roleList = []; };
accountManagement.listRoleInfoApi({}, function (data) { },
data = data.data; mounted: function() {
if (data.code === '0001') { this.listRoleInfo();
that.$Message.error("查询角色失败!"); this.listOfShop();
return; // enter
} this.enterKeyup();
if (data.code === '0000') { },
data = data.results; methods: {
that.roleList.push({ //
id: "0", handlePage: function(value) {
name: "全部" this.pageNum = value;
}); this.listAccountInfoFunction();
for (let i = 0; i < data.length; i++) { },
let row = data[i]; //
that.roleList.push(row); addOneAccount() {
} this.$router.push({
if (that.$route.query != null) { path: "/account/management/add",
that.item = that.$route.query; });
// },
if (that.item.id === undefined) { //
that.changeRoleId = "0"; listRoleInfo() {
} else { let that = this;
that.changeRoleId = that.item.id; that.roleList = [];
} accountManagement.listRoleInfoApi({}, function(data) {
} else { data = data.data;
that.changeRoleId = "0"; if (data.code === "0001") {
} that.$Message.error("查询角色失败!");
that.listAccountInfoFunction(); return;
} }
}) if (data.code === "0000") {
}, data = data.results;
// that.roleList.push({
listOfShop() { id: "0",
let that = this; name: "全部",
this.loading = true; });
that.shopList = []; for (let i = 0; i < data.length; i++) {
let request = { let row = data[i];
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId that.roleList.push(row);
}; }
accountManagement.listAllShopApi(request, function (data) { if (that.$route.query != null) {
data = data.data; that.item = that.$route.query;
that.loading = false; //
if (data.code === '0001') { if (that.item.id === undefined) {
that.$Message.error("查询店铺失败!"); that.changeRoleId = "0";
return; } else {
} that.changeRoleId = that.item.id;
if (data.code === '0000') { }
that.shopList.push({ } else {
id: '-1', that.changeRoleId = "0";
name: "全部" }
}); that.listAccountInfoFunction();
that.changeShopId = '-1'; }
data = data.results; });
for (let i = 0; i < data.length; i++) { },
let row = data[i]; //
that.shopList.push(row); listOfShop() {
} let that = this;
} this.loading = true;
}, function () { that.shopList = [];
that.loading = false; let request = {
}); userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
}, };
// accountManagement.listAllShopApi(
listAccountInfoFunction: function () { request,
let that = this; function(data) {
let roleId = that.changeRoleId; data = data.data;
if (that.changeRoleId === "0") { that.loading = false;
roleId = null; if (data.code === "0001") {
} that.$Message.error("查询店铺失败!");
let shopId = that.changeShopId; return;
if (that.changeShopId === "-1") { }
shopId = null; if (data.code === "0000") {
} that.shopList.push({
let request = { id: "-1",
searchContent: that.searchContent, name: "全部",
pageNum: that.pageNum, });
pageSize: that.pageSize, that.changeShopId = "-1";
roleId: roleId, data = data.results;
shopId: shopId for (let i = 0; i < data.length; i++) {
}; let row = data[i];
accountManagement.listAccountInfoApi(request, function (data) { that.shopList.push(row);
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();
}
},
}, },
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> </script>
<style scoped> <style scoped>
.div-page { .div-page {
margin-top: 20px; margin-top: 20px;
margin-left: 20px; margin-left: 20px;
} }
.search-row{ .search-row {
background-color: #F7F8FA; background-color: #f7f8fa;
line-height: 80px; line-height: 80px;
} }
.search-btn { .search-btn {
margin-left: 30px; margin-left: 30px;
} }
.search-btn-add-row { .search-btn-add-row {
text-align: right; text-align: right;
padding-right: 20px; padding-right: 20px;
} }
.table-account{ .table-account {
margin-top: 30px; margin-top: 30px;
} }
</style> </style>

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