| | |
| | | </div> |
| | | </el-dialog> |
| | | <!--新增自传--> |
| | | <el-dialog :title="isEdit ? '编辑记录' : '新增记录'" :visible.sync="dialogVisible.autobiography" width="900px" append-to-body> |
| | | <el-dialog :title="isEdit1 ? '编辑记录' : '新增记录'" :visible.sync="dialogVisible.autobiography" width="900px" append-to-body> |
| | | <el-col > |
| | | <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-position="left" > |
| | | <el-row :span="5"> |
| | |
| | | btn:false, |
| | | isShow:true, |
| | | isShow_2:false, |
| | | isEdit:false, |
| | | isEdit1:false, |
| | | formDat: { |
| | | //个人基本信息 |
| | | nickName:undefined, |
| | |
| | | this.dialogVisible.relation1 = false; |
| | | this.dialogVisible.certificate =false; |
| | | this.dialogVisible.abroad=false; |
| | | this.dialogVisible.autobiography=false |
| | | this.dialogVisible.autobiography=false; |
| | | this.isEdit1 = false; |
| | | this.reset(); |
| | | // 清空formDat对象的数据 |
| | | Object.keys(this.formDat).forEach(key => { |
| | | this.formDat[key] = ''; |
| | | }); |
| | | }, |
| | | //下拉 |
| | | handleChange(activeNames) { |
| | |
| | | }, |
| | | //个人自传编辑 |
| | | editData(data) { |
| | | this.isEdit = true; // 设置为编辑操作 |
| | | this.isEdit1 = true; // 设置为编辑操作 |
| | | // 将要修改的数据填充到formDat对象中 |
| | | this.formDat.ageBegin = data.ageBegin; |
| | | this.formDat.ageEnd = data.ageEnd; |
| | |
| | | // 根据值找到选中的选项对象 |
| | | const selectedOption = this.typeOptions.find(option => option.value === this.formDat.term); |
| | | |
| | | if (this.isEdit) { |
| | | if (this.isEdit1) { |
| | | // 执行修改操作 |
| | | updateAutobiography(this.formDat).then(response => { |
| | | // 将选中选项的文本设置为"term"字段的值 |
| | |
| | | console.log("1") |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.dialogVisible.autobiography = false; |
| | | this.isEdit1 = false; |
| | | this.getList(); |
| | | }).catch(error => { |
| | | console.log(error); |
| | | this.isEdit1 = false; |
| | | this.dialogVisible.autobiography = false; |
| | | }); |
| | | } else { |
| | |
| | | this.formDat[key] = ''; |
| | | }); |
| | | // 重置isEdit为false,以便下次点击新增时为新增操作 |
| | | this.isEdit = false; |
| | | this.isEdit1 = false; |
| | | }, |
| | | |
| | | editRow(row) { |