|
@@ -79,6 +79,7 @@ export function useBusinessSelect(type) {
|
|
|
|
|
|
// 门店筛选
|
|
|
import { storeSelect } from "@/api/business/list";
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
|
|
|
export function useStoreSelect(type) {
|
|
|
const storeData = reactive({
|
|
@@ -94,14 +95,17 @@ export function useStoreSelect(type) {
|
|
|
storeSelect(storeData.form).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
storeData.options = res.data;
|
|
|
- if (type && res.data.length > 1) {
|
|
|
+ if (
|
|
|
+ type &&
|
|
|
+ res.data.length > 1 &&
|
|
|
+ useUserStore().storeIds.length !== 0
|
|
|
+ ) {
|
|
|
storeData.options.unshift({
|
|
|
id: 0,
|
|
|
name: "全部",
|
|
|
});
|
|
|
}
|
|
|
- storeData.storeId =
|
|
|
- storeData.options.length > 0 ? storeData.options[0].id : null;
|
|
|
+ storeData.storeId = storeData.options.length > 0 ? storeData.options[0].id : null;
|
|
|
}
|
|
|
});
|
|
|
};
|