xvying 1 éve
szülő
commit
4c13c5f5bb
2 módosított fájl, 58 hozzáadás és 62 törlés
  1. 2 2
      src/router/index.js
  2. 56 60
      src/views/organization/list.vue

+ 2 - 2
src/router/index.js

@@ -36,7 +36,7 @@ export const asyncRoutes = [
     component: Layout,
     redirect: "/organization/list",
     name: "organization",
-    meta: { title: "支部管理", icon: "tree", roles: ["Super admin"] },
+    meta: { title: "支部管理", icon: "tree", roles: ["Super admin", "Admin"] },
     children: [
       {
         path: "list",
@@ -426,7 +426,7 @@ export const asyncRoutes = [
         meta: {
           title: "视频学习",
           icon: "videos",
-          roles: ["Super admin", "Admin"],
+          roles: ["Super admin", "Admin", "Student"],
         },
       },
       {

+ 56 - 60
src/views/organization/list.vue

@@ -44,9 +44,9 @@
         <template slot-scope="{ row }">
           {{
             row.activists_member_num +
-              row.development_member_num +
-              row.prepare_party_member_num +
-              row.party_member_num
+            row.development_member_num +
+            row.prepare_party_member_num +
+            row.party_member_num
           }}
         </template>
       </el-table-column>
@@ -98,20 +98,18 @@
       </el-table-column>
       <el-table-column prop="address" label="操作" width="250" align="center">
         <template slot-scope="{ row }">
-          <el-button
-            type="primary"
-            plain
-            size="mini"
-            @click="organizeDetail(row)"
+          <el-button type="primary" size="mini" @click="organizeDetail(row)"
             >详情</el-button
           >
-          <el-button type="success" plain size="mini" @click="edit(row)"
+          <el-button type="primary" size="mini" @click="organizeDetail(row)"
+            >支部活动</el-button
+          >
+          <el-button type="success" size="mini" @click="edit(row)"
             >编辑</el-button
           >
           <el-button
             v-if="roles == 'superAdmin'"
             type="warning"
-            plain
             :disabled="row.is_init == 1 ? true : false"
             size="mini"
             @click="deleteList(row.id)"
@@ -239,7 +237,7 @@
             </div>
             <svg-icon
               icon-class="add"
-              style="color:#409EFF;font-size:24px;"
+              style="color: #409eff; font-size: 24px"
               @click="addOtherPerson"
             />
           </el-form-item>
@@ -343,7 +341,7 @@ import {
   fatherLists,
   editOrganization,
   deleteOrganization,
-  buildOrganizations
+  buildOrganizations,
 } from "@/api/organizationList/index";
 import store from "@/store";
 export default {
@@ -356,7 +354,7 @@ export default {
         name: "", //支部名称
         zb_sj: "", //支部书记
         limit: 15, //每页显示条数
-        page: 1 //当前页码
+        page: 1, //当前页码
       }, //搜索框数据
 
       totalPage: 0, //总页码
@@ -364,25 +362,25 @@ export default {
       fatherList: [
         {
           id: 0,
-          name: "未选择"
-        }
+          name: "未选择",
+        },
       ], //父级党组织列表
       organizeType: [
         {
           id: 0,
-          name: "未选择"
-        }
+          name: "未选择",
+        },
       ], //组织类型
       orgainIndex: "", //组织索引
       status: [
         {
           value: 0,
-          name: "暂停"
+          name: "暂停",
         },
         {
           value: 1,
-          name: "正常"
-        }
+          name: "正常",
+        },
       ],
       editForm: {
         name: "",
@@ -391,7 +389,7 @@ export default {
         pid: "",
         set_up_date: "",
         status: "",
-        id: ""
+        id: "",
       },
       createForm: {
         name: "",
@@ -408,8 +406,8 @@ export default {
           zb_fsj: "",
           zb_qnwy: "",
           zb_rq: 1,
-          zb_hj_date: ""
-        }
+          zb_hj_date: "",
+        },
       }, //创建组织表单
 
       otherPerson: [],
@@ -420,17 +418,17 @@ export default {
       creatRules: {
         name: [{ required: true, message: "请输入组织名称", trigger: "blur" }],
         short_name: [
-          { required: true, message: "请输入组织简称", trigger: "blur" }
+          { required: true, message: "请输入组织简称", trigger: "blur" },
         ],
         type: [
-          { required: true, message: "请选择组织类型", trigger: "change" }
+          { required: true, message: "请选择组织类型", trigger: "change" },
         ],
         pid: [{ required: true, message: "请选择父级组织", trigger: "change" }],
         set_up_date: [
-          { required: true, message: "请选择组织成立时间", trigger: "change" }
-        ]
+          { required: true, message: "请选择组织成立时间", trigger: "change" },
+        ],
       },
-      roles: ""
+      roles: "",
     };
   },
   created() {
@@ -447,13 +445,13 @@ export default {
     for (let i in organize) {
       arr.push({
         id: parseInt(i),
-        name: organize[i]
+        name: organize[i],
       });
     }
     this.organizeType = arr;
   },
   methods: {
-    creatZhibu: function() {
+    creatZhibu: function () {
       this.dialogVisible = true;
       this.createForm = {
         type: 5,
@@ -461,8 +459,8 @@ export default {
         status: 1,
         record: {
           zb_qtry: [],
-          zb_rq: 1
-        }
+          zb_rq: 1,
+        },
       };
     },
     //删除其他人员
@@ -479,7 +477,7 @@ export default {
     },
     //获取父级党组织名称
     async fatherOrganiza(name) {
-      await fatherLists(name).then(res => {
+      await fatherLists(name).then((res) => {
         console.log(res);
         this.fatherList = this.fatherList.concat(res.data);
 
@@ -488,8 +486,7 @@ export default {
     },
     //获取党组织列表
     async organizationsList() {
-    
-      await organizationsList(this.searchParams).then(res => {
+      await organizationsList(this.searchParams).then((res) => {
         console.log(res, "909090");
         this.totalPage = res.data.meta.pagination.total;
         this.organizeList = res.data.data;
@@ -507,7 +504,7 @@ export default {
       this.otherPerson.push({
         name: "",
         index: this.index,
-        job: ""
+        job: "",
       });
       console.log(this.otherPerson);
       this.createForm.record.zb_qtry = this.otherPerson;
@@ -526,14 +523,14 @@ export default {
         pid: row.pid,
         set_up_date: row.set_up_date,
         status: row.status,
-        id: row.id
+        id: row.id,
       };
       this.orgainIndex = row.type;
       this.editId = row.id;
     },
     editForms(formName) {
       this.editOrganize = true;
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         if (valid) {
           console.log(this.createForm, "crea6");
           this.editOrganization();
@@ -547,19 +544,19 @@ export default {
     async editOrganization() {
       const data = this.editForm;
       await editOrganization(data)
-        .then(res => {
+        .then((res) => {
           console.log(res, "编辑列表");
           if (res.code === 200) {
             this.$message({
               message: "编辑成功",
-              type: "success"
+              type: "success",
             });
             this.organizationsList();
           } else {
             this.$message.error("编辑失败请重试");
           }
         })
-        .catch(err => {
+        .catch((err) => {
           console.log(err, "");
           this.loadingFull = false;
         });
@@ -569,7 +566,7 @@ export default {
       this.$confirm("此操作将删除此项模板, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           this.deleteOrganize(data);
@@ -577,30 +574,30 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "已取消删除"
+            message: "已取消删除",
           });
         });
     },
     async deleteOrganize(data) {
       console.log(data, "daatata");
-      await deleteOrganization(data).then(res => {
+      await deleteOrganization(data).then((res) => {
         if (!res.code) {
           this.$message({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.organizationsList();
         } else {
           this.$message({
             type: "error",
-            message: "删除失败!"
+            message: "删除失败!",
           });
         }
       });
     },
     submitForm(formName) {
       console.log(this.createForm.type, "创建测试");
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         if (valid) {
           this.buildOrganize();
         } else {
@@ -613,14 +610,14 @@ export default {
       this.loadingFull = true;
       const data = this.createForm;
       await buildOrganizations(data)
-        .then(res => {
+        .then((res) => {
           console.log(res, "chuangjianceshi");
           this.dialogVisible = false;
           this.organizationsList();
           this.loadingFull = false;
           this.$message({
             type: "success",
-            message: "创建成功!"
+            message: "创建成功!",
           });
 
           // this.$store.dispatch("tagsView/delView", this.$route);
@@ -628,7 +625,7 @@ export default {
           //this.$router.go(-1);
           //this.$refs[formName].resetFields();
         })
-        .catch(err => {
+        .catch((err) => {
           console.log(err, "");
           this.loadingFull = false;
         });
@@ -641,7 +638,7 @@ export default {
         pid: "",
         set_up_date: "",
         status: "",
-        id: ""
+        id: "",
       };
       this.createForm = {
         name: "",
@@ -657,29 +654,28 @@ export default {
           zb_qtry: [
             {
               name: "",
-              job: ""
-            }
+              job: "",
+            },
           ],
           zb_fsj: "",
           zb_qnwy: "",
           zb_rq: 1,
-          zb_hj_date: ""
-        }
+          zb_hj_date: "",
+        },
       };
     },
     //切换页码
-   handleCurrentChange (e) {
-   
+    handleCurrentChange(e) {
       this.searchParams.page = e;
 
       this.organizationsList();
     },
     //切换每页显示数量
-   handleSizeChange(e) {
+    handleSizeChange(e) {
       this.searchParams.limit = e;
       this.organizationsList();
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>