From b54a94b098a5a0a3375bab0d6493bacf45dd0a58 Mon Sep 17 00:00:00 2001
From: 周宾 <2802492122@qq.com>
Date: 星期五, 26 十二月 2025 18:08:55 +0800
Subject: [PATCH] 天津双奇点-仓储物流增加产品名称搜索

---
 src/pages/components/GoodsDetailPopup.vue |  290 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 290 insertions(+), 0 deletions(-)

diff --git a/src/pages/components/GoodsDetailPopup.vue b/src/pages/components/GoodsDetailPopup.vue
new file mode 100644
index 0000000..06eb850
--- /dev/null
+++ b/src/pages/components/GoodsDetailPopup.vue
@@ -0,0 +1,290 @@
+<template>
+    <uni-popup
+        ref="popupRef"
+        type="center" 
+        :round="20"
+        @close="handleClose"
+        @open="handleOpen"
+    >
+        <view class="dispatch-modal">
+            <!-- 澶撮儴 -->
+            <view class="modal-header">
+                <text class="modal-title">浜у搧璇︽儏</text>
+                <view class="close-btn" @click="handleClose">
+                    <up-icon name="close" size="20" color="#999"></up-icon>
+                </view>
+            </view>
+            
+            <!-- 琛ㄥ崟鍐呭 -->
+            <view class="modal-content">
+                <up-form 
+                    :model="detailData" 
+                    ref="formRef"
+                    :rules="rules"
+                    labelWidth="120"
+                >
+                    <!-- 椤圭洰鍩烘湰淇℃伅 -->
+                    <view class="form-section">
+                        <text class="section-title">浜у搧淇℃伅</text>
+                        <up-form-item v-if="detailType == 2" label="浜у搧鍥剧墖" prop="url">
+                            <image :src="baseUrl+detailData.url" class="detail-img"></image>
+                        </up-form-item>
+                        <up-form-item label="浜у搧鍚嶇О" prop="productCategory">
+                            <up-input 
+                                v-model="detailData.productCategory" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                        <up-form-item label="浜у搧楂樺害" prop="specificationModel">
+                            <up-input 
+                                v-model="detailData.specificationModelUnit" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                        <up-form-item label="鍗曚环锛堝厓锛�/浠�" prop="taxInclusiveUnitPrice">
+                            <up-input 
+                                v-model="detailData.taxInclusiveUnitPrice" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                        <up-form-item label="鍗曚环锛堢編鍏冿級/浠�" prop="dollarPrice">
+                            <up-input 
+                                v-model="detailData.dollarPrice" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                    </view>
+                    
+                    <!-- 鏁伴噺淇℃伅 -->
+                    <view class="form-section">
+                        <text class="section-title">鏁伴噺淇℃伅</text>
+                        <up-form-item label="鍏ュ簱鏁伴噺/浠�" prop="inboundNum">
+                            <up-input 
+                                v-model="detailData.inboundNum" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                        <!-- <up-form-item label="鍑哄簱鏁伴噺/浠�" prop="totalInboundNum">
+                            <up-input 
+                                v-model="detailData.totalInboundNum" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                        <up-form-item label="搴撳瓨鏁伴噺/浠�" prop="inboundNum0" required>
+                             <up-input 
+                                v-model="detailData.inboundNum0" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item> -->
+                        <up-form-item label="姣忎欢鏁伴噺/鏀�" prop="boxNum" required>
+                             <up-input 
+                                v-model="detailData.boxNum" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                    </view>
+                    <!-- 鍏朵粬淇℃伅 -->
+                    <view class="form-section">
+                        <text class="section-title">鍏朵粬淇℃伅</text>
+                        <up-form-item label="绾哥瑙勬牸" prop="cartonSpecifications">
+                            <up-input 
+                                v-model="detailData.cartonSpecifications" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                        <up-form-item label="鍏ュ簱浜�" prop="createBy">
+                            <up-input 
+                                v-model="detailData.createBy" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                        <up-form-item label="鍏ュ簱鏃堕棿" prop="inboundDate">
+                            <up-input 
+                                v-model="detailData.inboundDate" 
+                                disabled 
+                                placeholder=""
+                            />
+                        </up-form-item>
+                    </view>
+                    
+                </up-form>
+            </view>
+        </view>
+    </uni-popup>
+</template>
+ 
+<script setup>
+import { ref, reactive } from 'vue';
+import config from '@/config'
+const baseUrl = config.imgUrl
+const emit = defineEmits(['confirm']);
+ 
+// 寮圭獥鏄剧ず鐘舵��
+const popupRef = ref();
+
+// 琛ㄥ崟鏁版嵁
+const detailData = reactive({});
+ 
+// 琛ㄥ崟楠岃瘉瑙勫垯
+const rules = reactive({});
+ 
+const detailType = ref(0)
+// 鎵撳紑寮圭獥
+const open = async (rowData) => {
+    try {
+        // 濉厖琛ㄥ崟鏁版嵁
+        Object.assign(detailData, {
+            ...rowData,
+            specificationModelUnit: rowData.specificationModel + rowData.unit,
+            totalInboundNum: rowData.totalInboundNum||0
+        });
+        popupRef.value.open()
+        detailType.value = rowData.type
+    } catch (error) {
+        console.log(error)
+        uni.showToast({
+            title: '鍔犺浇鐢ㄦ埛鍒楄〃澶辫触',
+            icon: 'error'
+        });
+    }
+};
+
+ 
+// 寮圭獥鎵撳紑浜嬩欢
+const handleOpen = () => {
+    // 寮圭獥鎵撳紑鏃剁殑澶勭悊
+};
+ 
+// 鍏抽棴寮圭獥
+const handleClose = () => {
+    popupRef.value.close()
+    // 閲嶇疆琛ㄥ崟
+    for (const key in detailData) {
+        detailData[key] = undefined;
+    }
+};
+ 
+// 鏆撮湶鏂规硶
+defineExpose({
+    open
+});
+</script>
+ 
+<style scoped lang="scss">
+.dispatch-modal {
+    background: #ffffff;
+    border-radius: 20px;
+    max-height: 80vh;
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
+    box-sizing: border-box;
+    padding-bottom: 20rpx;
+}
+ 
+.modal-header {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 20px 20px 0 20px;
+    border-bottom: 1px solid #f0f0f0;
+    padding-bottom: 16px;
+    margin-bottom: 20px;
+}
+ 
+.modal-title {
+    font-size: 18px;
+    font-weight: 600;
+    color: #333;
+}
+ 
+.close-btn {
+    padding: 4px;
+    
+    &:active {
+        opacity: 0.7;
+    }
+}
+ 
+.modal-content {
+    flex: 1;
+    padding: 0 20px;
+    overflow-y: auto;
+    .datetime-picker-value{
+        font-size: 14px;
+        border: 1px solid #e5e5e5;
+        box-sizing: border-box;
+        border-radius: 4px;
+        padding: 0 5px;
+        padding-left: 10px;
+        position: relative;
+        display: flex;
+        -webkit-user-select: none;
+        -moz-user-select: none;
+        user-select: none;
+        flex-direction: row;
+        align-items: center;
+        width: 100%;
+        flex: 1;
+        height: 35px;
+    }
+}
+ 
+.form-section {
+    margin-bottom: 24px;
+}
+ 
+.section-title {
+    display: block;
+    font-size: 16px;
+    font-weight: 600;
+    color: #333;
+    margin-bottom: 16px;
+    padding-left: 8px;
+    border-left: 3px solid #2979ff;
+}
+ 
+.modal-footer {
+    display: flex;
+    gap: 12px;
+    padding: 20px;
+    border-top: 1px solid #f0f0f0;
+    background: #fafafa;
+}
+.detail-img {
+    width: 200rpx;
+    height: 200rpx;
+    border-radius: 8rpx;
+    background-color: #f5f5f5;
+}
+ 
+// uView 缁勪欢鏍峰紡璋冩暣
+:deep(.up-form-item) {
+    margin-bottom: 20px;
+}
+ 
+:deep(.up-input) {
+    background: #f8f9fa;
+    border-radius: 8px;
+}
+ 
+:deep(.up-input--disabled) {
+    background: #f0f0f0;
+    color: #999;
+}
+ 
+:deep(.up-number-box) {
+    background: #f8f9fa;
+    border-radius: 8px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3