feature_0521
zhenghuang 5 years ago
parent e83a02fb9e
commit 9589780eb7

@ -1,33 +1,52 @@
<template> <template>
<div class="layout"> <div class="layout">
<Layout :style="{minHeight: '100vh'}"> <Layout :style="{minHeight: '100vh'}">
<Sider collapsible :collapsed-width="78" v-model="isCollapsed" :hide-trigger="true" > <Sider collapsible
:collapsed-width="78"
v-model="isCollapsed"
:hide-trigger="true">
<div style="margin: 40px 0 20px 10px;font-weight: bold;font-size: 30px;color: #ffffff;"> <div style="margin: 40px 0 20px 10px;font-weight: bold;font-size: 30px;color: #ffffff;">
<Poptip placement="bottom-start" width="200" :offset="-8"> <Poptip placement="bottom-start"
<img src="../../static/img/avatar.png" style="width: 32px;vertical-align: middle;cursor: pointer"/> width="200"
:offset="-8">
<img src="../../static/img/avatar.png"
style="width: 32px;vertical-align: middle;cursor: pointer" />
<div slot="content"> <div slot="content">
<div style="cursor: pointer;" @click="logoutClick"> <div style="cursor: pointer;"
@click="logoutClick">
<span class="logout-span">退出登录</span> <span class="logout-span">退出登录</span>
<img class="logout-img" src="../../static/img/logout.png"/> <img class="logout-img"
src="../../static/img/logout.png" />
</div> </div>
</div> </div>
</Poptip> </Poptip>
<span class="project-title">优客后台管理</span> <span class="project-title">优客后台管理</span>
</div> </div>
<Menu ref="menu" :active-name="selectedItemName" :open-names="openName" theme="dark" width="auto" <Menu ref="menu"
@on-select="onSelectLister" :accordion="true"> :active-name="selectedItemName"
<MenuItem v-if="roleCode === 'GLY-ADMIN' || roleCode === 'DG-YUNYING' || roleCode === 'GL-YUNYING'" :name="0" to="/customer/view"> :open-names="openName"
<Icon type="ios-paper"/> theme="dark"
width="auto"
@on-select="onSelectLister"
:accordion="true">
<MenuItem v-if="roleCode === 'GLY-ADMIN' || roleCode === 'DG-YUNYING' || roleCode === 'GL-YUNYING'"
:name="0"
to="/customer/view">
<Icon type="ios-paper" />
<span style="margin-left: 7px">首页</span> <span style="margin-left: 7px">首页</span>
</MenuItem> </MenuItem>
<Submenu :name="item.id" v-for="item in onePermissionList" :key="item.id"> <Submenu :name="item.id"
v-for="item in onePermissionList"
:key="item.id">
<template slot="title"> <template slot="title">
<Icon type="ios-paper"/> <Icon type="ios-paper" />
{{item.name}} {{item.name}}
</template> </template>
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in item.subMenuList" <MenuItem :name="cItem.id"
:to="cItem.resource"
v-for="cItem in item.subMenuList"
:key="cItem.id"> :key="cItem.id">
{{cItem.name}} {{cItem.name}}
</MenuItem> </MenuItem>
@ -38,12 +57,13 @@
<!-- <Header :style="{background: '#fff', boxShadow: '0 2px 3px 2px rgba(0,0,0,.1)'}"></Header>--> <!-- <Header :style="{background: '#fff', boxShadow: '0 2px 3px 2px rgba(0,0,0,.1)'}"></Header>-->
<Content :style="{padding: '0 16px 16px'}"> <Content :style="{padding: '0 16px 16px'}">
<Breadcrumb :style="{margin: '16px 0'}"> <Breadcrumb :style="{margin: '16px 0'}">
<BreadcrumbItem><span style="cursor: pointer" @click="breadcrumbClick">{{selectedMenu}}</span></BreadcrumbItem> <BreadcrumbItem><span style="cursor: pointer"
@click="breadcrumbClick">{{selectedMenu}}</span></BreadcrumbItem>
<BreadcrumbItem>{{selectedSubMenu}}</BreadcrumbItem> <BreadcrumbItem>{{selectedSubMenu}}</BreadcrumbItem>
</Breadcrumb> </Breadcrumb>
<Card> <Card>
<div :style="{'min-height':mHeight + 'px'}"> <div :style="{'min-height':mHeight + 'px'}">
<router-view/> <router-view />
</div> </div>
</Card> </Card>
</Content> </Content>
@ -52,16 +72,16 @@
</div> </div>
</template> </template>
<script> <script>
import homeRequest from "../services/home/homeRequest"; import homeRequest from "../services/home/homeRequest";
export default { export default {
provide() { provide () {
return { return {
checkParamBlank: this.checkParamBlank, checkParamBlank: this.checkParamBlank,
setMenuName: this.setMenuName, setMenuName: this.setMenuName,
}; };
}, },
data() { data () {
return { return {
roleCode: JSON.parse(sessionStorage.getItem("loginInfo")).roleCode, roleCode: JSON.parse(sessionStorage.getItem("loginInfo")).roleCode,
mainUrl: "/customer/view", mainUrl: "/customer/view",
@ -85,7 +105,7 @@
breadcrumbUrl: "", breadcrumbUrl: "",
} }
}, },
mounted() { mounted () {
let that = this; let that = this;
this.bus.$on('callBack', function (item) { this.bus.$on('callBack', function (item) {
that.callBack(item); that.callBack(item);
@ -94,7 +114,7 @@
// that.setHeader(data); // that.setHeader(data);
// }) // })
}, },
created() { created () {
// this.mHeight = window.screen.availHeight - 22; // this.mHeight = window.screen.availHeight - 22;
// //
@ -115,20 +135,20 @@
}, },
methods: { methods: {
onSelectLister(val) { onSelectLister (val) {
let i; let i;
this.onePermissionList.forEach(function (data) { this.onePermissionList.forEach(function (data) {
data.subMenuList.forEach(function (dta) { data.subMenuList.forEach(function (dta) {
if(dta.id === val){ if (dta.id === val) {
i = dta; i = dta;
} }
}) })
}); });
if(i){ if (i) {
sessionStorage.setItem("threeLevel",JSON.stringify(i.subMenuList)); sessionStorage.setItem("threeLevel", JSON.stringify(i.subMenuList));
} }
// //
if(val === 0){ if (val === 0) {
this.selectedMenu = "首页"; this.selectedMenu = "首页";
this.selectedSubMenu = ""; this.selectedSubMenu = "";
this.breadcrumbUrl = this.mainUrl; this.breadcrumbUrl = this.mainUrl;
@ -162,7 +182,7 @@
} }
}, },
// //
listOnePermission(level) { listOnePermission (level) {
let that = this; let that = this;
let userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId; let userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId;
let request = { let request = {
@ -188,7 +208,7 @@
}) })
}, },
// //
listTwoPermission(level) { listTwoPermission (level) {
let userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId; let userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId;
let that = this; let that = this;
that.twoPermissionList = []; that.twoPermissionList = [];
@ -215,7 +235,7 @@
}) })
}, },
// //
listThreePermission(level) { listThreePermission (level) {
let userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId; let userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId;
let that = this; let that = this;
that.threePermissionList = []; that.threePermissionList = [];
@ -258,36 +278,36 @@
// //
menuInit: function () { menuInit: function () {
let that = this; let that = this;
if(this.roleCode === 'GLY-ADMIN' || this.roleCode === 'DG-YUNYING' || this.roleCode === 'GL-YUNYING'){ if (this.roleCode === 'GLY-ADMIN' || this.roleCode === 'DG-YUNYING' || this.roleCode === 'GL-YUNYING') {
// //
that.selectedItemName = 0; that.selectedItemName = 0;
this.$router.push({path: that.mainUrl}); this.$router.push({ path: that.mainUrl });
this.selectedMenu = "首页"; this.selectedMenu = "首页";
this.breadcrumbUrl = this.mainUrl; this.breadcrumbUrl = this.mainUrl;
}else{ } else {
that.selectedItemName = that.onePermissionList[0].subMenuList[0].id; that.selectedItemName = that.onePermissionList[0].subMenuList[0].id;
that.openName = [that.onePermissionList[0].id]; that.openName = [that.onePermissionList[0].id];
this.selectedMenu = this.onePermissionList[0].name; this.selectedMenu = this.onePermissionList[0].name;
this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name; this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name;
sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList)); sessionStorage.setItem("threeLevel", JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList));
// this.$nextTick(() => { // this.$nextTick(() => {
// this.$refs.menu.updateOpened(); // this.$refs.menu.updateOpened();
// this.$refs.menu.updateActiveName(); // this.$refs.menu.updateActiveName();
// }); // });
this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource}); this.$router.push({ path: that.onePermissionList[0].subMenuList[0].resource });
} }
}, },
// //
callBack(item) { callBack (item) {
let that = this; let that = this;
this.selectedMenu = "设置管理"; this.selectedMenu = "设置管理";
this.selectedSubMenu = "账户管理"; this.selectedSubMenu = "账户管理";
this.selectedItemName = this.onePermissionList[2].subMenuList[0].id; this.selectedItemName = this.onePermissionList[2].subMenuList[0].id;
this.$router.push({path: '/account/manager',query:item}); this.$router.push({ path: '/account/manager', query: item });
}, },
setHeader(data){ setHeader (data) {
let that = this; let that = this;
this.selectedSubMenu = data.header; this.selectedSubMenu = data.header;
this.$nextTick(() => { this.$nextTick(() => {
@ -296,12 +316,19 @@
}, },
// //
setMenuName: function (menu1, menu2) { setMenuName: function (menu1, menu2) {
console.log("setMenu", arguments)
this.selectedMenu = menu1; this.selectedMenu = menu1;
this.selectedSubMenu = menu2; this.selectedSubMenu = menu2;
let parentId;
let subId;
this.onePermissionList.forEach(item => {
if (item.name == menu1) parentId = item.id
})
this.$forceUpdate()
}, },
// //
breadcrumbClick: function () { breadcrumbClick: function () {
if(this.selectedMenu === "首页"){ if (this.selectedMenu === "首页") {
this.selectedSubMenu = ""; this.selectedSubMenu = "";
} }
this.$router.push(this.breadcrumbUrl); this.$router.push(this.breadcrumbUrl);
@ -315,27 +342,26 @@
this.$Message.info("登出成功"); this.$Message.info("登出成功");
} }
}, },
} }
</script> </script>
<style scoped> <style scoped>
.layout-con {
.layout-con {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
/*项目标题*/ /*项目标题*/
.project-title{ .project-title {
font-size: 22px; font-size: 22px;
margin-left: 15px; margin-left: 15px;
} }
/*退出登入*/ /*退出登入*/
.logout-span{ .logout-span {
font-size: 15px; font-size: 15px;
vertical-align: middle; vertical-align: middle;
color: #535353; color: #535353;
} }
.logout-img{ .logout-img {
vertical-align: middle; vertical-align: middle;
margin-left: 80px; margin-left: 80px;
} }
</style> </style>

@ -1,46 +1,50 @@
<template> <template>
<div class="use_box"> <div class="use_box">
<Modal <Modal :scrollable="false"
:scrollable="false"
v-model="showUse" v-model="showUse"
title="使用活动" title="使用活动"
@on-cancel="cancel" @on-cancel="cancel"
:loading="true" :loading="true"
width="70%" width="70%"
@on-visible-change="visibleChange" @on-visible-change="visibleChange">
> <Steps style="padding: 40px;"
<Steps style="padding: 40px;" :current="currentStep"> :current="currentStep">
<Step title="基本信息"></Step> <Step title="基本信息"></Step>
<Step :title="isModify ? '修改零售公司' : '选择零售公司'" content></Step> <Step :title="isModify ? '修改零售公司' : '选择零售公司'"
<Step :title="isModify ? '修改店铺' : '选择店铺'" content></Step> content></Step>
<Step title="确认信息" content></Step> <Step :title="isModify ? '修改店铺' : '选择店铺'"
content></Step>
<Step title="确认信息"
content></Step>
</Steps> </Steps>
<useActivityStepOne :schedule="schedule" :isModify="isModify" v-if="currentStep == 0 && show"></useActivityStepOne> <useActivityStepOne :schedule="schedule"
<useActivityStepTwo :schedule="schedule" :isModify="isModify" v-if="currentStep == 1"></useActivityStepTwo> :isModify="isModify"
<useActivityStepThree :schedule="schedule" :isModify="isModify" v-if="currentStep == 2"></useActivityStepThree> v-if="currentStep == 0 && show"></useActivityStepOne>
<useActivityStepFoure :schedule="schedule" :isModify="isModify" v-if="currentStep == 3"></useActivityStepFoure> <useActivityStepTwo :schedule="schedule"
:isModify="isModify"
v-if="currentStep == 1"></useActivityStepTwo>
<useActivityStepThree :schedule="schedule"
:isModify="isModify"
v-if="currentStep == 2"></useActivityStepThree>
<useActivityStepFoure :schedule="schedule"
:isModify="isModify"
v-if="currentStep == 3"></useActivityStepFoure>
<div slot="footer"> <div slot="footer">
<Button <Button v-if="currentStep !== 0"
v-if="currentStep !== 0"
type="primary" type="primary"
shape="circle" shape="circle"
:loading="modal_loading" :loading="modal_loading"
@click="back" @click="back">上一步</Button>
>上一步</Button> <Button v-if="currentStep !== 3"
<Button
v-if="currentStep !== 3"
type="primary" type="primary"
shape="circle" shape="circle"
:loading="modal_loading" :loading="modal_loading"
@click="next" @click="next">下一步</Button>
>下一步</Button> <Button v-if="currentStep == 3"
<Button
v-if="currentStep == 3"
type="primary" type="primary"
shape="circle" shape="circle"
:loading="modal_loading" :loading="modal_loading"
@click="finish" @click="finish">完成</Button>
>完成</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
@ -62,7 +66,7 @@ export default {
useActivityStepFoure useActivityStepFoure
}, },
inject: ["setMenuName"], inject: ["setMenuName"],
data() { data () {
return { return {
currentStep: 0, currentStep: 0,
modal_loading: false, modal_loading: false,
@ -83,27 +87,26 @@ export default {
} }
}, },
watch: { watch: {
show() { show () {
this.showUse = this.show; this.showUse = this.show;
}, },
schedule() { schedule () {
store.getters.useData.scheduleId = this.schedule.id; store.getters.useData.scheduleId = this.schedule.id;
} }
}, },
created() { created () {
this.setMenuName("活动管理", "活动计划");
}, },
mounted() {}, mounted () { },
methods: { methods: {
visibleChange(show) {}, visibleChange (show) { },
cancel() { cancel () {
store.commit("RSET_useData"); store.commit("RSET_useData");
this.$emit("doShow", false); this.$emit("doShow", false);
this.modal_loading = false; this.modal_loading = false;
this.showUse = false; this.showUse = false;
this.currentStep = 0; this.currentStep = 0;
}, },
next() { next () {
let data = store.getters.useData; let data = store.getters.useData;
data.name = this.schedule.name; data.name = this.schedule.name;
if (this.currentStep === 0) { if (this.currentStep === 0) {
@ -146,17 +149,18 @@ export default {
store.commit("SET_useData", data); store.commit("SET_useData", data);
this.currentStep = this.currentStep + 1; this.currentStep = this.currentStep + 1;
}, },
back() { back () {
this.currentStep = this.currentStep - 1; this.currentStep = this.currentStep - 1;
}, },
finish() { finish () {
let that = this; let that = this;
let data = store.getters.useData; let data = store.getters.useData;
data.isGetActivityInfo = true; data.isGetActivityInfo = true;
this.modal_loading = true; this.modal_loading = true;
ActivityManager.saveActivityData(store.getters.useData, function(data) { ActivityManager.saveActivityData(store.getters.useData, function (data) {
store.commit("RSET_useData"); store.commit("RSET_useData");
that.$emit("doShow", false); that.$emit("doShow", false);
that.setMenuName("活动管理", "活动计划");
that.$router.push("/activity/plan"); that.$router.push("/activity/plan");
that.currentStep = 0; that.currentStep = 0;
that.modal_loading = false; that.modal_loading = false;

Loading…
Cancel
Save