You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1767 lines
52 KiB

<template>
<div class="app-container">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button
type="primary"
size="small"
:disabled="submitdisabled"
@click="dialogStatus === 'add' ? saveAdd() : saveEdit()"
>保存
</el-button>
<el-button
type="primary"
size="small"
@click="dialogStatus === 'create' ? saveAdd() : saveEdit()"
>提交
</el-button>
<el-button type="primary" size="small">打印</el-button>
<el-button
type="info"
size="small"
@click="handleReturn()"
>返回
</el-button>
</div>
<!--end 添加修改按钮-->
<!--end 详情按钮-->
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<el-form
ref="dataForm"
:model="temp"
label-position="right"
class="formadd"
:rules="rules"
>
<div
class="title"
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div>客户基础信息</div>
</div>
<el-container>
<el-main>
<el-row>
<el-col :span="4">
<span><span class="icon">*</span>工号</span>
</el-col>
<el-col :span="20">
<el-form-item prop="jobNumber">
<el-input
v-model="temp.jobNumber"
maxlength="20"
placeholder="系统自动生成"
class="addinputw"
clearable
readonly
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<span><span class="icon">*</span>姓名</span>
</el-col>
<el-col :span="20">
<el-form-item prop="name">
<el-input
v-model="temp.name"
maxlength="20"
placeholder="请输入姓名"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<span><span class="icon">*</span>性别</span>
</el-col>
<el-col :span="20">
<el-form-item prop="gender">
<el-radio v-model="temp.gender" label="男"></el-radio>
<el-radio v-model="temp.gender" label="女"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<span><span class="icon">*</span>身份证</span>
</el-col>
<el-col :span="20">
<el-form-item prop="idNo">
<el-input
v-model="temp.idNo"
maxlength="20"
placeholder="请输入身份证号"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<span><span class="icon">*</span>证件有效期</span>
</el-col>
<el-col :span="20">
<el-form-item prop="idTerm">
<el-date-picker
v-model="temp.idTerm"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<span><span class="icon">*</span>出生年月日</span>
</el-col>
<el-col :span="20">
<el-form-item prop="birthday">
<el-date-picker
v-model="temp.birthday"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<span><span class="icon">*</span>民族</span>
</el-col>
<el-col :span="20">
<el-form-item prop="national">
<el-select
v-model="temp.national"
class="addinputw"
placeholder="请选择民族"
@change="getNational"
>
<el-option
v-for="(item, index) in national_list"
:key="index.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-main>
<el-aside width="410px">
<!--头像上传-->
<upload-head
ref="uploadImg"
v-model="photo_list"
:limit="1"
bucket="map"
:upload-data="{ type: '0001' }"
/>
</el-aside>
</el-container>
<el-row>
<el-col :span="3">
<span>籍贯</span>
</el-col>
<el-col :span="21" class="jiguan">
<el-form-item prop="">
<el-select
v-model="temp.province"
filterable
placeholder="请选择省"
class="filter-item"
style="width: 168px"
@change="getShen"
>
<el-option
v-for="item in inputProvinceList"
:key="item.sid"
:label="item.name"
:value="item.sid"
/>
</el-select>
<el-select
v-model="temp.city"
filterable
placeholder="请选择市"
class="filter-item"
style="width: 168px"
@change="getShi"
>
<el-option
v-for="item in inputCityList"
:key="item.sid"
:label="item.name"
:value="item.sid"
/>
</el-select>
<el-select
v-model="temp.county"
filterable
placeholder="请选择县"
class="filter-item"
style="width: 168px"
@change="getQu"
>
<el-option
v-for="item in inputCountyList"
:key="item.sid"
:label="item.name"
:value="item.sid"
/>
</el-select>
<el-input
v-model="temp.nativePlace"
maxlength="20"
placeholder="请输入详细地址"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>住址</span>
</el-col>
<el-col :span="21">
<el-form-item prop="address">
<el-input
v-model="temp.address"
maxlength="20"
placeholder="请输入住址"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span><span class="icon">*</span>手机号码</span>
</el-col>
<el-col :span="9">
<el-form-item prop="mobile">
<el-input
v-model="temp.mobile"
maxlength="20"
placeholder="请输入手机号码"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>邮箱</span>
</el-col>
<el-col :span="9">
<el-form-item prop="email">
<el-input
v-model="temp.email"
maxlength="20"
placeholder="请输入邮箱"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>紧急联系人</span>
</el-col>
<el-col :span="9">
<el-form-item prop="emergencyContact">
<el-input
v-model="temp.emergencyContact"
maxlength="20"
placeholder="请输入紧急联系人"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>紧急联系电话</span>
</el-col>
<el-col :span="9">
<el-form-item prop="emergencyMobile">
<el-input
v-model="temp.emergencyMobile"
maxlength="20"
placeholder="请输入紧急联系电话"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>政治面貌</span>
</el-col>
<el-col :span="9">
<el-form-item prop="poliCode">
<el-select
v-model="temp.poliCode"
class="addinputw"
placeholder="请选择政治面貌"
@change="getPoliCode"
>
<el-option
v-for="(item, index) in political_list"
:key="index.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<span>婚姻状况</span>
</el-col>
<el-col :span="9">
<el-form-item prop="maritalStatus">
<el-select
v-model="temp.maritalStatus"
class="addinputw"
placeholder="请选择婚姻状况"
@change="getMari"
>
<el-option
v-for="(item, index) in maritalstatus_list"
:key="index.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div
class="title"
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div>更多信息</div>
</div>
<el-row>
<el-col :span="3">
<span><span class="icon">*</span>员工类型</span>
</el-col>
<el-col :span="9">
<el-form-item prop="personType">
<el-select
v-model="temp.personType"
class="addinputw"
placeholder="请选择员工类型"
@change="getPersonType"
>
<el-option
v-for="(item, index) in personType_list"
:key="index.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<span><span class="icon">*</span>入职时间</span>
</el-col>
<el-col :span="9">
<el-form-item prop="joinCompnyDate">
<el-date-picker
v-model="temp.joinCompnyDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>试用期</span>
</el-col>
<el-col :span="9">
<el-form-item prop="probPeriod">
<el-select
v-model="temp.probPeriod"
class="addinputw"
placeholder="请选择试用期"
@change="getProbPeriod"
>
<el-option
v-for="(item, index) in probPeriod_list"
:key="index.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<span>计划转正日期</span>
</el-col>
<el-col :span="9">
<el-form-item prop="plannedConfirmDate">
<el-date-picker
v-model="temp.plannedConfirmDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>实际转正日期</span>
</el-col>
<el-col :span="9">
<el-form-item prop="confirmationDate">
<el-date-picker
v-model="temp.confirmationDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
<el-col :span="12" />
</el-row>
<el-row>
<el-col :span="3">
<span>所在部门</span>
</el-col>
<el-col :span="9">
<el-form-item prop="orgName">
<el-cascader
v-model="orgName_list"
:props="props"
:options="options"
@change="orgNameChange"
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>岗位</span>
</el-col>
<el-col :span="9">
<el-form-item prop="postSid">
<el-select
v-model="temp.postName"
class="addinputw"
placeholder="请选择岗位"
@change="getPostSid"
>
<el-option
v-for="(item, index) in postSid_list"
:key="index.postCode"
:label="item.name"
:value="item.postCode"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>银行账号</span>
</el-col>
<el-col :span="9">
<el-form-item prop="bankCardNo">
<el-input
v-model="temp.bankCardNo"
maxlength="20"
placeholder="请输入银行账号"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>开户行</span>
</el-col>
<el-col :span="9">
<el-form-item prop="openBank">
<el-input
v-model="temp.openBank"
maxlength="20"
placeholder="请输入开户行"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<!-- !!!!各种附件证明图片!!!! -->
<el-row>
<el-col :span="3">
<span>身份证(人像面)</span>
</el-col>
<el-col :span="9">
<Upload
ref="uploadImg"
v-model="idCardA_list"
:limit="1"
bucket="map"
:upload-data="{ type: '0001' }"
/>
</el-col>
<el-col :span="3">
<span>身份证(国徽面)</span>
</el-col>
<el-col :span="9">
<Upload
ref="uploadImg"
v-model="idCardB_list"
:limit="1"
bucket="map"
:upload-data="{ type: '0001' }"
/>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>前公司离职证明</span>
</el-col>
<el-col :span="21">
<Upload
ref="uploadImg"
v-model="leave_list"
:limit="1"
bucket="map"
:upload-data="{ type: '0001' }"
/>
</el-col>
</el-row>
<div
class="title"
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div>学历/技能信息</div>
</div>
<el-row>
<el-col :span="3">
<span>毕业院校</span>
</el-col>
<el-col :span="9">
<el-form-item prop="graduate">
<el-input
v-model="temp.graduate"
maxlength="20"
placeholder="请输入毕业院校"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>学历/专业</span>
</el-col>
<el-col :span="9">
<el-form-item prop="education">
<el-select
v-model="temp.education"
class="addinputw"
placeholder="请选择学历"
@change="getEducate"
>
<el-option
v-for="(item, index) in educate_list"
:key="index.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>职称</span>
</el-col>
<el-col :span="9">
<el-form-item prop="title">
<el-input
v-model="temp.title"
maxlength="20"
placeholder="请输入职称"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>资格认证</span>
</el-col>
<el-col :span="9">
<el-form-item prop="qualification">
<el-input
v-model="temp.qualification"
maxlength="20"
placeholder="请输入资格认证"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>驾照类型</span>
</el-col>
<el-col :span="21">
<el-form-item prop="licenseType">
<el-select
v-model="temp.licenseType"
class="addinputw"
placeholder="请选择驾照类型"
@change="getLicenseType"
>
<el-option
v-for="(item, index) in licenseType_list"
:key="index.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>学历证书</span>
</el-col>
<el-col :span="9">
<Upload
ref="uploadImg"
v-model="diploma_list"
:limit="1"
bucket="map"
:upload-data="{ type: '0001' }"
/>
</el-col>
<el-col :span="3">
<span>学位证书</span>
</el-col>
<el-col :span="9">
<Upload
ref="uploadImg"
v-model="degree_list"
:limit="1"
bucket="map"
:upload-data="{ type: '0001' }"
/>
</el-col>
</el-row>
<div
class="title"
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div>社保信息</div>
</div>
<el-row>
<el-col :span="3">
<span>意外险参保</span>
</el-col>
<el-col :span="9">
<el-form-item prop="isHaveInsurance">
<el-radio v-model="temp.isHaveInsurance" :label="1"></el-radio>
<el-radio v-model="temp.isHaveInsurance" :label="0"></el-radio>
</el-form-item>
</el-col>
<el-col :span="3">
<span>意外险参保地</span>
</el-col>
<el-col :span="9">
<el-form-item prop="insuranceAddr">
<el-input
v-model="temp.insuranceAddr"
maxlength="20"
placeholder="请输入意外险参保地"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>意外险参保时间</span>
</el-col>
<el-col :span="9">
<el-form-item prop="insuranceStartDate">
<el-date-picker
v-model="temp.insuranceStartDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>意外险终止时间</span>
</el-col>
<el-col :span="9">
<el-form-item prop="insuranceEndDate">
<el-date-picker
v-model="temp.insuranceEndDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>养老</span>
</el-col>
<el-col :span="9">
<el-form-item prop="isHaveAged">
<el-radio v-model="temp.isHaveAged" :label="1"></el-radio>
<el-radio v-model="temp.isHaveAged" :label="0"></el-radio>
</el-form-item>
</el-col>
<el-col :span="3">
<span>医疗/生育</span>
</el-col>
<el-col :span="9">
<el-form-item prop="isHaveMedical">
<el-radio v-model="temp.isHaveMedical" :label="1"></el-radio>
<el-radio v-model="temp.isHaveMedical" :label="0"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>工伤</span>
</el-col>
<el-col :span="9">
<el-form-item prop="isHaveInjury">
<el-radio v-model="temp.isHaveInjury" :label="1"></el-radio>
<el-radio v-model="temp.isHaveInjury" :label="0"></el-radio>
</el-form-item>
</el-col>
<el-col :span="3">
<span>失业</span>
</el-col>
<el-col :span="9">
<el-form-item prop="isHaveUnemploy">
<el-radio v-model="temp.isHaveUnemploy" :label="1"></el-radio>
<el-radio v-model="temp.isHaveUnemploy" :label="0"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<span>社保参保地</span>
</el-col>
<el-col :span="9">
<el-form-item prop="insuredPlace">
<el-input
v-model="temp.insuredPlace"
maxlength="20"
placeholder="请输入社保参保地"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>纸质档案保管地</span>
</el-col>
<el-col :span="9">
<el-form-item prop="paperPlace">
<el-input
v-model="temp.paperPlace"
maxlength="20"
placeholder="请输入纸质档案保管地"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<div
class="title"
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div>合同信息</div>
</div>
<el-row>
<el-col :span="3">
<span>合同起止日期</span>
</el-col>
<el-col :span="9">
<el-form-item prop="contractStartDate">
<el-date-picker
v-model="temp.contractStartDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>合同结束日期</span>
</el-col>
<el-col :span="9">
<el-form-item prop="contractEndDate">
<el-date-picker
v-model="temp.contractEndDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
</el-row>
<div v-show="isQuit == true">
<div
class="title"
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div>离职信息</div>
</div>
<el-row>
<el-col :span="3">
<span>离职日期</span>
</el-col>
<el-col :span="9">
<el-form-item prop="quitDate">
<el-date-picker
v-model="temp.quitDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
</el-col>
<el-col :span="3">
<span>离职理由</span>
</el-col>
<el-col :span="9">
<el-form-item prop="quitReason">
<el-input
v-model="temp.quitReason"
maxlength="20"
placeholder="请输入离职理由"
class="addinputw"
clearable
/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
</div>
<!--End 添加修改部分-->
</div>
</template>
<script>
import { getProvince, getCity, getCounty } from '@/api/Common/areaPicker' // 省市区
import Upload from '@/components/uploadFileimg/upload.vue'
import uploadHead from '@/components/uploadFileimg/upload_head.vue'
import req from '@/api/management/yuangongguanli'
export default {
name: 'YuangongAdd',
components: { Upload, uploadHead },
data() {
var checkSubmit = (rule, value, callback) => {
const Submit =
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
if (Submit.test(value)) {
return callback()
}
callback(new Error('请输入手机号'))
}
var identitycard = (rules, value, callback) => {
const card =
/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
if (card.test(value)) {
return callback()
}
callback(new Error('请输入身份证号码'))
}
return {
viewTitle: '',
dialogStatus: '',
index: 0,
isQuit: false,
// 下拉框
national_list: [], // 民族 12
maritalstatus_list: [], // 婚姻 12
political_list: [], // 政治面貌 12
postSid_list: [], // 岗位
personType_list: [], // 员工类型 12
probPeriod_list: [], // 试用期 12
gender_list: [], // 性别 1
educate_list: [], // 学历
licenseType_list: [], // 驾照类型
// 省市区
province: [],
city: [],
county: [],
inputProvinceList: [],
inputCityList: [],
inputCountyList: [],
// 部门级联列表
orgSid: '',
orgName_list: [], // 所在部门
dataArr: [],
refreshItem: 0, // 级联列表key值
options: [], // 级联列表选项
props: {
// props传值
value: 'sid',
label: 'name',
children: 'children'
},
// 上传图片
photo_list: [],
idCardA_list: [],
idCardB_list: [],
diploma_list: [],
degree_list: [],
leave_list: [],
sid: '', // 一条数据的sid
sysStaffOrgDto: {}, // 编辑回显所用
sysStaffPostDto: {},
temp: {
provinceCode: '',
postName: '',
cityCode: '',
countyCode: '',
genderKey: '', // 性别code
nativePlace: '', // 籍贯
sysStaffOrgDto: {
orgName: '',
orgSid: ''
}, // 部门信息
sysStaffPostDto: {} // 岗位信息
},
rules: {
// jobNumber: [{required: true, message: '单据类型不能为空', trigger: 'change'}],
name: [{ required: true, message: '姓名不能为空', trigger: 'change' }],
gender: [
{ required: true, message: '性别不能为空', trigger: 'change' }
],
idNo: [
{
required: true,
message: '身份证号不能为空',
validator: identitycard,
trigger: 'change'
}
],
idTerm: [
{ required: true, message: '证件有效期不能为空', trigger: 'change' }
],
national: [
{ required: true, message: '民族不能为空', trigger: 'change' }
],
mobile: [
{
required: true,
message: '手机号不能为空',
validator: checkSubmit,
trigger: 'change'
}
],
personType: [
{ required: true, message: '员工类型不能为空', trigger: 'change' }
]
// joinCompnyDate: [{required: true, message: '入职时间不能为空', trigger: 'change'}],
},
submitdisabled: false
}
},
created() {
// 下拉框
this.getType()
// 部门级联列表
this.getBuMen()
this.huoquSheng()
},
methods: {
// -------------------------获取省市县方法-------------------------
huoquSheng() {
getProvince().then((res) => {
// console.log('11111省:', res)
if (res.code === '200') {
this.inputProvinceList = res.data
}
})
},
getShen(value) {
let bb = ''
this.inputProvinceList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
console.log('shengshengsheng', this.inputProvinceList)
// 这里是把code的值赋给province省字段
this.temp.province = bb.name
this.temp.provinceCode = bb.districtCode
this.huoquShi(bb.sid)
},
huoquShi(sid1) {
var sid = {
sid: sid1
}
getCity(sid).then((res) => {
console.log('2222市', res)
if (res.code === '200') {
this.inputCityList = res.data
}
})
},
getShi(value) {
let bb = ''
this.inputCityList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.temp.city = bb.name
this.temp.cityCode = bb.districtCode
// this.deCode.push(bb.districtCode)
this.huoquXian(bb.sid)
// this.temp.orgmoneVakue.push(bb)
// let aa = ''
// this.temp.orgmoneVakue.forEach((e)=>{
// aa = aa +e.districtCode
// })
},
huoquXian(sid1) {
var sid = {
sid: sid1
}
getCounty(sid).then((res) => {
console.log('333县', res)
if (res.code === '200') {
this.inputCountyList = res.data
}
})
},
getQu(value) {
let bb = ''
this.inputCountyList.forEach((e) => {
if (e.sid === value) {
bb = {
name: e.name,
districtCode: e.districtCode,
sid: e.sid
}
}
})
this.temp.county = bb.name
this.temp.countyCode = bb.districtCode
// this.deCode.push(bb.districtCode)
console.log('6666677777777', this.deCode)
},
// 级联列表 部门
getBuMen() {
req.salesDepName().then((res) => {
if (res.code === '200') {
this.options = res.data
console.log('请求到的部门级联列表', this.options)
this.BuMen0(this.options)
}
})
},
BuMen0(data) {
data.forEach((e) => {
if (e.children.length !== 0) {
this.BuMen0(e.children)
} else {
delete e.children
this.dataArr.push(e)
return
}
})
},
// 部门
orgNameChange(e) {
console.log('选中结果:' + JSON.stringify(e))
var result = ''
var result_Sid = ''
var sidPath = ''
var namePath = ''
var result_code = ''
if (e.length > 0) {
// 循环多选项
e.forEach((item) => {
var last_id = item
// 循环查找名字
this.select_temp_Name = '' // 临时遍历,用来保存选中结果(组织名称)
this.select_temp_Sid = '' // 临时遍历,用来保存选中结果(组织Sid)
this.select_temp_NamePath = '' // 临时遍历,用来保存选中结果(名称路径)
this.select_temp_SidPath = '' // 临时遍历,用来保存选中结果(sid路径)
this.select_temp_code = '' // 临时遍历,用来保存选中结果(code)
this.findOrgId(last_id, this.options)
result = result + this.select_temp_Name + ','
result_Sid = result_Sid + this.select_temp_Sid + ','
sidPath = this.select_temp_SidPath
namePath = namePath + this.select_temp_Name + '/'
result_code = this.select_temp_code
})
}
if (result !== '') {
result = result.substring(0, result.length - 1)
}
if (namePath !== '') {
namePath = namePath.substring(0, result.length - 1)
}
if (result_Sid !== '') {
result_Sid = result_Sid.substring(0, result_Sid.length - 1)
}
const orgSidArray = result_Sid.split(',')
const orgSid = orgSidArray[orgSidArray.length - 1]
const orgNameArray = result.split(',')
const orgName = orgNameArray[orgNameArray.length - 1]
this.temp.sysStaffOrgDto.orgName = orgName
this.temp.sysStaffOrgDto.orgSid = orgSid
this.temp.sysStaffOrgDto.orgSidPath = sidPath
this.temp.sysStaffOrgDto.orgNamePath = namePath
this.temp.sysStaffOrgDto.orgCode = result_code
console.log(
'选中名称:' + orgName,
orgSid,
sidPath,
namePath,
result_code
)
},
// --- 循环查询
findOrgId(id, options) {
console.log('这是部门id', id)
for (var i = 0; i < options.length; i++) {
if (id === options[i].sid) {
this.select_temp_Name = options[i].name // 保存找到的内容
this.select_temp_Sid = options[i].sid
this.select_temp_NamePath = options[i].name
this.select_temp_SidPath = options[i].orgSidPath
this.select_temp_code = options[i].orgCode
return true
} else {
// 判断是否最后一级
if (options[i].children !== undefined) {
// 不是的话查询下一级
if (this.findOrgId(id, options[i].children)) {
return true
}
}
}
}
},
// -------------------------数据字典下拉框-------------------------
getType() {
req
.pullDown({
type: 'national'
})
.then((res) => {
if (res.code === '200') {
this.national_list = res.data
console.log('下拉框请求民族', res.data)
}
})
req
.pullDown({
type: 'maritalstatus'
})
.then((res) => {
if (res.code === '200') {
this.maritalstatus_list = res.data
console.log('下拉框请求婚姻', res.data)
}
})
req
.pullDown({
type: 'political'
})
.then((res) => {
if (res.code === '200') {
this.political_list = res.data
console.log('下拉框请求政治', res.data)
}
})
req
.pullDown({
type: 'personType'
})
.then((res) => {
if (res.code === '200') {
this.personType_list = res.data
console.log('下拉框员工类型', res.data)
}
})
req
.pullDown({
type: 'probPeriod'
})
.then((res) => {
if (res.code === '200') {
this.probPeriod_list = res.data
console.log('下拉框试用期', res.data)
}
})
req
.pullDown({
type: 'sex'
})
.then((res) => {
if (res.code === '200') {
this.gender_list = res.data
console.log('下拉框性别', res.data)
}
})
req.postName().then((res) => {
if (res.code === '200') {
this.postSid_list = res.data
console.log('下拉框请求岗位', res.data)
}
})
req
.pullDown({
type: 'educationdegree'
})
.then((res) => {
if (res.code === '200') {
this.educate_list = res.data
console.log('下拉框请求学历', res.data)
}
})
req
.pullDown({
type: 'carType'
})
.then((res) => {
if (res.code === '200') {
this.licenseType_list = res.data
console.log('下拉框请求驾照', res.data)
}
})
},
getNational(value) {
console.log('触发下拉框按钮')
let bb = {}
this.national_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.temp.national = bb.name
this.temp.nationalKey = bb.key
// this.formobj.scmOtherInboundDto.billType = bb.sid
console.log('name', this.temp.national)
},
getMari(value) {
console.log('触发下拉框按钮')
let bb = {}
this.maritalstatus_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.temp.maritalStatus = bb.name
this.temp.maritalStatusKey = bb.key
// this.formobj.scmOtherInboundDto.billType = bb.sid
console.log('name', this.temp.maritalStatus)
},
getPoliCode(value) {
console.log('触发下拉框按钮')
let bb = {}
this.political_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.temp.political = bb.name
this.temp.poliCodeKey = bb.key
console.log('name', this.temp.political)
},
getPersonType(value) {
console.log('触发下拉框按钮')
let bb = {}
this.personType_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
if (bb.name === '离职') {
this.isQuit = true
} else if (bb.name === '全职') {
this.isQuit = false
}
this.temp.personType = bb.name
this.temp.personTypeKey = bb.key
console.log('name', this.temp.personType)
},
getProbPeriod(value) {
console.log('触发下拉框按钮')
let bb = {}
this.probPeriod_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.temp.probPeriod = bb.name
this.temp.probPeriodKey = bb.key
console.log('name', this.temp.probPeriod)
},
getPostSid(value) {
console.log('触发下拉框按钮', value)
let bb = {}
this.postSid_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.postCode == value) {
bb = {
name: e.name,
key: e.postCode,
sid: e.sid
}
}
})
this.temp.sysStaffPostDto.postSid = bb.sid
this.temp.postName = bb.name
this.temp.sysStaffPostDto.postCode = bb.key
// this.formobj.scmOtherInboundDto.billType = bb.sid
console.log('name', this.temp.sysStaffPostDto.postSid)
},
getEducate(value) {
console.log('触发下拉框按钮', value)
let bb = {}
this.educate_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.temp.education = bb.name
this.temp.educationKey = bb.key
console.log('name', this.temp.sysStaffPostDto.postSid)
},
getLicenseType(value) {
console.log('触发下拉框按钮', value)
let bb = {}
this.licenseType_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictKey == value) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
this.temp.licenseType = bb.name
this.temp.licenseTypeKey = bb.key
console.log('name', this.temp.licenseType)
},
getGenderKey() {
console.log('触发下拉框按钮')
let bb = {}
this.gender_list.forEach((e) => {
// eslint-disable-next-line eqeqeq
if (e.dictValue == this.temp.gender) {
bb = {
type: e.dictType,
name: e.dictValue,
key: e.dictKey,
sid: e.sid
}
}
})
if (this.temp.gender === bb.name) {
this.temp.genderKey = bb.key
}
// this.temp.probPeriod = bb.name
// this.temp.probPeriodKey = bb.key
// console.log('name', this.temp.probPeriod)
},
// 上传附件
getUrl() {
// 员工照片
this.temp.photo = this.photo_list[this.photo_list.length - 1].url
// for (var i = 0; i < this.photo_list.length; i++) {
// this.temp.photo = this.photo_list[i].url;
// console.log("图片信息", this.temp.photo);
// }
// 身份证(人像面)
this.temp.idCardA = this.idCardA_list[this.idCardA_list.length - 1].url
// for (var i = 0; i < this.idCardA_list.length; i++) {
// this.temp.idCardA = this.idCardA_list[i].url;
// console.log("图片信息", this.temp.idCardA);
// }
// 身份证(国徽面)
this.temp.idCardB = this.idCardB_list[this.idCardB_list.length - 1].url
// for (var i = 0; i < this.idCardB_list.length; i++) {
// this.temp.idCardB = this.idCardB_list[i].url;
// console.log("图片信息", this.temp.idCardB);
// }
// 学历证书
this.temp.diploma = this.diploma_list[this.diploma_list.length - 1].url
// for (var i = 0; i < this.diploma_list.length; i++) {
// this.temp.diploma = this.diploma_list[i].url;
// console.log("图片信息", this.temp.diploma);
// }
// 学位证书
this.temp.degreeCertificate =
this.degree_list[this.degree_list.length - 1].url
// for (var i = 0; i < this.degree_list.length; i++) {
// this.temp.degreeCertificate = this.degree_list[i].url;
// console.log("图片信息", this.temp.degreeCertificate);
// }
// 前公司离职证明 leaveCertificate
this.temp.leaveCertificate =
this.leave_list[this.leave_list.length - 1].url
// for (var i = 0; i < this.leave_list.length; i++) {
// this.temp.leaveCertificate = this.leave_list[i].url;
// console.log("图片信息", this.temp.leaveCertificate);
// }
// console.log("所有图片路径");
},
// 返回(===既判断又赋值)
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.photo_list = []
this.idCardA_list = []
this.idCardB_list = []
this.diploma_list = []
this.degree_list = []
this.leave_list = []
this.temp = {
sysStaffOrgDto: {}, // 部门信息
sysStaffPostDto: {} // 岗位信息
}
this.$refs['dataForm'].resetFields()
this.$emit('doback')
this.refreshItem++
},
showAdd() {
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
this.dialogStatus = 'add'
this.viewTitle = '员工信息登记'
},
showEdit(sid, row) {
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
this.dialogStatus = 'edit'
this.viewTitle = '【编辑】其他入库单'
console.log('编辑页面sid', sid)
req
.fetchBySid(sid)
.then((resp) => {
const data = resp.data
this.sid = sid
this.temp = data
this.orgName_list = data.sysStaffOrgDetailsVo.orgSid
// ---修改名称---
this.temp = JSON.parse(
JSON.stringify(this.temp).replace(
/sysStaffOrgDetailsVo/g,
'sysStaffOrgDto'
)
)
this.temp = JSON.parse(
JSON.stringify(this.temp).replace(
/sysStaffPostDetailsVo/g,
'sysStaffPostDto'
)
)
// ---修改名称---
// this.sysStaffOrgDto =data.sysStaffOrgDetailsVo
// this.sysStaffPostDto = data.sysStaffPostDetailsVo
// this.temp.sysStaffOrgDetailsVo = this.sysStaffOrgDto
// this.temp.sysStaffPostDetailsVo = this.sysStaffPostDto
// console.log('1111111',this.sysStaffOrgDto,this.sysStaffPostDto)
console.log('888999', this.temp)
let bb = {}
this.postSid_list.forEach((e) => {
if (e.sid === data.sysStaffPostDetailsVo.postSid) {
bb = {
name: e.name,
key: e.postCode,
sid: e.sid
}
}
})
this.temp.postName = bb.name
if (this.temp.photo !== '') {
const imgName = this.temp.photo.split('/')
this.photo_list.push({
name: imgName[imgName.length - 1],
url: this.temp.photo
})
}
if (this.temp.idCardA !== '') {
const imgName = this.temp.idCardA.split('/')
this.idCardA_list.push({
name: imgName[imgName.length - 1],
url: this.temp.idCardA
})
}
if (this.temp.idCardB !== '') {
const imgName = this.temp.idCardB.split('/')
this.idCardB_list.push({
name: imgName[imgName.length - 1],
url: this.temp.idCardB
})
}
if (this.temp.diploma !== '') {
const imgName = this.temp.diploma.split('/')
this.diploma_list.push({
name: imgName[imgName.length - 1],
url: this.temp.diploma
})
}
if (this.temp.degreeCertificate !== '') {
const imgName = this.temp.degreeCertificate.split('/')
this.degree_list.push({
name: imgName[imgName.length - 1],
url: this.temp.degreeCertificate
})
}
if (this.temp.leaveCertificate !== '') {
const imgName = this.temp.leaveCertificate.split('/')
this.leave_list.push({
name: imgName[imgName.length - 1],
url: this.temp.leaveCertificate
})
}
})
.catch((e) => {
this.temp = row
})
},
saveAdd() {
const _this = this
this.$refs['dataForm'].validate((valid) => {
this.getGenderKey()
this.getUrl()
if (valid) {
this.submitdisabled = true
req
.saveAdd(this.temp)
.then((resp) => {
this.submitdisabled = false
console.log(resp)
if (resp.success) {
_this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
_this.handleReturn('true')
// _this.handleReturn("true");
console.log('保存成功')
} else {
_this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
// resp.code
}
})
.catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
saveEdit() {
const _this = this
// Start
// var orgName_Sid = "";
// if (this.orgName_list.length > 0) {
// console.log('114477885522',this.orgName_list)
// this.orgName_list.forEach((item) => {
// var last_id = item[item.length - 1];
// this.select_temp_Sid = ""; //临时遍历,用来保存选中结果(组织Sid)
// this.findOrgId(last_id, this.options);
// orgName_Sid = orgName_Sid + this.select_temp_Sid + ",";
// });
// }
// if (orgName_Sid !== "") {
// orgName_Sid = orgName_Sid.substring(0, orgName_Sid.length - 1);
// }
// this.temp.sysStaffOrgDto.orgSid = orgName_Sid;
// console.log("重新赋值后的组织结构", this.temp.sysStaffOrgDto.orgSid);
// End
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req
.saveEdit(this.temp, this.sid)
.then((resp) => {
this.submitdisabled = false
_this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
_this.handleReturn('true')
})
.catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
}
}
}
</script>
<style scoped>
/deep/ .el-main {
padding: 0;
}
/deep/ .el-form-item__content {
margin-left: 0 !important;
}
.icon {
color: #e84026;
margin-right: 4px;
}
.jiguan {
border-top: 1px solid #e0e3eb;
}
/deep/ .el-col-3,
.el-col-4 {
text-align: right;
float: left;
font-size: 14px;
color: #606266;
line-height: 40px !important;
font-weight: 600;
}
</style>