|
@@ -0,0 +1,175 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <span><i class="el-icon-share"></i> 家族树 - {{ familyName }}</span>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="模糊条件" prop="searchValue">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.searchValue"
|
|
|
+ placeholder="请输入姓名/手机号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['system:member:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['system:member:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['system:member:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="memberList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="主键ID" align="center" prop="memberId" v-if="false"/>
|
|
|
+ <el-table-column label="ID" align="center" prop="qrcode" width="150" />
|
|
|
+ <el-table-column label="姓名" align="center" prop="name" width="100" />
|
|
|
+ <el-table-column label="父辈" align="center" prop="father" width="100" />
|
|
|
+ <el-table-column label="手机号" align="center" prop="mobile" width="200" />
|
|
|
+ <el-table-column label="性别" align="center" prop="gender" :formatter="genderFormat" width="50" />
|
|
|
+ <el-table-column label="配偶" align="center" prop="spouse" width="100" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['system:member:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['system:member:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { getFamily } from "@/api/system/family";
|
|
|
+import { listTree } from "@/api/system/member";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Tree",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ familyName: null,
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 家族成员表格数据
|
|
|
+ memberList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 配偶
|
|
|
+ spouseOptions:[],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ familyId: null,
|
|
|
+ name: null,
|
|
|
+ gender: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ const fid = this.$route.query.fid;
|
|
|
+ this.queryParams.familyId = fid;
|
|
|
+ this.getFamily(fid);
|
|
|
+ this.getList();
|
|
|
+ this.getDicts("sys_user_sex").then((response) => {
|
|
|
+ this.genderOptions = response.data;
|
|
|
+ });
|
|
|
+ this.getDicts("app_member_state").then((response) => {
|
|
|
+ this.stateOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getFamily(id){
|
|
|
+ getFamily(id).then(response => {
|
|
|
+ this.familyName = response.data.fullName;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 查询家族成员列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listTree(this.queryParams).then(response => {
|
|
|
+ this.memberList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 性别 字典翻译
|
|
|
+ genderFormat(row, column) {
|
|
|
+ return this.selectDictLabel(this.genderOptions, row.gender);
|
|
|
+ },
|
|
|
+ // 状态 字典翻译
|
|
|
+ stateFormat(row, column) {
|
|
|
+ return this.selectDictLabel(this.stateOptions, row.state);
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|