From d53d9ce404fb0b53c2c6ac0841f121c7bac0eff4 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 31 三月 2026 09:16:29 +0800
Subject: [PATCH] fix: 仓储管理添加批号
---
src/views/inventoryManagement/stockManagement/New.vue | 64 +++++++++++++++++++++++++++++++-
1 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/src/views/inventoryManagement/stockManagement/New.vue b/src/views/inventoryManagement/stockManagement/New.vue
index 1f86fd6..913c3fd 100644
--- a/src/views/inventoryManagement/stockManagement/New.vue
+++ b/src/views/inventoryManagement/stockManagement/New.vue
@@ -37,6 +37,35 @@
<el-input v-model="formState.unit" disabled />
</el-form-item>
+ <el-form-item label="鎵瑰彿" prop="batchNo" :rules="[{ required: true, message: '璇疯緭鍏ユ壒鍙�', trigger: 'blur' }]">
+ <el-input v-model="formState.batchNo" placeholder="璇疯緭鍏ユ壒鍙�" clearable />
+ </el-form-item>
+
+ <el-form-item
+ label="渚涘簲鍟�"
+ prop="customer"
+ :rules="[{ required: true, message: '璇烽�夋嫨渚涘簲鍟�', trigger: 'change' }]"
+ >
+ <el-select
+ v-model="formState.customer"
+ placeholder="璇烽�夋嫨渚涘簲鍟�"
+ filterable
+ clearable
+ allow-create
+ :reserve-keyword="true"
+ :default-first-option="false"
+ >
+ <el-option
+ v-for="item in supplierList"
+ :key="item.id"
+ :label="item.supplierName"
+ :value="item.supplierName"
+ >
+ {{ item.supplierName}}
+ </el-option>
+ </el-select>
+ </el-form-item>
+
<el-form-item
label="搴撳瓨鏁伴噺"
prop="qualitity"
@@ -74,10 +103,11 @@
</template>
<script setup>
-import {ref, computed, getCurrentInstance} from "vue";
+import {ref, computed, getCurrentInstance, watch} from "vue";
import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
import {createStockInventory} from "@/api/inventoryManagement/stockInventory.js";
import {createStockUnInventory} from "@/api/inventoryManagement/stockUninventory.js";
+import {getOptions as getSupplierOptions} from "@/api/procurementManagement/procurementLedger.js";
const props = defineProps({
visible: {
@@ -101,6 +131,8 @@
productName: "",
productModelName: "",
unit: "",
+ batchNo: "",
+ customer: "",
qualitity: 0,
warnNum: 0,
remark: '',
@@ -126,11 +158,39 @@
productModelId: undefined,
productName: "",
productModelName: "",
- description: '',
+ unit: "",
+ batchNo: "",
+ customer: "",
+ qualitity: 0,
+ warnNum: 0,
+ remark: '',
};
isShow.value = false;
};
+const supplierList = ref([]);
+
+const loadSuppliers = async () => {
+ try {
+ const res = await getSupplierOptions();
+ // 澶嶇敤閲囪喘鍙拌处绛涢�夐�昏緫锛歩sWhite=0 鐨勪緵搴斿晢
+ supplierList.value = (res?.data || []).filter(item => item.isWhite === 0);
+ } catch (e) {
+ console.error("鑾峰彇渚涘簲鍟嗗垪琛ㄥけ璐�:", e);
+ supplierList.value = [];
+ }
+};
+
+watch(
+ () => props.visible,
+ (val) => {
+ if (val) {
+ loadSuppliers();
+ }
+ },
+ { immediate: true }
+);
+
// 浜у搧閫夋嫨澶勭悊
const handleProductSelect = async (products) => {
if (products && products.length > 0) {
--
Gitblit v1.9.3