Przeglądaj źródła

修改查看报告页面进行修改组织架构时增加清空--以及全选按钮

plg 5 dni temu
rodzic
commit
d705ab708b
2 zmienionych plików z 104 dodań i 50 usunięć
  1. 100 48
      src/components/PlanReport.vue
  2. 4 2
      src/utils/http.js

+ 100 - 48
src/components/PlanReport.vue

@@ -284,20 +284,33 @@
           </el-form-item>
           <el-form-item label="组织架构选择" class="org_class">
             <el-select
+              :popper-append-to-body="false"
               collapse-tags
-              width="300px"
               multiple
               v-model="orgName"
               @change="userOrgName"
               placeholder="请选择组织架构"
             >
               <el-option
-                style="width: 300px"
                 v-for="item in orgList"
                 :key="item.id"
                 :label="item.orgName"
                 :value="item.orgNo"
-              ></el-option>
+              >
+              </el-option>
+              <div class="button_report">
+                <el-button
+                  size="mini"
+                  type="success"
+                  class="all_select"
+                  @click="selectAllFun"
+                >
+                  全选
+                </el-button>
+                <el-button size="mini" class="all_clear" @click="clearAllFun">
+                  清空
+                </el-button>
+              </div>
             </el-select>
           </el-form-item>
         </el-form>
@@ -422,7 +435,7 @@
             >
             </el-table-column>
 
-            <el-table-column label="症状" align="center" >
+            <el-table-column label="症状" align="center">
               <template slot-scope="scope">
                 <div
                   v-show="scope.row.dimensionSymptom == '重度'"
@@ -592,6 +605,7 @@ import BingChart from "@/components/BingChart";
 import BingChart2 from "@/components/BingChart2";
 import { basePath } from "../utils/http";
 import report1 from "../components/Report1.vue";
