From ae4d69edb9f29996eaa6104b48e4328f05d2e84b Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Fri, 19 Dec 2025 00:04:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(export):=20=E4=BF=AE=E5=A4=8D=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=88=9B=E5=BB=BA=E8=80=85=E9=80=89=E6=8B=A9=E4=B8=BA?= =?UTF-8?q?=E5=8D=95=E9=80=89=E7=9A=84=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将订单数据创建者选择从多选改为单选 - 修改关联分销商加载逻辑,支持单个创建者ID查询 - 更新计算属性hasCreators以适应单选字段 - 调整导出筛选条件构建中创建者ID的处理 - 添加监听导出表单中的creatorId变化,重置相关筛选条件并重新加载分销商列表 --- web/index.html | 2 +- web/main.js | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/web/index.html b/web/index.html index f45113c..eb3c54d 100644 --- a/web/index.html +++ b/web/index.html @@ -271,7 +271,7 @@ - + diff --git a/web/main.js b/web/main.js index e289487..5159c77 100644 --- a/web/main.js +++ b/web/main.js @@ -295,13 +295,13 @@ const app = createApp({ * 加载分销商列表 */ const loadResellers = async () => { - const ids = state.exportForm.creatorIds; - if (!ids?.length) { + const id = state.exportForm.creatorId; + if (!id) { resellerOptions.value = []; return; } try { - resellerOptions.value = await Api.fetchResellers(ids); + resellerOptions.value = await Api.fetchResellers([id]); } catch (error) { console.error('加载分销商列表失败:', error); resellerOptions.value = []; @@ -360,7 +360,7 @@ const app = createApp({ }; // ==================== 导出相关计算属性 ==================== - const hasCreators = Vue.computed(() => state.exportForm.creatorIds?.length > 0); + const hasCreators = Vue.computed(() => !!state.exportForm.creatorId); const hasReseller = Vue.computed(() => !!state.exportForm.resellerId); const hasPlan = Vue.computed(() => !!state.exportForm.planId); const hasKeyBatch = Vue.computed(() => !!state.exportForm.keyBatchId); @@ -702,7 +702,9 @@ const app = createApp({ } } - if (creatorIds?.length) { + if (creatorId) { + filters.creator_in = [Number(creatorId)]; + } else if (creatorIds?.length) { filters.creator_in = creatorIds.map(Number); } else if (creatorIdsRaw) { const arr = String(creatorIdsRaw).split(',').map(s => s.trim()).filter(Boolean); @@ -923,6 +925,14 @@ const app = createApp({ }); // 导出筛选条件变化 + Vue.watch(() => state.exportForm.creatorId, () => { + state.exportForm.resellerId = null; + state.exportForm.planId = null; + state.exportForm.keyBatchId = null; + state.exportForm.codeBatchId = null; + loadResellers(); + }); + Vue.watch(() => state.exportForm.creatorIds, () => { state.exportForm.resellerId = null; state.exportForm.planId = null;