Explorar o código

履职计划优化

jiawuxian %!s(int64=2) %!d(string=hai) anos
pai
achega
23b8cdb9a5

+ 1 - 1
src/views/resumption/plan/dialog.edit.vue

@@ -166,7 +166,7 @@
         </el-form>
         <el-button @click="openSelect">新增履职内容</el-button>
        
-        <el-table :data="tableData" style="width: 100%">
+        <el-table :data="tableData" style="width: 100%" height="400px">
           <el-table-column  label="是否扫描" >
             <template v-slot="{ row }"> 
               <el-switch

+ 52 - 6
src/views/resumption/plan/distribute.vue

@@ -4,15 +4,44 @@
     :visible.sync="isShow"
     class="g-dialog-select-safe-check"
     :close-on-click-modal="false"
-    width="55%"
+    width="700px"
     top="10vh"
     append-to-body
   >
     <div class="el-dialog-div">
-      <el-table :data="info.orgAndStatus" height="400px">
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-input
+            size="mini"
+            v-model="filterName"
+            placeholder="按机构名称过滤"
+            @input="filterbyOrgName"
+            clearable
+          ></el-input>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="primary"
+            plain
+            size="mini"
+            @click="handleAllStatus('1')"
+            >全部启用</el-button
+          >
+        </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="danger"
+            plain
+            size="mini"
+            @click="handleAllStatus('0')"
+            >全部禁用</el-button
+          >
+        </el-col>
+      </el-row>
+      <el-table :data="tableData" height="400px">
         <el-table-column type="index" label="序号" width="80"></el-table-column>
         <el-table-column prop="orgName" label="机构名称"></el-table-column>
-        <el-table-column prop="status" label="计划状态">
+        <el-table-column prop="status" label="计划状态" width="150px">
           <template slot-scope="r">
             <el-switch
               v-model="r.row.status"
@@ -39,11 +68,13 @@
 import { listByTypes } from "@/api/system/org.js";
 
 export default {
-  components: {  },
+  components: {},
   data() {
     return {
       isShow: false,
       info: this.emptyInfo(),
+      tableData: [],
+      filterName: null,
     };
   },
   computed: {},
@@ -67,14 +98,29 @@ export default {
         this.info.orgAndStatus = r.data.map((d) => {
           return { orgId: d.id, orgName: d.name, status: "1" };
         });
+        this.tableData = this.info.orgAndStatus;
       });
     },
+    handleAllStatus(status) {
+      this.tableData.forEach((element) => {
+        element.status = status;
+      });
+    },
+    filterbyOrgName(val) {
+      if (!val || !val.trim()) {
+        this.tableData = this.info.orgAndStatus;
+      } else {
+        this.tableData = this.info.orgAndStatus.filter(
+          (o) => o.orgName.indexOf(val) >= 0
+        );
+      }
+    },
     onHide() {
-      this.info=this.emptyInfo();
+      this.info = this.emptyInfo();
       this.isShow = false;
     },
     onSubmit() {
-      console.info(this.info)
+      console.info(this.info);
       this.$emit("select", this.info);
       this.onHide();
     },