<template>
  <div class="bigBox">
    <MOSTY.FromPage :title="props.title" @closeDialog="CloseEvent">
      <template #content>
        <MOSTY.Assort :title="'基本信息'" />
        <div class="fromBox">
          <el-form class="mosty-from-wrap" ref="ruleFormRef" label-width="140px" :model="fromObj" :inline="true"
            :rules="rules" :disabled="!props.BtnShow">
            <div style="display: flex;">
              <div style="
                      width: 14%;
                      margin: auto;
                      overflow: hidden;
                      height: 155px;
                    ">
                <MOSTY.Upload width="150px" v-if='props.BtnShow || fromObj.picture' :limit="1" :nopicer="false"
                  :isImg="true" :ShowfileList="false" v-model="fromObj.picture" @filehandleChange="changeFiles"
                  :disabled="!props.BtnShow">
                </MOSTY.Upload>
                <img v-else :src="getImgUrl('img/emptyImg.jpg')" alt="" style="height:180px;width:237px;">
              </div>
              <div class="right-item">
                <el-form-item label="驾驶员姓名:" prop="drivername" style="display: flex">
                  <el-input v-model="fromObj.drivername" readonly clearable>
                    <template #append>
                      <el-button class='cursor' @click="ChooesDdld('01')">选择</el-button>
                      <!-- :disabled="props.title === '驾驶员信息修改'">选择</el-button> -->
                    </template>
                  </el-input>
                </el-form-item>
                <el-form-item label="驾驶档案号:">
                  <el-input v-model="fromObj.driverfileno" clearable :disabled='true' />
                </el-form-item>
                <el-form-item label="性别:" prop="sex">
                  <el-select v-model="fromObj.sex" clearable>
                    <el-option v-for="item in props.zdlist.D_BZ_XB" :key="item" :label="item.label"
                      :value="item.value" />
                  </el-select>
                </el-form-item>
                <el-form-item label="出生日期:" prop="birth">
                  <!-- :disabled-date="disabledDate" -->
                  <el-date-picker v-model="fromObj.birth" type="data" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                    placeholder="请选择出生日期" :default-value="getDefaultDates" style="width: 100%">
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="身份证号:" prop="idcard">
                  <MaskIdcardInput :isShow="fromObj.isShowData" v-model="fromObj.idcard" placeholder="请输入身份证号"
                    style="width: 337px" @change="identCardChange" />
                </el-form-item>
                <!-- <el-form-item label="身份证号:" prop="idcard" style="display: flex">
                  <el-input v-model="fromObj.idcard" placeholder="请输入身份证号" style="width: 100%" clearable
                    @change="identCardChange"></el-input>
                  <MOSTY.IdentityCard width="100%" v-model="fromObj.idcard" clearable @onInput="identityCardChange" @onChange="identCardChange">
                  </MOSTY.IdentityCard>
                </el-form-item> -->
                <el-form-item label="民族:">
                  <el-select v-model="fromObj.nation" clearable>
                    <el-option v-for="item in D_BZ_MZ" :key="item" :label="item.label" :value="item.value" />
                  </el-select>
                </el-form-item>
                <el-form-item label="政治面貌:">
                  <el-select v-model="fromObj.politicalstatus" clearable>
                    <el-option v-for="item in D_BZ_AQRYZZMM" :key="item" :label="item.label" :value="item.value" />
                  </el-select>
                </el-form-item>
                <el-form-item label="文化程度:">
                  <el-select v-model="fromObj.educationlevel" clearable>
                    <el-option v-for="item in D_BZ_AQRYWHCD" :key="item" :label="item.label" :value="item.value" />
                  </el-select>
                </el-form-item>
                <el-form-item label="身体健康状况:">
                  <el-select v-model="fromObj.healthstatus" clearable>
                    <el-option v-for="item in D_TB_HEALTH" :key="item" :label="item.label" :value="item.value" />
                  </el-select>
                </el-form-item>

              </div>
            </div>
            <!-- <el-form-item label="是否为专职驾驶员:" prop="sfwzzjsy">
              <el-select v-model="fromObj.sfwzzjsy" style="width: 250px" clearable>
                <el-option v-for="item in D_BZ_SF" :key="item" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item> -->
            <el-form-item label="家庭住址:" style="display: flex">
              <el-input v-model="fromObj.homeaddr" clearable />
            </el-form-item>
            <el-form-item label="驾驶证号:" prop="drivenumber">
              <MaskIdcardInput :isShow="fromObj.isShowData" v-model="fromObj.drivenumber" placeholder="请输入驾驶证号"
                style="width: 337px" @change="identityCardChange" />
            </el-form-item>
            <!-- <el-form-item label="驾驶证号:" prop="drivenumber">
              <MOSTY.IdentityCard width="100%" v-model="fromObj.drivenumber" :placeholder="'请输入驾驶证号'" clearable
                @onInput="identityCardChange">
              </MOSTY.IdentityCard>
              <el-input v-model="fromObj.drivenumber" clearable />
            </el-form-item> -->
            <el-form-item label="准驾车型:" prop="driveLevelArray">
              <el-select v-model="fromObj.driveLevelArray" clearable multiple>
                <el-option v-for="item in props.zdlist.D_TB_DRIVELEVEL" :key="item" :label="item.label"
                  :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="安全行车公里:" prop="safedistance">
              <el-input v-model.number="fromObj.safedistance" type='number' clearable>
                <template #append>(万)公里</template>
              </el-input>
            </el-form-item>
            <el-form-item label="驾驶工龄:" prop="driveage">
              <el-input v-model.number="fromObj.driveage" type='number' clearable>
                <template #append>年</template>
              </el-input>
            </el-form-item>
            <el-form-item label="驾驶员类别:" prop="drivertype">
              <el-select v-model="fromObj.drivertype" clearable>
                <el-option v-for="item in D_TB_DRIVERTYPE" :key="item" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="驾驶员状态:" prop="driverState">
              <el-select v-model="fromObj.driverState" clearable>
                <el-option v-for="item in D_JSYZT" :key="item" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="职工类型:" prop="empnature">
              <MOSTY.DictRidioAndSelect style="width:100%" :dictData="D_TB_EMPNATURE" v-model="fromObj.empnature"
                selectType="select" />
            </el-form-item>
            <el-form-item label="技术职称:">
              <el-input v-model="fromObj.technicaltitle" clearable />
            </el-form-item>
            <el-form-item label="初次领证时间:" prop="initgetlicensedate">
              <!-- :disabled-date="disablednowDate" -->
              <el-date-picker v-model="fromObj.initgetlicensedate" type="date" style="width: 100%" format="YYYY-MM-DD"
                value-format="YYYY-MM-DD" />
            </el-form-item>
            <el-form-item label="参加工作时间:">
              <!-- :disabled-date="disablednowDate"  -->
              <el-date-picker v-model="fromObj.joinworkdate" type="date" style="width: 100%" format="YYYY-MM-DD"
                value-format="YYYY-MM-DD" />
            </el-form-item>
            <el-form-item label="上岗证号:" v-if="props.BtnShow">
              <el-input v-model="fromObj.idnumber" disabled clearable />
            </el-form-item>
            <el-form-item label="体检时间:" v-if="props.BtnShow">
              <!-- :disabled-date="disablednowDate" -->
              <el-date-picker v-model="fromObj.medicaltime" type="date" style="width: 100%" format="YYYY-MM-DD"
                value-format="YYYY-MM-DD" />
            </el-form-item>
            <el-form-item label="体检是否合格:" v-if="props.BtnShow">
              <el-select v-model="fromObj.medicaltype" clearable>
                <el-option v-for="item in D_TB_MEDICALTYPE" :key="item" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <!--所属相关方，当员工为业务外包时显示-->
            <el-form-item label="所属相关方:" prop="relatedname" v-if="fromObj.empnature != '1'">
              <el-input v-model="fromObj.relatedname" disabled clearable />
            </el-form-item>
            <!--空白项，调整格式使用,当员工为业务外包时使用-->
            <el-form-item style="visibility: hidden;" v-if="fromObj.empnature === '3'"></el-form-item>
            <el-form-item label="备注:" style="width:100%">
              <el-input v-model="fromObj.bz" autosize clearable type="textarea" row="5" style="width:100%" />
            </el-form-item>
          </el-form>
        </div>
        <div v-if="fromObj.id">
          <MOSTY.Assort :title="'上岗证'">
            <template #icon>
              <span @click='tabshow.bjzshow = !tabshow.bjzshow' class='zkbox'>
                <span class='bqfont'> {{ tabshow.bjzshow ? '收起' : '展开' }}</span>
                <el-icon v-if='tabshow.bjzshow' class='iconfont'>
                  <CaretTop />
                </el-icon>
                <el-icon v-else class='iconfont'>
                  <CaretBottom />
                </el-icon>
              </span>
            </template>
          </MOSTY.Assort>
          <div v-if='tabshow.bjzshow'>
            <div style="margin: 10px">
              <MOSTY.IDcard :driveruserid='fromObj.id'> </MOSTY.IDcard>
            </div>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶车辆'">
          <template #icon>
            <span @click='tabshow.jsclshow = !tabshow.jsclshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jsclshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jsclshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jsclshow'>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns" :tableData="tableData3" :tableloading="tableloading"
              :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false" :key="keyCount">
              <template #actions="{ row }">
                <span v-if='props.BtnShow' class="operedit" @click="bjclxx(row)"> <el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <span v-else class="operesee" @click="bjclck(row)"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'参加工作简历情况'">
          <template #icon>
            <span @click='tabshow.cjgzshow = !tabshow.cjgzshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.cjgzshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.cjgzshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>

        <div v-if='tabshow.cjgzshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('01')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns1" :tableData="fromObj.tbDriverWadcList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '01', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverWadcList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '01')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'主要驾驶情况'">
          <template #icon>
            <span @click='tabshow.zyjsshow = !tabshow.zyjsshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.zyjsshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.zyjsshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.zyjsshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('02')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns2" :tableData="fromObj.tbDriverSituatiList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '02', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverSituatiList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '02')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'驾照审核记录'">
          <template #icon>
            <span @click='tabshow.jzshshow = !tabshow.jzshshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jzshshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jzshshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jzshshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('03')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns3" :tableData="fromObj.tbDriverLarList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '03', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverLarList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '03')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶经历及证照登记'">
          <template #icon>
            <span @click='tabshow.jsyjshow = !tabshow.jsyjshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jsyjshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jsyjshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jsyjshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('04')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns12" :tableData="fromObj.tbDriverMdeatlrfList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '04', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverMdeatlrfList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '04')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'机动车驾驶员调入、借用、聘用考核登记'">
          <template #icon>
            <span @click='tabshow.khdjshow = !tabshow.khdjshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.khdjshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.khdjshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.khdjshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('05')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns13" :tableData="fromObj.tbDriverTeerfList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #arttlhtvt="{ row }">
                <dict-tag :options="D_TB_ARTTLHTVT" :value="row.arttlhtvt" :tag="false" />
              </template>
              <template #aes="{ row }">
                <dict-tag :options="D_TB_AES" :value="row.aes" :tag="false" />
              </template>
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '05', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverTeerfList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '05')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶员受奖励登记'">
          <template #icon>
            <span @click='tabshow.sjdjshow = !tabshow.sjdjshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.sjdjshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.sjdjshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.sjdjshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('06')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns4" :tableData="fromObj.tbDriverDwrrfList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '06', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverDwrrfList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '06')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶员肇事登记'">
          <template #icon>
            <span @click='tabshow.zsdjshow = !tabshow.zsdjshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.zsdjshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.zsdjshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.zsdjshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('07')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns14" :tableData="fromObj.tbDriverRfohardList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '07', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverRfohardList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '07')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶员家庭情况表'">
          <template #icon>
            <span @click='tabshow.jtqkshow = !tabshow.jtqkshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jtqkshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jtqkshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jtqkshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('08')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns5" :tableData="fromObj.tbDriverDftList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #impact="{ row }">
                <dict-tag :options="D_TB_IMPACT" :value="row.impact" :tag="false" />
              </template>
              <template #jleducation="{ row }">
                <dict-tag :options="D_BZ_AQRYWHCD" :value="row.jleducation" :tag="false" />
              </template>

              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '08', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverDftList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '08')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶员技能比武'">
          <template #icon>
            <span @click='tabshow.jnbwshow = !tabshow.jnbwshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jnbwshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jnbwshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jnbwshow'>
          <div v-if="props.BtnShow">
            <el-button class="addbtn" type="primary" @click="addDialog('09')">
              <el-icon>
                <CirclePlus />
              </el-icon>
              <span>新增</span>
            </el-button>
          </div>
          <div class="tabbox">
            <MOSTY.Table :table-columns="padedata.tableColumns6" :tableData="fromObj.tbDriverSkillAwardsList"
              :tableloading="tableloading" :tableHeight="'30vh'" :isSelect="false" style="width: 100%;" :isSort="false">
              <template #awardstype="{ row }">
                <dict-tag :options="D_BZ_AWARDS_TYPE" :value="row.awardstype" :tag="false" />
              </template>
              <template #getlevel="{ row }">
                <dict-tag :options="D_TB_GETLEVEL" :value="row.getlevel" :tag="false" />
              </template>
              <template #actions="scope">
                <span class="operedit" v-if="props.BtnShow" @click="editDialog(scope.row, '09', scope.$index)"><el-icon>
                    <EditPen />
                  </el-icon>编辑</span>
                <el-popconfirm v-if="props.BtnShow" confirm-button-text="是" cancel-button-text="否" icon-color="red"
                  title="确定要删除?" @confirm="delRow(fromObj.tbDriverSkillAwardsList, scope.row)">
                  <template #reference>
                    <span class="operdel" size="small"><el-icon>
                        <Delete />
                      </el-icon>删除</span>
                  </template>
                </el-popconfirm>
                <span class="operesee" v-if="!props.BtnShow" @click="seeDialog(scope.row, '09')"><el-icon>
                    <View />
                  </el-icon>查看</span>
              </template>
            </MOSTY.Table>
          </div>
        </div>
        <!-- <MOSTY.Assort :title="'身份证复印件'">
          <template #icon>
            <span @click='tabshow.sfzfyshow = !tabshow.sfzfyshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.sfzfyshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.sfzfyshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.sfzfyshow'>
          <div style="margin: 10px">
            <MOSTY.Upload :width="'100%'" :limit="2" :nopicer="false" :isImg="true" :ShowfileList="false"
              v-model="fromObj.idcardfile" :nameshow='true' :gsgfList="['jpg', 'png']" :disabled='!props.BtnShow'
              @filehandleChange="changeFiles">
            </MOSTY.Upload>
          </div>
        </div> -->
        <MOSTY.Assort :title="'机动车驾驶员考核原件'">
          <template #icon>
            <span @click='tabshow.khyjshow = !tabshow.khyjshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.khyjshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.khyjshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.khyjshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="3" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.examinefile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶员体检登记与禁忌管理'">
          <template #icon>
            <span @click='tabshow.jjglshow = !tabshow.jjglshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jjglshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jjglshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jjglshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.taboofile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>

        </div>
        <MOSTY.Assort :title="'违法违规证明'">
          <template #icon>
            <span @click='tabshow.wgwfshow = !tabshow.wgwfshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.wgwfshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.wgwfshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.wgwfshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.regulationfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>

        </div>
        <MOSTY.Assort :title="'机动车驾驶证正复印件'">
          <template #icon>
            <span @click='tabshow.jdcjsshow = !tabshow.jdcjsshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jdcjsshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jdcjsshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jdcjsshow'>
          <div style="margin: 10px">
            <MOSTY.Upload :width="'100%'" :limit="2" :nopicer="false" :isImg="true" :ShowfileList="false"
              v-model="fromObj.drivinglicencefile" :nameshow='true' :gsgfList="['jpg', 'png', 'jpeg', 'bmp', 'gif']"
              :disabled='!props.BtnShow' @filehandleChange="changeFiles">
            </MOSTY.Upload>
          </div>

        </div>
        <MOSTY.Assort :title="'机动车驾驶证副复印件'">
          <template #icon>
            <span @click='tabshow.jdcjsfshow = !tabshow.jdcjsfshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jdcjsfshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jdcjsfshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jdcjsfshow'>
          <div style="margin: 10px">
            <MOSTY.Upload :width="'100%'" :limit="2" :nopicer="false" :isImg="true" :ShowfileList="false"
              v-model="fromObj.drivinglicenceReverseflie" :nameshow='true'
              :gsgfList="['jpg', 'png', 'jpeg', 'bmp', 'gif']" :disabled='!props.BtnShow'
              @filehandleChange="changeFiles">
            </MOSTY.Upload>
          </div>

        </div>
        <MOSTY.Assort :title="'驾驶员奖励登记'">
          <template #icon>
            <span @click='tabshow.jldjfshow = !tabshow.jldjfshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jldjfshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jldjfshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jldjfshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.rewardfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>
        <!-- <MOSTY.Assort :title="'行业上岗证'">
          <template #icon>
            <span @click='tabshow.zysgshow = !tabshow.zysgshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.zysgshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.zysgshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.zysgshow'>
          <div style="margin: 10px">
            <MOSTY.Upload :width="'100%'" :limit="5" :nopicer="false" :isImg="true" :ShowfileList="false"
              v-model="fromObj.industryfile" :nameshow='true' :gsgfList="['jpg', 'png', 'jpeg', 'bmp', 'gif']"
              :disabled='!props.BtnShow' @filehandleChange="changeFiles">
            </MOSTY.Upload>
          </div>
        </div> -->
        <MOSTY.Assort :title="'车队证明'">
          <template #icon>
            <span @click='tabshow.cdzmshow = !tabshow.cdzmshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.cdzmshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.cdzmshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.cdzmshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.fleetfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>
        <MOSTY.Assort :title="'驾驶员上岗证办理申请表'">
          <template #icon>
            <span @click='tabshow.sgzblshow = !tabshow.sgzblshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.sgzblshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.sgzblshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.sgzblshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.certificationfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>

        <MOSTY.Assort :title="'驾驶员准驾证办理申请表'">
          <template #icon>
            <span @click='tabshow.zjzblshow = !tabshow.zjzblshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.zjzblshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.zjzblshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.zjzblshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.drivingpermitfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>
        <MOSTY.Assort :title="'理论考试资料'">
          <template #icon>
            <span @click='tabshow.kszlshow = !tabshow.kszlshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.kszlshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.kszlshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.kszlshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.examinationfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>

        <MOSTY.Assort :title="'路考资料附件'">
          <template #icon>
            <span @click='tabshow.lkkszlshow = !tabshow.lkkszlshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.lkkszlshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.lkkszlshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.lkkszlshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.roadtestfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>
        <!--
        <MOSTY.Assort :title="'驾驶证'">
          <template #icon>
            <span @click='tabshow.jszshow = !tabshow.jszshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jszshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jszshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jszshow'>
          <div style="margin: 10px">
            <MOSTY.Upload :width="'100%'" :limit="5" :nopicer="false" :isImg="true" :ShowfileList="false"
              v-model="fromObj.driverslicensefile" :nameshow='true' :gsgfList="['jpg', 'png', 'jpeg', 'bmp', 'gif']"
              :disabled='!props.BtnShow' @filehandleChange="changeFiles">
            </MOSTY.Upload>
          </div>
        </div> -->
        <MOSTY.Assort :title="'身份证'">
          <template #icon>
            <span @click='tabshow.sfzshow = !tabshow.sfzshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.sfzshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.sfzshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.sfzshow'>
          <div style="margin: 10px">
            <MOSTY.Upload :width="'100%'" :limit="5" :nopicer="false" :isImg="true" :ShowfileList="false"
              v-model="fromObj.idcardsfile" :nameshow='true' :gsgfList="['jpg', 'png', 'jpeg', 'bmp', 'gif']"
              :disabled='!props.BtnShow' @filehandleChange="changeFiles">
            </MOSTY.Upload>
          </div>
        </div>
        <MOSTY.Assort :title="'职业禁忌症体检附件'">
          <template #icon>
            <span @click='tabshow.jjtjshow = !tabshow.jjtjshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jjtjshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jjtjshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jjtjshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="5" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.zyjjztj" :showinput="false" :disabled="!saveBtnShow"></MOSTY.Upload>
          </div>
        </div>
        <!-- <MOSTY.Assort :title="'健康体检证明'">
          <template #icon>
            <span @click='tabshow.jkzmshow = !tabshow.jkzmshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.jkzmshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.jkzmshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.jkzmshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.healthfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div> -->
        <MOSTY.Assort :title="'三年无重大事故证明(交警部门)'">
          <template #icon>
            <span @click='tabshow.swzdshow = !tabshow.swzdshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.swzdshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.swzdshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.swzdshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.certificatefile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>
        <!-- <MOSTY.Assort :title="'安全行车5万公里证明'">
          <template #icon>
            <span @click='tabshow.aqxcshow = !tabshow.aqxcshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.aqxcshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.aqxcshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.aqxcshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :ShowfileList="true" v-model="fromObj.drivingkilometersfile" :showinput="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div> -->
        <MOSTY.Assort :title="'学历证明：（高中(中专)及以上学历）'">
          <template #icon>
            <span @click='tabshow.xlzmshow = !tabshow.xlzmshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.xlzmshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.xlzmshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.xlzmshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.diplomafile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>
        <MOSTY.Assort :title="'其他相关附件'">
          <template #icon>
            <span @click='tabshow.qtfjshow = !tabshow.qtfjshow' class='zkbox'>
              <span class='bqfont'> {{ tabshow.qtfjshow ? '收起' : '展开' }}</span>
              <el-icon v-if='tabshow.qtfjshow' class='iconfont'>
                <CaretTop />
              </el-icon>
              <el-icon v-else class='iconfont'>
                <CaretBottom />
              </el-icon>
            </span>
          </template>
        </MOSTY.Assort>
        <div v-if='tabshow.qtfjshow'>
          <div style="margin: 10px">
            <MOSTY.Upload width="600px !important" :widthNumber="800" :limit="10" :nopicer="true" :isImg="false"
              :gsgfList="['pdf', 'ofd', 'doc', 'docx', 'xls', 'xlsx', 'wps']" :ShowfileList="true"
              v-model="fromObj.otherfile" :showinput="false" :disabled='!props.BtnShow'>
            </MOSTY.Upload>
          </div>
        </div>


      </template>
      <template #footer>
        <el-button style="margin-left: 10px" type="primary" @click="yjjsyFrom" v-if="props.title == '驾驶员信息修改'">
          <el-icon>
            <Switch />
          </el-icon>
          <span>移交驾驶员</span>
        </el-button>

        <el-button style="margin-left: 10px" type="primary" v-if="props.BtnShow" :loading="loading"
          @click="savaFrom(ruleFormRef)">
          <el-icon>
            <CirclePlus />
          </el-icon>
          <span>保存</span>
        </el-button>
        <el-button type="primary" @click="CloseEvent">
          <el-icon>
            <DocumentDelete />
          </el-icon>
          <span>关闭</span>
        </el-button>
      </template>
    </MOSTY.FromPage>
    <!-- 选择人员 -->
    <MOSTY.xgfandzzjgry v-model="chooseUserVisible" :Single="singleShow" :data="memberList" :stlyrylx='stlyrylx'
      :relatedid="null" :xgflx="'09,10,15'" @choosedUsers="getSonValue" @changerylx='changerylx' />
    <!-- <ChooseUser v-model="chooseUserVisible" :Single="singleShow" :data="memberList" :leaderid="leaderid"
      @choosedUsers="getSonValue"></ChooseUser> -->
    <Choosebm :showDdld="showDept" @closezzjg="closezzjg" @listdata="getSonValue" :zzlx="zzlx" />
    <!-- 人员移交-->
    <el-dialog v-model="showtjjsz" title="驾驶员所属部门变更" :before-close="closedio" width="40%">
      <div style="width: 100%;">
        <el-form class="mosty-from-wrap" ref="elform" label-width="130px" :model="deptfrom" :inline="true"
          :rules="rules" style="width: 100%;">
          <el-form-item label="移交单位名称:" prop="nameaffiliation" style="display: flex;width: 100%;">
            <el-input v-model="deptfrom.nameaffiliation" disabled clearable style="width: 250px" />
            <el-button @click="ChooesDdld('02')">选择</el-button>
          </el-form-item>
        </el-form>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="savebmyj">保存</el-button>
          <el-button @click="closedio">关闭</el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 编辑驾驶车辆 -->
    <el-dialog v-model="showjscl" title="驾驶员车辆修改" :before-close="closejscl" width="600px">
      <div class='jsclfrom'>
        <el-form class="mosty-from-wrap" ref="elforms" label-width="130px" :model="jsclfrom" :inline="true"
          :disabled='!saveclbtn'>
          <el-form-item label="车辆:" prop="carNumber" required :rules="[
            { required: true, message: '车辆不能为空', trigger: 'blur' }
          ]">
            <el-input v-model="jsclfrom.carNumber" disabled clearable />
          </el-form-item>
          <el-form-item label="开始日期:" prop="startDate" required :rules="[
            { required: true, message: '开始日期不能为空', trigger: 'blur' }
          ]">
            <el-date-picker v-model="jsclfrom.startDate" style="width:100%;" type="data" format="YYYY-MM-DD"
              value-format="YYYY-MM-DD">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="变动原因:">
            <el-input v-model="jsclfrom.reason" type="textarea" clearable maxlength="200" />
          </el-form-item>
        </el-form>
      </div>
      <template #footer>
        <span class="dialog-footer">

          <el-button @click="saveyscl(elforms)" v-if="saveclbtn">
            保存
          </el-button>
          <el-button @click="closejscl">
            关闭
          </el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 参加工作简历情况新增弹出框 -->
    <addcjgzjlqk v-if="addDiaShowjlqk" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShowjlqk" :title="jstitle"
      @changeAddVi="changeAddVi0" :rowxq="rowxq" @changeclose="addDiaShowjlqk = false">
    </addcjgzjlqk>
    <!-- 主要驾驶情况新增弹出框 -->
    <addzyjsqk v-if="addDiaShowzyjsqk" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShowzyjsqk" :title="jstitle"
      @changeAddVi="changeAddVi4" :rowxq="rowxq" @changeclose="addDiaShowzyjsqk = false">
    </addzyjsqk>
    <!-- 驾照审核记录 -->
    <addjzshjl v-if="addDiaShowjzshjl" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShowjzshjl" :title="jstitle"
      @changeAddVi="changeAddVi5" :rowxq="rowxq" @changeclose="addDiaShowjzshjl = false">
    </addjzshjl>

    <addsjldj v-if="addDiaShowsjldj" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShowsjldj" :title="jstitle"
      @changeAddVi="changeAddVi6" :rowxq="rowxq" @changeclose="addDiaShowsjldj = false">
    </addsjldj>
    <!-- 驾驶经历及证照登记新增弹出框 -->
    <Addjsjyzzdj v-if="addDiaShow" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShow" :title="jstitle"
      @changeAddVi="changeAddVi" :rowxq="rowxq" @changeclose="addDiaShow = false">
    </Addjsjyzzdj>
    <!-- 驾驶员家庭情况新增弹出框 -->
    <Addjsjjtqk v-if="addDiaShowjtqk" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShowjtqk" :title="jstitle"
      :zdlist="zdlists" @changeAddVi="changeAddVi3" :rowxq="rowxq" @changeclose="addDiaShowjtqk = false">
    </Addjsjjtqk>
    <!-- 机动车驾驶员调入、借用、聘用考核登记新增弹出框 -->
    <Addjdcjsydr v-if="addDiaShow1" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShow1" :title="jstitle"
      @changeAddVi="changeAddVi1" :rowxq="rowxq" @changeclose="addDiaShow1 = false">
    </Addjdcjsydr>
    <!-- 驾驶员肇事登记表新增弹出框 -->
    <Addjsyzsdjb v-if="addDiaShow2" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShow2" :title="jstitle"
      @changeAddVi="changeAddVi2" :rowxq="rowxq" @changeclose="addDiaShow2 = false">
    </Addjsyzsdjb>
    <!-- 驾驶员技能比武新增弹出框 -->
    <addjnbw v-if="addDiaShowjnbw" :saveBtnShow="saveBtnShow" :addDiaShow="addDiaShowjnbw" :title="jstitle"
      @changeAddVi="changeAddVi7" :zdlist="zdlists" :rowxq="rowxq" @changeclose="addDiaShowjnbw = false">
    </addjnbw>

  </div>
