ソースを参照

feat: 新增优惠券查询筛选条件和表格列

- 在Coupon2QueryParams接口中新增coupon2code、usersname、usersphone字段
- 在getCoupon2AuditListApi和getCoupon2EditListApi方法中添加对应查询参数处理
- 在examine-coupon页面表单中新增优惠券代码、姓名、手机号输入框
- 在表格中显示优惠券代码和手机号列,并支持排序功能
- 更新.gitignore文件添加.omc忽略规则
laiqi 3 週間 前
コミット
e0f6bb3e39

+ 1 - 0
.gitignore

@@ -30,6 +30,7 @@ components.d.ts
 .env.local
 .env.*.local
 .eslintcache
+.omc
 
 logs
 *.log

+ 27 - 0
apps/web-ele/src/api/coupon/coupon2.ts

@@ -13,6 +13,9 @@ interface Coupon2QueryParams
   extends Omit<Coupon2PartialEntity, 'coupon2adddatetime'>,
     PageConfig {
   couponmc?: string;
+  coupon2code?: string;
+  usersname?: string;
+  usersphone?: string;
   productsname?: string;
   productsmodel?: string;
   productsjjlx?: string;
@@ -64,6 +67,9 @@ export async function getCoupon2AuditListApi(data: Coupon2QueryParams) {
     pageindex,
     rows,
     couponmc,
+    coupon2code,
+    usersname,
+    usersphone,
     coupon2sype,
     productsname,
     productsmodel,
@@ -78,6 +84,15 @@ export async function getCoupon2AuditListApi(data: Coupon2QueryParams) {
   if (couponmc) {
     queryParams['coupon2mc.like'] = couponmc;
   }
+  if (coupon2code) {
+    queryParams['coupon2code.like'] = coupon2code;
+  }
+  if (usersname) {
+    queryParams['usersname.like'] = usersname;
+  }
+  if (usersphone) {
+    queryParams['usersphone.like'] = usersphone;
+  }
   if (coupon2sype !== undefined && coupon2sype !== null) {
     queryParams['coupon2sype.value'] = coupon2sype;
   }
@@ -111,6 +126,9 @@ export async function getCoupon2EditListApi(data: Coupon2QueryParams) {
     pageindex,
     rows,
     couponmc,
+    coupon2code,
+    usersname,
+    usersphone,
     coupon2sype,
     productsname,
     productsmodel,
@@ -125,6 +143,15 @@ export async function getCoupon2EditListApi(data: Coupon2QueryParams) {
   if (couponmc) {
     queryParams['coupon2mc.like'] = couponmc;
   }
+  if (coupon2code) {
+    queryParams['coupon2code.like'] = coupon2code;
+  }
+  if (usersname) {
+    queryParams['usersname.like'] = usersname;
+  }
+  if (usersphone) {
+    queryParams['usersphone.like'] = usersphone;
+  }
   if (coupon2sype !== undefined && coupon2sype !== null) {
     queryParams['coupon2sype.value'] = coupon2sype;
   }

+ 29 - 1
apps/web-ele/src/views/examine-manage/examine-coupon/index.vue

@@ -47,6 +47,33 @@ const formOptions: VbenFormProps = {
       },
     },
     {
+      component: 'Input',
+      fieldName: 'coupon2code',
+      label: '优惠券代码',
+      componentProps: {
+        placeholder: $t('ui.placeholder.input'),
+        clearable: true,
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'usersname',
+      label: '姓名',
+      componentProps: {
+        placeholder: $t('ui.placeholder.input'),
+        clearable: true,
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'usersphone',
+      label: '手机号',
+      componentProps: {
+        placeholder: $t('ui.placeholder.input'),
+        clearable: true,
+      },
+    },
+    {
       component: 'Select',
       fieldName: 'coupon2sype',
       label: '优惠券状态',
@@ -143,7 +170,7 @@ const gridOptions: VxeGridProps<any> = {
   columns: [
     { title: '序号', type: 'seq', width: 50 },
     // { title: '优惠券ID', field: 'coupon2sid', sortable: true },
-    // { title: '优惠券代码', field: 'coupon2code', sortable: true },
+    { title: '优惠券代码', field: 'coupon2code', sortable: true },
     { title: '产品名称', field: 'productsname', sortable: true },
     { title: '产品型号', field: 'productsmodel', sortable: true },
     { title: '机具类型', field: 'productsjjlx', sortable: true },
@@ -151,6 +178,7 @@ const gridOptions: VxeGridProps<any> = {
     { title: '优惠券名称', field: 'coupon2mc', sortable: true },
     { title: '可用产品', field: 'productsname', sortable: true },
     { title: '购机者', field: 'usersname', sortable: true, width: 140 },
+    { title: '手机号', field: 'usersphone', sortable: true },
     {
       title: '优惠券状态',
       field: 'coupon2sype',