10 changed files with 1044 additions and 470 deletions
@ -0,0 +1,49 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
// 查询分页列表
|
||||
|
listPage: function(params) { |
||||
|
return request({ |
||||
|
url: '/wms/apiadmin/base/basegoodsunit/listPage', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 单位查询
|
||||
|
getAllUnit: function(params) { |
||||
|
return request({ |
||||
|
url: '/wms/apiadmin/base/basegoodsunit/listAll', |
||||
|
method: 'get' |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
// 修改是否可用状态
|
||||
|
updateIsEnable: function(sid,isEnable) { |
||||
|
return request({ |
||||
|
url: '/wms/apiadmin/base/basegoodsunit/updateIsEnable/'+sid+"/"+isEnable |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
// 新增、保存
|
||||
|
saveUnits: function(data) { |
||||
|
return request({ |
||||
|
url: '/wms/apiadmin/base/basegoodsunit/saveOrUpdate', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// 初始化
|
||||
|
initUnits: function(data) { |
||||
|
return request({ |
||||
|
url: '/base/basegoodsunit/initialization/' + data, |
||||
|
method: 'get' |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
} |
@ -1,452 +1,471 @@ |
|||||
<template> |
<template> |
||||
<div :class="{ 'has-logo': showLogo }"> |
<div :class="{ 'has-logo': showLogo }"> |
||||
<logo v-if="showLogo" :collapse="isCollapse"/> |
<logo v-if="showLogo" :collapse="isCollapse" /> |
||||
<el-scrollbar wrap-class="scrollbar-wrapper"> |
<el-scrollbar wrap-class="scrollbar-wrapper"> |
||||
<el-menu :default-active="$route.path" :background-color="variables.menuBg" :text-color="variables.menuText" :unique-opened="false" :active-text-color="variables.menuActiveText" :collapse-transition="false" mode="vertical"> |
<el-menu :default-active="$route.path" :background-color="variables.menuBg" :text-color="variables.menuText" |
||||
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path"/> |
:unique-opened="false" :active-text-color="variables.menuActiveText" :collapse-transition="false" |
||||
|
mode="vertical"> |
||||
|
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" /> |
||||
</el-menu> |
</el-menu> |
||||
</el-scrollbar> |
</el-scrollbar> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { mapGetters } from 'vuex' |
import { |
||||
import Logo from './Logo' |
mapGetters |
||||
import SidebarItem from './SidebarItem' |
} from 'vuex' |
||||
import variables from '@/styles/variables.scss' |
import Logo from './Logo' |
||||
import { |
import SidebarItem from './SidebarItem' |
||||
getrolemenus, |
import variables from '@/styles/variables.scss' |
||||
loginDetails |
import { |
||||
} from '@/api/system/Role/role.js' |
getrolemenus, |
||||
import { |
loginDetails |
||||
getStorage |
} from '@/api/system/Role/role.js' |
||||
} from '@/utils/auth' |
import { |
||||
import Layout from '@/layout' |
getStorage |
||||
|
} from '@/utils/auth' |
||||
|
import Layout from '@/layout' |
||||
|
|
||||
export default { |
export default { |
||||
components: { |
components: { |
||||
SidebarItem, |
SidebarItem, |
||||
Logo |
Logo |
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
YongHuid: [], |
YongHuid: [], |
||||
// routes: [], |
// routes: [], |
||||
params: { |
params: { |
||||
sourceSid: '', |
sourceSid: '', |
||||
userSid: '' |
userSid: '' |
||||
}, |
}, |
||||
routes: [ |
routes: [{ |
||||
{ |
alwaysShow: true, |
||||
alwaysShow: true, |
component: 'baseInfo', |
||||
component: 'baseInfo', |
meta: { |
||||
meta: { |
icon: 'el-icon-menu', |
||||
icon: 'el-icon-menu', |
title: '基础信息' |
||||
title: '基础信息' |
|
||||
}, |
|
||||
name: '/baseInfo', |
|
||||
path: '/baseInfo', |
|
||||
children: [ |
|
||||
// { |
|
||||
// alwaysShow: true, |
|
||||
// component: 'brands', |
|
||||
// meta: { |
|
||||
// icon: 'el-icon-help', |
|
||||
// title: '品牌管理' |
|
||||
// }, |
|
||||
// name: '/baseInfo/brands', |
|
||||
// path: '/baseInfo/brands' |
|
||||
// }, { |
|
||||
// alwaysShow: true, |
|
||||
// component: 'category', |
|
||||
// meta: { |
|
||||
// icon: 'el-icon-help', |
|
||||
// title: '类别管理' |
|
||||
// }, |
|
||||
// name: '/baseInfo/category', |
|
||||
// path: '/baseInfo/category' |
|
||||
// }, |
|
||||
// { |
|
||||
// alwaysShow: true, |
|
||||
// component: 'goods', |
|
||||
// meta: { |
|
||||
// icon: 'el-icon-help', |
|
||||
// title: '商品管理' |
|
||||
// }, |
|
||||
// name: '/baseInfo/goods', |
|
||||
// path: '/baseInfo/goods' |
|
||||
// }, |
|
||||
// { |
|
||||
// alwaysShow: true, |
|
||||
// component: 'factory', |
|
||||
// meta: { |
|
||||
// icon: 'el-icon-help', |
|
||||
// title: '厂家管理' |
|
||||
// }, |
|
||||
// name: '/baseInfo/factory', |
|
||||
// path: '/baseInfo/factory' |
|
||||
// }, |
|
||||
{ |
|
||||
alwaysShow: true, |
|
||||
component: 'warehouse', |
|
||||
meta: { |
|
||||
icon: 'el-icon-help', |
|
||||
title: '仓库管理' |
|
||||
}, |
|
||||
name: '/baseInfo/warehouse', |
|
||||
path: '/baseInfo/warehouse' |
|
||||
}, |
}, |
||||
{ |
name: '/baseInfo', |
||||
alwaysShow: true, |
path: '/baseInfo', |
||||
component: 'warehouseArea', |
children: [{ |
||||
meta: { |
alwaysShow: true, |
||||
icon: 'el-icon-help', |
component: 'brands', |
||||
title: '库区管理' |
meta: { |
||||
|
icon: 'el-icon-help', |
||||
|
title: '品牌管理' |
||||
|
}, |
||||
|
name: '/baseInfo/brands', |
||||
|
path: '/baseInfo/brands' |
||||
|
}, { |
||||
|
alwaysShow: true, |
||||
|
component: 'category', |
||||
|
meta: { |
||||
|
icon: 'el-icon-help', |
||||
|
title: '类别管理' |
||||
|
}, |
||||
|
name: '/baseInfo/category', |
||||
|
path: '/baseInfo/category' |
||||
}, |
}, |
||||
name: '/baseInfo/warehouseArea', |
{ |
||||
path: '/baseInfo/warehouseArea' |
alwaysShow: true, |
||||
}, |
component: 'unit', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'warehouseAreaType', |
title: '单位管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/baseInfo/unit', |
||||
title: '库区类型管理' |
path: '/baseInfo/unit' |
||||
}, |
}, |
||||
name: '/baseInfo/warehouseAreaType', |
{ |
||||
path: '/baseInfo/warehouseAreaType' |
alwaysShow: true, |
||||
}, |
component: 'factory', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'goodsShelves', |
title: '厂家管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/baseInfo/factory', |
||||
title: '库位管理' |
path: '/baseInfo/factory' |
||||
}, |
}, |
||||
name: '/baseInfo/goodsShelves', |
{ |
||||
path: '/baseInfo/goodsShelves' |
alwaysShow: true, |
||||
} |
component: 'goods', |
||||
] |
meta: { |
||||
}, |
icon: 'el-icon-help', |
||||
{ |
title: '商品管理' |
||||
alwaysShow: true, |
}, |
||||
component: 'warehouse', |
name: '/baseInfo/goods', |
||||
meta: { |
path: '/baseInfo/goods' |
||||
icon: 'el-icon-menu', |
|
||||
title: '仓库信息' |
|
||||
}, |
|
||||
name: '/warehouse', |
|
||||
path: '/warehouse', |
|
||||
children: [ |
|
||||
|
|
||||
{ |
|
||||
alwaysShow: true, |
|
||||
component: 'inStorage', |
|
||||
meta: { |
|
||||
icon: 'el-icon-help', |
|
||||
title: '入库管理' |
|
||||
}, |
}, |
||||
name: '/warehouse/inStorage', |
{ |
||||
path: '/warehouse/inStorage' |
alwaysShow: true, |
||||
}, |
component: 'warehouse', |
||||
|
meta: { |
||||
{ |
icon: 'el-icon-help', |
||||
alwaysShow: true, |
title: '仓库管理' |
||||
component: 'reservationInStorage', |
}, |
||||
meta: { |
name: '/baseInfo/warehouse', |
||||
icon: 'el-icon-help', |
path: '/baseInfo/warehouse' |
||||
title: '预约入库' |
|
||||
}, |
}, |
||||
name: '/warehouse/reservationInStorage', |
{ |
||||
path: '/warehouse/reservationInStorage' |
alwaysShow: true, |
||||
}, |
component: 'warehouseArea', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'outStorage', |
title: '库区管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/baseInfo/warehouseArea', |
||||
title: '出库管理' |
path: '/baseInfo/warehouseArea' |
||||
|
}, |
||||
|
{ |
||||
|
alwaysShow: true, |
||||
|
component: 'warehouseAreaType', |
||||
|
meta: { |
||||
|
icon: 'el-icon-help', |
||||
|
title: '库区类型管理' |
||||
|
}, |
||||
|
name: '/baseInfo/warehouseAreaType', |
||||
|
path: '/baseInfo/warehouseAreaType' |
||||
}, |
}, |
||||
name: '/warehouse/outStorage', |
{ |
||||
path: '/warehouse/outStorage' |
alwaysShow: true, |
||||
|
component: 'goodsShelves', |
||||
|
meta: { |
||||
|
icon: 'el-icon-help', |
||||
|
title: '库位管理' |
||||
|
}, |
||||
|
name: '/baseInfo/goodsShelves', |
||||
|
path: '/baseInfo/goodsShelves' |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
alwaysShow: true, |
||||
|
component: 'warehouse', |
||||
|
meta: { |
||||
|
icon: 'el-icon-menu', |
||||
|
title: '仓库信息' |
||||
}, |
}, |
||||
// { |
name: '/warehouse', |
||||
// alwaysShow: true, |
path: '/warehouse', |
||||
// component: 'distribution', |
children: [ |
||||
// meta: { |
|
||||
// icon: 'el-icon-help', |
{ |
||||
// title: '配货管理' |
alwaysShow: true, |
||||
// }, |
component: 'inStorage', |
||||
// name: '/warehouse/distribution', |
meta: { |
||||
// path: '/warehouse/distribution' |
icon: 'el-icon-help', |
||||
// }, |
title: '入库管理' |
||||
{ |
}, |
||||
alwaysShow: true, |
name: '/warehouse/inStorage', |
||||
component: 'inventory', |
path: '/warehouse/inStorage' |
||||
meta: { |
|
||||
icon: 'el-icon-help', |
|
||||
title: '库存查询' |
|
||||
}, |
}, |
||||
name: '/warehouse/inventory', |
|
||||
path: '/warehouse/inventory' |
{ |
||||
}, { |
alwaysShow: true, |
||||
alwaysShow: true, |
component: 'reservationInStorage', |
||||
component: 'inOutStorage', |
meta: { |
||||
meta: { |
icon: 'el-icon-help', |
||||
icon: 'el-icon-help', |
title: '预约入库' |
||||
title: '出入库查询' |
}, |
||||
|
name: '/warehouse/reservationInStorage', |
||||
|
path: '/warehouse/reservationInStorage' |
||||
}, |
}, |
||||
name: '/warehouse/inOutStorage', |
{ |
||||
path: '/warehouse/inOutStorage' |
alwaysShow: true, |
||||
}, |
component: 'outStorage', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'stocktaking', |
title: '出库管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/outStorage', |
||||
title: '盘点管理' |
path: '/warehouse/outStorage' |
||||
}, |
}, |
||||
name: '/warehouse/stocktaking', |
// { |
||||
path: '/warehouse/stocktaking' |
// alwaysShow: true, |
||||
}, |
// component: 'distribution', |
||||
{ |
// meta: { |
||||
alwaysShow: true, |
// icon: 'el-icon-help', |
||||
component: 'allocation', |
// title: '配货管理' |
||||
meta: { |
// }, |
||||
icon: 'el-icon-help', |
// name: '/warehouse/distribution', |
||||
title: '调拨管理' |
// path: '/warehouse/distribution' |
||||
|
// }, |
||||
|
{ |
||||
|
alwaysShow: true, |
||||
|
component: 'inventory', |
||||
|
meta: { |
||||
|
icon: 'el-icon-help', |
||||
|
title: '库存查询' |
||||
|
}, |
||||
|
name: '/warehouse/inventory', |
||||
|
path: '/warehouse/inventory' |
||||
|
}, { |
||||
|
alwaysShow: true, |
||||
|
component: 'inOutStorage', |
||||
|
meta: { |
||||
|
icon: 'el-icon-help', |
||||
|
title: '出入库查询' |
||||
|
}, |
||||
|
name: '/warehouse/inOutStorage', |
||||
|
path: '/warehouse/inOutStorage' |
||||
}, |
}, |
||||
name: '/warehouse/allocation', |
{ |
||||
path: '/warehouse/allocation' |
alwaysShow: true, |
||||
}, |
component: 'stocktaking', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'deliveryNotice', |
title: '盘点管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/stocktaking', |
||||
title: '到货单管理' |
path: '/warehouse/stocktaking' |
||||
}, |
}, |
||||
name: '/warehouse/deliveryNotice', |
{ |
||||
path: '/warehouse/deliveryNotice' |
alwaysShow: true, |
||||
}, |
component: 'allocation', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'receivingGoods', |
title: '调拨管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/allocation', |
||||
title: '收货单管理' |
path: '/warehouse/allocation' |
||||
}, |
}, |
||||
name: '/warehouse/receivingGoods', |
{ |
||||
path: '/warehouse/receivingGoods' |
alwaysShow: true, |
||||
}, |
component: 'deliveryNotice', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'upShelf', |
title: '到货单管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/deliveryNotice', |
||||
title: '上架单管理' |
path: '/warehouse/deliveryNotice' |
||||
}, |
}, |
||||
name: '/warehouse/upShelf', |
{ |
||||
path: '/warehouse/upShelf' |
alwaysShow: true, |
||||
}, |
component: 'receivingGoods', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'oldPartsFactory', |
title: '收货单管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/receivingGoods', |
||||
title: '旧件返厂' |
path: '/warehouse/receivingGoods' |
||||
}, |
}, |
||||
name: '/warehouse/oldPartsFactory', |
{ |
||||
path: '/warehouse/oldPartsFactory' |
alwaysShow: true, |
||||
}, |
component: 'upShelf', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'oldPartsCope', |
title: '上架单管理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/upShelf', |
||||
title: '旧件处理' |
path: '/warehouse/upShelf' |
||||
}, |
}, |
||||
name: '/warehouse/oldPartsCope', |
{ |
||||
path: '/warehouse/oldPartsCope' |
alwaysShow: true, |
||||
}, |
component: 'oldPartsFactory', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'oldPartsRecovery', |
title: '旧件返厂' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/oldPartsFactory', |
||||
title: '旧件回收' |
path: '/warehouse/oldPartsFactory' |
||||
}, |
}, |
||||
name: '/warehouse/oldPartsRecovery', |
{ |
||||
path: '/warehouse/oldPartsRecovery' |
alwaysShow: true, |
||||
}, |
component: 'oldPartsCope', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'oldPartsInStorage', |
title: '旧件处理' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/oldPartsCope', |
||||
title: '旧件入库' |
path: '/warehouse/oldPartsCope' |
||||
}, |
}, |
||||
name: '/warehouse/oldPartsInStorage', |
{ |
||||
path: '/warehouse/oldPartsInStorage' |
alwaysShow: true, |
||||
}, |
component: 'oldPartsRecovery', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'oldPartsInvertory', |
title: '旧件回收' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/oldPartsRecovery', |
||||
title: '旧件库存' |
path: '/warehouse/oldPartsRecovery' |
||||
}, |
}, |
||||
name: '/warehouse/oldPartsInvertory', |
{ |
||||
path: '/warehouse/oldPartsInvertory' |
alwaysShow: true, |
||||
}, |
component: 'oldPartsInStorage', |
||||
{ |
meta: { |
||||
alwaysShow: true, |
icon: 'el-icon-help', |
||||
component: 'oldPartsInAndOutStorage', |
title: '旧件入库' |
||||
meta: { |
}, |
||||
icon: 'el-icon-help', |
name: '/warehouse/oldPartsInStorage', |
||||
title: '旧件出入库查询' |
path: '/warehouse/oldPartsInStorage' |
||||
}, |
}, |
||||
name: '/warehouse/oldPartsInAndOutStorage', |
{ |
||||
path: '/warehouse/oldPartsInAndOutStorage' |
alwaysShow: true, |
||||
} |
component: 'oldPartsInvertory', |
||||
] |
meta: { |
||||
}, |
icon: 'el-icon-help', |
||||
{ |
title: '旧件库存' |
||||
path: '/inventory', |
}, |
||||
component: Layout, |
name: '/warehouse/oldPartsInvertory', |
||||
redirect: '/inventory', |
path: '/warehouse/oldPartsInvertory' |
||||
meta: { |
}, |
||||
title: '库存查询' |
{ |
||||
|
alwaysShow: true, |
||||
|
component: 'oldPartsInAndOutStorage', |
||||
|
meta: { |
||||
|
icon: 'el-icon-help', |
||||
|
title: '旧件出入库查询' |
||||
|
}, |
||||
|
name: '/warehouse/oldPartsInAndOutStorage', |
||||
|
path: '/warehouse/oldPartsInAndOutStorage' |
||||
|
} |
||||
|
] |
||||
}, |
}, |
||||
children: [ |
{ |
||||
{ |
path: '/inventory', |
||||
|
component: Layout, |
||||
|
redirect: '/inventory', |
||||
|
meta: { |
||||
|
title: '库存查询' |
||||
|
}, |
||||
|
children: [{ |
||||
path: '/inventory/inventory', |
path: '/inventory/inventory', |
||||
component: () => import('@/views/inventory/inventory.vue'), |
component: () => import('@/views/inventory/inventory.vue'), |
||||
name: 'Inventory', |
name: 'Inventory', |
||||
meta: { title: '库存查询', noCache: true } |
meta: { |
||||
} |
title: '库存查询', |
||||
] |
noCache: true |
||||
}, |
} |
||||
{ |
}] |
||||
path: '/storageage', |
|
||||
component: Layout, |
|
||||
redirect: '/storageage', |
|
||||
meta: { |
|
||||
title: '库龄查询' |
|
||||
}, |
}, |
||||
children: [ |
{ |
||||
{ |
path: '/storageage', |
||||
|
component: Layout, |
||||
|
redirect: '/storageage', |
||||
|
meta: { |
||||
|
title: '库龄查询' |
||||
|
}, |
||||
|
children: [{ |
||||
path: '/storageage/storageage', |
path: '/storageage/storageage', |
||||
component: () => import('@/views/storageage/storageage.vue'), |
component: () => import('@/views/storageage/storageage.vue'), |
||||
name: 'StorageAge', |
name: 'StorageAge', |
||||
meta: { title: '库龄查询', noCache: true } |
meta: { |
||||
} |
title: '库龄查询', |
||||
] |
noCache: true |
||||
}, |
} |
||||
{ |
}] |
||||
path: '/carryover', |
|
||||
component: Layout, |
|
||||
redirect: '/carryover', |
|
||||
meta: { |
|
||||
title: '结转查询' |
|
||||
}, |
}, |
||||
children: [ |
{ |
||||
{ |
path: '/carryover', |
||||
path: '/carryover/carryforwardrecord', |
component: Layout, |
||||
component: () => import('@/views/carryover/carryforwardrecord.vue'), |
redirect: '/carryover', |
||||
name: 'CarryForwardRecord', |
meta: { |
||||
meta: { title: '结转记录查询', noCache: true } |
title: '结转查询' |
||||
}, |
}, |
||||
{ |
children: [{ |
||||
path: '/carryover/carryoverstock', |
path: '/carryover/carryforwardrecord', |
||||
component: () => import('@/views/carryover/carryoverstock.vue'), |
component: () => import('@/views/carryover/carryforwardrecord.vue'), |
||||
name: 'CarryoverStock', |
name: 'CarryForwardRecord', |
||||
meta: { title: '结转库存查询', noCache: true } |
meta: { |
||||
} |
title: '结转记录查询', |
||||
] |
noCache: true |
||||
} |
} |
||||
] |
}, |
||||
} |
{ |
||||
}, |
path: '/carryover/carryoverstock', |
||||
computed: { |
component: () => import('@/views/carryover/carryoverstock.vue'), |
||||
...mapGetters(['sidebar']), |
name: 'CarryoverStock', |
||||
// routes() { |
meta: { |
||||
// f4d2e507-c4ed-451c-b364-04c08f962045 |
title: '结转库存查询', |
||||
// console.log('78979789', this.$router.options.routes) |
noCache: true |
||||
// return this.$router.options.routes |
} |
||||
// }, |
} |
||||
activeMenu() { |
] |
||||
// const route = this.$route |
} |
||||
// const { |
] |
||||
// meta, |
} |
||||
// path |
|
||||
// } = route |
|
||||
// // if set path, the sidebar will highlight the path you set |
|
||||
// if (meta.activeMenu) { |
|
||||
// return meta.activeMenu |
|
||||
// } |
|
||||
return '/index' |
|
||||
}, |
}, |
||||
showLogo() { |
computed: { |
||||
return this.$store.state.settings.sidebarLogo |
...mapGetters(['sidebar']), |
||||
|
// routes() { |
||||
|
// f4d2e507-c4ed-451c-b364-04c08f962045 |
||||
|
// console.log('78979789', this.$router.options.routes) |
||||
|
// return this.$router.options.routes |
||||
|
// }, |
||||
|
activeMenu() { |
||||
|
// const route = this.$route |
||||
|
// const { |
||||
|
// meta, |
||||
|
// path |
||||
|
// } = route |
||||
|
// // if set path, the sidebar will highlight the path you set |
||||
|
// if (meta.activeMenu) { |
||||
|
// return meta.activeMenu |
||||
|
// } |
||||
|
return '/index' |
||||
|
}, |
||||
|
showLogo() { |
||||
|
return this.$store.state.settings.sidebarLogo |
||||
|
}, |
||||
|
variables() { |
||||
|
return variables |
||||
|
}, |
||||
|
isCollapse() { |
||||
|
return !this.sidebar.opened |
||||
|
} |
||||
}, |
}, |
||||
variables() { |
created() { |
||||
return variables |
this.postHuoquyonghu() |
||||
}, |
}, |
||||
isCollapse() { |
methods: { |
||||
return !this.sidebar.opened |
// 获取用户信息 |
||||
} |
postHuoquyonghu() { |
||||
}, |
// var token = getStorage() |
||||
created() { |
// loginDetails(token).then((response) => { |
||||
this.postHuoquyonghu() |
// console.log('resss', response) |
||||
}, |
// if (response.code === '200') { |
||||
methods: { |
// this.YongHuid = response.data |
||||
// 获取用户信息 |
// this.params.userSid = this.YongHuid.sid |
||||
postHuoquyonghu() { |
// getrolemenus(this.params).then((res) => { |
||||
// var token = getStorage() |
// const userRoles = this.resRouter(res.data) |
||||
// loginDetails(token).then((response) => { |
this.routes.push({ |
||||
// console.log('resss', response) |
path: '*', |
||||
// if (response.code === '200') { |
redirect: '/404', |
||||
// this.YongHuid = response.data |
hidden: true |
||||
// this.params.userSid = this.YongHuid.sid |
}) |
||||
// getrolemenus(this.params).then((res) => { |
console.log('左侧菜单', this.routes) |
||||
// const userRoles = this.resRouter(res.data) |
return this.routes |
||||
this.routes.push({ |
// }) |
||||
path: '*', |
// } |
||||
redirect: '/404', |
// }) |
||||
hidden: true |
|
||||
}) |
|
||||
console.log('左侧菜单', this.routes) |
|
||||
return this.routes |
|
||||
// }) |
|
||||
// } |
|
||||
// }) |
|
||||
|
|
||||
}, |
}, |
||||
resRouter(menus) { |
resRouter(menus) { |
||||
// 递归,将后台传来数组 |
// 递归,将后台传来数组 |
||||
for (var i = 0; i < menus.length; i++) { |
for (var i = 0; i < menus.length; i++) { |
||||
if (menus[i].children && menus[i].children.length != 0) { |
if (menus[i].children && menus[i].children.length != 0) { |
||||
this.resRouter(menus[i].children) |
this.resRouter(menus[i].children) |
||||
} |
} |
||||
if (menus[i].children.length == 0) { |
if (menus[i].children.length == 0) { |
||||
delete menus[i].children |
delete menus[i].children |
||||
delete menus[i].redirect |
delete menus[i].redirect |
||||
} |
} |
||||
if (menus[i].component == '') { |
if (menus[i].component == '') { |
||||
console.log('55555', menus[i]) |
console.log('55555', menus[i]) |
||||
menus[i] = { |
menus[i] = { |
||||
path: menus[i].path, |
path: menus[i].path, |
||||
component: '', |
component: '', |
||||
redirect: menus[i].path, |
redirect: menus[i].path, |
||||
children: [menus[i]] |
children: [menus[i]] |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
this.routes = menus |
||||
|
console.log('左侧菜单', this.routes) |
||||
|
return menus |
||||
} |
} |
||||
this.routes = menus |
|
||||
console.log('左侧菜单', this.routes) |
|
||||
return menus |
|
||||
} |
} |
||||
} |
} |
||||
} |
|
||||
</script> |
</script> |
||||
|
@ -0,0 +1,245 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div v-show="viewState == 1"> |
||||
|
<button-bar ref="btnbar" view-title="单位列表" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
||||
|
<div class="main-content"> |
||||
|
<div class="searchcon"> |
||||
|
<el-button size="small" class="searchbtn" @click="clicksearchShow"> |
||||
|
{{ searchxianshitit }} |
||||
|
</el-button> |
||||
|
<div v-show="isSearchShow" class="search"> |
||||
|
<el-form :inline="true" class="tab-header"> |
||||
|
<el-form-item label="单位名称"> |
||||
|
<el-input v-model="queryParams.params.name" placeholder="" clearable /> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<div class="btn" style="text-align: center;"> |
||||
|
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button> |
||||
|
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- Start 项目列表头部 --> |
||||
|
<div class="listtop"> |
||||
|
<div class="tit">单位列表</div> |
||||
|
</div> |
||||
|
<!-- End 项目列表头部 --> |
||||
|
<!-- Start 项目列表 --> |
||||
|
<div class=""> |
||||
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"> |
||||
|
<!-- <el-table-column fixed width="50" type="selection" align="center" /> --> |
||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" /> |
||||
|
<el-table-column label="操作" align="center" width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button> |
||||
|
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> --> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="是否可用" align="center" width="140"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1" |
||||
|
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="unitName" label="单位名称" align="center" /> |
||||
|
<el-table-column prop="remarks" label="单位备注" align="center" /> |
||||
|
|
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!-- End 项目列表 --> |
||||
|
<div class="pages"> |
||||
|
<div class="tit" /> |
||||
|
<!-- 翻页 --> |
||||
|
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" |
||||
|
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- End 查询和其列表部分 --> |
||||
|
<!-- 新增修改部分组件 --> |
||||
|
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import req from '@/api/baseinfo/unit/unit.js' |
||||
|
import ButtonBar from '@/components/ButtonBar' |
||||
|
import Pagination from '@/components/pagination' |
||||
|
import pageye from '@/components/pagination/pageye' |
||||
|
import divAdd from './unitAdd.vue' |
||||
|
export default { |
||||
|
components: { |
||||
|
ButtonBar, |
||||
|
Pagination, |
||||
|
pageye, |
||||
|
divAdd |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
btndisabled: false, |
||||
|
viewState: 1, // 1、列表 2、添加 3、修改 4、查看 |
||||
|
isSearchShow: false, |
||||
|
searchxianshitit: '显示查询条件', |
||||
|
tableLoading: false, |
||||
|
dataList: [], |
||||
|
btnList: [{ |
||||
|
type: 'primary', |
||||
|
size: 'small', |
||||
|
icon: 'plus', |
||||
|
btnKey: 'toAdd', |
||||
|
btnLabel: '新增' |
||||
|
}, |
||||
|
{ |
||||
|
type: 'info', |
||||
|
size: 'small', |
||||
|
icon: 'cross', |
||||
|
btnKey: 'doClose', |
||||
|
btnLabel: '关闭' |
||||
|
} |
||||
|
], |
||||
|
queryParams: { |
||||
|
current: 1, |
||||
|
size: 10, |
||||
|
total: 0, |
||||
|
params: { |
||||
|
name: '' |
||||
|
} |
||||
|
}, |
||||
|
sids: [] |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$refs['btnbar'].setButtonList(this.btnList) |
||||
|
}, |
||||
|
created() { |
||||
|
this.loadList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 搜索条件效果 |
||||
|
clicksearchShow() { |
||||
|
this.isSearchShow = !this.isSearchShow |
||||
|
if (this.isSearchShow) { |
||||
|
this.searchxianshitit = '隐藏查询条件' |
||||
|
} else { |
||||
|
this.searchxianshitit = '显示查询条件' |
||||
|
} |
||||
|
}, |
||||
|
btnHandle(btnKey) { |
||||
|
switch (btnKey) { |
||||
|
case 'toAdd': |
||||
|
this.toAdd() |
||||
|
break |
||||
|
case 'doClose': |
||||
|
this.doClose() |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
}, |
||||
|
loadList() { |
||||
|
this.tableLoading = true |
||||
|
req.listPage(this.queryParams).then((resp) => { |
||||
|
this.tableLoading = false |
||||
|
if (resp.success) { |
||||
|
const data = resp.data |
||||
|
this.queryParams.total = data.total |
||||
|
this.dataList = data.records |
||||
|
} else { |
||||
|
// 根据resp.code进行异常情况处理 |
||||
|
this.dataList = [] |
||||
|
this.queryParams.total = 0 |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.tableLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 序号 |
||||
|
indexMethod(index) { |
||||
|
var pagestart = (this.queryParams.current - 1) * this.queryParams.size |
||||
|
var pageindex = index + 1 + pagestart |
||||
|
return pageindex |
||||
|
}, |
||||
|
dosearch() { |
||||
|
this.queryParams.current = 1 |
||||
|
this.loadList() |
||||
|
}, |
||||
|
resetQuery() { |
||||
|
this.queryParams = { |
||||
|
current: 1, |
||||
|
size: 10, |
||||
|
total: 0, |
||||
|
params: { |
||||
|
name: '' |
||||
|
} |
||||
|
} |
||||
|
this.loadList() |
||||
|
}, |
||||
|
toAdd() { |
||||
|
this.viewState = 2 |
||||
|
this.$refs['divadd'].showAdd() |
||||
|
}, |
||||
|
|
||||
|
doClose() { |
||||
|
this.$store.dispatch('tagsView/delView', this.$route) |
||||
|
this.$router.go(-1) |
||||
|
}, |
||||
|
toRelevancy(row) { |
||||
|
this.viewState = 3 |
||||
|
this.$refs['divadd'].showEdit(row) |
||||
|
}, |
||||
|
toRelevancyInfo(row) { |
||||
|
const tip = '请确认是否删除所选品牌?' |
||||
|
this.$confirm(tip, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
const loading = this.$loading({ |
||||
|
lock: true, |
||||
|
text: 'Loading', |
||||
|
spinner: 'el-icon-loading', |
||||
|
background: 'rgba(0, 0, 0, 0.7)' |
||||
|
}) |
||||
|
req.deleteGoods(row.sid).then((resp) => { |
||||
|
loading.close() |
||||
|
if (resp.success) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: resp.msg, |
||||
|
showClose: true |
||||
|
}) |
||||
|
this.loadList() |
||||
|
} else { |
||||
|
// 根据resp.code进行异常情况处理 |
||||
|
} |
||||
|
}).catch(e => { |
||||
|
loading.close() |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
}, |
||||
|
resetState() { |
||||
|
this.viewState = 1 |
||||
|
}, |
||||
|
enableChange(sid, state) { |
||||
|
console.log('sid', sid) |
||||
|
console.log('state', state) |
||||
|
req.updateIsEnable(sid, state).then((resp) => { |
||||
|
if (resp.success) { |
||||
|
this.$message({ |
||||
|
type: 'success', |
||||
|
message: '状态已更新', |
||||
|
showClose: true |
||||
|
}) |
||||
|
} else { // 根据resp.code进行异常情况处理 |
||||
|
} |
||||
|
}).catch(e => { |
||||
|
console.log(e) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
</style> |
@ -0,0 +1,210 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
|
||||
|
<div class="tab-header webtop"> |
||||
|
<!-- 标题 --> |
||||
|
<div>单位信息</div> |
||||
|
<!-- start 添加修改按钮 --> |
||||
|
<div> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
|
</div> |
||||
|
<!-- end 添加修改按钮 --> |
||||
|
<!-- end 详情按钮 --> |
||||
|
</div> |
||||
|
|
||||
|
<div class="listconadd"> |
||||
|
|
||||
|
<el-card class="box-card"> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">单位名称:</span> |
||||
|
<el-input v-model="formobj.unitName" placeholder="" class="item_input" clearable /> |
||||
|
</div> |
||||
|
<div class="item"> |
||||
|
<span class="item_text">单位备注:</span> |
||||
|
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable /> |
||||
|
</div> |
||||
|
<!-- <div class="item"> |
||||
|
<span class="item_text">品牌故事:</span> |
||||
|
<el-input v-model="formobj.brandStory" placeholder="" class="item_input" clearable /> |
||||
|
</div> --> |
||||
|
|
||||
|
<!-- <div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
||||
|
|
||||
|
<div style="flex: 1;display: flex;flex-direction: row;align-items: center;"> |
||||
|
<span class="item_text2" >品牌Logo:</span> |
||||
|
<upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px;" class="item_input2" :limit="1" |
||||
|
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" @change="backData" /> |
||||
|
</div> |
||||
|
<div style="flex: 1;display: flex;flex-direction: row;align-items: center;"> |
||||
|
<span class="item_text2">专区大图:</span> |
||||
|
<upload ref="uploadImg2" v-model="imgList2" style="margin-top: 20px;" class="item_input2" :limit="1" |
||||
|
bucket="map" :class="{ hide: hideUploadBtn2 }" :upload-data="{ type: '0001' }" @change="backData2" /> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
</div> --> |
||||
|
<!-- <div class="item" style="margin-bottom: 100px;margin-top: 100px;"> |
||||
|
<span class="item_text">品牌Logo:</span> |
||||
|
<upload ref="uploadImg" v-model="imgList" style="" class="item_input" :limit="1" |
||||
|
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" @change="backData" /> |
||||
|
</div> --> |
||||
|
|
||||
|
</el-card> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import req from '@/api/baseinfo/unit/unit.js' |
||||
|
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue' |
||||
|
export default { |
||||
|
components: { |
||||
|
upload, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
submitdisabled: false, |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
unitName: '', |
||||
|
remarks: '', |
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
// this.initData() |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
saveOrUpdate() { |
||||
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
||||
|
req.saveUnits(this.formobj) |
||||
|
.then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
type: 'success', |
||||
|
message: resp.msg |
||||
|
}) |
||||
|
this.handleReturn('true') |
||||
|
} else { |
||||
|
// 根据resp.code进行异常情况处理 |
||||
|
} |
||||
|
}) |
||||
|
.catch(() => {}) |
||||
|
}, |
||||
|
handleReturn(isreload) { |
||||
|
if (isreload === 'true') this.$emit('reloadlist') |
||||
|
this.formobj = { |
||||
|
sid: '', |
||||
|
unitName: '', |
||||
|
remarks: '', |
||||
|
} |
||||
|
this.$emit('doback') |
||||
|
}, |
||||
|
showAdd() { |
||||
|
}, |
||||
|
showEdit(row) { |
||||
|
req.initUnits(row.sid) |
||||
|
.then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.formobj = resp.data |
||||
|
} |
||||
|
}) |
||||
|
.catch(e => { |
||||
|
this.formobj = row |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
// 隐藏上传组件 |
||||
|
|
||||
|
::v-deep .hide { |
||||
|
.el-upload--picture-card { |
||||
|
display: none !important; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.box-card { |
||||
|
margin-left: 60px; |
||||
|
margin-right: 60px; |
||||
|
min-width: 70%; |
||||
|
margin-top: 20px; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
align-items: center; |
||||
|
margin-top: 15px; |
||||
|
height: 40px; |
||||
|
line-height: 40px; |
||||
|
|
||||
|
.item_text { |
||||
|
flex: 0.8; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
.item_input { |
||||
|
flex: 4; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 80px; |
||||
|
} |
||||
|
|
||||
|
.item_text2 { |
||||
|
flex: 1; |
||||
|
font-size: 18px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.item_input2 { |
||||
|
flex: 1; |
||||
|
font-size: 16px; |
||||
|
margin-left: 10px; |
||||
|
margin-right: 80px; |
||||
|
} |
||||
|
|
||||
|
.item_left_input { |
||||
|
width: 20%; |
||||
|
} |
||||
|
|
||||
|
.item_left_text { |
||||
|
height: 30px; |
||||
|
margin-left: 20px; |
||||
|
line-height: 30px; |
||||
|
color: #018AD2; |
||||
|
padding: 0px 15px; |
||||
|
border: 1.5px solid #018AD2; |
||||
|
border-radius: 5px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.item_right { |
||||
|
flex: 1; |
||||
|
justify-items: center; |
||||
|
|
||||
|
.item_right_list_text { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
|
||||
|
.item_right_list_delect { |
||||
|
color: #5E94FF; |
||||
|
margin-left: 20px; |
||||
|
font-size: 16px; |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue