Commit 9ee8a6d8 by 陈羽

update: 面包屑优化

parent 37a7df36
......@@ -46,6 +46,16 @@ export default {
activeSelTab: '1',
activeTab: '1',
// 面包屑参数
defaultNavpath: [
{
name: '首页',
path: '/index'
},
{
name: '卡券赠送',
path: '/cardList'
}
],
navpath: [
{
name: '首页',
......@@ -53,9 +63,21 @@ export default {
},
{
name: '卡券赠送',
path: ''
path: '/cardList'
}
],
navName: {
1: '卡券列表',
11: '编辑卡券',
12: '新增卡券',
2: '卡券记录'
},
navFrontPath: {
1: '/cardList',
11: '/cardList',
12: '/cardList',
2: '/cardList'
},
tabListData: [
{
tabId: '1',
......@@ -133,28 +155,17 @@ export default {
* 各路由返回 tabId
*/
showTab(id) {
let ids = [...arguments];
let that = this;
that.activeTab = id;
that.activeSelTab = id;
that.tabListData.forEach(ele => {
if (ele.tabId == id) {
ele.onlyIconActive = false;
}
if (!!ele.children) {
ele.children.forEach(el => {
if (el.tabId == id) {
ele.onlyIconActive = true;
}
if (!!el.children) {
el.children.forEach(item => {
if (item.tabId == id) {
ele.onlyIconActive = true;
}
this.navpath = [...this.defaultNavpath];
if (ids.length) {
ids.map(tabId => {
this.navpath[this.navpath.length - 1].path = this.navFrontPath[tabId];
this.navpath.push({ name: this.navName[tabId], path: '' });
});
}
});
}
});
}
},
watch: {
......@@ -176,8 +187,6 @@ export default {
}
},
mounted() {
// const that = this;
// that.changeNavShow(that.$route);
document.documentElement.style.backgroundColor = '#f0f2f5';
},
destroyed() {
......
......@@ -412,12 +412,13 @@ export default {
},
mounted() {
const that = this;
that.$emit('showTab', '1');
that.activeBrand = that.brandId;
if (that.$route.query.coupCardId && that.brandId) {
that.$emit('showTab', '1', '11');
that.addTag = false;
that.getCardData();
} else {
that.$emit('showTab', '1', '12');
that.loadingPage = false;
}
}
......
......@@ -1393,9 +1393,10 @@ export default {
},
mounted() {
const that = this;
that.$emit('showTab', '32');
document.documentElement.style.backgroundColor = '#f0f2f5';
let query = that.$route.query;
that.$emit('showTab', '32',query.type==='copy'?'322':query.templateId?'321':'322');
// 获取已经配置的数据
/* eslint-disable */
Promise.all([that.getAllFields(2)])
......
......@@ -480,7 +480,7 @@ export default {
mounted() {
const that = this;
document.documentElement.style.backgroundColor = '#f0f2f5';
that.$emit('showTab', '11');
that.$emit('showTab', '11','111');
that.activeBrand = that.brandId;
that.conditionObj.storeId = that.$route.query.storeId;
if (!!that.brandId) {
......
......@@ -427,6 +427,7 @@ export default {
},
mounted() {
let that = this;
that.$emit('showTab', '11');
document.documentElement.style.backgroundColor = '#f0f2f5';
that.activeBrand = that.brandId;
that.activeGroup = that.activeGroupId;
......
......@@ -44,6 +44,16 @@ export default {
activeSelTab: '11',
activeTab: '11',
// 面包屑参数
defaultNavpath: [
{
name: '首页',
path: '/index'
},
{
name: '云日报',
path: '/dailyRecord'
}
],
navpath: [
{
name: '首页',
......@@ -51,9 +61,30 @@ export default {
},
{
name: '云日报',
path: ''
path: '/dailyRecord'
}
],
navName: {
11: '云日报-云日报记录',
111: '云日报-记录详情',
12: '云日报导出',
2: '任务下发设置',
3: '云日报设置',
31: '云日报设置-系统报表',
32: '云日报设置-自定义报表',
321: '编辑模板',
322: '新建模板'
},
navFrontPath: {
11: '/dailyRecord',
111: '/dailyRecord',
12: '/dailyRecord',
2: '/dailyRecord',
31: '/dailyRecord',
32: '/dailyRecord',
321: '/customReport',
322: '/customReport'
},
tabListData: [
{
tabId: '1',
......@@ -147,6 +178,7 @@ export default {
*/
setSelectTab(item) {
let that = this;
console.log(item);
that.activeTab = item.tabId;
switch (item.tabId) {
case '1':
......@@ -173,28 +205,18 @@ export default {
* 各路由返回 tabId
*/
showTab(id) {
let ids = [...arguments];
let that = this;
that.activeTab = id;
that.activeSelTab = id;
that.tabListData.forEach(ele => {
if (ele.tabId == id) {
ele.onlyIconActive = false;
}
if (!!ele.children) {
ele.children.forEach(el => {
if (el.tabId == id) {
ele.onlyIconActive = true;
}
if (!!el.children) {
el.children.forEach(item => {
if (item.tabId == id) {
ele.onlyIconActive = true;
}
});
}
let navpath = [...this.defaultNavpath];
if (ids.length) {
ids.map(tabId => {
navpath[navpath.length - 1].path = this.navFrontPath[tabId];
navpath.push({ name: this.navName[tabId], path: '' });
});
}
});
this.$nextTick(() => (this.navpath = [].concat(navpath)));
},
changeNavShow(val) {
const that = this;
......
......@@ -40,7 +40,7 @@
<el-table class="select-table" ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45"> </el-table-column>
<el-table-column width="25">
<template slot="header" slot-scope="scope">
<template slot="header">
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" @command="handleCommand" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
......@@ -49,7 +49,7 @@
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope"> </template>
<template slot-scope="{ $index }"><p :key="$index"></p></template>
</el-table-column>
<el-table-column label="会员姓名" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.memberName || '--' }}</template>
......@@ -163,21 +163,24 @@ export default {
if (!!item.storeId) {
return false;
}
that.departObj = item;
that.showMember = false;
// that.getSelectData(param);
// 重新组装树形部门
let copyData = JSON.parse(JSON.stringify(that.gicDataCopy));
for (let i = 0; i < copyData.length; i++) {
if (that.departObj.parentGroupId == copyData[i].storeGroupId) {
if (item.parentGroupId == copyData[i].storeGroupId) {
copyData[i].expand = true;
if (copyData[i].parentGroupId != 0) {
await that.setParent(copyData[i], copyData);
}
}
}
that.gicData = await that.treeData(JSON.parse(JSON.stringify(copyData)));
that.gicData[0].expand = true;
let gicData = await that.treeData(JSON.parse(JSON.stringify(copyData)));
gicData[0].expand = true;
that.showMember = false;
this.$nextTick(() => {
that.gicData = [].concat(gicData);
that.departObj = Object.assign({}, item);
});
},
/**
* 获取会员数据
......
......@@ -164,7 +164,6 @@ export default {
let resData = res.data;
if (resData.errorCode == 1) {
resData.result.relaxTaskJudge = resData.result.relaxTaskJudge == 1 ? true : false;
console.log(resData.result);
const taskCallTypes = typeof resData.result.taskCallTypes === 'string' ? resData.result.taskCallTypes.split(',') : [];
that.setObj = Object.assign({}, resData.result, { taskCallTypes });
return;
......
......@@ -367,7 +367,7 @@ export default {
mounted() {
let that = this;
document.documentElement.style.backgroundColor = '#f0f2f5';
that.$emit('showTab', '1');
that.$emit('showTab', '1', '12');
if (!!that.brandId) {
that.yearMonth = that.$route.query.yearMonth;
that.getData();
......
......@@ -53,7 +53,17 @@ export default {
},
{
name: '指标管理',
path: ''
path: '/monthList'
}
],
defaultNavpath: [
{
name: '首页',
path: '/index'
},
{
name: '指标管理',
path: '/monthList'
}
],
tabListData: [
......@@ -68,6 +78,23 @@ export default {
icon: 'iconrenwu'
}
],
navName: {
1: '月指标',
11: '门店月指标',
111: '导购月指标详情',
12: '商户日权重月指标',
2: '月指标任务',
21: '月指标任务详情'
},
navFrontPath: {
1: '/monthList',
11: '/monthList',
111: '/storeMonthTask',
12: '/monthList',
13: '/monthList',
2: '/monthList',
21: '/monthTask'
},
activeBrand: '', // 商户(品牌) id
activeGroup: '', // 商户(品牌) groupId
expiredFlag: false
......@@ -133,103 +160,20 @@ export default {
* 各路由返回 tabId
*/
showTab(id) {
let ids = [...arguments];
let that = this;
that.activeTab = id;
that.activeSelTab = id;
that.tabListData.forEach(ele => {
if (ele.tabId == id) {
ele.onlyIconActive = false;
}
if (!!ele.children) {
ele.children.forEach(el => {
if (el.tabId == id) {
ele.onlyIconActive = true;
}
if (!!el.children) {
el.children.forEach(item => {
if (item.tabId == id) {
ele.onlyIconActive = true;
}
});
}
});
}
this.navpath = [...this.defaultNavpath];
if (ids.length) {
ids.map(tabId => {
this.navpath[this.navpath.length - 1].path = tabId === '111' ? `${this.navFrontPath[tabId]}?yearMonth=${this.$route.query.yearMonth}` : this.navFrontPath[tabId];
this.navpath.push({ name: this.navName[tabId], path: '' });
});
},
changeNavShow(val) {
const that = this;
if (val.path == '/storeMonthTask') {
that.navpath = [
{
name: '首页',
path: '/index'
},
{
name: '指标管理',
path: '/monthList'
},
{
name: '门店月指标',
path: ''
}
];
} else if (val.path == '/salerMonthDetail') {
that.navpath = [
{
name: '首页',
path: '/index'
},
{
name: '指标管理',
path: '/monthList'
},
{
name: '门店月指标',
path: `storeMonthTask?yearMonth=${this.$route.query.yearMonth}`
},
{
name: '导购月指标详情',
path: ''
}
];
} else if (val.path == '/companyDaySet') {
that.navpath = [
{
name: '首页',
path: '/index'
},
{
name: '指标管理',
path: '/monthList'
},
{
name: '商户日权重',
path: ''
}
];
} else {
that.navpath = [
{
name: '首页',
path: '/index'
},
{
name: '指标管理',
path: ''
}
];
}
}
},
watch: {
$route: {
handler: function(val, oldVal) {
const that = this;
that.changeNavShow(val);
},
// 深度观察监听
deep: true
},
activeBrand: function(newData, oldData) {
const that = this;
that.activeBrand = newData;
......@@ -240,8 +184,6 @@ export default {
}
},
mounted() {
const that = this;
that.changeNavShow(that.$route);
document.documentElement.style.backgroundColor = '#f0f2f5';
},
destroyed() {
......
......@@ -26,7 +26,7 @@
<el-table class="select-table" ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45" :selectable="selectInit"> </el-table-column>
<el-table-column width="25">
<template slot="header" slot-scope="scope">
<template slot="header">
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" @command="handleCommand" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
......@@ -35,7 +35,9 @@
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope"> </template>
<template slot-scope="scope"
><p style="display:none">{{ scope.$index }}</p></template
>
</el-table-column>
<el-table-column label="指派对象" width="260">
<template slot-scope="scope">
......@@ -234,7 +236,7 @@ export default {
let startDate = that.$route.query.startDate;
let endDate = that.$route.query.endDate;
document.documentElement.style.backgroundColor = '#f0f2f5';
that.$emit('showTab', '2');
that.$emit('showTab', '2','21');
that.activeBrand = that.brandId;
that.conditionObj.storeId = that.$route.query.storeId;
that.conditionObj.dateRange = endDate ? [startDate, endDate] : [];
......@@ -467,9 +469,6 @@ export default {
}
}
},
activated() {
this.init();
},
mounted() {
this.init();
},
......
......@@ -33,8 +33,8 @@
</template>
</el-table-column>
<el-table-column label="总计=门店月指标" width="418px">
<template slot-scope="scope">
<div><span class="font-14 color-606266 text-left">总计</span><span class=" p-l-175 font-14 color-606266 text-left">门店月指标</span></div>
<template slot-scope="{ $index }">
<div :key="$index"><span class="font-14 color-606266 text-left">总计</span><span class=" p-l-175 font-14 color-606266 text-left">门店月指标</span></div>
<div style="margin-top: 4px;">
<el-input class="w-161" v-model="performanceSum" disabled>
<i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 10px;"></i>
......@@ -247,7 +247,7 @@ export default {
mounted() {
let that = this;
document.documentElement.style.backgroundColor = '#f0f2f5';
that.$emit('showTab', '1');
that.$emit('showTab', '1', '11', '111');
if (!!that.brandId) {
that.clerkObj.yearMonth = that.$route.query.yearMonth;
......
......@@ -322,7 +322,7 @@ export default {
mounted() {
let that = this;
document.documentElement.style.backgroundColor = '#f0f2f5';
that.$emit('showTab', '1');
that.$emit('showTab', '1', '11');
that.activeBrand = that.brandId;
that.activeGroup = that.activeGroupId;
that.conditionObj.storeId = that.$route.query.storeId;
......
......@@ -51,6 +51,10 @@ export default {
},
{
name: '商品中心',
path: '/goodsShowSet'
},
{
name: '商品展示设置',
path: ''
}
],
......@@ -126,25 +130,6 @@ export default {
let that = this;
that.activeTab = id;
that.activeSelTab = id;
that.tabListData.forEach(ele => {
if (ele.tabId == id) {
ele.onlyIconActive = false;
}
if (!!ele.children) {
ele.children.forEach(el => {
if (el.tabId == id) {
ele.onlyIconActive = true;
}
if (!!el.children) {
el.children.forEach(item => {
if (item.tabId == id) {
ele.onlyIconActive = true;
}
});
}
});
}
});
}
},
watch: {
......
......@@ -26,7 +26,7 @@ import taskViewDetail from '@/components/app/taskViewDetail.vue';
<el-table class="select-table" ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45"> </el-table-column>
<el-table-column width="25">
<template slot="header" slot-scope="scope">
<template slot="header">
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" @command="handleCommand" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
......@@ -35,7 +35,7 @@ import taskViewDetail from '@/components/app/taskViewDetail.vue';
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope"> </template>
<template slot-scope="{ $index }"><p :key="$index"></p></template>
</el-table-column>
<el-table-column label="门店名称" width="120" show-overflow-tooltip>
<template slot-scope="scope">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment