|
@@ -0,0 +1,378 @@
|
|
|
|
+<template>
|
|
|
|
+ <view>
|
|
|
|
+ <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm">
|
|
|
|
+ <u-form-item label="姓名" borderBottom prop="name">
|
|
|
|
+ <u--input placeholder='请填写姓名' v-model="inputForm.name"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <!-- <u-form-item label="性别" borderBottom prop="sex">
|
|
|
|
+ <jp-picker v-model="inputForm.sex" rangeKey="label" rangeValue="value" :range="$dictUtils.getDictList('sex')"></jp-picker>
|
|
|
|
+ </u-form-item> -->
|
|
|
|
+ <u-form-item label="性别" borderBottom prop="sex">
|
|
|
|
+ <jp-picker v-model="inputForm.sex" rangeKey="label" rangeValue="value" :range="[
|
|
|
|
+ { label: '男', value: 'male' },
|
|
|
|
+ { label: '女', value: 'female' },
|
|
|
|
+ { label: '其他', value: 'other' }
|
|
|
|
+ ]"></jp-picker>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <u-form-item label="年龄" borderBottom prop="age">
|
|
|
|
+ <u--input placeholder='请填写年龄' v-model="inputForm.age"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="出生日期" borderBottom prop="birthday">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="inputForm.birthday"
|
|
|
|
+ type="date"
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
+ placeholder="选择出生日期"
|
|
|
|
+ style="width:100%"
|
|
|
|
+ size="default"
|
|
|
|
+ placement="bottom-start"
|
|
|
|
+ clearable>
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="政治面貌" borderBottom prop="politicalOutlook" >
|
|
|
|
+ <u--input placeholder='请填写政治面貌' v-model="inputForm.politicalOutlook"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="籍贯" borderBottom prop="nativePlace" >
|
|
|
|
+ <u--input placeholder='请填写籍贯' v-model="inputForm.nativePlace"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="民族" borderBottom prop="nation" >
|
|
|
|
+ <u--input placeholder='请填写民族' v-model="inputForm.nation"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="婚姻状况" borderBottom prop="maritalStatus" >
|
|
|
|
+ <u--input placeholder='请填写婚姻状况' v-model="inputForm.maritalStatus"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="联系电话" borderBottom prop="mobilePhone" >
|
|
|
|
+ <u--input placeholder='请填写联系电话' @blur="mobilePhoneOnly(inputForm.mobilePhone)" maxlength="11" v-model="inputForm.mobilePhone"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="身份证号码" borderBottom prop="idCard" >
|
|
|
|
+ <u--input placeholder='请填写身份证号码' @blur="idCardOnly(inputForm.idCard)" v-model="inputForm.idCard"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="家庭住址" borderBottom prop="homeAddress" >
|
|
|
|
+ <u--input placeholder='请填写家庭住址' v-model="inputForm.homeAddress"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="常住住址" borderBottom prop="permanentAddress" >
|
|
|
|
+ <u--input placeholder='请填写常住住址' v-model="inputForm.permanentAddress"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="毕业院校" borderBottom prop="graduatedFrom" >
|
|
|
|
+ <u--input placeholder='请填写毕业院校' v-model="inputForm.graduatedFrom"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="专业" borderBottom prop="speciality" >
|
|
|
|
+ <u--input placeholder='请填写专业' v-model="inputForm.speciality"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="开始时间" borderBottom prop="startTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="inputForm.startTime"
|
|
|
|
+ type="date"
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
+ placeholder="选择开始时间"
|
|
|
|
+ style="width:100%"
|
|
|
|
+ size="default"
|
|
|
|
+ placement="bottom-start"
|
|
|
|
+ clearable>
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="毕业时间" borderBottom prop="endTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="inputForm.endTime"
|
|
|
|
+ type="date"
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
+ placeholder="选择毕业时间"
|
|
|
|
+ style="width:100%"
|
|
|
|
+ size="default"
|
|
|
|
+ placement="bottom-start"
|
|
|
|
+ clearable>
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="学历" borderBottom prop="education" >
|
|
|
|
+ <u--input placeholder='请填写学历' v-model="inputForm.education"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="学历性质" borderBottom prop="educationNature" >
|
|
|
|
+ <u--input placeholder='请填写学历性质' v-model="inputForm.educationNature"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="是否毕业" borderBottom prop="graduatedOrNot" >
|
|
|
|
+ <u--input placeholder='请填写是否毕业' v-model="inputForm.graduatedOrNot"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="英语等级" borderBottom prop="englishLevel" >
|
|
|
|
+ <u--input placeholder='请填写英语等级' v-model="inputForm.englishLevel"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="计算机等级" borderBottom prop="ncre" >
|
|
|
|
+ <u--input placeholder='请填写计算机等级' v-model="inputForm.ncre"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="个人简介" borderBottom prop="remarks">
|
|
|
|
+ <u--textarea placeholder='请填写简介' v-model="inputForm.remarks" ></u--textarea>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="社保编号(选填)" borderBottom prop="socialSecurityNumber">
|
|
|
|
+ <u--input placeholder='请填写社保编号' v-model="inputForm.socialSecurityNumber" maxlength="10"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="社保银行卡号(选填)" borderBottom prop="socialSecurityBankNumber">
|
|
|
|
+ <u--input placeholder='请填写社保银行卡号' v-model="inputForm.socialSecurityBankNumber" maxlength="19"></u--input>
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="社保卡照片正面" borderBottom prop="socialSecurityPictureFront">
|
|
|
|
+
|
|
|
|
+ <el-upload
|
|
|
|
+ class="upload-demo"
|
|
|
|
+ :action="`http://localhost:2800/api/public-modules-server/oss/file/webUpload/upload`"
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
+ :on-success="handleAvatarSuccess"
|
|
|
|
+ :file-list="fileList"
|
|
|
|
+ :limit="1"
|
|
|
|
+ list-type="picture">
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+
|
|
|
|
+ </u-form-item>
|
|
|
|
+
|
|
|
|
+ <u-form-item label="社保卡照片反面" borderBottom prop="socialSecurityPictureOpposite">
|
|
|
|
+
|
|
|
|
+ <el-upload
|
|
|
|
+ class="upload-demo"
|
|
|
|
+ :action="`http://localhost:2800/api/public-modules-server/oss/file/webUpload/upload`"
|
|
|
|
+ :on-success="handleAvatarSuccess2"
|
|
|
|
+ :on-remove="handleRemove2"
|
|
|
|
+ :file-list="fileList2"
|
|
|
|
+ :limit="1"
|
|
|
|
+ list-type="picture">
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+
|
|
|
|
+ </u-form-item>
|
|
|
|
+ </u--form>
|
|
|
|
+ </view>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import enrollmentRegistrationService from '@/api/human/enrollment/EnrollmentRegistrationService'
|
|
|
|
+ import OSSSerivce, {
|
|
|
|
+ httpRequest,
|
|
|
|
+ fileName,
|
|
|
|
+ toHref,
|
|
|
|
+ } from '@/api/sys/OSSService'
|
|
|
|
+ export default {
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ fileList: [],
|
|
|
|
+ fileList2: [],
|
|
|
|
+ title: '',
|
|
|
|
+ method: '',
|
|
|
|
+ loading: false,
|
|
|
|
+ inputForm: {
|
|
|
|
+ userId: '',
|
|
|
|
+ name: '',
|
|
|
|
+ sex: '',
|
|
|
|
+ age: '',
|
|
|
|
+ birthday: '',
|
|
|
|
+ politicalOutlook: '',
|
|
|
|
+ nativePlace: '',
|
|
|
|
+ nation: '',
|
|
|
|
+ maritalStatus: '',
|
|
|
|
+ mobilePhone: '',
|
|
|
|
+ idCard: '',
|
|
|
|
+ homeAddress: '',
|
|
|
|
+ permanentAddress: '',
|
|
|
|
+ graduatedFrom: '',
|
|
|
|
+ speciality: '',
|
|
|
|
+ startTime: '',
|
|
|
|
+ endTime: '',
|
|
|
|
+ education: '',
|
|
|
|
+ educationNature: '',
|
|
|
|
+ graduatedOrNot: '',
|
|
|
|
+ englishLevel: '',
|
|
|
|
+ ncre: '',
|
|
|
|
+ department: '',
|
|
|
|
+ entryDate: '',
|
|
|
|
+ contractStartDate: '',
|
|
|
|
+ remarks: '',
|
|
|
|
+ type: '',
|
|
|
|
+ socialSecurityNumber: '',
|
|
|
|
+ socialSecurityBankNumber: '',
|
|
|
|
+ socialSecurityPictureFront: '',
|
|
|
|
+ socialSecurityPictureFrontUrl: '',
|
|
|
|
+ socialSecurityPictureOpposite: '',
|
|
|
|
+ socialSecurityPictureOppositeUrl: '',
|
|
|
|
+ },
|
|
|
|
+ // tableData:[],// 存储表格数据
|
|
|
|
+ amountKey: '',
|
|
|
|
+ membersKey: '',
|
|
|
|
+ rules: {
|
|
|
|
+ 'sex': [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: '性别不能为空',
|
|
|
|
+ trigger: ['blur', 'change']
|
|
|
|
+ }],
|
|
|
|
+ 'name': [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: '姓名不能为空',
|
|
|
|
+ trigger: ['blur', 'change']
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ 'mobilePhone': [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: '联系电话不能为空',
|
|
|
|
+ trigger: ['blur', 'change']
|
|
|
|
+ }],
|
|
|
|
+ 'idCard': [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: '身份证号码不能为空',
|
|
|
|
+ trigger: ['blur', 'change']
|
|
|
|
+ }]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ props: {
|
|
|
|
+ businessId: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
|
|
+ },
|
|
|
|
+ formReadOnly: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ 'businessId': {
|
|
|
|
+ handler (newVal) {
|
|
|
|
+ if (this.businessId) {
|
|
|
|
+ this.init(this.businessId)
|
|
|
|
+ } else {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ // this.$refs.inputForm.reset()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ immediate: true,
|
|
|
|
+ deep: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ handleAvatarSuccess (res, file, fileList) {
|
|
|
|
+ this.inputForm.socialSecurityPictureFront = file.response.url
|
|
|
|
+ this.inputForm.socialSecurityPictureFrontUrl = file.response.lsUrl
|
|
|
|
+ },
|
|
|
|
+ handleRemove(file, fileList) {
|
|
|
|
+ this.inputForm.socialSecurityPictureFront = ''
|
|
|
|
+ this.inputForm.socialSecurityPictureFrontUrl = ''
|
|
|
|
+ },
|
|
|
|
+ handleAvatarSuccess2 (res, file, fileList) {
|
|
|
|
+ this.inputForm.socialSecurityPictureOpposite = file.response.url
|
|
|
|
+ this.inputForm.socialSecurityPictureOppositeUrl = file.response.lsUrl
|
|
|
|
+ },
|
|
|
|
+ handleRemove2(file, fileList) {
|
|
|
|
+ this.inputForm.socialSecurityPictureOpposite = ''
|
|
|
|
+ this.inputForm.socialSecurityPictureOppositeUrl = ''
|
|
|
|
+ },
|
|
|
|
+ init (id) {
|
|
|
|
+ if (id) {
|
|
|
|
+ enrollmentRegistrationService.findById(id).then((data) => {
|
|
|
|
+ this.inputForm = this.recover(this.inputForm, data)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ saveForm (callback) {
|
|
|
|
+ //定义表单规则
|
|
|
|
+ if (this.isNotEmpty(this.inputForm.socialSecurityNumber) && (this.isEmpty(this.inputForm.socialSecurityBankNumber) || isEmpty(this.inputForm.socialSecurityPictureFront))) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.$message.error('社保银行卡号与社保卡照片不能为空');
|
|
|
|
+ throw new Error('社保银行卡号与社保卡照片不能为空')
|
|
|
|
+ }
|
|
|
|
+ if (this.isNotEmpty(this.inputForm.socialSecurityBankNumber) && (this.isEmpty(this.inputForm.socialSecurityNumber) || this.isEmpty(this.inputForm.socialSecurityPictureFront))) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.$message.error('社保编号与社保卡照片不能为空');
|
|
|
|
+ throw new Error('社保编号与社保卡照片不能为空')
|
|
|
|
+ }
|
|
|
|
+ if (this.isNotEmpty(this.inputForm.socialSecurityPictureFront) && (this.isEmpty(this.inputForm.socialSecurityNumber) || this.isEmpty(this.inputForm.socialSecurityBankNumber))) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.$message.error('社保编号与社保银行卡号不能为空');
|
|
|
|
+ throw new Error('社保编号与社保银行卡号不能为空')
|
|
|
|
+ }
|
|
|
|
+ this.$refs.inputForm.validate().then(res => {
|
|
|
|
+ uni.showLoading()
|
|
|
|
+ this.inputForm.type = '2'
|
|
|
|
+ enrollmentRegistrationService.save(this.inputForm).then((data) => {
|
|
|
|
+ callback(data.businessTable, data.businessId)
|
|
|
|
+ }).catch((e)=>{
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }).catch((e)=>{
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //身份证号码唯一性判断
|
|
|
|
+ idCardOnly(idCard) {
|
|
|
|
+ enrollmentRegistrationService.findIdCardOnly(idCard).then((data) => {
|
|
|
|
+ if (data !== 0) {
|
|
|
|
+ this.$message.error('身份证号码已存在,请重新确认')
|
|
|
|
+ this.inputForm.idCard = ''
|
|
|
|
+ throw new Error('身份证号码已存在,请重新确认')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ //联系电话唯一性判断
|
|
|
|
+ mobilePhoneOnly(mobilePhone) {
|
|
|
|
+ enrollmentRegistrationService.findMobilePhoneOnly(mobilePhone).then((data) => {
|
|
|
|
+ if (data !== 0) {
|
|
|
|
+ this.$message.error('手机码已存在,请重新确认')
|
|
|
|
+ this.inputForm.mobilePhone = ''
|
|
|
|
+ throw new Error('联系电话已存在,请重新确认')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ isEmpty(value) {
|
|
|
|
+ let result = false;
|
|
|
|
+ if (value == null || value == undefined) {
|
|
|
|
+ result = true;
|
|
|
|
+ }
|
|
|
|
+ if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
|
|
|
|
+ result = true;
|
|
|
|
+ }
|
|
|
|
+ if (typeof value == "object" && value instanceof Array && value.length === 0) {
|
|
|
|
+ result = true;
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ },
|
|
|
|
+ isNotEmpty (value) {
|
|
|
|
+ return !this.isEmpty(value)
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style>
|
|
|
|
+ .cu-form-group .title {
|
|
|
|
+ min-width: calc(4em + 40px);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+</style>
|