Przeglądaj źródła

Merge remote-tracking branch 'origin/development' into development

spy 3 tygodni temu
rodzic
commit
9d44d25447

+ 10 - 10
src/assets/json/authMenuList.json

@@ -359,7 +359,7 @@
       "name": "financialManagement",
       "redirect": "/financialManagement/index",
       "meta": {
-        "icon": "CreditCard",
+        "icon": "Wallet",
         "title": "财务管理",
         "isLink": "",
         "isHide": false,
@@ -373,7 +373,7 @@
           "name": "financialManagementIndex",
           "component": "/financialManagement/index",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "DataAnalysis",
             "title": "账户总览",
             "isLink": "",
             "isHide": false,
@@ -387,7 +387,7 @@
           "name": "realName",
           "component": "/financialManagement/realName",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "UserFilled",
             "title": "实名认证",
             "isLink": "",
             "isHide": true,
@@ -401,7 +401,7 @@
           "name": "cashApply",
           "component": "/financialManagement/cashApply",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "Money",
             "title": "提现申请",
             "isLink": "",
             "isHide": true,
@@ -415,7 +415,7 @@
           "name": "todayIncomeList",
           "component": "/financialManagement/todayIncomeList",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "TrendCharts",
             "title": "今日收益",
             "isLink": "",
             "isHide": true,
@@ -429,7 +429,7 @@
           "name": "reconciled",
           "component": "/financialManagement/reconciled",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "CircleCheck",
             "title": "已到账期金额",
             "isLink": "",
             "isHide": true,
@@ -443,7 +443,7 @@
           "name": "unposted",
           "component": "/financialManagement/unposted",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "Clock",
             "title": "未到账期金额",
             "isLink": "",
             "isHide": true,
@@ -457,7 +457,7 @@
           "name": "withdrawaRecord",
           "component": "/financialManagement/withdrawaRecord",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "Document",
             "title": "提现记录",
             "isLink": "",
             "isHide": false,
@@ -471,7 +471,7 @@
           "name": "withdrawaRequest",
           "component": "/financialManagement/withdrawaRequest",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "Money",
             "title": "提现申请",
             "isLink": "",
             "isHide": true,
@@ -485,7 +485,7 @@
           "name": "realName",
           "component": "/financialManagement/realName",
           "meta": {
-            "icon": "CreditCard",
+            "icon": "Setting",
             "title": "支付设置",
             "isLink": "",
             "isHide": false,

+ 3 - 1
src/layouts/components/Header/ToolBarRight.vue

@@ -8,7 +8,7 @@
       <Message id="message" />
       <Fullscreen id="fullscreen" />
     </div>
-    <span class="username">{{ username }}</span>
+    <span class="username">{{ userInfo.name != null ? userInfo.name : userInfo.nickName }}</span>
     <Avatar />
   </div>
 </template>
@@ -23,9 +23,11 @@ import ThemeSetting from "./components/ThemeSetting.vue";
 import Message from "./components/Message.vue";
 import Fullscreen from "./components/Fullscreen.vue";
 import Avatar from "./components/Avatar.vue";
+import { localGet } from "@/utils/index";
 
 const userStore = useUserStore();
 const username = computed(() => userStore.userInfo.name);
+const userInfo = localGet("geeker-user")?.userInfo || {};
 </script>
 
 <style scoped lang="scss">

+ 32 - 28
src/utils/permission.ts

@@ -8,36 +8,40 @@ import { getUserByPhone, getDetail } from "@/api/modules/homeEntry";
  */
 export async function usePermission(tip?: string) {
   let type = true;
-  if (!localGet("createdId") && !localGet("geeker-user").userInfo.storeId) {
-    let params = {
-      phone: localGet("iphone") || localGet("geeker-user").userInfo.phone
-    };
-    const res: any = await getUserByPhone(params);
-    if (res.data && res.data.storeId) {
-      localSet("createdId", res.data.storeId);
-      const resD: any = await getDetail({
-        id: res.data.storeId
-      });
-      if (resD.data && resD.data.commissionRate) {
-        localSet("commissionRate", resD.data.commissionRate);
-      }
-      if (resD.data && resD.data.businessSection) {
-        localSet("businessSection", resD.data.businessSection);
-      }
-    } else {
-      type = false;
-      if (tip) {
-        ElMessage.warning(`请完成商家入驻后再进行${tip}`);
-      }
-      return type;
+  // if (localGet("createdId") || localGet("geeker-user").userInfo.storeId) {
+  //   //   return type;
+  //   // }
+  let params = {
+    phone: localGet("iphone") || localGet("geeker-user").userInfo.phone
+  };
+  const res: any = await getUserByPhone(params);
+  if (res.data && res.data.storeId) {
+    localSet("createdId", res.data.storeId);
+    const resD: any = await getDetail({
+      id: res.data.storeId
+    });
+    if (resD.data && resD.data.storeApplicationStatus != 1) {
+      return false;
     }
-    if (!localGet("businessSection") && !localGet("geeker-user").userInfo.businessSection) {
-      type = false;
-      if (tip) {
-        ElMessage.warning(`请完成商家入驻后重新登录再进行${tip}`);
-      }
-      return type;
+    if (resD.data && resD.data.commissionRate) {
+      localSet("commissionRate", resD.data.commissionRate);
     }
+    if (resD.data && resD.data.businessSection) {
+      localSet("businessSection", resD.data.businessSection);
+    }
+  } else {
+    type = false;
+    if (tip) {
+      ElMessage.warning(`请完成商家入驻后再进行${tip}`);
+    }
+    return type;
+  }
+  if (!localGet("businessSection") && !localGet("geeker-user").userInfo.businessSection) {
+    type = false;
+    if (tip) {
+      ElMessage.warning(`请完成商家入驻后重新登录再进行${tip}`);
+    }
+    return type;
   }
   return type;
 }

+ 0 - 3
src/views/financialManagement/cashApply.vue

@@ -322,9 +322,6 @@ onMounted(() => {
   border: 1px solid #dcdfe6;
   border-radius: 8px;
   transition: all 0.3s;
-  &:hover {
-    border-color: #7f9dff;
-  }
   &.active {
     background-color: #ecf5ff;
     border-color: #7f9dff;

+ 15 - 0
src/views/financialManagement/index.vue

@@ -178,6 +178,21 @@ const fetchGetTodayIncome = async () => {
 
 const handleAction = async (key: string) => {
   if (key == "withdraw") {
+    // 获取可提现金额
+    const withdrawAmount = stats[0].amount;
+
+    // 转换为数字类型
+    const numAmount = typeof withdrawAmount === "string" ? parseFloat(withdrawAmount) : Number(withdrawAmount);
+
+    // 校验金额是否小于0.1
+    if (isNaN(numAmount) || numAmount < 0.1) {
+      // 格式化金额显示
+      const formattedAmount = isNaN(numAmount) ? "0.00" : numAmount.toFixed(2);
+      ElMessage.warning(`可提现金额不足,最低提现金额为0.1元,当前可提现金额为¥${formattedAmount}元`);
+      return;
+    }
+
+    // 金额校验通过,继续原有逻辑
     if (userInfo.alipayAccount != null && userInfo.payPassword != null) {
       router.push({ path: "/financialManagement/cashApply" });
     } else {

+ 14 - 4
src/views/home/components/go-flow.vue

@@ -2,7 +2,9 @@
   <div class="form-container">
     <div>
       <!-- 进度条 -->
-      <el-button class="back-btn" @click="handleBack"> 返回 </el-button>
+      <el-button class="back-btn" @click="handleBack" v-if="storeApplicationStatus == 2 && storeApplicationStatus == 1">
+        返回
+      </el-button>
       <div class="progress-container">
         <el-steps :active="currentStep" style="max-width: 1500px" align-center>
           <el-step v-for="(item, index) in entryList" :key="index">
@@ -43,7 +45,7 @@
             <!-- 左列 -->
             <div class="form-col">
               <el-form-item label="店铺名称" prop="storeName">
-                <el-input v-model="step2Form.storeName" placeholder="请输入店铺名称" />
+                <el-input v-model="step2Form.storeName" placeholder="请输入店铺名称" maxlength="30" />
               </el-form-item>
 
               <el-form-item label="容纳人数" prop="storeCapacity">
@@ -66,11 +68,11 @@
               </el-form-item>
 
               <el-form-item label="详细地址" prop="storeDetailAddress">
-                <el-input v-model="step2Form.storeDetailAddress" type="textarea" :rows="3" placeholder="请输入" />
+                <el-input v-model="step2Form.storeDetailAddress" type="textarea" :rows="3" placeholder="请输入" maxlength="255" />
               </el-form-item>
 
               <el-form-item label="门店简介" prop="storeBlurb">
-                <el-input v-model="step2Form.storeBlurb" type="textarea" :rows="3" placeholder="请输入" />
+                <el-input v-model="step2Form.storeBlurb" type="textarea" :rows="3" placeholder="请输入" maxlength="300" />
               </el-form-item>
 
               <el-form-item label="经营板块" prop="businessSection">
@@ -917,12 +919,20 @@ const handleExceed = () => {
     border-color: #dcdfe6;
   }
   .progress-container {
+    margin-top: 120px;
     margin-bottom: 40px;
     :deep(.el-step__head.is-process .el-step__icon) {
       color: #909399;
       border-color: #909399 !important; /* 设置圆圈边框为灰色 */
     }
     :deep(.el-steps) {
+      .is-finish {
+        .el-step__icon {
+          color: #ffffff;
+          background-color: #6c8ff8 !important; /* 设置已完成步骤的圆圈背景色 */
+          border-color: #6c8ff8 !important; /* 设置已完成步骤的圆圈边框色 */
+        }
+      }
       .el-step__head {
         .el-step__icon {
           width: 30px;

+ 9 - 2
src/views/home/index.vue

@@ -17,7 +17,7 @@
 
 <script setup lang="ts">
 import { onMounted, ref, watch } from "vue";
-import { localGet } from "@/utils/index";
+import { localGet, localSet } from "@/utils/index";
 import goEnter from "./components/go-enter.vue";
 import goFlow from "./components/go-flow.vue";
 import goExamine from "./components/go-examine.vue";
@@ -100,6 +100,13 @@ const getUserInfo = async () => {
     const res: any = await getMerchantByPhone(param);
     storeId.value = res.data.storeId;
     if (res && res.code == 200 && res.data) {
+      // 更新缓存中的 storeId
+      geekerUser.userInfo.storeId = res.data.storeId;
+      localSet("geeker-user", geekerUser);
+      // 同时更新 createdId 缓存
+      if (res.data.storeId) {
+        localSet("createdId", res.data.storeId);
+      }
       if (res.data.storeId == null) {
         isEntry.value = true;
       }
@@ -110,8 +117,8 @@ const getUserInfo = async () => {
         const resStore: any = await getDetail(param1);
         if (resStore && resStore.code == 200 && resStore.data) {
           storeApplicationStatus.value = resStore.data.storeApplicationStatus;
-          console.log(storeApplicationStatus.value);
           if (storeApplicationStatus.value == 0) {
+            //
             currentStep.value = 3;
           }
           if (storeApplicationStatus.value == 2) {

+ 48 - 45
src/views/licenseManagement/foodBusinessLicense.vue

@@ -69,32 +69,39 @@
 
     <!-- 变更记录弹窗 -->
     <el-dialog v-model="changeRecordDialogVisible" title="变更记录" width="900px" :close-on-click-modal="false">
-      <div class="change-record-content">
-        <div class="record-date">
-          {{ currentRecordDate }}
-        </div>
-        <div class="record-items">
-          <div v-for="(item, index) in changeRecordList" :key="index" class="record-item">
-            <div class="record-status-badge" :class="getStatusClass(item.status)">
-              {{ getStatusText(item.status) }}
+      <el-scrollbar height="400px" class="change-record-scrollbar">
+        <div v-if="changeRecordList && changeRecordList.length > 0" class="change-record-content">
+          <div v-for="(item, index) in changeRecordList" :key="index" class="record-group">
+            <div class="record-date">
+              {{ item.createdDateFormat }}
             </div>
-            <el-image
-              :src="item.imgUrl"
-              fit="cover"
-              class="record-image"
-              :preview-src-list="changeRecordList.map(record => record.imgUrl)"
-              :initial-index="index"
-            >
-              <template #error>
-                <div class="image-slot">
-                  <el-icon><Picture /></el-icon>
+            <div class="record-items">
+              <div class="record-item">
+                <div class="record-status-badge" :class="getStatusClass(item.licenseExecuteStatus)">
+                  {{ item.licenseExecuteName }}
                 </div>
-              </template>
-            </el-image>
+                <el-image
+                  :src="item.imgUrl"
+                  fit="cover"
+                  class="record-image"
+                  :preview-src-list="changeRecordList.map(record => record.imgUrl)"
+                  :initial-index="index"
+                >
+                  <template #error>
+                    <div class="image-slot">
+                      <el-icon><Picture /></el-icon>
+                    </div>
+                  </template>
+                </el-image>
+              </div>
+            </div>
+            <div v-if="item.reasonRefusal" class="rejection-reason">拒绝原因: {{ item.reasonRefusal }}</div>
           </div>
         </div>
-        <div v-if="rejectionReason" class="rejection-reason">拒绝原因: {{ rejectionReason }}</div>
-      </div>
+        <div v-else class="empty-record">
+          <el-empty description="暂无变更记录" :image-size="100" />
+        </div>
+      </el-scrollbar>
       <template #footer>
         <div class="dialog-footer">
           <el-button type="primary" @click="changeRecordDialogVisible = false"> 关闭 </el-button>
@@ -195,23 +202,22 @@ const handleReplace = async () => {
 
 const handleViewChangeRecord = async () => {
   try {
-    // TODO: 调用API获取变更记录
-    // const response = await getChangeRecords();
-    // if (response.code === 200) {
-    //   changeRecordList.value = response.data.records;
-    //   currentRecordDate.value = response.data.date;
-    //   rejectionReason.value = response.data.rejectionReason || "";
-    // }
-    // 模拟数据(假数据)
-    changeRecordList.value = [
-      { id: "1", status: "pending", imgUrl: "https://picsum.photos/150/150?random=1" },
-      { id: "2", status: "success", imgUrl: "https://picsum.photos/150/150?random=2" },
-      { id: "3", status: "failed", imgUrl: "https://picsum.photos/150/150?random=3" }
-    ];
-    rejectionReason.value = "";
+    const params = {
+      storeId: localGet("createdId")
+    };
+    const res: any = await getChangeRecords(params);
+    if (res.code === 200) {
+      changeRecordList.value = res.data;
+    } else {
+      // 请求失败时清空数据
+      changeRecordList.value = [];
+    }
     changeRecordDialogVisible.value = true;
   } catch (error) {
     ElMessage.error("获取变更记录失败");
+    // 发生错误时清空数据并显示空状态
+    changeRecordList.value = [];
+    changeRecordDialogVisible.value = true;
   }
 };
 
@@ -529,10 +535,11 @@ const handleSubmitReplace = async () => {
   try {
     // 只提交单张图片,排序为0
     const imageDataWithSort = uploadedFiles.map((file, index) => ({
-      url: file.url,
-      sort: index
+      imgUrl: file.url,
+      imgSort: index,
+      storeId: localGet("createdId")
     }));
-    await submitFoodLicenseReview({ images: imageDataWithSort });
+    await submitFoodLicenseReview(imageDataWithSort[0]);
     ElMessage.success("提交审核成功");
     replaceDialogVisible.value = false;
     fileList.value = [];
@@ -546,12 +553,8 @@ const handleSubmitReplace = async () => {
 };
 
 const getStatusClass = (status: string) => {
-  const statusMap: Record<string, string> = {
-    pending: "status-pending",
-    success: "status-success",
-    failed: "status-failed"
-  };
-  return statusMap[status] || "";
+  const statusInfo = statusMap[status];
+  return statusInfo ? statusInfo.class : "";
 };
 
 const getStatusText = (status: string) => {

+ 4 - 4
src/views/ticketManagement/detail.vue

@@ -85,18 +85,18 @@
         <!-- 使用规则模块 -->
         <div class="model">
           <h3 style="font-weight: bold">使用规则:</h3>
-          <!-- 单可用数量 -->
+          <!-- 单可用数量 -->
           <div class="detail-item">
-            <div class="detail-label">单可用数量</div>
+            <div class="detail-label">单可用数量</div>
             <div class="detail-value">
-              {{ voucherModel.singleCanUse || "--" }}
+              {{ voucherModel.singleCanUse + "张" || "--" }}
             </div>
           </div>
           <!-- 限购数量 -->
           <div class="detail-item">
             <div class="detail-label">限购数量</div>
             <div class="detail-value">
-              {{ voucherModel.purchaseLimitCode || "--" }}
+              {{ voucherModel.purchaseLimitCode + "张" || "--" }}
             </div>
           </div>
           <!-- 适用范围 -->

+ 33 - 40
src/views/ticketManagement/index.vue

@@ -21,14 +21,16 @@
       <template #tableHeaderRight="scope">
         <div class="action-buttons">
           <el-button :icon="Plus" class="button" type="primary" @click="newGroupBuying" v-if="type"> 新建代金券 </el-button>
-          <el-button :icon="Plus" class="button" type="primary" @click="newCoupon" v-if="typeCoupon"> 新建优惠券 </el-button>
+          <el-button :icon="Plus" class="button" type="primary" @click="newCoupon" v-if="type"> 新建优惠券 </el-button>
         </div>
       </template>
       <template #status="scope">
         <!-- 代金券:显示状态和审核状态两行 -->
         <template v-if="activeName === '1'">
-          <p style="margin: 0; line-height: 1.5">状态:{{ getStatusLabel(scope.row.status, scope.row.dataType) || "--" }}</p>
-          <p style="margin: 0; line-height: 1.5">审核状态:{{ scope.row.statusName || "--" }}</p>
+          <p style="margin: 0; line-height: 1.5">
+            状态:{{ scope.row.dataType === 1 ? "草稿" : scope.row.statusName ? scope.row.statusName : "--" }}
+          </p>
+          <p style="margin: 0; line-height: 1.5" v-if="scope.row.dataType == 0">审核状态:{{ scope.row.reviewType || "--" }}</p>
         </template>
         <!-- 优惠券:只显示状态一行 -->
         <template v-else>
@@ -64,20 +66,11 @@
         >
           修改库存
         </el-button>
-        <!-- 查看拒绝原因按钮(仅代金券) -->
-        <el-button
-          v-if="isVoucher && canShowButton(scope.row.status, VOUCHER_OPERATION_PERMISSIONS.查看拒绝原因)"
-          link
-          type="primary"
-          @click="viewRejectReason(scope.row)"
-        >
-          查看拒绝原因
-        </el-button>
         <!-- 查看详情按钮 -->
         <el-button
           v-if="
             isVoucher
-              ? canShowButton(scope.row.status, currentOperationPermissions.查看详情) && scope.row.dataType != 1
+              ? canShowButton(scope.row.status, currentOperationPermissions.查看详情) && scope.row.dataType == 0
               : canShowButton(scope.row.status, currentOperationPermissions.查看详情)
           "
           link
@@ -90,8 +83,7 @@
         <el-button
           v-if="
             isVoucher
-              ? canShowButton(scope.row.status, currentOperationPermissions.编辑) ||
-                (scope.row.dataType == 1 && scope.row.status == 0)
+              ? canShowButton(scope.row.status, currentOperationPermissions.编辑) || scope.row.dataType == 1
               : canShowButton(scope.row.status, currentOperationPermissions.编辑)
           "
           link
@@ -104,8 +96,7 @@
         <el-button
           v-if="
             isVoucher
-              ? canShowButton(scope.row.status, currentOperationPermissions.删除) ||
-                (scope.row.dataType == 1 && scope.row.status == 0)
+              ? canShowButton(scope.row.status, currentOperationPermissions.删除) || scope.row.dataType == 1
               : canShowButton(scope.row.status, currentOperationPermissions.删除)
           "
           link
@@ -114,6 +105,15 @@
         >
           删除
         </el-button>
+        <!-- 查看拒绝原因按钮(仅代金券) -->
+        <el-button
+          v-if="isVoucher && canShowButton(scope.row.status, VOUCHER_OPERATION_PERMISSIONS.查看拒绝原因)"
+          link
+          type="primary"
+          @click="viewRejectReason(scope.row)"
+        >
+          查看拒绝原因
+        </el-button>
       </template>
     </ProTable>
     <el-dialog v-model="dialogFormVisible" title="修改库存" width="500">
@@ -212,7 +212,7 @@ const rules = reactive<FormRules<RuleForm>>({
           // 验证新库存值不能小于剩余库存
           const currentQty = Number(formInventory.value.singleQty) || 0;
           if (numValue < currentQty) {
-            callback(new Error(`库存不能小于剩余库存(${currentQty})`));
+            callback(new Error(`库存不能小于剩余库存(${currentQty})`));
             return;
           }
         }
@@ -352,9 +352,8 @@ const allTabOptions = [
   { label: "优惠券", name: "2" }
 ];
 
-// 状态枚举:1草稿 1待审核 2未开始 3审核拒绝 4已售罄 5进行中 6已下架 7已结束
+// 状态枚举: 1待审核 2未开始 3审核拒绝 4已售罄 5进行中 6已下架 7已结束
 const VO_STATUS = {
-  草稿: 1,
   待审核: 1,
   未开始: 2,
   审核拒绝: 3,
@@ -363,7 +362,8 @@ const VO_STATUS = {
   已下架: 6,
   已结束: 7
 } as const;
-// 状态枚举:1草稿 1待审核 2未开始 3审核拒绝 4已售罄 5进行中 6已下架 7已结束
+
+// 状态枚举:0进行中 1已结束 2未开始 3已下架 4已售罄 5草稿
 const CO_STATUS = {
   进行中: 0,
   已结束: 1,
@@ -372,7 +372,8 @@ const CO_STATUS = {
   已售罄: 4,
   草稿: 5
 } as const;
-// 代金券操作按钮权限配置:定义每个操作按钮在哪些状态下显示
+
+// 代金券操作按钮权限配置:定义每个操作按钮在哪些状态下显示 草稿单独判断
 const VOUCHER_OPERATION_PERMISSIONS = {
   // 查看详情:待审核、未开始、审核拒绝、进行中、已售罄、已下架
   查看详情: [VO_STATUS.待审核, VO_STATUS.未开始, VO_STATUS.审核拒绝, VO_STATUS.进行中, VO_STATUS.已售罄, VO_STATUS.已下架],
@@ -382,10 +383,10 @@ const VOUCHER_OPERATION_PERMISSIONS = {
   下架: [VO_STATUS.进行中],
   // 修改库存:未开始、进行中、已售罄
   修改库存: [VO_STATUS.未开始, VO_STATUS.进行中, VO_STATUS.已售罄],
-  // 编辑:草稿、审核拒绝、已售罄、已下架、已结束
-  编辑: [VO_STATUS.草稿, VO_STATUS.审核拒绝, VO_STATUS.已售罄, VO_STATUS.已下架, VO_STATUS.已结束],
-  // 删除:草稿、未开始、审核拒绝、已售罄、已结束
-  删除: [VO_STATUS.草稿, VO_STATUS.未开始, VO_STATUS.审核拒绝, VO_STATUS.已售罄, VO_STATUS.已结束],
+  // 编辑:审核拒绝、已售罄、已下架、已结束
+  编辑: [VO_STATUS.审核拒绝, VO_STATUS.已售罄, VO_STATUS.已下架, VO_STATUS.已结束],
+  // 删除:未开始、审核拒绝、已售罄、已结束
+  删除: [VO_STATUS.未开始, VO_STATUS.审核拒绝, VO_STATUS.已售罄, VO_STATUS.已结束],
   // 查看拒绝原因:审核拒绝
   查看拒绝原因: [VO_STATUS.审核拒绝]
 } as const;
@@ -421,17 +422,9 @@ const isVoucher = computed(() => activeName.value === "1");
 const isCoupon = computed(() => activeName.value === "2");
 
 // 获取状态标签
-const getStatusLabel = (status: number, dataType?: number) => {
-  // 代金券且状态为1时,根据dataType判断
-  if (isVoucher.value && status === 1) {
-    if (dataType === 0) {
-      return "待审核";
-    } else if (dataType === 1) {
-      return "草稿";
-    }
-  }
+const getStatusLabel = (status: any) => {
   // 根据当前选中的tab选择对应的状态枚举
-  const statusEnum = isVoucher.value ? VO_STATUS : CO_STATUS;
+  const statusEnum = CO_STATUS;
   // 从状态枚举中查找对应的标签
   for (const [label, value] of Object.entries(statusEnum)) {
     if (value === status) {
@@ -443,8 +436,8 @@ const getStatusLabel = (status: number, dataType?: number) => {
 
 // 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
 const initParam = reactive({
-  storeId: localGet("createdId"),
-  groupType: localGet("businessSection"),
+  storeId: localGet("createdId") || "",
+  groupType: localGet("businessSection") || "1",
   couponType: activeName
 });
 const type = ref(false);
@@ -461,8 +454,8 @@ const restoreActiveName = () => {
 
 // 页面加载时触发查询
 onMounted(async () => {
-  type.value = await usePermission("新建代金券");
-  typeCoupon.value = await usePermission("新建优惠券");
+  type.value = await usePermission("新建券");
+  // typeCoupon.value = await usePermission("新建优惠券");
   // 从 sessionStorage 恢复 activeName
   restoreActiveName();
   proTable.value?.getTableList();

+ 4 - 4
src/views/ticketManagement/newCoupon.vue

@@ -14,7 +14,7 @@
             <el-input maxlength="50" v-model="couponModel.name" placeholder="请输入" clearable />
           </el-form-item>
           <!-- 面值 -->
-          <el-form-item label="面值()" prop="nominalValue">
+          <el-form-item label="面值()" prop="nominalValue">
             <el-input v-model="couponModel.nominalValue" maxlength="15" placeholder="请输入" clearable />
           </el-form-item>
           <!-- 开始领取时间 -->
@@ -42,7 +42,7 @@
             <el-input v-model="couponModel.specifiedDay" maxlength="15" placeholder="请输入" clearable />
           </el-form-item>
           <!-- 库存 -->
-          <el-form-item label="库存" prop="singleQty">
+          <el-form-item label="库存(张)" prop="singleQty">
             <el-input v-model="couponModel.singleQty" maxlength="15" placeholder="请输入" clearable />
           </el-form-item>
           <!-- 用户领取规则 -->
@@ -73,7 +73,7 @@
             </el-radio-group>
           </el-form-item>
           <!-- 最低消费金额 -->
-          <el-form-item label="最低消费金额" prop="minimumSpendingAmount" v-if="couponModel.hasMinimumSpend === 1">
+          <el-form-item label="最低消费金额(¥)" prop="minimumSpendingAmount" v-if="couponModel.hasMinimumSpend === 1">
             <el-input v-model="couponModel.minimumSpendingAmount" maxlength="15" placeholder="请输入" clearable />
           </el-form-item>
           <!-- 补充说明 -->
@@ -93,7 +93,7 @@
     <!-- 底部按钮区域 -->
     <div class="button-container">
       <el-button @click="() => handleSubmit('draft')"> 存草稿 </el-button>
-      <el-button type="primary" @click="() => handleSubmit()"> {{ type == "add" ? "新建" : "编辑" }}优惠券 </el-button>
+      <el-button type="primary" @click="() => handleSubmit()"> 提交 </el-button>
     </div>
   </div>
 </template>

+ 5 - 5
src/views/ticketManagement/newVoucher.vue

@@ -173,19 +173,19 @@
           <!-- 库存模块 -->
           <div class="model">
             <h3 style="font-weight: bold">库存:</h3>
-            <el-form-item label="库存" prop="singleQty">
+            <el-form-item label="库存(张)" prop="singleQty">
               <el-input v-model="voucherModel.singleQty" maxlength="15" placeholder="请输入" clearable />
             </el-form-item>
           </div>
           <!-- 使用规则模块 -->
           <div class="model">
             <h3 style="font-weight: bold">使用规则:</h3>
-            <!-- 单可用数量 -->
-            <el-form-item label="单次可用数量" prop="singleCanUse">
+            <!-- 单可用数量 -->
+            <el-form-item label="单日可用数量(张)" prop="singleCanUse">
               <el-input v-model="voucherModel.singleCanUse" maxlength="15" placeholder="请输入" clearable />
             </el-form-item>
             <!-- 限购数量 -->
-            <el-form-item label="限购数量" prop="purchaseLimitCode">
+            <el-form-item label="限购数量(张)" prop="purchaseLimitCode">
               <el-input v-model="voucherModel.purchaseLimitCode" maxlength="15" placeholder="请输入" clearable />
             </el-form-item>
             <!-- 适用范围 -->
@@ -227,7 +227,7 @@
     <!-- 底部按钮区域 -->
     <div class="button-container">
       <el-button @click="handleSubmit('draft')"> 存草稿 </el-button>
-      <el-button type="primary" @click="handleSubmit()"> {{ type == "add" ? "新建" : "编辑" }}代金券 </el-button>
+      <el-button type="primary" @click="handleSubmit()"> 提交 </el-button>
     </div>
   </div>
 </template>