</template>

<script setup>
import { getImgUrl } from "@/utils/tools.js"
// 引入
import {
  reactive,
  onMounted,
  ref,
  watch,
  getCurrentInstance,
  defineProps,
  watchEffect
} from "vue";
import * as rule from "@/utils/rules.js";
import Addjsjyzzdj from "./addjsjyzzdj";
import addzyjsqk from "./addzyjsqk";
import addcjgzjlqk from "./addcjgzjlqk";
import addsjldj from "./addsjldj";
import addjnbw from "./addjnbw";
import addjzshjl from "./addjzshjl";
import Addjsjjtqk from "./addjsjjtqk";
import Addjdcjsydr from "./addjdcjsydr";
import Addjsyzsdjb from "./addjsyzsdjb";
import MaskIdcardInput from "@/components/MaskIdcardInput.vue"
import * as MOSTY from "@/components/MyComponents/index";
import { getDefaultDate, createAndClickLink, disablednowDate } from '@/utils/tools.js'
import Choosebm from "@/components/MyComponents/ChooseDept/index.vue";
import ChooseUser from "@/components/MyComponents/ChooseUser/Leader.vue";
import { getApi, postApi, putApi } from "@/api/tobAcco_api.js";
import { ElMessage } from "element-plus";
//规则校验
const getDefaultDates = ref(getDefaultDate())
const rules = reactive({
  drivername: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
  initgetlicensedate: [{ required: true, message: "初次领证时间不能为空", trigger: "blur" }],
  sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
  birth: [{ trigger: "blur", required: true, message: "出生年月不能为空" }],
  driverfileno: [{ required: true, message: "驾驶档案号不能为空", trigger: "blur" }],
  ...rule.identityCardRule({ require: true, validator: true }, "idcard"),
  ...rule.identityCardRule({ require: true, validator: true, text: '驾驶证号' }, "drivenumber"),
  ...rule.numbernineRule({ validator: true, require: false, iszs: true, firstNum: 7, lastNum: 4 }, "safedistance"),
  ...rule.numberzzsRule({ validator: true, require: false, num: 90 }, "driveage"),
  driveLevelArray: [
    {
      required: true,
      message: "准驾车型不能为空",
      trigger: ["change", "blur"],
      validator: (rule, value, callback) => {
        if (!value || value.length === 0) {
          callback(new Error("准驾车型不能为空"));
        } else {
          callback();
        }
      }
    }
  ],
  empnature: [
    { required: true, message: "正式或聘用职工不能为空", trigger: "blur" }
  ],
  drivertype: [{ required: true, message: "专职驾驶员类别不能为空", trigger: "blur" }
  ],
  driverState: [{ required: true, message: "驾驶员状态不能为空", trigger: "blur" }
  ],
});
const stlyrylx = ref('01')
const addDiaShowjlqk = ref(false)
const addDiaShowjnbw = ref(false)
const addDiaShowzyjsqk = ref(false)
const addDiaShowsjldj = ref(false)
const saveclbtn = ref(true)
const jsclfromtitle = ref('驾驶员车辆修改')
const loading = ref(false); //新增保存按钮截流
const jsclfrom = ref({})
const props = defineProps({
  BtnShow: {
    default: true,
    type: Boolean
  },
  obj: {
    default: null,
    type: Object
  },
  title: String,
  zdlist: {
    default: [],
    type: Array
  }
});
const { proxy } = getCurrentInstance();
// 数据
const {
  D_BZ_AQRYWHCD,
  D_BZ_AQRYZZMM,
  D_BZ_MZ,
  D_TB_HEALTH,
  D_JSYZT,
  D_TB_DRIVERTYPE,
  D_TB_ARTTLHTVT,
  D_TB_AES,
  D_TB_IMPACT,
  D_BZ_AWARDS_TYPE,
  D_TB_GETLEVEL,
  D_TB_MEDICALTYPE,
  D_TB_EMPNATURE
} = proxy.$dict(
  "D_BZ_AQRYWHCD",
  "D_BZ_AQRYZZMM",
  "D_BZ_MZ",
  "D_TB_HEALTH",
  "D_JSYZT",
  "D_TB_DRIVERTYPE",
  "D_TB_ARTTLHTVT",
  "D_TB_AES",
  "D_TB_IMPACT",
  "D_BZ_AWARDS_TYPE",
  "D_TB_GETLEVEL",
  "D_TB_MEDICALTYPE",
  "D_BZ_SF",
  "D_TB_EMPNATURE"
);
const zdlists = ref({ D_TB_IMPACT, D_BZ_AQRYZZMM, D_BZ_AQRYWHCD })
const fromObj = ref({
  tbDriverWadcList: [], //参加工作简历情况
  tbDriverSituatiList: [], //主要驾驶情况表
  tbDriverLarList: [], //驾照审核记录表
  tbDriverMdeatlrfList: [], //驾驶经历及证照登记
  tbDriverTeerfList: [], //机动车驾驶员调入、借用、聘用考核登记
  tbDriverDwrrfList: [], // 驾驶员受奖励登记
  tbDriverRfohardList: [], //驾驶员肇事登记表
  tbDriverDftList: [], //驾驶员家庭情况表
  tbDriverSkillAwardsList: [] //驾驶员技能比武
});
const tabshow = ref({
  bjzshow: true,
  jsclshow: true,
  cjgzshow: true,
  zyjsshow: true,
  jzshshow: true,
  jsyjshow: true,
  khdjshow: true,
  sjdjshow: true,
  zsdjshow: true,
  jtqkshow: true,
  jnbwshow: true,
  sfzfyshow: true,
  khyjshow: true,
  jjglshow: true,
  wgwfshow: true,
  jdcjsshow: true,
  jdcjsfshow: true,
  jldjfshow: true,
  zysgshow: true,
  cdzmshow: true,
  sgzblshow: true,
  zjzblshow: true,
  kszlshow: true,
  lkkszlshow: true,
  jszshow: true,
  sfzshow: true,
  jkzmshow: true,
  swzdshow: true,
  aqxcshow: true,
  xlzmshow: true,
  qtfjshow: true,
})

