Bladeren bron

修改bug

lxr 2 maanden geleden
bovenliggende
commit
4166475a4d

+ 12 - 3
src/api/modules/performance.ts

@@ -177,12 +177,21 @@ export const setPerformanceOnlineStatus = (id: number | string, onlineStatus: nu
 };
 
 /** 表演嘉宾列表(员工/嘉宾可选列表,用于新建编辑时选择) */
-export const getGuestListPage = (params: { pageNum?: number; pageSize?: number; storeId?: string; keyword?: string }) => {
+export const getGuestListPage = (params: {
+  pageNum?: number;
+  pageSize?: number;
+  onlineStatus?: number;
+  status?: number;
+  storeId?: string;
+  staffName?: string;
+}) => {
   const storeId = params.storeId ?? (localGet("createdId") as string) ?? "";
   const pageNum = params.pageNum ?? 1;
   const pageSize = params.pageSize ?? 20;
-  const query: any = { pageNum, pageSize, storeId };
-  if (params.keyword) query.keyword = params.keyword;
+  const onlineStatus = params.onlineStatus ?? 0;
+  const status = params.status ?? 1;
+  const query: any = { pageNum, pageSize, storeId, onlineStatus, status };
+  if (params.staffName) query.staffName = params.staffName;
   return performanceAxios.get<any>(PORT_NONE + "/storeStaffConfig/getStaffConfigList", { params: query });
 };
 

+ 15 - 14
src/assets/json/authMenuList.json

@@ -183,6 +183,21 @@
       ]
     },
     {
+      "path": "/storeDecoration/personnelConfig",
+      "name": "personnelConfig",
+      "component": "/storeDecoration/personnelConfig/index",
+      "meta": {
+        "icon": "User",
+        "title": "人员配置",
+        "isLink": "",
+        "isHide": false,
+        "isFull": false,
+        "isAffix": false,
+        "isKeepAlive": false
+      },
+      "children": []
+    },
+    {
       "path": "/performance",
       "name": "performance",
       "component": "/performance/index",
@@ -390,20 +405,6 @@
           }
         },
         {
-          "path": "/storeDecoration/personnelConfig",
-          "name": "personnelConfig",
-          "component": "/storeDecoration/personnelConfig/index",
-          "meta": {
-            "icon": "User",
-            "title": "人员配置",
-            "isLink": "",
-            "isHide": false,
-            "isFull": false,
-            "isAffix": false,
-            "isKeepAlive": false
-          }
-        },
-        {
           "path": "/storeDecoration/facilitiesAndServices",
           "name": "facilitiesAndServices",
           "component": "/storeDecoration/facilitiesAndServices/index",

+ 16 - 1
src/stores/modules/auth.ts

@@ -38,11 +38,12 @@ export const useAuthStore = defineStore({
       const hasPermission = await usePermission();
       const hideMenuNames = ["storeDecoration", "financialManagement", "licenseManagement", "dynamicManagement"];
 
-      // 获取用户信息和 businessSection(经营板块)、mealsFlag(是否提供餐食)、storeId
+      // 获取用户信息和 businessSection(经营板块)、mealsFlag(是否提供餐食)、storeId、storeTickets
       const userInfo = localGet("geeker-user")?.userInfo || {};
       const businessSection = Number(userInfo.businessSection || localGet("businessSection") || 0);
       const mealsFlag = Number(userInfo.mealsFlag || localGet("mealsFlag") || 0);
       const storeId = userInfo.storeId ?? localGet("createdId");
+      const storeTickets = Number(userInfo.storeTickets ?? localGet("storeTickets") ?? 0);
 
       // 递归处理菜单的显示/隐藏状态
       const processMenus = (menuList: any[]) => {
@@ -114,9 +115,23 @@ export const useAuthStore = defineStore({
                 // 有店铺且为休闲娱乐(businessSection=2) 时显示演出
                 menu.meta.isHide = !storeId || businessSection !== 2;
                 break;
+              case "门店装修":
+                menu.meta.isHide = !storeId;
+                break;
             }
           }
 
+          // 门店装修:根据 storeTickets 只显示其一,0=只显示「门店装修」,1=只显示「装修公司」
+          if (menu.name === "storeDecorationManagement" && menu.children?.length) {
+            menu.children.forEach((child: any) => {
+              if (child.meta?.title === "门店装修") {
+                child.meta.isHide = storeTickets !== 0;
+              } else if (child.meta?.title === "装修公司") {
+                child.meta.isHide = storeTickets !== 1;
+              }
+            });
+          }
+
           // 处理子菜单
           // if (menu.children && menu.children.length > 0) {
           //   // 检查子菜单中是否有需要显示的菜单项

+ 19 - 22
src/views/home/components/go-flow.vue

@@ -317,7 +317,7 @@ const businessLabelList = ref<any[]>([
     dictDetail: "装修公司"
   },
   {
-    dictId: 2,
+    dictId: 0,
     dictDetail: "其他类型"
   }
 ]);
@@ -397,22 +397,21 @@ const isIdCardUploadComplete = computed(() => {
 // 下一步 - 验证身份证正反面是否已上传
 const handleNextStep = async () => {
   // 识别成功,进入下一步
-  // try {
-  //   const res: any = await verifyIdInfo({
-  //     idCard: ocrResult.value.idCard,
-  //     name: ocrResult.value.name,
-  //     appType: 1
-  //   });
-  //   if (res.code === 200) {
-  //     ElMessage.success("身份证识别成功");
-  //     setStep(2);
-  //   } else {
-  //     ElMessage.error(res?.msg || "身份证识别失败");
-  //   }
-  // } catch (error: any) {
-  //   console.log(error);
-  // }
-  setStep(2);
+  try {
+    const res: any = await verifyIdInfo({
+      idCard: ocrResult.value.idCard,
+      name: ocrResult.value.name,
+      appType: 1
+    });
+    if (res.code === 200) {
+      ElMessage.success("身份证识别成功");
+      setStep(2);
+    } else {
+      ElMessage.error(res?.msg || "身份证识别失败");
+    }
+  } catch (error: any) {
+    console.log(error);
+  }
 };
 const step2Rules: FormRules = {
   storeName: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
@@ -485,7 +484,7 @@ const changeBusinessSection = () => {
     showDisportLicence.value = true;
   } else {
     showDisportLicence.value = false;
-    step2Form.storeTickets = "";
+    step2Form.storeTickets = "0";
   }
 };
 // 隐藏财务管理菜单的函数
@@ -605,7 +604,7 @@ const step2Form = reactive({
   storeAddress: "",
   storeBlurb: "",
   businessSection: 1,
-  storeTickets: "" as string,
+  storeTickets: "0" as string,
   businessSecondLevel: [] as string[],
   businessTypes: "" as string,
   businessTypesList: [] as string[],
@@ -1224,9 +1223,7 @@ const handleSubmit = async () => {
         idCard: localGet("idCard") || ""
       };
 
-      if (String(step2Form.businessSection) === "3") {
-        storeInfoDto.storeTickets = step2Form.storeTickets;
-      }
+      storeInfoDto.storeTickets = step2Form.storeTickets;
 
       const saveStoreInfoParams = {
         ...storeInfoDto,

+ 31 - 3
src/views/performance/components/GuestSelectDialog.vue

@@ -34,7 +34,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, watch } from "vue";
+import { ref, watch, nextTick } from "vue";
 import { User } from "@element-plus/icons-vue";
 import { localGet } from "@/utils";
 import type { ElTable } from "element-plus";
@@ -53,6 +53,8 @@ export interface GuestItem {
 const props = defineProps<{
   modelValue: boolean;
   selectedIds?: (string | number)[];
+  /** 已选嘉宾完整列表,用于合并确认结果(未出现在当前列表的嘉宾会保留) */
+  selectedGuests?: GuestItem[];
 }>();
 
 const emit = defineEmits<{
@@ -67,6 +69,8 @@ const guestList = ref<GuestItem[]>([]);
 const selectedRows = ref<GuestItem[]>([]);
 const tableRef = ref<InstanceType<typeof ElTable>>();
 
+const selectedIdSet = () => new Set((props.selectedIds ?? []).map(id => String(id)));
+
 watch(
   () => props.modelValue,
   v => {
@@ -85,7 +89,9 @@ async function loadList() {
       storeId: localGet("createdId") as string,
       pageNum: 1,
       pageSize: 100,
-      keyword: keyword.value || undefined
+      onlineStatus: 0,
+      status: 1,
+      staffName: keyword.value || undefined
     });
     const raw = res?.data ?? res;
     const list = raw?.records ?? raw?.list ?? (Array.isArray(raw) ? raw : []);
@@ -96,6 +102,8 @@ async function loadList() {
       avatar: item.avatar ?? item.staffImage ?? item.headImg,
       position: item.position ?? item.staffPosition ?? item.style
     }));
+    await nextTick();
+    restoreSelection();
   } catch (e) {
     guestList.value = [];
   } finally {
@@ -103,6 +111,15 @@ async function loadList() {
   }
 }
 
+function restoreSelection() {
+  const ids = selectedIdSet();
+  const tbl = tableRef.value;
+  if (!tbl || !ids.size) return;
+  guestList.value.forEach(row => {
+    if (ids.has(String(row.id))) tbl.toggleRowSelection(row, true);
+  });
+}
+
 function search() {
   loadList();
 }
@@ -117,7 +134,18 @@ function onSelectionChange(rows: GuestItem[]) {
 }
 
 function confirm() {
-  emit("confirm", selectedRows.value);
+  const idsInList = new Set(guestList.value.map(r => String(r.id)));
+  const existingNotInList = (props.selectedGuests ?? []).filter(g => !idsInList.has(String(g.id)));
+  const merged = [...existingNotInList];
+  const seen = new Set(existingNotInList.map(g => String(g.id)));
+  selectedRows.value.forEach(row => {
+    const id = String(row.id);
+    if (!seen.has(id)) {
+      seen.add(id);
+      merged.push(row);
+    }
+  });
+  emit("confirm", merged);
   visible.value = false;
 }
 

+ 7 - 2
src/views/performance/edit.vue

@@ -241,7 +241,7 @@
           <el-col :span="12">
             <el-form-item label="表演嘉宾">
               <el-link v-if="!viewMode" type="primary" @click="openGuestSelect"> 请添加 </el-link>
-              <div v-if="form.guests.length" class="guest-list">
+              <div v-if="form.guests?.length" class="guest-list">
                 <div v-for="g in form.guests" :key="String(g.id)" class="guest-item">
                   <el-avatar :size="32" :src="g.avatar">
                     <el-icon><User /></el-icon>
@@ -299,7 +299,12 @@
       </div>
     </div>
 
-    <GuestSelectDialog v-model="guestSelectVisible" :selected-ids="selectedGuestIds" @confirm="onGuestsConfirm" />
+    <GuestSelectDialog
+      v-model="guestSelectVisible"
+      :selected-ids="selectedGuestIds"
+      :selected-guests="form.guests"
+      @confirm="onGuestsConfirm"
+    />
   </div>
 </template>