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 | 205 +++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 175 insertions(+), 30 deletions(-)
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 01ad4f4..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>
@@ -31,7 +31,35 @@
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
-
+ <!-- 浠撳偍鐗╂祦妯″潡 -->
+ <view class="common-module marketing-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 warehousingLogisticsItems"
+ :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 marketing-module">
<view class="module-header">
@@ -123,34 +151,34 @@
</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 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">
@@ -181,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('');
@@ -213,6 +244,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 +545,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 '浜у搧鎵爜':
+ scanQRCode()
+ break
default:
uni.showToast({
title: `鐐瑰嚮浜�${item.label}`,
@@ -544,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