소스 검색

积分列表

zhengnaiwen_citu 5 달 전
부모
커밋
29ca78d6b1

+ 0 - 5
src/api/accumulatePoint.js

@@ -15,11 +15,6 @@ export function getAccumulatePoint (data) {
   return http.post('/employee/score/detail', data)
 }
 
-// 积分 删除
-export function deleteAccumulatePoint (data) {
-  return http.post('', data)
-}
-
 // 积分 模板
 export function getAccumulatePointRule () {
   return http.get('/employee/score/rule/detail')

+ 4 - 24
src/views/accumulatePoints/accumulatePointsApply/index.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="pa-3 white">
-    <!-- <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search> -->
     <m-table
       v-loading="loading"
       :items="items"
@@ -30,8 +29,7 @@
 
 <script>
 import {
-  getAccumulatePointList,
-  deleteAccumulatePoint
+  getAccumulatePointList
 } from '@/api/accumulatePoint'
 import AccumulatePointsApplyDetails from '../components/accumulatePointsApplyDetails.vue'
 import AccumulatePointsApplyEdit from './accumulatePointsApplyEdit.vue'
@@ -67,7 +65,9 @@ export default {
       this.loading = true
       try {
         const { data } = await getAccumulatePointList({
-          ...this.pageInfo
+          page: {
+            ...this.pageInfo
+          }
         })
         this.items = data.records
         this.total = data.total
@@ -80,29 +80,9 @@ export default {
     onAdd () {
       this.$refs.accumulatePointsApplyEditRefs.open()
     },
-    onEdit (item) {
-      this.$refs.accumulatePointsApplyEditRefs.open(item)
-    },
-    onDelete (row) {
-      this.$confirm('确定删除吗?', '提示')
-        .then(async () => {
-          try {
-            await deleteAccumulatePoint({ id: row.id })
-            this.$message.success('删除成功')
-            this.onInit()
-          } catch (error) {
-            this.$message.error(error)
-          }
-        })
-        .catch(_ => {})
-    },
     onDetails (item) {
       this.$refs.accumulatePointsApplyDetailsRefs.open(item)
     },
-    onSearch () {
-      this.pageInfo.current = 1
-      this.onInit()
-    },
     onPageChange (index) {
       this.pageInfo.current = index
       this.onInit()

+ 112 - 3
src/views/accumulatePoints/accumulatePointsIntegralList/index.vue

@@ -1,12 +1,121 @@
 <template>
-  <div>
-
+  <div class="pa-3 white">
+    <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
+    <m-table
+      v-loading="loading"
+      :items="items"
+      :headers="headers"
+      :page-size="pageInfo.size"
+      :page-current="pageInfo.current"
+      :total="total"
+      @page-change="onPageChange"
+    >
+      <template #score="{ row }">
+        <el-tag type="success">{{ row.score }}</el-tag>
+      </template>
+      <template #actions="{ row }">
+        <m-button text type="primary" @click="onDetails(row)">查看明细</m-button>
+      </template>
+    </m-table>
+    <AccumulatePointsApplyDetails ref="accumulatePointsApplyDetailsRefs"></AccumulatePointsApplyDetails>
   </div>
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
+import AccumulatePointsApplyDetails from '../components/accumulatePointsApplyDetails.vue'
+import {
+  getAccumulatePointList
+} from '@/api/accumulatePoint'
 export default {
-  name: 'accumulatePointsIntegralList'
+  name: 'accumulatePointsIntegralList',
+  components: {
+    AccumulatePointsApplyDetails
+  },
+  data () {
+    return {
+      headers: [
+        { label: '员工姓名', prop: 'employeeName' },
+        { label: '机构', prop: 'organizationName' },
+        { label: '申报积分', prop: 'score', align: 'center' },
+        { label: '创建时间', prop: 'createDate' },
+        { label: '操作', prop: 'actions' }
+      ],
+      items: [],
+      total: 0,
+      pageInfo: {
+        current: 1,
+        size: 10
+      },
+      loading: false,
+      searchValues: {
+        employeeName: null,
+        organizationName: null
+      }
+    }
+  },
+  created () {
+    this.onInit()
+  },
+  computed: {
+    ...mapGetters(['organizationTree']),
+    searchItems () {
+      return [
+        { label: '员工姓名', prop: 'employeeName', type: 'input', options: { placeholder: '请输入员工姓名' } },
+        {
+          label: '机构',
+          prop: 'organizationNo',
+          type: 'cascader',
+          options: {
+            placeholder: '请选择机构',
+            options: this.organizationTree,
+            showAllLevels: false,
+            props: {
+              emitPath: false,
+              checkStrictly: true,
+              value: 'organizationNo',
+              label: 'organizationName',
+              children: 'child'
+            }
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    async onInit () {
+      this.loading = true
+      try {
+        const { data } = await getAccumulatePointList({
+          page: {
+            ...this.pageInfo
+          },
+          entity: {
+            ...this.searchValues
+          }
+        })
+        this.items = data.records
+        this.total = data.total
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onDetails (item) {
+      this.$refs.accumulatePointsApplyDetailsRefs.open(item, {
+        employeeCode: item.employeeCode
+      })
+    },
+    onSearch () {
+      this.pageInfo.current = 1
+      this.onInit()
+    },
+    onPageChange (index) {
+      this.pageInfo.current = index
+      this.onInit()
+    }
+  }
 }
 </script>
 

+ 35 - 6
src/views/accumulatePoints/components/accumulatePointsApplyDetails.vue

@@ -1,9 +1,21 @@
 <template>
   <m-dialog ref="dialog" title="积分明细">
     <m-table
+      shadow="never"
+      clear-header
       :headers="headers"
       :items="items"
-    ></m-table>
+    >
+      <template #actions="{ row }">
+        <m-button type="primary" text @click="getFile(row)">查看附件</m-button>
+      </template>
+    </m-table>
+    <el-image
+      ref="hiddenPreview"
+      style="display: none;"
+      :src="previewUrl.length ? previewUrl[0] : ''"
+      :preview-src-list="previewUrl"
+    ></el-image>
   </m-dialog>
 </template>
 
@@ -12,29 +24,46 @@ import {
   getAccumulatePoint
 } from '@/api/accumulatePoint'
 export default {
-  name: 'accumulatePointsApplyEdit',
+  name: 'accumulatePointsApplyDetails',
 
   data () {
     return {
       loading: false,
       items: [],
-      headers: []
+      headers: [
+        { label: '分类', prop: 'category' },
+        { label: '积分类型', prop: 'title' },
+        { label: '积分值', prop: 'inputValue' },
+        { label: '描述', prop: 'desc' },
+        { label: '操作', prop: 'actions' }
+      ],
+      previewUrl: []
     }
   },
   methods: {
-    async open (item) {
+    async open (item, query = {}) {
       this.loading = true
       this.$refs.dialog.open()
       try {
         const { data } = await getAccumulatePoint({
-          employeeScoreId: item.employeeScoreId
+          employeeScoreId: item.employeeScoreId,
+          ...query
         })
-        console.log(data)
+        this.items = data.itemInfos
       } catch (error) {
         this.$message.error(error)
       } finally {
         this.loading = false
       }
+    },
+    getFile (row) {
+      this.previewUrl = row.images
+      this.$nextTick(() => {
+        setTimeout(() => {
+          const img = this.$refs.hiddenPreview.$el.querySelector('img')
+          img && img.click()
+        }, 100)
+      })
     }
   }
 }

+ 0 - 2
src/views/humanResources/organizationStructure/index.vue

@@ -34,7 +34,6 @@ import {
   // downloadOrganization,
   deleteOrganization
 } from '@/api/system'
-import { mapGetters } from 'vuex'
 import {
   // upload,
   download
@@ -61,7 +60,6 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['organizationTree']),
     option () {
       return {
         series: [