Tcsm
2023-08-05 e20f3d2945acedf83676a0720821e9ec5c8f228e
个人自传完善新增按钮
1个文件已修改
19 ■■■■■ 已修改文件
ruoyi-ui/src/views/self/show.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/self/show.vue
@@ -631,7 +631,7 @@
      </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">
@@ -782,7 +782,7 @@
      btn:false,
      isShow:true,
      isShow_2:false,
      isEdit:false,
      isEdit1:false,
      formDat: {
        //个人基本信息
        nickName:undefined,
@@ -982,8 +982,13 @@
      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) {
@@ -1002,7 +1007,7 @@
    },
    //个人自传编辑
    editData(data) {
      this.isEdit = true; // 设置为编辑操作
      this.isEdit1 = true; // 设置为编辑操作
      // 将要修改的数据填充到formDat对象中
      this.formDat.ageBegin = data.ageBegin;
      this.formDat.ageEnd = data.ageEnd;
@@ -1312,7 +1317,7 @@
          // 根据值找到选中的选项对象
          const selectedOption = this.typeOptions.find(option => option.value === this.formDat.term);
          if (this.isEdit) {
          if (this.isEdit1) {
            // 执行修改操作
            updateAutobiography(this.formDat).then(response => {
              // 将选中选项的文本设置为"term"字段的值
@@ -1321,9 +1326,11 @@
              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 {
@@ -1345,7 +1352,7 @@
        this.formDat[key] = '';
      });
      // 重置isEdit为false,以便下次点击新增时为新增操作
      this.isEdit = false;
      this.isEdit1 = false;
    },
    editRow(row) {