const showjscl = ref(false);
//驾驶经历及证照登记新增
const saveBtnShow = ref(true);
const addDiaShow = ref(false);
const addDiaShowjtqk = ref(false);
const addDiaShowjzshjl = ref(false);
const jstitle = ref("");
const keysid = ref(0);
const keysid3 = ref(0);
const keysid0 = ref(0);
const keysid4 = ref(0);
const keysid5 = ref(0);
const keysid6 = ref(0);
const keysid7 = ref(0);
const rowxq = ref(null);
const editIndex = ref(null);
//机动车驾驶员调入、借用、聘用考核登记新增
const addDiaShow1 = ref(false);
const keysid1 = ref(0);
//驾驶员肇事登记表新增
const addDiaShow2 = ref(false);
const elforms = ref()
const keysid2 = ref(0);
const showxg = ref(false);
const xqbtnShow = ref(false); //详情展示内容
const showDept = ref(false); //选择部门
const tableData3 = ref([]);
const currentRow = ref(); //选中的表格数据
const chooseUserVisible = ref(false); //选择人员弹窗
const singleShow = ref(true); //单选多选
const leaderid = ref("");
const activeNames = ref(1);
const padedata = reactive({
  tableColumns: [{
    title: "车辆",
    prop: "carNumber"
  },
  {
    title: "开始时间",
    prop: "startDate"
  },
  {
    title: "变动原因",
    prop: "reason"
  },
  {
    title: "操作",
    prop: "actions",
    slot: true
  }],
  tableColumns1: [{
    title: "参加工作起始日期",
    prop: "begindate"
  },
  {
    title: "参加工作结束日期",
    prop: "enddate"
  },
  {
    title: "所在单位",
    prop: "location"
  },
  {
    title: "干何工作",
    prop: "work"
  },
  {
    title: "证明人",
    prop: "certifier"
  },
  {
    title: "操作",
    prop: "actions",
    slot: true
  }],
  tableColumns2: [
    {
      title: "驾驶起始日期",
      prop: "begindate"
    },
    {
      title: "驾驶结束日期",
      prop: "enddate"
    },
    {
      title: "所在单位",
      prop: "location"
    },
    {
      title: "驾驶车种",
      prop: "cartype"
    },
    {
      title: "里程数(万公里)",
      prop: "mileagerate"
    },
    {
      title: "操作",
      prop: "actions",
      slot: true
    }
  ],
  tableColumns3: [
    {
      title: "审核时间",
      prop: "licenseauditdate"
    },
    {
      title: "审核内容",
      prop: "approvetext"
    },
    {
      title: "证件有效日期(起)",
      prop: "notbefore"
    },
    {
      title: "证件有效日期(止)",
      prop: "notafter"
    },
    {
      title: "操作",
      prop: "actions",
      slot: true
    }
  ],
  tableColumns4: [
    {
      title: "授奖时间",
      prop: "awardstime"
    },
    {
      title: "经办单位",
      prop: "dtp"
    },
    {
      title: "批准机关",
      prop: "approvalauthority"
    },
    {
      title: "受何奖励",
      prop: "aotpracotcid"
    },
    {
      title: "操作",
      prop: "actions",
      slot: true
    }
  ],
  tableColumns5: [
    {
      title: "经办单位",
      prop: "jname"
    },
    {
      title: "关系",
      prop: "impact",
      slot: true
    },
    {
      title: "年龄",
      prop: "jage"
    },
    {
      title: "文化程度",
      prop: "jleducation",
      slot: true
    },
    {
      title: "职业情况",
      prop: "professionalsttus"
    },
    {
      title: "操作",
      prop: "actions",
      slot: true
    }
  ],
  tableColumns6: [
    {
      title: "获奖年度",
      prop: "getyear"
    },
    {
      title: "获奖方式",
      prop: "awardstype",
      slot: true
    },
    {
      title: "等级",
      prop: "getlevel",
      slot: true
    },
    {
      title: "操作",
      prop: "actions",
      slot: true
    }
  ],
  tableColumns12: [
    {
      title: "学习驾驶学校",
      prop: "drivingschool"
    },
    {
      title: "学习驾驶所在单位",
      prop: "drivingunit"
    },
    {
      title: "正式驾驶所在单位",
      prop: "fulldrivingunit"
    },
    {
      title: "增驾所在单位",
      prop: "idu"
    },
    {
      title: "操作",
      prop: "actions",
      slot: true
    }
  ],
  tableColumns13: [{
    title: "现准备调、借、聘用准驾车型",
    prop: "arttlhtvt",
    slot: true
  },
  {
    title: "驾驶证有效期",
    prop: "lvp"
  },
  {
    title: "专职驾驶工作",
    prop: "ftdj"
  },
  {
    title: "考试科目",
    prop: "aes",
    slot: true
  },
  {
    title: "操作",
    prop: "actions",
    slot: true
  }],
  tableColumns14: [
    {
      title: "事故时间",
      prop: "accidenttime"
    },
    {
      title: "事故类别",
      prop: "accidenttype"
    },
    {
      title: "肇事地点",
      prop: "incidentsite"
    },
    {
      title: "事故简要经过",
      prop: "taba"
    },
    {
      title: "操作",
      prop: "actions",
      slot: true
    }
  ]
})
watchEffect(() => {
  if (props.title == "驾驶员信息详情") {
    showxg.value = true;
  }
  if (props.obj) {
    fromObj.value = props.obj;
    fromObj.value.driveLevelArray = fromObj.value.drivelevel.split(',')
    xqbtnShow.value = true;
    getdata(fromObj.value.id);
  }
  zdlists.value.D_BZ_XB = props.zdlist.D_BZ_XB
});

