From bbc93d7a5c22bf006502f2515e2200cdfe8f6a62 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 12 一月 2026 19:03:03 +0800
Subject: [PATCH] 双奇点app: 1.扫码改成可连续扫码,加一个导出excel功能

---
 src/pages/index.vue |  290 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 149 insertions(+), 141 deletions(-)

diff --git a/src/pages/index.vue b/src/pages/index.vue
index 9bd3452..514c546 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -11,32 +11,16 @@
 		<view class="hero-section">
 			<view class="bg-img">
 				<view class="hero-content">
-					<text class="hero-title">娑︽嘲鐢熺墿绉戞妧</text>
+					<text class="hero-title">澶╂触鍙屽鐐�</text>
 				</view>
 				<view class="hero-wave"></view>
 			</view>
 		</view>
-		
-		<!--		<view class="notice-section">-->
-		<!--			<view class="notice">-->
-		<!--				<view class="notice-content">-->
-		<!--					<view class="notice-left">-->
-		<!--						<text class="notice-status">閫氱煡</text>-->
-		<!--					</view>-->
-		<!--					<view class="notice-separator"></view>-->
-		<!--					<view class="notice-right">-->
-		<!--						<text class="notice-label">{{currentStatus}}</text>-->
-		<!--						<text class="notice-text">褰撴棩閿�鍞澶囨暟:<text class="notice-number">{{number}}<text class="notice-unit">涓�</text></text></text>-->
-		<!--					</view>-->
-		<!--				</view>-->
-		<!--			</view>-->
-		<!--		</view>-->
-		
-		<!-- 钀ラ攢绠$悊妯″潡 -->
+		<!-- 浠撳偍鐗╂祦妯″潡 -->
 		<view class="common-module marketing-module">
 			<view class="module-header">
 				<view class="module-title-container">
-					<text class="module-title">钀ラ攢绠$悊</text>
+					<text class="module-title">浠撳偍鐗╂祦</text>
 				</view>
 			</view>
 			<view class="module-content">
@@ -45,7 +29,7 @@
 					col="4"
 				>
 					<up-grid-item
-						v-for="(item, index) in marketingItems"
+						v-for="(item, index) in warehousingLogisticsItems"
 						:key="index"
 						@click="handleCommonItemClick(item)"
 					>
@@ -61,134 +45,19 @@
 				</up-grid>
 			</view>
 		</view>
-		
-		<!-- 閲囪喘绠$悊妯″潡 -->
-		<view class="common-module purchase-module">
-			<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 purchaseItems"
-						:key="index"
-						@click="handleCommonItemClick(item)"
-					>
-						<view class="icon-container" :style="{ background: item.bgColor }">
-							<up-icon
-								:name="item.icon"
-								:size="58"
-								color="#ffffff"
-							></up-icon>
-						</view>
-						<text class="item-label">{{item.label}}</text>
-					</up-grid-item>
-				</up-grid>
-			</view>
-		</view>
-		
-		<!-- 鍗忓悓鍔炲叕妯″潡 -->
-		<view class="common-module collaboration-module">
-			<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 collaborationItems"
-						:key="index"
-						@click="handleCommonItemClick(item)"
-					>
-						<view class="icon-container" :style="{ background: item.bgColor }">
-							<up-icon
-								:name="item.icon"
-								:size="58"
-								color="#ffffff"
-							></up-icon>
-						</view>
-						<text class="item-label">{{item.label}}</text>
-					</up-grid-item>
-				</up-grid>
-			</view>
-		</view>
-		
-		<!-- 鐢熶骇绠℃帶妯″潡 -->
-<!--		<view class="common-module production-module">-->
-<!--			<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 productionItems"-->
-<!--						:key="index"-->
-<!--						@click="handleCommonItemClick(item)"-->
-<!--					>-->
-<!--						<view class="icon-container" :style="{ background: item.bgColor }">-->
-<!--							<up-icon-->
-<!--								:name="item.icon"-->
-<!--								:size="58"-->
-<!--								color="#ffffff"-->
-<!--							></up-icon>-->
-<!--						</view>-->
-<!--						<text class="item-label">{{item.label}}</text>-->
-<!--					</up-grid-item>-->
-<!--				</up-grid>-->
-<!--			</view>-->
-<!--		</view>-->
-		
-		<!-- 璁惧绠$悊妯″潡 -->
-		<view class="common-module equipment-module">
-			<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 equipmentItems"
-						:key="index"
-						@click="handleCommonItemClick(item)"
-					>
-						<view class="icon-container" :style="{ background: item.bgColor }">
-							<up-icon
-								:name="item.icon"
-								:size="58"
-								color="#ffffff"
-							></up-icon>
-						</view>
-						<text class="item-label">{{item.label}}</text>
-					</up-grid-item>
-				</up-grid>
-			</view>
-		</view>
+		<GoodsDetailPopup ref="refGoodsDetailPopup"></GoodsDetailPopup>
+		<ScanListPopup ref="refScanListPopup"></ScanListPopup>
 	</view>
 </template>
 
 <script setup>
 import {ref, onMounted, nextTick, reactive} from 'vue';
 import {userLoginFacotryList} from "@/api/login";
