From c536cbdacf1d945226fe1973e640d061f33b8eac Mon Sep 17 00:00:00 2001
From: yijiusmile <253281376@qq.com>
Date: 星期四, 04 二月 2021 21:28:55 +0800
Subject: [PATCH] 信息录入增加翻页,在职离职员工样式修改

---
 src/views/user/Informationinput.vue |   73 +++++++++++++++++++++++++++++-------
 1 files changed, 59 insertions(+), 14 deletions(-)

diff --git a/src/views/user/Informationinput.vue b/src/views/user/Informationinput.vue
index 3e05c13..94a08f3 100644
--- a/src/views/user/Informationinput.vue
+++ b/src/views/user/Informationinput.vue
@@ -420,6 +420,7 @@
           <el-table-column prop="remarkDate" label="备注日期" width="180" />
           <el-table-column prop="remarkContent" label="备注信息" width="400" />
         </el-table>
+        <pagination v-show="total>0" :total="total" :page.sync="pagination.num" :limit.sync="pagination.size" @pagination="search" />
         <el-col :span="24">
           <div style="margin: 0px auto; width: 250px;margin-top: 20px;">
             <el-button class="nomalBtn" @click="deleteFrom()">取消</el-button>
@@ -1908,11 +1909,21 @@
 import { toCardGetUserInfo } from '@/utils/myUtil'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import Pagination from '@/components/Pagination'
 
 export default {
-  components: { Treeselect },
+  components: { Treeselect, Pagination },
   data() {
     return {
+      total: 0, // 总数量
+      queryParams: {}, // 查询参数
+      sort: {}, // 排序
+      pagination: { // 分页参数
+        size: 5,
+        num: 1
+      },
+      tableUrl: '',
+      tableDataName: '',
       rules: {
         empNumb: [{ required: true, message: '请输入员工编号', trigger: 'blur' },
           { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }],
@@ -2084,7 +2095,6 @@
         }
       ],
       isAdd: false,
-      queryParams: {},
       depts: [],
       deptTree: [],
       physicalExamData: [],
@@ -2501,20 +2511,41 @@
   },
   mounted() {
     this.initDept()
-    this.selectBadRecord()
-    this.selectEmpBase()
-    this.selectWorkExperience()
-    this.selectPhysicalExam()
-    this.selectContractInfo()
-    this.selectDimissionAttend()
-    this.selectLeaveInfo()
-    this.selectResign()
-    this.selectUnemployment()
-    this.selectAccidentCases()
-    this.selectLaborTrouble()
-    this.selectRemarkInfo()
+    this.thisShowIndex = 1
+    this.isShow(false, 0)
+    // this.selectBadRecord()
+    // this.selectEmpBase()
+    // this.selectWorkExperience()
+    // this.selectPhysicalExam()
+    // this.selectContractInfo()
+    // this.selectDimissionAttend()
+    // this.selectLeaveInfo()
+    // this.selectResign()
+    // this.selectUnemployment()
+    // this.selectAccidentCases()
+    // this.selectLaborTrouble()
+    // this.selectRemarkInfo()
   },
   methods: {
+    // 翻页插件翻页方法
+    search() {
+      this.fetch({
+        ...this.queryParams,
+        ...this.sort
+      })
+    },
+    // 公用查询
+    fetch(params = {}) {
+      params.pageSize = this.pagination.size
+      params.pageNum = this.pagination.num
+      this.$get(this.tableUrl, {
+        ...params
+      }).then((r) => {
+        const data = r.data.data
+        this.total = data.total
+        this[this.tableDataName] = data.rows
+      })
+    },
     dialogIsShow() {
       this.isAdd = true
       this.dialogshowArr[this.thisShowIndex].show = !this.dialogshowArr[this.thisShowIndex]
@@ -2531,6 +2562,20 @@
         this.showArr[this.thisShowIndex].show = false
       }
       this.thisShowIndex = index
+      switch (this.thisShowIndex) {
+        case 0:
+          this.tableUrl = 'hr/empBaseInfo/list'
+          this.tableDataName = 'basicInformationData'
+          this.queryParams.delFlag = 2
+          this.search()
+          break
+        case 1:
+          this.tableUrl = 'hr/empWorkExperience/list'
+          this.tableDataName = 'workExperienceData'
+          this.queryParams.delFlag = 2
+          this.search()
+          break
+      }
     },
     initDept() {
       this.$get('system/dept').then((r) => {

--
Gitblit v1.8.0