feige
2024-11-19 799f206549b25ca0ae8dee94d21b987fc1e6e26c
ruoyi-ui/src/views/clanManager/clan/index.vue
@@ -56,13 +56,13 @@
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="roleList" :row-key="getRowId" @selection-change="handleSelectionChange">
    <el-table v-loading="loading" border :data="roleList" :row-key="getRowId" @selection-change="handleSelectionChange">
    <el-table-column type="selection" width="55"  align="center" />
    <el-table-column fixed label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="100"/>
    <el-table-column label="家族号名称" prop="clanName" sortable :show-overflow-tooltip="true" width="150" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
      <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" >
        <template slot-scope="scope"  v-if="scope.row.id !== 1">
          <el-button
            size="mini"
@@ -71,13 +71,13 @@
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:role:edit']"
          >修改</el-button>
          <el-button
     <!--     <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:role:remove']"
          >删除</el-button>
          >删除</el-button> -->
        </template>
      </el-table-column>
@@ -203,6 +203,7 @@
      },
      personInfos:[],
      personInfos1:[],
     res: false,
      // 表单参数
      form: {
        clanId: undefined,
@@ -221,26 +222,37 @@
      }
    };
  },
  watch: {
            'form.clanName': function(newVal, oldVal){
            // alert(newVal)
            // alert(oldVal)
                if(newVal==oldVal||oldVal==undefined)
               this.res = false;
            else
               this.res = true;
            },
         },
  created() {
    this.getList();
    this.getAllUser();
    //this.getAllUser();
  },
  methods: {
    chongf(){
      //alert(2)
      if(this.form.name!=""){
      findByFname(this.form.name).then(response => {
          console.log(response.data)
       //   alert(response.data!=null)
          if(response.data!=null)
          {
            this.$set(this.form,'name',"")
            this.$modal.msgSuccess("家庭号已经存在!")
          }
      // if(this.form.name!=""){
      // findByFname(this.form.name).then(response => {
      //     console.log(response.data)
      //  //   alert(response.data!=null)
      //     if(response.data!=null)
      //     {
      //       this.$set(this.form,'name',"")
      //       this.$modal.msgSuccess("家庭号已经存在!")
      //     }
         
      });
      }
      // });
      // }
    },
    handleChange(){
      let _this = this;
@@ -372,7 +384,8 @@
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      //this.dateRange = [];
     this.queryParams.clanName = undefined
      this.resetForm("queryForm");
      this.handleQuery();
    },
@@ -475,16 +488,29 @@
    /** 提交按钮 */
    submitForm: function() {
      let _this = this
     //alert(this.res)
     if(this.res == false)
     {
        this.$modal.msgSuccess("家族名称没有修改,不能提交")
      return;
      }
      this.$refs["form"].validate(valid => {
        if (valid) {
        //  alert(this.form.id)
         //alert(this.form.id)
          if (this.form.clanId != undefined) {
          //  alert(this.form.name)
           // this.form.menuIds = this.getMenuAllCheckedKeys();
            updateClan(this.form).then(response => {
            console.log(response)
           this.res = false;
           if(response.msg=="家族名称不能重复!")
            this.$modal.msgSuccess("家族名称不能重复")
            else{
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
           }
            });
          } else {