From 58087a4b37d601d0c2716c10c4aa6f8a958f7767 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Sun, 14 Jun 2026 10:46:52 +0700 Subject: [PATCH] =?UTF-8?q?B=E1=BB=95=20sung=20t=C3=ADnh=20n=C4=83ng=20c?= =?UTF-8?q?=E1=BA=ADp=20nh=E1=BA=ADt=20ti=E1=BB=81n=20c=E1=BB=A7a=20=C4=91?= =?UTF-8?q?=E1=BB=8Ba=20=C4=91i=E1=BB=83m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AddLocationModal.tsx | 35 +++++++++++++++++++ ItineraryTimeline.tsx | 13 +++++++ dist/AddLocationModal.js | 11 +++++- dist/AddLocationModal.js.map | 2 +- dist/ItineraryTimeline.js | 3 +- dist/ItineraryTimeline.js.map | 2 +- dist/main.js | 56 +++++++++++++++++++++++++----- dist/main.js.map | 2 +- dist/tsconfig.build.tsbuildinfo | 2 +- main.ts | 60 ++++++++++++++++++++++++++++----- 10 files changed, 162 insertions(+), 24 deletions(-) diff --git a/AddLocationModal.tsx b/AddLocationModal.tsx index c3e16e1..8c5b693 100644 --- a/AddLocationModal.tsx +++ b/AddLocationModal.tsx @@ -67,6 +67,9 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin longitude: 106.7009, type: 'VISIT', legId: '', + note: '', + expenseAmount: '', + expenseCategory: 'OTHER', plannedStart: '', plannedEnd: '' }); @@ -79,6 +82,9 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin useEffect(() => { if (isOpen) { if (editingLocation) { + const leg = legs.find(l => l.id === editingLocation.legId); + const expense = leg?.expenses?.find((e: any) => e.locationId === editingLocation.id); + setFormData({ name: editingLocation.name || '', address: editingLocation.address || '', @@ -86,6 +92,9 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin longitude: editingLocation.longitude, type: editingLocation.type || 'VISIT', legId: editingLocation.legId || '', + note: editingLocation.note || '', + expenseAmount: expense?.amount?.toString() || '', + expenseCategory: expense?.category || 'OTHER', plannedStart: editingLocation.plannedStart ? editingLocation.plannedStart.slice(0, 16) : '', plannedEnd: editingLocation.plannedEnd ? editingLocation.plannedEnd.slice(0, 16) : '' }); @@ -94,6 +103,7 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin ...prev, name: '', address: '', legId: initialLegId || (legs.length > 0 ? legs[0].id : ''), + note: '', expenseAmount: '', expenseCategory: 'OTHER', plannedStart: '', plannedEnd: '' })); } @@ -195,6 +205,31 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin setFormData({...formData, address: e.target.value})} /> +
+ +