<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" id="queryForm">
      <el-form-item label="申请类型" prop="approveType">
        <el-select v-model="queryParams.approveType" placeholder="请选择申请类型" clearable size="small">
          <el-option
            v-for="dict in approveTypeOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
       <!-- <el-button
          type="danger"
          plain
          icon="el-icon-refresh-right"
          size="mini"
          :disabled="multiple"
          @click="handleReback"
          v-hasPermi="['system:salaryemploye:rebackapply']"
        >撤回
        </el-button>-->
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="salaryemployeList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" v-if="0"/>
      <el-table-column label="员工ID" align="center" prop="employeId" v-if="0"/>
      <el-table-column label="单位ID" align="center" prop="deptId" v-if="0"/>
      <el-table-column label="序号" align="center" type="index" :index="indexFn" fixed />
      <el-table-column label="序号" align="center" prop="xuHao" fixed width="60" v-if="0"/>
      <el-table-column label="单位名称" align="center" prop="applyDeptName" fixed  :show-overflow-tooltip="true" width="230"/>
      <el-table-column label="姓名" align="center" prop="name" fixed/>
      <el-table-column label="手机号" align="center" prop="phone" width="110"/>
      <el-table-column label="身份证号" align="center" prop="idcardNo" width="180"/>
      <el-table-column label="唯一码" align="center" prop="uniqueCode"/>
      <el-table-column label="性别" align="center" prop="sex" :formatter="sexFormat" width="50"/>
      <el-table-column label="出生日期" align="center" prop="birthDay" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.birthDay, '{y}年{m}月') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="是否一孩" align="center" prop="onlyChild" :formatter="onlyChildFormat" width="100" v-if="0"/>
      <el-table-column label="民族" align="center" prop="folk" :formatter="folkFormat" width="60"/>
      <el-table-column label="政治面貌" align="center" prop="politicalStatus" :formatter="politicalStatusFormat"/>
      <el-table-column label="初始学历" align="center" prop="firstEducation" :formatter="firstEducationFormat" :show-overflow-tooltip="true" width="100"/>
      <el-table-column label="初始学历毕业院校" align="center" prop="firstEducationSchool" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="初始学历所学专业" align="center" prop="firstEducationProfession" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="最高学历" align="center" prop="topEducation" :formatter="topEducationFormat" :show-overflow-tooltip="true" width="100"/>
      <el-table-column label="最高学历毕业院校" align="center" prop="topEducationSchool" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="最高学历所学专业" align="center" prop="topEducationProfession" :show-overflow-tooltip="true" width="150"/>
      <el-table-column label="技术职称" align="center" prop="professionalTitle" :formatter="professionalTitleFormat" width="110"/>
      <el-table-column label="现岗位及职务" align="center" prop="postJob"  width="160" />
      <el-table-column label="职务" align="center" prop="postTitle" :formatter="postTitleFormat" width="160" />
      <el-table-column label="职级" align="center" prop="postLevel" :formatter="postLevelFormat" width="150"/>
      <el-table-column label="任同等职务时间" align="center" prop="postTime" width="150">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.postTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="参加工作时间" align="center" prop="workDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.workDate, '{y}年{m}月') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="入司时间" align="center" prop="hiredate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.hiredate, '{y}年{m}月') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="籍贯" align="center" prop="nativePlace" width="200" :show-overflow-tooltip="true"/>
      <el-table-column label="人事档案存放地" align="center" prop="personnelDossierLocation" width="140"/>
      <el-table-column label="人事档案是否在集团" align="center" prop="personnelDossier" :formatter="personnelDossierFormat" width="140" v-if="0"/>
      <el-table-column label="调任部门" align="center" prop="deptName" :show-overflow-tooltip="true"/>
      <el-table-column label="申请日期" align="center" prop="firedate"  width="100" />
      <el-table-column label="员工类型" align="center" prop="employeType" :formatter="employeTypeFormat"/>
      <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat"/>
      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
      <el-table-column label="申请状态" align="center" prop="approveStatus" fixed="right" :formatter="approveStatusFormat"/>
      <el-table-column label="申请类型" align="center" prop="approveType" fixed="right" :formatter="approveTypeFormat"/>
     <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="115">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row)"
            v-hasPermi="['system:salaryemploye:query']"
          >详情</el-button>
          <el-button
            v-if="scope.row.approveStatus!=0"
            size="mini"
            type="text"
            icon="el-icon-refresh-right"
            @click="handleReback(scope.row)"
            v-hasPermi="['system:salaryemploye:rebackapply']"
          >撤回</el-button>
        </template>
      </el-table-column>-->
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改员工花名册对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="650px" append-to-body id="dialog-view">
      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        <el-row>
          <el-col :span="24">
            <el-form-item label="机构名称" prop="deptId">
              <treeselect disabled="true" v-model="form.deptId" :options="deptOptions" :normalizer="normalizer" placeholder="选择机构" :defaultExpandLevel="Infinity" :default-expand-level="1"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="姓名" prop="name">
              <el-input v-model="form.name" placeholder="请输入姓名" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="身份证号" prop="idcardNo">
              <el-input v-model="form.idcardNo" placeholder="请输入身份证号" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="出生日期" prop="birthDay">
              <el-date-picker clearable size="small"
                              v-model="form.birthDay"
                              type="month"
                              disabled
                              value-format="yyyy-MM-dd"
                              placeholder="选择出生日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="性别" prop="sex">
              <el-select v-model="form.sex" placeholder="请选择性别" size="small" disabled>
                <el-option
                  v-for="dict in sexOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="民族" prop="folk">
              <el-select v-model="form.folk" placeholder="请选择民族" disabled>
                <el-option
                  v-for="dict in folkOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="政治面貌" prop="politicalStatus">
              <el-select v-model="form.politicalStatus" placeholder="请选择政治面貌" disabled>
                <el-option
                  v-for="dict in politicalStatusOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="籍贯" prop="nativePlace">
              <el-input v-model="form.nativePlace" placeholder="请输入籍贯" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="技术职称" prop="professionalTitle">
              <el-select v-model="form.professionalTitle" placeholder="请选择技术职称" disabled>
                <el-option
                  v-for="dict in professionalTitleOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="初始学历" prop="firstEducation">
              <el-select v-model="form.firstEducation" placeholder="请选择初始学历" disabled>
                <el-option
                  v-for="dict in educationOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="最高学历" prop="topEducation">
              <el-select v-model="form.topEducation" placeholder="请选择最高学历" disabled>
                <el-option
                  v-for="dict in educationOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
            <el-col :span="12">
              <el-form-item label="现岗位及职务" prop="postJob">
                <el-input v-model="form.postJob" placeholder="请输入现岗位及职务" disabled/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="职务" prop="postTitle">
                <el-select v-model="form.postTitle" placeholder="请选择职务" disabled>
                  <el-option
                    v-for="dict in postTitleOptions"
                    :key="dict.dictValue"
                    :label="dict.dictLabel"
                    :value="dict.dictValue"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
        </el-row>

        <el-row v-hasPermi="['system:salaryemploye:editpost']">
          <el-col :span="12">
            <el-form-item label="唯一码" prop="uniqueCode">
              <el-input v-model="form.uniqueCode" placeholder="请输入唯一码" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="职级" prop="postLevel">
              <el-select v-model="form.postLevel" placeholder="请选择职级" disabled>
                <el-option
                  v-for="dict in postLevelOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="参加工作时间" prop="workDate">
              <el-date-picker
                disabled
                clearable
                size="small"
                v-model="form.workDate"
                type="month"
                value-format="yyyy-MM-dd"
                placeholder="选择参加工作时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="入司时间" prop="hiredate">
              <el-date-picker clearable
                              disabled
                              size="small"
                              v-model="form.hiredate"
                              type="month"
                              value-format="yyyy-MM-dd"
                              placeholder="选择入司时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="员工类型" prop="employeType">
              <el-select v-model="form.employeType" placeholder="请选择员工类型" disabled>
                <el-option
                  v-for="dict in employeTypeOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工岗位" prop="postCode">
              <el-select v-model="form.postCode" placeholder="请选择员工岗位" disabled>
                <el-option
                  v-for="dict in postCodeOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12" v-if="0">
            <el-form-item label="是否一孩">
              <el-radio-group v-model="form.onlyChild" disabled>
                <el-radio
                  v-for="dict in onlyChildOptions"
                  :key="dict.dictValue"
                  :label="dict.dictValue"
                >{{dict.dictLabel}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="人事档案存放地" prop="personnelDossierLocation" disabled>
              <el-input v-model="form.personnelDossierLocation" placeholder="请输入人事档案存放地"/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="人事档案">
              <el-radio-group v-model="form.personnelDossier" disabled>
                <el-radio
                  v-for="dict in personnelDossierOptions"
                  :key="dict.dictValue"
                  :label="dict.dictValue"
                >{{dict.dictLabel}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="在职状态">
              <el-select v-model="form.status" placeholder="请选择在职状态" disabled>
                <el-option
                  v-for="dict in statusOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" placeholder="请输入备注" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer" style="padding-top: 0px;">
        <el-button type="primary" @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>


  </div>
</template>
<style scoped>
  #queryForm .el-form-item{
    margin-bottom: 5px;
    margin-top: 5px;
  }

  .el-date-editor {
    width:195px;
  }

  .twoLine .el-form-item__label {
    line-height: 18px;
  }

  .el-dropdown-link {
    cursor: pointer;
    color: #409eff;
    font-size:12px;
  }

  #dialog-view div.el-dialog__body{
    padding-top: 5px;
    padding-bottom: 5px;
  }

  #dialog-view div.el-dialog__footer{
    padding-top: 0px;
  }