const deptfrom = ref({});
const zzlx = ref();
const emits = defineEmits(["close"]);
const showtjjsz = ref(false);
const sjqx = reactive({
  begindate: '',
  begindate1: '',
  begindate2: ''
});
onMounted(() => {
  activeNames.value = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
});

// 校验是否 符合规则
function disabledDate(time) {
  return time.getTime() + 24 * 60 * 60 * 1000 < new Date(sjqx.begindate).getTime() || time.getTime() + 24 * 60 * 60 * 1000 > Date.now()
}

//获取人员类型
function changerylx(val) {
  stlyrylx.value = val
}
//获取表格接口数据
function getdata(id) {
  getApi({ id }, '/mosty-jcgl/driverposts/queryDriverpostsByUserid').then(res => {
    if (res) {
      fromObj.value.idnumber = res.idnumber
    }
  })
  //查看 驾驶员对应的车辆信息
  getApi({ driverId: id }, '/mosty-jcgl/driver/getCarRelevancePage').then((res) => {
    if (res.records) {
      tableData3.value = res.records.filter(item => {
        return item.xtScbz == '0'

      })
    } else {
      tableData3.value = []
    }
  })
  //获取参加工作简历情况
  getApi({ id: id }, "/mosty-jcgl/driverWadc/queryDriverWadcById").then(
    (res) => {
      fromObj.value.tbDriverWadcList = res ? res : [];
    }
  );
  //主要驾驶情况
  getApi({ id: id }, "/mosty-jcgl/driverSituati/queryDriverSituatiById").then(
    (res) => {
      fromObj.value.tbDriverSituatiList = res ? res : [];
    }
  );
  //驾照审核记录
  getApi({ id: id }, `/mosty-jcgl/driverLar/queryDriverLarById`).then((res) => {
    fromObj.value.tbDriverLarList = res ? res : [];
  });
  //驾驶经历及证照登记
  getApi({ id: id }, `/mosty-jcgl/DriverMdeatlrf/queryDriverMdeatlrfById`).then(
    (res) => {
      if (res && props.BtnShow) {
        res.forEach((item) => {
          item.del = false;
        });
      }
      fromObj.value.tbDriverMdeatlrfList = res ? res : [];
    }
  );
  //机动车驾驶员调入、借用、聘用考核登记
  getApi({ id: id }, `/mosty-jcgl/driverTeerf/queryDriverTeerfById`).then(
    (res) => {
      if (res && props.BtnShow) {
        res.forEach((item) => {
          item.del = false;
        });
      }
      fromObj.value.tbDriverTeerfList = res ? res : [];
    }
  );
  //驾驶员受奖励登记
  getApi({ id: id }, `/mosty-jcgl/driverDwrrf/queryDriverDwrrfById`).then(
    (res) => {
      fromObj.value.tbDriverDwrrfList = res ? res : [];
    }
  );
  //驾驶员肇事登记
  getApi({ id: id }, `/mosty-jcgl/driverRfohard/queryDriverRfohardById`).then(
    (res) => {
      if (res && props.BtnShow) {
        res.forEach((item) => {
          item.del = false;
        });
      }
      fromObj.value.tbDriverRfohardList = res ? res : [];
    }
  );
  //驾驶员家庭情况表
  getApi({ id: id }, `/mosty-jcgl/driverDft/queryDriverDftById`).then((res) => {
    fromObj.value.tbDriverDftList = res ? res : [];
  });
  //驾驶员技能比武
  getApi({ id: id }, `/mosty-jcgl/driverSkillAwards/queryDriverSkillAwardsById`).then(
    (res) => {
      fromObj.value.tbDriverSkillAwardsList = res ? res : [];
    }
  );
}
//修改驾驶车辆
function bjclxx(row) {
  jsclfromtitle.value = '驾驶员车辆修改'
  saveclbtn.value = true
  jsclfrom.value = row
  showjscl.value = true
}
//查看驾驶车辆
function bjclck(row) {
  jsclfromtitle.value = '驾驶员车辆详情'
  saveclbtn.value = false
  jsclfrom.value = row
  showjscl.value = true
}
function closejscl() {
  if (saveclbtn.value) {
    proxy.$modal.confirm('离开会丢失页面中修改的内容，确认离开吗？')
      .then(() => {
        showjscl.value = false
      })
      .catch(() => {
        // catch error
      })
  } else {
    showjscl.value = false
  }

}

