luoyb
2021-03-05 2c7c8a89d0b7acef55a97401e174ed8b9a902d96
src/views/user/selectuser.vue
@@ -17,8 +17,9 @@
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="2">
            <el-button type="primary" @click="search">查询</el-button>
          <el-col :span="4">
            <el-button size="mini" class="hr-but-all" type="primary" @click="vagueSearch">查询</el-button>
            <el-button size="mini" class="hr-but" type="danger" @click="resetSearch">重置</el-button>
          </el-col>
        </el-row>
      </el-form>
@@ -28,17 +29,17 @@
        ref="multipleTable"
        :data="list"
        row-key="prop1"
        width="50%"
        width="80%"
        @selection-change="handleSelectionChange"
        @row-dblclick="rowDblclick"
      >
        <el-table-column type="selection" :reserve-selection="false" width="55" />
        <el-table-column type="selection" :reserve-selection="false" width="50" />
        <el-table-column v-if="show" prop="empId" label="员工Id" />
        <el-table-column prop="empNumb" label="员工编号" />
        <el-table-column prop="empNumb" label="编号" />
        <el-table-column prop="empName" label="姓名" />
        <el-table-column prop="certificateNumb" label="身份证号码" width="180" />
        <el-table-column v-if="show" prop="deptId" label="部门Id" />
        <el-table-column prop="deptName" label="护卫点" />
        <el-table-column prop="deptName" label="护卫点" width="180" />
        <el-table-column v-if="show" prop="jobId" label="岗位Id" />
        <el-table-column prop="jobName" label="岗位" />
        <el-table-column prop="empTypeName" label="员工类别" />
@@ -88,7 +89,7 @@
      }, // 查询参数
      sort: {}, // 排序
      pagination: { // 分页参数
        size: 10,
        size: 12,
        num: 1
      },
      list: [], // 给table显示的数据
@@ -104,18 +105,39 @@
  methods: {
    // 翻页方法
    search() {
      this.queryParams.empName = this.queryParams.empNumb
      this.queryParams.deptName = this.queryParams.empNumb
      this.queryParams.delFlag = 0
      this.fetch({
        ...this.queryParams,
        ...this.sort
      })
    },
    vagueSearch() {
      this.fetch({
        empNumb: this.queryParams.empNumb,
        empName: this.queryParams.empNumb,
        deptName: this.queryParams.empNumb,
        certificateNumb: this.queryParams.empNumb,
        nativePlaceName: this.queryParams.empNumb,
        censusAddress: this.queryParams.empNumb,
        empStatus: this.queryParams.empStatus
      })
    },
    resetSearch() {
      this.queryParams = {
        empNumb: '',
        empName: '',
        deptName: '',
        certificateNumb: '',
        nativePlaceName: '',
        censusAddress: '',
        empStatus: []
      }
      this.search()
    },
    fetch(params = {}) {
      var that = this
      params.pageSize = this.pagination.size
      params.pageNum = this.pagination.num
      params.delFlag = 0
      this.$get('hr/empBaseInfo/list', {
        ...params
      }).then((r) => {
@@ -143,6 +165,7 @@
    },
    rowDblclick(row, column, event) {
      this.$refs.multipleTable.toggleRowSelection(row, true)
      this.sureChoose()
    }
  }
}