+import { reject, resolve } from "core-js/fn/promise";
 export default {
   components: {
     BingChart,
@@ -799,17 +813,39 @@ export default {
     window.addEventListener("resize", this.echartsAllSize);
   },
   destroyed() {
-    console.log("报告页面销毁了");
     window.removeEventListener("resize", this.echartsAllSize);
   },
   methods: {
-    
+    selectAllFun() {
+      this.getOrgList1().then(() => {
+        let params = {
+          dimensionName: this.dime,
+          orgList: this.orgName,
+          planId: this.planId,
+          quesType: this.tabName,
+          quesValue: this.subValue,
+        };
+        this.queryBread(params);
+      });
+    },
+    clearAllFun() {
+      this.orgName = [];
+      let params = {
+        dimensionName: this.dime,
+        orgList: this.orgName,
+        planId: this.planId,
+        quesType: this.tabName,
+        quesValue: this.subValue,
+      };
+      this.queryBread(params);
+      //清空的时候也是选择的全部
+    },
     selectPlan(val) {
       this.addRegisterUser(val);
     },
     addRegisterUser(val) {
-      let obj=val
-      obj.planName=this.planName
+      let obj = val;
+      obj.planName = this.planName;
       this.$refs.register.open(obj);
     },
     //导出心理异常的人员
@@ -837,9 +873,7 @@ export default {
       //下载
       let a = document.createElement("a");
       document.body.appendChild(a);
-      console.log(
-        basePath + `/planUser/exportCompletedUserHighRisk?planId=${this.planId}`
-      );
+
       a.setAttribute(
         "href",
         basePath + `/planUser/exportCompletedUserHighRisk?planId=${this.planId}`
@@ -889,9 +923,7 @@ export default {
     },
     //tab状态改变
     tabFun(a) {
-      console.log("this.tabName");
-      console.log(this.tabName);
-      console.log(this.subDimeList);
+
       // this.tabNameCurrent=
       let linT = [];
       linT = this.subDimeList.filter((item) => {
@@ -1067,7 +1099,6 @@ export default {
       );
     },
     userTypeChange(val) {
-      console.log(this.userType);
       this.pageNum = 1;
       if (val == "心理异常") {
         this.getAbnormalList();
@@ -1204,19 +1235,24 @@ export default {
     },
     //组织架构选择--
     getOrgList1() {
-      this.$http.get(`/planOrg/findAllByPlanId?planId=${this.planId}`, {}, (res) => {
-        if (res && res.code == 200) {
-          if (res.data.length > 0) {
-            let list = [];
-            for (let i = 0; i < res.data.length; i++) {
-              list.push(res.data[i].orgNo);
+      //修改为promise模式以便 进行调用回调的操作
+      return new Promise((resolve, reject) => {
+        this.$http.get(`/planOrg/findAllByPlanId?planId=${this.planId}`, {}, (res) => {
+          if (res && res.code == 200) {
+            resolve();
+            if (res.data.length > 0) {
+              let list = [];
+              for (let i = 0; i < res.data.length; i++) {
+                list.push(res.data[i].orgNo);
+              }
+              this.orgName = list;
+              this.orgList = res.data;
             }
-            this.orgName = list;
-            this.orgList = res.data;
+          } else {
+            reject();
+            this.$message.error(res.msg);
           }
-        } else {
-          this.$message.error(res.msg);
-        }
+        });
       });
     },
     getOrgList(val) {
@@ -1285,8 +1321,6 @@ export default {
         {},
         (res) => {
           if (res && res.code == 200) {
-            // console.log("饼图数据");
-            // console.log(res.data);
 
             this.subAll = res.data.totalNum;
             this.subSingle = res.data.highNum;
@@ -1405,35 +1439,35 @@ export default {
 .radio_group_style >>> .el-radio-button__inner {
   background-color: #f5f7fa;
 }
-</style>
-<style>
-.el-dialog {
-  border-radius: 20px !important;
-}
-.el-tabs__content {
-  display: contents !important;
-}
-.org_class >>> .el-select-dropdown.is-multiple .el-select-dropdown__item {
-  width: 300px !important;
-}
-.org_class >>> .el-select-dropdown__item {
-  width: 300px !important;
-}
-</style>
-<style scoped>
 .org_class >>> .el-input__inner {
   width: 300px !important;
 }
 .org_class >>> .el-input {
   width: 300px;
 }
-.org_class >>> .el-select-dropdown.is-multiple .el-select-dropdown__item {
-  width: 300px !important;
+.org_class >>> .el-scrollbar__bar.is-vertical {
+  padding-bottom: 40px !important;
 }
-.org_class >>> .el-select-dropdown__item {
-  width: 300px !important;
+.org_class >>> .el-select-dropdown__wrap {
+  padding-bottom: 40px !important;
 }
 </style>
+<style>
+.el-dialog {
+  border-radius: 20px !important;
+}
+.el-tabs__content {
+  display: contents !important;
+}
+
+/* .el-scrollbar {
+  padding-bottom: 40px !important;
+} */
+/* .el-scrollbar {
+  padding-bottom: 40px !important;
+} */
+</style>
+
 <style lang="less" scoped>
 .pag_class /deep/ .el-input__inner {
   width: 100% !important;
@@ -1546,4 +1580,22 @@ export default {
     }
   }
 }
+.button_report {
+  background-color: #ffffff;
+  position: absolute;
+  padding-top: 10px;
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  padding-bottom: 10px;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  .all_select {
+    cursor: pointer;
+  }
+  .all_clear {
+    cursor: pointer;
+  }
+}
 </style>

+ 4 - 2
src/utils/http.js

@@ -22,9 +22,11 @@ import { router } from "@/router";
 //少锋本地 wifi
 // export const basePath = "http://172.28.50.2:8089";
 //30
-export const basePath = "http://43.143.198.30:8089";
-//
+// export const basePath = "http://43.143.198.30:8089";
+//红朵服务器
 // export const basePath = "http://129.211.221.44:8089";
+//锦泓税务服务器
+export const basePath = "http://146.56.226.174:8089";
 // const base_url = 'http://43.143.198.30:8089/'
 // const base_url = 'http://10.113.248.4:8090/'
 // export const basePath='http://43.143.198.30:8086'