diff --git a/src/pages/customer/CustomerEdit.vue b/src/pages/customer/CustomerEdit.vue
index 6608e15..5289f4d 100644
--- a/src/pages/customer/CustomerEdit.vue
+++ b/src/pages/customer/CustomerEdit.vue
@@ -18,9 +18,6 @@
-
-
-
-
-
-
formData.name?.trim() && formData.storeId);
-
-// ---------- 门店选择 ----------
-
-const storePickerVisible = ref(false);
-const storePickerDraft = ref([]);
-const storePickerColumns = computed(() => [
- currentStoreStore.storeList.map(item => ({
- label: item.name || item.code || "未命名门店",
- value: item.id || ""
- })).filter(item => item.value)
-]);
-const selectedStoreName = computed(() => {
- const store = currentStoreStore.storeList.find(item => item.id === formData.storeId);
- return store?.name || store?.code || "请选择门店";
-});
-
-function openStorePicker(): void {
- if (!currentStoreStore.storeList.length) {
- Toast.warning("暂无可选门店");
- return;
- }
-
- storePickerDraft.value = [formData.storeId || ""];
- storePickerVisible.value = true;
-}
-
-function confirmStorePicker(): void {
- const storeId = String(storePickerDraft.value[0] || "");
- if (!storeId) {
- return;
- }
-
- formData.storeId = storeId;
- currentStoreStore.selectStore(storeId);
- storePickerVisible.value = false;
-}
+const canSubmit = computed(() => formData.name?.trim() && currentStoreStore.currentStoreId);
async function prepareStoreScope(): Promise {
if (isGlobalManager.value) {
await currentStoreStore.loadStoreList();
- const queryStoreId = String(route.query.storeId || "");
- formData.storeId = currentStoreStore.storeList.some(item => item.id === queryStoreId)
- ? queryStoreId
- : currentStoreStore.currentStoreId;
+ formData.storeId = currentStoreStore.currentStoreId;
return;
}
- const store = await currentStoreStore.loadLoginStore();
- formData.storeId = store?.id || "";
+ await currentStoreStore.loadLoginStore();
+ formData.storeId = currentStoreStore.currentStoreId;
}
async function loadDetail() {
@@ -434,8 +381,8 @@ async function loadDetail() {
try {
const customer = await CustomerAPI.detail(id);
Object.assign(formData, customer);
+ formData.storeId = currentStoreStore.currentStoreId;
await loadCustomerTags(id);
- formData.storeId = customer.storeId || formData.storeId;
photoItemList.value = (customer.attachmentList || [])
.filter(item => !!item.id)
.map(item => ({
@@ -579,7 +526,7 @@ async function doSubmit(): Promise {
Toast.warning("请填写姓名");
return;
}
- Toast.warning("请选择门店");
+ Toast.warning("当前门店未设置");
return;
}
if (!validateCustomerPhotoList()) {
@@ -589,6 +536,7 @@ async function doSubmit(): Promise {
isSubmitting.value = true;
try {
const payload: Customer = { ...formData };
+ payload.storeId = currentStoreStore.currentStoreId;
payload.conditioningPart = selectedAreas.value;
payload.introducerCustomerId = introducerCustomerId.value || "";
payload.attachmentList = buildAttachmentList();
diff --git a/src/pages/customer/CustomerList.vue b/src/pages/customer/CustomerList.vue
index 704f283..826ef8b 100644
--- a/src/pages/customer/CustomerList.vue
+++ b/src/pages/customer/CustomerList.vue
@@ -1,14 +1,6 @@
-
-
-
import { Toast } from "tdesign-mobile-vue";
-import { type DropdownValue } from "tdesign-mobile-vue";
import { type Page, type PageResult, Time, Toolkit, useUserStore } from "timi-web";
import CustomerAPI from "@/api/CustomerAPI";
import GenderIcon from "@/components/GenderIcon.vue";
@@ -132,28 +123,6 @@ const isExporting = ref(false);
const isGlobalManager = computed(() => userStore.hasRoles(gaoRoleCodes.globalManager));
const canReadTag = computed(() => userStore.hasPermissions(corePermissionCodes.tag.read));
-// ---------- 门店筛选 ----------
-
-const selectedStoreId = ref(currentStoreStore.currentStoreId);
-const storeOptions = computed(() => currentStoreStore.storeList
- .map(item => ({
- label: item.name || item.code || "未命名门店",
- value: item.id || ""
- }))
- .filter(item => item.value));
-const storeFilterLabel = computed(() => storeOptions.value.find(item => item.value === selectedStoreId.value)?.label || "选择门店");
-
-async function selectStoreFilter(value: DropdownValue): Promise {
- if (Array.isArray(value)) {
- return;
- }
-
- const storeId = String(value);
- selectedStoreId.value = storeId;
- currentStoreStore.selectStore(storeId);
- await refresh();
-}
-
// ---------- 标签筛选 ----------
const selectedTagList = ref([]);
@@ -196,7 +165,7 @@ const fetch = Toolkit.debounce(async () => {
const result = await CustomerAPI.list({
...page,
keyword: keyword.value,
- storeId: selectedStoreId.value,
+ storeId: currentStoreStore.currentStoreId,
tagIdList: selectedTagIdList.value
});
pageResult.total = result.total;
@@ -221,7 +190,6 @@ async function refresh(): Promise {
async function loadData(): Promise {
if (isGlobalManager.value) {
await currentStoreStore.loadStoreList();
- selectedStoreId.value = currentStoreStore.currentStoreId;
} else {
await currentStoreStore.loadLoginStore();
}
@@ -254,7 +222,7 @@ onUnmounted(() => {
async function toCreate(): Promise {
await router.push({
path: "/management/customers/create",
- query: isGlobalManager.value && selectedStoreId.value ? { storeId: selectedStoreId.value } : undefined
+ query: isGlobalManager.value && currentStoreStore.currentStoreId ? { storeId: currentStoreStore.currentStoreId } : undefined
});
}
@@ -291,13 +259,6 @@ async function doExport(): Promise {
box-shadow: var(--td-shadow-1);
align-items: center;
- .store {
-
- &:after {
- display: none;
- }
- }
-
.search {
width: 100%;
border: 1px solid rgba(148, 163, 184, .28);
diff --git a/src/pages/event/EventList.vue b/src/pages/event/EventList.vue
index 6064a4a..676c4ec 100644
--- a/src/pages/event/EventList.vue
+++ b/src/pages/event/EventList.vue
@@ -1,20 +1,8 @@
-