</style>

<script>
  var that;
  import {
    listSalaryemployeApply,
    getSalaryemploye,
    rebackApply
  } from "@/api/system/salaryemploye";

  import {listDept, listDeptExcludeChild} from "@/api/system/dept";
  import Treeselect from "@riophae/vue-treeselect";
  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  import {getToken} from "@/utils/auth";
  import { listEmployee, getEmployee, delEmployee, addEmployee, updateEmployee, exportEmployee } from "@/api/bizapprove/employee";
  export default {
    name: "Salaryemploye",
    components: {Treeselect},
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 选中数组
        names: [],
        // 选中数组
        deptIds: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 部门树选项
        deptOptions: [],
        // 员工花名册表格数据
        salaryemployeList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 是否显示弹出层(离职)
        openLeave: false,
        //弹出框 操作类型
        operAction:'',
        // 申请类型字典
        approveTypeOptions: [],
        // 申请状态字典
        approveStatusOptions: [],
        // 性别字典
        sexOptions: [],
        // 年龄段字典
        agePeriodOptions: [],
        // 是否一孩字典
        onlyChildOptions: [],
        // 民族字典
        folkOptions: [],
        // 政治面貌字典
        politicalStatusOptions: [],
        // 学历学位字典
        educationOptions: [],
        // 技术职称字典
        professionalTitleOptions: [],
        // 岗位字典
        postCodeOptions: [],
        // 职务字典
        postTitleOptions: [],
        // 职级字典
        postLevelOptions: [],
        // 人事档案是否在集团字典
        personnelDossierOptions: [],
        // 员工类型字典
        employeTypeOptions: [],
        // 状态字典
        statusOptions: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,

          approveStatus: null,
          approveType: null,
        },
        // 表单参数
        form: {},
        Wi: [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2],
        ValideCode: [1,0,'X',9,8,7,6,5,4,3,2],
        // 表单校验
        rules: {
        },
        rulesLeave: {
        }
      };
    },
    created() {
      that=this;
      this.getList();

      this.getDicts("sys_user_sex").then(response => {
        this.sexOptions = response.data;
      });
      this.getDicts("employe_age_period").then(response => {
        this.agePeriodOptions = response.data;
      });
      this.getDicts("sys_yes_no").then(response => {
        this.onlyChildOptions = response.data;
      });
      this.getDicts("sys_folk").then(response => {
        this.folkOptions = response.data;
      });
      this.getDicts("sys_political_status").then(response => {
        this.politicalStatusOptions = response.data;
      });
      this.getDicts("sys_education").then(response => {
        this.educationOptions = response.data;
      });
      this.getDicts("sys_professional_title").then(response => {
        this.professionalTitleOptions = response.data;
      });
      this.getDicts("sys_employe_post").then(response => {
        this.postCodeOptions = response.data;
      });
      this.getDicts("sys_post").then(response => {
        if(this.$store.state.user.deptType == 20){

          response.data.forEach(item =>{
            if(item.dictValue.startsWith("2")){
              this.postTitleOptions.push(item)
            }
          });

        }else{
          this.postTitleOptions = response.data;
        }
      });
      this.getDicts("sys_post_level").then(response => {
        this.postLevelOptions = response.data;
      });
      this.getDicts("sys_employe_dossier").then(response => {
        this.personnelDossierOptions = response.data;
      });
      this.getDicts("sys_employe_type").then(response => {
        this.employeTypeOptions = response.data;
      });
      this.getDicts("sys_employe_status").then(response => {
        this.statusOptions = response.data;
      });
      this.getDicts("employe_approve_status").then(response => {
        this.approveStatusOptions = response.data;
      });
      this.getDicts("employe_approve_type").then(response => {
        this.approveTypeOptions = response.data;
      });
    },
    methods: {

      /** 查询员工花名册列表 */
      getList() {
      /*  this.loading = true;
        listSalaryemployeApply(this.queryParams).then(response => {
          this.salaryemployeList = response.rows;
          this.total = response.total;
          this.loading = false;
        });*/
        this.loading = true;
        listEmployee(this.queryParams).then(response => {
          this.salaryemployeList = response.rows;
          console.log("this.salaryemployeList",this.salaryemployeList);
          this.total = response.total;
          this.loading = false;
        });
      },
      /** 转换部门数据结构 */
      normalizer(node) {
        if (node.children && !node.children.length) {
          delete node.children;
        }
        return {
          id: node.deptId,
          label: node.deptName,
          children: node.children
        };
      },
      // 性别字典翻译
      sexFormat(row, column) {
        return this.selectDictLabel(this.sexOptions, row.sex);
      },
      // 是否一孩字典翻译
      onlyChildFormat(row, column) {
        return this.selectDictLabel(this.onlyChildOptions, row.onlyChild);
      },
      // 民族字典翻译
      folkFormat(row, column) {
        return this.selectDictLabel(this.folkOptions, row.folk);
      },
      // 政治面貌字典翻译
      politicalStatusFormat(row, column) {
        return this.selectDictLabel(this.politicalStatusOptions, row.politicalStatus);
      },
      // 学历学位字典翻译
      topEducationFormat(row, column) {
        return this.selectDictLabel(this.educationOptions, row.topEducation);
      },
      // 学历学位字典翻译
      firstEducationFormat(row, column) {
        return this.selectDictLabel(this.educationOptions, row.firstEducation);
      },
      // 技术职称字典翻译
      professionalTitleFormat(row, column) {
        return this.selectDictLabel(this.professionalTitleOptions, row.professionalTitle);
      },
      // 职务字典翻译
      postTitleFormat(row, column) {
        return this.selectDictLabel(this.postTitleOptions, row.postTitle);
      },
      // 职级字典翻译
      postLevelFormat(row, column) {
        return this.selectDictLabel(this.postLevelOptions, row.postLevel);
      },
      // 人事档案是否在集团字典翻译
      personnelDossierFormat(row, column) {
        return this.selectDictLabel(this.personnelDossierOptions, row.personnelDossier);
      },
      // 员工类型字典翻译
      employeTypeFormat(row, column) {
        return this.selectDictLabel(this.employeTypeOptions, row.employeType);
      },
      // 状态字典翻译
      statusFormat(row, column) {
        return this.selectDictLabel(this.statusOptions, row.status);
      },
      // 状态字典翻译
      approveStatusFormat(row, column) {
        return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
      },
      // 状态字典翻译
      approveTypeFormat(row, column) {
        return this.selectDictLabel(this.approveTypeOptions, row.approveType);
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 取消离职申请按钮
      cancelLeaveapply() {
        this.openLeave = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          employeId: null,
          uniqueCode: null,
          idcardNo: null,
          deptId: null,
          name: null,
          sex: null,
          birthDay: null,
          onlyChild: 'N',
          folk: null,
          politicalStatus: null,
          nativePlace: null,
          firstEducation: null,
          topEducation: null,
          professionalTitle: null,
          postCode: null,
          postJob: null,
          postTitle: null,
          postLevel: null,
          workDate: null,
          hiredate: null,
          firedate: null,
          personnelDossier: "N",
          personnelDossierLocation: null,
          employeType: null,
          remark: null,
          createBy: null,
          createDate: null,
          updateBy: null,
          status: "1",
          deleteStatus: "0",
          updateDate: null,
          deleteTime: null,
          deleteBy: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.employeId);
        this.names = selection.map(item => item.name);
        this.deptIds = selection.map(item => item.deptId);
        this.single = selection.length !== 1;
        this.multiple = !selection.length;
      },
      /** 撤回申请按钮操作 */
      handleReback(row) {
        const employeIds = row.employeId || this.ids;
        const employeNames = row.name || this.names;

        this.$confirm('是否确认撤回员工【' + employeNames + '】的申请信息?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function () {
          return rebackApply(employeIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("申请撤回成功");
        })
      },
      /** 查看按钮操作 */
      handleView(row) {
        this.reset();
        const employeId = row.employeId || this.ids;
        const deptId = row.deptId || this.deptIds;

        getSalaryemploye(employeId).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "员工信息";
          this.operAction = "view";
        });
        listDept(deptId).then(response => {
          this.deptOptions = this.handleTree(response.data, "deptId");
        });
      },
      indexFn(index) {
        index = (index + 1) + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
        console.log(this)
        return index
      }
    }
  };
</script>
