From 9d8aa29beeb5d681fb48d92b9ede88128651e429 Mon Sep 17 00:00:00 2001
From: 周宾 <2802492122@qq.com>
Date: 星期一, 29 十二月 2025 15:57:14 +0800
Subject: [PATCH] 天津双奇点-新增台账增加商品id字段,修复切换公司失败
---
src/pages/index.vue | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 164 insertions(+), 3 deletions(-)
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 617ce21..c2d8002 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">
@@ -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}`,
@@ -524,7 +602,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 +622,89 @@
});
}
+
+//寮�濮嬫壂鐮�
+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){
+ 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