Tcsm
2023-08-05 60ae08e4437faa2c881bda539d57921b837cc8df
ruoyi-ui/src/views/genealogy/index.vue
@@ -19,14 +19,20 @@
      </el-form-item>
      <el-form-item label="身份" prop="identity" >
        <el-input
        <el-select
          v-model="queryParams.identity"
          placeholder="请输入身份"
          placeholder="请选择身份"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery">
          <i slot="prefix" class="el-input__icon el-icon-search"></i>
        </el-input>
          @keyup.enter.native="handleQuery"
        >
          <el-option
            v-for="item in typeOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
@@ -71,14 +77,14 @@
      </el-form-item>
    </el-form>
    <div>
      <div style="width: 149px;
      height: 24px;
      font-size: 18px;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      font-weight: 400;
      color: #000000;
      line-height: 21px;
      ">张氏一览表</div>
<!--      <div style="width: 149px;-->
<!--      height: 24px;-->
<!--      font-size: 18px;-->
<!--      font-family: Microsoft YaHei-Regular, Microsoft YaHei;-->
<!--      font-weight: 400;-->
<!--      color: #000000;-->
<!--      line-height: 21px;-->
<!--      ">张氏一览表</div>-->
      <el-row :gutter="10" class="mb8">
<!--        <el-col :span="1.5">-->
@@ -143,12 +149,14 @@
    <el-table v-loading="loading" :data="listRoot"  @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
      <el-table-column type="selection" width="25"  align="center" />
      <el-table-column  label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/>
      <el-table-column fixed label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/>
      <el-table-column label="身份" prop="identity" sortable width="100" >
        <template slot-scope="scope">
          <span>第{{scope.row.identity}}代</span>
        <template slot-scope="scope" >
          <span v-if="scope.row.isMyFamily==1">第{{scope.row.identity}}代</span>
          <span v-else>——</span>
        </template>
<!--        <template slot-scope="scope">{{ getSrc(scope.row.identity) }}</template>-->
      </el-table-column>
      <el-table-column label="姓名" prop="nickName" sortable :show-overflow-tooltip="true" width="100" align="center"/>
      <el-table-column label="性别" prop="sex" sortable width="100" align="center" >
@@ -201,105 +209,40 @@
    />
  <!--  <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
        <el-form-item label="成员姓名" prop="myName">
          <el-input v-model="formDat.myName" placeholder="请输入成员姓名" clearable :style="{width: '100%'}" >
        <el-form-item label="身份" prop="identity">
          <el-input v-model="formDat.identity" placeholder="请输入成员姓名" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="称呼" prop="nickName">
        <el-form-item label="姓名" prop="nickName">
          <el-input v-model="formDat.nickName" placeholder="请输入称呼" clearable :style="{width: '100%'}" ></el-input>
        </el-form-item>
        <el-form-item label="姓名" prop="name">
          <el-input v-model="formDat.name" placeholder="请输入姓名" clearable :style="{width: '100%'}" >
        <el-form-item label="性别" prop="sex">
          <el-input v-model="formDat.sex" placeholder="请输入姓名" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="工作单位" prop="work">
          <el-input v-model="formDat.work" placeholder="请输入工作单位" clearable :style="{width: '100%'}" >
        <el-form-item label="出生时间" prop="birth">
          <el-input v-model="formDat.birth" placeholder="请输入工作单位" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="手机" prop="phone">
          <el-input v-model="formDat.phone" placeholder="请输入手机" clearable :style="{width: '100%'}" >
        <el-form-item label="全生命周期" prop="deadDay">
          <el-input v-model="formDat.deadDay" placeholder="请输入手机" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="微信" prop="wx">
          <el-input v-model="formDat.wx" placeholder="请输入微信" clearable :style="{width: '100%'}" >
        <el-form-item label="手机号码" prop="phoneNumber">
          <el-input v-model="formDat.phoneNumber" placeholder="请输入微信" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="QQ" prop="qq">
          <el-input v-model="formDat.qq" placeholder="请输入QQ" clearable :style="{width: '100%'}" >
        <el-form-item label="所在单位" prop="unit">
          <el-input v-model="formDat.unit" placeholder="请输入QQ" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="twitter" prop="twitter">
          <el-input v-model="formDat.twitter" placeholder="请输入twitter" clearable :style="{width: '100%'}" >
        <el-form-item label="配偶" prop="spouseName">
          <el-input v-model="formDat.spouseName" placeholder="请输入twitter" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="是否常联系" prop="isAlways">
          <el-input v-model="formDat.isAlways" placeholder="是否常联系" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="备注(是否存在金钱关系)" prop="remark">
          <el-input v-model="formDat.remark" placeholder="请输入备注" clearable :style="{width: '100%'}" ></el-input>
        </el-form-item>
        <h4 class="form-header">电子名片 </h4>
        <el-upload
          action="#"
          list-type="picture-card"
          multiple
          :http-request="requestUpload"
          :file-list="fileList"
        >
          <i slot="default" class="el-icon-plus"></i>
          <div slot="file" slot-scope="{file}">
            <img
              class="el-upload-list__item-thumbnail"
              :src="file.url"
              alt=""
              style="width: 126px; height: 126px"
              fit="cover"
              :preview-src-list="[file.url]"
            >
            <span class="el-upload-list__item-actions">
        <span
          class="el-upload-list__item-preview"
          @click="handlePictureCardPreview(file)"
        >
          <i class="el-icon-zoom-in"></i>
        </span>
        <span
          v-if="!disabled"
          class="el-upload-list__item-delete"
          @click="handleRemove(file)"
        >
          <i class="el-icon-delete"></i>
        </span>
      </span>
          </div>
        </el-upload>
        <h4 class="form-header">其他附件 </h4>
        <el-upload
          action=""
          :file-list="fileListOther"
          class="upload-demo"
          multiple
          :on-remove="handleRemove"
          :http-request="requestUpload"
          :show-file-list="true"
        >
          <el-button type="primary">点击上传</el-button>
          <template #tip>
            <div class="el-upload__tip">
            </div>
          </template>
        </el-upload>
      </el-form>
      <h4 class="form-header"> </h4>
