diff --git a/src/components/ChatAi/index.jsx b/src/components/ChatAi/index.jsx index 13422cb..a1d9b5e 100644 --- a/src/components/ChatAi/index.jsx +++ b/src/components/ChatAi/index.jsx @@ -15,8 +15,6 @@ export default function ChatAIDrawer({ open, onClose, onExport }) { }); const messagesEndRef = useRef(null); - - // 当 messages 改变时,自动更新 session storage useEffect(() => { setStoredMessages(JSON.stringify(messages)); }, [messages, setStoredMessages]); diff --git a/src/pages/company/project/detail/index.jsx b/src/pages/company/project/detail/index.jsx new file mode 100644 index 0000000..e629f6a --- /dev/null +++ b/src/pages/company/project/detail/index.jsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function ProjectDetail() { + return ( +
ProjectDetail
+ ) +} diff --git a/src/pages/company/quotation/detail/index.jsx b/src/pages/company/quotation/detail/index.jsx index 272c441..34dbb1a 100644 --- a/src/pages/company/quotation/detail/index.jsx +++ b/src/pages/company/quotation/detail/index.jsx @@ -14,10 +14,8 @@ import { Divider, } from "antd"; import { - PlusOutlined, ArrowLeftOutlined, SaveOutlined, - DeleteOutlined, } from "@ant-design/icons"; import { supabase } from "@/config/supabase"; import { useNavigate, useParams, useSearchParams } from "react-router-dom"; @@ -42,17 +40,10 @@ const QuotationForm = () => { const isView = id && !isEdit; const [form] = Form.useForm(); const navigate = useNavigate(); - const [dataSource, setDataSource] = useState([{ id: Date.now() }]); - const [totalAmount, setTotalAmount] = useState(0); const [loading, setLoading] = useState(false); const [currentCurrency, setCurrentCurrency] = useState("TWD"); const [customers, setCustomers] = useState([]); - const [selectedCustomers, setSelectedCustomers] = useState([]); const [formValues, setFormValues] = useState({}); - const [templateModalVisible, setTemplateModalVisible] = useState(false); - const [availableSections, setAvailableSections] = useState([]); - const [editingSectionIndex, setEditingSectionIndex] = useState(null); - const [editingSectionName, setEditingSectionName] = useState(""); const [taxRate, setTaxRate] = useState(0); const [discount, setDiscount] = useState(0); @@ -92,26 +83,6 @@ const QuotationForm = () => { [calculateSectionTotal] ); - // 格式化货币 - const formatCurrency = useMemo( - () => - (amount, currency = currentCurrency) => { - const safeAmount = Number(amount) || 0; - return `${CURRENCY_SYMBOLS[currency] || ""}${safeAmount.toLocaleString( - "zh-CN", - { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - } - )}`; - }, - [currentCurrency] - ); - useEffect(() => { - console.log(currentCurrency, 'currency'); - - }, [currentCurrency]) - // 处理表单值变化 const handleValuesChange = (changedValues, allValues) => { setFormValues(allValues); if (changedValues.currency) { @@ -182,9 +153,7 @@ const QuotationForm = () => { setTaxRate(data.attributes.taxRate || 0); setDiscount(data.attributes.discount || 0); - if (data.attributes.customers) { - setSelectedCustomers(data.attributes.customers); - } + } } catch (error) { console.error("获取报价单详情失败:", error); @@ -349,7 +318,7 @@ const QuotationForm = () => { const quotationData = { quataName: data.activityName, description: data.description, - currency: data.currency || "TWD", + currency: data.currency || "TWD", sections: data.sections.map((section) => ({ key: uuidv4(), sectionName: section.sectionName, diff --git a/src/routes/routes.js b/src/routes/routes.js index cdc3bb6..e08c3f7 100644 --- a/src/routes/routes.js +++ b/src/routes/routes.js @@ -119,6 +119,21 @@ const companyRoutes = [ icon: "branches", roles: ["ADMIN", "OWNER"], }, + { + path: "project", + component: lazy(() => import("@/pages/company/project")), + name: "专案管理", + icon: "appstore", + roles: ["ADMIN", "OWNER"], + }, + { + path: "projectInfo/:id?", + hidden: true, + component: lazy(() => import("@/pages/company/project/detail")), + name: "专案管理详情", + icon: "appstore", + roles: ["ADMIN", "OWNER"], + } ]; const marketingRoutes = [];