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: {

@ -13,23 +13,47 @@
</i-col>
</Row>
<Table :columns="columns1" :data="data1" style="margin-top: 20px;" size="small">
<Table
:columns="columns1"
:data="data1"
style="margin-top: 20px;"
size="small"
>
<template slot-scope="{ row }" slot="qrCodeAction">
<img :src="require('../../../static/img/qrCode-init.png')" @click="show(row)"
style="margin-left: 5px;margin-top: 5px;width:30px;height:30px;"/>
<img
:src="require('../../../static/img/qrCode-init.png')"
@click="show(row)"
style="margin-left: 5px;margin-top: 5px;width:30px;height:30px;"
/>
</template>
<template slot-scope="{ row, index }" slot="state">
<i-switch size="large" :value="row.qrCodeState" @on-change="onSwitchChangeLister(row, index)">
<i-switch
size="large"
:value="row.qrCodeState"
@on-change="onSwitchChangeLister(row, index)"
>
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
</template>
<template slot-scope="{ row }" slot="action">
<Button ghost type="primary" size="small" style="border: 0px;color:#2074E2"
@click="open(2, row)">修改
<Button
ghost
type="primary"
size="small"
style="border: 0px;color:#2074E2"
@click="open(2, row)"
>修改
</Button>
<Button ghost type="error" size="small" style="border: 0px" @click="remove(row)"></Button>
<Button
ghost
type="error"
size="small"
style="border: 0px"
@click="remove(row)"
>删除</Button
>
</template>
</Table>
@ -52,8 +76,7 @@
</Modal>
<!-- 添加推广人员 -->
<Modal v-model="isShowAdd"
:footer-hide="true">
<Modal v-model="isShowAdd" :footer-hide="true">
<div slot="header">
<template v-if="flag === 1">
<span>添加推广人员</span>
@ -63,21 +86,39 @@
</template>
</div>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<Form
ref="formValidate"
:model="formValidate"
:rules="ruleValidate"
:label-width="80"
>
<FormItem label="名称" prop="name">
<i-input v-model="formValidate.name" placeholder="请输入名字"></i-input>
<i-input
v-model="formValidate.name"
placeholder="请输入名字"
></i-input>
</FormItem>
<FormItem label="手机" prop="phone">
<i-input v-model="formValidate.phone" placeholder="成员通过验证该手机号后可加入企业"
:disabled="flag !== 1 ? true : false">
<i-input
v-model="formValidate.phone"
placeholder="成员通过验证该手机号后可加入企业"
:disabled="flag !== 1 ? true : false"
>
</i-input>
</FormItem>
<FormItem label="工号" prop="staffCode">
<i-input v-model="formValidate.staffCode" placeholder="请输入工号"
:disabled="flag !== 1 ? true : false"></i-input>
<i-input
v-model="formValidate.staffCode"
placeholder="请输入工号"
:disabled="flag !== 1 ? true : false"
></i-input>
</FormItem>
<FormItem label="角色" prop="role">
<Select v-model="formValidate.role" placeholder="选择角色" :disabled="flag !== 1 ? true : false">
<Select
v-model="formValidate.role"
placeholder="选择角色"
:disabled="flag !== 1 ? true : false"
>
<Option value="DZ-DIANZHANG">店长</Option>
<Option value="DG-DAOGOU">导购</Option>
</Select>
@ -90,8 +131,14 @@
<FormItem style="text-align: left;">
<Row>
<i-col span="16">
<Button type="primary" @click="handleSubmit(formValidate)"></Button>
<Button @click="handleReset('formValidate')" style="margin-left: 8px">取消</Button>
<Button type="primary" @click="handleSubmit(formValidate)"
>保存</Button
>
<Button
@click="handleReset('formValidate')"
style="margin-left: 8px"
>取消</Button
>
</i-col>
</Row>
</FormItem>
@ -101,29 +148,48 @@
<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">
@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="deleteStaff"></Button>
<Button
type="error"
style="width: 100px;margin-left: 20px"
@click="deleteStaff"
>确认删除</Button
>
</div>
</Modal>
<Page :total="total" :current="pageNum" :page-size="pageSize" show-elevator show-total
placement="top" @on-change="handlePage"
class="ks-page"></Page>
<Page
:total="total"
:current="pageNum"
:page-size="pageSize"
show-elevator
show-total
placement="top"
@on-change="handlePage"
class="ks-page"
></Page>
</div>
</template>
<script>
import data from "../../utils/PhoneRegionData";
import http from '../../services/store/IncreaseStoreManager';
import http from "../../services/store/IncreaseStoreManager";
import staff from "../../services/staff/staff";
export default {
name: "IncreaseStaffManager",
inject: ['setMenuName'],
inject: ["setMenuName"],
data() {
return {
modal13: false,
@ -134,9 +200,9 @@
prefixDefault: data.prefixDefault,
isShow: false,
isShowAdd: false,
showStoreName: '',
showStoreCode: '',
qrCodeImage: '',
showStoreName: "",
showStoreCode: "",
qrCodeImage: "",
loading: true,
spuLoading: false,
//
@ -153,86 +219,90 @@
rules: { required: false },
columns1: [
{
title: '序号',
key: 'id',
title: "序号",
key: "id",
},
{
title: '姓名',
key: 'name',
title: "姓名",
key: "name",
},
{
title: '员工ID',
key: 'staffCode',
title: "员工ID",
key: "staffCode",
},
{
title: '手机号码',
key: 'mobil',
title: "手机号码",
key: "mobil",
},
{
title: '店铺',
key: 'storeName',
title: "店铺",
key: "storeName",
},
{
title: '角色',
key: 'role',
title: "角色",
key: "role",
},
{
title: '客户数',
key: 'customerNum',
title: "客户数",
key: "customerNum",
},
{
title: '推广码',
slot: 'qrCodeAction',
key: 'epWechatQrCode',
title: "推广码",
slot: "qrCodeAction",
key: "epWechatQrCode",
},
{
title: '操作',
slot: 'action',
}
title: "操作",
slot: "action",
},
],
data1: [],
//
formValidate: {
name: '',
staffCode: '',
region: '',
phone: '',
role: '',
store: '',
userId: '',
checkbox: ['vail']
name: "",
staffCode: "",
region: "",
phone: "",
role: "",
store: "",
userId: "",
checkbox: ["vail"],
},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
],
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
staffCode: [
{required: true, message: '工号不能为空', trigger: 'blur'}
{ required: true, message: "工号不能为空", trigger: "blur" },
],
// mail: [
// { required: true, message: '', trigger: 'blur' },
// { type: 'email', message: '', trigger: 'blur' }
// ],
role: [
{required: true, message: '请选择角色', trigger: 'change'}
],
role: [{ required: true, message: "请选择角色", trigger: "change" }],
region: [
{required: true, type: String, message: '请选择区域', trigger: 'change'}
{
required: true,
type: String,
message: "请选择区域",
trigger: "change",
},
],
store: [
{required: true, type: String, message: '请选择店铺', trigger: 'change'}
]
}
}
{
required: true,
type: String,
message: "请选择店铺",
trigger: "change",
},
],
},
};
},
mounted() {
this.setMenuName("门店推广", "推广管理", "门店导购管理");
this.listOfLogistics();
},
methods: {
cancel: function () {
},
cancel: function() {},
listOfLogistics() {
let that = this;
let request = {
@ -243,7 +313,6 @@
staff.getStaffList(request, function(data) {
data = data.data;
if (data.code == "0000") {
that.data1 = [];
let datas = data.results;
//
@ -257,14 +326,13 @@
}
that.data1 = datas.records;
}
})
});
},
//
downRegionData: function() {
let that = this;
that.regionList = [{"id": 0, "name": "全部"}];
let request =
{userId: that.userId};
that.regionList = [{ id: 0, name: "全部" }];
let request = { userId: that.userId };
staff.downRegionData(request, function(data) {
data = data.data.results;
if (data) {
@ -275,13 +343,15 @@
}
}
}
})
});
},
downShopData: function() {
let that = this;
that.shopList = [{"id": 0, "name": "全部"}];
let request =
{userId: that.userId, regionId: that.changeData(that.selectedRegion)};
that.shopList = [{ id: 0, name: "全部" }];
let request = {
userId: that.userId,
regionId: that.changeData(that.selectedRegion),
};
staff.downShopData(request, function(data) {
data = data.data.results;
if (data) {
@ -292,7 +362,7 @@
}
}
}
})
});
},
downRoleData: function() {
let that = this;
@ -306,7 +376,7 @@
}
}
}
})
});
},
addSattf: function(request) {
let that = this;
@ -314,32 +384,31 @@
data = data.data;
if (data.code == "0000") {
if (data.results == "0001") {
that.$Message.error('添加失败!');
that.$Message.error("添加失败!");
} else if (data.results == "0002") {
that.$Message.error('该工号已经被使用!');
that.$Message.error("该工号已经被使用!");
} else if (data.results == "0003") {
that.$Message.error('该手机号已经被使用!');
that.$Message.error("该手机号已经被使用!");
} else if (data.results == "0004") {
that.$Message.error('该工号已经被使用!');
that.$Message.error("该工号已经被使用!");
} else if (data.results == "0000") {
that.$Message.success('添加成功!');
that.$Message.success("添加成功!");
that.handleAdd(that.formValidate);
that.listOfLogistics();
}
}
})
});
},
editSattf: function(request) {
let that = this;
staff.editSattf(request, function(data) {
data = data.data;
if (data.code == "0000") {
that.$Message.success('修改成功!');
that.$Message.success("修改成功!");
that.isShowAdd = false;
that.listOfLogistics();
}
})
});
},
searchCustomerDataBtnClick: function() {
@ -359,9 +428,7 @@
downRegionChange: function() {
this.downShopData();
},
onChangeDateLister: function () {
},
onChangeDateLister: function() {},
//
show: function(index) {
this.isShow = true;
@ -373,11 +440,13 @@
//
download: function(index) {
let name = index.staffCode + "-" + index.name + "-导购码";
http.downloadImg({
url: index.epWechatQrCode
}, name, function (/*data*/) {
})
http.downloadImg(
{
url: index.epWechatQrCode,
},
name,
function(/*data*/) {}
);
},
// 广
open: function(flag, row) {
@ -401,15 +470,14 @@
role: role,
store: row.storeId,
userId: row.userId,
id: row.id
}
id: row.id,
};
} else {
this.handleAdd(this.formValidate);
}
},
back: function() {
this.$router.push({path: '/shop/increase/manager'});
this.$router.push({ path: "/shop/increase/manager" });
},
//
remove: function(row) {
@ -419,39 +487,36 @@
//
deleteStaff: function() {
let requset = {
staffId: this.deleteId
}
staffId: this.deleteId,
};
let that = this;
staff.removeStaff(requset, function(data) {
data = data.data;
if (data.results) {
that.$Message.success('删除成功!');
that.$Message.success("删除成功!");
that.modal13 = false;
that.listOfLogistics();
} else {
that.$Message.success('删除失败!');
that.$Message.success("删除失败!");
}
})
});
},
// switch
onSwitchChangeLister: function () {
},
onSwitchChangeLister: function() {},
handleSubmit(value) {
if (value) {
let request = {};
if (this.flag == 1) {
if (value.name == null || value.name == "") {
this.$Message.success('名称不能为空!');
this.$Message.success("名称不能为空!");
return;
}
if (value.staffCode == null || value.staffCode == "") {
this.$Message.success('工号不能为空!');
this.$Message.success("工号不能为空!");
return;
}
if (value.role == null || value.role == "") {
this.$Message.success('角色不能为空!');
this.$Message.success("角色不能为空!");
return;
}
//
@ -461,13 +526,12 @@
mobil: value.phone,
staffCode: value.staffCode,
role: value.role,
isOpen: this.formValidate.checkbox[0]
isOpen: this.formValidate.checkbox[0],
};
this.addSattf(request);
} else {
let newRole;
if (value.role === 'DZ-DIANZHANG') {
if (value.role === "DZ-DIANZHANG") {
newRole = 1;
} else {
newRole = 4;
@ -480,16 +544,14 @@
staffCode: value.staffCode,
roleId: newRole,
userId: this.formValidate.userId,
id: this.formValidate.id
id: this.formValidate.id,
};
//
this.editSattf(request);
}
} else {
this.$Message.error('Fail!');
this.$Message.error("Fail!");
}
},
handleReset(name) {
this.$refs[name].resetFields();
@ -502,10 +564,10 @@
value.staffCode = "";
value.role = "";
value.region = "";
value.checkbox = ['vail'];
}
}
}
value.checkbox = ["vail"];
},
},
};
</script>
<style scoped>

