diff --git a/furniture-3d-system/src/app/intake/IntakeClient.test.tsx b/furniture-3d-system/src/app/intake/IntakeClient.test.tsx
index 77bca563..4d9e70d4 100644
--- a/furniture-3d-system/src/app/intake/IntakeClient.test.tsx
+++ b/furniture-3d-system/src/app/intake/IntakeClient.test.tsx
@@ -82,12 +82,36 @@ jest.mock('./non-integrated/NonIntegratedDetailClient', () => ({
default: ({
productId,
mode,
+ initialDocumentWorkspaceView,
+ initialDocumentWorkspaceCategory,
+ onDocumentWorkspaceStateChange,
}: {
productId?: string
mode: 'create' | 'edit' | 'view'
+ initialDocumentWorkspaceView?: 'detail' | 'document'
+ initialDocumentWorkspaceCategory?: string
+ onDocumentWorkspaceStateChange?: (state: {
+ view: 'detail' | 'document'
+ category: string
+ }) => void
}) => (
{productId}-{mode}
+
+ {(initialDocumentWorkspaceView ?? 'detail')}-
+ {(initialDocumentWorkspaceCategory ?? '基础信息')}
+
+
),
}))
@@ -313,6 +337,9 @@ function createPatentApprovedProduct(overrides: Record = {}) {
const product = createNonIntegratedProduct(overrides)
return {
...product,
+ patentApplication:
+ (overrides.patentApplication as Record | undefined) ??
+ createPatentApplicationContent(),
documentWorkspaceConfirmations: {
...createDefaultDocumentWorkspaceConfirmations(),
...(product.documentWorkspaceConfirmations as Record),
@@ -1751,6 +1778,30 @@ describe('IntakeClient', () => {
).not.toBeInTheDocument()
})
+ it('keeps each product workspace on the last selected right-side node when switching top tabs', async () => {
+ const actor = userEvent.setup()
+
+ window.localStorage.setItem(
+ NON_INTEGRATED_STORAGE_KEY,
+ JSON.stringify([createNonIntegratedProduct()]),
+ )
+
+ renderSelector({ eligibleSkuList: [] })
+
+ await actor.click(screen.getByRole('button', { name: '修改' }))
+ expect(screen.getByTestId('embedded-workspace-state')).toHaveTextContent(
+ 'detail-基础信息',
+ )
+
+ await actor.click(screen.getByRole('button', { name: '模拟切到专利申请' }))
+ await actor.click(screen.getByRole('tab', { name: '非集成系列产品' }))
+ await actor.click(screen.getByRole('tab', { name: 'DNZ0001产品开发明细' }))
+
+ expect(screen.getByTestId('embedded-workspace-state')).toHaveTextContent(
+ 'document-专利申请',
+ )
+ })
+
it('opens a separate workspace tab each time product edit is clicked', async () => {
const actor = userEvent.setup()
diff --git a/furniture-3d-system/src/app/intake/IntakeClient.tsx b/furniture-3d-system/src/app/intake/IntakeClient.tsx
index 36ea5241..d3d2248b 100644
--- a/furniture-3d-system/src/app/intake/IntakeClient.tsx
+++ b/furniture-3d-system/src/app/intake/IntakeClient.tsx
@@ -6,6 +6,7 @@ import {
type ChangeEvent,
type KeyboardEvent,
type ReactNode,
+ useCallback,
useEffect,
useMemo,
useRef,
@@ -185,6 +186,10 @@ type BomLibraryKey =
| "packagingLibrary"
| "packagingMaterialLibrary";
type WorkspaceProductMode = "view" | "edit";
+type WorkspaceProductDetailState = {
+ view: "detail" | "document";
+ category: NonIntegratedDocumentWorkspaceCategory;
+};
type IntakeWorkspaceTab =
| {
id: string;
@@ -214,6 +219,7 @@ type IntakeWorkspaceTab =
productId: string;
product: NonIntegratedProductRecord;
mode: WorkspaceProductMode;
+ detailState?: WorkspaceProductDetailState;
}
| {
id: string;
@@ -6859,6 +6865,44 @@ export default function IntakeClient(props: IntakeClientProps) {
const activeWorkspaceTab =
workspaceTabs.find((tab) => tab.id === activeWorkspaceTabId) ?? null;
+ const activeProductWorkspaceTabId =
+ activeWorkspaceTab?.kind === "nonIntegratedProduct"
+ ? activeWorkspaceTab.id
+ : null;
+
+ const updateProductWorkspaceDetailState = useCallback(
+ (tabId: string, detailState: WorkspaceProductDetailState) => {
+ setWorkspaceTabs((current) => {
+ let changed = false;
+ const nextTabs = current.map((tab) => {
+ if (tab.id !== tabId || tab.kind !== "nonIntegratedProduct") {
+ return tab;
+ }
+
+ if (
+ tab.detailState?.view === detailState.view &&
+ tab.detailState.category === detailState.category
+ ) {
+ return tab;
+ }
+
+ changed = true;
+ return { ...tab, detailState };
+ });
+
+ return changed ? nextTabs : current;
+ });
+ },
+ [],
+ );
+
+ const handleActiveProductWorkspaceDetailStateChange = useCallback(
+ (detailState: WorkspaceProductDetailState) => {
+ if (!activeProductWorkspaceTabId) return;
+ updateProductWorkspaceDetailState(activeProductWorkspaceTabId, detailState);
+ },
+ [activeProductWorkspaceTabId, updateProductWorkspaceDetailState],
+ );
useEffect(() => {
setNonIntegratedProducts(props.initialNonIntegratedProducts);
@@ -7087,8 +7131,11 @@ export default function IntakeClient(props: IntakeClientProps) {
mode={activeWorkspaceTab.mode}
productId={activeWorkspaceTab.productId}
initialProduct={activeWorkspaceTab.product}
+ initialDocumentWorkspaceView={activeWorkspaceTab.detailState?.view}
+ initialDocumentWorkspaceCategory={activeWorkspaceTab.detailState?.category}
currentUserRole={props.user.role}
onProductSaved={handleNonIntegratedProductSaved}
+ onDocumentWorkspaceStateChange={handleActiveProductWorkspaceDetailStateChange}
onReturnToList={activateNonIntegratedListWorkspace}
/>
);
diff --git a/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.test.tsx b/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.test.tsx
index 88169f38..5aea6510 100644
--- a/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.test.tsx
+++ b/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.test.tsx
@@ -26,6 +26,7 @@ import {
import { parseZipFile } from "@/lib/zip-parser";
import { extractPreviewModelFromZip } from "../../../lib/model-preview-zip";
import { fetchSubstrates } from "@/lib/open-product/platform-api";
+import { createApprovalWorkflow } from "@/app/approval-workflows/approvalWorkflowApi";
const push = jest.fn();
const modelPreviewPanelMock = jest.fn();
@@ -102,6 +103,16 @@ jest.mock("@/lib/open-product/platform-api", () => ({
fetchSubstrates: jest.fn(),
}));
+jest.mock("@/app/approval-workflows/approvalWorkflowApi", () => ({
+ buildApprovalNumber: jest.fn(() => "PD20260505175418001"),
+ createApprovalWorkflow: jest.fn(async (input) => ({
+ id: "workflow-test",
+ accessKey: "workflow-access-key",
+ status: "PENDING",
+ ...input,
+ })),
+}));
+
const mockedPreviewSharedNonIntegratedDocumentImages = jest.mocked(
previewSharedNonIntegratedDocumentImages,
);
@@ -112,6 +123,7 @@ const mockedUploadSharedNonIntegratedFile = jest.mocked(
uploadSharedNonIntegratedFile,
);
const mockedFetchSubstrates = jest.mocked(fetchSubstrates);
+const mockedCreateApprovalWorkflow = jest.mocked(createApprovalWorkflow);
function createSubstrateOption(overrides: {
id: string;
@@ -334,6 +346,7 @@ describe("NonIntegratedDetailClient", () => {
mockedSaveSharedNonIntegratedProduct.mockImplementation(async (product) => product);
mockedUploadSharedNonIntegratedFile.mockReset();
mockedFetchSubstrates.mockReset();
+ mockedCreateApprovalWorkflow.mockClear();
mockedFetchSubstrates.mockResolvedValue([
createSubstrateOption({
id: "substrate-ice",
@@ -357,6 +370,12 @@ describe("NonIntegratedDetailClient", () => {
systemName: "20ENF级橡胶木",
}),
]);
+ Object.defineProperty(navigator, "clipboard", {
+ value: {
+ writeText: jest.fn(async () => undefined),
+ },
+ configurable: true,
+ });
});
afterEach(() => {
@@ -367,9 +386,9 @@ describe("NonIntegratedDetailClient", () => {
const actor = userEvent.setup();
const { container } = render();
- await actor.type(screen.getByLabelText("开品名称"), "测试开品");
- await actor.type(screen.getByLabelText("临时编号"), "DNZ0001");
- await actor.type(screen.getByLabelText("设计师"), "测试设计师");
+ expect(screen.getByLabelText("审批编号")).toHaveValue("PD20260505175418001");
+ expect(screen.getByLabelText("产品图片")).toBeInTheDocument();
+ await actor.type(screen.getByLabelText("名称"), "测试开品");
const imageFile = new File(["image"], "preview.png", { type: "image/png" });
const fileInputs = container.querySelectorAll('input[type="file"]');
@@ -383,17 +402,26 @@ describe("NonIntegratedDetailClient", () => {
) as NonIntegratedProductRecord[];
expect(savedProducts).toHaveLength(1);
- expect(savedProducts[0]?.spu).toBe("DNZ0001");
+ expect(savedProducts[0]?.spu).toBe("PD20260505175418001");
expect(savedProducts[0]?.projectStatus).toBe("draft");
expect(savedProducts[0]?.brand).toBe("基本盘");
- expect(savedProducts[0]?.designer).toBe("测试设计师");
expect(savedProducts[0]?.openingReference.productName).toBe("测试开品");
- expect(savedProducts[0]?.openingReference.temporaryCode).toBe("DNZ0001");
+ expect(savedProducts[0]?.openingReference.temporaryCode).toBe(
+ "PD20260505175418001",
+ );
expect(savedProducts[0]?.previewImage).toContain(
"data:image/png;base64,dGVzdA==",
);
+ expect(mockedCreateApprovalWorkflow).toHaveBeenCalledWith({
+ productId: savedProducts[0]?.id,
+ approvalNumber: "PD20260505175418001",
+ title: "测试开品",
+ businessRoles: [],
+ });
expect(push).toHaveBeenCalledWith(
- `/intake/non-integrated/${encodeURIComponent(savedProducts[0]!.id)}`,
+ `/intake/non-integrated/${encodeURIComponent(
+ savedProducts[0]!.id,
+ )}?workspace=opening-reference`,
);
});
@@ -401,7 +429,7 @@ describe("NonIntegratedDetailClient", () => {
const actor = userEvent.setup();
const { container } = render();
- await actor.type(screen.getByLabelText("开品名称"), "仅填写名称的开品");
+ await actor.type(screen.getByLabelText("名称"), "仅填写名称的开品");
const imageFile = new File(["image"], "preview.png", { type: "image/png" });
const fileInputs = container.querySelectorAll('input[type="file"]');
@@ -418,7 +446,9 @@ describe("NonIntegratedDetailClient", () => {
expect(savedProducts[0]?.openingReference.productName).toBe(
"仅填写名称的开品",
);
- expect(savedProducts[0]?.openingReference.temporaryCode).toMatch(/^KP-\d+$/);
+ expect(savedProducts[0]?.openingReference.temporaryCode).toBe(
+ "PD20260505175418001",
+ );
expect(savedProducts[0]?.spu).toBe(
savedProducts[0]?.openingReference.temporaryCode,
);
@@ -553,7 +583,23 @@ describe("NonIntegratedDetailClient", () => {
it("keeps brand as a single value when adaptable brands change", async () => {
const actor = userEvent.setup();
- render();
+ saveNonIntegratedProduct(
+ createProductRecord({
+ id: "DNZ0001-brand-single",
+ spu: "DNZ0001",
+ openingReference: {
+ ...createEmptyNonIntegratedOpeningReference(),
+ productName: "测试开品",
+ temporaryCode: "DNZ0001",
+ brand: "基本盘",
+ adaptableBrands: ["基本盘"],
+ },
+ }),
+ );
+
+ render(
+ ,
+ );
const brandSelect = screen.getByLabelText("品牌");
const adaptableBrandButton = screen.getByRole("button", {
@@ -574,7 +620,6 @@ describe("NonIntegratedDetailClient", () => {
await actor.click(adaptableBrandButton);
await actor.click(screen.getByLabelText("基本盘"));
expect(brandSelect).toHaveValue("顾家");
- expect(screen.getByLabelText("临时编号")).toHaveValue("");
});
it("shows the document sidebar in the updated workflow order", () => {
@@ -643,8 +688,6 @@ describe("NonIntegratedDetailClient", () => {
"document-workspace-trigger-产品定厂",
"document-workspace-trigger-样包测量",
"document-workspace-trigger-产品核价",
- "document-workspace-trigger-工厂质检",
- "document-workspace-trigger-检测报告",
]);
expect(
screen.queryByTestId("document-workspace-trigger-立项评审"),
@@ -652,13 +695,15 @@ describe("NonIntegratedDetailClient", () => {
const reviewTrigger = screen.getByTestId("document-workspace-trigger-评审资料");
const modelTrigger = screen.getByTestId("document-workspace-trigger-产品模型");
- const reportTrigger = screen.getByTestId("document-workspace-trigger-检测报告");
expect(reviewTrigger).toHaveAttribute("data-has-files", "true");
expect(modelTrigger).toHaveAttribute("data-has-files", "true");
- expect(reportTrigger).toHaveAttribute("data-has-files", "false");
- expect(reportTrigger).toHaveAttribute("data-pending-confirmation", "true");
- expect(reportTrigger).toHaveClass("bg-[#fff7ea]");
+ expect(
+ screen.queryByTestId("document-workspace-trigger-工厂质检"),
+ ).not.toBeInTheDocument();
+ expect(
+ screen.queryByTestId("document-workspace-trigger-检测报告"),
+ ).not.toBeInTheDocument();
expect(reviewTrigger).not.toHaveClass("bg-[#e6ebf0]");
expect(
Array.from(
@@ -721,8 +766,6 @@ describe("NonIntegratedDetailClient", () => {
"document-workspace-trigger-产品定厂",
"document-workspace-trigger-样包测量",
"document-workspace-trigger-产品核价",
- "document-workspace-trigger-工厂质检",
- "document-workspace-trigger-检测报告",
]);
expect(
sidebar.querySelector(
@@ -884,7 +927,14 @@ describe("NonIntegratedDetailClient", () => {
await actor.click(screen.getByTestId("document-workspace-trigger-专利申请"));
- expect(screen.getByLabelText("是否申请专利")).toHaveValue("待判断");
+ const patentApplicationDecision = screen.getByRole("radiogroup", {
+ name: "是否申请专利",
+ });
+ expect(
+ within(patentApplicationDecision).getByRole("radio", {
+ name: "待判断",
+ }),
+ ).toHaveAttribute("aria-checked", "true");
expect(screen.getByTestId("patent-application-pending-choice")).toHaveTextContent(
"请先选择是否申请专利",
);
@@ -892,7 +942,9 @@ describe("NonIntegratedDetailClient", () => {
screen.queryByTestId("patent-application-ledger-fields"),
).not.toBeInTheDocument();
- await actor.selectOptions(screen.getByLabelText("是否申请专利"), "申请");
+ await actor.click(
+ within(patentApplicationDecision).getByRole("radio", { name: "是" }),
+ );
const ledgerFields = screen.getByTestId("patent-application-ledger-fields");
const ledgerText = ledgerFields.textContent ?? "";
@@ -1021,7 +1073,11 @@ describe("NonIntegratedDetailClient", () => {
);
await actor.click(screen.getByTestId("document-workspace-trigger-专利申请"));
- await actor.selectOptions(screen.getByLabelText("是否申请专利"), "不申请");
+ await actor.click(
+ within(
+ screen.getByRole("radiogroup", { name: "是否申请专利" }),
+ ).getByRole("radio", { name: "否" }),
+ );
expect(screen.getByTestId("patent-application-not-needed")).toHaveTextContent(
"产品无需申请专利",
@@ -1297,9 +1353,12 @@ describe("NonIntegratedDetailClient", () => {
/>,
);
- await actor.click(screen.getByTestId("document-workspace-trigger-工厂质检"));
+ await actor.click(screen.getByTestId("document-workspace-trigger-包装细节"));
const panel = screen.getByTestId("document-workspace-panel");
+ expect(
+ screen.getByTestId("packaging-factory-quality-section"),
+ ).toBeInTheDocument();
expect(screen.getByTestId("factory-quality-workspace")).toBeInTheDocument();
expect(screen.getByTestId("factory-quality-style-K01")).toHaveTextContent(
"SZ0230K01",
@@ -1689,6 +1748,45 @@ describe("NonIntegratedDetailClient", () => {
).toHaveAttribute("data-active", "true");
});
+ it("keeps the sidebar on basic info instead of falling back to opening reference", async () => {
+ const actor = userEvent.setup();
+
+ window.localStorage.setItem(
+ NON_INTEGRATED_STORAGE_KEY,
+ JSON.stringify([
+ createProductRecord({
+ id: "DNZ0001-basic-info-sidebar",
+ uploadFiles: [
+ {
+ id: "workspace-photo-basic-info",
+ name: "产品实拍图.png",
+ category: "产品实拍图",
+ dataUrl: "data:image/png;base64,test-image",
+ mimeType: "image/png",
+ },
+ ],
+ }),
+ ]),
+ );
+
+ render(
+ ,
+ );
+
+ await actor.click(screen.getByTestId("document-workspace-trigger-产品实拍图"));
+ await actor.click(screen.getByTestId("document-workspace-basic-info-trigger"));
+
+ await waitFor(() => {
+ expect(
+ screen.getByTestId("document-workspace-basic-info-trigger"),
+ ).toHaveAttribute("data-active", "true");
+ });
+ expect(screen.queryByTestId("opening-reference-workspace")).not.toBeInTheDocument();
+ });
+
it("marks copied document categories as pending until the current category is confirmed", async () => {
const actor = userEvent.setup();
diff --git a/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx b/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx
index a73daa2e..95b24e5d 100644
--- a/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx
+++ b/furniture-3d-system/src/app/intake/non-integrated/NonIntegratedDetailClient.tsx
@@ -804,7 +804,10 @@ const DOCUMENT_WORKSPACE_CATEGORY_ORDER: DocumentWorkspaceCategory[] = [
];
const DOCUMENT_WORKSPACE_VISIBLE_CATEGORY_ORDER: DocumentWorkspaceCategory[] =
DOCUMENT_WORKSPACE_CATEGORY_ORDER.filter(
- (category) => category !== PROJECT_REVIEW_WORKSPACE_CATEGORY,
+ (category) =>
+ category !== PROJECT_REVIEW_WORKSPACE_CATEGORY &&
+ category !== "工厂质检" &&
+ category !== "检测报告",
);
const BASIC_INFO_PRECEDING_WORKSPACE_CATEGORIES: DocumentWorkspaceCategory[] =
[
@@ -904,7 +907,6 @@ const SUPPLEMENT_WORKSPACE_SHORTCUT_LAYOUT: DocumentWorkspaceCategory[] = [
"安装方式",
"包装细节",
"产品模型",
- "检测报告",
];
const DEFAULT_DOCUMENT_WORKSPACE_CATEGORY: DocumentWorkspaceCategory =
@@ -914,6 +916,14 @@ const PRODUCT_PHOTO_CATEGORY: DocumentWorkspaceCategory = "产品实拍图";
const AUTO_SAVE_DELAY_MS = 500;
const PATENT_APPLICATION_STATUS_OPTIONS: NonIntegratedPatentApplication["patentStatus"][] =
["待确认", "已有专利", "申请中", "申请失败", "无专利", "放弃维护"];
+const PATENT_APPLICATION_DECISION_OPTIONS: Array<{
+ value: Exclude;
+ label: string;
+}> = [
+ { value: "待判断", label: "待判断" },
+ { value: "申请", label: "是" },
+ { value: "不申请", label: "否" },
+];
const PATENT_APPLICATION_SA_REQUIRED_OPTIONS: NonIntegratedPatentApplication["saRequired"][] =
["否", "是"];
const PATENT_APPLICATION_SALES_STATUS_OPTIONS: NonIntegratedPatentApplication["salesStatus"][] =
@@ -1244,11 +1254,11 @@ const DOCUMENT_WORKSPACE_COPY: Record<
emptyDescription: "该入口已预留,后续可配置产品核价资料内容。",
},
工厂质检: {
- description: "工厂质检资料入口已预留,详情内容后续配置。",
+ description: "按款式维护工厂质检资料,集中归档摔包图片和摔包视频。",
noteLabel: "工厂质检备注",
- notePlaceholder: "可填写工厂质检相关说明。",
+ notePlaceholder: "可填写摔包、工厂质检或补充说明。",
emptyTitle: "当前还没有工厂质检资料",
- emptyDescription: "该入口已预留,后续可配置工厂质检资料内容。",
+ emptyDescription: "可先上传当前款式的摔包图片或摔包视频。",
},
};
@@ -6091,20 +6101,27 @@ export default function NonIntegratedDetailClient({
productId,
initialProduct = null,
initialDocumentWorkspaceCategory,
+ initialDocumentWorkspaceView,
embedded = false,
linkEntryView = false,
currentUserRole,
onProductSaved,
+ onDocumentWorkspaceStateChange,
onReturnToList,
}: {
mode: "create" | "edit" | "view";
productId?: string;
initialProduct?: NonIntegratedProductRecord | null;
initialDocumentWorkspaceCategory?: DocumentWorkspaceCategory;
+ initialDocumentWorkspaceView?: DocumentWorkspaceView;
embedded?: boolean;
linkEntryView?: boolean;
currentUserRole?: string;
onProductSaved?: (product: NonIntegratedProductRecord) => void;
+ onDocumentWorkspaceStateChange?: (state: {
+ view: DocumentWorkspaceView;
+ category: DocumentWorkspaceCategory;
+ }) => void;
onReturnToList?: () => void;
}) {
const router = useRouter();
@@ -6197,9 +6214,12 @@ export default function NonIntegratedDetailClient({
);
const [documentWorkspaceView, setDocumentWorkspaceView] =
useState(
- mode === "create" || initialProjectStatus === "approved"
+ initialDocumentWorkspaceView ??
+ (initialDocumentWorkspaceCategory
+ ? "document"
+ : mode === "create" || initialProjectStatus === "approved"
? "detail"
- : "document",
+ : "document"),
);
const [activeDocumentWorkspaceCategory, setActiveDocumentWorkspaceCategory] =
useState(
@@ -6316,6 +6336,17 @@ export default function NonIntegratedDetailClient({
"success" | "error"
>("success");
+ useEffect(() => {
+ onDocumentWorkspaceStateChange?.({
+ view: documentWorkspaceView,
+ category: activeDocumentWorkspaceCategory,
+ });
+ }, [
+ activeDocumentWorkspaceCategory,
+ documentWorkspaceView,
+ onDocumentWorkspaceStateChange,
+ ]);
+
useEffect(() => {
if (typeof document === "undefined") {
return;
@@ -6921,6 +6952,14 @@ export default function NonIntegratedDetailClient({
const packagingHasStructuredContent = Object.values(styleDetails).some(
(detail) => hasPackagingStyleStructuredContent(detail),
);
+ const factoryQualityFileCount = uploadFiles.filter(
+ (file) => file.category === FACTORY_QUALITY_WORKSPACE_CATEGORY,
+ ).length;
+ const qualityStandardFileCount = uploadFiles.filter(
+ (file) =>
+ file.category === DETECTION_WORKSPACE_CATEGORY &&
+ resolveDetectionWorkspaceAssetType(file) === "quality-standard",
+ ).length;
return {
...uploadFileCountByCategory,
@@ -6934,11 +6973,13 @@ export default function NonIntegratedDetailClient({
uploadFileCountByCategory[PATENT_APPLICATION_WORKSPACE_CATEGORY] +
(patentApplicationHasContent ? 1 : 0),
[DETECTION_WORKSPACE_CATEGORY]:
- uploadFileCountByCategory[DETECTION_WORKSPACE_CATEGORY] +
- (qualityInspectionHasContent ? 1 : 0),
+ qualityStandardFileCount,
[PACKAGING_WORKSPACE_CATEGORY]:
uploadFileCountByCategory[PACKAGING_WORKSPACE_CATEGORY] +
+ factoryQualityFileCount +
+ qualityStandardFileCount +
(packagingHasStructuredContent ? 1 : 0),
+ [FACTORY_QUALITY_WORKSPACE_CATEGORY]: factoryQualityFileCount,
[PRODUCT_FACTORY_WORKSPACE_CATEGORY]: confirmedProductFactoryRowCount,
[SAMPLE_MEASUREMENT_WORKSPACE_CATEGORY]:
populatedSampleMeasurementRowCount,
@@ -6994,12 +7035,16 @@ export default function NonIntegratedDetailClient({
name: file.name,
category: file.category,
dataUrl: file.dataUrl,
+ mimeType: file.mimeType,
productDataGroup: file.productDataGroup,
+ detectionAssetType: file.detectionAssetType,
photoGroup: file.photoGroup,
photoSlot: file.photoSlot,
productPhotoStyleKey: file.productPhotoStyleKey,
installStyleKey: file.installStyleKey,
installAssetType: file.installAssetType,
+ installVersionLabel: file.installVersionLabel,
+ installIsCurrentVersion: file.installIsCurrentVersion,
packagingStyleKey: file.packagingStyleKey,
packagingAssetType: file.packagingAssetType,
factoryQualityStyleKey: file.factoryQualityStyleKey,
@@ -7050,9 +7095,9 @@ export default function NonIntegratedDetailClient({
files: filesForCategory(INSTALLATION_WORKSPACE_CATEGORY),
});
signatures[PACKAGING_WORKSPACE_CATEGORY] = JSON.stringify({
- styleDetails,
- files: filesForCategory(PACKAGING_WORKSPACE_CATEGORY),
- });
+ styleDetails,
+ files: filesForCategory(PACKAGING_WORKSPACE_CATEGORY),
+ });
signatures[PRODUCT_FACTORY_WORKSPACE_CATEGORY] =
JSON.stringify(productFactoryRows);
signatures[SAMPLE_MEASUREMENT_WORKSPACE_CATEGORY] = JSON.stringify(
@@ -7061,12 +7106,13 @@ export default function NonIntegratedDetailClient({
signatures[PRODUCT_PRICING_WORKSPACE_CATEGORY] =
JSON.stringify(productPricingRows);
signatures[DETECTION_WORKSPACE_CATEGORY] = JSON.stringify({
- qualityInspectionSheet,
- files: filesForCategory(DETECTION_WORKSPACE_CATEGORY),
- });
+ files: filesForCategory(DETECTION_WORKSPACE_CATEGORY).filter(
+ (file) => resolveDetectionWorkspaceAssetType(file) === "quality-standard",
+ ),
+ });
signatures[FACTORY_QUALITY_WORKSPACE_CATEGORY] = JSON.stringify({
- files: filesForCategory(FACTORY_QUALITY_WORKSPACE_CATEGORY),
- });
+ files: filesForCategory(FACTORY_QUALITY_WORKSPACE_CATEGORY),
+ });
signatures[NON_INTEGRATED_BASIC_INFO_WORKSPACE_CATEGORY] = JSON.stringify({
formValues,
skuItems,
@@ -7207,6 +7253,13 @@ export default function NonIntegratedDetailClient({
),
[uploadFiles],
);
+ const factoryQualityFiles = useMemo(
+ () =>
+ uploadFiles.filter(
+ (file) => file.category === FACTORY_QUALITY_WORKSPACE_CATEGORY,
+ ),
+ [uploadFiles],
+ );
const activeDocumentWorkspaceFiles = useMemo(() => {
if (activeDocumentWorkspaceCategory !== DETECTION_WORKSPACE_CATEGORY) {
return uploadFiles.filter(
@@ -7503,7 +7556,7 @@ export default function NonIntegratedDetailClient({
ensureEntry(styleKey);
});
- activeDocumentWorkspaceFiles.forEach((file) => {
+ factoryQualityFiles.forEach((file) => {
const resolvedStyleKey = resolveFactoryQualityFileStyleKey(
file,
factoryQualityKnownStyleKeys,
@@ -7532,8 +7585,8 @@ export default function NonIntegratedDetailClient({
return sortStyleKeys([left.key, right.key])[0] === left.key ? -1 : 1;
});
}, [
- activeDocumentWorkspaceFiles,
derivedSkuItems,
+ factoryQualityFiles,
factoryQualityKnownStyleKeys,
]);
const packagingStyleEntries = useMemo(() => {
@@ -7799,12 +7852,24 @@ export default function NonIntegratedDetailClient({
),
[activeFactoryQualityAssetType, activeFactoryQualityStyleFiles],
);
+ const packagingWorkspaceSelectableFiles = useMemo(
+ () => [
+ ...activePackagingStyleFiles,
+ ...activeFactoryQualityAssetFiles,
+ ...qualityStandardFiles,
+ ],
+ [
+ activeFactoryQualityAssetFiles,
+ activePackagingStyleFiles,
+ qualityStandardFiles,
+ ],
+ );
const workspaceSelectableFiles = isInstallationWorkspace
? activeInstallationAssetFiles
: isFactoryQualityWorkspace
? activeFactoryQualityAssetFiles
: isPackagingWorkspace
- ? activePackagingStyleFiles
+ ? packagingWorkspaceSelectableFiles
: isProductDataWorkspace
? activeProductDataGroupFiles
: activeDocumentWorkspaceFiles;
@@ -7872,11 +7937,11 @@ export default function NonIntegratedDetailClient({
? activeDocumentWorkspaceCopy.description
: isInstallationWorkspace
? "按前面基础资料里的款式和整装/拆装信息自动分组,分别维护安装图纸与安装视频,并保留版本迭代。"
- : isFactoryQualityWorkspace
- ? "按前面 SKU 型号分开归档工厂质检资料,每个款式独立维护摔包图片和摔包视频。"
- : isPackagingWorkspace
- ? "按前面基础资料里的款式分栏维护包装方案:左侧维护款式和外包装配置,中间查看包装预览,右侧查看包装 3D 预览。"
- : `${activeDocumentWorkspaceCopy.description} 支持直接预览图片、PDF、Excel 和 PPT,其他文件可在这里集中下载查看。`;
+ : isFactoryQualityWorkspace
+ ? "按前面 SKU 型号分开归档工厂质检资料,每个款式独立维护摔包图片和摔包视频。"
+ : isPackagingWorkspace
+ ? "按款式维护包装方案;工厂质检和质检标准已并入这里,设计师在同一个包装细节工作区集中维护。"
+ : `${activeDocumentWorkspaceCopy.description} 支持直接预览图片、PDF、Excel 和 PPT,其他文件可在这里集中下载查看。`;
const activeProductPhotoPanel = selectedProductPhotoTarget.group;
const activeProductPhotoPanelTitle = getProductPhotoPanelTitle(
activeProductPhotoPanel,
@@ -8323,12 +8388,8 @@ export default function NonIntegratedDetailClient({
useEffect(() => {
if (mode === "create") return;
- if (
- documentWorkspaceView === "document" &&
- UPLOAD_CATEGORY_PANEL_ORDER.includes(activeDocumentWorkspaceCategory)
- ) {
- return;
- }
+ if (documentWorkspaceView !== "document") return;
+ if (UPLOAD_CATEGORY_PANEL_ORDER.includes(activeDocumentWorkspaceCategory)) return;
setDocumentWorkspaceView("document");
setActiveDocumentWorkspaceCategory(OPENING_REFERENCE_WORKSPACE_CATEGORY);
@@ -9921,10 +9982,20 @@ export default function NonIntegratedDetailClient({
}
function handleOpenDocumentWorkspace(category: DocumentWorkspaceCategory) {
+ const nextCategory =
+ category === FACTORY_QUALITY_WORKSPACE_CATEGORY ||
+ category === DETECTION_WORKSPACE_CATEGORY
+ ? PACKAGING_WORKSPACE_CATEGORY
+ : category;
+
setActiveDocumentWorkspaceCategory(category);
setDocumentWorkspaceView("document");
- if (category === PRODUCT_DATA_WORKSPACE_CATEGORY) {
+ if (nextCategory !== category) {
+ setActiveDocumentWorkspaceCategory(nextCategory);
+ }
+
+ if (nextCategory === PRODUCT_DATA_WORKSPACE_CATEGORY) {
setActiveProductDataGroup((current) => {
const currentEntry = productDataGroupEntries.find(
(entry) => entry.key === current,
@@ -9941,7 +10012,7 @@ export default function NonIntegratedDetailClient({
return;
}
- if (category === INSTALLATION_WORKSPACE_CATEGORY) {
+ if (nextCategory === INSTALLATION_WORKSPACE_CATEGORY) {
setSelectedInstallationStyleKey((current) => {
if (current) return current;
if (
@@ -9973,7 +10044,7 @@ export default function NonIntegratedDetailClient({
return;
}
- if (category === PACKAGING_WORKSPACE_CATEGORY) {
+ if (nextCategory === PACKAGING_WORKSPACE_CATEGORY) {
setSelectedPackagingStyleKey((current) => {
if (current) return current;
if (
@@ -10084,6 +10155,20 @@ export default function NonIntegratedDetailClient({
setSaveMessageType("success");
}
+ function handleDocumentWorkspaceNoteChangeForCategory(
+ category: DocumentWorkspaceCategory,
+ value: string,
+ ) {
+ if (isReadOnly) return;
+
+ setDocumentWorkspaceNotes((current) => ({
+ ...current,
+ [category]: value,
+ }));
+ setSaveMessage("");
+ setSaveMessageType("success");
+ }
+
function handleOpeningReferenceFieldChange(
field: OpeningReferenceFieldKey,
value: string,
@@ -10605,7 +10690,7 @@ export default function NonIntegratedDetailClient({
);
setUploadFiles((current) => [...current, ...nextFiles]);
- setActiveDocumentWorkspaceCategory(DETECTION_WORKSPACE_CATEGORY);
+ setActiveDocumentWorkspaceCategory(PACKAGING_WORKSPACE_CATEGORY);
setDocumentWorkspaceView("document");
setActiveDetectionWorkspacePanel("quality-standard");
setSelectedWorkspaceFileId(nextFiles[0]?.id ?? "");
@@ -12218,12 +12303,103 @@ export default function NonIntegratedDetailClient({
function renderPackagingWorkspace() {
const packagingStyleLabel =
selectedPackagingStyleEntry?.label ?? "包装资料";
+ const packagingSectionHasContent =
+ activePackagingStyleFiles.length > 0 ||
+ Object.values(styleDetails).some((detail) =>
+ hasPackagingStyleStructuredContent(detail),
+ );
+ const factoryQualitySectionHasContent =
+ (documentWorkspaceCountByCategory[FACTORY_QUALITY_WORKSPACE_CATEGORY] ??
+ 0) > 0;
+ const qualityStandardSectionHasContent = qualityStandardFiles.length > 0;
return (
+
+
+
+
+ 包装资料
+
+
+ 设计师维护包装方式、内包装包材、包装图纸和包装 3D。
+
+
+
+ {isReadOnly ? null : (
+ <>
+
+ void handleUploadPackagingFiles(event)}
+ />
+
+ void handlePackagingModel3dChange(event)}
+ />
+ >
+ )}
+
+ {isReadOnly ? null : (
+
+ )}
+ {renderPackagingSectionConfirmationAction({
+ category: PACKAGING_WORKSPACE_CATEGORY,
+ hasContent: packagingSectionHasContent,
+ label: "包装资料",
+ })}
+
+
+
@@ -12388,6 +12564,180 @@ export default function NonIntegratedDetailClient({
+
+
+
+
+
+
+ 工厂质检
+
+
+ 设计师按款式维护摔包图片和摔包视频;原来的右侧节点已经并入这里。
+
+
+
+ {isReadOnly ? null : (
+ <>
+
+ option.key === activeFactoryQualityAssetType,
+ )?.accept
+ }
+ multiple
+ className="hidden"
+ onChange={(event) => void handleUploadFactoryQualityFiles(event)}
+ />
+ >
+ )}
+
+
+ {isReadOnly ? null : (
+
+ )}
+ {renderPackagingSectionConfirmationAction({
+ category: FACTORY_QUALITY_WORKSPACE_CATEGORY,
+ hasContent: factoryQualitySectionHasContent,
+ label: "工厂质检",
+ })}
+
+
+
+ {renderFactoryQualityWorkspace()}
+
+
+
+
+
+
+
+ 质检标准
+
+
+ 设计师维护质检标准 Excel;原仓库抽检只保留这一块并入包装细节。
+
+
+
+ {isReadOnly ? null : (
+ <>
+
+
+ void handleUploadDetectionQualityStandardFiles(event)
+ }
+ />
+ >
+ )}
+
+
+ {isReadOnly ? null : (
+
+ )}
+ {renderPackagingSectionConfirmationAction({
+ category: DETECTION_WORKSPACE_CATEGORY,
+ hasContent: qualityStandardSectionHasContent,
+ label: "质检标准",
+ })}
+
+
+
+ {renderQualityStandardWorkspace()}
+
+
+
);
}
@@ -13021,7 +13371,25 @@ export default function NonIntegratedDetailClient({
);
}
- function renderArchivePreviewPanel() {
+ function renderArchivePreviewPanel(options?: {
+ title?: string;
+ description?: string;
+ emptyTitle?: string;
+ emptyDescription?: string;
+ }) {
+ const previewTitle = options?.title ?? workspacePreviewTitle;
+ const previewDescription =
+ options?.description ?? workspacePreviewDescription;
+ const previewContent =
+ !effectiveSelectedWorkspaceFile && options?.emptyTitle ? (
+
+ ) : (
+ renderDocumentWorkspacePreviewContent()
+ );
+
return (
Preview
-
-
- {workspacePreviewTitle}
-
-
- {workspacePreviewDescription}
-
-
-
-
- {renderDocumentWorkspacePreviewContent()}
-
+
+
+ {previewTitle}
+
+
+ {previewDescription}
+
+
+
- );
- }
+
+ );
+}
- function renderFactoryQualityWorkspace() {
- const assetTypeSummaries = FACTORY_QUALITY_ASSET_TYPE_OPTIONS.map(
- (option) => {
+function renderFactoryQualityWorkspace() {
+ const factoryQualityCopy =
+ DOCUMENT_WORKSPACE_COPY[FACTORY_QUALITY_WORKSPACE_CATEGORY];
+ const assetTypeSummaries = FACTORY_QUALITY_ASSET_TYPE_OPTIONS.map(
+ (option) => {
const files = activeFactoryQualityStyleFiles.filter(
(file) => resolveFactoryQualityAssetType(file) === option.key,
);
@@ -13122,20 +13492,23 @@ export default function NonIntegratedDetailClient({
);
})
)}
-
-
-
-
+
) : (
@@ -13202,7 +13575,22 @@ export default function NonIntegratedDetailClient({
- {renderArchivePreviewPanel()}
+ {renderArchivePreviewPanel({
+ title: effectiveSelectedWorkspaceFile?.name
+ ? effectiveSelectedWorkspaceFile.name
+ : `${selectedFactoryQualityStyleEntry?.label ?? "工厂质检"} · ${activeFactoryQualityAssetLabel}`,
+ description: effectiveSelectedWorkspaceFile
+ ? [
+ `当前款式:${selectedFactoryQualityStyleEntry?.label ?? "工厂质检"}`,
+ `当前分栏:${activeFactoryQualityAssetLabel}`,
+ `当前文件类型:${getUploadFileTypeLabel(effectiveSelectedWorkspaceFile)}`,
+ ]
+ .filter(Boolean)
+ .join(" · ")
+ : `当前还没有${selectedFactoryQualityStyleEntry?.label ?? "该款式"}的${activeFactoryQualityAssetLabel},可点击上方“上传工厂质检”补充。`,
+ emptyTitle: `当前还没有${activeFactoryQualityAssetLabel}`,
+ emptyDescription: factoryQualityCopy.emptyDescription,
+ })}
);
}
@@ -13870,47 +14258,81 @@ export default function NonIntegratedDetailClient({
: patentApplication.shouldApply;
const shouldShowPatentApplicationFields =
resolvedPatentApplicationDecision === "申请";
+ const patentApplicationLedgerColumns = [
+ { label: "序列号", className: "w-[4%]" },
+ { label: "专利状态", className: "w-[7.5%]" },
+ { label: "图片", className: "w-[5%]" },
+ { label: "外观设计名称", className: "w-[13%]" },
+ { label: "SPU", className: "w-[10%]" },
+ { label: "是否SA", className: "w-[6%]" },
+ { label: "销售状态", className: "w-[7%]" },
+ { label: "设计师", className: "w-[8%]" },
+ { label: "申请号", className: "w-[10%]" },
+ { label: "专利号", className: "w-[10%]" },
+ { label: "申请日", className: "w-[9.75%]" },
+ { label: "缴费日", className: "w-[9.75%]" },
+ ];
return (
-
-
-
+
+
+
-
- 专利申请
-
+
+
+ 专利申请
+
+
+ {resolvedPatentApplicationDecision || "待判断"}
+
+
样品评审后判断是否申请专利;申请后记录申请号、结果和申请缴费。
-
-
@@ -13931,42 +14353,34 @@ export default function NonIntegratedDetailClient({
请先选择是否申请专利
) : (
-
+
+
+ {patentApplicationLedgerColumns.map((column) => (
+
+ ))}
+
-
- {[
- "序列号",
- "专利状态",
- "图片",
- "外观设计名称",
- "SPU",
- "是否SA",
- "销售状态",
- "设计师",
- "申请号",
- "专利号",
- "申请日",
- "缴费日",
- ].map((column) => (
+
+ {patentApplicationLedgerColumns.map((column) => (
|
- {column}
+ {column.label}
|
))}
-
- |
+ |
+ |
1
|
-
+ |
|
-
+ |
{linkedImage ? (
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
+ 已确认
+
+ );
+ }
+
+ return (
+
+ );
+ }
+
function renderProjectReviewWorkspace() {
const statusCopy = PROJECT_STATUS_COPY[projectStatus];
const sourceCards: {
@@ -17829,84 +18282,8 @@ export default function NonIntegratedDetailClient({
)}
{renderDocumentWorkspaceConfirmationAction()}
- ) : isPackagingWorkspace ? (
-
- {isReadOnly ? null : (
- <>
-
-
- void handleUploadPackagingFiles(event)
- }
- />
-
-
- void handlePackagingModel3dChange(event)
- }
- />
- >
- )}
-
- {isReadOnly ? null : (
-
- )}
- {renderDocumentWorkspaceConfirmationAction()}
-
- ) : isProductDataWorkspace ? (
+ ) : isPackagingWorkspace ? null
+ : isProductDataWorkspace ? (
{isReadOnly ? null : (
<>
|