Parcourir la source

委员会名册、党员名册 - 前端表格添加“党支部”

Wang Zi Wen il y a 2 ans
Parent
commit
e1b30a50e5

+ 22 - 1
ruoyi-ui/src/views/branch/dymc/index.vue

@@ -131,6 +131,7 @@
 
     <el-table v-loading="loading" :data="memberList" @selection-change="handleSelectionChange" :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="党支部" align="center" prop="deptId" :formatter="deptListFormat"/>
       <el-table-column label="姓名" align="center" prop="nickName"/>
       <el-table-column label="性别" align="center" prop="sex" :formatter="sysUserSexFormat"/>
       <el-table-column label="出生年月" align="center" prop="birthday">
@@ -330,6 +331,7 @@
   import Treeselect from "@riophae/vue-treeselect";
   import "@riophae/vue-treeselect/dist/vue-treeselect.css";
   import { listUser} from "@/api/system/user";
+  import { listDept } from "@/api/system/dept";
 
   export default {
     name: "Member",
@@ -367,6 +369,8 @@
         memberEthnicOptions: [],
         // 用户列表
         userList: [],
+        // 部门列表
+        deptList: [],
         // 用户导入参数
         upload: {
           // 是否显示弹出层(用户导入)
@@ -451,8 +455,21 @@
         this.memberEthnicOptions = response.data;
       });
       this.getUserList();
+      this.getDeptList();
     },
     methods: {
+      /** 查询部门列表 */
+      getDeptList() {
+        listDept().then(response => {
+          let data = response.data;
+          let deptList = [];
+          for(let i = 0; i < data.length; i++) {
+            let dept = { "dictValue" : data[i].deptId, "dictLabel" : data[i].deptName};
+            deptList.push(dept);
+          }
+          this.deptList = deptList;
+        });
+      },
       /** 查询用户列表 */
       getUserList() {
         listUser().then(response => {
@@ -523,7 +540,7 @@
       sysUserSexFormat(row, column) {
         return this.selectDictLabel(this.sysUserSexOptions, row.sex);
       },
-      // 用户性别字典翻译
+      // 用户民族字典翻译
       memberEthnicFormat(row, column) {
         return this.selectDictLabel(this.memberEthnicOptions, row.ethnic);
       },
@@ -535,6 +552,10 @@
       currentMentorFormat(row, column) {
         return this.selectDictLabel(this.userList, row.currentMentor);
       },
+      // 部门列表字典翻译
+      deptListFormat(row, column) {
+        return this.selectDictLabel(this.deptList, row.deptId);
+      },
       // 取消按钮
       cancel() {
         this.open = false;

+ 24 - 2
ruoyi-ui/src/views/branch/wyhmc/index.vue

@@ -131,6 +131,7 @@
 
     <el-table v-loading="loading" :data="memberList" @selection-change="handleSelectionChange" :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="党支部" align="center" prop="deptId" :formatter="deptListFormat"/>
       <el-table-column label="姓名" align="center" prop="nickName"/>
       <el-table-column label="性别" align="center" prop="sex" :formatter="sysUserSexFormat"/>
       <el-table-column label="出生年月" align="center" prop="birthday">
@@ -331,6 +332,7 @@
   import Treeselect from "@riophae/vue-treeselect";
   import "@riophae/vue-treeselect/dist/vue-treeselect.css";
   import { listUser} from "@/api/system/user";
+  import { listDept } from "@/api/system/dept";
 
   export default {
     name: "Member",
@@ -368,6 +370,8 @@
         memberEthnicOptions: [],
         // 用户列表
         userList: [],
+        // 部门列表
+        deptList: [],
         // 用户导入参数
         upload: {
           // 是否显示弹出层(用户导入)
@@ -452,9 +456,22 @@
       this.getDicts("member_ethnic").then(response => {
         this.memberEthnicOptions = response.data;
       });
-      this.getUserList();
+      this.getUserList()
+      this.getDeptList();
     },
     methods: {
+      /** 查询部门列表 */
+      getDeptList() {
+        listDept().then(response => {
+          let data = response.data;
+          let deptList = [];
+          for(let i = 0; i < data.length; i++) {
+            let dept = { "dictValue" : data[i].deptId, "dictLabel" : data[i].deptName};
+            deptList.push(dept);
+          }
+          this.deptList = deptList;
+        });
+      },
       /** 查询用户列表 */
       getUserList() {
         listUser().then(response => {
@@ -525,7 +542,7 @@
       sysUserSexFormat(row, column) {
         return this.selectDictLabel(this.sysUserSexOptions, row.sex);
       },
-      // 用户性别字典翻译
+      // 用户民族字典翻译
       memberEthnicFormat(row, column) {
         return this.selectDictLabel(this.memberEthnicOptions, row.ethnic);
       },
@@ -537,6 +554,11 @@
       currentMentorFormat(row, column) {
         return this.selectDictLabel(this.userList, row.currentMentor);
       },
+
+      // 部门列表字典翻译
+      deptListFormat(row, column) {
+        return this.selectDictLabel(this.deptList, row.deptId);
+      },
       // 取消按钮
       cancel() {
         this.open = false;