From fe6ba6220f32276f147a16c41e7a69c2a18e5012 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 22 九月 2026 11:21:58 +0800
Subject: [PATCH] feat(inventory): 优化库存管理批量详情页面功能
---
src/views/basicData/tankInfo/index.vue | 48 ++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/src/views/basicData/tankInfo/index.vue b/src/views/basicData/tankInfo/index.vue
index a93d11e..5b15939 100644
--- a/src/views/basicData/tankInfo/index.vue
+++ b/src/views/basicData/tankInfo/index.vue
@@ -85,7 +85,7 @@
<el-table-column label="缃愬"
prop="capacity"
min-width="120" />
- <el-table-column label="搴撳瓨浣欓噺(m鲁)"
+ <el-table-column label="搴撳瓨浣欓噺"
prop="remaining"
min-width="140" />
<el-table-column label="鏄惁鍚敤"
@@ -205,7 +205,7 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="搴撳瓨浣欓噺(m鲁)锛�"
+ <el-form-item label="搴撳瓨浣欓噺锛�"
prop="remaining">
<el-input-number v-model="form.remaining"
:precision="2"
@@ -247,9 +247,16 @@
trigger: 'blur',
}
]">
- <el-input v-model="form.tenantInfo"
- placeholder="璇疯緭鍏ョ瀹俊鎭�"
- clearable />
+ <el-select v-model="form.tenantInfo"
+ placeholder="璇烽�夋嫨绉熷"
+ clearable
+ filterable
+ style="width: 100%">
+ <el-option v-for="item in tenantSelectOptions"
+ :key="item.id"
+ :label="item.customerName"
+ :value="item.customerName" />
+ </el-select>
</el-form-item>
</el-col>
</el-row>
@@ -261,7 +268,7 @@
<script setup>
import FormDialog from "@/components/Dialog/FormDialog.vue";
import pagination from "@/components/PIMTable/Pagination.vue";
- import { ref, reactive, toRefs, watch, getCurrentInstance } from "vue";
+ import { ref, reactive, toRefs, watch, computed, getCurrentInstance } from "vue";
import { Search } from "@element-plus/icons-vue";
import { ElMessageBox } from "element-plus";
import {
@@ -270,8 +277,10 @@
updateTankInfo,
delTankInfo,
} from "@/api/basicData/tankInfo.js";
+ import { listCustomer } from "@/api/basicData/customer.js";
const { proxy } = getCurrentInstance();
+ const { customer_type } = proxy.useDict("customer_type");
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
@@ -311,6 +320,33 @@
// 鐢ㄩ�旀枃妗堬細1 绉熻祦 / 2 鑷敤
const getUsageTypeText = value => ({ 1: "绉熻祦", 2: "鑷敤" })[value] || "--";
+ // 绉熷鍙兘浠庛�屼唬鍌ㄥ鎴枫�嶅垎绫婚噷閫夛紱瀛楀吀鐨� value 鏈繀灏辨槸涓枃鏍囩锛屾寜 label 鍙嶆煡鐪熷疄鍙栧��
+ const tenantOptions = ref([]);
+ let loadedTenantType = null;
+ const loadTenantOptions = () => {
+ const hit = (customer_type.value || []).find(
+ item => item.label === "浠e偍瀹㈡埛"
+ );
+ const customerType = hit ? hit.value : "浠e偍瀹㈡埛";
+ if (customerType === loadedTenantType) return;
+ loadedTenantType = customerType;
+ listCustomer({ current: -1, size: -1, customerType }).then(res => {
+ tenantOptions.value = res.data.records || [];
+ });
+ };
+ // 瀛楀吀寮傛鍒拌揪鍚庡啀鎷変竴娆★紱瀛楀吀鍛戒腑缂撳瓨鏃� immediate 杩欎竴娆″氨澶熶簡
+ watch(customer_type, loadTenantOptions, { immediate: true });
+
+ // 鍘嗗彶鏁版嵁鏄墜宸ュ~鐨勭瀹㈠悕锛屾湭蹇呰繕鍦ㄤ唬鍌ㄥ鎴峰垪琛ㄩ噷锛岃ˉ涓�涓复鏃堕�夐」淇濊瘉鍥炴樉
+ const tenantSelectOptions = computed(() => {
+ const list = tenantOptions.value;
+ const current = form.value.tenantInfo;
+ if (current && !list.some(item => item.customerName === current)) {
+ return [...list, { id: `legacy-${current}`, customerName: current }];
+ }
+ return list;
+ });
+
// 鏈惎鐢ㄦ椂鐢ㄩ�斾笌绉熷淇℃伅涓�寰嬫竻绌猴紱閫夎嚜鐢ㄦ椂绉熷淇℃伅鑷姩娓呯┖锛堢璧佹墠闇�瑕佺瀹級
watch(
() => [form.value.isEnabled, form.value.usageType],
--
Gitblit v1.9.3