From 95fce9ecb77e9615df925eee143ce34647c694ce Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 16 四月 2026 17:20:22 +0800
Subject: [PATCH] 扫码出库和扫码入库功能开发
---
src/pages/works.vue | 186 +++++++++++++++++++++++++++++----------------
1 files changed, 119 insertions(+), 67 deletions(-)
diff --git a/src/pages/works.vue b/src/pages/works.vue
index 89c8d26..9ddae95 100644
--- a/src/pages/works.vue
+++ b/src/pages/works.vue
@@ -15,7 +15,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -37,7 +38,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -59,7 +61,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -81,14 +84,29 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
+ </up-grid-item>
+ <up-grid-item @click="jumpUrl('/pages/inventoryManagement/scanIn/index')">
+ <view class="icon-container">
+ <image src="/static/images/icon/xiaoshoutaizhang.svg"
+ class="item-icon"></image>
+ </view>
+ <text class="item-label">鎵爜鍏ュ簱</text>
+ </up-grid-item>
+ <up-grid-item @click="jumpUrl('/pages/inventoryManagement/scanOut/index')">
+ <view class="icon-container">
+ <image src="/static/images/icon/xiaoshoutaizhang.svg"
+ class="item-icon"></image>
+ </view>
+ <text class="item-label">鎵爜鍑哄簱</text>
</up-grid-item>
</up-grid>
</view>
</view>
- <!-- 浜哄姏璧勬簮妯″潡 -->
+ <!-- 浜哄姏璧勬簮妯″潡锛堝凡娉ㄩ噴锛�
<view class="common-module collaboration-module"
v-if="hasHumanResourcesItems">
<view class="module-header">
@@ -110,7 +128,8 @@
</up-grid>
</view>
</view>
- <!-- 鐢熶骇绠℃帶妯″潡 -->
+ -->
+ <!-- 鐢熶骇绠℃帶妯″潡锛堝凡娉ㄩ噴锛�
<view class="common-module equipment-module"
v-if="hasProductionItems">
<view class="module-header">
@@ -132,6 +151,7 @@
</up-grid>
</view>
</view>
+ -->
<!-- 璐㈠姟绠$悊妯″潡 -->
<view class="common-module finance-module"
v-if="hasFinanceManagementItems">
@@ -147,7 +167,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -169,7 +190,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -191,7 +213,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -213,7 +236,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -235,7 +259,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -257,7 +282,8 @@
:key="index"
@click="handleCommonItemClick(item)">
<view class="icon-container">
- <image :src="item.icon" class="item-icon"></image>
+ <image :src="item.icon"
+ class="item-icon"></image>
</view>
<text class="item-label">{{item.label}}</text>
</up-grid-item>
@@ -401,20 +427,22 @@
},
]);
- const humanResourcesItems = reactive([
- {
- icon: "/static/images/icon/dakaqiandao.svg",
- label: "鎵撳崱绛惧埌",
- },
- {
- icon: "/static/images/icon/renyuanxinzi.svg",
- label: "浜哄憳钖祫",
- },
- {
- icon: "/static/images/icon/hetongguanli.svg",
- label: "鍚堝悓绠$悊",
- },
- ]);
+ // 浜哄姏璧勬簮妯″潡锛堝凡娉ㄩ噴锛�
+ const humanResourcesItems = reactive([]);
+ // const humanResourcesItems = reactive([
+ // {
+ // icon: "/static/images/icon/dakaqiandao.svg",
+ // label: "鎵撳崱绛惧埌",
+ // },
+ // {
+ // icon: "/static/images/icon/renyuanxinzi.svg",
+ // label: "浜哄憳钖祫",
+ // },
+ // {
+ // icon: "/static/images/icon/hetongguanli.svg",
+ // label: "鍚堝悓绠$悊",
+ // },
+ // ]);
const qualityItems = reactive([
{
icon: "/static/images/icon/yuancailiaojianyan.svg",
@@ -495,40 +523,42 @@
},
]);
- // 鐢熶骇绠℃帶鍔熻兘鏁版嵁
- const productionItems = reactive([
- // {
- // icon: "/static/images/icon/shengchandingdan@2x.svg",
- // label: "鐢熶骇璁㈠崟",
- // },
- // {
- // icon: "/static/images/icon/shengchanpaigong@2x.svg",
- // label: "鐢熶骇娲惧伐",
- // },
- // {
- // icon: "/static/images/icon/shengchanpaichan@2x.svg",
- // label: "宸ュ簭鎺掍骇",
- // },
- {
- icon: "/static/images/icon/shengchanbaogong.svg",
- label: "鐢熶骇鎶ュ伐",
- },
- {
- icon: "/static/images/icon/shengchanbaogong.svg",
- label: "鐢熶骇宸ュ崟",
- },
- // {
- // icon: "/static/images/icon/shengchanhesuan@2x.svg",
- // label: "鐢熶骇鏍哥畻",
- // },
- ]);
+ // 鐢熶骇绠℃帶妯″潡锛堝凡娉ㄩ噴锛�
+ const productionItems = reactive([]);
+ // // 鐢熶骇绠℃帶鍔熻兘鏁版嵁
+ // const productionItems = reactive([
+ // {
+ // icon: "/static/images/icon/shengchandingdan@2x.svg",
+ // label: "鐢熶骇璁㈠崟",
+ // },
+ // {
+ // icon: "/static/images/icon/shengchanpaigong@2x.svg",
+ // label: "鐢熶骇娲惧伐",
+ // },
+ // {
+ // icon: "/static/images/icon/shengchanpaichan@2x.svg",
+ // label: "宸ュ簭鎺掍骇",
+ // },
+ // {
+ // icon: "/static/images/icon/shengchanbaogong.svg",
+ // label: "鐢熶骇鎶ュ伐",
+ // },
+ // {
+ // icon: "/static/images/icon/shengchanbaogong.svg",
+ // label: "鐢熶骇宸ュ崟",
+ // },
+ // {
+ // icon: "/static/images/icon/shengchanhesuan@2x.svg",
+ // label: "鐢熶骇鏍哥畻",
+ // },
+ // ]);
// 璁惧绠$悊鍔熻兘鏁版嵁
const equipmentItems = reactive([
- // {
- // icon: '/static/images/icon/shebeitaizhang@2x.svg',
- // label: '璁惧鍙拌处',
- // },
+ {
+ icon: "/static/images/icon/shengchanbaogong.svg",
+ label: "璁惧鍙拌处",
+ },
{
icon: "/static/images/icon/yunxingguanli.svg",
label: "杩愯绠$悊",
@@ -906,6 +936,11 @@
});
}
};
+ const jumpUrl = url => {
+ uni.navigateTo({
+ url: url,
+ });
+ };
// 鍒涘缓瀵瑰瓙缁勪欢鐨勫紩鐢�
const uToastRef = ref(null);
@@ -1086,10 +1121,16 @@
// 瀹氫箟鑿滃崟閰嶇疆鏄犲皠
const menuMapping = {
- collaboration: { target: collaborationItems, specialMapping: { "瑙勭珷鍒跺害": "瑙勭珷鍒跺害绠$悊" } },
- archiveManagement: { target: archiveManagementItems, specialMapping: { "渚涘簲鍟嗘。妗�": "渚涘簲鍟嗙鐞�" } },
+ collaboration: {
+ target: collaborationItems,
+ specialMapping: { 瑙勭珷鍒跺害: "瑙勭珷鍒跺害绠$悊" },
+ },
+ archiveManagement: {
+ target: archiveManagementItems,
+ specialMapping: { 渚涘簲鍟嗘。妗�: "渚涘簲鍟嗙鐞�" },
+ },
};
- console.log(allowedMenuTitles)
+ console.log(allowedMenuTitles);
// 閫氱敤杩囨护鍑芥暟
const filterArray = (targetArray, specialMapping) => {
const filtered = targetArray.filter(item => {
@@ -1106,7 +1147,10 @@
filterArray(marketingItems);
filterArray(purchaseItems);
filterArray(financeManagementItems);
- filterArray(archiveManagementItems, menuMapping.archiveManagement.specialMapping);
+ filterArray(
+ archiveManagementItems,
+ menuMapping.archiveManagement.specialMapping
+ );
filterArray(collaborationItems, menuMapping.collaboration.specialMapping);
filterArray(safetyItems);
filterArray(humanResourcesItems);
@@ -1119,15 +1163,23 @@
// 妫�鏌ユā鍧楁槸鍚︽湁鑿滃崟椤归渶瑕佹樉绀�
const hasMarketingItems = computed(() => marketingItems.length > 0);
const hasPurchaseItems = computed(() => purchaseItems.length > 0);
- const hasFinanceManagementItems = computed(() => financeManagementItems.length > 0);
- const hasArchiveManagementItems = computed(() => archiveManagementItems.length > 0);
- const hasAfterSalesServiceItems = computed(() => afterSalesServiceItems.length > 0);
+ const hasFinanceManagementItems = computed(
+ () => financeManagementItems.length > 0
+ );
+ const hasArchiveManagementItems = computed(
+ () => archiveManagementItems.length > 0
+ );
+ const hasAfterSalesServiceItems = computed(
+ () => afterSalesServiceItems.length > 0
+ );
const hasCollaborationItems = computed(() => collaborationItems.length > 0);
const hasSafetyItems = computed(() => safetyItems.length > 0);
const hasQualityItems = computed(() => qualityItems.length > 0);
- const hasHumanResourcesItems = computed(() => humanResourcesItems.length > 0);
- const hasWarehouseLogisticsItems = computed(() => warehouseLogisticsItems.length > 0);
- const hasProductionItems = computed(() => productionItems.length > 0);
+ // const hasHumanResourcesItems = computed(() => humanResourcesItems.length > 0);
+ const hasWarehouseLogisticsItems = computed(
+ () => warehouseLogisticsItems.length > 0
+ );
+ // const hasProductionItems = computed(() => productionItems.length > 0);
const hasEquipmentItems = computed(() => equipmentItems.length > 0);
onMounted(() => {
--
Gitblit v1.9.3