From b54a94b098a5a0a3375bab0d6493bacf45dd0a58 Mon Sep 17 00:00:00 2001
From: 周宾 <2802492122@qq.com>
Date: 星期五, 26 十二月 2025 18:08:55 +0800
Subject: [PATCH] 天津双奇点-仓储物流增加产品名称搜索
---
src/pages/index.vue | 89 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 88 insertions(+), 1 deletions(-)
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 7964b47..c71cd5e 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -11,7 +11,7 @@
<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>
@@ -209,14 +209,17 @@
</up-grid>
</view>
</view>
+ <GoodsDetailPopup ref="refGoodsDetailPopup"></GoodsDetailPopup>
</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';
const userStore = useUserStore()
const factoryId = ref('');
@@ -259,6 +262,10 @@
{
icon: '/static/images/icon/huikuandengji@2x.png',
label: '搴撳瓨绠$悊',
+ },
+ {
+ icon: '/static/images/icon/huikuandengji@2x.png',
+ label: '浜у搧鎵爜',
}
]);
@@ -548,6 +555,19 @@
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 '浜у搧鎵爜':
+ scanQRCode()
+ break
default:
uni.showToast({
title: `鐐瑰嚮浜�${item.label}`,
@@ -602,6 +622,73 @@
});
}
+
+//寮�濮嬫壂鐮�
+const scanQRCode = ()=>{
+ uni.scanCode({
+ onlyFromCamera:true,
+ scanType:['barCode','qrCode'],
+ success(res) {
+ searchDetail(res.result||'')
+ },
+ fail(res) {
+ uni.showToast({
+ title: res.errMsg||'鎵爜澶辫触',
+ icon: 'none',
+ duration: 1500
+ })
+ }
+ })
+}
+
+//璋堟鐩稿叧
+const refGoodsDetailPopup = ref(null)
+
+
+//鏌ョ湅璇︽儏
+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||!resp.data)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