const saveyscl = async (formEl) => {
  if (!formEl) return
  await formEl.validate((valid, fields) => {
    if (valid) {
      postApi(jsclfrom.value, '/mosty-jcgl/carRelevance/updateCarRelevanceOne').then((res) => {
        showjscl.value = false;
        ElMessage.success("修改成功");
      })
    } else {
      ElMessage.warning('请输入必填项！！！')
    }
  })
}
//关闭弹窗
const closezzjg = (val) => {
  showDept.value = val;
};

function closedio() {
  proxy.$modal.confirm('离开会丢失页面中修改的内容，确认离开吗？')
    .then(() => {
      showtjjsz.value = false;
    })
    .catch(() => {
      // catch error
    })

}
function savebmyj() {
  if (deptfrom.value && deptfrom.value.nameaffiliation) {
    postApi(deptfrom.value, "/mosty-jcgl/driver/ChangeDriverOrg").then(
      (res) => {
        showtjjsz.value = false;
        emits("close");
        ElMessage.success("移交成功");
      }
    );
  } else {
    ElMessage.warning("请选择移交单位");
  }
}



function ChooesDdld(val) {
  zzlx.value = val;
  //选择检查成员
  if (val == "01") {
    leaderid.value = "";
    singleShow.value = true;
    chooseUserVisible.value = true;
  } else {
    showDept.value = true;
  }
}
const getSonValue = (value) => {
  console.log(value, 'value')
  // 驾驶员姓名
  if (zzlx.value == "01") {
    fromObj.value.drivername = value[0].userName;
    fromObj.value.driveruserid = value[0].id;
    fromObj.value.orgid = stlyrylx.value == '01' ? value[0].ssdwid : value[0].orgid;
    fromObj.value.orgname = stlyrylx.value == '01' ? value[0].ssdwmc : value[0].orgname;
    fromObj.value.deptcode = stlyrylx.value == '01' ? value[0].deptid || value[0].deptId : value[0].belongDeptId;
    fromObj.value.deptname = stlyrylx.value == '01' ? value[0].deptname || value[0].deptName : value[0].belongDeptName;
    getdreardata(fromObj.value.driveruserid);
    getsgz(fromObj.value.driveruserid)
  }
  // 移交单位
  if (zzlx.value == "02") {
    deptfrom.value.nameaffiliation = value.orgName;
    deptfrom.value.nameaffiliationid = value.id;
  }
};
const getSex = (sfz) => {
  if (sfz.length !== 18) return ''
  const genderCode = parseInt(sfz.charAt(16), 10);
  // return genderCode % 2 === 1 ? '男' : '女';
  return genderCode % 2 === 1 ? '1' : '2';
}
const getBirth = (sfz) => {
  if (sfz?.length !== 18) return ''
  const birthYear = sfz.substring(6, 10);
  const birthMonth = sfz.substring(10, 12);
  const birthDay = sfz.substring(12, 14);
  return `${birthYear}-${birthMonth}-${birthDay}`;
}
//获取驾驶员驾驶信息
function getdreardata(id) {
  if (stlyrylx.value == '01') {
    getApi({}, `/mosty-base/sysUser/getUserInfo/${id}`).then((res) => {
      fromObj.value.sex = res.sex ? res.sex : getSex(res?.idEntityCard);
      if (!['1', '2'].includes(fromObj.value.sex)) fromObj.value.sex = ''
      fromObj.value.birth = res.birthday ? res.birthday : getBirth(res?.idEntityCard);
      fromObj.value.idcard = res.idEntityCard;
      fromObj.value.drivenumber = res.idEntityCard;
      fromObj.value.empnature = '1'
    });
  } else {
    getApi({ id }, `/mosty-jcgl/relatedUser/getInfo`).then((res) => {
      fromObj.value.sex = res.sex ? res.sex : getSex(res?.idEntityCard);
      if (!['1', '2'].includes(fromObj.value.sex)) fromObj.value.sex = ''
      fromObj.value.birth = res.birthday ? res.birthday : getBirth(res?.idEntityCard);
      fromObj.value.idcard = res.idEntityCard;
      fromObj.value.drivenumber = res.idEntityCard;
      fromObj.value.relatedname = res.relatedname
      fromObj.value.empnature = '3'
    });
  }

}
//根据用户id查询证号
function getsgz(userid) {
  getApi({ userid }, '/mosty-jcgl/driverposts/queryDriByUserid').then(res => {
    if (res) {
      if (res.zjz) {
        fromObj.value.cdfiid = res.zjz
      } else if (res.sgz) {
        fromObj.value.cdfiid = res.sgz
      }

    }

  })
}
/** 身份证变化时,触发自动获取[性别]和[生日] */
const identCardChange = (val) => {
  fromObj.value.sex = getSex(val);
  fromObj.value.birth = getBirth(val);
}
// 解决未申明警告
function identityCardChange() { }


