保安监管系统-验收版本
zhengpz
2021-12-07 dbb160f7ce6c334ee561e551930ec72b5f5db899
src/views/securityUnitOperation/economicAnalysis.vue
@@ -6,37 +6,26 @@
          <div class="rowTitle">
            <img src="../../../public/img/bajgxt/u1618.png" />
            <span>数据概览</span>
            <el-select
            <avue-input-tree
              class="select1"
              ref="treeForm"
              v-model="node.title"
              placeholder="请选择"
            >
              <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
              default-expand-all
              v-model="value1"
              placeholder="请选择内容"
              type="tree"
              :dic="options1"
              :props="props"
              @change="handleNodeClick"
            ></avue-input-tree>
            <avue-input-tree
              class="select2"
              default-expand-all
              v-model="value2"
              placeholder="请选择"
              placeholder="请选择公司"
              type="tree"
              :dic="options2"
              :props="props2"
              @change="changeCompanys"
            >
              <el-option
                v-for="item in options2"
                :key="item.departmentid"
                :label="item.enterpriseName"
                :value="item.departmentid"
              >
              </el-option>
            </el-select>
            ></avue-input-tree>
            <el-button @click="toEconomicTable">进入数据统计表</el-button>
          </div>
@@ -47,9 +36,20 @@
              <span>较上月增加{{ socialSecurity.addNum }}人</span>
            </div>
            <div class="box-card">
              <span>社保缴纳总额(元)</span>
              <span>{{ socialSecurity.money }}</span>
              <span>较上月增加{{ socialSecurity.addMoney }}元</span>
              <template v-if="socialSecurity.money / 10000 > 1">
                <span>社保缴纳总额(万元)</span>
                <span>{{ (socialSecurity.money / 10000).toFixed(0) }}</span>
              </template>
              <template v-else>
                <span>社保缴纳总额(元)</span>
                <span>{{ Number(socialSecurity.money).toFixed(0) }}</span>
              </template>
              <span
                >较上月增加{{
                  Number(socialSecurity.addMoney).toFixed(0)
                }}元</span
              >
            </div>
            <div class="box-card">
              <span>公司派遣人数</span>
@@ -68,7 +68,7 @@
        <div class="rowContent first-menu">
          <div class="rowTitle">
            <img src="../../../public/img/bajgxt/yj.png" />
            <span>数据概览</span>
            <span>预警分析</span>
          </div>
          <div class="col-content">
@@ -77,36 +77,36 @@
              style="cursor: pointer; "
              @click="showTable('sb')"
            >
              <span>社保缴纳预警(家)</span>
              <span>{{ socialSecurity.num }}</span>
              <span>社保缴纳低于90%</span>
              <span style="margin-top: 24px;">未缴纳社保预警(人)</span>
              <span>{{ yj.sb }}</span>
              <!-- <span>社保缴纳率小于90%</span> -->
            </div>
            <div
              class="box-card"
              style="cursor: pointer; "
              @click="showTable('bx')"
            >
              <span>保险缴纳预警(家)</span>
              <span>{{ socialSecurity.money }}</span>
              <span>保险缴纳低于90%</span>
              <span style="margin-top: 24px;">未缴纳保险预警(人)</span>
              <span>{{ yj.bx }}</span>
              <!-- <span>保险缴纳率小于90%</span> -->
            </div>
            <div
              class="box-card"
              style="cursor: pointer; "
              @click="showTable('fw')"
            >
              <span>服务合同预警(家)</span>
              <span>{{ socialSecurity.paiQ }}</span>
              <span>服务合同不多于一份</span>
              <span style="margin-top: 24px;">服务合同预警(份)</span>
                <span>{{ yj.fw }}</span>
                <span style="font-size:12px;margin-top: -5px;">小于2份</span>
            </div>
            <div
              class="box-card"
              style="cursor: pointer; "
              @click="showTable('pq')"
            >
              <span>派遣预警(家)</span>
              <span>{{ socialSecurity.sheBPerson }}</span>
              <span>派遣比例少于50%</span>
              <span style="margin-top: 24px;">未派遣预警(人)</span>
              <span>{{ yj.pq }}</span>
              <!-- <span>派遣率小于50%</span> -->
            </div>
          </div>
        </div>
