congxuesong пре 1 месец
родитељ
комит
8dddffdb0c

+ 223 - 156
src/assets/json/authMenuList.json

@@ -16,12 +16,12 @@
       }
     },
     {
-      "path": "/store/storeUser",
-      "name": "storeUser",
-      "redirect": "/store/storeUser/storeStaffConfigManagement",
+      "path": "/groupPackageManagement",
+      "name": "groupPackageManagement",
+      "redirect": "/groupPackageManagement/index",
       "meta": {
-        "icon": "Shop",
-        "title": "Demo",
+        "icon": "ShoppingBag",
+        "title": "团购管理",
         "isLink": "",
         "isHide": false,
         "isFull": false,
@@ -30,69 +30,40 @@
       },
       "children": [
         {
-          "path": "/store/storeUser/storeStaffConfigManagement",
-          "name": "storeStaffConfigManagement",
-          "component": "/store/storeUser/storeStaffConfigManagement/index",
+          "path": "/groupPackageManagement/index",
+          "name": "groupPackageManagementIndex",
+          "component": "/groupPackageManagement/index",
           "meta": {
-            "icon": "UserFilled",
-            "title": "人员管理",
+            "icon": "ShoppingBag",
+            "title": "团购管理",
             "isLink": "",
             "isHide": false,
             "isFull": false,
             "isAffix": false,
             "isKeepAlive": false
           }
+        },
+        {
+          "path": "/groupPackageManagementDetail",
+          "name": "groupPackageManagementDetail",
+          "component": "/groupPackageManagement/detail",
+          "meta": {
+            "icon": "Menu",
+            "title": "团购管理详情",
+            "activeMenu": "/groupPackageManagement",
+            "isLink": "",
+            "isHide": true,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
         }
       ]
     },
     {
-      "path": "/store/storeUser/storeStaffConfigManagementDetail",
-      "name": "storeStaffConfigManagementDetail",
-      "component": "/store/storeUser/storeStaffConfigManagement/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "员工信息详细",
-        "activeMenu": "/store/storeUser/storeStaffConfigManagement",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/groupPackageManagement",
-      "name": "groupPackageManagement",
-      "component": "/groupPackageManagement/index",
-      "meta": {
-        "icon": "ShoppingBag",
-        "title": "团购管理",
-        "isLink": "",
-        "isHide": false,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/groupPackageManagementDetail",
-      "name": "groupPackageManagementDetail",
-      "component": "/groupPackageManagement/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "团购管理详情",
-        "activeMenu": "/groupPackageManagement",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
-    },
-    {
       "path": "/couponManagement",
       "name": "couponManagement",
-      "component": "/couponManagement/index",
+      "redirect": "/couponManagement/index",
       "meta": {
         "icon": "Ticket",
         "title": "优惠券管理",
@@ -101,27 +72,43 @@
         "isFull": false,
         "isAffix": false,
         "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/couponManagementDetail",
-      "name": "couponManagementDetail",
-      "component": "/couponManagement/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "优惠券管理详情",
-        "activeMenu": "/couponManagement",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
+      },
+      "children": [
+        {
+          "path": "/couponManagement/index",
+          "name": "couponManagementIndex",
+          "component": "/couponManagement/index",
+          "meta": {
+            "icon": "Ticket",
+            "title": "优惠券管理",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        },
+        {
+          "path": "/couponManagementDetail",
+          "name": "couponManagementDetail",
+          "component": "/couponManagement/detail",
+          "meta": {
+            "icon": "Menu",
+            "title": "优惠券管理详情",
+            "activeMenu": "/couponManagement",
+            "isLink": "",
+            "isHide": true,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        }
+      ]
     },
     {
       "path": "/voucherManagement",
       "name": "voucherManagement",
-      "component": "/voucherManagement/index",
+      "redirect": "/voucherManagement/index",
       "meta": {
         "icon": "Money",
         "title": "代金券管理",
@@ -130,27 +117,43 @@
         "isFull": false,
         "isAffix": false,
         "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/voucherManagementDetail",
-      "name": "voucherManagementDetail",
-      "component": "/voucherManagement/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "代金券管理详情",
-        "activeMenu": "/voucherManagement",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
+      },
+      "children": [
+        {
+          "path": "/voucherManagement/index",
+          "name": "voucherManagementIndex",
+          "component": "/voucherManagement/index",
+          "meta": {
+            "icon": "Money",
+            "title": "代金券管理",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        },
+        {
+          "path": "/voucherManagementDetail",
+          "name": "voucherManagementDetail",
+          "component": "/voucherManagement/detail",
+          "meta": {
+            "icon": "Menu",
+            "title": "代金券管理详情",
+            "activeMenu": "/voucherManagement",
+            "isLink": "",
+            "isHide": true,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        }
+      ]
     },
     {
       "path": "/orderManagement",
       "name": "orderManagement",
-      "component": "/orderManagement/index",
+      "redirect": "/orderManagement/index",
       "meta": {
         "icon": "Document",
         "title": "订单管理",
@@ -159,27 +162,43 @@
         "isFull": false,
         "isAffix": false,
         "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/orderManagementDetail",
-      "name": "orderManagementDetail",
-      "component": "/orderManagement/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "订单管理详情",
-        "activeMenu": "/orderManagement",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
+      },
+      "children": [
+        {
+          "path": "/orderManagement/index",
+          "name": "orderManagementIndex",
+          "component": "/orderManagement/index",
+          "meta": {
+            "icon": "Document",
+            "title": "订单管理",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        },
+        {
+          "path": "/orderManagementDetail",
+          "name": "orderManagementDetail",
+          "component": "/orderManagement/detail",
+          "meta": {
+            "icon": "Menu",
+            "title": "订单管理详情",
+            "activeMenu": "/orderManagement",
+            "isLink": "",
+            "isHide": true,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        }
+      ]
     },
     {
       "path": "/storeDecoration",
       "name": "storeDecoration",
-      "component": "/storeDecoration/index",
+      "redirect": "/storeDecoration/index",
       "meta": {
         "icon": "Brush",
         "title": "门店装修",
@@ -188,27 +207,43 @@
         "isFull": false,
         "isAffix": false,
         "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/storeDecorationDetail",
-      "name": "storeDecorationDetail",
-      "component": "/storeDecoration/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "门店装修详情",
-        "activeMenu": "/storeDecoration",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
+      },
+      "children": [
+        {
+          "path": "/storeDecoration/index",
+          "name": "storeDecorationIndex",
+          "component": "/storeDecoration/index",
+          "meta": {
+            "icon": "Brush",
+            "title": "门店装修",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        },
+        {
+          "path": "/storeDecorationDetail",
+          "name": "storeDecorationDetail",
+          "component": "/storeDecoration/detail",
+          "meta": {
+            "icon": "Menu",
+            "title": "门店装修详情",
+            "activeMenu": "/storeDecoration",
+            "isLink": "",
+            "isHide": true,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        }
+      ]
     },
     {
       "path": "/licenseManagement",
       "name": "licenseManagement",
-      "component": "/licenseManagement/index",
+      "redirect": "/licenseManagement/index",
       "meta": {
         "icon": "Files",
         "title": "证照管理",
@@ -217,27 +252,43 @@
         "isFull": false,
         "isAffix": false,
         "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/licenseManagementDetail",
-      "name": "licenseManagementDetail",
-      "component": "/licenseManagement/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "证照管理详情",
-        "activeMenu": "/licenseManagement",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
+      },
+      "children": [
+        {
+          "path": "/licenseManagement/index",
+          "name": "licenseManagementIndex",
+          "component": "/licenseManagement/index",
+          "meta": {
+            "icon": "Files",
+            "title": "证照管理",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        },
+        {
+          "path": "/licenseManagementDetail",
+          "name": "licenseManagementDetail",
+          "component": "/licenseManagement/detail",
+          "meta": {
+            "icon": "Menu",
+            "title": "证照管理详情",
+            "activeMenu": "/licenseManagement",
+            "isLink": "",
+            "isHide": true,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        }
+      ]
     },
     {
       "path": "/financialManagement",
       "name": "financialManagement",
-      "component": "/financialManagement/index",
+      "redirect": "/financialManagement/index",
       "meta": {
         "icon": "CreditCard",
         "title": "财务管理",
@@ -246,22 +297,38 @@
         "isFull": false,
         "isAffix": false,
         "isKeepAlive": false
-      }
-    },
-    {
-      "path": "/financialManagementDetail",
-      "name": "financialManagementDetail",
-      "component": "/financialManagement/detail",
-      "meta": {
-        "icon": "Menu",
-        "title": "财务管理详情",
-        "activeMenu": "/financialManagement",
-        "isLink": "",
-        "isHide": true,
-        "isFull": false,
-        "isAffix": false,
-        "isKeepAlive": false
-      }
+      },
+      "children": [
+        {
+          "path": "/financialManagement/index",
+          "name": "financialManagementIndex",
+          "component": "/financialManagement/index",
+          "meta": {
+            "icon": "CreditCard",
+            "title": "财务管理",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        },
+        {
+          "path": "/financialManagementDetail",
+          "name": "financialManagementDetail",
+          "component": "/financialManagement/detail",
+          "meta": {
+            "icon": "Menu",
+            "title": "财务管理详情",
+            "activeMenu": "/financialManagement",
+            "isLink": "",
+            "isHide": true,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        }
+      ]
     }
   ],
   "msg": "成功"

+ 0 - 130
src/views/store/storeUser/storeStaffConfigManagement/detail.vue

@@ -1,130 +0,0 @@
-<template>
-  <div class="card content-box">
-    <el-form :model="formData" label-width="140px">
-      <el-row>
-        <el-col :span="12">
-          <el-form-item label="店铺名称 :">
-            <span>{{ formData.storeName }}</span>
-          </el-form-item>
-          <el-form-item label="姓名/昵称 :">
-            <span>{{ formData.name }}</span>
-          </el-form-item>
-          <el-form-item label="人员职称 :">
-            <span>{{ formData.staffPosition }}</span>
-          </el-form-item>
-          <el-form-item label="头像">
-            <div v-if="formData.staffImage" style="margin-right: 10px">
-              <el-image :src="formData.staffImage" style="width: 100px; height: 100px" />
-            </div>
-          </el-form-item>
-          <el-form-item label="擅长:">
-            <span>{{ formData.proficientProjects }}</span>
-          </el-form-item>
-          <el-form-item label="标签 :">
-            <div class="tag-container">
-              <el-tag v-for="(tag, index) in tagList" :key="index" :closable="false" class="tag-item">
-                {{ tag }}
-              </el-tag>
-            </div>
-          </el-form-item>
-          <el-form-item label="个人简介 :">
-            <span>{{ formData.personalIntroduction }}</span>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="状态:">
-            <span>{{ getStatusName(formData.status) }}</span>
-          </el-form-item>
-          <el-form-item label="拒绝原因:" v-if="formData.status === '2'">
-            <span>{{ formData.rejectionReason }}</span>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row class="text-center" style="margin-top: 20px">
-        <el-col :span="24">
-          <el-button type="primary" @click="goBack"> 确定 </el-button>
-        </el-col>
-      </el-row>
-    </el-form>
-  </div>
-</template>
-
-<script setup lang="tsx" name="useProTable">
-import { ref, onMounted, computed } from "vue";
-import { useRoute, useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
-import { getStaffConfigDeatail } from "@/api/modules/staffConfig";
-
-const route = useRoute();
-const router = useRouter();
-
-const formData = ref({});
-
-const id = ref((route.query.id as string) || "");
-
-const getStatusName = (status: string) => {
-  switch (status) {
-    case "0":
-      return "待审核";
-    case "1":
-      return "审核通过";
-    case "2":
-      return "审核拒绝";
-    default:
-      return "未知状态";
-  }
-};
-
-onMounted(async () => {
-  await initData();
-});
-
-const initData = async () => {
-  if (id.value) {
-    try {
-      const response = await getStaffConfigDeatail({ id: id.value });
-      if (response.code === 200) {
-        formData.value = response.data;
-      }
-    } catch (error) {
-      ElMessage.error("获取详情失败");
-    }
-  }
-};
-
-// 计算属性:将逗号分隔的字符串转为数组(并去除前后空格)
-const tagList = computed(() => {
-  if (!formData.value.tag) return [];
-  return formData.value.tag.split(",").map(tag => tag.trim()); // 去除标签前后空格
-});
-
-const goBack = () => {
-  router.go(-1);
-};
-</script>
-
-<style lang="scss" scoped>
-.el-form {
-  width: 100%;
-  .text-center {
-    text-align: center;
-  }
-}
-.el-col {
-  box-sizing: border-box;
-  padding-right: 10px;
-}
-.tag-container {
-  display: flex;
-  flex-wrap: wrap;
-  gap: 8px; /* 标签之间的间距 */
-  padding-top: 8px; /* 与标签名的间距 */
-}
-.tag-item {
-  color: #4a90e2;
-
-  /* 可自定义标签样式,以下为示例 */
-  background-color: #f0f5f9;
-  border: 1px solid #e0e6ed;
-}
-</style>

+ 0 - 223
src/views/store/storeUser/storeStaffConfigManagement/index.vue

@@ -1,223 +0,0 @@
-<template>
-  <div class="table-box">
-    <ProTable ref="proTable" :columns="columns" :data-callback="dataCallback" :init-param="initParam" :request-api="getTableList">
-      <!-- 表格 header 按钮 -->
-      <!-- <template #tableHeader="scope">
-          <el-button type="primary" :icon="CirclePlus" @click="openDrawer('新增')">新增商铺及商铺管理员</el-button>
-        </template> -->
-      <!-- Expand -->
-      <template #tableHeader="scope">
-        <el-button :icon="Download" type="primary" @click="exportInfoExcel(scope)"> 导出 </el-button>
-      </template>
-      <template #expand="scope">
-        {{ scope.row }}
-      </template>
-      <!-- usernameHeader -->
-      <template #usernameHeader="scope">
-        <el-button type="primary" @click="ElMessage.success('我是通过作用域插槽渲染的表头')">
-          {{ scope.column.label }}
-        </el-button>
-      </template>
-      <!-- createTime -->
-      <template #createTime="scope">
-        <el-button link type="primary" @click="ElMessage.success('我是通过作用域插槽渲染的内容')">
-          {{ scope.row.createTime }}
-        </el-button>
-      </template>
-      <!-- 表格操作 -->
-      <template #operation="scope">
-        <!-- 审批通过和拒绝按钮仅在状态为0时显示 -->
-        <template v-if="scope.row.status === '0'">
-          <el-button link type="primary" @click="changeTypes(scope.row, 'pass')"> 审核通过 </el-button>
-          <el-button link type="primary" @click="changeTypes(scope.row, '')"> 审核拒绝 </el-button>
-        </template>
-        <el-button link type="primary" @click="toDetail(scope.row)"> 查看详情 </el-button>
-      </template>
-    </ProTable>
-
-    <el-dialog v-model="dialogFormVisible" title="审核拒绝" width="500">
-      <el-form :model="form">
-        <el-form-item label="" label-width="0">
-          <el-input v-model="form.comment" autocomplete="off" maxlength="200" type="textarea" />
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button @click="closeDialog"> 取消 </el-button>
-          <el-button type="primary" @click="handleSubmit"> 驳回 </el-button>
-        </div>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script setup lang="tsx" name="useProTable">
-import { ref, reactive, onMounted, onActivated, computed } from "vue";
-import { useRouter } from "vue-router";
-import { type Course, GroupPackage, StaffConfig } from "@/api/interface";
-import { dayjs, ElMessage, FormInstance } from "element-plus";
-import ProTable from "@/components/ProTable/index.vue";
-import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
-import { Download } from "@element-plus/icons-vue";
-import { audit, exportExcelStaffConfig, getStaffConfigList } from "@/api/modules/staffConfig";
-
-const router = useRouter();
-const dialogFormVisible = ref(false);
-const form = reactive({
-  comment: ""
-});
-
-const rowData = ref<any>();
-
-const statusEnum = [
-  { value: "0", label: "待审核" },
-  { value: "1", label: "审核通过" },
-  { value: "2", label: "审核拒绝" }
-];
-// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
-const initParam = reactive({});
-
-// 定义 filterValues
-const filterValues = reactive({});
-
-const getStatusObj = (statusValue: string) => {
-  const statusObj = statusEnum.find(item => item.value === statusValue);
-  if (statusObj) {
-    filterValues.status = statusObj;
-  } else {
-    filterValues.status = "";
-  }
-  console.log("statusObj", statusObj);
-  return statusObj;
-};
-
-// ProTable 实例
-const proTable = ref<ProTableInstance>();
-
-// 页面加载时触发查询
-onMounted(() => {
-  proTable.value?.getTableList();
-});
-
-// 从其他页面返回时触发查询
-onActivated(() => {
-  proTable.value?.getTableList();
-});
-
-// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
-// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
-const dataCallback = (data: any) => {
-  return {
-    list: data.records,
-    total: data.total
-  };
-};
-
-// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
-// 默认不做操作就直接在 ProTable 组件上绑定	:requestApi="getUserList"
-const getTableList = (params: any) => {
-  let newParams = JSON.parse(JSON.stringify(params));
-  return getStaffConfigList(newParams);
-};
-
-// 跳转详情页
-const toDetail = row => {
-  router.push(`/store/storeUser/storeStaffConfigManagementDetail?id=${row.id}`);
-};
-
-// 表格配置项
-const columns = reactive<ColumnProps<StaffConfig.StaffConfigList>[]>([
-  { type: "index", fixed: "left", label: "序号", width: 130 },
-  { prop: "storeName", label: "所属店铺" },
-  { prop: "name", label: "姓名/昵称" },
-  { prop: "staffPosition", label: "职位" },
-  {
-    prop: "status",
-    label: "状态",
-    render: scope => {
-      // const statusObj = statusEnum.find(item => item.value === scope.row.status);
-      const statusObj = getStatusObj(scope.row.status);
-      return statusObj ? statusObj.label : "未知状态";
-    },
-    search: {
-      el: "select"
-    },
-    enum: statusEnum,
-    fieldNames: { label: "label", value: "value" }
-  },
-  { prop: "operation", label: "操作", fixed: "right", width: 330 }
-]);
-
-const changeTypes = (row: any, status: string) => {
-  rowData.value = row;
-  if (status === "pass") {
-    handleChangeStatus(row, "1");
-  } else {
-    form.comment = "";
-    dialogFormVisible.value = true;
-  }
-};
-
-const handleChangeStatus = async (row: any, status: string) => {
-  try {
-    let res = await audit({ id: row.id, status: status, rejectionReason: form.comment });
-    if (res.code === 200) {
-      proTable.value?.getTableList();
-      console.log("status", status);
-      if (status === "2") closeDialog();
-      ElMessage.success("审核成功");
-    }
-  } catch (error) {
-    ElMessage.error("操作失败");
-  }
-};
-
-// 导出信息
-const exportInfoExcel = async scope => {
-  let res;
-  // 获取原始状态值(可能为数字、字符串或 undefined)
-  const rawStatus = proTable.value.searchParam.status;
-  // 转换为字符串(处理 undefined/null 为 "" 或保留原始字符串)
-  const statusParam = rawStatus !== undefined && rawStatus !== null ? String(rawStatus) : undefined;
-  // 将筛选条件作为参数传递给后台
-  res = await exportExcelStaffConfig({ status: statusParam });
-  if (res.code === 200) {
-    if (!res.data) {
-      ElMessage.error("暂无可下载数据");
-      return;
-    }
-    const exportFile = document.createElement("a");
-    exportFile.style.display = "none";
-    exportFile.download = `员工管理.xlsx`;
-    exportFile.href = `${res.data}?timestamp=${new Date().getTime()}`; // 添加时间戳防止缓存
-    document.body.appendChild(exportFile);
-    exportFile.click();
-    document.body.removeChild(exportFile);
-    ElMessage.success("下载成功");
-  }
-};
-
-// 弹窗提交
-const handleSubmit = () => {
-  if (!form.comment) {
-    ElMessage.error("请输入审批意见");
-    return;
-  }
-  handleChangeStatus(rowData.value, "2");
-};
-// 关闭弹窗;
-const closeDialog = () => {
-  dialogFormVisible.value = false;
-  form.comment = "";
-};
-</script>
-
-<style lang="scss" scoped>
-// 在组件样式中添加
-.date-range {
-  display: block; // 确保换行生效
-  padding: 0 8px; // 可选:增加内边距
-  word-wrap: break-word; // 长单词内换行
-  white-space: normal; // 允许自然换行
-}
-</style>