//打开新增表单
function addDialog(val) {
  saveBtnShow.value = true;
  rowxq.value = {};
  switch (val) {
    case '01':
      jstitle.value = "参加工作简历情况新增";
      addDiaShowjlqk.value = true
      break;
    case '02':
      jstitle.value = "主要驾驶情况新增";
      addDiaShowzyjsqk.value = true
      break;
    case '03':
      jstitle.value = "驾照审核记录新增";
      addDiaShowjzshjl.value = true
      break;
    case '04':
      jstitle.value = "驾驶经历及证照登记新增";
      addDiaShow.value = true
      break;
    case '05':
      jstitle.value = "机动车驾驶员调入、借用、聘用考核登记新增";
      addDiaShow1.value = true
      break;
    case '06':
      jstitle.value = "驾驶员受奖励登记新增";
      addDiaShowsjldj.value = true
      break;
    case '07':
      jstitle.value = "驾驶员肇事登记表新增";
      addDiaShow2.value = true
      break;
    case '08':
      jstitle.value = "驾驶员家庭情况新增";
      addDiaShowjtqk.value = true
      break;
    case '09':
      jstitle.value = "驾驶员技能比武新增";
      addDiaShowjnbw.value = true
      break;
    default:
      break;
  }
}
//打开修改弹窗
function editDialog(row, val, index) {
  editIndex.value = index;
  saveBtnShow.value = true;
  rowxq.value = row;
  switch (val) {
    case '01':
      jstitle.value = "参加工作简历情况修改";
      addDiaShowjlqk.value = true
      break;
    case '02':
      jstitle.value = "主要驾驶情况修改";
      addDiaShowzyjsqk.value = true
      break;
    case '03':
      jstitle.value = "驾照审核记录修改";
      addDiaShowjzshjl.value = true
      break;
    case '04':
      jstitle.value = "驾驶经历及证照登记修改";
      addDiaShow.value = true
      break;
    case '05':
      jstitle.value = "机动车驾驶员调入、借用、聘用考核登记修改";
      addDiaShow1.value = true
      break;
    case '06':
      jstitle.value = "驾驶员受奖励登记修改";
      addDiaShowsjldj.value = true
      break;
    case '07':
      jstitle.value = "驾驶员肇事登记表修改";
      addDiaShow2.value = true
      break;
    case '08':
      jstitle.value = "驾驶员家庭情况修改";
      addDiaShowjtqk.value = true
      break;
    case '09':
      jstitle.value = "驾驶员技能比武修改";
      addDiaShowjnbw.value = true
      break;
    default:
      break;
  }
}
//打开详情弹窗
function seeDialog(row, val) {
  saveBtnShow.value = false;
  rowxq.value = row;
  switch (val) {
    case '01':
      jstitle.value = "参加工作简历情况详情";
      addDiaShowjlqk.value = true
      break;
    case '02':
      jstitle.value = "主要驾驶情况详情";
      addDiaShowzyjsqk.value = true
      break;
    case '03':
      jstitle.value = "驾照审核记录详情";
      addDiaShowjzshjl.value = true
      break;
    case '04':
      jstitle.value = "驾驶经历及证照登记详情";
      addDiaShow.value = true
      break;
    case '05':
      jstitle.value = "机动车驾驶员调入、借用、聘用考核登记详情";
      addDiaShow1.value = true
      break;
    case '06':
      jstitle.value = "驾驶员受奖励登记详情";
      addDiaShowsjldj.value = true
      break;
    case '07':
      jstitle.value = "驾驶员肇事登记表详情";
      addDiaShow2.value = true
      break;
    case '08':
      jstitle.value = "驾驶员家庭情况详情";
      addDiaShowjtqk.value = true
      break;
    case '09':
      jstitle.value = "驾驶员技能比武详情";
      addDiaShowjnbw.value = true
      break;
    default:
      break;
  }
}

