zhuli 2 settimane fa
parent
commit
fb46a36977

+ 1 - 1
src/api/modules/scheduledService.ts

@@ -148,7 +148,7 @@ export const reservationCancel = (params: {
 };
 
 /** 删除预约 */
-export const reservationDelete = (params: { id: number | string }) => {
+export const reservationDelete = (params: { reservationId: number | string }) => {
   const formData = Object.keys(params)
     .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(String(params[key as keyof typeof params]))}`)
     .join("&");

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

@@ -65,6 +65,7 @@ export const useAuthStore = defineStore({
 
           // 根据 businessSection 判断菜单显示
           if (menu.meta && menu.meta.title) {
+            console.log(businessSection);
             switch (menu.meta.title) {
               case "菜单管理":
                 // 只在特色美食(1) 时显示菜单管理
@@ -76,7 +77,7 @@ export const useAuthStore = defineStore({
                 break;
               case "设施与服务":
                 // 只在洗浴汗蒸(4) 和 运动健身(7) 时显示设施与服务
-                menu.meta.isHide = ![4, 7].includes(businessSection);
+                menu.meta.isHide = ![4, 7, 1].includes(businessSection);
                 break;
               case "门店基础信息":
               case "门店头图":

+ 32 - 21
src/views/appoinmentManagement/appoinmentInfo.vue

@@ -6,7 +6,12 @@
         <span class="filter-label">姓名</span>
         <el-input v-model="searchForm.reservationUserName" placeholder="请输入姓名" clearable style="width: 160px" />
         <span class="filter-label">状态</span>
-        <el-select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 180px">
+        <el-select
+          v-model="searchForm.orderStatus"
+          clearable
+          style="width: 180px"
+          @clear="searchForm.orderStatus = STATUS_FILTER_ALL"
+        >
           <el-option
             v-for="opt in statusOptions"
             :key="`${opt.label}-${String(opt.value)}`"
@@ -65,21 +70,17 @@
           >
             <el-button link type="primary" @click="handleDelete(scope.row)"> 删除 </el-button>
           </template>
+          <!-- 已过期(3) 且结束未超 3 小时:付费先判断(退款+删除),否则仅删除;顺序不可颠倒,否则宽条件会吃掉窄条件 -->
           <template
-            v-else-if="
-              (isOrderStatus(scope.row, 2) || isOrderStatus(scope.row, 7) || isOrderStatus(scope.row, 3)) &&
-              !isMoreThanThreeHoursAfterEnd(scope.row)
-            "
+            v-else-if="isOrderStatus(scope.row, 3) && !isMoreThanThreeHoursAfterEnd(scope.row) && orderCostTypeIsPaid(scope.row)"
           >
+            <el-button link type="primary" @click="handleRefund(scope.row)"> 退款 </el-button>
             <el-button link type="primary" @click="handleDelete(scope.row)"> 删除 </el-button>
           </template>
-          <template v-else-if="isOrderStatus(scope.row, 7) && !isMoreThanThreeHoursAfterEnd(scope.row)">
+          <template v-else-if="isOrderStatus(scope.row, 3) && !isMoreThanThreeHoursAfterEnd(scope.row)">
             <el-button link type="primary" @click="handleDelete(scope.row)"> 删除 </el-button>
           </template>
-          <template
-            v-else-if="isOrderStatus(scope.row, 3) && !isMoreThanThreeHoursAfterEnd(scope.row) && orderCostTypeIsPaid(scope.row)"
-          >
-            <el-button link type="primary" @click="handleRefund(scope.row)"> 退款 </el-button>
+          <template v-else-if="isOrderStatus(scope.row, 7) && !isMoreThanThreeHoursAfterEnd(scope.row)">
             <el-button link type="primary" @click="handleDelete(scope.row)"> 删除 </el-button>
           </template>
           <template v-else-if="isOrderStatus(scope.row, 4) && !orderCostTypeIsPaid(scope.row)">
@@ -97,13 +98,20 @@
     </ProTable>
 
     <!-- 查看原因 -->
-    <el-dialog v-model="reasonDialogVisible" title="原因" width="420px" append-to-body destroy-on-close>
-      <div class="reason-dialog-body">取消原因:</div>
-      <div class="reason-dialog-body">
+    <el-dialog
+      v-model="reasonDialogVisible"
+      title="原因"
+      width="420px"
+      append-to-body
+      destroy-on-close
+      class="cancel-reason-dialog"
+    >
+      <div class="reason-dialog-body">取消原因</div>
+      <div class="reason-dialog-body" style="padding-left: 20px">
         {{ reasonDialogText || "—" }}
       </div>
       <template #footer>
-        <el-button type="primary" @click="reasonDialogVisible = false"> 知道了 </el-button>
+        <el-button type="primary" @click="reasonDialogVisible = false"> 返回 </el-button>
       </template>
     </el-dialog>
 
@@ -237,9 +245,11 @@ const columns: ColumnProps<ReservationRow>[] = [
  */
 const STATUS_FILTER_MERCHANT_CANCEL = "merchant_cancel";
 const STATUS_FILTER_USER_CANCEL = "user_cancel";
+/** 占位选项值:勿用 "",el-select 常无法匹配空串而不显示「全部」 */
+const STATUS_FILTER_ALL = "__all__";
 
 const statusOptions: { label: string; value: number | string }[] = [
-  { label: "全部", value: "" },
+  { label: "全部", value: STATUS_FILTER_ALL },
   { label: "待使用", value: 1 },
   { label: "退款成功", value: 7 },
   { label: "商家取消", value: STATUS_FILTER_MERCHANT_CANCEL },
@@ -281,14 +291,14 @@ const initParam = reactive({
 /** 已生效的查询条件(点击搜索后写入;接口字段 reservationUserName、orderStatus) */
 const listFilter = reactive({
   reservationUserName: "",
-  orderStatus: "" as number | string,
+  orderStatus: STATUS_FILTER_ALL as number | string,
   startDate: "",
   endDate: ""
 });
 
 const searchForm = reactive({
   reservationUserName: "",
-  orderStatus: "" as number | string,
+  orderStatus: STATUS_FILTER_ALL as number | string,
   dateRange: [] as string[]
 });
 
@@ -478,7 +488,7 @@ async function getTableList(params: any) {
     req.reservationUserName = listFilter.reservationUserName.trim();
   }
   const sf = listFilter.orderStatus;
-  if (sf !== undefined && sf !== "" && sf !== null) {
+  if (sf !== undefined && sf !== "" && sf !== null && sf !== STATUS_FILTER_ALL) {
     if (sf === STATUS_FILTER_USER_CANCEL || sf === STATUS_FILTER_MERCHANT_CANCEL) {
       req.orderStatus = 4;
     } else {
@@ -529,10 +539,10 @@ function handleSearch() {
 
 function handleReset() {
   searchForm.reservationUserName = "";
-  searchForm.orderStatus = "";
+  searchForm.orderStatus = STATUS_FILTER_ALL;
   searchForm.dateRange = [];
   listFilter.reservationUserName = "";
-  listFilter.orderStatus = "";
+  listFilter.orderStatus = STATUS_FILTER_ALL;
   listFilter.startDate = "";
   listFilter.endDate = "";
   proTable.value?.getTableList();
@@ -654,7 +664,7 @@ function handleDelete(row: ReservationRow) {
   })
     .then(async () => {
       try {
-        await reservationDelete({ id: row.id });
+        await reservationDelete({ reservationId: row.id });
         ElMessage.success("删除成功");
         proTable.value?.getTableList();
       } catch (e: any) {
@@ -766,6 +776,7 @@ function handleRefund(row: ReservationRow) {
   color: #606266;
 }
 .cancel-reason-dialog.el-dialog .el-dialog__body {
+  height: 300px;
   padding-top: 8px;
 }
 .cancel-reason-form {

+ 7 - 4
src/views/appoinmentManagement/classifyManagement.vue

@@ -33,6 +33,7 @@
       v-model="dialogVisible"
       :title="editId == null ? '新建分类' : '编辑分类'"
       width="480px"
+      class="classify-edit-dialog"
       append-to-body
       destroy-on-close
       @close="onDialogClose"
@@ -438,12 +439,14 @@ async function submitForm() {
   }
 }
 </script>
-
-<style scoped lang="scss">
-:deep(.el-dialog__body) {
+<!-- append-to-body 时弹窗在 body 下,不是 .classify-management 子节点,需用 dialog 自身 class 命中 -->
+<style lang="scss">
+.classify-edit-dialog .el-dialog__body {
+  box-sizing: border-box;
   height: 400px;
-  border: 1px solid red;
 }
+</style>
+<style scoped lang="scss">
 .classify-management {
   padding: 0;
 }

+ 6 - 1
src/views/appoinmentManagement/tableManagement.vue

@@ -544,7 +544,12 @@ onMounted(() => {
   loadCategories();
 });
 </script>
-
+<style lang="scss">
+.table-management-dialog .el-dialog__body {
+  box-sizing: border-box;
+  height: 300px;
+}
+</style>
 <style scoped lang="scss">
 .table-management {
   padding: 0;

+ 2 - 2
src/views/businessData/compare.vue

@@ -148,7 +148,7 @@
               </div>
             </div>
           </el-tab-pane>
-          <el-tab-pane label="代金券" name="voucher">
+          <!-- <el-tab-pane label="代金券1" name="voucher">
             <div class="compare-cards">
               <div v-for="item in voucherCompareList" :key="item.key" class="compare-card">
                 <div class="card-title">
@@ -181,7 +181,7 @@
                 </div>
               </div>
             </div>
-          </el-tab-pane>
+          </el-tab-pane> -->
           <el-tab-pane label="服务质量" name="service">
             <div class="compare-cards">
               <div v-for="item in serviceCompareList" :key="item.key" class="compare-card">

+ 11 - 1
src/views/storeDecoration/basicStoreInformation/index.vue

@@ -200,6 +200,12 @@
           <el-form-item label="经营类目" prop="businessCategoryName">
             <el-input v-model="formData.businessCategoryName" placeholder="请输入经营类目" clearable maxlength="50" />
           </el-form-item>
+          <el-form-item label="预定服务" prop="bookingService">
+            <el-radio-group v-model="formData.bookingService">
+              <el-radio :value="1"> 提供 </el-radio>
+              <el-radio :value="0"> 不提供 </el-radio>
+            </el-radio-group>
+          </el-form-item>
           <el-form-item label="营业时间">
             <div style="color: #6c8ff8; cursor: pointer" @click="handleViewBusinessHours">查看</div>
           </el-form-item>
@@ -857,7 +863,9 @@ const formData = reactive({
   storePositionLongitude: "",
   storePositionLatitude: "",
   isChain: 0,
-  storeTickets: "" as number | ""
+  storeTickets: "" as number | "",
+  /** 预定服务:1 提供 / 0 不提供(与 go-flow 入驻 bookingService 一致) */
+  bookingService: 0 as 0 | 1
 });
 
 // 经纬度查询
@@ -1171,6 +1179,7 @@ const handleSubmit = async () => {
         businessSectionName: selectedSection ? selectedSection.dictDetail : "",
         businessTypeName: formData.businessTypeName,
         businessCategoryName: formData.businessCategoryName,
+        bookingService: formData.bookingService,
         // 标签选择(仅当经营板块为生活服务时)
         storeTickets:
           formData.businessSection === 3 ? (formData.storeTickets !== "" ? formData.storeTickets : undefined) : undefined
@@ -1280,6 +1289,7 @@ const getStoreDetailData = async () => {
       // 如果 businessCategoryName 是 0,转换为空字符串
       const categoryName = storeData.businessCategoryName;
       formData.businessCategoryName = categoryName === 0 || categoryName === "0" ? "" : categoryName || "";
+      formData.bookingService = storeData.bookingService === 1 || storeData.bookingService === "1" ? 1 : 0;
     }
   } catch (error) {
     console.error("获取店铺详情失败:", error);

+ 1 - 3
src/views/storeDecoration/storeHeadMap/index.vue

@@ -63,9 +63,7 @@
                 :show-success-notification="false"
               >
                 <template #tip>
-                  <div class="upload-tip">
-                    上传图片{{ formData.multipleImages.length }} ({{ formData.multipleImages.length }}/6)
-                  </div>
+                  <div class="upload-tip">上传图片({{ formData.multipleImages.length }}/6)</div>
                 </template>
               </UploadImgs>
             </div>