货无忧
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

426 lines
12 KiB

2 years ago
<template>
<u-navbar title="工作台" placeholder border=true leftIcon=''></u-navbar>
2 years ago
<view class="mabox" v-for="item in tablist">
<view class="boxtitl">
{{item.name}}
</view>
<view class="minboxlist">
<view @click="gopathpage(ite.router)" v-for="ite in item.minilist">
<image mode="widthFix" :src="ite.icon"></image>
<view>{{ite.name}}</view>
</view>
</view>
</view>
<!-- #ifdef APP -->
1 year ago
<saomiao2></saomiao2>
<!-- <saomiao></saomiao>
2 years ago
<saomiao1></saomiao1>
<saomiao2></saomiao2>
<saomiao3></saomiao3>
1 year ago
<saomiao4></saomiao4> -->
2 years ago
<!-- #endif -->
2 years ago
<!-- <tiplist></tiplist> -->
<!-- <Tabber checkstate='home'></Tabber> -->
2 years ago
</template>
<script lang="ts" setup>
import {
onLoad,
onShow,
onHide,
onUnload
} from '@dcloudio/uni-app'
1 year ago
import {
appMenuroutes,
appbuttons
} from "@/api/user.js"
import { getImageCache } from '@/utils/cacheimg.js'
2 years ago
import { listtype } from '@/interfaces/home/index'
2 years ago
// import Tabber from '@/compoment/Tabber/Tabber.vue'
import { inject, reactive, toRefs, watchEffect } from "vue";
let details = reactive<listtype>({
tablist: [
{
1 year ago
type: 1,
name: '库内',
minilist: [
{
1 year ago
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '订单分拣',
router: '/pagesHome/pages/ordersorting/ordersorting',
},
{
1 year ago
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '库存品分拣',
router: '/pagesHome/pages/lnventorysorting/lnventorysorting',
},
1 year ago
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '扫码上架',
router: '/pagesHome/pages/ScanUpType/ScanUpType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '手动上架',
router: '/pagesHome/pages/PeopleScanUpType/PeopleScanUpType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '移库',
router: '/pagesHome/pages/RelocationType/RelocationType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '滞留',
router: '/pagesHome/pages/Retention/Retention',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '合托',
router: '/pagesHome/pages/MergeTray/MergeTray',
},
1 year ago
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '下架',
router: '/pagesHome/pages/DownGoodsType/DownGoodsType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '空置托盘',
router: '/pagesHome/pages/RemoveTray/RemoveTray',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '复核',
router: '/pagesHome/pages/Check/Check',
},
]
},
{
type: 1,
name: '出库',
minilist: [
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '拣货扫描',
router: '/pagesHome/pages/pickingScan/pickingScan',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '自提扫描',
router: '/pagesHome/pages/SelfPickupScan/SelfPickupScan',
},
]
},
{
type: 1,
name: '配送',
minilist: [
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '装车扫描',
router: '/pagesHome/pages/LoadingScan/LoadingScan',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '签收扫描',
router: '/pagesHome/pages/signinScan/signinScan',
},
]
},
{
type: 1,
name: '离线上传',
minilist: [
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '离线上传',
router: '/pagesHome/pages/OfflineUpload/OfflineUpload',
},
]
},
2 years ago
]
})
function gopathpage(path : string) {
2 years ago
uni.navigateTo({
url: path
2 years ago
})
}
1 year ago
async function init() {
let tabber = uni.getStorageSync('homerouter')
if (tabber) {
details.tablist = tabber
return
}
1 year ago
let res = await appMenuroutes({})
console.log(res, '-------------');
if (res.code == 200) {
//读取并处理缓存图标并把菜单写入缓存
// getimgcache(res.data[0])
// 本地强行写入菜单
details.tablist = [
{
type: 1,
name: '库内',
minilist: [
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '订单分拣',
router: '/pagesHome/pages/ordersorting/ordersorting',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '库存品分拣',
router: '/pagesHome/pages/lnventorysorting/lnventorysorting',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '扫码上架',
router: '/pagesHome/pages/ScanUpType/ScanUpType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '手动上架',
router: '/pagesHome/pages/PeopleScanUpType/PeopleScanUpType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '移库',
router: '/pagesHome/pages/RelocationType/RelocationType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '滞留',
router: '/pagesHome/pages/Retention/Retention',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '合托',
router: '/pagesHome/pages/MergeTray/MergeTray',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '下架',
router: '/pagesHome/pages/DownGoodsType/DownGoodsType',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '空置托盘',
router: '/pagesHome/pages/RemoveTray/RemoveTray',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '复核',
router: '/pagesHome/pages/Check/Check',
},
]
},
{
type: 1,
name: '出库',
minilist: [
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '拣货扫描',
router: '/pagesHome/pages/pickingScan/pickingScan',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '自提扫描',
router: '/pagesHome/pages/SelfPickupScan/SelfPickupScan',
},
]
},
{
type: 1,
name: '配送',
minilist: [
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '装车扫描',
router: '/pagesHome/pages/LoadingScan/LoadingScan',
},
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '签收扫描',
router: '/pagesHome/pages/signinScan/signinScan',
},
]
},
{
type: 1,
name: '离线上传',
minilist: [
{
icon: 'http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png',
name: '离线上传',
router: '/pagesHome/pages/OfflineUpload/OfflineUpload',
},
]
},
]
1 year ago
} else {
uni.showToast({
1 year ago
title: res.msg,
icon: 'none'
})
}
}
1 year ago
async function initbuts() {
let authbut = uni.getStorageSync('authbuts')
if (authbut) {
return
}
1 year ago
let butres = await appbuttons({})
console.log(butres.data);
1 year ago
let qxan = []
butres.data.map(item => {
item.children.map(ite => {
qxan.push(ite.name)
})
})
1 year ago
uni.setStorageSync('authbuts', qxan)
}
1 year ago
onShow(() => {
init()
initbuts()
// print()
})
1 year ago
function print() {
// #ifdef APP
1 year ago
const util = (inject('utils') as any)
let text = '! 0 200 200 500 1\r\n'
text += 'SETBOLD 2\r\n'
text += `T 56 0 0 0 OPLYA成都市230700015YA7\r\n`
text += 'LINE 0 50 420 50 3\r\n'
text += `T 55 0 0 60 客户\r\n`
text += 'LINE 40 50 40 110 3\r\n'
text += `T 55 0 50 60 客户名称\r\n`
text += 'LINE 40 80 420 80 3\r\n'
text += `T 55 0 50 90 四川成都龙泉驿西河镇\r\n`
text += 'LINE 0 110 420 110 3\r\n'
text += `T 55 0 0 120 物料\r\n`
text += 'LINE 40 110 40 140 3\r\n'
text += `T 55 0 60 120 物料名称31\r\n`
text += 'LINE 0 140 420 140 3\r\n'
text += 'B QR 150 150 M 2 U 4\r\n'
text += 'MA,123141515215212\r\n'
text += 'ENDQR\r\n'
text += `T 55 0 140 260 123141515215212\r\n`
text += 'PRINT\r\n'
// let text='! 0 200 200 500 1\r\n'
// text+='SETBOLD 2\r\n'
// text+='B QR 80 40 M 2 U 8\r\n'
// text+='MA,TESTCodeBJ2308020043\r\n'
// text+='ENDQR\r\n'
// text+=`T 56 0 15 280 TESTCodeBJ2308020043\r\n`
// text+='PRINT\r\n'
1 year ago
let sylist = util.initbl()
console.log(sylist);
sylist.map(item => {
console.log(item);
1 year ago
if (item.uuids) {
util.getbl(item, text)
}
})
// #endif
}
1 year ago
watchEffect(() => {
if (details.tablist.length > 0) {
uni.setStorageSync('homerouter', details.tablist)
}
})
function getimgcache(list) {
1 year ago
let maxarr = []
list.children.map(async item => {
let arr = {
type: 1,
name: item.name,
minilist: []
}
1 year ago
await item.children.map(async ite => {
let result = await getImageCache('http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png')
console.log("image cache", result);
1 year ago
let obj = {
icon: result,
name: ite.name,
router: ite.path
}
arr.minilist.push(obj)
})
maxarr.push(arr)
})
1 year ago
details.tablist = maxarr
// details.tablist.map((item,index)=>{
// item.minilist.map(async (ite,inde)=>{
// let result = await getImageCache('http://htys.oss-cn-chengdu.aliyuncs.com/htys/afb031efec7d2f8620ee68c71f87a80e.png')
// console.log("image cache", result);
// if (result) {
// details.tablist[index].minilist[inde].icon=result
1 year ago
// } else {
// details.tablist[index].minilist[inde].icon=ite.icon
// }
// })
// })
// setTimeout(()=>{
// console.log(details.tablist);
// },3500)
}
1 year ago
const { tablist } = toRefs(details)
2 years ago
</script>
<style lang="scss">
.mabox {
2 years ago
display: flex;
flex-direction: column;
padding: 20upx 0;
box-sizing: border-box;
width: 686upx;
margin: auto;
background-color: #ffffff;
margin-bottom: 20upx;
margin-top: 10upx;
border-radius: 10upx;
box-shadow: 0rpx 2rpx 10rpx 0rpx #e2e2e380;
.boxtitl {
2 years ago
font-size: 34upx;
font-weight: 500;
margin-bottom: 10upx;
// margin-left: 10upx;
border-bottom: 1upx solid #EEEEEE;
padding: 0upx 20upx;
padding-bottom: 20upx;
color: #092C4D;
}
.minboxlist {
display: flex;
flex-wrap: wrap;
align-items: center;
// justify-content: space-between;
2 years ago
padding-top: 10upx;
>view {
width: 25%;
2 years ago
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 15upx;
>image {
2 years ago
width: 60upx;
}
>view {
2 years ago
font-size: 26upx;
}
}
}
}
</style>