//获取驾驶员家庭情况数据
function changeAddVi3(row) {
  getxzData(row, keysid3.value, fromObj.value.tbDriverDftList);
}
// 参加工作简历情况
function changeAddVi0(row) {
  getxzData(row, keysid0.value, fromObj.value.tbDriverWadcList);
}
// 主要驾驶情况
function changeAddVi4(row) {
  getxzData(row, keysid4.value, fromObj.value.tbDriverSituatiList);
}
// 驾照审核记录
function changeAddVi5(row) {
  getxzData(row, keysid5.value, fromObj.value.tbDriverLarList);
}
// 驾驶员受奖励登记
function changeAddVi6(row) {
  getxzData(row, keysid6.value, fromObj.value.tbDriverDwrrfList);
}
//获取驾驶经历及证照登记新增数据
function changeAddVi(row) {
  getxzData(row, keysid.value, fromObj.value.tbDriverMdeatlrfList);
}
//获取驾驶员肇事登记表新增数据
function changeAddVi2(row) {
  getxzData(row, keysid2.value, fromObj.value.tbDriverRfohardList);
}

//获取机动车驾驶员调入、借用、聘用考核登记新增数据
function changeAddVi1(row) {
  getxzData(row, keysid1.value, fromObj.value.tbDriverTeerfList);
}
function changeAddVi7(row) {
  getxzData(row, keysid7.value, fromObj.value.tbDriverSkillAwardsList);
}

