From e449a5408265e4bd1f6c66f5be28a42efac444ee Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期日, 20 九月 2026 15:22:46 +0800
Subject: [PATCH] 天津豹鸣app 1.需求修改

---
 src/pages/works.vue |  307 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 271 insertions(+), 36 deletions(-)

diff --git a/src/pages/works.vue b/src/pages/works.vue
index 65fd28a..d2d6986 100644
--- a/src/pages/works.vue
+++ b/src/pages/works.vue
@@ -1,28 +1,5 @@
 <template>
   <view class="content">
-    <!-- OA鍔炲叕妯″潡 -->
-    <view class="common-module oa-module"
-          v-if="hasOaItems">
-      <view class="module-header">
-        <view class="module-title-container">
-          <text class="module-title">OA鍔炲叕</text>
-        </view>
-      </view>
-      <view class="module-content">
-        <up-grid :border="false"
-                 col="4">
-          <up-grid-item v-for="(item, index) in oaItems"
-                        :key="index"
-                        @click="handleCommonItemClick(item)">
-            <view class="icon-container">
-              <image :src="item.icon"
-                     class="item-icon"></image>
-            </view>
-            <text class="item-label">{{item.label}}</text>
-          </up-grid-item>
-        </up-grid>
-      </view>
-    </view>
     <!-- 鍗忓悓鍔炲叕妯″潡 -->
     <view class="common-module collaboration-module"
           v-if="hasCollaborationItems">
@@ -35,6 +12,29 @@
         <up-grid :border="false"
                  col="4">
           <up-grid-item v-for="(item, index) in collaborationItems"
+                        :key="index"
+                        @click="handleCommonItemClick(item)">
+            <view class="icon-container">
+              <image :src="item.icon"
+                     class="item-icon"></image>
+            </view>
+            <text class="item-label">{{item.label}}</text>
+          </up-grid-item>
+        </up-grid>
+      </view>
+    </view>
+    <!-- 椤圭洰绠$悊妯″潡 -->
+    <view class="common-module project-module"
+          v-if="hasProjectItems">
+      <view class="module-header">
+        <view class="module-title-container">
+          <text class="module-title">椤圭洰绠$悊</text>
+        </view>
+      </view>
+      <view class="module-content">
+        <up-grid :border="false"
+                 col="4">
+          <up-grid-item v-for="(item, index) in projectItems"
                         :key="index"
                         @click="handleCommonItemClick(item)">
             <view class="icon-container">
@@ -299,6 +299,29 @@
         </up-grid>
       </view>
     </view>
+    <!-- 杞﹁締绠$悊妯″潡 -->
+    <view class="common-module vehicle-module"
+          v-if="hasVehicleItems">
+      <view class="module-header">
+        <view class="module-title-container">
+          <text class="module-title">杞﹁締绠$悊</text>
+        </view>
+      </view>
+      <view class="module-content">
+        <up-grid :border="false"
+                 col="4">
+          <up-grid-item v-for="(item, index) in vehicleItems"
+                        :key="index"
+                        @click="handleCommonItemClick(item)">
+            <view class="icon-container">
+              <image :src="item.icon"
+                     class="item-icon"></image>
+            </view>
+            <text class="item-label">{{item.label}}</text>
+          </up-grid-item>
+        </up-grid>
+      </view>
+    </view>
     <!-- 瀹夊叏鐢熶骇妯″潡 -->
     <view class="common-module collaboration-module"
           v-if="hasSafetyItems">
@@ -331,7 +354,6 @@
   import { userLoginFacotryList } from "@/api/login";
   import { getProductWorkOrderById } from "@/api/productionManagement/productionReporting";
   import DownloadProgressMask from "@/components/DownloadProgressMask.vue";
-  import { OA_WORKBENCH_ITEMS } from "@/config/oaWorkbench.js";
   import modal from "@/plugins/modal";
   import useUserStore from "@/store/modules/user";
 
@@ -377,6 +399,30 @@
     },
   ]);
 
