Sfoglia il codice sorgente

固定薪资核对

zhengnaiwen_citu 4 mesi fa
parent
commit
c1365fc4f3
2 ha cambiato i file con 75 aggiunte e 21 eliminazioni
  1. 5 0
      src/api/salary.js
  2. 70 21
      src/views/salaryFixed/salaryFixedCalculation/index.vue

+ 5 - 0
src/api/salary.js

@@ -135,3 +135,8 @@ export function downloadSalaryFixedLevel (data) {
 export function exportSalaryFixedLevel (data) {
   return http.download('/salary/level/manage/download/export', data)
 }
+
+// 固定薪资 基础薪资
+export function getSalaryFixedList (data) {
+  return http.post('/digitizationData/employee/salary/page', data)
+}

+ 70 - 21
src/views/salaryFixed/salaryFixedCalculation/index.vue

@@ -9,40 +9,41 @@
       :page-current="pageInfo.current"
       :total="total"
       @page-change="onPageChange"
+      @sort-change="onSortChange"
     >
-      <template #card-tools>
+      <!-- <template #card-tools>
         <m-button type="orange" icon="el-icon-plus" @click="onAdd">新增</m-button>
-      </template>
-      <template #actions="{ row }">
+      </template> -->
+      <!-- <template #actions="{ row }">
         <m-button type="primary" text @click="onEdit(row)">编辑</m-button>
         <m-button type="danger" text @click="onDelete(row)">删除</m-button>
-      </template>
+      </template> -->
     </m-table>
   </div>
 </template>
 
 <script>
+import {
+  getSalaryFixedList
+} from '@/api/salary'
+import { mapGetters } from 'vuex'
 export default {
   name: 'salaryFixedCalculation',
   data () {
     return {
-      searchItems: [
-        {
-          label: '名称',
-          prop: 'name',
-          type: 'input',
-          options: {
-            placeholder: '请输入名称'
-          }
-        }
-      ],
       searchValues: {
-        name: null
+        employeeName: null
       },
       headers: [
-        { label: '名称', prop: 'name' },
-        { label: '状态', prop: 'status' },
-        { label: '操作', prop: 'actions', fixed: 'right', width: 300 }
+        { label: '姓名', prop: 'employeeName' },
+        { label: '所在部门名称', prop: 'deptName' },
+        { label: '岗位名称', prop: 'postName' },
+        { label: '人员类别', prop: 'personnelCategory' },
+        { label: '职务层级', prop: 'jobLevel' },
+        { label: '薪酬档次', prop: 'salaryCategory', align: 'center' },
+        { label: '薪酬等级', prop: 'salaryLevel', align: 'center' },
+        { label: '固定薪资', prop: 'salaryAmount', align: 'center' }
+        // { label: '操作', prop: 'actions', fixed: 'right', width: 150 }
       ],
       items: [],
       total: 0,
@@ -50,9 +51,43 @@ export default {
         current: 1,
         size: 10
       },
+      orders: [],
       loading: false
     }
   },
+  computed: {
+    ...mapGetters(['organizationTree']),
+    searchItems () {
+      return [
+        {
+          label: '姓名',
+          prop: 'employeeName',
+          type: 'input',
+          options: {
+            placeholder: '姓名'
+          }
+        },
+        {
+          label: '部门',
+          prop: 'organizationNo',
+          type: 'cascader',
+          options: {
+            filterable: true,
+            clearable: true,
+            placeholder: '请选择部门',
+            options: this.organizationTree,
+            showAllLevels: false,
+            props: {
+              emitPath: false,
+              value: 'organizationNo',
+              label: 'organizationName',
+              children: 'child'
+            }
+          }
+        }
+      ]
+    }
+  },
   created () {
     this.onInit()
   },
@@ -60,9 +95,19 @@ export default {
     async onInit () {
       this.loading = true
       try {
-        // const { data } = await ApiName()
-        // this.items = data.records
-        // this.total = data.total
+        const { organizationNo, ...param } = this.searchValues
+        const { data } = await getSalaryFixedList({
+          page: {
+            ...this.pageInfo,
+            orders: this.orders
+          },
+          entity: {
+            ...param
+          },
+          organizationNo
+        })
+        this.items = data.records
+        this.total = data.total
       } catch (error) {
         this.$message.error(error)
       } finally {
@@ -95,6 +140,10 @@ export default {
     onPageChange (index) {
       this.pageInfo.current = index
       this.onInit()
+    },
+    onSortChange (orders) {
+      this.orders = orders
+      this.onInit()
     }
   }
 }