@@ -143,158 +143,173 @@
      :modal-append-to-body="false"
    >
      <el-table :data="gridData.data">
        <template v-if="gridData.type === 'sb'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
        <template
          v-if="
            gridData.type === 'sb' ||
              gridData.type === 'bx' ||
              gridData.type === 'pq'
          "
        >
          <el-table-column
            label="序号"
            width="50"
            :key="gridData.type"
            type="index"
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="realName"
            label="保安公司名称"
            label="保安姓名"
            :show-overflow-tooltip="true"
            width="180"
            width="100"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="deptName"
            label="所属辖区"
            label="保安公司"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="sex"
            label="保安总人数"
            label="性别"
            :formatter="sexFormatter"
            :show-overflow-tooltip="true"
            width="100"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="cardid"
            label="社保缴纳人数"
            label="身份证号"
            :show-overflow-tooltip="true"
            width="180"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="age"
            label="社保缴纳比例"
            label="年龄"
            :show-overflow-tooltip="true"
            width="100"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="age"
            label="备注"
            prop="securitynumber"
            label="保安员证编号"
            :show-overflow-tooltip="true"
            width="150"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="phone"
            label="联系方式"
            :show-overflow-tooltip="true"
            width="150"
          ></el-table-column>
        </template>
        <template v-if="gridData.type === 'bx'">
        <!-- <template v-if="gridData.type === 'bx'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterpriseName"
            prop="enterprisename"
            label="保安公司名称"
            width="180"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="znum"
            prop="jurisdictionName"
            label="所属辖区"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="cznum"
            prop="znum"
            label="保安总人数"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="czl"
            prop="cnum"
            label="保险缴纳人数"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="sbnum"
            label="保险缴纳比例"
            prop="pnum"
            label="保险缴纳率"
            :formatter="kslFormatter"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="sbl"
            label="备注"
            :show-overflow-tooltip="true"
          ></el-table-column>
        </template>
        </template> -->
        <template v-if="gridData.type === 'fw'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterpriseName"
            prop="enterprisename"
            label="保安公司名称"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="znum"
            prop="jurisdictionName"
            label="所属辖区"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="cznum"
            prop="znum"
            label="服务合同数"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="painum"
            prop="dispatchUnitName"
            label="服务单位名称"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
          <!-- <el-table-column
            :key="gridData.type"
            prop="pql"
            label="备注"
            :show-overflow-tooltip="true"
          ></el-table-column> </template
        ><template v-if="gridData.type === 'pq'">
          ></el-table-column> -->
        </template>
        <!-- <template v-if="gridData.type === 'pq'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterpriseName"
            prop="enterprisename"
            label="保安公司名称"
            width="180"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="znum"
            prop="jurisdictionName"
            label="所属辖区"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="cznum"
            prop="znum"
            label="保安总人数"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="painum"
            prop="cnum"
            label="派遣人数"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="fwnum"
            label="派遣比例"
            prop="pnum"
            label="派遣率"
            :formatter="kslFormatter"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="pql"
            label="备注"
            :show-overflow-tooltip="true"
          ></el-table-column>
        </template>
        </template> -->
      </el-table>
      <el-pagination
        @current-change="changePage"