@@ -308,7 +251,7 @@
        <el-button type="primary" @click="submitDataScope">保 存</el-button>
        <el-button @click="cancelData">取 消</el-button>
      </div>
    </el-dialog>  -->
    </el-dialog>
    <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
@@ -402,6 +345,7 @@
        secondFamilyId:undefined,
        childList:undefined,
        identity:undefined,
        isMyFamily:undefined,
        url: undefined,
      },
@@ -456,7 +400,19 @@
        }],
      },
      typeOptions: [],
      typeOptions: [{
        value:'1',
        label:'第1代'
      },{
        value:'2',
        label:'第2代'
      },{
        value:'3',
        label:'第3代'
      },{
        value:'4',
        label:'第4代'
      }],
    };
  },
  created() {
@@ -473,30 +429,30 @@
      this.reset();
    },
     //拿到配偶的姓名
   //   getPerson(id)
   //   {
   //   //  alert(id)
   // //    alert(typeof(id))
   //     // this.listRoot.forEach(function(item, index) {
   //     //             //item 就是当日按循环到的对象
   //     //             //index是循环的索引,从0开始
   //     //              //alert(typeof(item.userId))
   //     //             if(item.userId==id){
   //     //            //   alert(89)
   //     //            alert(item.nickName)
   //     //               return item.nickName
   //     //             }
   //
   //     // })
   //     let username = ""
   //     for(let i = 0; i < this.listRoot.length;i++)
   //     {
   //       if(this.listRoot[i].userId==id)
   //        username = this.listRoot[i].nickName
   //     }
   //     return username;
   //    // return "12ddd"
   //   },
     getPerson(id)
     {
     //  alert(id)
   //    alert(typeof(id))
       // this.listRoot.forEach(function(item, index) {
       //             //item 就是当日按循环到的对象
       //             //index是循环的索引,从0开始
       //              //alert(typeof(item.userId))
       //             if(item.userId==id){
       //            //   alert(89)
       //            alert(item.nickName)
       //               return item.nickName
       //             }
       // })
       let username = ""
       for(let i = 0; i < this.listRoot.length;i++)
       {
         if(this.listRoot[i].userId==id)
          username = this.listRoot[i].nickName
       }
       return username;
      // return "12ddd"
     },
    //隔行变色
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 == 0) {
@@ -505,7 +461,12 @@
        return "statistics-warning-row";
      }
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加证件/荣誉/资质信息";
    },
    /** 查询通讯录列表 */
    getList() {
      this.loading = true;
@@ -526,16 +487,30 @@
      );
    },
    /** 查询类别信息 */
    // getCateInfor()
    // {
    //   let _this = this
    //   getCategory().then(response=>{
    //
    //     response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
    //       _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
    //     })
    //   })
    // },
    getCateInfor()
    {
      let _this = this
      getCategory().then(response=>{
        response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
          _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
        })
      })
    },
    //身份选择
    getSrc(identity) {
      if (identity === '1'){
        return '第1代'
      }else if(identity === '2'){
        return '第2代'
      }else if(identity === '3'){
        return '第3代'
      }else if(identity === '4'){
        return '第4代'
      }else {
        return '其它'
      }
    },
    handleRemove(file) {
      alert(323)
@@ -604,8 +579,8 @@
    /** 查看详细信息 */
    handleCheck(row){
      const id = row.userId;
      alert(id)
     this.$router.push("/familymodel/jiagenwang/getPInfo/" + id);
      // alert(id)
     this.$router.push("/familymodel/jiagenwang/personInfo/" + id);
    },
@@ -668,11 +643,27 @@
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    // handleExport() {
    //   this.download('/self/user/export/genealogy', {
    //     ...this.queryParams
    //   }, `zGenealogy_${new Date().getTime()}.xlsx`)
    // },
    handleExport() {
      this.download('/self/user/export/genealogy', {
        ...this.queryParams
      }, `zGenealogy_${new Date().getTime()}.xlsx`)
      const Ids = this.ids;
      if(Ids.length==0)
      {
        this.download('/self/user/export/genealogy', {
          ...this.queryParams
        }, `zGenealogy_${new Date().getTime()}.xlsx`)
      }else{
        this.download('/self/user/export/genealogy1/'+Ids, {
        }, `zGenealogy_${new Date().getTime()}.xlsx`)
      }
    },
    /** 导入操作*/
    // handleEnport(params){
    //   var file = params.file;