+import { stockinDetail, detailManagementByCustom } from '@/api/inventoryManagement/receiptManagement'
 import modal from "@/plugins/modal";
 import useUserStore from "@/store/modules/user";
+import GoodsDetailPopup from './components/GoodsDetailPopup.vue';
+import ScanListPopup from './components/ScanListPopup.vue';
 
 const userStore = useUserStore()
 const factoryId = ref('');
@@ -213,6 +82,30 @@
 		currentStatus.value = statusList[statusIndex]
 	}, 3000)
 }
+
+//浠撳偍鐗╂祦鍔熻兘鏁版嵁
+const warehousingLogisticsItems = reactive([
+	{
+		icon: '/static/images/icon/xiaoshoutaizhang@2x.png',
+		label: '鍏ュ簱绠$悊',
+	},
+	{
+		icon: '/static/images/icon/kaipiaodengji@2x.png',
+		label: '鍑哄簱绠$悊',
+	},
+	{
+		icon: '/static/images/icon/kaipiaotaizhang@2x.png',
+		label: '鍑哄簱鍙拌处',
+	},
+	{
+		icon: '/static/images/icon/huikuandengji@2x.png',
+		label: '搴撳瓨绠$悊',
+	},
+	{
+		icon: '/static/images/icon/huikuandengji@2x.png',
+		label: '浜у搧鎵爜',
+	}
+]);
 
 // 钀ラ攢绠$悊鍔熻兘鏁版嵁
 const marketingItems = reactive([
@@ -490,6 +383,29 @@
 				url: '/pages/equipmentManagement/verification/index'
 			});
 			break;
+		case '鍏ュ簱绠$悊':
+			uni.navigateTo({
+				url: '/pages/inventoryManagement/receiptManagement/index'
+			});
+			break
+		case '鍑哄簱绠$悊':
+			uni.navigateTo({
+				url: '/pages/inventoryManagement/issueManagement/index'
+			});
+			break
+		case '鍑哄簱鍙拌处':
+			uni.navigateTo({
+				url: '/pages/inventoryManagement/dispatchLog/index'
+			});
+			break
+		case '搴撳瓨绠$悊':
+			uni.navigateTo({
+				url: '/pages/inventoryManagement/stockManagement/index'
+			});
+			break
+		case '浜у搧鎵爜':
+			openScanListPopup()
+			break
 		default:
 			uni.showToast({
 				title: `鐐瑰嚮浜�${item.label}`,
@@ -524,7 +440,7 @@
 	show.value = false;
 	const factoryId = factoryListTem.value[arr.indexs[0]].deptId
 	const loginForm = {
-		username: userStore.name,
+		userName: userStore.name,
 		password: uni.getStorageSync('remembered_password'),
 		factoryId: factoryId,
 	}
@@ -544,6 +460,98 @@
 	});
 }
 
+
+//寮�濮嬫壂鐮�
+const scanQRCode = ()=>{
+	uni.scanCode({
+		onlyFromCamera:true,
+		scanType:['barCode','qrCode'],
+		success(res) {
+			console.log(res)
+			searchDetail(res.result||'')
+		},
+		fail(res) {
+			uni.showToast({
+				title: '鍙栨秷鎵爜',
+				icon: 'none',
+				duration: 1500
+			})
+		}
+	})
+}
+
+//璋堟鐩稿叧
+const refGoodsDetailPopup = ref(null)
+const refScanListPopup = ref(null)
+
+//鎵撳紑鎵爜鍒楄〃寮圭獥
+const openScanListPopup = () => {
+	if (refScanListPopup.value) {
+		refScanListPopup.value.open()
+	}
+}
+
+
+//鏌ョ湅璇︽儏
+const searchDetail = (barcode)=>{
+	if(!barcode||barcode.indexOf(',')==-1){
+		uni.showToast({
+			title:"璇锋壂鎻忔纭殑浜岀淮鐮�",
+			icon: 'none',
+			duration: 1500
+		})
+		return
+	}
+	let barcodeList = barcode.split(",")
+	let barcodeId = barcodeList[0]
+	let type = barcodeList[1]
+	let detailApi = null
+	if(type==1){
+		detailApi = stockinDetail
+	}else if(type==2){
+		detailApi = detailManagementByCustom
+	}
+	
+	if(!detailApi){
+		uni.showToast({
+			title:"璇锋壂鎻忔纭殑浜岀淮鐮�",
+			icon: 'none',
+			duration: 1500
+		})
+		return
+	}
+	detailApi({id:barcodeId}).then((resp) => {
+
+		if(resp.code!=200){
+			uni.showToast({
+				title:resp.msg,
+				icon:"none",
+				duration: 1500
+			})
+			return
+		}
+		if(!resp.data){
+			uni.showToast({
+				title:'鍟嗗搧涓嶅瓨鍦�',
+				icon:"none",
+				duration: 1500
+			})
+			return
+		}
+		// barcodeDetail.value = resp.data
+		refGoodsDetailPopup.value.open({
+			type: type,
+			...resp.data
+		})
+	}).catch(() => {
+		uni.showToast({
+			title: "鑾峰彇鏁版嵁澶辫触",
+			icon: 'none',
+			duration: 1500
+		});
+	})
+}
+
 // 瀹氫箟鏂规硶
 const click = (name) => {
 	if (uToastRef.value) {

--
Gitblit v1.9.3