<template>
  <div>
    <el-breadcrumb separator=">">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>
        <a href="#">企业HR管理</a>
      </el-breadcrumb-item>
      <el-breadcrumb-item>
        <a href="/resume">简历管理</a>
      </el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>
    <!--
      要resetFields起作用，必须配置:model和prop
    -->
    <el-form
      ref="queryForm"
      :model="queryModel"
      inline
      class="demo-form-inline"
    >
      <el-form-item label="求职者姓名" prop="name">
        <el-input type="text" size="mini" v-model="queryModel.name"></el-input>
      </el-form-item>
      <el-form-item label="应聘岗位" prop="type">
        <el-input type="text" size="mini" v-model="queryModel.type"></el-input>
      </el-form-item>
      <el-form-item label="求职状态" prop="scale">
        <el-input type="text" size="mini" v-model="queryModel.scale"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          size="mini"
          icon="ios-search"
          @click="handleSearch(1)"
          :loading="loading"
          >查询</el-button
        >&nbsp;
        <el-button
          type="info"
          size="mini"
          style="margin-left: 8px"
          @click="handleReset('queryForm')"
          >重置</el-button
        >&nbsp;
      </el-form-item>
    </el-form>
    <el-divider></el-divider>
    <el-row class="button-group">
      <el-button
        type="primary"
        size="small"
        plain
        icon="el-icon-upload"
        @click="exportXls"
        >导出记录</el-button
      >
    </el-row>
    <template>
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
        <el-tab-pane label="全部" name="first">
            <el-table
            :data="tableData1"
            style="min-height: 400px"
            v-loading="loading1"
            stripe
            >
                <el-table-column prop="name" label="姓名" width="100"></el-table-column>
                <el-table-column prop="position" label="应聘职位" width="150"></el-table-column>
                <el-table-column prop="positionNumber" label="招聘人数" width="80"></el-table-column>
                <el-table-column prop="dreamMoney" label="期望薪资" width="80"></el-table-column>
                <el-table-column prop="workExp" label="工作经验" width="80"></el-table-column>
                <el-table-column prop="education" label="学历" width="100"></el-table-column>
                <el-table-column prop="birthday" label="出生年月" width="120"></el-table-column>
                <el-table-column prop="workExp" label="工作经历" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">查看</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="sortNo" label="简历附件" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="jobStatusN" label="工作状态" width="80"></el-table-column>
                <el-table-column prop="chatStatusN" label="沟通状态" ></el-table-column>
                <el-table-column label="操作" width="280">
                    <template slot-scope="{ row }">
                    <el-button size="mini" type="success" @click="handleRecordList(row)"
                        >沟通记录</el-button
                    >
                    
                    <el-dropdown size="mini" split-button class="dropdown1" type="primary" v-if="row.chatStatusList.length>0">
                      修改状态
                      <el-dropdown-menu slot="dropdown" class="dropdownMenu1" >
                        <el-dropdown-item v-for="item in row.chatStatusList" v-bind:key="item" @click.native="handleSelect(row,item.value)">
                            {{item.name}}
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
            :current-page.sync="pageIndex1"
            :total="totalElements1"
            :page-sizes="pageSizeList1"
            @current-change="changePage"
            @size-change="pageSizeChange1"
            layout="total, sizes, prev, pager, next, jumper"
            ></el-pagination>
        </el-tab-pane>
        <el-tab-pane label="已投递" name="second">
            <el-table
            :data="tableData2"
            style="min-height: 400px"
            v-loading="loading2"
            stripe
            >
                <el-table-column prop="name" label="姓名" width="100"></el-table-column>
                <el-table-column prop="position" label="应聘职位" width="150"></el-table-column>
                <el-table-column prop="positionNumber" label="招聘人数" width="80"></el-table-column>
                <el-table-column prop="dreamMoney" label="期望薪资" width="80"></el-table-column>
                <el-table-column prop="workExp" label="工作经验" width="80"></el-table-column>
                <el-table-column prop="education" label="学历" width="100"></el-table-column>
                <el-table-column prop="birthday" label="出生年月" width="120"></el-table-column>
                <el-table-column prop="workExp" label="工作经历" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">查看</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="sortNo" label="简历附件" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="jobStatusN" label="工作状态" width="80"></el-table-column>
                <el-table-column prop="chatStatusN" label="沟通状态"></el-table-column>
                <el-table-column label="操作" width="280">
                    <template slot-scope="{ row }">
                    <el-button size="mini" type="success" @click="handleRecordList(row)"
                        >沟通记录</el-button
                    >
                    
                    <el-dropdown size="mini" split-button class="dropdown1" type="primary" v-if="row.chatStatusList.length>0">
                      修改状态
                      <el-dropdown-menu slot="dropdown" class="dropdownMenu1" >
                        <el-dropdown-item v-for="item in row.chatStatusList" v-bind:key="item" @click.native="handleSelect(row,item.value)">
                            {{item.name}}
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
            :current-page.sync="pageIndex2"
            :total="totalElements2"
            :page-sizes="pageSizeList2"
            @current-change="changePage2"
            @size-change="pageSizeChange2"
            layout="total, sizes, prev, pager, next, jumper"
            ></el-pagination>
        </el-tab-pane>
        <el-tab-pane label="邀请沟通" name="third">
          <el-table
            :data="tableData3"
            style="min-height: 400px"
            v-loading="loading3"
            stripe
            >
                <el-table-column prop="name" label="姓名" width="100"></el-table-column>
                <el-table-column prop="position" label="应聘职位" width="150"></el-table-column>
                <el-table-column prop="positionNumber" label="招聘人数" width="80"></el-table-column>
                <el-table-column prop="dreamMoney" label="期望薪资" width="80"></el-table-column>
                <el-table-column prop="workExp" label="工作经验" width="80"></el-table-column>
                <el-table-column prop="education" label="学历" width="100"></el-table-column>
                <el-table-column prop="birthday" label="出生年月" width="120"></el-table-column>
                <el-table-column prop="workExp" label="工作经历" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">查看</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="sortNo" label="简历附件" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="jobStatusN" label="工作状态" width="80"></el-table-column>
                <el-table-column prop="chatStatusN" label="沟通状态"></el-table-column>
                <el-table-column label="操作" width="280">
                    <template slot-scope="{ row }">
                    <el-button size="mini" type="success" @click="handleRecordList(row)"
                        >沟通记录</el-button
                    >
                    
                    <el-dropdown size="mini" split-button class="dropdown1" type="primary" v-if="row.chatStatusList.length>0">
                      修改状态
                      <el-dropdown-menu slot="dropdown" class="dropdownMenu1" >
                        <el-dropdown-item v-for="item in row.chatStatusList" v-bind:key="item" @click.native="handleSelect(row,item.value)">
                            {{item.name}}
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
            :current-page.sync="pageIndex3"
            :total="totalElements3"
            :page-sizes="pageSizeList3"
            @current-change="changePage3"
            @size-change="pageSizeChange3"
            layout="total, sizes, prev, pager, next, jumper"
            ></el-pagination>
        </el-tab-pane>
        <el-tab-pane label="邀请面试" name="fourth">
          <el-table
            :data="tableData4"
            style="min-height: 400px"
            v-loading="loading4"
            stripe
            >
                <el-table-column prop="name" label="姓名" width="100"></el-table-column>
                <el-table-column prop="position" label="应聘职位" width="150"></el-table-column>
                <el-table-column prop="positionNumber" label="招聘人数" width="80"></el-table-column>
                <el-table-column prop="dreamMoney" label="期望薪资" width="80"></el-table-column>
                <el-table-column prop="workExp" label="工作经验" width="80"></el-table-column>
                <el-table-column prop="education" label="学历" width="100"></el-table-column>
                <el-table-column prop="birthday" label="出生年月" width="120"></el-table-column>
                <el-table-column prop="workExp" label="工作经历" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">查看</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="sortNo" label="简历附件" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="jobStatusN" label="工作状态" width="80"></el-table-column>
                <el-table-column prop="chatStatusN" label="沟通状态" ></el-table-column>
                <el-table-column label="操作" width="280">
                    <template slot-scope="{ row }">
                    <el-button size="mini" type="success" @click="handleRecordList(row)"
                        >沟通记录</el-button
                    >
                    
                    <el-dropdown size="mini" split-button class="dropdown1" type="primary" v-if="row.chatStatusList.length>0">
                      修改状态
                      <el-dropdown-menu slot="dropdown" class="dropdownMenu1" >
                        <el-dropdown-item v-for="item in row.chatStatusList" v-bind:key="item" @click.native="handleSelect(row,item.value)">
                            {{item.name}}
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>

                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
            :current-page.sync="pageIndex4"
            :total="totalElements4"
            :page-sizes="pageSizeList4"
            @current-change="changePage4"
            @size-change="pageSizeChange4"
            layout="total, sizes, prev, pager, next, jumper"
            ></el-pagination>
        </el-tab-pane>
        <el-tab-pane label="邀请入职" name="5">
          <el-table
            :data="tableData5"
            style="min-height: 400px"
            v-loading="loading5"
            stripe
            >
                <el-table-column prop="name" label="姓名" width="100"></el-table-column>
                <el-table-column prop="position" label="应聘职位" width="150"></el-table-column>
                <el-table-column prop="positionNumber" label="招聘人数" width="80"></el-table-column>
                <el-table-column prop="dreamMoney" label="期望薪资" width="80"></el-table-column>
                <el-table-column prop="workExp" label="工作经验" width="80"></el-table-column>
                <el-table-column prop="education" label="学历" width="100"></el-table-column>
                <el-table-column prop="birthday" label="出生年月" width="120"></el-table-column>
                <el-table-column prop="workExp" label="工作经历" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">查看</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="sortNo" label="简历附件" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="jobStatusN" label="工作状态" width="80"></el-table-column>
                <el-table-column prop="chatStatusN" label="沟通状态" ></el-table-column>
                <el-table-column label="操作" width="280">
                    <template slot-scope="{ row }">
                    <el-button size="mini" type="success" @click="handleRecordList(row)"
                        >沟通记录</el-button
                    >
                    
                    <el-dropdown size="mini" split-button class="dropdown1" type="primary" v-if="row.chatStatusList.length>0">
                      修改状态
                      <el-dropdown-menu slot="dropdown" class="dropdownMenu1" >
                        <el-dropdown-item v-for="item in row.chatStatusList" v-bind:key="item" @click.native="handleSelect(row,item.value)">
                            {{item.name}}
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
            :current-page.sync="pageIndex5"
            :total="totalElements5"
            :page-sizes="pageSizeList5"
            @current-change="changePage5"
            @size-change="pageSizeChange5"
            layout="total, sizes, prev, pager, next, jumper"
            ></el-pagination>
        </el-tab-pane>
        <el-tab-pane label="接收入职" name="6">
          <el-table
            :data="tableData6"
            style="min-height: 400px"
            v-loading="loading6"
            stripe
            >
                <el-table-column prop="name" label="姓名" width="100"></el-table-column>
                <el-table-column prop="position" label="应聘职位" width="150"></el-table-column>
                <el-table-column prop="positionNumber" label="招聘人数" width="80"></el-table-column>
                <el-table-column prop="dreamMoney" label="期望薪资" width="80"></el-table-column>
                <el-table-column prop="workExp" label="工作经验" width="80"></el-table-column>
                <el-table-column prop="education" label="学历" width="100"></el-table-column>
                <el-table-column prop="birthday" label="出生年月" width="120"></el-table-column>
                <el-table-column prop="workExp" label="工作经历" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">查看</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="sortNo" label="简历附件" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="jobStatusN" label="工作状态" width="80"></el-table-column>
                <el-table-column prop="chatStatusN" label="沟通状态" ></el-table-column>
                <el-table-column label="操作" width="280">
                    <template slot-scope="{ row }">
                    <el-button size="mini" type="success" @click="handleRecordList(row)"
                        >沟通记录</el-button
                    >
                    
                    <el-dropdown size="mini" split-button class="dropdown1" type="primary" v-if="row.chatStatusList.length>0">
                      修改状态
                      <el-dropdown-menu slot="dropdown" class="dropdownMenu1" >
                        <el-dropdown-item v-for="item in row.chatStatusList" v-bind:key="item" @click.native="handleSelect(row,item.value)">
                            {{item.name}}
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
            :current-page.sync="pageIndex6"
            :total="totalElements6"
            :page-sizes="pageSizeList6"
            @current-change="changePage6"
            @size-change="pageSizeChange6"
            layout="total, sizes, prev, pager, next, jumper"
            ></el-pagination>
        </el-tab-pane>
        <el-tab-pane label="拒绝/不合适" name="7">
          <el-table
            :data="tableData7"
            style="min-height: 400px"
            v-loading="loading7"
            stripe
            >
                <el-table-column prop="name" label="姓名" width="100"></el-table-column>
                <el-table-column prop="position" label="应聘职位" width="150"></el-table-column>
                <el-table-column prop="positionNumber" label="招聘人数" width="80"></el-table-column>
                <el-table-column prop="dreamMoney" label="期望薪资" width="80"></el-table-column>
                <el-table-column prop="workExp" label="工作经验" width="80"></el-table-column>
                <el-table-column prop="education" label="学历" width="100"></el-table-column>
                <el-table-column prop="birthday" label="出生年月" width="120"></el-table-column>
                <el-table-column prop="workExp" label="工作经历" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">查看</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="sortNo" label="简历附件" width="80">
                    <template>
                        <el-link href="#" target="_blank" type="primary">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="jobStatusN" label="工作状态" width="80"></el-table-column>
                <el-table-column prop="chatStatusN" label="沟通状态" ></el-table-column>
                <el-table-column label="操作" width="280">
                    <template slot-scope="{ row }">
                    <el-button size="mini" type="success" @click="handleRecordList(row)"
                        >沟通记录</el-button
                    >
                    
                    <el-dropdown size="mini" split-button class="dropdown1" type="primary" v-if="row.chatStatusList.length>0">
                      修改状态
                      <el-dropdown-menu slot="dropdown" class="dropdownMenu1" >
                        <el-dropdown-item v-for="item in row.chatStatusList" v-bind:key="item" @click.native="handleSelect(row,item.value)">
                            {{item.name}}
                        </el-dropdown-item>
                      </el-dropdown-menu>
                    </el-dropdown>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
            :current-page.sync="pageIndex7"
            :total="totalElements7"
            :page-sizes="pageSizeList7"
            @current-change="changePage7"
            @size-change="pageSizeChange7"
            layout="total, sizes, prev, pager, next, jumper"
            ></el-pagination>
        </el-tab-pane>
    </el-tabs>
    </template>

    <resumeDeliverRecord-list
      v-if="showModal1"
      :businessKey="businessKey"
      :title="modalTitle1"
      @close="onDetailModalCloseLog"
    ></resumeDeliverRecord-list>

    <resumeDeliver-detail
      v-if="showModal"
      :businessKey="businessKey"
      :title="modalTitle"
      @close="onDetailModalClose"
    ></resumeDeliver-detail>

    <resumeDeliver-detail2
      v-if="showModal2"
      :businessKey="businessKey"
      :title="modalTitle2"
      @close="onDetailModalClose2"
    ></resumeDeliver-detail2>

    <resumeDeliver-detail3
      v-if="showModal3"
      :businessKey="businessKey"
      :title="modalTitle3"
      @close="onDetailModalClose3"
    ></resumeDeliver-detail3>

    <resumeDeliver-detail4
      v-if="showModal4"
      :businessKey="businessKey"
      :title="modalTitle4"
      @close="onDetailModalClose4"
    ></resumeDeliver-detail4>
  </div>
