فهرست منبع

feat: 更新优惠券列表API参数,新增优惠券状态选择功能,优化编辑功能

laiqi 11 ماه پیش
والد
کامیت
0cc11e2506
2فایلهای تغییر یافته به همراه27 افزوده شده و 10 حذف شده
  1. 4 2
      apps/web-ele/src/api/coupon/coupon2.ts
  2. 23 8
      apps/web-ele/src/views/examine-manage/examine-coupon/index.vue

+ 4 - 2
apps/web-ele/src/api/coupon/coupon2.ts

@@ -14,9 +14,11 @@ interface Coupon2QueryParams extends Coupon2PartialEntity, PageConfig {}
 /**
  * 我的优惠券信息_列表
  */
-export async function getCoupon2ListApi(params: Coupon2QueryParams) {
+export async function getCoupon2ListApi(data: Coupon2QueryParams) {
   return requestClient.post<any>('/api/query/list?pagevalue=38', {
-    ...params,
+    pageindex: data.pageindex,
+    rows: data.rows,
+    ...parseQueryValues(data),
   });
 }
 

+ 23 - 8
apps/web-ele/src/views/examine-manage/examine-coupon/index.vue

@@ -6,7 +6,7 @@ import type { VxeGridListeners, VxeGridProps } from '#/adapter/vxe-table';
 import { h, ref } from 'vue';
 
 import { Page, useVbenModal } from '@vben/common-ui';
-import { MdiCheckboxMultipleMarked, MdiDetail, MdiEdit } from '@vben/icons';
+import { MdiCheckboxMultipleMarked, MdiDetail } from '@vben/icons';
 
 import { ElTag } from 'element-plus';
 
@@ -34,6 +34,21 @@ const formOptions: VbenFormProps = {
         allowClear: true,
       },
     },
+    {
+      component: 'Select',
+      fieldName: 'coupon2sype',
+      label: '优惠券状态',
+      componentProps: {
+        placeholder: '请选择优惠券状态',
+        clearable: true,
+        options: [
+          { label: '申请中', value: 0 },
+          { label: '审核通过', value: 1 },
+          { label: '审核不通过', value: 2 },
+        ],
+      },
+      defaultValue: 0,
+    },
   ],
   wrapperClass: 'grid-cols-1 md:grid-cols-3 lg:grid-cols-5',
 };
@@ -150,10 +165,10 @@ const [Modal, modalApi] = useVbenModal({
 const auditFormRef = ref<any>(null);
 
 /* 编辑 */
-function handleEdit(row: any) {
-  modalApi.setState({ showCancelButton: true });
-  modalApi.setData({ formType: 'edit', row }).open();
-}
+// function handleEdit(row: any) {
+//   modalApi.setState({ showCancelButton: true });
+//   modalApi.setData({ formType: 'edit', row }).open();
+// }
 
 /* 详情 */
 function handleDetail(row: any) {
@@ -191,7 +206,7 @@ function handleFinish() {
             class="!p-2"
           />
         </el-tooltip>
-        <el-tooltip
+        <!-- <el-tooltip
           class="box-item"
           effect="dark"
           content="编辑"
@@ -203,9 +218,8 @@ function handleFinish() {
             :icon="MdiEdit"
             class="!p-2"
           />
-        </el-tooltip>
+        </el-tooltip> -->
         <el-tooltip
-          v-if="row.coupon2sype === 0"
           class="box-item"
           effect="dark"
           content="审核"
@@ -216,6 +230,7 @@ function handleFinish() {
             @click="() => handleAudit(row)"
             :icon="MdiCheckboxMultipleMarked"
             class="!p-2"
+            :disabled="row.coupon2sype !== 0"
           />
         </el-tooltip>
       </template>