+  // 椤圭洰绠$悊鍔熻兘鏁版嵁
+  const projectItems = reactive([
+    {
+      icon: "/static/images/icon/xiangmuguanli.svg",
+      label: "椤圭洰绠$悊",
+    },
+  ]);
+
+  // 杞﹁締绠$悊鍔熻兘鏁版嵁
+  const vehicleItems = reactive([
+    {
+      icon: "/static/images/icon/cheliangguanli.svg",
+      label: "杞﹁締绠$悊",
+    },
+    {
+      icon: "/static/images/icon/jiayoukaguanli.svg",
+      label: "鍔犳补鍗$鐞�",
+    },
+    {
+      icon: "/static/images/icon/jiayoujilu.svg",
+      label: "鍔犳补璁板綍",
+    },
+  ]);
+
   // 钀ラ攢绠$悊鍔熻兘鏁版嵁
   const marketingItems = reactive([
     {
@@ -394,6 +440,22 @@
     {
       icon: "/static/images/icon/kehuwanglai.svg",
       label: "瀹㈡埛寰�鏉�",
+    },
+    {
+      icon: "/static/images/icon/zhaotoubiaoguanli.svg",
+      label: "鎷涙姇鏍囩鐞�",
+    },
+    {
+      icon: "/static/images/icon/susongguanli.svg",
+      label: "璇夎绠$悊",
+    },
+    {
+      icon: "/static/images/icon/fahuotaizhang.svg",
+      label: "鍙戣揣鍙拌处",
+    },
+    {
+      icon: "/static/images/icon/hetongguanli.svg",
+      label: "閿�鍞悎鍚�",
     },
   ]);
 
@@ -510,6 +572,21 @@
       icon: "/static/images/icon/hetongguanli.svg",
       label: "鍚堝悓绠$悊",
     },
+    {
+      icon: "/static/images/icon/hetongguanli.svg",
+      label: "杞鐢宠",
+      path: "/pages/oa/HrManage/regular-apply/index",
+    },
+    {
+      icon: "/static/images/icon/renyuanxinzi.svg",
+      label: "璋冨姩鐢宠",
+      path: "/pages/oa/HrManage/transfer-apply/index",
+    },
+    {
+      icon: "/static/images/icon/gongchuguanli.svg",
+      label: "宸ヤ綔浜ゆ帴",
+      path: "/pages/oa/HrManage/work-handover/index",
+    },
   ]);
   const qualityItems = reactive([
     {
@@ -523,6 +600,10 @@
     {
       icon: "/static/images/icon/chuchangjianyan.svg",
       label: "鍑哄巶妫�楠�",
+    },
+    {
+      icon: "/static/images/icon/baobiaoguanli.svg",
+      label: "鎶ヨ〃绠$悊",
     },
   ]);
   const safetyItems = reactive([
@@ -559,17 +640,22 @@
       label: "瀹夊叏鍩硅鑰冩牳",
     },
   ]);
-  // OA鍔炲叕鍔熻兘鏁版嵁锛堢函鍓嶇閰嶇疆锛屼笉鍙備笌鍚庣鏉冮檺杩囨护锛�
-  const oaItems = reactive(
-    OA_WORKBENCH_ITEMS.map(item => ({ ...item }))
-  );
-
   // 鍗忓悓鍔炲叕鍔熻兘鏁版嵁
   const collaborationItems = reactive([
-    {
-      icon: "/static/images/icon/xietongshenpi.svg",
-      label: "鍗忓悓瀹℃壒",
-    },
+    // {
+    //   icon: "/static/images/icon/xietongshenpi.svg",
+    //   label: "鍗忓悓瀹℃壒",
+    // },
+		{
+			icon: "/static/images/icon/guizhangzhidu.svg",
+			label: "瀹℃壒绠$悊",
+			path: "/pages/oa/ApproveManage/approve-template/index",
+		},
+		{
+			icon: "/static/images/icon/xietongshenpi.svg",
+			label: "鍗忓悓瀹℃壒",
+			path: "/pages/oa/ApproveManage/approve-list/index",
+		},
     {
       icon: "/static/images/icon/huiyiguanli.svg",
       label: "浼氳绠$悊",
@@ -593,6 +679,34 @@
     {
       icon: "/static/images/icon/kehubaifang.svg",
       label: "瀹㈡埛鎷滆",
+    },
+    {
+      icon: "/static/images/icon/qingjiaguanli.svg",
+      label: "璇峰亣鐢宠",
+      path: "/pages/oa/AttendManage/leave-apply/index",
+    },
+    {
+      icon: "/static/images/icon/dakaqiandao.svg",
+      label: "鍔犵彮鐢宠",
+      path: "/pages/oa/AttendManage/overtime-apply/index",
+    },
+    {
+      icon: "/static/images/icon/chuchaiguanli.svg",
+      label: "宸梾鎶ラ攢",
+      path: "/pages/oa/ReimburseManage/travel-reimburse/index",
+    },
+    {
+      icon: "/static/images/icon/baoxiaoguanli.svg",
+      label: "璐圭敤鎶ラ攢",
+      path: "/pages/oa/ReimburseManage/cost-reimburse/index",
+    },
+    {
+      icon: "/static/images/icon/kuandaiyutongxin.svg",
+      label: "瀹藉甫涓庨�氫俊绠$悊",
+    },
+    {
+      icon: "/static/images/icon/fangwuzulin.svg",
+      label: "鎴垮眿绉熻祦绠$悊",
     },
   ]);
 
@@ -640,6 +754,10 @@
     // 	label: '璁惧鍙拌处',
     // },
     {
+      icon: "/static/images/icon/saomashebei.svg",
+      label: "鎵爜鏌ヨ澶�",
+    },
+    {
       icon: "/static/images/icon/yunxingguanli.svg",
       label: "杩愯绠$悊",
     },
@@ -656,6 +774,42 @@
       label: "璁惧宸℃",
     },
   ]);
