|
|
@@ -1,13 +1,14 @@
|
|
|
const homeIcon = name => name
|
|
|
|
|
|
+/** 花束栏已下线菜单(兼容本地 storage 旧配置) */
|
|
|
+const REMOVED_FLOWER_MENU_KEYS = ['hsBill', 'hsQuickBill', 'goHsKd', 'goHsKjKd']
|
|
|
+
|
|
|
export const APPLY_MENU_GROUPS = [
|
|
|
{
|
|
|
title: '花束',
|
|
|
titleIcon: homeIcon('bouquet'),
|
|
|
list: [
|
|
|
{ name: '商城码', icon: homeIcon('mall-filled'), url: '/admin/cg/mall', pf: 1 },
|
|
|
- { name: '开单', icon: homeIcon('bouquet-billing'), action: 'goHsKd', pf: 1 },
|
|
|
- { name: '快捷开单', icon: homeIcon('bouquet-quick-billing'), action: 'goHsKjKd', pf: 1 },
|
|
|
{ name: '花束', icon: homeIcon('bouquet'), url: '/admin/goods/list', pf: 1 },
|
|
|
{ name: '新增花束', icon: homeIcon('add-bouquet'), url: '/admin/goods/add', pf: 1 },
|
|
|
{ name: '分类', icon: homeIcon('category-filled'), url: '/admin/goods/category', pf: 1 },
|
|
|
@@ -98,8 +99,6 @@ export const APPLY_MENU_GROUPS = [
|
|
|
|
|
|
//菜单项配置, 用于快速菜单和更多菜单
|
|
|
export const HOME_MENU_ITEMS = {
|
|
|
- hsBill: { name: '开单', icon: homeIcon('bouquet-billing'), action: 'goHsKd', pf: 1 },
|
|
|
- hsQuickBill: { name: '快捷开单', icon: homeIcon('bouquet-quick-billing'), action: 'goHsKjKd', pf: 1 },
|
|
|
itemBill: { name: '开单', icon: homeIcon('plant-billing'), action: 'goItemKd', pf: 1 },
|
|
|
itemQuickBill: { name: '快捷开单', icon: homeIcon('plant-quick-billing'), action: 'goItemKjKd', pf: 1 },
|
|
|
customer: { name: '客户', icon: homeIcon('customer-filled'), url: '/admin/home/member', type: 4, pf: 1 },
|
|
|
@@ -135,8 +134,8 @@ export const HOME_MENU_ITEMS = {
|
|
|
*/
|
|
|
export const HOME_MENU_DEFAULT_KEYS = {
|
|
|
quickMenus: ['itemBill', 'itemQuickBill', 'flower', 'buyItem'],
|
|
|
- flowerMenus: ['mall', 'task', 'hsBill', 'hsQuickBill', 'flowerCategory', 'flowerSort', 'flower', 'addFlower'],
|
|
|
- plantMenus: ['itemMall', 'plant', 'itemBill', 'itemQuickBill', 'part', 'changePrice', 'breakage', 'plantCategory'],
|
|
|
+ flowerMenus: ['mall', 'task', 'flowerCategory', 'flowerSort', 'flower', 'addFlower'],
|
|
|
+ plantMenus: ['itemMall', 'plant', 'part', 'changePrice', 'breakage', 'plantCategory'],
|
|
|
moreMenus: ['calculator', 'staff', 'profit', 'picText', 'scanPay', 'payCode', 'redPacket', 'rechargeSetting']
|
|
|
}
|
|
|
|
|
|
@@ -157,6 +156,13 @@ export const HOME_OVERVIEW_FALLBACK = [
|
|
|
|
|
|
export const getMenuItemKey = item => item.url || item.action || item.name
|
|
|
|
|
|
+const isRemovedFlowerMenuItem = item => {
|
|
|
+ const key = getMenuItemKey(item)
|
|
|
+ return REMOVED_FLOWER_MENU_KEYS.includes(key)
|
|
|
+ || item.action === 'goHsKd'
|
|
|
+ || item.action === 'goHsKjKd'
|
|
|
+}
|
|
|
+
|
|
|
export const getMenuByKeys = keys => {
|
|
|
return keys.map(key => {
|
|
|
let item = HOME_MENU_ITEMS[key]
|
|
|
@@ -183,7 +189,9 @@ export const MENU_EDITOR_SCOPE = {
|
|
|
export const getApplyCatalog = () => {
|
|
|
return APPLY_MENU_GROUPS.map(group => ({
|
|
|
...group,
|
|
|
- list: group.list.map(item => ({ ...item, key: getMenuItemKey(item) }))
|
|
|
+ list: group.list
|
|
|
+ .filter(item => group.title !== '花束' || !isRemovedFlowerMenuItem(item))
|
|
|
+ .map(item => ({ ...item, key: getMenuItemKey(item) }))
|
|
|
}))
|
|
|
}
|
|
|
|
|
|
@@ -231,8 +239,12 @@ export const getStoredMenuKeys = type => {
|
|
|
storedKeys = stored
|
|
|
}
|
|
|
}
|
|
|
- const keys = storedKeys.length ? storedKeys : defaultKeys
|
|
|
- return keys.filter(key => key !== 'allApply')
|
|
|
+ let keys = storedKeys.length ? storedKeys : defaultKeys
|
|
|
+ keys = keys.filter(key => key !== 'allApply')
|
|
|
+ if (type === 'flowerMenus') {
|
|
|
+ keys = keys.filter(key => !REMOVED_FLOWER_MENU_KEYS.includes(key))
|
|
|
+ }
|
|
|
+ return keys
|
|
|
}
|
|
|
|
|
|
export const navigateMenuItem = (vm, item) => {
|
|
|
@@ -257,15 +269,5 @@ export const HOME_MENU_BILLING_METHODS = {
|
|
|
},
|
|
|
goItemKd() {
|
|
|
this.$util.pageTo({ url: '/admin/custom/selectCustom' })
|
|
|
- },
|
|
|
- goHsKjKd() {
|
|
|
- if (this.myShopInfo && Number(this.myShopInfo.defaultCustomId) > 0) {
|
|
|
- this.$util.pageTo({ url: '/admin/billing/hs?customId=' + this.myShopInfo.defaultCustomId })
|
|
|
- } else {
|
|
|
- this.$msg('请设置快捷开单的对应客户')
|
|
|
- }
|
|
|
- },
|
|
|
- goHsKd() {
|
|
|
- this.$util.pageTo({ url: '/admin/custom/selectCustom?style=3' })
|
|
|
}
|
|
|
}
|