Explorar el Código

feat(groupPackage): 更新团购管理页面及接口调整

- 调整商家信息展示模板,优化图片预览功能
- 更新团购状态和审核状态的显示逻辑
- 修改表格字段配置,包括名称、库存、价格等列
- 调整状态筛选标签页选项及其对应值
-修正初始化参数设置,确保正确传递查询条件
- 移动部分 API 接口定义位置,保持代码结构清晰
- 删除冗余的注释和无用代码段
- 添加样式类以美化信息展示区域布局
congxuesong hace 5 meses
padre
commit
f21c0ceeb2

+ 12 - 18
src/api/modules/groupPackageManagement.ts

@@ -9,6 +9,18 @@ import http from "@/api";
 export const getThaliList = params => {
   return http.get<ResPage<StoreUser.ResStoreUserList>>(PORT_NONE + `/PcGroupBuy/getThaliList`, params);
 };
+export const saveStoreInfo = (params: { id: string }) => {
+  return http.post(PORT_NONE + `/store/info/saveStoreInfo`, params);
+};
+export const getUserByPhone = params => {
+  return http.get(PORT_NONE + `/store/user/getUserByPhone`, params);
+};
+export const getDetail = params => {
+  return http.get(PORT_NONE + `/store/info/getDetail`, params);
+};
+export const getMenuByStoreId = params => {
+  return http.get(PORT_NONE + `/menu/getMenuByStoreId`, params);
+};
 
 // 新增商家端用户
 export const addStoreUser = (params: { id: string }) => {
@@ -65,18 +77,6 @@ export const addBusinessSectionAndTypes = (params: {
 };
 
 //新增商铺信息
-export const saveStoreInfo = (params: { id: string }) => {
-  return http.post(PORT_NONE + `/store/info/saveStoreInfo`, params);
-};
-export const getUserByPhone = params => {
-  return http.get(PORT_NONE + `/store/user/getUserByPhone`, params);
-};
-export const getDetail = params => {
-  return http.get(PORT_NONE + `/store/info/getDetail`, params);
-};
-export const getMenuByStoreId = params => {
-  return http.get(PORT_NONE + `/menu/getMenuByStoreId`, params);
-};
 
 //获取商铺明细信息
 export const getStoreDetail = (params: StoreUser.ReqUserParams) => {
@@ -87,12 +87,6 @@ export const getStoreDetail = (params: StoreUser.ReqUserParams) => {
 export const editStoreInfo = (params: { id: string }) => {
   return http.post(PORT_NONE + `/store/info/editStoreInfo`, params);
 };
-
-// 修改商铺用户
-// export const editStoreUser1 = (params: { id: string }) => {
-//   return http.post(PORT_NONE + `/store/info/editStoreInfo`, params);
-// };
-
 // 删除商铺信息
 export const deleteStoreInfo = (params: { id: string }) => {
   return http.post(PORT_NONE + `/store/info/deleteStoreInfo`, params);

+ 47 - 28
src/views/groupPackageManagement/index.vue

@@ -11,19 +11,19 @@
         </div>
       </template>
       <template #Information="scope">
-        <div>
-          <el-image :src="scope.row.homeImage" />
-          <div>
-            <p>团购名称:{{ scope.row.goodsName }}</p>
-            <p>团购编号:{{ scope.row.goodsDesc }}</p>
-            <p>结束时间:{{ scope.row.goodsDesc }}</p>
+        <div class="information">
+          <el-image :src="scope.row.imageValueStr[0]" :preview-src-list="scope.row.imageValueStr" preview-teleported />
+          <div class="information-right">
+            <p>团购名称:{{ scope.row.groupName }}</p>
+            <p>团购编号:{{ scope.row.groupNo }}</p>
+            <p>结束时间:{{ scope.row.endTime }}</p>
           </div>
         </div>
       </template>
       <template #status="scope">
-        <p>团购状态:{{ scope.row.status }}</p>
-        <p>审核状态:{{ scope.row.status }}</p>
-      </template>
+        <p>团购状态:{{ allTabOptions.find(item => item.name === scope.row.groupType)?.label ?? "--" }}</p>
+        <p>审核状态:{{ statusEnum.find(item => item.value === scope.row.reviewType)?.label ?? "--" }}</p> </template
+      >:
       <!-- 表格操作 -->
       <template #operation="scope">
         <!-- 审批通过和拒绝按钮仅在状态为0时显示 -->
@@ -79,7 +79,7 @@ const formInventory: any = ref({
   newInventory: ""
 });
 const rowData = ref<any>();
-const activeName = ref("0");
+const activeName = ref("");
 
 const ruleFormRef = ref<FormInstance>();
 const rules = reactive<FormRules<RuleForm>>({
@@ -112,7 +112,7 @@ const columns = reactive<ColumnProps<any>[]>([
     }
   },
   {
-    prop: "tradeNo",
+    prop: "groupName",
     label: "团购名称",
     isShow: false,
     search: {
@@ -129,35 +129,41 @@ const columns = reactive<ColumnProps<any>[]>([
   },
   {
     prop: "Information",
-    label: "团购信息"
+    label: "团购信息",
+    width: 400
   },
   {
     prop: "goodsId",
     label: "已售"
   },
   {
-    prop: "goodsId",
-    isShow: false,
+    prop: "inventoryNum",
     label: "剩余库存"
   },
   {
     prop: "goodsId",
-    label: "优惠价"
+    label: "优惠价",
+    render: (scope: any) => {
+      return `¥${scope.row.preferentialPrice}`;
+    }
   },
   {
     prop: "goodsId",
-    label: "成本价"
+    label: "成本价",
+    render: (scope: any) => {
+      return `¥${scope.row.originalPrice}`;
+    }
   },
   {
     prop: "goodsId",
     label: "利润"
   },
   {
-    prop: "tradeStatus",
+    prop: "reviewType",
     label: "审核状态",
     isShow: false,
     render: scope => {
-      const statusObj = statusEnum.find(item => item.value === scope.row.tradeStatus);
+      const statusObj = statusEnum.find(item => item.value === scope.row.reviewType);
       return statusObj ? statusObj.label : "--";
     },
     search: {
@@ -175,19 +181,19 @@ const columns = reactive<ColumnProps<any>[]>([
 
 // 在 script setup 中添加
 const allTabOptions = [
-  { label: "全部", name: "0" },
-  { label: "草稿", name: "1" },
-  { label: "进行中", name: "2" },
-  { label: "未开始", name: "3" },
-  { label: "已下架", name: "4" },
-  { label: "已售罄", name: "5" },
-  { label: "已结束", name: "6" }
+  { label: "全部", name: "" },
+  { label: "草稿", name: "0" },
+  { label: "进行中", name: "5" },
+  { label: "待审核", name: "1" },
+  { label: "审核拒绝", name: "3" },
+  { label: "已售罄", name: "4" },
+  { label: "已结束", name: "7" }
 ];
 
 // 获取当前审核状态
 const currentAuditStatus = computed(() => {
   if (!proTable.value?.searchParam) return "";
-  return proTable.value.searchParam.tradeStatus || "";
+  return proTable.value.searchParam.reviewType || "";
 });
 
 // 控制 el-tabs 是否显示:当审核状态为空或审核通过时显示
@@ -215,14 +221,16 @@ watch(
   newStatus => {
     if (!newStatus || newStatus === "-2") {
       // 审核状态为空时,确保 activeName 为草稿
-      activeName.value = "0";
+      activeName.value = "";
     }
   },
   { immediate: true }
 );
 // 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
 const initParam = reactive({
-  activeName: activeName
+  storeId: "104",
+  groupType: "1",
+  status: activeName
 });
 
 // 页面加载时触发查询
@@ -327,4 +335,15 @@ const closeDialog = () => {
     }
   }
 }
+.information {
+  display: flex;
+  column-gap: 5px;
+  align-items: center;
+  .information-right {
+    display: flex;
+    flex-direction: column;
+    row-gap: 5px;
+    align-items: flex-start;
+  }
+}
 </style>