+
+  // 鎵爜鏌ヨ澶囷細瑙f瀽 deviceId 鍚庤烦杞埌璁惧淇℃伅椤�
+  const getDeviceIdFromScan = scanResult => {
+    if (!scanResult) return null;
+    const match = scanResult.match(/deviceId=(\d+)/);
+    if (match && match[1]) return match[1];
+    if (/^\d+$/.test(scanResult.trim())) return scanResult.trim();
+    try {
+      const obj = JSON.parse(scanResult);
+      if (obj.deviceId) return String(obj.deviceId);
+    } catch (e) {
+      // 蹇界暐闈� JSON 鍐呭
+    }
+    return null;
+  };
+
+  const startScanDevice = () => {
+    uni.scanCode({
+      scanType: ["qrCode", "barCode"],
+      success: res => {
+        console.log("鎵爜缁撴灉:", res.result);
+        const deviceId = getDeviceIdFromScan(res.result);
+        if (!deviceId) {
+          uni.showToast({ title: "鏈瘑鍒埌璁惧ID", icon: "none" });
+          return;
+        }
+        uni.navigateTo({
+          url: `/pages/equipmentManagement/deviceInfo/index?deviceId=${deviceId}`,
+        });
+      },
+      fail: err => {
+        console.error("鎵爜澶辫触:", err);
+        uni.showToast({ title: "鎵爜澶辫触锛岃閲嶈瘯", icon: "none" });
+      },
+    });
+  };
 
   // 澶勭悊甯哥敤鍔熻兘鐐瑰嚮
   const handleCommonItemClick = item => {
@@ -703,6 +857,61 @@
       case "瀹㈡埛寰�鏉�":
         uni.navigateTo({
           url: "/pages/sales/receiptPaymentLedger/index",
+        });
+        break;
+      case "椤圭洰绠$悊":
+        uni.navigateTo({
+          url: "/pages/projectManagement/project/index",
+        });
+        break;
+      case "鎷涙姇鏍囩鐞�":
+        uni.navigateTo({
+          url: "/pages/sales/biddingManagement/index",
+        });
+        break;
+      case "璇夎绠$悊":
+        uni.navigateTo({
+          url: "/pages/sales/lawsuitManagement/index",
+        });
+        break;
+      case "鍙戣揣鍙拌处":
+        uni.navigateTo({
+          url: "/pages/sales/deliveryLedger/index",
+        });
+        break;
+      case "閿�鍞悎鍚�":
+        uni.navigateTo({
+          url: "/pages/sales/contractManagement/index",
+        });
+        break;
+      case "鎶ヨ〃绠$悊":
+        uni.navigateTo({
+          url: "/pages/qualityManagement/inspectionReport/index",
+        });
+        break;
+      case "杞﹁締绠$悊":
+        uni.navigateTo({
+          url: "/pages/inventoryManagement/vehicleInfo/index",
+        });
+        break;
+      case "鍔犳补鍗$鐞�":
+        uni.navigateTo({
+          url: "/pages/inventoryManagement/fuelCard/index",
+        });
+        break;
+      case "鍔犳补璁板綍":
+        uni.navigateTo({
+          url: "/pages/inventoryManagement/fuelRecord/index",
+        });
+        break;
+      case "瀹藉甫涓庨�氫俊绠$悊":
+        uni.navigateTo({
+          url: "/pages/cooperativeOffice/broadbandCommunication/index",
+        });
+        break;
+      case "鎴垮眿绉熻祦绠$悊":
+        uni.navigateTo({
+          url: "/pages/cooperativeOffice/houseLeaseManagement/index",
         });
         break;
       case "閲囪喘鍙拌处":
@@ -922,6 +1131,9 @@
         uni.navigateTo({
           url: "/pages/equipmentManagement/ledger/index",
         });
+        break;
+      case "鎵爜鏌ヨ澶�":
+        startScanDevice();
         break;
       case "杩愯绠$悊":
         uni.navigateTo({
@@ -1242,7 +1454,7 @@
 
     // 鏀堕泦鎵�鏈夋湁鏉冮檺鐨勮彍鍗曟爣棰橈紙鏍规嵁 meta.title锛�
     const allowedMenuTitles = new Set();
-    const alwaysShowTitles = new Set(["閲囪喘閫�璐у崟", "渚涘簲鍟嗙鐞�"]);
+    const alwaysShowTitles = new Set(["閲囪喘閫�璐у崟", "渚涘簲鍟嗙鐞�", "鎵爜鏌ヨ澶�"]);
     const collectMenuTitles = routes => {
       if (!Array.isArray(routes)) return;
       routes.forEach(route => {
@@ -1263,11 +1475,15 @@
         specialMapping: { 瑙勭珷鍒跺害: "瑙勭珷鍒跺害绠$悊" },
       },
       purchase: { specialMapping: { 渚涘簲鍟嗘。妗�: "渚涘簲鍟嗙鐞�" } },
+      // 鎵嬫満绔汉浜嬫ā鍧楀凡鍗犵敤銆屽悎鍚岀鐞嗐�峫abel锛堣蛋 /staff/staffContract锛夛紝
+      // 閿�鍞悎鍚屾敼鐢ㄣ�岄攢鍞悎鍚屻�峫abel锛屾澶勬槧灏勫洖鍚庣鐨勮彍鍗曟爣棰�
+      marketing: { specialMapping: { 閿�鍞悎鍚�: "鍚堝悓绠$悊" } },
     };
     console.log(allowedMenuTitles);
     // 閫氱敤杩囨护鍑芥暟
     const filterArray = (targetArray, specialMapping) => {
       const filtered = targetArray.filter(item => {
+        if (alwaysShowTitles.has(item.label)) return true;
         let matched = allowedMenuTitles.has(item.label);
         if (specialMapping && !matched && specialMapping[item.label]) {
           matched = allowedMenuTitles.has(specialMapping[item.label]);
@@ -1278,7 +1494,7 @@
     };
 
     // 杩囨护鍚勪釜妯″潡
-    filterArray(marketingItems);
+    filterArray(marketingItems, menuMapping.marketing.specialMapping);
     filterArray(designItems);
     filterArray(purchaseItems, menuMapping.purchase.specialMapping);
     filterArray(financeManagementItems);
@@ -1291,6 +1507,8 @@
     filterArray(equipmentItems);
     filterArray(archiveManagementItems);
     filterArray(afterSalesServiceItems);
+    filterArray(projectItems);
+    filterArray(vehicleItems);
   };
 
   // 妫�鏌ユā鍧楁槸鍚︽湁鑿滃崟椤归渶瑕佹樉绀�
@@ -1303,7 +1521,6 @@
   const hasAfterSalesServiceItems = computed(
     () => afterSalesServiceItems.length > 0
   );
-  const hasOaItems = computed(() => oaItems.length > 0);
   const hasCollaborationItems = computed(() => collaborationItems.length > 0);
   const hasSafetyItems = computed(() => safetyItems.length > 0);
   const hasQualityItems = computed(() => qualityItems.length > 0);
@@ -1316,6 +1533,8 @@
   const hasArchiveManagementItems = computed(
     () => archiveManagementItems.length > 0
   );
+  const hasProjectItems = computed(() => projectItems.length > 0);
+  const hasVehicleItems = computed(() => vehicleItems.length > 0);
 
   onMounted(() => {
     // 姣忔杩涘叆棣栭〉閮藉己鍒跺埛鏂扮敤鎴蜂俊鎭拰璺敱鏉冮檺锛屼笉鍋氭湰鍦扮紦瀛樺垽鏂�
@@ -1694,6 +1913,14 @@
     --module-color: #9c27b0;
   }
 
+  .project-module {
+    --module-color: #0066ff;
+  }
+
+  .vehicle-module {
+    --module-color: #ff8a3d;
+  }
+
   .module-header {
     margin-bottom: 10px;
     display: flex;
@@ -1940,6 +2167,14 @@
     --module-color: #9c27b0;
   }
 
+  .project-module {
+    --module-color: #0066ff;
+  }
+
+  .vehicle-module {
+    --module-color: #ff8a3d;
+  }
+
   .module-header {
     margin-bottom: 18px;
     padding-left: 18px;

--
Gitblit v1.9.3