From a457da530cb40f4546daa54a1022329723ab03d0 Mon Sep 17 00:00:00 2001 From: zhongwenkai <3478244299@qq.com> Date: Fri, 26 Jun 2026 10:25:53 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=A8=A1=E5=85=B7=E5=8F=B0=E8=B4=A6?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=B8=8B=E6=8B=89=E6=A1=86=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/erp/productInfo.js | 5 +-- src/api/mes/product.js | 5 +-- src/pages_function/pages/moldLedger/index.vue | 34 +++++++------------ 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/api/erp/productInfo.js b/src/api/erp/productInfo.js index 78f98c2..676c747 100644 --- a/src/api/erp/productInfo.js +++ b/src/api/erp/productInfo.js @@ -16,10 +16,11 @@ export function getProductSimpleList(params) { }) } -export function getMesProductSimpleList() { +export function getMesProductSimpleList(params) { return request({ url: '/admin-api/erp/product/simple-list-product', - method: 'get' + method: 'get', + params }) } diff --git a/src/api/mes/product.js b/src/api/mes/product.js index 0c3e040..fd070c2 100644 --- a/src/api/mes/product.js +++ b/src/api/mes/product.js @@ -25,9 +25,10 @@ export function getItemList() { } // 产品简单列表(用于下拉选择) -export function getMesProductSimpleList() { +export function getMesProductSimpleList(params) { return request({ url: '/admin-api/erp/product/simple-list-product', - method: 'get' + method: 'get', + params }) } diff --git a/src/pages_function/pages/moldLedger/index.vue b/src/pages_function/pages/moldLedger/index.vue index 69584af..96e7fa1 100644 --- a/src/pages_function/pages/moldLedger/index.vue +++ b/src/pages_function/pages/moldLedger/index.vue @@ -94,18 +94,18 @@ {{ t('moldLedger.productModel') }} - {{ selectedProductLabel }} + {{ selectedProductLabel }} {{ item.name }} - + @@ -163,7 +163,7 @@ const searchKeyword = ref('') const selectedStatus = ref('') const productOptions = ref([]) const deviceOptions = ref([]) -const selectedProductIds = ref([]) +const selectedProductId = ref(null) const selectedCurrentDevice = ref('') // 面板开关 const productPanelOpen = ref(false) @@ -196,11 +196,9 @@ const selectedStatusLabel = computed(() => { }) const selectedProductLabel = computed(() => { - if (selectedProductIds.value.length === 0) return t('moldLedger.productModel') - const names = productOptions.value - .filter((p) => selectedProductIds.value.includes(p.id)) - .map((p) => p.name) - return names.join(', ') || t('moldLedger.productModel') + if (selectedProductId.value == null) return t('moldLedger.productModel') + const found = productOptions.value.find((p) => p.id === selectedProductId.value) + return found ? found.name : t('moldLedger.productModel') }) const selectedDeviceLabel = computed(() => { @@ -225,7 +223,7 @@ onReady(() => { async function fetchProductOptions() { try { - const res = await getMesProductSimpleList() + const res = await getMesProductSimpleList({ type: '1', categoryType: '1' }) const root = res && res.data !== undefined ? res.data : res productOptions.value = Array.isArray(root) ? root : (root?.data || []) } catch { productOptions.value = [] } @@ -261,12 +259,8 @@ function toggleDevicePanel() { } function selectProduct(item) { - const idx = selectedProductIds.value.indexOf(item.id) - if (idx >= 0) { - selectedProductIds.value.splice(idx, 1) - } else { - selectedProductIds.value.push(item.id) - } + selectedProductId.value = selectedProductId.value === item.id ? null : item.id + productPanelOpen.value = false } function selectDevice(item) { @@ -282,7 +276,7 @@ function confirmFilterDrawer() { async function resetFilters() { searchKeyword.value = '' selectedStatus.value = '' - selectedProductIds.value = [] + selectedProductId.value = null selectedCurrentDevice.value = '' await fetchList(true) } @@ -315,10 +309,7 @@ async function fetchList(reset) { code: keyword || undefined, name: keyword || undefined, status: selectedStatus.value, - productIds: selectedProductIds.value.length ? selectedProductIds.value : undefined, - productName: selectedProductIds.value.length - ? productOptions.value.filter((p) => selectedProductIds.value.includes(p.id)).map((p) => p.name).join(',') - : undefined, + productId: selectedProductId.value != null ? selectedProductId.value : undefined, currentDevice: selectedCurrentDevice.value || undefined }) const page = normalizePageData(res) @@ -522,6 +513,7 @@ function formatDateTime(value) { .content-scroll { width: 100%; + height: calc(100vh - var(--status-bar-height) - 88rpx - 188rpx); } .list-wrap {