index_apply.vue 28.6 KB
Newer Older
lvzhuangzhuang's avatar
lvzhuangzhuang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772
<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>