@@ -320,8 +335,13 @@
  queryYearSoil,
  queryYearAn,
  queryYearPz,
  queryYearKh
  queryYearKh,
  getSecurityUnitSoilLessPage,
  getSecurityUnitInsuranceLessPage,
  getSecurityUnitServerLessPage1,
  getSecurityUnitDispatcherLessPage
} from "../../api/securityUnitOperation/securityUnitOperation";
import { pageSecurity } from "../../api/statisticalQueryManagement/statisticalQueryManagement";
export default {
  data() {
    return {
@@ -375,6 +395,11 @@
        label: "title",
        value: "id"
      },
      props2: {
        children: "children",
        label: "enterpriseName",
        value: "departmentid"
      },
      node: {}, //选中的记录
      gridData: {
        data: [],
@@ -384,28 +409,62 @@
        title: ""
      },
      dialogloading: false,
      dialogTableVisible: false
      dialogTableVisible: false,
      yj: {
        sb: 0,
        bx: 0,
        fw: 0,
        pq: 0
      }
    };
  },
  methods: {
    sexFormatter(row, column) {
      if (row.sex === 1) {
        return "男";
      } else if (row.sex === 2) {
        return "女";
      }
    },
    kslFormatter(row) {
      if (row.pnum && row.pnum !== "0") {
        return row.pnum + "%";
      } else {
        return row.pnum;
      }
    },
    changePage() {
      this.showcurTable(this.gridData.type);
    },
    showTable(type) {
      this.gridData.type = type;
      this.gridData.current = 1;
      this.gridData.data = [];
      this.showcurTable(type);
    },
    showcurTable(type) {
      // this.dialogloading = true;
      this.dialogTableVisible = true;
      if (type === "sb") {
        this.gridData.title = "社保缴纳预警保安公司";
        this.gridData.title = "未缴纳社保人数";
        // this.getSecurityUnitSoilLessPage();
        this.getPageSecurity("dispatch");
      } else if (type === "bx") {
        this.gridData.title = "保险缴纳预警保安公司";
        this.gridData.title = "未缴纳保险人数";
        // this.getSecurityUnitInsuranceLessPage();
        this.getPageSecurity("soil");
      } else if (type === "fw") {
        this.gridData.title = "服务合同预警保安公司";
        this.getSecurityUnitServerLessPage();
      } else if (type === "pq") {
        this.gridData.title = "派遣预警保安公司";
        this.gridData.title = "未派遣人数";
        // this.getSecurityUnitDispatcherLessPage();
        this.getPageSecurity("insurance");
      }
    },
    //点击节点
    handleNodeClick(data) {
      this.node = data;
      this.value1 = data.id;
      this.$refs.treeForm.blur();
      this.value1 = data;
      this.getCompanys();
    },
    toEconomicTable() {
@@ -456,7 +515,7 @@
      getCompanys({ jurisdiction: this.value1 }).then(res => {
        if (res.data.code === 200) {
          this.options2 = res.data.data;
          this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
          this.value2 = "";
          this.changeCompanys();
        }
      });
@@ -469,27 +528,21 @@
      selectTo(params).then(res => {
        if (res.data.code === 200) {
          let data = res.data.data[0];
          this.socialSecurity.num = data.thismouth;
          this.socialSecurity.addNum = data.thismouth - data.lastmonth;
          this.socialSecurity.money = data.thisamount;
          this.socialSecurity.addMoney = data.thisamount - data.lastamount;
          this.socialSecurity.paiQ = data.userpcthismouth;
          this.socialSecurity.addPaiQ =
            data.userpcthismouth - data.userpclastmouth;
          this.socialSecurity.num = data.znum;
          this.socialSecurity.addNum = data.thismouth;
          this.socialSecurity.money = data.tamountnum.toFixed(0);
          this.socialSecurity.addMoney = data.thisamount.toFixed(0);
          this.socialSecurity.paiQ = data.userpcnum;
          this.socialSecurity.addPaiQ = data.userpcthismouth;
          this.socialSecurity.sheBPerson =
            data.userthismouth && (data.thismouth / data.userthismouth) * 100
              ? ((data.thismouth / data.userthismouth) * 100).toFixed(2) + "%"
            data.usernum && (data.znum / data.usernum) * 100
              ? ((data.znum / data.usernum) * 100).toFixed(2) + "%"
              : 0;
          this.socialSecurity.addSheBPerson =
            data.userthismouth &&
            data.userlastmouth &&
            (data.thismouth / data.userthismouth) * 100 &&
            (data.lastmonth / data.userlastmouth) * 100 &&
            (data.thismouth / data.userthismouth) * 100 -
              (data.lastmonth / data.userlastmouth) * 100
            data.thismouth && data.lastmonth && data.thismouth - data.lastmonth
              ? (
                  (data.thismouth / data.userthismouth) * 100 -
                  (data.lastmonth / data.userlastmouth) * 100
                  ((data.thismouth - data.lastmonth) / data.lastmonth) *
                  100
                ).toFixed(2) + "%"
              : 0;
        } else {
@@ -539,6 +592,116 @@
        this.loading3 = false;
      });
    },
    // 获取预警分析数据
    getPageSecurity(type) {
      let params = {
        jurisdiction: this.value1,
        deptId: this.value2,
        current: this.gridData.current,
        size: 10
      };
      if (type === "dispatch") {
        Object.assign(params, { dispatch: 1 });
      } else if (type === "soil") {
        Object.assign(params, { soil: 1 });
      } else if (type === "insurance") {
        Object.assign(params, { insurance: 1 });
      }
      pageSecurity(params).then(res => {
        if (res.data.code === 200) {
          if (type === "dispatch") {
            this.yj.sb = res.data.data.total;
            this.gridData.data = res.data.data.records;
            this.gridData.total = res.data.data.total;
          } else if (type === "soil") {
            this.yj.bx = res.data.data.total;
            this.gridData.data = res.data.data.records;
            this.gridData.total = res.data.data.total;
          } else if (type === "insurance") {
            this.yj.pq = res.data.data.total;
            this.gridData.data = res.data.data.records;
            this.gridData.total = res.data.data.total;
          }
          if (this.dialogloading) {
            this.dialogloading = false;
          }
        }
      });
    },
    getSecurityUnitSoilLessPage() {
      let params = {
        jurisdiction: this.value1,
        departmentid: this.value2,
        current: this.gridData.current,
        size: 10
      };
      getSecurityUnitSoilLessPage(params).then(res => {
        if (res.data.code === 200) {
          this.yj.sb = res.data.data.total;
          this.gridData.data = res.data.data.records;
          this.gridData.total = res.data.data.total;
        }
        if (this.dialogloading) {
          this.dialogloading = false;
        }
      });
    },
    getSecurityUnitInsuranceLessPage() {
      let params = {
        jurisdiction: this.value1,
        departmentid: this.value2,
        current: this.gridData.current,
        size: 10
      };
      getSecurityUnitInsuranceLessPage(params).then(res => {
        if (res.data.code === 200) {
          this.yj.bx = res.data.data.total;
          this.gridData.data = res.data.data.records;
          this.gridData.total = res.data.data.total;
        }
        if (this.dialogloading) {
          this.dialogloading = false;
        }
      });
    },
    getSecurityUnitServerLessPage() {
      let params = {
        jurisdiction: this.value1,
        departmentid: this.value2,
        current: this.gridData.current,
        size: 10,
        proportion: 2
      };
      getSecurityUnitServerLessPage1(params).then(res => {
        if (res.data.code === 200) {
          this.yj.fw = res.data.data.total;
          this.gridData.data = res.data.data.records;
          this.gridData.total = res.data.data.total;
        }
        if (this.dialogloading) {
          this.dialogloading = false;
        }
      });
    },
    getSecurityUnitDispatcherLessPage() {
      let params = {
        jurisdiction: this.value1,
        departmentid: this.value2,
        current: this.gridData.current,
        size: 10
      };
      getSecurityUnitDispatcherLessPage(params).then(res => {
        if (res.data.code === 200) {
          this.yj.pq = res.data.data.total;
          this.gridData.data = res.data.data.records;
          this.gridData.total = res.data.data.total;
        }
        if (this.dialogloading) {
          this.dialogloading = false;
        }
      });
    },
    changeCompanys() {
      this.options2.forEach(item => {
        if (item.departmentid === this.value2) {
@@ -549,6 +712,18 @@
      this.getSocialSecurity();
      this.getQueryYearSoil();
      this.getQueryYearAn();
      // 获取未缴纳社保人数
      this.getPageSecurity("dispatch");
      // 获取未缴纳保险人数
      this.getPageSecurity("soil");
      // 获取未派遣人数
      this.getPageSecurity("insurance");
      // this.getSecurityUnitSoilLessPage();
      // this.getSecurityUnitInsuranceLessPage();
      this.getSecurityUnitServerLessPage();
      // this.getSecurityUnitDispatcherLessPage();
    }
  },
  mounted() {