diff --git a/src/api/TagAPI.ts b/src/api/TagAPI.ts index ee3f05b..eae4f3a 100644 --- a/src/api/TagAPI.ts +++ b/src/api/TagAPI.ts @@ -1,6 +1,7 @@ import { axios } from "timi-web-api"; import type { Page, PageResult } from "timi-web-api"; import type { Tag, TagApply, TagBizType } from "@/types/Tag"; +import { getCurrentStoreId } from "@/utils/store"; const BASE_URI = "/gao/tag"; @@ -15,7 +16,16 @@ async function detail(id: string): Promise { } async function create(tag: Tag): Promise { - return await axios.post(`${BASE_URI}/create`, tag); + const ownerId = tag.ownerId || getCurrentStoreId(); + if (!ownerId) { + throw new Error("无法确定标签所属门店"); + } + + return await axios.post(`${BASE_URI}/create`, { + ...tag, + ownerType: tag.ownerType || "GAO_STORE", + ownerId + }); } async function update(tag: Tag): Promise { diff --git a/src/components/TagSelector.vue b/src/components/TagSelector.vue index fa69be8..54913bd 100644 --- a/src/components/TagSelector.vue +++ b/src/components/TagSelector.vue @@ -9,11 +9,11 @@ @right-button-click="confirmSelection" >
-
+
新增 + />
-
- - - -
+
+
+ + + +
+
@@ -202,15 +205,16 @@ watch(() => props.visible, async (value) => {