Browse Source

奖金分配限定当前机构

zhengnaiwen_citu 6 tháng trước cách đây
mục cha
commit
4b9e1b5a74

+ 3 - 0
src/components/AutoComponents/MCard/index.vue

@@ -1,5 +1,8 @@
 <template>
   <el-card v-bind="$attrs" v-on="$listeners">
+    <template v-if="$scopedSlots.header" slot="header">
+      <slot name="header"></slot>
+    </template>
     <slot></slot>
   </el-card>
 </template>

+ 5 - 1
src/components/AutoComponents/MTable/index.vue

@@ -1,5 +1,8 @@
 <template>
-  <m-card :shadow="shadow">
+  <m-card :shadow="shadow" title="11">
+    <template v-if="cardTitle" slot="header">
+      <span>{{ cardTitle }}</span>
+    </template>
     <slot name="header"></slot>
     <el-table
       ref="table"
@@ -44,6 +47,7 @@ export default {
   name: 'm-table',
   components: { MTableColumn },
   props: {
+    cardTitle: String,
     shadow: String,
     items: {
       type: Array,

+ 2 - 1
src/store/getters.js

@@ -7,7 +7,8 @@ const getters = {
   lang: state => state.system.lang,
   systemInfo: state => state.system.systemInfo,
   refresh: state => state.menu.refresh,
-  permission: state => state.menu.permission
+  permission: state => state.menu.permission,
+  employeeInfo: state => state.user.employeeInfo
 }
 
 export default getters

+ 10 - 11
src/views/bonus/allocation/index.vue

@@ -48,6 +48,7 @@ import {
   getOrganizationTree
 } from '@/utils/dict'
 import { STATUS_LIST } from '../utils'
+import { mapGetters } from 'vuex'
 export default {
   name: 'bonusAllocation',
   components: {
@@ -64,9 +65,7 @@ export default {
         organizationNo: null,
         employeeCategory: null
       },
-      query: {
-        month: dateFormat('YYYY-mm', new Date())
-      },
+      query: {},
       employeeCategoryItems: [],
       totalGrantPerformanceSalary: 0,
       deptItems: [],
@@ -74,6 +73,7 @@ export default {
     }
   },
   computed: {
+    ...mapGetters(['employeeInfo']),
     totalAllocationPerformanceSalary () {
       return Object.values(this.values).reduce((r, v) => {
         return new Decimal(r).plus(v || 0)
@@ -91,6 +91,9 @@ export default {
             type: 'month',
             valueFormat: 'yyyy-MM',
             format: 'yyyy 年 MM 月'
+          },
+          handles: {
+            change: this.getEmployeeCategoryItems
           }
         },
         {
@@ -123,17 +126,12 @@ export default {
       ]
     }
   },
-  watch: {
-    'searchValues.month': {
-      handler (v) {
-        this.getEmployeeCategoryItems()
-      }
-    }
-  },
   async created () {
     this.loading = true
     this.onGetDept()
     await this.getEmployeeCategoryItems()
+    this.searchValues.organizationNo = this.employeeInfo.organizationNo
+    this.query = { ...this.searchValues }
     this.$nextTick(() => {
       this.onInit()
     })
@@ -178,12 +176,13 @@ export default {
           return
         }
         this.searchValues.employeeCategory = this.employeeCategoryItems[0].value
+        return data
       } catch (error) {
         this.employeeCategoryItems = []
         this.$message.error(error)
       }
     },
-    onSearch () {
+    async onSearch () {
       this.query = { ...this.searchValues }
       this.onInit({ current: 1 })
     },

+ 2 - 1
src/views/bonus/approve/approveDetails.vue

@@ -63,7 +63,8 @@ export default {
         this.$refs.bonusTableRefs.onInit({
           month: item.month,
           organizationNo: item.opOrganizationNo,
-          employeeCategory: item.employeeCategory
+          employeeCategory: item.employeeCategory,
+          employeePerformanceIds: item.employeePerformanceIds
         })
       })
     },

+ 3 - 1
src/views/humanResources/organizationStructure/index.vue

@@ -2,6 +2,7 @@
   <m-table
     v-loading="loading"
     row-key="uuid"
+    card-title="组织机构"
     :items="items"
     :headers="headers"
     :page-size="total"
@@ -12,7 +13,8 @@
     :load="load"
     :tree-props="{children: 'child'}"
     :default-sort="{ prop: 'sort', order: 'ascending' }"
-  ></m-table>
+  >
+  </m-table>
 </template>
 
 <script>

+ 1 - 0
src/views/humanResources/payroll/index.vue

@@ -6,6 +6,7 @@
       </template>
     </m-search>
     <m-table
+      card-title="员工工资单"
       :items="items"
       :headers="headers"
       :loading="loading"

+ 1 - 0
src/views/humanResources/roster/index.vue

@@ -11,6 +11,7 @@
       </template>
     </m-search>
     <m-table
+      card-title="员工花名册"
       v-loading="loading"
       row-key="id"
       :items="items"