@ -1,13 +1,13 @@
<style scoped>
/deep/.title-font {
color: #4E5966;
color: #4e5966;
font-size: 14px;
font-weight: 700;
margin-bottom: 20px;
}
/deep/.name-font {
font-size: 14px;
color: #4E5966;
color: #4e5966;
}
</style>
<template>
@ -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,38 +85,67 @@
<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)">
<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>
<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>
<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 accountManagementModify from "../../services/account/AccountManagementModify";
import accountManagement from "../../services/account/AccountManagement";
import IncreaseData from "../../services/generalize/IncreaseData";
export default {
data() {
return {
companyList: [],
@ -98,28 +165,44 @@
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'},
{ 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'},
{ 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'},
{ 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'}
{ 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'},
{ 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,
@ -130,10 +213,10 @@
shopList: [],
//
shopSelectDisplay: false,
}
};
},
mounted: function() {
if(this.$route.query.roleCode === 'DZ-DIANZHANG'){
if (this.$route.query.roleCode === "DZ-DIANZHANG") {
this.shopSelectDisplay = true;
this.modifyFrom.type = 1;
this.modifyFrom.companyId = null;
@ -143,7 +226,7 @@
this.modifyFrom.type = 4;
this.modifyFrom.companyId = null;
this.listShop();
}else if(this.$route.query.roleCode === 'DG-YUNYING'){
} else if (this.$route.query.roleCode === "DG-YUNYING") {
this.companySelectDisplay = true;
this.shopSelectDisplay = false;
this.modifyFrom.type = 2;
@ -158,11 +241,11 @@
that.roleList = [];
accountManagement.listRoleInfoApi({}, function(data) {
data = data.data;
if(data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询失败");
return;
}
if(data.code === '0000') {
if (data.code === "0000") {
let row = data.results;
for (let i = 0; i < row.length; i++) {
that.roleList.push(row[i]);
@ -204,46 +287,42 @@
let that = this;
let request = {
modifyForm: JSON.stringify(that.modifyFrom)
modifyForm: JSON.stringify(that.modifyFrom),
};
accountManagementModify.modifyAccountApi(request, function(data) {
data = data.data;
if(data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("修改账号失败");
return;
}
if(data.code === '0002') {
if (data.code === "0002") {
that.$Message.info("账号已经存在(登录账号不能重复)");
return;
}
if(data.code === '0000') {
if (data.code === "0000") {
if (data.results == "0001") {
that.$Message.error('添加失败!');
that.$Message.error("添加失败!");
} else if (data.results == 3) {
that.$Message.error('该手机号已经被使用!');
that.$Message.error("该手机号已经被使用!");
} else if (data.results == 2) {
that.$Message.error('该手机号已经被使用!');
that.$Message.error("该手机号已经被使用!");
} else if (data.results == 1) {
that.$Message.error('该账号已经被使用!');
that.$Message.error("该账号已经被使用!");
} else if (data.results == 0) {
that.$Message.success("修改账号成功");
that.$router.push({path:'/account/manager'});
that.$router.push({ path: "/account/manager" });
}
}
})
});
});
},
//
modifyAccountcancel: function() {
this.$router.push({path:'/account/manager'});
this.$router.push({ path: "/account/manager" });
},
//
roleChange(roleBean) {
if(roleBean.code === 'DZ-DIANZHANG'){
if (roleBean.code === "DZ-DIANZHANG") {
this.shopSelectDisplay = true;
this.modifyFrom.type = 1;
this.companySelectDisplay = false;
@ -255,12 +334,12 @@
this.companySelectDisplay = false;
this.modifyFrom.companyId = null;
this.listShop();
}else if(roleBean.code === 'DG-YUNYING'){
} else if (roleBean.code === "DG-YUNYING") {
this.companySelectDisplay = true;
this.shopSelectDisplay = false;
this.modifyFrom.type = 2;
this.allCompany();
}else if(roleBean.code === 'GL-YUNYING'){
} else if (roleBean.code === "GL-YUNYING") {
this.companySelectDisplay = false;
this.shopSelectDisplay = false;
this.addFrom.type = 2;
@ -276,11 +355,11 @@
that.shopList = [];
accountManagementModify.listShopApi({}, function(data) {
data = data.data;
if(data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询店铺失败");
return;
}
if(data.code === '0000') {
if (data.code === "0000") {
let row = data.results;
for (let i = 0; i < row.length; i++) {
that.shopList.push(row[i]);
@ -295,27 +374,24 @@
allCompany() {
let that = this;
let request = {
userId:JSON.parse(sessionStorage.getItem("loginInfo")).userId
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
};
this.companyList = [];
IncreaseData.listOfRetailCompany(request, function(data) {
data = data.data;
if (data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询零售公司出错!");
return;
}
if (data.code === '0000') {
data.results.forEach(da => {
if (data.code === "0000") {
data.results.forEach((da) => {
that.companyList.push(da);
})
});
}
})
});
},
}
}
},
};
</script>
<style scoped>
</style>
<style scoped></style>

@ -4,40 +4,85 @@
<Row class="search-row">
<i-col span="18">
<span class="search-span">账户名</span>
<i-input placeholder="搜索用户名/账户" class="search-select" v-model="searchContent"/>
<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
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
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>
<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" @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>
<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">
@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>
<Button type="error" style="width: 100px;margin-left: 20px" @click="ok"
>确认删除</Button
>
</div>
</Modal>
</div>
@ -53,88 +98,92 @@
modal13: false,
roleList: [
{
id: '0',
name: '全部',
id: "0",
name: "全部",
},
{
id: '1',
name: '系统管理员',
id: "1",
name: "系统管理员",
},
{
id: '2',
name: '运营人员',
id: "2",
name: "运营人员",
},
{
id: '3',
name: '店长',
id: "3",
name: "店长",
},
{
id: '4',
name: '导购',
id: "4",
name: "导购",
},
],
shopList: [
],
shopList: [],
columns1: [
{
type: 'index2',
type: "index2",
width: 80,
title: "序号",
align: 'center',
align: "center",
render: (h, params) => {
return h('span', params.index + (this.pageNum- 1) * this.pageSize + 1);
}
return h(
"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',
title: "操作",
key: "operation",
render: (h, params) => {
let that = this;
return h('div', [
h('span', {
return h("div", [
h(
"span",
{
style: {
background: 'white',
border: '0',
color: '#3496EB',
marginRight: '15px',
cursor: 'pointer'
background: "white",
border: "0",
color: "#3496EB",
marginRight: "15px",
cursor: "pointer",
},
on: {
click: () => {
this.$router.push({
path: '/account/management/modify',
path: "/account/management/modify",
query: {
accountId: params.row.accountId,
userId: params.row.userId,
@ -147,36 +196,40 @@
shopId: params.row.shopId,
companyId: params.row.orgId,
mobil: params.row.mobil,
}
},
});
}
}
}, '修改'),
h('span', {
},
},
},
"修改"
),
h(
"span",
{
style: {
background: 'white',
border: '0',
color: 'red',
marginRight: '15px',
cursor: 'pointer'
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: '',
data1: [],
roleId: "",
shopId: "",
//
totalSize: 0,
pageNum: 1,
@ -188,7 +241,7 @@
updateAccountId: 0,
updateUserId: 0,
item: null,
}
};
},
mounted: function() {
this.listRoleInfo();
@ -205,7 +258,7 @@
//
addOneAccount() {
this.$router.push({
path: '/account/management/add',
path: "/account/management/add",
});
},
//
@ -214,15 +267,15 @@
that.roleList = [];
accountManagement.listRoleInfoApi({}, function(data) {
data = data.data;
if (data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询角色失败!");
return;
}
if (data.code === '0000') {
if (data.code === "0000") {
data = data.results;
that.roleList.push({
id: "0",
name: "全部"
name: "全部",
});
for (let i = 0; i < data.length; i++) {
let row = data[i];
@ -241,7 +294,7 @@
}
that.listAccountInfoFunction();
}
})
});
},
//
listOfShop() {
@ -249,30 +302,34 @@
this.loading = true;
that.shopList = [];
let request = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
};
accountManagement.listAllShopApi(request, function (data) {
accountManagement.listAllShopApi(
request,
function(data) {
data = data.data;
that.loading = false;
if (data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询店铺失败!");
return;
}
if (data.code === '0000') {
if (data.code === "0000") {
that.shopList.push({
id: '-1',
name: "全部"
id: "-1",
name: "全部",
});
that.changeShopId = '-1';
that.changeShopId = "-1";
data = data.results;
for (let i = 0; i < data.length; i++) {
let row = data[i];
that.shopList.push(row);
}
}
}, function () {
},
function() {
that.loading = false;
});
}
);
},
//
listAccountInfoFunction: function() {
@ -290,35 +347,35 @@
pageNum: that.pageNum,
pageSize: that.pageSize,
roleId: roleId,
shopId: shopId
shopId: shopId,
};
accountManagement.listAccountInfoApi(request, function(data) {
that.data1 = [];
data = data.data;
if (data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("系统繁忙!");
return
return;
}
if (data.code === '0000') {
if (data.code === "0000") {
if (data) {
let row = data.results.records;
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 = '--';
entity.channel = "--";
}
if (!entity.account) {
entity.account = '--';
entity.account = "--";
}
if (!entity.userName) {
entity.userName = '--';
entity.userName = "--";
}
if (!entity.roleName) {
entity.roleName = '--';
entity.roleName = "--";
}
if (!entity.shopName) {
entity.shopName = '--';
entity.shopName = "--";
}
that.data1.push(entity);
}
@ -327,31 +384,28 @@
}
}
}
})
});
},
//
remove() {
let that = this;
let request = {
accountId: that.updateAccountId,
userId: that.updateUserId
userId: that.updateUserId,
};
accountManagement.removeAccountApi(request, function(data) {
if (data.data.code === '0001') {
if (data.data.code === "0001") {
that.$Message.info("删除失败");
return
return;
}
if (data.data.code === '0000') {
if (data.data.code === "0000") {
that.$Message.info("删除成功");
that.pageNum = 1;
that.listAccountInfoFunction();
}
})
},
cancel() {
});
},
cancel() {},
ok() {
this.modal13 = false;
this.remove();
@ -374,8 +428,7 @@
}
},
},
}
};
</script>
<style scoped>
@ -385,7 +438,7 @@
}
.search-row {
background-color: #F7F8FA;
background-color: #f7f8fa;
line-height: 80px;
}

@ -1,6 +1,6 @@
<style scoped>
/deep/ .title-font {
color: #4E5966;
color: #4e5966;
font-size: 14px;
font-weight: 700;
margin-bottom: 20px;
@ -8,9 +8,8 @@
/deep/ .name-font {
font-size: 14px;
color: #4E5966;
color: #4e5966;
}
</style>
<template>
<row style="margin-left: 30px;margin-top: 30px">
@ -19,27 +18,63 @@
<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
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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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>
@ -49,40 +84,65 @@
<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)">
<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="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>
<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="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"
>零售公司</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>
<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>
<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 accountManagementAdd from "../../services/account/AccountManagementAdd";
import accountManagement from "../../services/account/AccountManagement";
import IncreaseData from "../../services/generalize/IncreaseData";
export default {
@ -93,8 +153,8 @@
userName: null,
roleId: null,
account: null,
password: '123456',
confirmPassword: '123456',
password: "123456",
confirmPassword: "123456",
shopId: null,
type: null,
companyId: null,
@ -102,62 +162,87 @@
},
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'}
{ 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'},
{ 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'},
{ 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'},
{ 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'},
{ 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: "系统管理员"
name: "系统管理员",
},
{
id: 2,
name: "运营人员"
name: "运营人员",
},
{
id: 3,
name: "店长"
name: "店长",
},
],
//
shopList: [
{
id: 3,
name: "店长"
name: "店长",
},
],
//
shopSelectDisplay: false,
companyList: [],
companySelectDisplay: false,
}
};
},
mounted: function() {
//
this.bus.$emit('setHeader',{header:"添加账户"});
this.bus.$emit("setHeader", { header: "添加账户" });
//-
this.listRoleInfo();
},
methods: {
//
@ -166,17 +251,17 @@
that.roleList = [];
accountManagement.listRoleInfoApi({}, function(data) {
data = data.data;
if (data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询角色失败!");
return;
}
if (data.code === '0000') {
if (data.code === "0000") {
let row = data.results;
for (let i = 0; i < row.length; i++) {
that.roleList.push(row[i]);
}
}
})
});
},
//
addAccountConfirm: function() {
@ -213,44 +298,42 @@
let that = this;
//
let request = {
addFrom: JSON.stringify(that.addFrom)
addFrom: JSON.stringify(that.addFrom),
};
accountManagementAdd.saveAccountInputApi(request, function(data) {
data = data.data;
if(data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("保存账号失败");
return;
}
if(data.code === '0002') {
if (data.code === "0002") {
that.$Message.info("账号已经存在(登录账号不能重复)");
return;
}
if(data.code === '0000') {
if (data.code === "0000") {
if (data.results == "0001") {
that.$Message.error('添加失败!');
that.$Message.error("添加失败!");
} else if (data.results == "0002") {
that.$Message.error('该工号已经被使用!');
that.$Message.error("该工号已经被使用!");
} else if (data.results == "0003") {
that.$Message.error('该手机号已经被使用!');
that.$Message.error("该手机号已经被使用!");
} else if (data.results == "0004") {
that.$Message.error('该账号已经被使用!');
that.$Message.error("该账号已经被使用!");
} else if (data.results == "0000") {
that.$Message.success("保存账号成功");
that.$router.push({path:'/account/manager'});
that.$router.push({ path: "/account/manager" });
}
}
})
});
});
},
//
addAccountCancel: function() {
this.$router.push({path: '/account/manager'});
this.$router.push({ path: "/account/manager" });
},
//
roleChange(roleBean) {
if (roleBean.code === 'DZ-DIANZHANG') {
if (roleBean.code === "DZ-DIANZHANG") {
this.shopSelectDisplay = true;
this.companySelectDisplay = false;
this.addFrom.companyId = null;
@ -262,12 +345,12 @@
this.addFrom.companyId = null;
this.addFrom.type = 4;
this.listOfShop();
}else if(roleBean.code === 'DG-YUNYING'){
} else if (roleBean.code === "DG-YUNYING") {
this.companySelectDisplay = true;
this.shopSelectDisplay = false;
this.addFrom.type = 3;
this.allCompany();
}else if(roleBean.code === 'GL-YUNYING'){
} else if (roleBean.code === "GL-YUNYING") {
this.companySelectDisplay = false;
this.shopSelectDisplay = false;
this.addFrom.type = 2;
@ -282,46 +365,43 @@
let that = this;
that.shopList = [];
let request = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
};
accountManagement.listAllShopApi(request, function(data) {
data = data.data;
if (data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询店铺失败!");
return;
}
if (data.code === '0000') {
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
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
};
this.companyList = [];
IncreaseData.listOfRetailCompany(request, function(data) {
data = data.data;
if (data.code === '0001') {
if (data.code === "0001") {
that.$Message.error("查询零售公司出错!");
return;
}
if (data.code === '0000') {
data.results.forEach(da => {
if (data.code === "0000") {
data.results.forEach((da) => {
that.companyList.push(da);
})
});
}
})
});
},
}
}
},
};
</script>
<style scoped>
</style>
<style scoped></style>

@ -1,230 +1,241 @@
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,
},
]
],
});
/*
* 跳转前的处理事件
@ -233,4 +244,4 @@ router.beforeEach(function (to, from, next) {
next();
});
export default router
export default router;

Loading…
Cancel
Save