From 13ad671b29b0b6b91cd8bdf6a8ebf746601743d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Sat, 23 May 2026 16:25:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(KLPService=E9=80=89=E6=8B=A9=E7=BB=84?= =?UTF-8?q?=E4=BB=B6):=20=E6=96=B0=E5=A2=9E=E5=88=86=E9=A1=B5=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8F=82=E6=95=B0=EF=BC=8C=E6=94=AF=E6=8C=81=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E5=8A=A0=E8=BD=BD=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 为CustomerSelect和OrderSelect组件新增pager参数,默认开启分页模式 2. 分页模式下保持每页10条的远程搜索逻辑,非分页模式下加载全量10000条数据 3. 调整OrderSelect组件的加载状态绑定方式,统一使用v-loading指令 4. 为OrderSelect新增mounted钩子,非分页模式下初始化加载全量订单数据 --- .../KLPService/CustomerSelect/index.vue | 8 +++-- .../KLPService/OrderSelect/index.vue | 30 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/klp-ui/src/components/KLPService/CustomerSelect/index.vue b/klp-ui/src/components/KLPService/CustomerSelect/index.vue index 0ce3c7c7..12d5bd76 100644 --- a/klp-ui/src/components/KLPService/CustomerSelect/index.vue +++ b/klp-ui/src/components/KLPService/CustomerSelect/index.vue @@ -1,5 +1,5 @@ @@ -21,6 +21,10 @@ style: { type: Object, default: () => ({}) + }, + pager: { + type: Boolean, + default: true } }, computed: { @@ -51,7 +55,7 @@ methods: { remoteSearchCustomer(query) { this.customerLoading = true; - listCustomer({ companyName: query, pageNum: 1, pageSize: 10 }).then(response => { + listCustomer({ companyName: query, pageNum: 1, pageSize: this.pager ? 10 : 10000 }).then(response => { this.customerList = response.rows; }).finally(() => { this.customerLoading = false; diff --git a/klp-ui/src/components/KLPService/OrderSelect/index.vue b/klp-ui/src/components/KLPService/OrderSelect/index.vue index 4d2068ef..efe07f99 100644 --- a/klp-ui/src/components/KLPService/OrderSelect/index.vue +++ b/klp-ui/src/components/KLPService/OrderSelect/index.vue @@ -2,11 +2,11 @@ { + this.options = res.rows.map(item => ({ + value: item.orderId, + label: item.orderCode + })) + }).catch(error => { + console.error('订单加载失败:', error) + }).finally(() => { + this.loading = false + }) + } + }, methods: { remoteMethod(query) { if (query !== '') { this.loading = true listPurchaseOrder({ pageNum: 1, - pageSize: 10, + pageSize: this.pager ? 10 : 10000, orderCode: query }).then(res => { this.loading = false