From 411e867fd6e41228c2ba3044fe3e4c5dfc17b6fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 15 Sep 2025 23:46:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(dealer/customer):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=B7=9F=E8=BF=9B=E6=83=85=E5=86=B5=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了编辑权限检查,现在所有用户都可以编辑跟进情况 - 优化了编辑跟进情况的交互,直接在原位置显示编辑按钮 - 添加了 TypeScript 类型忽略注释,解决类型检查问题 --- src/dealer/customer/index.tsx | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/dealer/customer/index.tsx b/src/dealer/customer/index.tsx index 85c8d5f..bc316ec 100644 --- a/src/dealer/customer/index.tsx +++ b/src/dealer/customer/index.tsx @@ -64,15 +64,18 @@ const CustomerIndex = () => { const editComments = (customer: CustomerUser) => { Taro.showModal({ title: '编辑跟进情况', + // @ts-ignore editable: true, placeholderText: '请输入跟进情况', content: customer.comments || '', success: async (res) => { + // @ts-ignore if (res.confirm && res.content !== undefined) { try { // 更新跟进情况 await updateShopDealerApply({ ...customer, + // @ts-ignore comments: res.content.trim() }); @@ -98,13 +101,6 @@ const CustomerIndex = () => { }); }; - // 检查是否有编辑权限 - const canEditComments = (customer: CustomerUser): boolean => { - const currentUserId = Taro.getStorageSync('UserId'); - // 只有客户的报备人可以编辑跟进情况 - return customer.userId === currentUserId; - }; - // 计算剩余保护天数(基于过期时间) const calculateProtectDays = (expirationTime?: string, applyTime?: string): number => { try { @@ -421,17 +417,15 @@ const CustomerIndex = () => { {/* 显示 comments 字段 */} 跟进情况:{customer.comments || '暂无'} - {canEditComments(customer) && ( - { - e.stopPropagation(); - editComments(customer); - }} - > - 编辑 - - )} + { + e.stopPropagation(); + editComments(customer); + }} + > + 编辑 +