tangzy
2021-09-10 8edd0a2c8ebf56fcabc437e3a27935e439a3cd6d
src/views/securityUnitOperation/economicAnalysis.vue
@@ -6,7 +6,7 @@
          <div class="rowTitle">
            <img src="../../../public/img/bajgxt/u1618.png" />
            <span>数据概览</span>
            <el-select class="select0" v-model="value0" placeholder="请选择">
            <!-- <el-select class="select0" v-model="value0" placeholder="请选择">
              <el-option
                v-for="item in options0"
                :key="item.value"
@@ -14,19 +14,22 @@
                :value="item.value"
              >
              </el-option>
            </el-select>
            </el-select> -->
            <el-select
              class="select1"
              v-model="value1"
              ref="treeForm"
              v-model="node.title"
              placeholder="请选择"
              @change="fenjuChange"
            >
              <el-option
                v-for="item in options1"
                :key="item.id"
                :label="item.title"
                :value="item.id"
              >
              <el-option style="height: auto;" :value="node">
                <el-tree
                  :data="options1"
                  default-expand-all
                  node-key="id"
                  @node-click="handleNodeClick"
                  :props="props"
                >
                </el-tree>
              </el-option>
            </el-select>
            <el-select
@@ -73,13 +76,13 @@
    </el-row>
    <el-row :gutter="20">
      <el-col :span="16">
        <div class="rowContent">
        <div class="rowContent" v-loading="loading1">
          <span class="span-title">社保缴纳</span>
          <div id="middleEchart1"></div>
        </div>
      </el-col>
      <el-col :span="8">
        <div class="rowContent">
        <div class="rowContent" v-loading="loading2">
          <span class="span-title">派遣人员占比</span>
          <div id="middleEchart2"></div>
        </div>
@@ -87,8 +90,8 @@
    </el-row>
    <el-row>
      <el-col :span="24">
        <div class="rowContent">
          <span class="span-title">公司经济运转趋势</span>
        <div class="rowContent" v-loading="loading3">
          <span class="span-title">服务客户数量</span>
          <div id="bottomEchart"></div>
        </div>
      </el-col>
@@ -99,14 +102,15 @@
<script>
import * as echarts from "echarts";
import echartJs from "./securityEchart.js";
import { lazyTreeJu } from "../../api/index/index";
import { lazyTreeJu, lazyTrees } from "../../api/index/index";
import {
  getCompanys,
  selectPCount,
  selectTo,
  queryYearSoil,
  queryYearAn,
  queryYearPz
  queryYearPz,
  queryYearKh
} from "../../api/securityUnitOperation/securityUnitOperation";
export default {
  data() {
@@ -151,28 +155,55 @@
        addPaiQ: 0,
        sheBPerson: 0,
        addSheBPerson: 0
      }
      },
      loading1: true,
      loading2: true,
      loading3: true,
      enterpriseName: "",
      props: {
        children: "children",
        label: "title",
        value: "id"
      },
      node: {} //选中的记录
    };
  },
  methods: {
    //点击节点
    handleNodeClick(data) {
      this.node = data;
      this.value1 = data.id;
      this.$refs.treeForm.blur();
      this.getCompanys();
    },
    toEconomicTable() {
      this.$router.push({ path: "/securityUnitOperation/economicTable" });
      this.$router.push({
        path:
          "/securityUnitOperation/economicTable?jurisdiction=" +
          this.value2 +
          "&enterpriseName=" +
          this.enterpriseName +
          "&jurisdiction1=" +
          this.value1
      });
    },
    getFenju() {
      lazyTreeJu().then(res => {
      this.options1 = [];
      this.value1 = "";
      this.node = {};
      lazyTrees().then(res => {
        if (res.data.code === 200) {
          this.options1 = res.data.data;
          this.value1 = this.options1[0] ? this.options1[0].id : "";
          this.node = this.options1[0];
          this.getCompanys();
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    fenjuChange() {
      this.getCompanys();
    },
    pieChange() {
      this.loading2 = true;
      let params = {
        jurisdiction: this.value1,
        deptid: this.value2
@@ -186,6 +217,7 @@
        } else {
          this.$message.error(res.msg);
        }
        this.loading2 = false;
      });
    },
    getCompanys() {
@@ -234,6 +266,7 @@
      });
    },
    getQueryYearSoil() {
      this.loading1 = true;
      let params = {
        jurisdiction: this.value1,
        deptid: this.value2
@@ -249,6 +282,7 @@
                echartJs.economicMiddle(res.data.data, res1.data.data)
              );
            }
            this.loading1 = false;
          });
        } else {
          this.$message.error(res.msg);
@@ -256,11 +290,12 @@
      });
    },
    getQueryYearAn() {
      this.loading3 = true;
      let params = {
        jurisdiction: this.value1,
        deptid: this.value2
      };
      queryYearAn(params).then(res => {
      queryYearKh(params).then(res => {
        if (res.data.code === 200) {
          let bottomEchart = echarts.init(
            document.getElementById("bottomEchart")
@@ -269,9 +304,15 @@
        } else {
          this.$message.error(res.msg);
        }
        this.loading3 = false;
      });
    },
    changeCompanys() {
      this.options2.forEach(item => {
        if (item.departmentid === this.value2) {
          this.enterpriseName = item.enterpriseName;
        }
      });
      this.pieChange();
      this.getSocialSecurity();
      this.getQueryYearSoil();
@@ -284,6 +325,57 @@
};
</script>
<style lang="scss" scoped>
@media screen and (max-width: 1280px) {
  .box-card {
    font-size: 15px;
    width: 128px;
    background: #00aaf1;
    height: 117px;
    text-align: center;
    margin-right: 28px;
    box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
    line-height: 36px;
    span:nth-child(2) {
      color: #06ffff;
      font-size: 31px;
    }
  }
  .col-content {
    margin-top: 39px !important;
  }
}
// 适配分辨率1600*900
@media screen and (min-width: 1281px) and (max-width: 1600px) {
  .box-card {
    font-size: 15px;
    width: 128px;
    background: #00aaf1;
    height: 117px;
    text-align: center;
    margin-right: 66px;
    box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
    line-height: 36px;
    span:nth-child(2) {
      color: #06ffff;
      font-size: 31px;
    }
  }
}
@media screen and(min-width:1601px) and (max-width: 1920px) {
  .box-card {
    width: 150px;
    background: #00aaf1;
    height: 135px;
    text-align: center;
    margin-right: 66px;
    box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
    line-height: 40px;
    span:nth-child(2) {
      color: #06ffff;
      font-size: 34px;
    }
  }
}
.page1 {
  height: 100%;
  width: 100%;
@@ -321,23 +413,11 @@
    font-weight: 600;
  }
}
.box-card {
  width: 150px;
  background: #00aaf1;
  height: 135px;
  text-align: center;
  margin-right: 66px;
  box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
  line-height: 40px;
}
.box-card span {
  display: block;
  width: 100%;
  color: #fff;
}
.box-card span:nth-child(2) {
  color: #06ffff;
  font-size: 34px;
}
.rowTitle {
  height: 40px;