fix: 添加单条记录GET端点,修复移动端编辑表单数据加载
- work-plans/mini-business/key-visits 均新增 GET /{id} 端点
- 三个移动端编辑表单改用单条端点加载数据
- 修复点击卡片进入编辑时空白的 bug
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -32,10 +32,9 @@ onMounted(async () => {
|
||||
}
|
||||
if (isEdit.value) {
|
||||
try {
|
||||
const res = await miniBusinessApi.list()
|
||||
const items = Array.isArray(res.data) ? res.data : (res.data.items || [])
|
||||
const d = items.find((x: any) => x.id === route.params.id)
|
||||
if (d) form.value = { customer_id: d.customer_id, product_type: d.product_type, amount: d.amount, follow_up_detail: d.follow_up_detail || '', status: d.status, expected_revenue_date: d.expected_revenue_date, manager_id: d.manager_id || auth.userId || '' }
|
||||
const res = await api.get(`/mini-business/${route.params.id}`)
|
||||
const d = res.data
|
||||
form.value = { customer_id: d.customer_id, product_type: d.product_type, amount: d.amount, follow_up_detail: d.follow_up_detail || '', status: d.status, expected_revenue_date: d.expected_revenue_date, manager_id: d.manager_id || auth.userId || '' }
|
||||
} catch (_) {}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user