From 293d2dd8fe9119328e78ea9ddb364269ccf34a27 Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 29 Mar 2026 05:39:18 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=87=E6=8D=A2=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=A7=8D=E7=B1=BB=E6=97=B6=E9=87=8D=E6=96=B0=E6=8B=89=E5=8F=96?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=A7=8D=E7=B1=BB=E5=AE=A2=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/create.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/pages/order/create.vue b/src/pages/order/create.vue index 9fb97ff..f989e24 100644 --- a/src/pages/order/create.vue +++ b/src/pages/order/create.vue @@ -216,7 +216,7 @@ export default { } }, onLoad(options) { - this.loadCustomers() + this.loadCustomersByType() this.loadProducts() if (options.orderId) { this.editingOrderId = options.orderId @@ -302,8 +302,21 @@ export default { const idx = e.detail.value this.selectedType = this.typeOptions[idx].value this.selectedTypeLabel = this.typeOptions[idx].label - // 切换种类后清除已选客户 + // 切换种类后清除已选客户,重新拉取该种类的客户 this.selectedCustomer = null + this.loadCustomersByType() + }, + async loadCustomersByType() { + try { + const res = await customerApi.getCustomers({ + type: this.selectedType, + page: 1, + pageSize: 100 + }) + this.customers = res.records || [] + } catch (e) { + console.error(e) + } }, goToSelectProduct() { uni.navigateTo({ url: '/pages/product/select' })