Browse Source

Merge branch 'development' of http://8.152.195.41:3000/alien/group_web_merchant into development

congxuesong 3 weeks ago
parent
commit
997700346e

+ 4 - 1
src/api/modules/storeDecoration.ts

@@ -94,7 +94,10 @@ export const createOrUpdateDish = (params: any) => {
 export const getDishList = (params: any) => {
   return httpApi.get(`/alienStorePlatform/menuPlatform/getMenuByStoreId`, params);
 };
-
+//删除菜单
+export const deleteDish = (params: any) => {
+  return httpApi.get(`/alienStorePlatform/menuPlatform/delete`, params);
+};
 //获取菜品详情
 export const getDishDetail = (params: any) => {
   return httpApi.get(`/alienStorePlatform/menuPlatform/getMenuInfo`, params);

+ 1 - 1
src/layouts/components/Header/components/PasswordDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 修改密码对话框 -->
-  <el-dialog v-model="dialogVisible" title="修改密码1" width="500px" draggable :close-on-click-modal="false">
+  <el-dialog v-model="dialogVisible" title="修改密码" width="500px" draggable :close-on-click-modal="false">
     <el-form ref="passwordFormRef" :model="passwordForm" :rules="passwordRules" label-width="100px" label-position="left">
       <el-form-item label="输入原密码" prop="oldPassword">
         <el-input v-model="passwordForm.oldPassword" type="password" placeholder="请输入原密码" show-password clearable />

+ 1 - 1
src/views/financialManagement/todayIncomeList.vue

@@ -27,7 +27,7 @@
         <el-row class="couponRow">
           <el-col :span="12"> 实际收益: {{ ((unposted.money || 0) / 100).toFixed(2) }} </el-col>
           <el-col :span="12">
-            {{ `技术服务费(${commissionRate}%):` }}:
+            {{ `技术服务费(${commissionRate}%)` }}:
             {{ unposted.commission != null ? (unposted.commission / 100).toFixed(2) : "--" }}
           </el-col>
         </el-row>

+ 1 - 1
src/views/financialManagement/unposted.vue

@@ -31,7 +31,7 @@
           </el-col>
           <el-col :span="12">
             <!-- {{ `技术服务费(${unposted.commission / 100 || 3}%)` }}: 后续后端会变成可控的-->
-            {{ `技术服务费(${commissionRate}%):` }}:
+            {{ `技术服务费(${commissionRate}%)` }}:
             {{ unposted.commission != null ? (unposted.commission / 100).toFixed(2) : "--" }}
           </el-col>
         </el-row>

+ 10 - 24
src/views/storeDecoration/menuManagement/index.vue

@@ -30,7 +30,7 @@
           </div>
           <div class="dish-actions">
             <el-button type="primary" link @click="editDish(dish, index)"> 编辑 </el-button>
-            <el-button type="primary" link @click="deleteDish(dish.id!, index)"> 删除 </el-button>
+            <el-button type="primary" link @click="deleteDishHandler(dish.id!, index)"> 删除 </el-button>
             <el-button v-if="dish.dishType === 1" type="primary" link @click="cancelRecommend(dish.id!, index)">
               取消推荐
             </el-button>
@@ -138,7 +138,7 @@ import { Picture } from "@element-plus/icons-vue";
 import UploadImg from "@/components/Upload/Img.vue";
 import { uploadImg } from "@/api/modules/newLoginApi";
 import { localGet } from "@/utils";
-import { createOrUpdateDish, getDishList, getDishDetail } from "@/api/modules/storeDecoration";
+import { createOrUpdateDish, getDishList, getDishDetail, deleteDish } from "@/api/modules/storeDecoration";
 
 // 菜品接口
 interface Dish {
@@ -317,7 +317,7 @@ const editDish = async (dish: Dish, index: number) => {
 };
 
 // 删除菜品
-const deleteDish = async (id: string | number, index: number) => {
+const deleteDishHandler = async (id: string | number, index: number) => {
   try {
     await ElMessageBox.confirm("确认删除该菜品吗?", "提示", {
       confirmButtonText: "确定",
@@ -331,30 +331,16 @@ const deleteDish = async (id: string | number, index: number) => {
       return;
     }
 
-    const userInfo: any = localGet("geeker-user")?.userInfo || {};
-    const storeId = userInfo.storeId;
-    if (!storeId) {
-      ElMessage.error("未找到店铺ID");
-      return;
-    }
+    // 根据当前tab确定dishType:0表示菜单, 1表示推荐
+    const dishType = activeTab.value === "recommended" ? 1 : 0;
 
-    // 通过更新接口删除(设置deleteFlag,如果有的话,或者直接调用删除接口)
-    // 如果没有删除接口,可以通过更新dishType为-1或其他标记来删除
-    // 这里假设可以通过更新接口删除,实际需要根据后端接口调整
-    const params: any = {
-      id: dish.id,
-      storeId: Number(storeId),
-      dishName: dish.dishName,
-      dishPrice: dish.dishPrice,
-      costPrice: dish.costPrice,
-      dishesUnit: dish.dishesUnit,
-      imgUrl: dish.imgUrl,
-      description: dish.description || "",
-      dishType: dish.dishType,
-      deleteFlag: 1 // 假设有删除标记字段
+    // 调用删除接口,参数是 dishType 和 ids
+    const params = {
+      dishType: dishType,
+      ids: id
     };
 
-    const res: any = await createOrUpdateDish(params);
+    const res: any = await deleteDish(params);
     if (res && (res.code === 200 || res.code === "200")) {
       ElMessage.success("删除成功");
       await loadDishList();