From a8d694d5d987892afee5a1bb8f6c01d612e6b2a3 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 14 五月 2026 11:23:23 +0800
Subject: [PATCH] 浪潮 1.入库管理、出库管理添加库位相关字段和逻辑

---
 src/views/inventoryManagement/stockManagement/New.vue |   65 ++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/src/views/inventoryManagement/stockManagement/New.vue b/src/views/inventoryManagement/stockManagement/New.vue
index 2addb95..5a22acd 100644
--- a/src/views/inventoryManagement/stockManagement/New.vue
+++ b/src/views/inventoryManagement/stockManagement/New.vue
@@ -32,6 +32,37 @@
           <el-input v-model="formState.unit"
                     disabled />
         </el-form-item>
+        <el-form-item label="搴撲綅"
+                      prop="warehouseId"
+                      :rules="[
+                {
+                required: true,
+                message: '璇烽�夋嫨搴撲綅',
+                trigger: 'change',
+              }
+            ]">
+          <el-select v-model="formState.warehouseId"
+                     placeholder="璇烽�夋嫨搴撲綅"
+                     clearable
+                     style="width: 100%">
+            <el-option v-for="warehouse in warehouseList"
+                       :key="warehouse.id"
+                       :label="warehouse.warehouseName + ' - ' + warehouse.location"
+                       :value="warehouse.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鎵瑰彿"
+                      prop="batchNo">
+          <el-input v-model="formState.batchNo"
+                    placeholder="璇疯緭鍏ユ壒鍙�" />
+        </el-form-item>
+        <el-form-item label="搴撳瓨鏁伴噺"
+                      prop="qualitity">
+          <el-input-number v-model="formState.qualitity"
+                           :step="1"
+                           :min="1"
+                           style="width: 100%" />
+        </el-form-item>
         <el-form-item label="搴撳瓨绫诲瀷"
                       prop="type"
                       :rules="[
@@ -48,18 +79,6 @@
             <el-option label="涓嶅悎鏍煎簱瀛�"
                        value="unqualified" />
           </el-select>
-        </el-form-item>
-        <el-form-item label="搴撳瓨鏁伴噺"
-                      prop="qualitity">
-          <el-input-number v-model="formState.qualitity"
-                           :step="1"
-                           :min="1"
-                           style="width: 100%" />
-        </el-form-item>
-        <el-form-item label="鎵瑰彿"
-                      prop="batchNo">
-          <el-input v-model="formState.batchNo"
-                    placeholder="璇疯緭鍏ユ壒鍙�" />
         </el-form-item>
         <el-form-item v-if="formState.type === 'qualified'"
                       label="搴撳瓨棰勮鏁伴噺"
@@ -93,10 +112,11 @@
 </template>
 
 <script setup>
-  import { ref, computed, watch, getCurrentInstance } from "vue";
+  import { ref, computed, watch, getCurrentInstance, onMounted } from "vue";
   import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
   import { addStockInRecordOnly } from "@/api/inventoryManagement/stockInventory.js";
   import { createStockUnInventory } from "@/api/inventoryManagement/stockUninventory.js";
+  import { getWarehouseList } from "@/api/inventoryManagement/warehouse.js";
 
   const props = defineProps({
     visible: {
@@ -119,12 +139,16 @@
     productName: "",
     productModelName: "",
     unit: "",
+    warehouseId: undefined,
     type: undefined,
     qualitity: 0,
     batchNo: null,
     warnNum: 0,
     remark: "",
   });
+
+  // 浠撳簱鍒楄〃
+  const warehouseList = ref([]);
 
   const isShow = computed({
     get() {
@@ -136,6 +160,15 @@
   });
 
   const showProductSelectDialog = ref(false);
+
+  // 鑾峰彇浠撳簱鍒楄〃
+  const fetchWarehouseList = () => {
+    getWarehouseList({ status: true }).then(res => {
+      warehouseList.value = res.data || [];
+    }).catch(() => {
+      proxy.$modal.msgError("鑾峰彇浠撳簱鍒楄〃澶辫触");
+    });
+  };
 
   // 鎵瑰彿涓虹┖鏃惰浆涓� null
   watch(
@@ -157,6 +190,7 @@
       productName: "",
       productModelName: "",
       unit: "",
+      warehouseId: undefined,
       type: undefined,
       qualitity: 0,
       batchNo: null,
@@ -215,6 +249,11 @@
     });
   };
 
+  // 缁勪欢鎸傝浇鏃跺姞杞戒粨搴撳垪琛�
+  onMounted(() => {
+    fetchWarehouseList();
+  });
+
   defineExpose({
     closeModal,
     handleSubmit,

--
Gitblit v1.9.3