//移交人员
function yjjsyFrom() {
  showtjjsz.value = true;
  deptfrom.value.id = fromObj.value.id;
}

const CloseEvent = () => {
  if (props.BtnShow) {
    proxy.$modal.confirm('离开会丢失页面中修改的内容，确认离开吗？')
      .then(() => {
        // 关闭上一次的表单校验
        ruleFormRef.value.clearValidate();
        emits("close");
      })
      .catch(() => {
        // catch error
      })
  } else {
    // 关闭上一次的表单校验
    ruleFormRef.value.clearValidate();
    emits("close");
  }

};



//点击下载文件
function onloadflie(val) {
  createAndClickLink(val.url, val.name)
}
//封装选中当前行
function hangdleRow(arr, val) {
  currentRow.value = val;
  if (props.BtnShow) {
    arr.forEach((el) => {
      if (el == val) {
        el.input = true;
      } else {
        el.input = false;
      }
    });
  }

}
//删除当前行
function delRow(arr, row) {
  arr.forEach((item, index) => {
    if (row == item) {
      arr.splice(index, 1);
      ElMessage.success("删除成功");
    }
  });
}
//保存当前行
function saveRow(arr) {
  arr.forEach((el) => {
    el.input = false;
  });
}
// if (value.trim() == null || value == null || value == '') { alert('输入的值为空'); return; }
//判断对象是否存在空字符串(传入一个对象，如果对象中存在空字符串，函数会返回 true，否则返回 false)
function hasString(obj) {
  for (const key in obj) {
    if (typeof obj[key] == "string" && obj[key].trim() == "") {
      ElMessage.warning("请将内容填完整！！！");
      return true;
    }
  }
  return false;
}
//新增行
function addRow(tab, arr) {
  if (arr.length) {
    let legths = arr.length - 1;
    let data = arr[legths];
    if (hasString(data) == false) {
      arr.push(tab);
    }
  } else {
    arr.push(tab);
  }
}
//获取新增数据
function getxzData(row, key, arr) {
  row.del = false;
  if (!row.idex) {
    key++;
    row.idex = key;
  }
  if (editIndex.value != null) {
    for (let i = 0; i < arr.length; i++) {
      if (editIndex.value == i) {
        arr[i] = row
      }
    }
  } else {
    arr.push(row);
    ElMessage.success("新增成功");
  }
}
const ruleFormRef = ref();
//保存驾驶员表单信息
const savaFrom = async (ruleFormRef) => {
  if (!ruleFormRef) return;
  await ruleFormRef.validate((valid) => {
    if (valid) {
      if (fromObj.value) {
        loading.value = true;
        fromObj.value.picture = fromObj.value.picture
          ? fromObj.value.picture.toString()
          : null;
        fromObj.value.idcardfile = fromObj.value.idcardfile
          ? fromObj.value.idcardfile.toString()
          : null;
        fromObj.value.examinefile = fromObj.value.examinefile
          ? fromObj.value.examinefile.toString()
          : null;
        fromObj.value.taboofile = fromObj.value.taboofile
          ? fromObj.value.taboofile.toString()
          : null;
        fromObj.value.regulationfile = fromObj.value.regulationfile
          ? fromObj.value.regulationfile.toString()
          : null;
        fromObj.value.drivinglicencefile = fromObj.value.drivinglicencefile
          ? fromObj.value.drivinglicencefile.toString()
          : null;
        fromObj.value.drivinglicenceReverseflie = fromObj.value
          .drivinglicenceReverseflie
          ? fromObj.value.drivinglicenceReverseflie.toString()
          : null;
        fromObj.value.rewardfile = fromObj.value.rewardfile
          ? fromObj.value.rewardfile.toString()
          : null;
        fromObj.value.industryfile = fromObj.value.industryfile
          ? fromObj.value.industryfile.toString()
          : null;
        fromObj.value.fleetfile = fromObj.value.fleetfile
          ? fromObj.value.fleetfile.toString()
          : null;
        fromObj.value.certificationfile = fromObj.value.certificationfile
          ? fromObj.value.certificationfile.toString()
          : null;
        fromObj.value.drivingpermitfile = fromObj.value.drivingpermitfile
          ? fromObj.value.drivingpermitfile.toString()
          : null;
        fromObj.value.examinationfile = fromObj.value.examinationfile
          ? fromObj.value.examinationfile.toString()
          : null;
        fromObj.value.roadtestfile = fromObj.value.roadtestfile
          ? fromObj.value.roadtestfile.toString()
          : null;

        fromObj.value.driverslicensefile = fromObj.value.driverslicensefile
          ? fromObj.value.driverslicensefile.toString()
          : null;
        fromObj.value.idcardsfile = fromObj.value.idcardsfile
          ? fromObj.value.idcardsfile.toString()
          : null;
        fromObj.value.zyjjztj = fromObj.value.zyjjztj
          ? fromObj.value.zyjjztj.toString()
          : null;
        fromObj.value.healthfile = fromObj.value.healthfile
          ? fromObj.value.healthfile.toString()
          : null;
        fromObj.value.certificatefile = fromObj.value.certificatefile
          ? fromObj.value.certificatefile.toString()
          : null;
        fromObj.value.drivingkilometersfile = fromObj.value
          .drivingkilometersfile
          ? fromObj.value.drivingkilometersfile.toString()
          : null;
        fromObj.value.diplomafile = fromObj.value.diplomafile
          ? fromObj.value.diplomafile.toString()
          : null;
        fromObj.value.otherfile = fromObj.value.otherfile
          ? fromObj.value.otherfile.toString()
          : null;
        fromObj.value.drivelevel = fromObj.value.driveLevelArray.join(',');
        if (props.title == "驾驶员信息新增") {
          postApi(fromObj.value, "/mosty-jcgl/driver/addDriverOne").then(
            (res) => {
              ElMessage.success("新增成功");
              emits("close");
            }
          ).finally(() => {
            loading.value = false;
          });
        } else {
          postApi(fromObj.value, "/mosty-jcgl/driver/updateDriverOne").then(
            (res) => {
              ElMessage.success("修改成功");
              emits("close");
              loading.value = false;
            }
          ).finally(() => {
            loading.value = false;
          });
        }
      }
    } else {
      ElMessage.warning("请检查表单!");
    }
  });
};
</script>

<style lang="scss" scoped>
.iconfont {
  font-size: 26px;
  color: var(--el-color-primary)
}

.bqfont {
  color: var(--el-color-primary)
}

.zkbox {
  display: flex;
  align-items: center;
  margin-left: 10px;
}

.el-table td.el-table__cell div span {
  margin-top: 0px !important;
}

::v-deep .el-collapse {
  width: 100% !important;
}

.box_cont {
  height: calc(100vh - 25vh);
  overflow-y: scroll;
  margin: 0 auto;
}



.el-collapse {
  width: 100% !important;
}

.fromBox {
  margin: 20px;
}

.flx-box {
  display: flex;
  justify-content: space-between;
}

.jsclfrom {
  .el-form-item {
    width: 100%;
    text-align: center;
  }
}

.el-form {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.el-form-item {
  width: 30%;
  text-align: center;
}

.right-item {
  width: 66%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;

  .el-form-item {
    width: 45.5%;
    text-align: center;
  }
}

.bigBox {
  display: block !important;
  box-sizing: border-box;
}

.tabBoxs {
  height: 80vh;
}

.tabBox {
  margin-bottom: 10px;
  // min-height: 10vh;
  // max-height: 40vh;
  // border-left: 0 !important;
  // overflow-y: scroll;

  // .el-table {
  //   height: 91%;
  // }

  // .fenye {
  //   top: 95%;
  // }
}

.addbtn {
  margin-bottom: 10px;
}

::v-deep .el-form-item--default .el-form-item__content {
  color: #000 !important;
}

::v-deep .el-input-number__decrease {
  display: none !important;
}

::v-deep .el-input-number__increase {
  display: none !important;
}
</style>
