Эх сурвалжийг харах

feat: 积分规则设置活动时效对接查询接口

xyh 6 сар өмнө
parent
commit
70999e68ac

+ 13 - 1
src/api/points/rules_api.js

@@ -59,7 +59,7 @@ export function addActivity(data) {
 }
 
 /**
- * 编辑积分活动时效
+ * 设置积分活动时效
  * @param {Object} data - 查询参数对象,包含查询条件
  */
 export function editValidity(data) {
@@ -70,6 +70,18 @@ export function editValidity(data) {
   })
 }
 
+/**
+ * 查询积分活动时效
+ * @param {Object} data - 查询参数对象,包含查询条件
+ */
+export function getValidity(query) {
+  return request({
+    url: '/point/activity/validity/details',
+    method: 'get',
+    params: query
+  })
+}
+
 /**
  * 获取单一活动统计信息
  * @param {Object} query - 查询参数对象,包含查询条件

+ 22 - 22
src/router/index.js

@@ -178,7 +178,7 @@ export const constantRoutes = [
       {
         path: '/pointsManagement/details',
         component: () => import('@/views/pointsManagement/pointsOrdeManagement/details'),
-        name: 'details',
+        name: 'pointDetails',
         props:true,
         meta: { title: '积分订单详情' },
       },
@@ -261,8 +261,8 @@ export const constantRoutes = [
       }
     ]
   },
-   // 车费
-   {
+  // 车费
+  {
     path: '/fare',
     component: Layout,
     hidden: true,
@@ -276,8 +276,8 @@ export const constantRoutes = [
       }
     ]
   },
-   // 招商合作
-   {
+  // 招商合作
+  {
     path: '/teamWork',
     component: Layout,
     hidden: true,
@@ -291,23 +291,23 @@ export const constantRoutes = [
       }
     ]
   },
-     // 银行
-     {
-      path: '/bank',
-      component: Layout,
-      hidden: true,
-      redirect: 'bank',
-      children: [
-        {
-          path: '',
-          component: () => import('@/views/bank/bank'),
-          name: 'teamWork',
-          meta: { title: '银行' }
-        }
-      ]
-    },
-   // 投诉管理
-   {
+  // 银行
+  {
+    path: '/bank',
+    component: Layout,
+    hidden: true,
+    redirect: 'bank',
+    children: [
+      {
+        path: '',
+        component: () => import('@/views/bank/bank'),
+        name: 'teamWork',
+        meta: { title: '银行' }
+      }
+    ]
+  },
+  // 投诉管理
+  {
     path: '/complain',
     component: Layout,
     hidden: true,

+ 12 - 5
src/views/pointsManagement/pointsRules/compontents/Expiration_points.vue

@@ -1,5 +1,5 @@
 <script>
-import {editValidity} from '@/api/points/rules_api'
+import {editValidity,getValidity} from '@/api/points/rules_api'
 export default {
   name: "Expiration_points",
   data() {
@@ -7,25 +7,32 @@ export default {
       validityPeriod: false,
       tabList: [],
       activeTab: "",
+      validityList:[],
       expirePolicy: 1, // 1: 永久有效, 2: 逐笔过期, 3: 逐年过期
       expireDays: "",
       expireYear: ""
     }
   },
   methods: {
+    async getValidityData() {
+      const res = await getValidity();
+      this.validityList = res.data;
+      this.handleClick();
+    },
     clickSet(row) {
       this.validityPeriod = true;
       this.tabList = row || this.tabList;
       this.activeTab = row && row.length > 0 ? row[0].value : '';
+      this.getValidityData();
     },
     handleClose() {
       this.validityPeriod = false;
     },
     handleClick() {
-      this.expirePolicy = 1;
-      this.expireDays = '';
-      this.expireYear = '';
-      // 标签页切换处理
+      let selectInfo = this.validityList.filter(item => item.activityType === this.activeTab);
+      this.expirePolicy = selectInfo[0].expirePolicy;
+      this.expireDays = selectInfo[0].expireDays;
+      this.expireYear = selectInfo[0].expireYear;
     },
     handleConfirm() {
       // 确定按钮处理