zhengnaiwen_citu il y a 4 mois
Parent
commit
a5ce35c495

+ 15 - 0
src/api/accumulatePoint.js

@@ -49,3 +49,18 @@ export function exchangeAccumulatePointProduct (data) {
 export function getAccumulatePointProductHistory (data) {
   return http.post('/score/consumption/record/user/page', data)
 }
+
+// 积分规则 列表
+export function getAccumulatePointRulesList (data) {
+  return http.post('/employee/score/rule/page', data)
+}
+
+// 积分规则 列表
+export function saveAccumulatePointRules (data) {
+  return http.post('/employee/score/rule/save', data)
+}
+
+// 积分规则 列表
+export function deleteAccumulatePointRules (data) {
+  return http.post('/employee/score/rule/del', data)
+}

+ 7 - 2
src/views/accumulatePoints/accumulatePointsApply/accumulatePointsApplyEdit.vue

@@ -114,6 +114,11 @@ export default {
       this.$refs.dialog.open()
       try {
         const { data } = await getAccumulatePointRule()
+        if (!data.length) {
+          this.$message.error('暂无积分规则')
+          this.$refs.dialog.close()
+          return
+        }
         this.items = data.reduce((acc, cur) => {
           acc.push(...cur.item)
           return acc
@@ -147,12 +152,12 @@ export default {
     },
     onAdd () {
       this.key++
-      const item = this.items[0]
+      const item = this.items?.[0]
       this.queryItems.push({
         ...item,
         key: this.key,
         images: null,
-        value: item.inputType === 1 ? 0 : null
+        value: item?.inputType === 1 ? 0 : null
       })
     },
     async onSure () {

+ 23 - 6
src/views/accumulatePoints/accumulatePointsRules/index.vue

@@ -14,6 +14,7 @@
         <m-button type="orange" icon="el-icon-plus" @click="onAdd">新增</m-button>
       </template>
       <template #actions="{ row }">
+        <m-button type="primary" text @click="onDetails(row)">查看</m-button>
         <m-button type="primary" text @click="onEdit(row)">编辑</m-button>
         <m-button type="danger" text @click="onDelete(row)">删除</m-button>
       </template>
@@ -23,7 +24,7 @@
 
 <script>
 import {
-// getAccumulatePointList,
+  getAccumulatePointRulesList
 } from '@/api/accumulatePoint'
 export default {
   name: 'AccumulatePointRules',
@@ -43,8 +44,9 @@ export default {
         name: null
       },
       headers: [
-        { label: '名称', prop: 'name' },
-        { label: '状态', prop: 'status' },
+        { label: '模块名称', prop: 'ruleCategory' },
+        { label: '积分最大值', prop: 'maxScore' },
+        { label: '创建时间', prop: 'createDate' },
         { label: '操作', prop: 'actions', fixed: 'right', width: 300 }
       ],
       items: [],
@@ -53,6 +55,12 @@ export default {
         current: 1,
         size: 10
       },
+      orders: [
+        {
+          column: 'create_date',
+          asc: false
+        }
+      ],
       loading: false
     }
   },
@@ -63,9 +71,17 @@ export default {
     async onInit () {
       this.loading = true
       try {
-        // const { data } = await getAccumulatePointList()
-        // this.items = data.records
-        // this.total = data.total
+        const { data } = await getAccumulatePointRulesList({
+          page: {
+            ...this.pageInfo,
+            orders: this.orders
+          },
+          entity: {
+            ...this.searchValues
+          }
+        })
+        this.items = data.records
+        this.total = data.total
       } catch (error) {
         this.$message.error(error)
       } finally {
@@ -78,6 +94,7 @@ export default {
     onEdit (item) {
       this.$refs.accumulatePointRefs.open(item)
     },
+    onDetails () {},
     onDelete (row) {
       this.$confirm('确定删除吗?', '提示')
         .then(async () => {

+ 1 - 1
src/views/dataChart/privateChart/privateChartEditParams.vue

@@ -7,7 +7,7 @@
       <el-tab-pane label="参数配置" name="second">
         <PrivateChartEditParamsConfig ref="config" @change="onChangeConfig"></PrivateChartEditParamsConfig>
       </el-tab-pane> -->
-      <el-tab-pane label="AI查询" name="third">
+      <el-tab-pane label="AI取数" name="third">
         <div class="box fullHeigh">
           <div class="box-msg">
             <div v-for="(item, i) in items" :key="i" :class="{ active: item.type === 1 }" class="box-msg-items d-flex mb-3">

+ 0 - 15
src/views/salaryOther/salaryOtherRules/index.vue

@@ -1,15 +0,0 @@
-<template>
-  <div>
-
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'salaryOtherRules'
-}
-</script>
-
-<style lang="scss" scoped>
-
-</style>