1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const common_config = require("../../common/config.js");
- const _sfc_main = {
- data() {
- return {
- // 添加承诺书相关数据
- showPromiseModal: true,
- promiseChecked: false,
- formData: {
- name: "",
- gender: "",
- threePeriod: "",
- birthDate: "",
- idCard: "",
- political: "",
- ethnic: "",
- height: "",
- weight: "",
- nativePlace: "",
- residence: "",
- marriage: "",
- expectedSalary: "",
- phone: "",
- email: "",
- currentAddress: "",
- emergencyContact: "",
- emergencyPhone: "",
- hobby: "",
- motto: "",
- // 添加应聘来源相关字段
- sourceType: "social",
- // 默认为社招
- socialSource: "",
- // 社招来源
- otherSocialSource: "",
- // 其他社招来源
- otherSchoolSource: "",
- // 其他学校来源
- // 添加技能和培训字段
- skills: "",
- training: ""
- },
- genderOptions: ["男", "女"],
- genderIndex: -1,
- threePeriodOptions: ["无", "孕期", "产期", "哺乳期"],
- threePeriodIndex: -1,
- politicalOptions: ["群众", "共青团员", "中共党员", "民主党派"],
- politicalIndex: -1,
- ethnicOptions: ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "其他"],
- ethnicIndex: -1,
- marriageOptions: ["未婚", "已婚", "离异", "丧偶"],
- marriageIndex: -1,
- familyMembers: [],
- familyMemberForm: {
- relation: "",
- name: "",
- workplaceOrAddress: "",
- position: "",
- phone: "",
- isEmergencyContact: false
- // 添加新字段
- },
- isEditing: false,
- editingIndex: -1,
- // 添加教育经历相关数据
- educationList: [],
- educationForm: {
- startTime: "",
- endTime: "",
- schoolName: "",
- major: "",
- degree: ""
- },
- isEditingEducation: false,
- editingEducationIndex: -1,
- degreeOptions: ["高中", "中专", "大专", "本科", "硕士", "博士"],
- degreeIndex: -1,
- // 添加工作经历相关数据
- workList: [],
- workForm: {
- startTime: "",
- endTime: "",
- companyName: "",
- department: "",
- employeeCount: "",
- position: "",
- monthlySalary: "",
- supervisor: "",
- supervisorPhone: ""
- },
- isEditingWork: false,
- editingWorkIndex: -1,
- // 添加步骤控制
- currentStep: 1,
- steps: [
- { id: 1, name: "基本信息" },
- { id: 3, name: "家庭成员" },
- { id: 5, name: "教育经历" },
- { id: 6, name: "专业技能" },
- { id: 8, name: "工作经历" }
- ],
- formErrors: {
- name: "",
- idCard: "",
- phone: "",
- gender: "",
- ethnic: "",
- currentAddress: "",
- height: "",
- weight: "",
- expectedSalary: "",
- skills: "",
- training: ""
- },
- // Add loading state
- isLoading: true,
- familyMemberErrors: {
- relation: "",
- name: "",
- phone: "",
- workplaceOrAddress: "",
- position: ""
- },
- workErrors: {
- startTime: "",
- endTime: "",
- companyName: "",
- department: "",
- position: "",
- employeeCount: "",
- monthlySalary: "",
- supervisor: "",
- supervisorPhone: ""
- },
- // 在 data 中添加教育经历的错误提示对象
- educationErrors: {
- startTime: "",
- endTime: "",
- schoolName: "",
- major: "",
- degree: ""
- },
- // 添加统一的验证规则
- validationRules: {
- name: {
- required: true,
- message: "请输入姓名"
- },
- phone: {
- required: true,
- pattern: /^1[3-9]\d{9}$/,
- message: "请输入正确的手机号码"
- },
- idCard: {
- required: true,
- pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
- message: "请输入正确的身份证号码"
- },
- gender: {
- required: true,
- message: "请选择性别"
- },
- ethnic: {
- required: true,
- message: "请选择民族"
- },
- height: {
- pattern: /^\d+(\.\d{1,2})?$/,
- message: "请输入正确的身高(cm)"
- },
- weight: {
- pattern: /^\d+(\.\d{1,2})?$/,
- message: "请输入正确的体重(kg)"
- },
- expectedSalary: {
- pattern: /^\d+(\.\d{1,2})?$/,
- message: "请输入正确的期望薪资"
- },
- currentAddress: {
- required: true,
- message: "请输入现居住地址"
- }
- }
- };
- },
- onLoad() {
- this.fetchUserData();
- },
- computed: {
- // 添加计算属性来控制按钮显示
- showPrevButton() {
- return this.currentStep !== 1;
- },
- showNextButton() {
- return this.currentStep !== 8;
- },
- showSubmitButton() {
- return this.currentStep === 8;
- },
- // 获取当前步骤在数组中的索引
- currentStepIndex() {
- return this.steps.findIndex((step) => step.id === this.currentStep);
- }
- },
- methods: {
- // 添加承诺书相关方法
- togglePromiseChecked() {
- this.promiseChecked = !this.promiseChecked;
- },
- confirmPromise() {
- if (this.promiseChecked) {
- this.showPromiseModal = false;
- } else {
- common_vendor.index.showToast({
- title: "请先阅读并同意承诺书内容",
- icon: "none"
- });
- }
- },
- bindGenderChange(e) {
- this.genderIndex = e.detail.value;
- this.formData.gender = this.genderOptions[this.genderIndex];
- if (this.formData.gender !== "女") {
- this.formData.threePeriod = "";
- this.threePeriodIndex = -1;
- }
- },
- bindThreePeriodChange(e) {
- this.threePeriodIndex = e.detail.value;
- this.formData.threePeriod = this.threePeriodOptions[this.threePeriodIndex];
- },
- bindPoliticalChange(e) {
- this.politicalIndex = e.detail.value;
- this.formData.political = this.politicalOptions[this.politicalIndex];
- },
- bindEthnicChange(e) {
- this.ethnicIndex = e.detail.value;
- this.formData.ethnic = this.ethnicOptions[this.ethnicIndex];
- },
- bindMarriageChange(e) {
- this.marriageIndex = e.detail.value;
- this.formData.marriage = this.marriageOptions[this.marriageIndex];
- },
- bindDateChange(e) {
- this.formData.birthDate = e.detail.value;
- },
- saveFamilyMember() {
- this.resetFamilyMemberErrors();
- let isValid = true;
- if (!this.familyMemberForm.relation) {
- this.familyMemberErrors.relation = "请输入称谓";
- isValid = false;
- }
- if (!this.familyMemberForm.name) {
- this.familyMemberErrors.name = "请输入姓名";
- isValid = false;
- }
- if (!this.familyMemberForm.workplaceOrAddress) {
- this.familyMemberErrors.workplaceOrAddress = "请输入工作单位/家庭地址";
- isValid = false;
- }
- if (!this.familyMemberForm.position) {
- this.familyMemberErrors.position = "请输入职务";
- isValid = false;
- }
- if (!this.familyMemberForm.phone) {
- this.familyMemberErrors.phone = "请输入联系电话";
- isValid = false;
- } else if (!/^1[3-9]\d{9}$/.test(this.familyMemberForm.phone)) {
- this.familyMemberErrors.phone = "请输入正确的手机号";
- isValid = false;
- }
- if (!isValid) {
- common_vendor.index.showToast({
- title: "请完善家庭成员信息",
- icon: "none"
- });
- return;
- }
- if (this.isEditing) {
- this.familyMembers[this.editingIndex] = { ...this.familyMemberForm };
- common_vendor.index.showToast({
- title: "修改成功",
- icon: "success"
- });
- this.isEditing = false;
- this.editingIndex = -1;
- } else {
- this.familyMembers.push({ ...this.familyMemberForm });
- common_vendor.index.showToast({
- title: "添加成功",
- icon: "success"
- });
- }
- this.resetFamilyMemberForm();
- },
- // 添加重置错误信息的方法
- resetFamilyMemberErrors() {
- this.familyMemberErrors = {
- relation: "",
- name: "",
- phone: "",
- workplaceOrAddress: "",
- position: ""
- };
- },
- // 修改重置表单的方法
- resetFamilyMemberForm() {
- this.familyMemberForm = {
- relation: "",
- name: "",
- workplaceOrAddress: "",
- position: "",
- phone: "",
- isEmergencyContact: false
- };
- this.resetFamilyMemberErrors();
- },
- editFamilyMember(index) {
- this.isEditing = true;
- this.editingIndex = index;
- this.familyMemberForm = { ...this.familyMembers[index] };
- common_vendor.index.pageScrollTo({
- selector: ".family-member-form",
- duration: 300
- });
- },
- cancelEdit() {
- this.isEditing = false;
- this.editingIndex = -1;
- this.familyMemberForm = {
- relation: "",
- name: "",
- workplaceOrAddress: "",
- position: "",
- phone: "",
- isEmergencyContact: false
- };
- },
- deleteFamilyMember(index) {
- if (this.isEditing && this.editingIndex === index) {
- this.cancelEdit();
- }
- this.familyMembers.splice(index, 1);
- common_vendor.index.showToast({
- title: "已删除",
- icon: "none"
- });
- },
- // 选择应聘来源类型
- selectSourceType(type) {
- this.formData.sourceType = type;
- if (type === "social") {
- this.formData.socialSource = "BOSS";
- } else {
- this.formData.socialSource = "";
- }
- },
- // 选择社招来源
- selectSocialSource(source) {
- this.formData.sourceType = "social";
- this.formData.socialSource = source;
- },
- // 教育经历相关方法
- bindStartTimeChange(e) {
- this.educationForm.startTime = e.detail.value;
- },
- bindEndTimeChange(e) {
- this.educationForm.endTime = e.detail.value;
- },
- bindDegreeChange(e) {
- this.degreeIndex = e.detail.value;
- this.educationForm.degree = this.degreeOptions[this.degreeIndex];
- },
- saveEducation() {
- this.resetEducationErrors();
- let isValid = true;
- if (!this.educationForm.startTime) {
- this.educationErrors.startTime = "请选择开始时间";
- isValid = false;
- }
- if (!this.educationForm.endTime) {
- this.educationErrors.endTime = "请选择结束时间";
- isValid = false;
- }
- if (!this.educationForm.schoolName) {
- this.educationErrors.schoolName = "请输入学校名称";
- isValid = false;
- }
- if (!this.educationForm.major) {
- this.educationErrors.major = "请输入专业";
- isValid = false;
- }
- if (!this.educationForm.degree) {
- this.educationErrors.degree = "请选择学历";
- isValid = false;
- }
- if (!isValid) {
- common_vendor.index.showToast({
- title: "请完善教育经历信息",
- icon: "none"
- });
- return;
- }
- if (this.isEditingEducation) {
- this.educationList[this.editingEducationIndex] = { ...this.educationForm };
- common_vendor.index.showToast({
- title: "修改成功",
- icon: "success"
- });
- this.isEditingEducation = false;
- this.editingEducationIndex = -1;
- } else {
- this.educationList.push({ ...this.educationForm });
- common_vendor.index.showToast({
- title: "添加成功",
- icon: "success"
- });
- }
- this.educationForm = {
- startTime: "",
- endTime: "",
- schoolName: "",
- major: "",
- degree: ""
- };
- this.degreeIndex = -1;
- },
- editEducation(index) {
- this.isEditingEducation = true;
- this.editingEducationIndex = index;
- this.educationForm = { ...this.educationList[index] };
- this.degreeIndex = this.degreeOptions.findIndex((item) => item === this.educationForm.degree);
- common_vendor.index.pageScrollTo({
- selector: ".education-form",
- duration: 300
- });
- },
- cancelEditEducation() {
- this.isEditingEducation = false;
- this.editingEducationIndex = -1;
- this.educationForm = {
- startTime: "",
- endTime: "",
- schoolName: "",
- major: "",
- degree: ""
- };
- this.degreeIndex = -1;
- },
- deleteEducation(index) {
- if (this.isEditingEducation && this.editingEducationIndex === index) {
- this.cancelEditEducation();
- }
- this.educationList.splice(index, 1);
- common_vendor.index.showToast({
- title: "已删除",
- icon: "none"
- });
- },
- // 工作经历相关方法
- bindWorkStartTimeChange(e) {
- this.workForm.startTime = e.detail.value;
- },
- bindWorkEndTimeChange(e) {
- this.workForm.endTime = e.detail.value;
- },
- saveWork() {
- this.workErrors = {
- startTime: "",
- endTime: "",
- companyName: "",
- department: "",
- position: "",
- employeeCount: "",
- monthlySalary: "",
- supervisor: "",
- supervisorPhone: ""
- };
- let isValid = true;
- if (!this.workForm.startTime) {
- this.workErrors.startTime = "请选择开始时间";
- isValid = false;
- }
- if (!this.workForm.endTime) {
- this.workErrors.endTime = "请选择结束时间";
- isValid = false;
- }
- if (!this.workForm.companyName) {
- this.workErrors.companyName = "请输入单位名称";
- isValid = false;
- }
- if (!this.workForm.department) {
- this.workErrors.department = "请输入任职部门";
- isValid = false;
- }
- if (!this.workForm.position) {
- this.workErrors.position = "请输入担任职务";
- isValid = false;
- }
- if (!this.workForm.employeeCount) {
- this.workErrors.employeeCount = "请输入单位人数";
- isValid = false;
- }
- if (!this.workForm.monthlySalary) {
- this.workErrors.monthlySalary = "请输入月薪";
- isValid = false;
- }
- if (!this.workForm.supervisor) {
- this.workErrors.supervisor = "请输入直属上级";
- isValid = false;
- }
- if (!this.workForm.supervisorPhone) {
- this.workErrors.supervisorPhone = "请输入直属上级电话";
- isValid = false;
- }
- if (!isValid) {
- common_vendor.index.showToast({
- title: "请完善工作经历信息",
- icon: "none"
- });
- return;
- }
- if (this.isEditingWork) {
- this.workList[this.editingWorkIndex] = { ...this.workForm };
- common_vendor.index.showToast({
- title: "修改成功",
- icon: "success"
- });
- this.isEditingWork = false;
- this.editingWorkIndex = -1;
- } else {
- this.workList.push({ ...this.workForm });
- common_vendor.index.showToast({
- title: "添加成功",
- icon: "success"
- });
- }
- this.workForm = {
- startTime: "",
- endTime: "",
- companyName: "",
- department: "",
- employeeCount: "",
- position: "",
- monthlySalary: "",
- supervisor: "",
- supervisorPhone: ""
- };
- },
- editWork(index) {
- this.isEditingWork = true;
- this.editingWorkIndex = index;
- this.workForm = { ...this.workList[index] };
- common_vendor.index.pageScrollTo({
- selector: ".work-form",
- duration: 300
- });
- },
- cancelEditWork() {
- this.isEditingWork = false;
- this.editingWorkIndex = -1;
- this.workForm = {
- startTime: "",
- endTime: "",
- companyName: "",
- department: "",
- employeeCount: "",
- position: "",
- monthlySalary: "",
- supervisor: "",
- supervisorPhone: ""
- };
- },
- deleteWork(index) {
- if (this.isEditingWork && this.editingWorkIndex === index) {
- this.cancelEditWork();
- }
- this.workList.splice(index, 1);
- common_vendor.index.showToast({
- title: "已删除",
- icon: "none"
- });
- },
- submitForm() {
- if (!this.validateCurrentStep()) {
- return;
- }
- const allRequired = [
- "name",
- "gender",
- "phone",
- "idCard",
- "ethnic",
- "currentAddress"
- ];
- let isValid = true;
- allRequired.forEach((field) => {
- if (!this.validateField(field, this.formData[field])) {
- isValid = false;
- }
- });
- if (!isValid) {
- common_vendor.index.showToast({
- title: "请完善所有必填信息",
- icon: "none"
- });
- return;
- }
- const userInfo = common_vendor.index.getStorageSync("userInfo");
- if (!userInfo) {
- common_vendor.index.showToast({
- title: "用户信息获取失败,请重新登录",
- icon: "none",
- duration: 2e3
- });
- return;
- }
- try {
- const userData = JSON.parse(userInfo);
- const submitData = {
- tenant_id: 1,
- user_id: userData.id,
- personal_info: {
- name: this.formData.name,
- gender: this.formData.gender,
- phone: this.formData.phone,
- id_card: this.formData.idCard,
- address: this.formData.currentAddress,
- professional_skills: this.formData.skills ? this.formData.skills.split(",") : []
- },
- profile: {
- female_status: this.getFemaleStatus(),
- marital_status: this.getMaritalStatus(),
- height: parseFloat(this.formData.height) || 0,
- weight: parseFloat(this.formData.weight) || 0,
- ethnicity: this.formData.ethnic,
- current_address: this.formData.currentAddress,
- expected_salary: parseFloat(this.formData.expectedSalary) || 0
- },
- educations: this.formatEducations(),
- family_members: this.formatFamilyMembers(),
- work_experiences: this.formatWorkExperiences()
- };
- if (!submitData.personal_info.name || !submitData.personal_info.gender || !submitData.personal_info.phone) {
- common_vendor.index.showToast({
- title: "基本信息不完整",
- icon: "none",
- duration: 2e3
- });
- return;
- }
- this.sendFormData(submitData);
- } catch (error) {
- console.error("数据处理错误:", error);
- common_vendor.index.showToast({
- title: "数据处理错误,请重试",
- icon: "none",
- duration: 2e3
- });
- }
- },
- // 辅助方法:发送表单数据
- sendFormData(submitData) {
- common_vendor.index.showLoading({ title: "提交中..." });
- const token = common_vendor.index.getStorageSync("token");
- common_vendor.index.request({
- url: `${common_config.apiBaseUrl}/wechat/user/profile/update`,
- method: "POST",
- data: submitData,
- header: {
- "content-type": "application/json",
- "Authorization": token ? `Bearer ${token}` : ""
- },
- success: (res) => {
- common_vendor.index.hideLoading();
- if (res.statusCode === 200) {
- if (res.data.code === 2e3) {
- common_vendor.index.showToast({
- title: "提交成功",
- icon: "success",
- duration: 2e3
- });
- setTimeout(() => {
- common_vendor.index.navigateTo({
- url: "/pages/interview-notice/interview-notice"
- });
- }, 2e3);
- } else {
- common_vendor.index.showToast({
- title: res.data.msg || "提交失败",
- icon: "none",
- duration: 2e3
- });
- }
- } else {
- common_vendor.index.showToast({
- title: "服务器响应错误",
- icon: "none",
- duration: 2e3
- });
- }
- },
- fail: (err) => {
- console.error("提交失败:", err);
- common_vendor.index.hideLoading();
- if (err.errMsg.includes("timeout")) {
- common_vendor.index.showToast({
- title: "请求超时,请检查网络后重试",
- icon: "none",
- duration: 2e3
- });
- } else if (err.errMsg.includes("fail")) {
- common_vendor.index.showToast({
- title: "网络连接失败,请检查网络设置",
- icon: "none",
- duration: 2e3
- });
- } else {
- common_vendor.index.showToast({
- title: "提交失败,请稍后重试",
- icon: "none",
- duration: 2e3
- });
- }
- },
- complete: () => {
- }
- });
- },
- // 数据格式化方法
- getFemaleStatus() {
- if (this.formData.gender !== "女")
- return 0;
- const statusMap = { "孕期": 1, "产期": 2, "哺乳期": 3 };
- return statusMap[this.formData.threePeriod] || 0;
- },
- getMaritalStatus() {
- const statusMap = { "未婚": 0, "已婚": 1, "离异": 2, "丧偶": 3 };
- return statusMap[this.formData.marriage] || 0;
- },
- formatEducations() {
- return this.educationList.map((edu, index) => ({
- education_type: index === 0 ? 1 : 2,
- degree: this.mapDegreeToNumber(edu.degree),
- start_date: edu.startTime,
- end_date: edu.endTime,
- school_name: edu.schoolName,
- major: edu.major
- }));
- },
- formatFamilyMembers() {
- return this.familyMembers.map((member) => ({
- relation: member.relation,
- name: member.name,
- workplace: member.workplaceOrAddress,
- position: member.position,
- phone: member.phone
- //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
- }));
- },
- formatWorkExperiences() {
- return this.workList.map((work) => ({
- start_date: work.startTime,
- end_date: work.endTime,
- company_name: work.companyName,
- department: work.department,
- company_size: work.employeeCount,
- position: work.position,
- monthly_salary: work.monthlySalary,
- supervisor_name: work.supervisor,
- supervisor_phone: work.supervisorPhone
- }));
- },
- // 学历映射辅助方法
- mapDegreeToNumber(degreeText) {
- const degreeMap = {
- "高中": 1,
- "中专": 1,
- "大专": 2,
- "本科": 3,
- "硕士": 4,
- "博士": 5
- };
- return degreeMap[degreeText] || 6;
- },
- prevStep() {
- const prevIndex = this.currentStepIndex - 1;
- if (prevIndex >= 0) {
- this.currentStep = this.steps[prevIndex].id;
- common_vendor.index.pageScrollTo({
- scrollTop: 0,
- duration: 300
- });
- }
- },
- nextStep() {
- if (!this.validateCurrentStep()) {
- return;
- }
- if (this.currentStep === 1) {
- this.verifyIdentity();
- return;
- }
- const nextIndex = this.currentStepIndex + 1;
- if (nextIndex < this.steps.length) {
- this.currentStep = this.steps[nextIndex].id;
- common_vendor.index.pageScrollTo({
- scrollTop: 0,
- duration: 300
- });
- }
- },
- // 身份验证方法
- verifyIdentity() {
- this.formErrors = {
- name: "",
- idCard: "",
- phone: ""
- };
- common_vendor.index.showLoading({
- title: "身份验证中..."
- });
- common_vendor.index.request({
- url: `${common_config.apiBaseUrl}/wechat/identity/verify`,
- method: "POST",
- data: {
- name: this.formData.name,
- id_number: this.formData.idCard,
- mobile: this.formData.phone
- },
- header: {
- "content-type": "application/x-www-form-urlencoded"
- },
- success: (res) => {
- common_vendor.index.hideLoading();
- console.log(res);
- if (res.data.code === 200) {
- const nextIndex = this.currentStepIndex + 1;
- if (nextIndex < this.steps.length) {
- this.currentStep = this.steps[nextIndex].id;
- common_vendor.index.pageScrollTo({
- scrollTop: 0,
- duration: 300
- });
- }
- this.setUserInfo(this.formData);
- } else {
- this.handleVerificationError(res.data);
- }
- },
- fail: (err) => {
- this.handleRequestError(err);
- }
- });
- },
- setUserInfo(data) {
- common_vendor.index.request({
- url: `${common_config.apiBaseUrl}/wechat/updateUserInfo`,
- method: "POST",
- data: {
- openid: JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid,
- name: data.name,
- id_number: data.idCard,
- purePhoneNumber: data.phone,
- tenant_id: 1,
- examine: 0
- },
- header: {
- "content-type": "application/x-www-form-urlencoded"
- },
- success: (res) => {
- console.log(res);
- }
- });
- },
- // 处理验证错误
- handleVerificationError(data) {
- this.formErrors.name = "姓名验证失败,请检查姓名是否正确";
- this.formErrors.idCard = "身份证号验证失败,请检查身份证号是否正确";
- this.formErrors.phone = "手机号验证失败,请检查手机号是否正确";
- common_vendor.index.showToast({
- title: data.msg || "身份验证失败",
- icon: "none"
- });
- },
- // 处理请求错误
- handleRequestError(err) {
- common_vendor.index.hideLoading();
- common_vendor.index.showToast({
- title: "网络错误,请检查网络连接",
- icon: "none",
- duration: 2e3
- });
- console.error("请求失败:", err);
- },
- // 验证当前步骤的必填项
- validateCurrentStep() {
- var _a, _b;
- let isValid = true;
- switch (this.currentStep) {
- case 1:
- const basicFields = ["name", "gender", "phone", "idCard", "ethnic", "currentAddress"];
- basicFields.forEach((field) => {
- if (!this.validateField(field, this.formData[field])) {
- isValid = false;
- }
- });
- if (this.formData.gender === "女" && this.threePeriodIndex === -1) {
- this.formErrors.threePeriod = "请选择三期状态";
- isValid = false;
- }
- if (this.formData.height) {
- isValid = this.validateField("height", this.formData.height) && isValid;
- }
- if (this.formData.weight) {
- isValid = this.validateField("weight", this.formData.weight) && isValid;
- }
- if (this.formData.expectedSalary) {
- isValid = this.validateField("expectedSalary", this.formData.expectedSalary) && isValid;
- }
- break;
- case 3:
- console.log(this.familyMembers.length);
- if (this.familyMembers.length == 0) {
- common_vendor.index.showToast({
- title: "请至少添加一位家庭成员",
- icon: "none"
- });
- isValid = false;
- }
- break;
- case 5:
- if (this.educationList.length === 0) {
- common_vendor.index.showToast({
- title: "请至少添加一项教育经历",
- icon: "none"
- });
- isValid = false;
- }
- break;
- case 6:
- if (!((_a = this.formData.skills) == null ? void 0 : _a.trim())) {
- this.formErrors.skills = "请描述您的专业技能";
- isValid = false;
- }
- if (!((_b = this.formData.training) == null ? void 0 : _b.trim())) {
- this.formErrors.training = "请描述您的培训经历";
- isValid = false;
- }
- break;
- case 8:
- if (this.workList.length === 0) {
- common_vendor.index.showToast({
- title: "请至少添加一项工作经历",
- icon: "none"
- });
- isValid = false;
- }
- break;
- }
- return isValid;
- },
- // Add method to fetch user data
- fetchUserData() {
- this.isLoading = true;
- const userInfo = common_vendor.index.getStorageSync("userInfo") ? JSON.parse(common_vendor.index.getStorageSync("userInfo")) : {};
- const openid = userInfo.openid;
- if (!openid) {
- common_vendor.index.showToast({
- title: "用户信息获取失败,请重新登录",
- icon: "none"
- });
- this.isLoading = false;
- return;
- }
- common_vendor.index.request({
- url: `${common_config.apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=1&openid=${openid}`,
- method: "GET",
- success: (res) => {
- this.showPromiseModal = true;
- this.populateFormData(res.data.data);
- },
- fail: (err) => {
- },
- complete: () => {
- this.isLoading = false;
- }
- });
- },
- // Add method to populate form data with fetched data
- populateFormData(data) {
- const { user_info, profile, educations, work_experiences, family_members } = data;
- if (user_info) {
- this.formData.name = user_info.name || "";
- this.formData.gender = user_info.gender_text || "";
- this.genderIndex = this.genderOptions.findIndex((item) => item === this.formData.gender);
- this.formData.idCard = user_info.id_card || "";
- this.formData.phone = user_info.phone || "";
- this.formData.email = user_info.email || "";
- }
- if (profile) {
- this.formData.political = profile.political_status || "";
- this.politicalIndex = this.politicalOptions.findIndex((item) => item === this.formData.political);
- this.formData.ethnic = profile.ethnicity || "";
- this.ethnicIndex = this.ethnicOptions.findIndex((item) => item === this.formData.ethnic);
- this.formData.height = profile.height || "";
- this.formData.weight = profile.weight || "";
- this.formData.nativePlace = profile.native_place || "";
- this.formData.residence = profile.household_location || "";
- this.formData.currentAddress = profile.current_address || "";
- this.formData.marriage = profile.marital_status_text || "";
- this.marriageIndex = this.marriageOptions.findIndex((item) => item === this.formData.marriage);
- if (this.formData.gender === "女" && profile.female_status !== void 0) {
- const femaleStatusMap = { 0: "无", 1: "孕期", 2: "产期", 3: "哺乳期" };
- this.formData.threePeriod = femaleStatusMap[profile.female_status] || "无";
- this.threePeriodIndex = this.threePeriodOptions.findIndex((item) => item === this.formData.threePeriod);
- }
- this.formData.expectedSalary = profile.expected_salary || "";
- this.formData.emergencyContact = profile.emergency_contact || "";
- this.formData.emergencyPhone = profile.emergency_phone || "";
- this.formData.hobby = profile.specialties || "";
- this.formData.motto = profile.life_motto || "";
- const sourceTypeMap = {
- 1: "school",
- 2: "social",
- 3: "social",
- 4: "social",
- 5: "social"
- };
- const socialSourceMap = {
- 2: "BOSS",
- 3: "zhilian",
- 4: "liepin",
- 5: "other"
- };
- this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || "social";
- if (this.formData.sourceType === "social") {
- this.formData.socialSource = socialSourceMap[profile.recruitment_source] || "";
- if (this.formData.socialSource === "other") {
- this.formData.otherSocialSource = profile.recruitment_source_detail || "";
- }
- } else if (this.formData.sourceType === "school") {
- this.formData.otherSchoolSource = profile.recruitment_source_detail || "";
- }
- }
- if (educations && educations.length > 0) {
- this.educationList = educations.map((edu) => {
- const degreeMap = {
- 1: "高中",
- 2: "大专",
- 3: "本科",
- 4: "硕士",
- 5: "博士"
- };
- return {
- startTime: edu.start_date || "",
- endTime: edu.end_date || "",
- schoolName: edu.school_name || "",
- major: edu.major || "",
- degree: degreeMap[edu.degree] || ""
- };
- });
- }
- if (work_experiences && work_experiences.length > 0) {
- this.workList = work_experiences.map((work) => {
- return {
- startTime: work.start_date || "",
- endTime: work.end_date || "",
- companyName: work.company_name || "",
- department: work.department || "",
- employeeCount: work.company_size || "",
- position: work.position || "",
- monthlySalary: work.monthly_salary || "",
- supervisor: work.supervisor_name || "",
- supervisorPhone: work.supervisor_phone || ""
- };
- });
- }
- if (family_members && family_members.length > 0) {
- this.familyMembers = family_members.map((member) => {
- return {
- relation: member.relation || "",
- name: member.name || "",
- workplaceOrAddress: member.workplace || "",
- position: member.position || "",
- phone: member.phone || "",
- isEmergencyContact: member.isEmergencyContact || false
- };
- });
- }
- },
- // 处理紧急联系人开关变化
- handleEmergencyContactChange(e) {
- this.familyMemberForm.isEmergencyContact = e.detail.value;
- if (e.detail.value) {
- this.formData.emergencyContact = this.familyMemberForm.name;
- this.formData.emergencyPhone = this.familyMemberForm.phone;
- }
- },
- // 添加重置教育经历错误信息的方法
- resetEducationErrors() {
- this.educationErrors = {
- startTime: "",
- endTime: "",
- schoolName: "",
- major: "",
- degree: ""
- };
- },
- // 添加通用验证方法
- validateField(fieldName, value) {
- const rule = this.validationRules[fieldName];
- if (!rule)
- return true;
- this.formErrors[fieldName] = "";
- if (rule.required && !value) {
- this.formErrors[fieldName] = rule.message;
- return false;
- }
- if (rule.pattern && !rule.pattern.test(value)) {
- this.formErrors[fieldName] = rule.message;
- return false;
- }
- return true;
- }
- },
- // 添加监听器来清除错误信息
- watch: {
- "formData.name": function(newVal) {
- if (newVal && this.formErrors.name) {
- this.formErrors.name = "";
- }
- },
- "formData.idCard": function(newVal) {
- if (newVal && this.formErrors.idCard) {
- this.formErrors.idCard = "";
- }
- },
- "formData.phone": function(newVal) {
- if (newVal && this.formErrors.phone) {
- this.formErrors.phone = "";
- }
- },
- "formData.gender": function(newVal) {
- if (newVal && this.formErrors.gender) {
- this.formErrors.gender = "";
- }
- },
- "formData.ethnic": function(newVal) {
- if (newVal && this.formErrors.ethnic) {
- this.formErrors.ethnic = "";
- }
- },
- "formData.currentAddress": function(newVal) {
- if (newVal && this.formErrors.currentAddress) {
- this.formErrors.currentAddress = "";
- }
- },
- "formData.height": function(newVal) {
- if (newVal && this.formErrors.height) {
- this.formErrors.height = "";
- }
- },
- "formData.weight": function(newVal) {
- if (newVal && this.formErrors.weight) {
- this.formErrors.weight = "";
- }
- },
- "formData.expectedSalary": function(newVal) {
- if (newVal && this.formErrors.expectedSalary) {
- this.formErrors.expectedSalary = "";
- }
- },
- "familyMemberForm.relation": function(newVal) {
- if (newVal)
- this.familyMemberErrors.relation = "";
- },
- "familyMemberForm.name": function(newVal) {
- if (newVal)
- this.familyMemberErrors.name = "";
- },
- "familyMemberForm.phone": function(newVal) {
- if (newVal)
- this.familyMemberErrors.phone = "";
- },
- "workForm.companyName": function(newVal) {
- if (newVal && this.workErrors.companyName) {
- this.workErrors.companyName = "";
- }
- },
- "workForm.department": function(newVal) {
- if (newVal && this.workErrors.department) {
- this.workErrors.department = "";
- }
- },
- "workForm.position": function(newVal) {
- if (newVal && this.workErrors.position) {
- this.workErrors.position = "";
- }
- },
- "workForm.employeeCount": function(newVal) {
- if (newVal && this.workErrors.employeeCount) {
- this.workErrors.employeeCount = "";
- }
- },
- "workForm.monthlySalary": function(newVal) {
- if (newVal && this.workErrors.monthlySalary) {
- this.workErrors.monthlySalary = "";
- }
- },
- "workForm.supervisor": function(newVal) {
- if (newVal && this.workErrors.supervisor) {
- this.workErrors.supervisor = "";
- }
- },
- "workForm.supervisorPhone": function(newVal) {
- if (newVal && this.workErrors.supervisorPhone) {
- this.workErrors.supervisorPhone = "";
- }
- },
- "formData.training": function(newVal) {
- if (newVal && this.formErrors.training) {
- this.formErrors.training = "";
- }
- },
- "educationForm.startTime": function(newVal) {
- if (newVal)
- this.educationErrors.startTime = "";
- },
- "educationForm.endTime": function(newVal) {
- if (newVal)
- this.educationErrors.endTime = "";
- },
- "educationForm.schoolName": function(newVal) {
- if (newVal)
- this.educationErrors.schoolName = "";
- },
- "educationForm.major": function(newVal) {
- if (newVal)
- this.educationErrors.major = "";
- },
- "educationForm.degree": function(newVal) {
- if (newVal)
- this.educationErrors.degree = "";
- },
- // 添加对表单字段的实时验证
- "formData": {
- handler(newVal) {
- const currentStepFields = {
- 1: ["name", "gender", "phone", "idCard", "ethnic", "currentAddress", "height", "weight", "expectedSalary"],
- 6: ["skills", "training"]
- }[this.currentStep];
- if (currentStepFields) {
- currentStepFields.forEach((field) => {
- if (newVal[field] !== void 0) {
- this.validateField(field, newVal[field]);
- }
- });
- }
- },
- deep: true
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.isLoading
- }, $data.isLoading ? {} : {}, {
- b: $data.showPromiseModal
- }, $data.showPromiseModal ? {
- c: $data.promiseChecked,
- d: common_vendor.o((...args) => $options.togglePromiseChecked && $options.togglePromiseChecked(...args)),
- e: !$data.promiseChecked,
- f: common_vendor.o((...args) => $options.confirmPromise && $options.confirmPromise(...args))
- } : {}, {
- g: $data.currentStep === 1
- }, $data.currentStep === 1 ? common_vendor.e({
- h: $data.formErrors.name ? 1 : "",
- i: $data.formData.name,
- j: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
- k: $data.formErrors.name
- }, $data.formErrors.name ? {
- l: common_vendor.t($data.formErrors.name)
- } : {}, {
- m: common_vendor.t($data.genderOptions[$data.genderIndex] || "请选择性别"),
- n: common_vendor.o((...args) => $options.bindGenderChange && $options.bindGenderChange(...args)),
- o: $data.genderIndex,
- p: $data.genderOptions,
- q: $data.formData.gender === "女"
- }, $data.formData.gender === "女" ? {
- r: common_vendor.t($data.threePeriodOptions[$data.threePeriodIndex] || "请选择"),
- s: common_vendor.o((...args) => $options.bindThreePeriodChange && $options.bindThreePeriodChange(...args)),
- t: $data.threePeriodIndex,
- v: $data.threePeriodOptions
- } : {}, {
- w: $data.formErrors.phone ? 1 : "",
- x: $data.formData.phone,
- y: common_vendor.o(($event) => $data.formData.phone = $event.detail.value),
- z: $data.formErrors.phone
- }, $data.formErrors.phone ? {
- A: common_vendor.t($data.formErrors.phone)
- } : {}, {
- B: $data.formErrors.idCard ? 1 : "",
- C: $data.formData.idCard,
- D: common_vendor.o(($event) => $data.formData.idCard = $event.detail.value),
- E: $data.formErrors.idCard
- }, $data.formErrors.idCard ? {
- F: common_vendor.t($data.formErrors.idCard)
- } : {}, {
- G: common_vendor.t($data.ethnicOptions[$data.ethnicIndex] || "请选择民族"),
- H: common_vendor.o((...args) => $options.bindEthnicChange && $options.bindEthnicChange(...args)),
- I: $data.ethnicIndex,
- J: $data.ethnicOptions,
- K: $data.formData.height,
- L: common_vendor.o(($event) => $data.formData.height = $event.detail.value),
- M: $data.formData.weight,
- N: common_vendor.o(($event) => $data.formData.weight = $event.detail.value),
- O: $data.formData.currentAddress,
- P: common_vendor.o(($event) => $data.formData.currentAddress = $event.detail.value),
- Q: $data.formData.residence,
- R: common_vendor.o(($event) => $data.formData.residence = $event.detail.value),
- S: common_vendor.t($data.marriageOptions[$data.marriageIndex] || "请选择婚育状况"),
- T: common_vendor.o((...args) => $options.bindMarriageChange && $options.bindMarriageChange(...args)),
- U: $data.marriageIndex,
- V: $data.marriageOptions,
- W: $data.formData.expectedSalary,
- X: common_vendor.o(($event) => $data.formData.expectedSalary = $event.detail.value)
- }) : {}, {
- Y: $data.currentStep === 3
- }, $data.currentStep === 3 ? common_vendor.e({
- Z: $data.familyMembers.length > 0
- }, $data.familyMembers.length > 0 ? {
- aa: common_vendor.f($data.familyMembers, (member, index, i0) => {
- return {
- a: common_vendor.t(index + 1),
- b: common_vendor.o(($event) => $options.editFamilyMember(index), index),
- c: common_vendor.o(($event) => $options.deleteFamilyMember(index), index),
- d: common_vendor.t(member.relation),
- e: common_vendor.t(member.name),
- f: common_vendor.t(member.workplaceOrAddress),
- g: common_vendor.t(member.position),
- h: common_vendor.t(member.phone),
- i: common_vendor.t(member.isEmergencyContact ? "是" : "否"),
- j: index
- };
- })
- } : {}, {
- ab: common_vendor.t($data.isEditing ? "编辑家庭成员" : "添加家庭成员"),
- ac: $data.isEditing
- }, $data.isEditing ? {
- ad: common_vendor.o((...args) => $options.cancelEdit && $options.cancelEdit(...args))
- } : {}, {
- ae: $data.familyMemberErrors.relation ? 1 : "",
- af: $data.familyMemberForm.relation,
- ag: common_vendor.o(($event) => $data.familyMemberForm.relation = $event.detail.value),
- ah: $data.familyMemberErrors.relation
- }, $data.familyMemberErrors.relation ? {
- ai: common_vendor.t($data.familyMemberErrors.relation)
- } : {}, {
- aj: $data.familyMemberErrors.name ? 1 : "",
- ak: $data.familyMemberForm.name,
- al: common_vendor.o(($event) => $data.familyMemberForm.name = $event.detail.value),
- am: $data.familyMemberErrors.name
- }, $data.familyMemberErrors.name ? {
- an: common_vendor.t($data.familyMemberErrors.name)
- } : {}, {
- ao: $data.familyMemberForm.workplaceOrAddress,
- ap: common_vendor.o(($event) => $data.familyMemberForm.workplaceOrAddress = $event.detail.value),
- aq: $data.familyMemberForm.position,
- ar: common_vendor.o(($event) => $data.familyMemberForm.position = $event.detail.value),
- as: $data.familyMemberErrors.phone ? 1 : "",
- at: $data.familyMemberForm.phone,
- av: common_vendor.o(($event) => $data.familyMemberForm.phone = $event.detail.value),
- aw: $data.familyMemberErrors.phone
- }, $data.familyMemberErrors.phone ? {
- ax: common_vendor.t($data.familyMemberErrors.phone)
- } : {}, {
- ay: $data.familyMemberForm.isEmergencyContact,
- az: common_vendor.o((...args) => $options.handleEmergencyContactChange && $options.handleEmergencyContactChange(...args)),
- aA: common_vendor.t($data.isEditing ? "✓" : "+"),
- aB: common_vendor.o((...args) => $options.saveFamilyMember && $options.saveFamilyMember(...args)),
- aC: common_vendor.t($data.isEditing ? "保存修改" : "添加成员")
- }) : {}, {
- aD: $data.currentStep === 5
- }, $data.currentStep === 5 ? common_vendor.e({
- aE: $data.educationList.length > 0
- }, $data.educationList.length > 0 ? {
- aF: common_vendor.f($data.educationList, (edu, index, i0) => {
- return {
- a: common_vendor.t(index === 0 ? "第一学历" : "最高学历"),
- b: common_vendor.o(($event) => $options.editEducation(index), index),
- c: common_vendor.o(($event) => $options.deleteEducation(index), index),
- d: common_vendor.t(edu.startTime),
- e: common_vendor.t(edu.endTime),
- f: common_vendor.t(edu.schoolName),
- g: common_vendor.t(edu.major),
- h: common_vendor.t(edu.degree),
- i: index
- };
- })
- } : {}, {
- aG: $data.educationList.length < 2 || $data.isEditingEducation
- }, $data.educationList.length < 2 || $data.isEditingEducation ? common_vendor.e({
- aH: common_vendor.t($data.isEditingEducation ? "编辑教育经历" : $data.educationList.length === 0 ? "添加第一学历" : "添加最高学历"),
- aI: $data.isEditingEducation
- }, $data.isEditingEducation ? {
- aJ: common_vendor.o((...args) => $options.cancelEditEducation && $options.cancelEditEducation(...args))
- } : {}, {
- aK: common_vendor.t($data.educationForm.startTime || "开始时间"),
- aL: $data.educationForm.startTime,
- aM: common_vendor.o((...args) => $options.bindStartTimeChange && $options.bindStartTimeChange(...args)),
- aN: $data.educationErrors.startTime ? 1 : "",
- aO: common_vendor.t($data.educationForm.endTime || "结束时间"),
- aP: $data.educationForm.endTime,
- aQ: common_vendor.o((...args) => $options.bindEndTimeChange && $options.bindEndTimeChange(...args)),
- aR: $data.educationErrors.endTime ? 1 : "",
- aS: $data.educationErrors.startTime
- }, $data.educationErrors.startTime ? {
- aT: common_vendor.t($data.educationErrors.startTime)
- } : {}, {
- aU: $data.educationErrors.endTime
- }, $data.educationErrors.endTime ? {
- aV: common_vendor.t($data.educationErrors.endTime)
- } : {}, {
- aW: $data.educationErrors.schoolName ? 1 : "",
- aX: $data.educationForm.schoolName,
- aY: common_vendor.o(($event) => $data.educationForm.schoolName = $event.detail.value),
- aZ: $data.educationErrors.schoolName
- }, $data.educationErrors.schoolName ? {
- ba: common_vendor.t($data.educationErrors.schoolName)
- } : {}, {
- bb: $data.educationErrors.major ? 1 : "",
- bc: $data.educationForm.major,
- bd: common_vendor.o(($event) => $data.educationForm.major = $event.detail.value),
- be: $data.educationErrors.major
- }, $data.educationErrors.major ? {
- bf: common_vendor.t($data.educationErrors.major)
- } : {}, {
- bg: common_vendor.t($data.degreeOptions[$data.degreeIndex] || "请选择学历"),
- bh: common_vendor.o((...args) => $options.bindDegreeChange && $options.bindDegreeChange(...args)),
- bi: $data.degreeIndex,
- bj: $data.degreeOptions,
- bk: $data.educationErrors.degree ? 1 : "",
- bl: $data.educationErrors.degree
- }, $data.educationErrors.degree ? {
- bm: common_vendor.t($data.educationErrors.degree)
- } : {}, {
- bn: common_vendor.t($data.isEditingEducation ? "✓" : "+"),
- bo: common_vendor.o((...args) => $options.saveEducation && $options.saveEducation(...args)),
- bp: common_vendor.t($data.isEditingEducation ? "保存修改" : "添加学历")
- }) : {}) : {}, {
- bq: $data.currentStep === 6
- }, $data.currentStep === 6 ? common_vendor.e({
- br: $data.formErrors.skills ? 1 : "",
- bs: $data.formData.skills,
- bt: common_vendor.o(($event) => $data.formData.skills = $event.detail.value),
- bv: $data.formErrors.skills
- }, $data.formErrors.skills ? {
- bw: common_vendor.t($data.formErrors.skills)
- } : {}, {
- bx: $data.formErrors.training ? 1 : "",
- by: $data.formData.training,
- bz: common_vendor.o(($event) => $data.formData.training = $event.detail.value),
- bA: $data.formErrors.training
- }, $data.formErrors.training ? {
- bB: common_vendor.t($data.formErrors.training)
- } : {}) : {}, {
- bC: $data.currentStep === 8
- }, $data.currentStep === 8 ? common_vendor.e({
- bD: $data.workList.length > 0
- }, $data.workList.length > 0 ? {
- bE: common_vendor.f($data.workList, (work, index, i0) => {
- return {
- a: common_vendor.t(index + 1),
- b: common_vendor.o(($event) => $options.editWork(index), index),
- c: common_vendor.o(($event) => $options.deleteWork(index), index),
- d: common_vendor.t(work.startTime),
- e: common_vendor.t(work.endTime),
- f: common_vendor.t(work.companyName),
- g: common_vendor.t(work.department),
- h: common_vendor.t(work.employeeCount),
- i: common_vendor.t(work.position),
- j: common_vendor.t(work.monthlySalary),
- k: common_vendor.t(work.supervisor),
- l: common_vendor.t(work.supervisorPhone),
- m: index
- };
- })
- } : {}, {
- bF: $data.workList.length < 2 || $data.isEditingWork
- }, $data.workList.length < 2 || $data.isEditingWork ? common_vendor.e({
- bG: common_vendor.t($data.isEditingWork ? "编辑工作经历" : "添加工作经历"),
- bH: $data.isEditingWork
- }, $data.isEditingWork ? {
- bI: common_vendor.o((...args) => $options.cancelEditWork && $options.cancelEditWork(...args))
- } : {}, {
- bJ: common_vendor.t($data.workForm.startTime || "开始时间"),
- bK: $data.workForm.startTime,
- bL: common_vendor.o((...args) => $options.bindWorkStartTimeChange && $options.bindWorkStartTimeChange(...args)),
- bM: $data.workErrors.startTime ? 1 : "",
- bN: common_vendor.t($data.workForm.endTime || "结束时间"),
- bO: $data.workForm.endTime,
- bP: common_vendor.o((...args) => $options.bindWorkEndTimeChange && $options.bindWorkEndTimeChange(...args)),
- bQ: $data.workErrors.endTime ? 1 : "",
- bR: $data.workErrors.startTime
- }, $data.workErrors.startTime ? {
- bS: common_vendor.t($data.workErrors.startTime)
- } : {}, {
- bT: $data.workErrors.endTime
- }, $data.workErrors.endTime ? {
- bU: common_vendor.t($data.workErrors.endTime)
- } : {}, {
- bV: $data.workErrors.companyName ? 1 : "",
- bW: $data.workForm.companyName,
- bX: common_vendor.o(($event) => $data.workForm.companyName = $event.detail.value),
- bY: $data.workErrors.companyName
- }, $data.workErrors.companyName ? {
- bZ: common_vendor.t($data.workErrors.companyName)
- } : {}, {
- ca: $data.workErrors.employeeCount ? 1 : "",
- cb: $data.workForm.employeeCount,
- cc: common_vendor.o(($event) => $data.workForm.employeeCount = $event.detail.value),
- cd: $data.workErrors.employeeCount
- }, $data.workErrors.employeeCount ? {
- ce: common_vendor.t($data.workErrors.employeeCount)
- } : {}, {
- cf: $data.workErrors.department ? 1 : "",
- cg: $data.workForm.department,
- ch: common_vendor.o(($event) => $data.workForm.department = $event.detail.value),
- ci: $data.workErrors.department
- }, $data.workErrors.department ? {
- cj: common_vendor.t($data.workErrors.department)
- } : {}, {
- ck: $data.workErrors.position ? 1 : "",
- cl: $data.workForm.position,
- cm: common_vendor.o(($event) => $data.workForm.position = $event.detail.value),
- cn: $data.workErrors.position
- }, $data.workErrors.position ? {
- co: common_vendor.t($data.workErrors.position)
- } : {}, {
- cp: $data.workForm.monthlySalary,
- cq: common_vendor.o(($event) => $data.workForm.monthlySalary = $event.detail.value),
- cr: $data.workErrors.monthlySalary
- }, $data.workErrors.monthlySalary ? {
- cs: common_vendor.t($data.workErrors.monthlySalary)
- } : {}, {
- ct: $data.workForm.supervisor,
- cv: common_vendor.o(($event) => $data.workForm.supervisor = $event.detail.value),
- cw: $data.workErrors.supervisor
- }, $data.workErrors.supervisor ? {
- cx: common_vendor.t($data.workErrors.supervisor)
- } : {}, {
- cy: $data.workForm.supervisorPhone,
- cz: common_vendor.o(($event) => $data.workForm.supervisorPhone = $event.detail.value),
- cA: $data.workErrors.supervisorPhone
- }, $data.workErrors.supervisorPhone ? {
- cB: common_vendor.t($data.workErrors.supervisorPhone)
- } : {}, {
- cC: common_vendor.t($data.isEditingWork ? "✓" : "+"),
- cD: common_vendor.o((...args) => $options.saveWork && $options.saveWork(...args)),
- cE: common_vendor.t($data.isEditingWork ? "保存修改" : "添加工作经历")
- }) : {}) : {}, {
- cF: $options.showPrevButton
- }, $options.showPrevButton ? {
- cG: common_vendor.o((...args) => $options.prevStep && $options.prevStep(...args))
- } : {}, {
- cH: $options.showNextButton
- }, $options.showNextButton ? {
- cI: common_vendor.o((...args) => $options.nextStep && $options.nextStep(...args))
- } : {}, {
- cJ: $options.showSubmitButton
- }, $options.showSubmitButton ? {
- cK: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args))
- } : {});
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
- wx.createPage(MiniProgramPage);
|