</template>
<script>
import Constant from "@/constant";
import resumeDeliverDetail from "./resumeDeliver-detail";
import resumeDeliverDetail2 from "./resumeDeliver-detail2";
import resumeDeliverDetail3 from "./resumeDeliver-detail3";
import resumeDeliverDetail4 from "./resumeDeliver-detail4";
import resumeDeliverRecordList from "./resumeDeliverRecord-list";
import resumeDeliverApi from "@/api/job/resumeDeliver";
import NProgress from "nprogress"; // progress bar
import "nprogress/nprogress.css"; // progress bar style

export default {
  name: 'jobResumeList',
  data() {
    var self = this;

    return {
      queryModel: {
        id: "",
        name: "",
        type: "",
        scale: "",
        industry: "",
        address: "",
        introduction: "",
      },
      loading:false,
      activeName: 'first',
      loading1: false,
      tableData1: [],
      pageIndex1: 1,
      pageSize1: 10,
      totalPages1: 0,
      totalElements1: 0,
      pageSizeList1: [10, 20, 30],

      loading2: false,
      tableData2: [],
      pageIndex2: 1,
      pageSize2: 10,
      totalPages2: 0,
      totalElements2: 0,
      pageSizeList2: [10, 20, 30],

      loading3: false,
      tableData3: [],
      pageIndex3: 1,
      pageSize3: 10,
      totalPages3: 0,
      totalElements3: 0,
      pageSizeList3: [10, 20, 30],

      loading4: false,
      tableData4: [],
      pageIndex4: 1,
      pageSize4: 10,
      totalPages4: 0,
      totalElements4: 0,
      pageSizeList4: [10, 20, 30],

      loading5: false,
      tableData5: [],
      pageIndex5: 1,
      pageSize5: 10,
      totalPages5: 0,
      totalElements5: 0,
      pageSizeList5: [10, 20, 30],

      loading6: false,
      tableData6: [],
      pageIndex6: 1,
      pageSize6: 10,
      totalPages6: 0,
      totalElements6: 0,
      pageSizeList6: [10, 20, 30],

      loading7: false,
      tableData7: [],
      pageIndex7: 1,
      pageSize7: 10,
      totalPages7: 0,
      totalElements7: 0,
      pageSizeList7: [10, 20, 30],


      field: "",
      direction: "",
      showModal: false,
      modalTitle: "",

      showModal1: false,
      modalTitle1: "",

      showModal2: false,
      modalTitle2: "",

      showModal3: false,
      modalTitle3: "",

      showModal4: false,
      modalTitle4: "",
      businessKey: "",
    };
  },
  methods: {
    changePage(pageIndex1) {
      var self = this;

      self.loading1 = true;

      self.pageIndex1 = pageIndex1;
      var formData = new FormData();

      formData.append("pageIndex", self.pageIndex1);
      formData.append("pageSize", self.pageSize1);
      formData.append("name", self.queryModel.name);

      formData.append("chatStatus", "0");


      resumeDeliverApi
        .pageList(formData)
        .then(function (response) {
          self.loading1= false;

          var jsonData = response.data.data;

          self.tableData1 = jsonData.data;
          self.totalPages1 = jsonData.totalPages;
          self.totalElements1 = jsonData.recordsTotal;
        })
        .catch((error) => {
          self.loading1 = false;
          // self.$message.error(error + "");
        });
    },

    changePage2(pageIndex2) {
      var self = this;

      self.loading2 = true;

      self.pageIndex2 = pageIndex2;
      var formData = new FormData();

      formData.append("pageIndex", self.pageIndex2);
      formData.append("pageSize", self.pageSize2);
      formData.append("name", self.queryModel.name);

      formData.append("chatStatus", "1");


      resumeDeliverApi
        .pageList(formData)
        .then(function (response) {
          self.loading2= false;

          var jsonData = response.data.data;

          self.tableData2 = jsonData.data;
          self.totalPages2 = jsonData.totalPages;
          self.totalElements2 = jsonData.recordsTotal;
        })
        .catch((error) => {
          self.loading2 = false;
          // self.$message.error(error + "");
        });
    },

    changePage3(pageIndex3) {
      var self = this;

      self.loading3 = true;

      self.pageIndex3 = pageIndex3;
      var formData = new FormData();

      formData.append("pageIndex", self.pageIndex3);
      formData.append("pageSize", self.pageSize3);
      formData.append("name", self.queryModel.name);

      formData.append("chatStatus", "2");


      resumeDeliverApi
        .pageList(formData)
        .then(function (response) {
          self.loading3= false;

          var jsonData = response.data.data;

          self.tableData3 = jsonData.data;
          self.totalPages3 = jsonData.totalPages;
          self.totalElements3 = jsonData.recordsTotal;
        })
        .catch((error) => {
          self.loading3 = false;
          // self.$message.error(error + "");
        });
    },

    changePage4(pageIndex4) {
      var self = this;

      self.loading4 = true;

      self.pageIndex4 = pageIndex4;
      var formData = new FormData();

      formData.append("pageIndex", self.pageIndex4);
      formData.append("pageSize", self.pageSize4);
      formData.append("name", self.queryModel.name);

      formData.append("chatStatus", "3");


      resumeDeliverApi
        .pageList(formData)
        .then(function (response) {
          self.loading4= false;

          var jsonData = response.data.data;

          self.tableData4 = jsonData.data;
          self.totalPages4 = jsonData.totalPages;
          self.totalElements4 = jsonData.recordsTotal;
        })
        .catch((error) => {
          self.loading4 = false;
          // self.$message.error(error + "");
        });
    },

    changePage5(pageIndex5) {
      var self = this;

      self.loading5 = true;

      self.pageIndex5 = pageIndex5;
      var formData = new FormData();

      formData.append("pageIndex", self.pageIndex5);
      formData.append("pageSize", self.pageSize5);
      formData.append("name", self.queryModel.name);

      formData.append("chatStatus", "4");


      resumeDeliverApi
        .pageList(formData)
        .then(function (response) {
          self.loading5= false;

          var jsonData = response.data.data;

          self.tableData5 = jsonData.data;
          self.totalPages5 = jsonData.totalPages;
          self.totalElements5 = jsonData.recordsTotal;
        })
        .catch((error) => {
          self.loading5 = false;
          // self.$message.error(error + "");
        });
    },
    changePage6(pageIndex6) {
      var self = this;

      self.loading6 = true;

      self.pageIndex6 = pageIndex6;
      var formData = new FormData();

      formData.append("pageIndex", self.pageIndex6);
      formData.append("pageSize", self.pageSize6);
      formData.append("name", self.queryModel.name);

      formData.append("chatStatus", "5");


      resumeDeliverApi
        .pageList(formData)
        .then(function (response) {
          self.loading6= false;

          var jsonData = response.data.data;

          self.tableData6 = jsonData.data;
          self.totalPages6 = jsonData.totalPages;
          self.totalElements6 = jsonData.recordsTotal;
        })
        .catch((error) => {
          self.loading6 = false;
          // self.$message.error(error + "");
        });
    },

    changePage7(pageIndex7) {
      var self = this;

      self.loading7 = true;

      self.pageIndex7 = pageIndex7;
      var formData = new FormData();

      formData.append("pageIndex", self.pageIndex7);
      formData.append("pageSize", self.pageSize7);
      formData.append("name", self.queryModel.name);

      formData.append("chatStatus", "6");


      resumeDeliverApi
        .pageList(formData)
        .then(function (response) {
          self.loading7= false;

          var jsonData = response.data.data;

          self.tableData7 = jsonData.data;
          self.totalPages7 = jsonData.totalPages;
          self.totalElements7 = jsonData.recordsTotal;
        })
        .catch((error) => {
          self.loading7 = false;
          // self.$message.error(error + "");
        });
    },
    handleClick(tab, event) {
        console.log(tab, event);
    },
    pageSizeChange1(pageSize1) {
      this.pageSize1 = pageSize1;

      this.$nextTick(() => {
        this.changePage(this.pageIndex1);
      });
    },
    pageSizeChange2(pageSize2) {
      this.pageSize2 = pageSize2;

      this.$nextTick(() => {
        this.changePage2(this.pageSize2);
      });
    },
    pageSizeChange3(pageSize3) {
      this.pageSize3 = pageSize3;

      this.$nextTick(() => {
        this.changePage3(this.pageSize3);
      });
    },
    pageSizeChange4(pageSize4) {
      this.pageSize4 = pageSize4;

      this.$nextTick(() => {
        this.changePage4(this.pageSize4);
      });
    },
    pageSizeChange5(pageSize5) {
      this.pageSize5 = pageSize5;

      this.$nextTick(() => {
        this.changePage5(this.pageSize5);
      });
    },
    pageSizeChange6(pageSize6) {
      this.pageSize6 = pageSize6;

      this.$nextTick(() => {
        this.changePage6(this.pageSize6);
      });
    },
    pageSizeChange7(pageSize7) {
      this.pageSize7 = pageSize7;

      this.$nextTick(() => {
        this.changePage7(this.pageSize7);
      });
    },
    handleReset(name) {
      this.$refs[name].resetFields();
    },
    handleAdd() {
      this.modalTitle = "新增";
      this.businessKey = "";
      this.showModal = true;
    },
    handleEdit(record) {
      this.modalTitle = "编辑";
      this.businessKey = record.id;
      this.showModal = true;
    },
    handleDelete(record) {
      var self = this;

      self
        .$confirm("是否确认删除?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
        .then(() => {
          resumeDeliverApi.remove(record.id).then(function (response) {
            var jsonData = response.data;

            if (jsonData.result) {
              // var index = self.tableData.indexOf(record);
              // self.tableData.splice(index, 1);
              self.changePage(self.pageIndex);

              self.$message({
                type: "success",
                message: "删除成功!",
              });
            }
          });
        });
    },
    handleBatchDelete() {
      var self = this;

      var idList = this.multipleSelection.map((record) => {
        return record.id;
      });

      this.$confirm("是否确认删除选中项？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        resumeDeliverApi.batchRemove(idList).then(function (response) {
          var jsonData = response.data;

          if (jsonData.result) {
            self.changePage(self.pageIndex);

            self.$message({
              type: "success",
              message: "删除成功!",
            });
          }
        });
      });
    },
    onDetailModalClose(refreshed) {
      //保存成功后回调
      this.showModal = false;

      if (refreshed) {
        this.handleSearch(1);
      }
    },
    onDetailModalClose2(refreshed) {
      //保存成功后回调
      this.showModal2 = false;

      if (refreshed) {
        this.handleSearch(1);
      }
    },
    onDetailModalClose3(refreshed) {
      //保存成功后回调
      this.showModal3 = false;

      if (refreshed) {
        this.handleSearch(1);
      }
    },
    onDetailModalClose4(refreshed) {
      //保存成功后回调
      this.showModal4 = false;

      if (refreshed) {
        this.handleSearch(1);
      }
    },
    onDetailModalCloseLog(refreshed) {
      //保存成功后回调
      this.showModal1 = false;
    },
    handleSearch(pageIndex){
      this.changePage(pageIndex);
      this.changePage2(pageIndex);
      this.changePage3(pageIndex);
      this.changePage4(pageIndex);
      this.changePage5(pageIndex);
      this.changePage6(pageIndex);
      this.changePage7(pageIndex);
    },
    handleSelect(record,value){
        if(value=='2'){
          this.modalTitle = record.chatStatusN;
          this.businessKey = record.id;
          this.showModal = true;
        }
        else if(value=='3'){
          this.modalTitle2 = record.chatStatusN;
          this.businessKey = record.id;
          this.showModal2 = true;
        }
        else if(value=='4'){
          this.modalTitle3 = record.chatStatusN;
          this.businessKey = record.id;
          this.showModal3 = true;
        }
        else if(value=='5'){
          console.log("5")
        }
        else if(value=='6'){
          this.modalTitle4 = record.chatStatusN;
          this.businessKey = record.id;
          this.showModal4 = true;
        }
    },
    handleRecordList(record){
      this.modalTitle1 = "沟通记录";
      this.businessKey = record.id;
      this.showModal1 = true;
    },
    exportXls(){
      var self = this;

      self.loading1 = true;

      var formData = new FormData();

      formData.append("pageIndex", 1);
      formData.append("pageSize", 10000);
      formData.append("name", self.queryModel.name);


      resumeDeliverApi
        .exportXls(formData)
        .then(function (response) {
          self.loading1= false;

          var jsonData = response.data;

          if(jsonData.result) {
            if(document.location.href.startsWith("https://")){
                jsonData.data = jsonData.data.replace("http://","https://");
            }
            
            //导出
            self.$message({
              showClose: true,
              type: "success",
              message: `报表已生成，<a href="${jsonData.data}">请点击链接下载</a>`,
              dangerouslyUseHTMLString: true,
              duration: 30000
            });
            
          }
          else{
            self.$message.warning(jsonData.message);
          }

        })
        .catch((error) => {
          self.loading1 = false;
          // self.$message.error(error + "");
        });
    }
  },
  mounted: function () {
    this.changePage(1);
    this.changePage2(1);
    this.changePage3(1);
    this.changePage4(1);
    this.changePage5(1);
    this.changePage6(1);
    this.changePage7(1);
  },
  components: {
    "resumeDeliverRecordList":resumeDeliverRecordList,
    "resumeDeliver-detail": resumeDeliverDetail,
    "resumeDeliver-detail2": resumeDeliverDetail2,
    "resumeDeliver-detail3": resumeDeliverDetail3,
    "resumeDeliver-detail4": resumeDeliverDetail4,
  },
};
</script>
<style lang="scss" scoped>
.el-breadcrumb {
  margin: 10px;
  line-height: 20px;
}

.el-divider {
  margin: 5px 0;
}

.demo-form-inline {
  margin-left: 10px;
  text-align: left;
}

.button-group {
  margin-right: 10px;
  text-align: right;
  margin-top: 10px;
  margin-bottom: 10px;
}

.dropdown1{
  margin-left: 10px;
  margin-right: 10px;
}

.dropdownMenu1{
  width: 110px;
  text-align: center;
}
</style>