移动端:增加测试批次模式隔离
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
<view class="flex h-full flex-col bg-gray-50 overflow-hidden">
|
||||
<scroll-view scroll-y class="flex-1" :show-scrollbar="false">
|
||||
<view class="p-4 pb-24 space-y-6">
|
||||
<TestBatchModeSwitch />
|
||||
|
||||
<!-- Banner -->
|
||||
<view
|
||||
class="relative h-40 w-full overflow-hidden rounded-2xl shadow-lg shadow-indigo-100"
|
||||
@@ -82,6 +84,36 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- PDA Business Section -->
|
||||
<view v-if="visibleBusinessEntries.length">
|
||||
<view class="mb-4 flex items-center space-x-2">
|
||||
<view class="h-4 w-1 rounded-full bg-emerald-500"></view>
|
||||
<text class="text-base font-bold text-gray-800">现场业务</text>
|
||||
</view>
|
||||
<view class="rounded-2xl bg-white p-5 shadow-sm">
|
||||
<view class="grid grid-cols-3 gap-4">
|
||||
<view
|
||||
v-for="entry in visibleBusinessEntries"
|
||||
:key="entry.path"
|
||||
class="flex flex-col items-center space-y-1.5 active:opacity-60"
|
||||
@click="handleBusinessEntry(entry)"
|
||||
>
|
||||
<view
|
||||
class="flex size-10 items-center justify-center rounded-xl bg-emerald-50 text-emerald-600"
|
||||
>
|
||||
<view :class="entry.icon" class="text-xl"></view>
|
||||
</view>
|
||||
<text class="text-center text-[11px] font-medium text-gray-600">
|
||||
{{ entry.title }}
|
||||
</text>
|
||||
<text class="text-center text-[10px] text-gray-400">
|
||||
{{ entry.description }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- System Management Section -->
|
||||
<view>
|
||||
<view class="mb-4 flex items-center space-x-2">
|
||||
@@ -202,7 +234,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, getCurrentInstance } from "vue";
|
||||
import { computed, ref, getCurrentInstance } from "vue";
|
||||
import TestBatchModeSwitch from "@/components/business/TestBatchModeSwitch.vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const current = ref(0);
|
||||
@@ -212,6 +245,76 @@ const data = ref([
|
||||
{ image: "/static/images/banner/banner02.jpg" },
|
||||
{ image: "/static/images/banner/banner03.jpg" },
|
||||
]);
|
||||
const businessEntries = [
|
||||
{
|
||||
path: "/pages/business/inbound/index",
|
||||
title: "仓库入库",
|
||||
description: "扫描托盘登记入库",
|
||||
icon: "i-mdi-package-down",
|
||||
color: "blue",
|
||||
permissions: [
|
||||
"business:inbound:list",
|
||||
"business:inbound:query",
|
||||
"business:inbound:add",
|
||||
"business:inbound:edit",
|
||||
"business:inbound:confirm",
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/pages/business/filling/index",
|
||||
title: "托盘装填",
|
||||
description: "录入菌种和包数",
|
||||
icon: "i-mdi-package-variant-closed-plus",
|
||||
color: "green",
|
||||
permissions: [
|
||||
"business:filling:list",
|
||||
"business:filling:query",
|
||||
"business:filling:add",
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/pages/business/shipment/index",
|
||||
title: "发货出库",
|
||||
description: "扫码创建发货单",
|
||||
icon: "i-mdi-truck-delivery",
|
||||
color: "orange",
|
||||
permissions: [
|
||||
"business:shipment:list",
|
||||
"business:shipment:query",
|
||||
"business:shipment:add",
|
||||
"business:shipment:edit",
|
||||
"business:shipment:confirm",
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/pages/business/usage/index",
|
||||
title: "现场使用",
|
||||
description: "绑定产线记录消耗",
|
||||
icon: "i-mdi-factory",
|
||||
color: "purple",
|
||||
permissions: [
|
||||
"business:usage:list",
|
||||
"business:usage:query",
|
||||
"business:usage:add",
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/pages/business/return/index",
|
||||
title: "退回仓库",
|
||||
description: "申请和确认退回",
|
||||
icon: "i-mdi-undo-variant",
|
||||
color: "red",
|
||||
permissions: [
|
||||
"business:return:list",
|
||||
"business:return:query",
|
||||
"business:return:request",
|
||||
"business:return:confirm",
|
||||
],
|
||||
},
|
||||
];
|
||||
const visibleBusinessEntries = computed(() =>
|
||||
businessEntries.filter((entry) => proxy.$auth.hasPermiOr(entry.permissions)),
|
||||
);
|
||||
|
||||
function clickBannerItem(item) {
|
||||
console.info(item);
|
||||
@@ -229,6 +332,14 @@ function handleToUserList() {
|
||||
handleBuilding();
|
||||
}
|
||||
|
||||
function handleBusinessEntry(entry) {
|
||||
if (!proxy.$auth.hasPermiOr(entry.permissions)) {
|
||||
proxy.$modal.msgError("当前账号没有该业务权限");
|
||||
return;
|
||||
}
|
||||
proxy.$tab.navigateTo(entry.path);
|
||||
}
|
||||
|
||||
function handleBuilding() {
|
||||
proxy.$modal.msg("模块建设中~");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user