初始化专案
This commit is contained in:
@@ -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]);
|
||||
|
||||
7
src/pages/company/project/detail/index.jsx
Normal file
7
src/pages/company/project/detail/index.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import React from 'react'
|
||||
|
||||
export default function ProjectDetail() {
|
||||
return (
|
||||
<div>ProjectDetail</div>
|
||||
)
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user