|
@@ -1,59 +1,230 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="container">
|
|
|
|
|
- <van-image class="image" :src="imageUrl" ></van-image>
|
|
|
|
|
- <div class="name" >{{userInfo.username}}</div>
|
|
|
|
|
- <div class="home" @click="onRouter('picking')">拣货</div>
|
|
|
|
|
-<!-- <div class="home" @click="onRouter('picking-aisle')">巷道拣货</div>-->
|
|
|
|
|
- <div class="home" @click="onRouter('blind-receiving')">盲扫</div>
|
|
|
|
|
-<!-- <div class="home" @click="onRouter('check-move-stock')">反拣还库</div>-->
|
|
|
|
|
- <div class="home" @click="onRouter('piece-dashboard')">计件面板</div>
|
|
|
|
|
- <div class="home" @click="onRouter('take-delivery')">收货</div>
|
|
|
|
|
- <div class="home" @click="onRouter('hik-putaway-allocation')">海康上架-调度</div>
|
|
|
|
|
- <div class="home" @click="onRouter('hik-putaway')">海康上架</div>
|
|
|
|
|
- <div class="home" @click="onRouter('hik-box-return')">海康-入库/解绑</div>
|
|
|
|
|
- <div class="home" @click="onRouter('check-activity')">复核-活动单</div>
|
|
|
|
|
- <div class="home" @click="onRouter('check-large')">复核-大件单</div>
|
|
|
|
|
- <div class="home" @click="onRouter('move-list')">调拨-移库</div>
|
|
|
|
|
- <div class="home" @click="onRouter('processing')">加工登记</div>
|
|
|
|
|
- <div class="home" @click="onRouter('returned-register')">退货-登记</div>
|
|
|
|
|
|
|
+ <div class="warehouse container">
|
|
|
|
|
+ <div v-if="menuTrueFalseBy" class="menu">
|
|
|
|
|
+ <div class="name">
|
|
|
|
|
+ {{ userInfo.username }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="(item, index) in menuList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :class="menuId === item.id ? 'active' : ''"
|
|
|
|
|
+ @click="onConfirm(item)"
|
|
|
|
|
+ class="title flex"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="icon">
|
|
|
|
|
+ <van-icon :name="item.icon"></van-icon>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>{{ item.title }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="title flex" style="margin-top: 30px;" @click="outLogin">
|
|
|
|
|
+ <div class="icon">
|
|
|
|
|
+ <van-icon name="upgrade" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>退出登录</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div :class="menuTrueFalseBy ? 'content-box' : 'content-show'">
|
|
|
|
|
+ <div class="content">
|
|
|
|
|
+ <van-nav-bar
|
|
|
|
|
+ placeholder
|
|
|
|
|
+ :fixed="!menuTrueFalseBy"
|
|
|
|
|
+ @click-left="back"
|
|
|
|
|
+ @click-right="showSelect"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #left>
|
|
|
|
|
+ <div class="u-nav-slot">
|
|
|
|
|
+ <van-icon name="bars" size="25" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #title>
|
|
|
|
|
+ <div class="flex flexColumn alignCenter">
|
|
|
|
|
+ <div>工作台</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #right>
|
|
|
|
|
+ <div style="color: #fff">{{ warehousesMap[warehouse] }}</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </van-nav-bar>
|
|
|
|
|
+ <div class="menu-box">
|
|
|
|
|
+ <div v-for="(item, index) in menuList[menuId].menu" class="menu-list">
|
|
|
|
|
+ <div class="menu-title">{{ item.title }}</div>
|
|
|
|
|
+ <div class="menu-item-box">
|
|
|
|
|
+ <div v-for="(items, index) in item.children" class="menu-item" @click="onRouter(items.path)">
|
|
|
|
|
+ <div class="menu-item-icon">
|
|
|
|
|
+ <van-icon :name="items.icon" size="28" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="menu-item-title">{{ items.title }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="menuTrueFalseBy" @click="hideMenu" class="hide-menu"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <select-warehouse ref="selectWarehouseRef" @setWarehouse="setWarehouse" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import imageUrl from '@/assets/img.png'
|
|
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
|
|
-import { getHeader } from '@/utils/android.ts'
|
|
|
|
|
-import { useStore } from '@/store/modules/user.ts'
|
|
|
|
|
-import { getUserInfo } from '@/api/login/index.ts'
|
|
|
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
|
|
|
+import menu from '@/hooks/basic/menu.js'
|
|
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
+import { getHeader, goBack } from '@/utils/android'
|
|
|
|
|
+import { useStore } from '@/store/modules/user'
|
|
|
|
|
+import { getUserInfo } from '@/api/login/index'
|
|
|
|
|
+import SelectWarehouse from '@/components/SelectWarehouse.vue'
|
|
|
|
|
+import { showToast } from 'vant'
|
|
|
|
|
+
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
-const onRouter=(path)=>{
|
|
|
|
|
- router.push(`/${path}`)
|
|
|
|
|
-}
|
|
|
|
|
const store = useStore()
|
|
const store = useStore()
|
|
|
-const userInfo=ref({})
|
|
|
|
|
|
|
+const userInfo = ref({})
|
|
|
try {
|
|
try {
|
|
|
getHeader()
|
|
getHeader()
|
|
|
-}catch (error) {
|
|
|
|
|
|
|
+} catch (error) {
|
|
|
}
|
|
}
|
|
|
-setTimeout(()=>{
|
|
|
|
|
|
|
+setTimeout(() => {
|
|
|
getUserInfo().then(res => {
|
|
getUserInfo().then(res => {
|
|
|
- userInfo.value=res.data
|
|
|
|
|
|
|
+ userInfo.value = res.data
|
|
|
})
|
|
})
|
|
|
-},300)
|
|
|
|
|
|
|
+}, 300)
|
|
|
|
|
|
|
|
|
|
+const { menuList } = menu()
|
|
|
|
|
+const menuId = ref(0)
|
|
|
|
|
+const menuTrueFalseBy = ref(false)
|
|
|
|
|
+const storeUser = useStore()
|
|
|
|
|
+const warehouse = ref(storeUser.warehouse)
|
|
|
|
|
+const warehousesMap = ref({
|
|
|
|
|
+ 'WH99': '测试仓库(WH99)',
|
|
|
|
|
+ 'WH01': '九干仓(WH01)',
|
|
|
|
|
+ 'WH02': '新浜一仓(WH02)',
|
|
|
|
|
+ 'WH10': '新浜二仓(WH10)',
|
|
|
|
|
+})
|
|
|
|
|
+const onRouter = (path) => {
|
|
|
|
|
+ router.push(`/${path}`)
|
|
|
|
|
+}
|
|
|
|
|
+const onConfirm = (item) => {
|
|
|
|
|
+ menuTrueFalseBy.value = false
|
|
|
|
|
+}
|
|
|
|
|
+const back = () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ window.android.goBack()
|
|
|
|
|
+ }catch (e){
|
|
|
|
|
+ menuTrueFalseBy.value = true
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const selectWarehouseRef = ref(null)
|
|
|
|
|
+const showSelect = () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ if(window.android.getHeader()){
|
|
|
|
|
+ showToast('app内不支持切换仓库')
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (e){
|
|
|
|
|
+ selectWarehouseRef.value.show(warehouse.value)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+const hideMenu = () => {
|
|
|
|
|
+ if (menuTrueFalseBy.value) {
|
|
|
|
|
+ menuTrueFalseBy.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const setWarehouse = (code) => {
|
|
|
|
|
+ warehouse.value = code
|
|
|
|
|
+}
|
|
|
|
|
+const outLogin = () => {
|
|
|
|
|
+ router.push(`/login`)
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
-<style scoped lang="sass" >
|
|
|
|
|
-.container
|
|
|
|
|
|
|
+
|
|
|
|
|
+<style lang="sass" scoped>
|
|
|
|
|
+.warehouse
|
|
|
|
|
+ width: 100%
|
|
|
height: 100vh
|
|
height: 100vh
|
|
|
- .image
|
|
|
|
|
- margin: 20px
|
|
|
|
|
- .home
|
|
|
|
|
- cursor: pointer
|
|
|
|
|
- padding: 5px
|
|
|
|
|
- font-size: 16px
|
|
|
|
|
- text-decoration: underline
|
|
|
|
|
- color: #0077ff
|
|
|
|
|
- .name
|
|
|
|
|
- font-size: 20px
|
|
|
|
|
- color: #0077ff
|
|
|
|
|
|
|
+ display: flex
|
|
|
|
|
+
|
|
|
|
|
+ .menu
|
|
|
|
|
+ width: 50%
|
|
|
|
|
+ margin-left: 15px
|
|
|
|
|
+
|
|
|
|
|
+ .name
|
|
|
|
|
+ margin: 50px auto
|
|
|
|
|
+ text-align: center
|
|
|
|
|
+ font-size: 18px
|
|
|
|
|
+ font-weight: 500
|
|
|
|
|
+
|
|
|
|
|
+ .title
|
|
|
|
|
+ line-height: 40px
|
|
|
|
|
+
|
|
|
|
|
+ .active
|
|
|
|
|
+ color: #3c9cff
|
|
|
|
|
+
|
|
|
|
|
+ .content-box
|
|
|
|
|
+ width: 50%
|
|
|
|
|
+ transition: width 0.2s
|
|
|
|
|
+ overflow: hidden
|
|
|
|
|
+ background-color: #ffffff
|
|
|
|
|
+ margin: 80px 0 110px 0
|
|
|
|
|
+ position: relative
|
|
|
|
|
+
|
|
|
|
|
+ .content
|
|
|
|
|
+ width: 375px
|
|
|
|
|
+ overflow: hidden
|
|
|
|
|
+ transform: scale(0.75)
|
|
|
|
|
+ transform-origin: left top
|
|
|
|
|
+ pointer-events: none
|
|
|
|
|
+
|
|
|
|
|
+ .menu-box
|
|
|
|
|
+ .menu-list
|
|
|
|
|
+ background: #fff
|
|
|
|
|
+ padding: 10px 0
|
|
|
|
|
+ font-size: 13px
|
|
|
|
|
+ margin-bottom: 10px
|
|
|
|
|
+ color: #333
|
|
|
|
|
+
|
|
|
|
|
+ .menu-title
|
|
|
|
|
+ padding: 0 15px 10px 15px
|
|
|
|
|
+ text-align: left
|
|
|
|
|
+
|
|
|
|
|
+ .menu-item-box
|
|
|
|
|
+ display: flex
|
|
|
|
|
+
|
|
|
|
|
+ .menu-item
|
|
|
|
|
+ width: 25%
|
|
|
|
|
+
|
|
|
|
|
+ .hide-menu
|
|
|
|
|
+ position: absolute
|
|
|
|
|
+ height: 100%
|
|
|
|
|
+ width: 100%
|
|
|
|
|
+ left: 0
|
|
|
|
|
+ right: 0
|
|
|
|
|
+ top: 0
|
|
|
|
|
+ bottom: 0
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ .content-show
|
|
|
|
|
+ width: 100%
|
|
|
|
|
+
|
|
|
|
|
+ .content
|
|
|
|
|
+ .menu-box
|
|
|
|
|
+ .menu-list
|
|
|
|
|
+ background: #fff
|
|
|
|
|
+ padding: 10px 0
|
|
|
|
|
+ font-size: 13px
|
|
|
|
|
+ margin-bottom: 10px
|
|
|
|
|
+ color: #333
|
|
|
|
|
+
|
|
|
|
|
+ .menu-title
|
|
|
|
|
+ padding: 0 15px 10px 15px
|
|
|
|
|
+ text-align: left
|
|
|
|
|
+
|
|
|
|
|
+ .menu-item-box
|
|
|
|
|
+ display: flex
|
|
|
|
|
+
|
|
|
|
|
+ .menu-item
|
|
|
|
|
+ width: 25%
|
|
|
|
|
+
|
|
|
|
|
+ .grid-text
|
|
|
|
|
+ font-size: 14px
|
|
|
|
|
+ color: #909399
|
|
|
|
|
+ padding: 5px 0 10px 0
|
|
|
</style>
|
|
</style>
|