Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/V0.0.2' into V0.0.2

jingyuanchao 2 rokov pred
rodič
commit
e7207f7807
1 zmenil súbory, kde vykonal 35 pridanie a 16 odobranie
  1. 35 16
      src/views/resumption/plan/index.vue

+ 35 - 16
src/views/resumption/plan/index.vue

@@ -259,7 +259,7 @@
           </el-table-column>
 
           <el-table-column
-            prop="modifiedName"
+            prop="updateName"
             label="修改人"
             v-if="columns[6].visible"
           ></el-table-column>
@@ -280,9 +280,10 @@
             </template>
           </el-table-column>
 
-          <el-table-column fixed="right"  width="120" label="操作">
+          <el-table-column fixed="right" width="120" label="操作">
             <template slot-scope="r">
               <el-button
+                v-if="eqOrg(r.row)"
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
@@ -291,6 +292,7 @@
                 >编辑</el-button
               >
               <el-button
+                v-if="eqOrg(r.row)"
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
@@ -305,7 +307,8 @@
                 v-if="checkCanPublish(r.row)"
                 @click="showDialogDistribute(r.row)"
                 v-hasPermi="['system:user:remove']"
-                >下发</el-button>
+                >下发</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -332,7 +335,7 @@
 <script>
 import DialogDistribute from "@/views/resumption/plan/distribute.vue";
 import OrgTree from "@/components/orgTree";
-import { mapState, mapMutations } from "vuex";
+import { mapState, mapMutations,mapGetters } from "vuex";
 import DialogEdit from "./dialog.edit";
 import * as api from "@/api/resumption/plan";
 import { statusOptions, getLabel } from "./../../commonOption";
@@ -375,8 +378,8 @@ export default {
         planName: null,
         pageNum: 1,
         pageSize: 10,
-        checkSub:true,
-        roleList:[],
+        checkSub: true,
+        roleList: [],
         ...query,
       },
       pageData: [],
@@ -401,25 +404,38 @@ export default {
   watch: {},
   computed: {
     ...mapState([]),
+    ...mapGetters(["orgId", "orgName"]),
   },
   methods: {
     ...mapMutations([]),
-        //已完成下发的计划不显示下发按钮
+    //判断是否跟当前用户同机构
+    eqOrg(row) {
+      // console.log(row.planCreateOrgId,"row.planCreateOrgId");
+      // console.log(this.orgId,"this.orgId");
+      if (
+        row != null &&
+        row != undefined &&
+        row.planCreateOrgId == this.orgId
+      ) {
+        return true;
+      }
+      return false;
+    },
+    //已完成下发的计划不显示下发按钮
     checkCanPublish(row) {
-      if (row.createOrgType == "1"&&row.children.length==0) {
-        return true
+      if (row.createOrgType == "1" && row.children.length == 0) {
+        return true;
       }
       return false;
     },
-    sel(selectList){
+    sel(selectList) {
       this.loading = true;
       api.distribute(selectList).then((response) => {
         this.getList();
-          this.loading = false;
-        })
+        this.loading = false;
+      });
     },
     async getRolesByOrg() {
-
       await allRole().then((res) => {
         // console.info(res);
         this.resumptionRoles = res.data;
@@ -427,8 +443,11 @@ export default {
     },
     getList() {
       this.loading = true;
-      this.queryParams.roleList=[];
-      if(this.queryParams.resumptionRole!=null&&this.queryParams.resumptionRole!=''){
+      this.queryParams.roleList = [];
+      if (
+        this.queryParams.resumptionRole != null &&
+        this.queryParams.resumptionRole != ""
+      ) {
         this.queryParams.roleList.push(this.queryParams.resumptionRole);
       }
 
@@ -454,7 +473,7 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
-    showDialogDistribute(row){
+    showDialogDistribute(row) {
       this.$refs.dialogDistribute.show(row);
     },
     async onDel(id, name) {