Commit 9ee8a6d8 by 陈羽

update: 面包屑优化

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