<template>
<!-- 人员列表 -->
  <div class="dashboard-container">
    <div class="gva-search-box">
      <el-form ref="searchForm" :inline="true" :model="searchInfo">
      <el-form-item label="工号">
          <el-input
            placeholder="请输入工号"
            v-model="searchInfo.number"
            clearable>
          </el-input>
        </el-form-item>
        <el-form-item label="姓名">
          <el-input
            placeholder="请输入姓名"
            v-model="searchInfo.name"
            clearable>
          </el-input>
        </el-form-item>
        <!-- <el-form-item label="行政组织">
           <el-cascader filterable clearable v-model="searchInfo.adminorg" :options="searchDepartmentList" :show-all-levels="false" :props="props1"></el-cascader>
        </el-form-item> -->
       
        <!-- <el-form-item label="考核维度状态">
          <el-select v-model="searchInfo.state" clearable placeholder="请选择状态">
            <el-option :value=1 label="正常">正常</el-option>
            <el-option :value=2 label="禁止">禁止</el-option>
          </el-select>
        </el-form-item> -->
        <el-form-item label="用工关系">
           <el-select v-model="searchInfo.emptype" clearable placeholder="请选择">
              <el-option
                v-for="item in emptypeList"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
        </el-form-item>
        <el-form-item>
          <el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
          <!-- <el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> -->
        </el-form-item>
      </el-form>
    </div>
    <div class="gva-table-box">
      <div class="gva-btn-list">
        <el-button size="mini" type="primary" icon="el-icon-plus" @click="showAdd()">新增</el-button>
      </div>
      <el-container>
        <!-- 左侧内容 -->
        <el-aside width="300px">
          <el-tree :data="GovthreeList2" :props="defaultProps1" @node-click="handleNodeClick"></el-tree>
        </el-aside>
        <!-- 右侧内容 -->
        <el-main style="padding:10px">
          <el-table :data="tableData">
        <el-table-column width="100" align="left" label="工号" prop="number"/>
        <el-table-column width="100" align="left" label="姓名" prop="name"/>
        <el-table-column align="left" label="公司" prop="companyname"/>
        <el-table-column align="left" label="部门" prop="maindeparmentname"/>
        <el-table-column width="200" align="left" label="职位" prop="positionname"/>
        <!-- <el-table-column align="left" label="头像" prop="">
            <template #default="scope">
              <el-avatar shape="square" size="large" :src="scope.row.icon"></el-avatar>
            </template>
        </el-table-column> -->
        <el-table-column align="left" fixed="right" label="操作">
          <template #default="scope">
            <el-button
                icon="el-icon-view"
                size="small"
                type="text"
                @click="showDetails(scope.row)"
            >查看详情</el-button>
            <el-button
              icon="el-icon-edit"
              size="small"
              type="text"
              @click="showEditBase(scope.row)"
            >编辑基础信息</el-button>
            <el-button
              icon="el-icon-edit"
              size="small"
              type="text"
              @click="showEditTable(scope.row)"
            >编辑表格信息</el-button>
            <!-- <el-button
              icon="el-icon-edit"
              size="small"
              type="text"
              @click="showEdit(scope.row)"
            >编辑</el-button>
            <el-button
              icon="el-icon-delete"
              size="small"
              type="text"
              @click="deleteOperate(scope.row)"
            >删除</el-button> -->
          </template>
        </el-table-column>
      </el-table>
      <div class="gva-pagination">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[10, 30, 50, 100]"
          :page-size="searchInfo.pagesize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total">
        </el-pagination>
        </div>
        </el-main>
      </el-container>
      
      </div>
      <!-- 新增弹框 -->
      <el-dialog :visible.sync="dialogFormVisible" :before-close="closeDialog" title="新增" width="80%">
        <el-form ref="addForm" :model="form" :rules="rules">
          <el-descriptions class="margin-top" title="" :column="4" border>
          <!-- 第一行 -->
          <el-descriptions-item>
            <template slot="label">工号</template>
            <el-input v-model="form.number" clearable></el-input>
            
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">姓名</template>
            <el-input v-model="form.name" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">用工关系</template>
            <el-select v-model="form.emptype" clearable placeholder="请选择">
              <el-option label="临时工" :value=1></el-option>
              <el-option label="编外人员" :value=2></el-option>
              <el-option label="实习&实习生" :value=3></el-option>
              <el-option label="试用员工" :value=4></el-option>
              <el-option label="待分配" :value=5></el-option>
              <el-option label="待岗" :value=6></el-option>
              <el-option label="临时调入" :value=7></el-option>
              <el-option label="正式员工" :value=8></el-option>
              <el-option label="长期病假" :value=9></el-option>
              <el-option label="停薪留职" :value=10></el-option>
              <el-option label="退休" :value=11></el-option>
              <el-option label="辞职" :value=12></el-option>
              <el-option label="辞退" :value=13></el-option>
              <el-option label="离职" :value=14></el-option>
            </el-select>
            
            <!-- <div v-if="staffInfo.emptype==1">实习生</div>
            <div v-if="staffInfo.emptype==2">待分配</div>
            <div v-if="staffInfo.emptype==3">试用员工</div>
            <div v-if="staffInfo.emptype==4">正式员工</div>
            <div v-if="staffInfo.emptype==5">停薪留职</div>
            <div v-if="staffInfo.emptype==6">退休</div>
            <div v-if="staffInfo.emptype==7">辞退</div>
            <div v-if="staffInfo.emptype==8">离职</div> -->
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">照片</template>
            <el-avatar shape="square" size="large" :src="staffInfo.icon"></el-avatar>
          </el-descriptions-item>
          <!-- 2 -->
          <!-- <el-descriptions-item>
            <template slot="label">集团</template>
            {{staffInfo.companyname}}
          </el-descriptions-item> -->
          <el-descriptions-item>
            <template slot="label">分厂（部室）</template>
            
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">岗位</template>
            <el-select filterable v-model="form.position" clearable placeholder="请选择">
              <el-option
                v-for="item in positionlistData"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">职位</template>
            {{staffInfo.positionname}}
          </el-descriptions-item>
          <!-- 3 -->
          <el-descriptions-item>
            <template slot="label">职务</template>
            <el-select filterable v-model="form.position" clearable placeholder="请选择">
              <el-option
                v-for="item in dutieslistData"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">部门</template>
            {{staffInfo.deparment}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">性别</template>
            <el-select filterable v-model="form.gender" clearable placeholder="请选择">
              <el-option
                v-for="item in sexData"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">民族</template>
            <el-input v-model="form.nation" clearable></el-input>
          </el-descriptions-item>
          <!-- 4 -->
          <el-descriptions-item>
            <template slot="label">手机号码</template>
            <el-input v-model="form.mobilephone" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">生日</template>
            <el-date-picker
              v-model="form.mobilephone"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">电子邮件</template>
            {{staffInfo.email}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">国际区号</template>
            <el-input v-model="form.globalroaming" clearable></el-input>
          </el-descriptions-item>
          <!-- 5 -->
          <el-descriptions-item>
            <template slot="label">护照号码</template>
            <el-input v-model="form.passportno" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证号</template>
            <el-input v-model="form.idcardno" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">籍贯</template>
            <el-input v-model="form.nativeplace" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">健康状况</template>
            <el-select filterable v-model="form.health" clearable placeholder="请选择">
              <el-option
                v-for="item in healthList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <!-- 6 -->
          <el-descriptions-item>
            <template slot="label">婚姻状况</template>
            <el-select filterable v-model="form.maritalstatus" clearable placeholder="请选择">
              <el-option
                v-for="item in marriageList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证有效期开始</template>
            {{staffInfo.idcardstarttimedata}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证有效期结束</template>
            {{staffInfo.idcardendtimedata}}
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">身份证地址</template>
            {{staffInfo.idcardaddress}}
          </el-descriptions-item>
          <!-- 7 -->
          <el-descriptions-item>
            <template slot="label">签发机关</template>
            {{staffInfo.idcardIssued}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">现居地址</template>
            <el-input v-model="form.currentresidence" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">内线电话</template>
            <el-input v-model="form.currentresidence" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">星座</template>
            <el-select filterable v-model="form.constellation" clearable placeholder="请选择">
              <el-option
                v-for="item in constellationList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <!-- 8 -->
          <el-descriptions-item>
            <template slot="label">政治面貌</template>
            <el-select clearable v-model="form.politicaloutlook" placeholder="请选择">
                  <el-option

                    v-for="item in politicsList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                  </el-option>
                </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">参加工作日期</template>
            <el-date-picker
              v-model="form.workingdate"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">入职日期</template>
            <el-date-picker
              v-model="form.entrydate"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">试用期</template>
            <el-input v-model.number="form.probationperiod" clearable></el-input>
          </el-descriptions-item>
          <!-- 9 -->
          <el-descriptions-item>
            <template slot="label">预计转正日期</template>
            <el-date-picker
              v-model="form.confirmationdate"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">是否为退役军人</template>
            <el-select clearable v-model.number="form.isveterans" placeholder="请选择">
              <el-option label="是" value=1></el-option>
              <el-option label="否" value=2></el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">退役证编号</template>
            <el-input v-model.number="form.veteransnumber" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">是否为双职工</template>
            <div v-if="staffInfo.isdoubleworker==1">是</div>
            <div v-if="staffInfo.isdoubleworker==2">否</div>
          </el-descriptions-item>
        </el-descriptions>
        <!-- 双职工 -->
          <el-table :data="doubleworkerList" border style="width: 100%">
          <el-table-column header-align="center" label="双职工">
          <el-table-column prop="date" label="工号">
            <template slot-scope="scope">
                <el-input v-model="scope.row.number" autocomplete="off" />
            </template>
          </el-table-column>
          <el-table-column prop="date" label="姓名">
            <template slot-scope="scope">
                <el-input v-model="scope.row.name" autocomplete="off" />
            </template>
          </el-table-column>
          <el-table-column prop="date" label="公司">
            <template slot-scope="scope">
                <el-input v-model="scope.row.company" autocomplete="off" />
            </template>
          </el-table-column>
          <el-table-column prop="date" label="部门">
            <template slot-scope="scope">
                <el-input v-model="scope.row.department" autocomplete="off" />
            </template>
          </el-table-column>
          <el-table-column prop="date" label="岗位">
            <template slot-scope="scope">
                <el-input v-model="scope.row.position" autocomplete="off" />
            </template>
          </el-table-column>
          <el-table-column prop="date" label="联系电话">
            <template slot-scope="scope">
                <el-input v-model="scope.row.mobilephone" autocomplete="off" />
            </template>
          </el-table-column>
          </el-table-column>
        </el-table>
        <!-- 紧急联系人 -->
        <el-table :data="emergencycontactList" border style="width: 100%">
          <el-table-column header-align="center" label="紧急联系人">
            <el-table-column prop="date" label="姓名">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.name" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="与本人关系">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.relationship" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="联系电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.mobilephone" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="deleteRulesList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="jiaemergencycontactList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
        <!-- 家庭成员 -->
        <el-table :data="memberOfFamilyList" border style="width: 100%">
          <el-table-column header-align="center" label="家庭成员">
            <el-table-column prop="date" label="亲属关系">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.relationship" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="姓名">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.name" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="公司">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.company" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="部门">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.department" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="岗位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.position" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="联系电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.mobilephone" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="政治面貌">
              <template slot-scope="scope">
                <el-select clearable v-model.number="scope.row.politicaloutlook" placeholder="请选择">
                  <el-option

                    v-for="item in politicsList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                  </el-option>
                </el-select>
                  <!-- <el-input v-model="scope.row.mobilephone" autocomplete="off" /> -->
              </template>
            </el-table-column>
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="deleteFamilyList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="jiaFamilyList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
          <!-- <el-form-item label="考核维度名称" prop="title">
            <el-input v-model="form.title" autocomplete="off" />
          </el-form-item>
          <el-form-item label="排序" prop="sort">
            <el-input v-model.number="form.sort" autocomplete="off" />
          </el-form-item> -->
          <!-- 教育经历 -->
        <el-table :data="educateList" border style="width: 100%">
          <el-table-column header-align="center" label="教育经历">
            <el-table-column prop="date" label="毕业院校">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.graduationschool" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="专业">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.subject" autocomplete="off" />
              </template>
            </el-table-column>
            <!-- <el-table-column prop="date" label="学历">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.education" autocomplete="off" />
              </template>
            </el-table-column> -->
            <el-table-column prop="date" label="入学时间">
              <template slot-scope="scope">
                  <!-- <el-input v-model="scope.row.admissiontime" autocomplete="off" /> -->
                  <el-date-picker
                  style="width:120px"
                    v-model="scope.row.admissiontime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                  
              </template>
            </el-table-column>
            <el-table-column prop="date" label="毕业时间">
              <template slot-scope="scope">
                <el-date-picker
                  style="width:120px"
                    v-model="scope.row.graduationtime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                  <!-- <el-input v-model="scope.row.graduationtime" autocomplete="off" /> -->
              </template>
            </el-table-column>
            <!-- <el-table-column prop="date" label="学位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.mobilephone" autocomplete="off" />
              </template>
            </el-table-column> -->
            <el-table-column prop="date" label="学历类型">
              <template slot-scope="scope">
                <el-select clearable v-model.number="scope.row.education" placeholder="请选择">
                  <el-option
                    v-for="item in educationList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                  </el-option>
                </el-select>
                  <!-- <el-input v-model="scope.row.mobilephone" autocomplete="off" /> -->
              </template>
            </el-table-column>
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                        v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="deleteEducateList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="jiaEducateList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
        <!-- 工作履历 -->
        <el-table :data="workList" border style="width: 100%">
          <el-table-column header-align="center" label="工作履历">
            <el-table-column prop="date" label="公司">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.company" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="部门">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.department" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="职位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.position" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="入职时间">
              <template slot-scope="scope">
                  <el-date-picker
                    style="width:120px"
                    v-model="scope.row.entrytime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="离职日期">
              <template slot-scope="scope">
                  <el-date-picker
                  style="width:120px"
                    v-model="scope.row.leavedate"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witness" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witnesstel" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="备注">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.remarks" autocomplete="off" />
              </template>
            </el-table-column>
            
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="deleteWorkList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="jiaWorkList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
        <!-- 集团工作经历 -->
        <el-table :data="workList" border style="width: 100%">
          <el-table-column header-align="center" label="集团工作经历">
            <el-table-column prop="date" label="公司">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.company" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="部门">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.department" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="职位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.position" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="入职时间">
              <template slot-scope="scope">
                  <el-date-picker
                    style="width:120px"
                    v-model="scope.row.entrytime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="离职日期">
              <template slot-scope="scope">
                  <el-date-picker
                  style="width:120px"
                    v-model="scope.row.leavedate"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witness" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witnesstel" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="备注">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.remarks" autocomplete="off" />
              </template>
            </el-table-column>
            
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="deleteWorkList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="jiaWorkList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
        </el-form>
        <template #footer>
          <div class="dialog-footer">
            <el-button size="small" @click="closeDialog">取 消</el-button>
            <el-button size="small" type="primary" @click="enterDialog">确 定</el-button>
          </div>
        </template>
      </el-dialog>
      <!-- 编辑弹框 -->
      <el-dialog :visible.sync="editDialogFormVisible" :before-close="editCloseDialog" title="修改" width="20%">
        <el-form ref="editForm" :model="editAdd" :rules="editRules" label-width="150px">
          <el-form-item label="考核维度名称" prop="title">
            <el-input v-model="editAdd.title" autocomplete="off" />
          </el-form-item>
          <el-form-item label="排序" prop="sort">
            <el-input v-model.number="editAdd.sort" autocomplete="off" />
          </el-form-item>
        </el-form>
        <template #footer>
          <div class="dialog-footer"> 
            <el-button size="small" @click="editCloseDialog">取 消</el-button>
            <el-button size="small" type="primary" @click="editEnterDialog">确 定</el-button>
          </div>
        </template>
      </el-dialog>
      <!-- 详情弹框 -->
      <el-dialog :visible.sync="detailsVisible" title="人员档案" width="75%">
        <el-descriptions class="margin-top" title="" :column="4" border>\
          <!-- 第一行 -->
          <el-descriptions-item>
            <template slot="label">工号</template>
            {{staffInfo.number}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">姓名</template>
            {{staffInfo.name}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">用工关系</template>
            <div v-show="staffInfo.emptype==1">临时工</div>
            <div v-show="staffInfo.emptype==2">编外人员</div>
            <div v-show="staffInfo.emptype==3">实习&实习生</div>
            <div v-show="staffInfo.emptype==4">试用员工</div>
            <div v-show="staffInfo.emptype==5">待分配</div>
            <div v-show="staffInfo.emptype==6">待岗</div>
            <div v-show="staffInfo.emptype==7">临时调入</div>
            <div v-show="staffInfo.emptype==8">正式员工</div>
            <div v-show="staffInfo.emptype==9">长期病假</div>
            <div v-show="staffInfo.emptype==10">停薪留职</div>
            <div v-show="staffInfo.emptype==11">退休</div>
            <div v-show="staffInfo.emptype==12">辞职</div>
            <div v-show="staffInfo.emptype==13">辞退</div>
            <div v-show="staffInfo.emptype==14">离职</div>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">照片</template>
            <el-avatar shape="square" size="large" :src="staffInfo.icon"></el-avatar>
          </el-descriptions-item>
          <!-- 2 -->
          <el-descriptions-item>
            <template slot="label">集团</template>
            {{staffInfo.companyname}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">主分厂（部室）</template>
            {{staffInfo.maindeparmentname}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">岗位</template>
            {{staffInfo.number}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">职位</template>
            {{staffInfo.positionname}}
          </el-descriptions-item>
          <!-- 3 -->
          <el-descriptions-item>
            <template slot="label">职务</template>
            {{staffInfo.jobidname}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">部门</template>
            {{staffInfo.deparment}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">性别</template>
            <div v-if="staffInfo.gender==1">男性</div>
            <div v-if="staffInfo.gender==2">女性</div>
            <div v-if="staffInfo.gender==3">中性</div>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">民族</template>
            {{staffInfo.myfolk}}
          </el-descriptions-item>
          <!-- 4 -->
          <el-descriptions-item>
            <template slot="label">手机号码</template>
            {{staffInfo.mobilephone}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">生日</template>
            {{staffInfo.birthdaytime}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">电子邮件</template>
            {{staffInfo.email}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">国际区号</template>
            {{staffInfo.globalroaming}}
          </el-descriptions-item>
          <!-- 5 -->
          <el-descriptions-item>
            <template slot="label">护照号码</template>
            {{staffInfo.passportno}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证号</template>
            {{staffInfo.idcardno}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">籍贯</template>
            {{staffInfo.nativeplace}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">健康状况</template>
            <div v-if="staffInfo.health==1">良好</div>
            <div v-if="staffInfo.health==2">一般</div>
            <div v-if="staffInfo.health==3">较弱</div>
            <div v-if="staffInfo.health==4">有生理缺陷</div>
            <div v-if="staffInfo.health==5">残废</div>
          </el-descriptions-item>
          <!-- 6 -->
          <el-descriptions-item>
            <template slot="label">婚姻状况</template>
            <div v-if="staffInfo.maritalstatus==1">未婚</div>
            <div v-if="staffInfo.maritalstatus==2">已婚</div>
            <div v-if="staffInfo.maritalstatus==3">丧偶</div>
            <div v-if="staffInfo.maritalstatus==4">离异</div>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证有效期开始</template>
            {{staffInfo.idcardstarttimedata}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证有效期结束</template>
            {{staffInfo.idcardendtimedata}}
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">身份证地址</template>
            {{staffInfo.idcardaddress}}
          </el-descriptions-item>
          <!-- 7 -->
          <el-descriptions-item>
            <template slot="label">签发机关</template>
            {{staffInfo.idcardIssued}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">现居地址</template>
            {{staffInfo.currentresidence}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">内线电话</template>
            {{staffInfo.internaltelephone}}
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">星座</template>
            <div v-if="staffInfo.maritalstatus==1">白羊座</div>
            <div v-if="staffInfo.maritalstatus==2">金牛座</div>
            <div v-if="staffInfo.maritalstatus==3">双子座</div>
            <div v-if="staffInfo.maritalstatus==4">巨蟹座</div>
            <div v-if="staffInfo.maritalstatus==5">狮子座</div>
            <div v-if="staffInfo.maritalstatus==6">处女座</div>
            <div v-if="staffInfo.maritalstatus==7">天枰座</div>
            <div v-if="staffInfo.maritalstatus==8">天蝎座</div>
            <div v-if="staffInfo.maritalstatus==9">射手座</div>
            <div v-if="staffInfo.maritalstatus==10">摩羯座</div>
            <div v-if="staffInfo.maritalstatus==11">水瓶座</div>
            <div v-if="staffInfo.maritalstatus==12">双鱼座</div>
          </el-descriptions-item>
          <!-- 8 -->
          <el-descriptions-item>
            <template slot="label">政治面貌</template>
            <div v-if="staffInfo.politicaloutlook==1">群众</div>
            <div v-if="staffInfo.politicaloutlook==2">无党派</div>
            <div v-if="staffInfo.politicaloutlook==3">台盟会员</div>
            <div v-if="staffInfo.politicaloutlook==4">九三社员</div>
            <div v-if="staffInfo.politicaloutlook==5">致公党员</div>
            <div v-if="staffInfo.politicaloutlook==6">农工党员</div>
            <div v-if="staffInfo.politicaloutlook==7">民进会员</div>
            <div v-if="staffInfo.politicaloutlook==8">民建会员</div>
            <div v-if="staffInfo.politicaloutlook==9">民盟盟员</div>
            <div v-if="staffInfo.politicaloutlook==10">民革会员</div>
            <div v-if="staffInfo.politicaloutlook==11">共青团员</div>
            <div v-if="staffInfo.politicaloutlook==12">预备党员</div>
            <div v-if="staffInfo.politicaloutlook==13">中共党员</div>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">参加工作日期</template>
            {{staffInfo.jobstartdatestr}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">入职日期</template>
            {{staffInfo.entrydatestr}}
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">试用期</template>
            {{staffInfo.probationperiod}}月
          </el-descriptions-item>
          <!-- 9 -->
          <el-descriptions-item>
            <template slot="label">预计转正日期</template>
            {{staffInfo.planformaldatetime}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">是否为退役军人</template>
            <div v-if="staffInfo.isveterans==1">是</div>
            <div v-if="staffInfo.isveterans==2">否</div>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">退役证编号</template>
            {{staffInfo.veteransnumber}}
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">是否为双职工</template>
            <div v-if="staffInfo.isdoubleworker==1">是</div>
            <div v-if="staffInfo.isdoubleworker==2">否</div>
          </el-descriptions-item>
        </el-descriptions>
        <el-tabs stretch background-color="#545c64">
          <el-tab-pane label="双职工">
            <!-- 双职工 -->
            <el-table :data="staffInfo.doubleworkerlist" border style="width: 100%">
              <el-table-column header-align="center" label="双职工">
              <el-table-column prop="number" label="工号">
              </el-table-column>
              <el-table-column prop="name" label="姓名">
              </el-table-column>
              <el-table-column prop="company" label="公司">
              </el-table-column>
              <el-table-column prop="department" label="部门">
              </el-table-column>
              <el-table-column prop="position" label="岗位">
              </el-table-column>
              <el-table-column prop="mobilephone" label="联系电话">
              </el-table-column>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="紧急联系人" style="padding:20px">
              <!-- 紧急联系人 -->
              <el-table :data="staffInfo.emergencycontact" border style="width: 100%">
                <el-table-column header-align="center" label="紧急联系人">
                  <el-table-column prop="name" label="姓名">
                  </el-table-column>
                  <el-table-column prop="relationship" label="与本人关系">
                  </el-table-column>
                  <el-table-column prop="mobilephone" label="联系电话">
                  </el-table-column>
                </el-table-column>
              </el-table>
          </el-tab-pane>
          <el-tab-pane label="家庭成员" style="padding:20px">
              <!-- 家庭成员 -->
              <el-table :data="staffInfo.memberoffamily" border style="width: 100%">
                <el-table-column header-align="center" label="家庭成员">
                  <el-table-column prop="relationship" label="亲属关系">
                  </el-table-column>
                  <el-table-column prop="name" label="姓名">
                  </el-table-column>
                  <el-table-column prop="company" label="公司">
                  </el-table-column>
                  <el-table-column prop="department" label="部门">
                  </el-table-column>
                  <el-table-column prop="position" label="岗位">
                  </el-table-column>
                  <el-table-column prop="mobilephone" label="联系电话">
                  </el-table-column>
                  <el-table-column prop="politicaloutlook" label="政治面貌">
                    <template #default="scope">
                      <div v-if="scope.row.politicaloutlook==1">群众</div>
                      <div v-if="scope.row.politicaloutlook==2">无党派</div>
                      <div v-if="scope.row.politicaloutlook==3">台盟会员</div>
                      <div v-if="scope.row.politicaloutlook==4">九三社员</div>
                      <div v-if="scope.row.politicaloutlook==5">致公党员</div>
                      <div v-if="scope.row.politicaloutlook==6">农工党员</div>
                      <div v-if="scope.row.politicaloutlook==7">民进会员</div>
                      <div v-if="scope.row.politicaloutlook==8">民建会员</div>
                      <div v-if="scope.row.politicaloutlook==9">民盟盟员</div>
                      <div v-if="scope.row.politicaloutlook==10">民革会员</div>
                      <div v-if="scope.row.politicaloutlook==11">共青团员</div>
                      <div v-if="scope.row.politicaloutlook==12">预备党员</div>
                      <div v-if="scope.row.politicaloutlook==13">中共党员</div>
                    </template>
                  </el-table-column>
                </el-table-column>
              </el-table>
          </el-tab-pane>
          <el-tab-pane label="教育经历" style="padding:20px">
              <!-- 教育经历 -->
              <el-table :data="staffInfo.educationalexperience" border style="width: 100%">
                <el-table-column header-align="center" label="教育经历">
                  <el-table-column prop="graduationschool" label="毕业院校">
                  </el-table-column>
                  <el-table-column prop="subject" label="专业">
                  </el-table-column>
                  <el-table-column prop="company" label="学历">
                    <template #default="scope">
                      <div v-if="scope.row.education==1">初中以下</div>
                      <div v-if="scope.row.education==2">中专</div>
                      <div v-if="scope.row.education==3">高中</div>
                      <div v-if="scope.row.education==4">中技</div>
                      <div v-if="scope.row.education==5">高技</div>
                      <div v-if="scope.row.education==6">函授专科</div>
                      <div v-if="scope.row.education==7">大学专科</div>
                      <div v-if="scope.row.education==8">函授本科</div>
                      <div v-if="scope.row.education==9">大学本科</div>
                      <div v-if="scope.row.education==10">硕士研究生</div>
                      <div v-if="scope.row.education==11">博士研究生</div>
                      <div v-if="scope.row.education==12">专家、教授</div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="admissiontime" label="入学时间">
                  </el-table-column>
                  <el-table-column prop="graduationtime" label="毕业时间">
                  </el-table-column>
                  <el-table-column prop="academicdegree" label="学位">
                    <!-- <template #default="scope">
                      <div v-if="scope.row.academicdegree==0">无</div>
                      <div v-if="scope.row.academicdegree==1">学士</div>
                      <div v-if="scope.row.academicdegree==2">硕士</div>
                      <div v-if="scope.row.academicdegree==3">博士</div>
                    
                    </template> -->
                  </el-table-column>
                  <el-table-column prop="level" label="学历类型">
                    <!-- <template #default="scope">
                      <div v-if="scope.row.level==1">普通</div>
                      <div v-if="scope.row.level==2">第一学历</div>
                      <div v-if="scope.row.level==3">最高学历</div>
                    </template> -->
                  </el-table-column>
                </el-table-column>
              </el-table>
          </el-tab-pane>
          <el-tab-pane label="工作履历" style="padding:20px">
            <!-- 工作履历 -->
            <el-table :data="staffInfo.workhistorylist" border style="width: 100%">
              <el-table-column header-align="center" label="工作履历">
                <el-table-column prop="company" label="公司">
                </el-table-column>
                <el-table-column prop="department" label="部门">
                </el-table-column>
                <el-table-column prop="entrytime" label="入职时间">
                </el-table-column>
                <el-table-column prop="leavedate" label="离职日期">
                </el-table-column>
                <el-table-column prop="witness" label="证明人">
                </el-table-column>
                <el-table-column prop="witnesstel" label="证明人电话">
                </el-table-column>
                <el-table-column prop="remarks" label="备注">
                </el-table-column>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="集团内部工作履历" style="padding:20px">
            <!-- 集团内部工作履历 -->
            <el-table :data="staffInfo.groupworkhistorylist" border style="width: 100%">
              <el-table-column header-align="center" label="集团内部工作履历">
                <el-table-column prop="group" label="集团">
                </el-table-column>
                <el-table-column prop="company" label="公司">
                </el-table-column>
                <el-table-column prop="department" label="部门">
                </el-table-column>
                <el-table-column prop="workshopsection" label="岗位">
                </el-table-column>
                <el-table-column prop="position" label="职位">
                </el-table-column>
                <el-table-column prop="position" label="职位">
                </el-table-column>
                <el-table-column prop="starttime" label="开始日期">
                </el-table-column>
                <el-table-column prop="endtime" label="结束日期">
                </el-table-column>
                <el-table-column prop="changetype" label="变动类型">
                  <template #default="scope">
                    <div v-if="scope.row.changetype==1">预入职</div>
                    <div v-if="scope.row.changetype==2">雇佣入职</div>
                    <div v-if="scope.row.changetype==3">转正</div>
                    <div v-if="scope.row.changetype==4">晋升</div>
                    <div v-if="scope.row.changetype==5">降级</div>
                    <div v-if="scope.row.changetype==6">职等调整</div>
                    <div v-if="scope.row.changetype==7">调动调入</div>
                    <div v-if="scope.row.changetype==8">跨公司调动调入</div>
                    <div v-if="scope.row.changetype==9">借调</div>
                    <div v-if="scope.row.changetype==10">平调</div>
                    <div v-if="scope.row.changetype==11">兼职</div>
                    <div v-if="scope.row.changetype==12">预离职</div>
                    <div v-if="scope.row.changetype==13">离职</div>
                    <div v-if="scope.row.changetype==14">退休</div>
                    <div v-if="scope.row.changetype==15">返聘</div>
                    <div v-if="scope.row.changetype==16">员工初始化</div>
                  </template>
                </el-table-column>
                
              </el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-dialog>
      <!-- 编辑基础信息 -->
      <el-dialog :visible.sync="editBaseDialogFormVisible" title="人员档案" width="75%">
        <el-descriptions class="margin-top" title="" :column="4" border>
          <!-- 第一行 -->
          <el-descriptions-item>
            <template slot="label">工号</template>
            <el-input v-model="baseInfo.number" clearable></el-input>
            
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">姓名</template>
            <el-input v-model="baseInfo.name" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">用工关系</template>
            <el-select v-model="baseInfo.emptype" clearable placeholder="请选择">
              <el-option label="临时工" :value=1></el-option>
              <el-option label="编外人员" :value=2></el-option>
              <el-option label="实习&实习生" :value=3></el-option>
              <el-option label="试用员工" :value=4></el-option>
              <el-option label="待分配" :value=5></el-option>
              <el-option label="待岗" :value=6></el-option>
              <el-option label="临时调入" :value=7></el-option>
              <el-option label="正式员工" :value=8></el-option>
              <el-option label="长期病假" :value=9></el-option>
              <el-option label="停薪留职" :value=10></el-option>
              <el-option label="退休" :value=11></el-option>
              <el-option label="辞职" :value=12></el-option>
              <el-option label="辞退" :value=13></el-option>
              <el-option label="离职" :value=14></el-option>
            </el-select>
            
            <!-- <div v-if="staffInfo.emptype==1">实习生</div>
            <div v-if="staffInfo.emptype==2">待分配</div>
            <div v-if="staffInfo.emptype==3">试用员工</div>
            <div v-if="staffInfo.emptype==4">正式员工</div>
            <div v-if="staffInfo.emptype==5">停薪留职</div>
            <div v-if="staffInfo.emptype==6">退休</div>
            <div v-if="staffInfo.emptype==7">辞退</div>
            <div v-if="staffInfo.emptype==8">离职</div> -->
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">照片</template>
            <el-avatar shape="square" size="large" :src="baseInfo.icon"></el-avatar>
          </el-descriptions-item>
          <!-- 2 -->
          <!-- <el-descriptions-item>
            <template slot="label">集团</template>
            {{staffInfo.companyname}}
          </el-descriptions-item> -->
          <el-descriptions-item>
            <template slot="label">分厂（部室）</template>
            
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">岗位</template>
            <el-select filterable v-model="baseInfo.position" clearable placeholder="请选择">
              <el-option
                v-for="item in positionlistData"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">职位</template>
            {{baseInfo.positionname}}
          </el-descriptions-item>
          <!-- 3 -->
          <el-descriptions-item>
            <template slot="label">职务</template>
            <el-select filterable v-model="baseInfo.position" clearable placeholder="请选择">
              <el-option
                v-for="item in dutieslistData"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">部门</template>
            {{baseInfo.deparment}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">性别</template>
            <el-select filterable v-model="baseInfo.gender" clearable placeholder="请选择">
              <el-option
                v-for="item in sexData"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">民族</template>
            <el-input v-model="baseInfo.nation" clearable></el-input>
          </el-descriptions-item>
          <!-- 4 -->
          <el-descriptions-item>
            <template slot="label">手机号码</template>
            <el-input v-model="baseInfo.mobilephone" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">生日</template>
            <el-date-picker
              v-model="baseInfo.mobilephone"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">电子邮件</template>
            {{baseInfo.email}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">国际区号</template>
            <el-input v-model="baseInfo.globalroaming" clearable></el-input>
          </el-descriptions-item>
          <!-- 5 -->
          <el-descriptions-item>
            <template slot="label">护照号码</template>
            <el-input v-model="baseInfo.passportno" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证号</template>
            <el-input v-model="baseInfo.idcardno" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">籍贯</template>
            <el-input v-model="baseInfo.nativeplace" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">健康状况</template>
            <el-select filterable v-model="baseInfo.health" clearable placeholder="请选择">
              <el-option
                v-for="item in healthList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <!-- 6 -->
          <el-descriptions-item>
            <template slot="label">婚姻状况</template>
            <el-select filterable v-model="baseInfo.maritalstatus" clearable placeholder="请选择">
              <el-option
                v-for="item in marriageList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证有效期开始</template>
            {{baseInfo.idcardstarttimedata}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">身份证有效期结束</template>
            {{baseInfo.idcardendtimedata}}
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">身份证地址</template>
            {{baseInfo.idcardaddress}}
          </el-descriptions-item>
          <!-- 7 -->
          <el-descriptions-item>
            <template slot="label">签发机关</template>
            {{baseInfo.idcardIssued}}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">现居地址</template>
            <el-input v-model="baseInfo.currentresidence" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">内线电话</template>
            <el-input v-model="baseInfo.currentresidence" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">星座</template>
            <el-select filterable v-model="baseInfo.constellation" clearable placeholder="请选择">
              <el-option
                v-for="item in constellationList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
          <!-- 8 -->
          <el-descriptions-item>
            <template slot="label">政治面貌</template>
            <el-select clearable v-model="baseInfo.politicaloutlook" placeholder="请选择">
                  <el-option
                    v-for="item in politicsList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                  </el-option>
                </el-select>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">参加工作日期</template>
            <el-date-picker
              v-model="baseInfo.workingdate"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">入职日期</template>
            <el-date-picker
              v-model="baseInfo.entrydate"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">试用期</template>
            <el-input v-model.number="baseInfo.probationperiod" clearable></el-input>
          </el-descriptions-item>
          <!-- 9 -->
          <el-descriptions-item>
            <template slot="label">预计转正日期</template>
            <el-date-picker
              v-model="baseInfo.confirmationdate"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">是否为退役军人</template>
            <el-select clearable v-model="baseInfo.isveterans" placeholder="请选择">
              <el-option
                v-for="item in yesList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
            <!-- <el-select clearable v-model="baseInfo.isveterans" placeholder="请选择">
              <el-option label="是" value=1></el-option>
              <el-option label="否" value=2></el-option>
            </el-select> -->
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">退役证编号</template>
            <el-input v-model.number="baseInfo.veteransnumber" clearable></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
             <template slot="label">是否为双职工</template>
            <el-select clearable v-model="baseInfo.isdoubleworker" placeholder="请选择">
              <el-option
                v-for="item in yesList"
                :key="item.id"
                :label="item.tittle"
                :value="item.id">
              </el-option>
            </el-select>
          </el-descriptions-item>
        </el-descriptions>
      </el-dialog>
      <!-- 编辑表格信息 -->
      <el-dialog :visible.sync="editTableDialogFormVisible" title="编辑" width="80%">
        <!-- 紧急联系人 -->
        <el-table :data="tableInfo.emergencycontact" border style="width: 100%">
          <el-table-column header-align="center" label="紧急联系人">
            <el-table-column prop="date" label="姓名">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.name" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="与本人关系">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.relationship" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="联系电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.mobilephone" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="deleteRulesList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="eaitJiaemergencycontactList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
        <!-- 家庭成员 -->
        <el-table :data="tableInfo.memberoffamily" border style="width: 100%">
          <el-table-column header-align="center" label="家庭成员">
            <el-table-column prop="date" label="亲属关系">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.relationship" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="姓名">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.name" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="公司">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.company" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="部门">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.department" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="岗位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.position" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="联系电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.mobilephone" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="政治面貌">
              <template slot-scope="scope">
                <el-select clearable v-model.number="scope.row.politicaloutlook" placeholder="请选择">
                  <el-option

                    v-for="item in politicsList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                  </el-option>
                </el-select>
                  <!-- <el-input v-model="scope.row.mobilephone" autocomplete="off" /> -->
              </template>
            </el-table-column>
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="editDeleteFamilyList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="editJiaFamilyList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
          <!-- <el-form-item label="考核维度名称" prop="title">
            <el-input v-model="form.title" autocomplete="off" />
          </el-form-item>
          <el-form-item label="排序" prop="sort">
            <el-input v-model.number="form.sort" autocomplete="off" />
          </el-form-item> -->
          <!-- 教育经历 -->
        <el-table :data="tableInfo.educationalexperience" border style="width: 100%">
          <el-table-column header-align="center" label="教育经历">
            <el-table-column prop="date" label="毕业院校">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.graduationschool" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="专业">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.subject" autocomplete="off" />
              </template>
            </el-table-column>
            <!-- <el-table-column prop="date" label="学历">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.education" autocomplete="off" />
              </template>
            </el-table-column> -->
            <el-table-column prop="date" label="入学时间">
              <template slot-scope="scope">
                  <!-- <el-input v-model="scope.row.admissiontime" autocomplete="off" /> -->
                  <el-date-picker
                  style="width:120px"
                    v-model="scope.row.admissiontime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                  
              </template>
            </el-table-column>
            <el-table-column prop="date" label="毕业时间">
              <template slot-scope="scope">
                <el-date-picker
                  style="width:120px"
                    v-model="scope.row.graduationtime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                  <!-- <el-input v-model="scope.row.graduationtime" autocomplete="off" /> -->
              </template>
            </el-table-column>
            <!-- <el-table-column prop="date" label="学位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.mobilephone" autocomplete="off" />
              </template>
            </el-table-column> -->
            <el-table-column prop="date" label="学历类型">
              <template slot-scope="scope">
                <el-select clearable v-model.number="scope.row.education" placeholder="请选择">
                  <el-option
                    v-for="item in educationList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                  </el-option>
                </el-select>
                  <!-- <el-input v-model="scope.row.mobilephone" autocomplete="off" /> -->
              </template>
            </el-table-column>
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                        v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="editDeleteEducateList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="editJiaEducateList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
        <!-- 工作履历 -->
        <el-table :data="tableInfo.workhistorylist" border style="width: 100%">
          <el-table-column header-align="center" label="工作履历">
            <el-table-column prop="date" label="公司">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.company" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="部门">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.department" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="职位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.position" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="入职时间">
              <template slot-scope="scope">
                  <el-date-picker
                    style="width:120px"
                    v-model="scope.row.entrytime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="离职日期">
              <template slot-scope="scope">
                  <el-date-picker
                  style="width:120px"
                    v-model="scope.row.leavedate"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witness" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witnesstel" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="备注">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.remarks" autocomplete="off" />
              </template>
            </el-table-column>
            
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="editDeleteWorkList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="editJiaWorkList" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
        <!-- 集团工作经历 -->
        <el-table :data="tableInfo.groupworkhistorylist" border style="width: 100%">
          <el-table-column header-align="center" label="集团工作经历">
            <el-table-column prop="date" label="公司">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.company" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="部门">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.department" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="职位">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.position" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="入职时间">
              <template slot-scope="scope">
                  <el-date-picker
                    style="width:120px"
                    v-model="scope.row.entrytime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="离职日期">
              <template slot-scope="scope">
                  <el-date-picker
                  style="width:120px"
                    v-model="scope.row.leavedate"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witness" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="证明人电话">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.witnesstel" autocomplete="off" />
              </template>
            </el-table-column>
            <el-table-column prop="date" label="备注">
              <template slot-scope="scope">
                  <el-input v-model="scope.row.remarks" autocomplete="off" />
              </template>
            </el-table-column>
            
            <el-table-column
                label="操作">
                <template #default="scope">
                    <el-button
                    v-if="scope.$index!=0"
                        plain
                        icon="el-icon-delete"
                        size="mini"
                        type="danger"
                        @click="deleteGroupworkList(scope)"
                    >删除</el-button>
                </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-button @click="editGroupworkhistorylist" type="primary" icon="el-icon-plus" circle size="mini"></el-button>
      </el-dialog>

  </div>
</template>

<script>

import { dutyclasslist,statedutyclass,eitedutyclassinfo,getdutyclassinfo,adddutyclass } from '@/api/duty/dimension'
import { stafflist,archiveslist,archivescont,govthree,positionlist,dutieslist } from '@/api/personnel/post'
import {
  grouplist,
  departmentlist,
  getgroupdepartmap,
  getgroupuser
} from '@/api/duty/group'

export default {
  name: 'Dashboard',
  filters: {//与data同级
    dataFormat(val) {//val是传递过来的时间戳
      let data = new Date(val);
      let y = data.getFullYear();
      let m = data.getMonth() + 1;
      let d = data.getDay();
      let s = data.getHours();
      let f = data.getMinutes();
      let mi = data.getSeconds();
      return `${y}-${m}-${d}  ${s}:${f}:${mi} `;
    }
  },
  data() {
    return {
      GovthreeList2:[],
      defaultProps1: {
                children: 'child',
                label: 'name'
            },
      // 用工关系选择列表
      emptypeList:[
        {
          value:1,
          label:'实习生'
        },
        {
          value:2,
          label:'待分配'
        },
        {
          value:3,
          label:'试用员工'
        },
        {
          value:4,
          label:'正式员工'
        },
        {
          value:5,
          label:'停薪留职'
        },
        {
          value:6,
          label:'退休'
        },
        {
          value:7,
          label:'辞退'
        },
        {
          value:8,
          label:'离职'
        },
      ],
      // 是否为选项列表
      yesList:[
        {
          id:1,
          tittle:'是'
        },
        {
          id:2,
          tittle:'否'
        },
      ],
      // 星座列表
      constellationList:[
        {
          id:1,
          tittle:'白羊座'
        },
        {
          id:2,
          tittle:'金牛座'
        },
        {
          id:3,
          tittle:'双子座'
        },
        {
          id:4,
          tittle:'巨蟹座'
        },
        {
          id:5,
          tittle:'狮子座'
        },
        {
          id:6,
          tittle:'处女座'
        },
        {
          id:7,
          tittle:'天枰座'
        },
        {
          id:8,
          tittle:'天蝎座'
        },
        {
          id:9,
          tittle:'射手座'
        },
        {
          id:10,
          tittle:'摩羯座'
        },
        {
          id:11,
          tittle:'水瓶座'
        },
        {
          id:12,
          tittle:'双鱼座'
        },
      ],
      // 婚姻状态列表
      marriageList:[
        {
          id:1,
          tittle:'未婚'
        },
        {
          id:2,
          tittle:'已婚'
        },
        {
          id:3,
          tittle:'丧偶'
        },
        {
          id:4,
          tittle:'离异'
        },
      ],
      // 健康状况列表
      healthList:[
        {
          id:1,
          tittle:'良好'
        },
        {
          id:2,
          tittle:'一般'
        },
        {
          id:3,
          tittle:'较弱'
        },
        {
          id:4,
          tittle:'有生理缺陷'
        },
        {
          id:5,
          tittle:'残废'
        },
      ],
      // 职务列表
      dutieslistData:[],
      // 岗位列表数据
      positionlistData:[],
      govthreeData:{},
      editBaseDialogFormVisible:false,
      editTableDialogFormVisible:false,
      // 政治面貌列表
      politicsList:[
        {
          id:1,
          name:'群众'
        },
        {
          id:2,
          name:'无党派'
        },
        {
          id:3,
          name:'台盟会员'
        },
        {
          id:4,
          name:'九三社员'
        },
        {
          id:5,
          name:'致公党员'
        },
        {
          id:6,
          name:'农工党员'
        },
        {
          id:7,
          name:'民进会员'
        },
        {
          id:8,
          name:'民建会员'
        },
        {
          id:9,
          name:'民盟盟员'
        },
        {
          id:10,
          name:'民革会员'
        },
        {
          id:11,
          name:'共青团员'
        },
        {
          id:12,
          name:'预备党员'
        },
        {
          id:13,
          name:'中共党员'
        },
        
      ],
      // 教育经历列表
      educationList:[
        {
          id:1,
          name:'初中及以下'
        },
        {
          id:2,
          name:'中专'
        },
        {
          id:3,
          name:'高中'
        },
        {
          id:4,
          name:'中技'
        },
        {
          id:5,
          name:'高技'
        },
        {
          id:6,
          name:'函数专科'
        },
        {
          id:7,
          name:'大学专科'
        },
        {
          id:8,
          name:'函数本科'
        },
        {
          id:9,
          name:'大学本科'
        },
        {
          id:10,
          name:'硕士研究生'
        },
        {
          id:11,
          name:'博士研究生'
        },
        {
          id:12,
          name:'专家、教授'
        },
      ],
      // 家庭成员数组
      memberOfFamilyList:[
        {
          relationship:'',
          name:'',
          company:'',
          department:'',
          position:'',
          politicaloutlook:''
        }
      ],
      // 紧急联系人数组
      emergencycontactList:[
        {
          name:'',//姓名
          relationship:'',//与本人关系
          mobilephone:'',//联系电话
        },
      ],
      // 工作履历数组
      workList:[
        {
          company: "", //公司
          department: "", //部门
          position: "", //职位
          entrytime: "", //入职时间
          leavedate: "", //离职日期
          witness: "", //证明人
          witnesstel: "", //证明人电话
          remarks: "" //备注
        },
      ],
      // 双职工数组
      doubleworkerList:[
        {
          number:'',
          name:'',
          company:'',
          department:'',
          position:'',
          mobilephone:'',
        }
      ],
      // 教育经历数组
      educateList:[
        {
          graduationschool:'',
          subject:'',
          education:'',
          admissiontime:'',
          graduationtime:'',
          education:'',

        },
      ],
      // 基础信息
      baseInfo:{},
      // 性别列表
      sexData:[
        {
          id:1,
          tittle:'男'
        },
        {
          id:2,
          tittle:'女'
        },
      ],
      // 表格信息
      tableInfo:{},
      // 人员信息详情
      staffInfo:{},
      // 详情弹框
      detailsVisible:false,
      // 查询详情的数据
      editFrom:{},
      // 修改状态提交数据
      switchFrom:{},
      // 删除数据提交
      deleFrom:{},
      // 编辑时数据
      editAdd:{},
      assessList:{},
      // 添加数据
      form:{
        type:1,
      },
      // 弹窗变量
      dialogFormVisible:false,
      // 修改弹窗
      editDialogFormVisible:false,
      total: 0,
      tableData:[],
      // 条件查询变量
      searchInfo: {
        page: 1,
        pagesize: 10
      },
      // 条件查询变量
      abc:{
        aaa:"111",
        bbb:"222"
      },
      props1: {
        checkStrictly: true,
        value: "id",
        label: "name",
        children: "children",
        emitPath:false,
      },
      searchDepartmentList:[],
      // 添加时验证规则
      rules: {
        title: [{ required: true, message: '请输入名称', trigger: 'blur' }],
      },
      editRules:{
        title: [{ required: true, message: '请输入名称', trigger: 'blur' }],
      }
    }
  },
  created() {
    console.log(this.$store.state.user.token)
    if (this.$store.state.user.token=='') {
      this.$router.push('/login')
    }
    // 页面渲染时获取初始数据
    this.getDataList()
    this.getGovthreeData()
    this.getPositionlist()
    this.getDutieslist()
    this.getGroup()
    this.getGovthree2()
  },
  methods: {
    // 点击行政组织树
handleNodeClick(val){
      this.searchInfo.adminorg=val.id
      this.searchInfo.adminorg=this.searchInfo.adminorg
      this.getDataList()
      console.log(val)
    },
//   获取行政组织二级树
async getGovthree2(){
  const res = await govthree()
  // this.GovthreeList2 = res.data[0].child
  this.GovthreeList2 = res.data
},
    // 获取公司值
    async getGroup(){
      const res = await departmentlist()
      this.searchDepartmentList=res.data
    },
    // 获取岗位列表
    async getPositionlist(){
      const from = {
        page:1,
        pagesize:1000000
      }
      const res = await positionlist(from)
      this.positionlistData=res.data.list
      
    },
    // 获取职务列表
    async getDutieslist(){
      const from = {
        page:1,
        pagesize:1000000
      }
      const res = await dutieslist(from)
      this.dutieslistData=res.data.list
      
    },
    // 添加工作履历信息
    jiaWorkList(){
      this.workList.push({
        company: "", //公司
        department: "", //部门
        position: "", //职位
        entrytime: "", //入职时间
        leavedate: "", //离职日期
        witness: "", //证明人
        witnesstel: "", //证明人电话
        remarks: "" //备注
      })
    },
    // 添加工作履历信息
    editGroupworkhistorylist(){
      this.tableInfo.groupworkhistorylist.push({
        company: "", //公司
        department: "", //部门
        position: "", //职位
        entrytime: "", //入职时间
        leavedate: "", //离职日期
        witness: "", //证明人
        witnesstel: "", //证明人电话
        remarks: "" //备注
      })
    },
    // 编辑添加工作履历信息
    editJiaWorkList(){
      this.tableInfo.workhistorylist.push({
        company: "", //公司
        department: "", //部门
        position: "", //职位
        entrytime: "", //入职时间
        leavedate: "", //离职日期
        witness: "", //证明人
        witnesstel: "", //证明人电话
        remarks: "" //备注
      })
    },
    // 添加教育经历信息
    jiaEducateList(){
      this.educateList.push({
          graduationschool:'',
          subject:'',
          education:'',
          admissiontime:'',
          graduationtime:'',
          education:'',
        })
    },
    // 编辑添加教育经历信息
    editJiaEducateList(){
      this.tableInfo.educationalexperience.push({
          graduationschool:'',
          subject:'',
          education:'',
          admissiontime:'',
          graduationtime:'',
          education:'',
        })
    },
    deleteGroupworkList(row){
      this.tableInfo.groupworkhistorylist.splice(row.$index,1);
    },
    // 删除工作履历数组
    deleteWorkList(row){
      this.workList.splice(row.$index,1);
    },
    // 删除教育经历数组
    deleteEducateList(row){
      this.educateList.splice(row.$index,1);
    },
    // 删除家庭成员数组
    deleteFamilyList(row){
      this.memberOfFamilyList.splice(row.$index,1);
    },

    // 编辑删除工作履历数组
    editDeleteWorkList(row){
      this.tableInfo.workhistorylist.splice(row.$index,1);
    },
    // 编辑删除教育经历数组
    editDeleteEducateList(row){
      this.tableInfo.educationalexperience.splice(row.$index,1);
    },
    // 编辑删除家庭成员数组
    editDeleteFamilyList(row){
      this.memberOfFamilyList.splice(row.$index,1);
    },
    // 添加家庭成员信息
    jiaFamilyList(){
      this.memberOfFamilyList.push({
        relationship:'',
          name:'',
          company:'',
          department:'',
          position:'',
          politicaloutlook:''
      })
    },
    // 编辑添加家庭成员信息
    editJiaFamilyList(){
      this.tableInfo.memberoffamily.push({
        relationship:'',
          name:'',
          company:'',
          department:'',
          position:'',
          politicaloutlook:''
      })
    },
    // 删除行
    deleteRulesList(row){
        this.emergencycontactList.splice(row.$index,1);
    },
    // 编辑删除行紧急联系人
    deleteRulesList(row){
        this.tableInfo.emergencycontact.splice(row.$index,1);
    },
    // 添加紧急联系人
    jiaemergencycontactList(){
      this.emergencycontactList.push({
          number:'',
          name:'',
          company:'',
          department:'',
          position:'',
          mobilephone:'',
      })
    },
    // 编辑添加紧急联系人
    eaitJiaemergencycontactList(){
      this.tableInfo.emergencycontact.push({
          number:'',
          name:'',
          company:'',
          department:'',
          position:'',
          mobilephone:'',
      })
    },
    // 查看详情操作
    async showDetails(row){
      const from = {
        id:row.id
      }
      const res = await archivescont(from)
      this.staffInfo=res.data
      this.detailsVisible=true
    },
    // 删除操作
    //删除操作
    async deleteOperate(row) {
      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(async() => {
          this.deleFrom.state=3;
          this.deleFrom.outid=row.outId;
          const res = await statedutyclass(this.deleFrom)
          if (res.code === 0) {
            this.$message({
              type: 'success',
              message: '删除成功!'
            })
            
             this.getDataList()
          }
        })
    },
    // 新增按钮
    showAdd(){
      this.dialogFormVisible=true;
      console.log(this.dialogFormVisible)
    },
    // 编辑按钮
    async showEdit(row){
      this.editFrom.outid=row.outId
      const res = await getdutyclassinfo(this.editFrom)
      this.editAdd = res.data
      this.editDialogFormVisible=true;

    },
    // 编辑基础信息按钮
    async showEditBase(row){
      const editFrom = {
        id:row.id
      }
      // this.editFrom.outid=row.outId
      const res = await archivescont(editFrom)
      this.baseInfo = res.data
      this.editBaseDialogFormVisible=true;

    },
    // 编辑表格信息按钮
    async showEditTable(row){
      const editFrom = {
        id:row.id
      }
      // this.editFrom.outid=row.outId
      const res = await archivescont(editFrom)
      this.tableInfo = res.data
      console.log("this.tableInfo")
      console.log(this.tableInfo)
      this.editTableDialogFormVisible=true;

    },
    // 开关状态监听
   async changeVal(val,id){
       console.log(val)
      this.switchFrom.outid=id
      if (val==1) {
        this.switchFrom.state=1;
        const res = await statedutyclass(this.switchFrom)
                if (res.code === 0) {
                  this.$message({
                    type: 'success',
                    message: '修改状态成功',
                    showClose: true
                  })
                  this.getDataList()
                }
      } else {
        this.switchFrom.state=2;
        const res = await statedutyclass(this.switchFrom)
                if (res.code === 0) {
                  this.$message({
                    type: 'success',
                    message: '修改状态成功',
                    showClose: true
                  })
                  this.getDataList()
                }
      }
    },
    // 重置搜索条件
    onReset() {
      this.searchInfo = {}
    },
    // 条件搜索
    onSubmit() {
      
      this.searchInfo.page = 1
      this.searchInfo.pagesize = 10
      this.getDataList()
    },
    // 日期时间戳转日期格式
    formatDate(nS) {     
      return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');     
    },
   
    // 提交按钮
    async enterDialog(){
      
      this.$refs.addForm.validate(async valid => {
        if (valid) {
          const res = await adddutyclass(this.form)
          if (res.code === 0) {
                  this.$message({
                    type: 'success',
                    message: '添加成功',
                    showClose: true
                  })
                }
          this.getDataList();
          this.closeDialog();
        }
      })
    },

    // 编辑提交按钮
    async editEnterDialog(){
      this.$refs.editForm.validate(async valid => {
        if (valid) {
          const res = await eitedutyclassinfo(this.editAdd)
          if (res.code === 0) {
                  this.$message({
                    type: 'success',
                    message: '编辑成功',
                    showClose: true
                  })
                }
          this.getDataList();
          this.editCloseDialog();
        }
      })
    },
    // 添加框关闭
    closeDialog() {
      console.log("closeDialog")
      this.initForm()
      this.dialogFormVisible = false
    },
    // 修改框关闭
    editCloseDialog() {
      this.editInitForm()
      this.editDialogFormVisible = false
    },
    // 添加重置表单
    initForm() {
      console.log("initForm")
      this.$refs.addForm.resetFields()
      this.form = {}
      console.log(this.form)
    },
    // 修改重置表单
    editInitForm() {
      this.$refs.editForm.resetFields()
      this.editAdd = {}
    },
    // 改变pageSize
    handleSizeChange(val) {
      this.searchInfo.pagesize=val
      this.getDataList(this.searchInfo)
    },
    // 改变page
    handleCurrentChange(val) {
      this.searchInfo.page=val
      this.getDataList(this.searchInfo)
    },
    // 获取初始数据
    async getDataList() {
      const res = await archiveslist(this.searchInfo)
      console.log("res")
      console.log(res)
      this.tableData = res.data.list

      this.total = res.data.total
      this.searchInfo.page = res.data.page
      this.searchInfo.pagesize = res.data.pageSize
    },
    // 获取组织初始数据
    async getGovthreeData() {
      const searchInfo = {
        id:312
      }
      const res = await govthree(searchInfo)
      console.log("res")
      console.log(res)
      this.govthreeData = res.data
      console.log("this.govthreeData")
      console.log(this.govthreeData)
    }

  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
