保安服务企业管理-验收版本
liuyg
2021-09-11 c43954206a6392a6d0ee427c9adc626265152f98
保安智能分析
3 files modified
3 files added
435 ■■■■■ changed files
public/img/table.png patch | view | raw | blame | history
src/api/securityAnalysis/securityAnalysis.js 13 ●●●●● patch | view | raw | blame | history
src/styles/element-ui.scss 5 ●●●●● patch | view | raw | blame | history
src/views/securityAnalysis/certificate.vue 103 ●●●●● patch | view | raw | blame | history
src/views/securityAnalysis/examination.vue 123 ●●●●● patch | view | raw | blame | history
src/views/securityAnalysis/index.vue 191 ●●●●● patch | view | raw | blame | history
public/img/table.png
src/api/securityAnalysis/securityAnalysis.js
@@ -68,4 +68,17 @@
            jurisdiction: jurisdiction,
        }
    })
}
export const getinformationstatisticsXX = (current, size, params) => { //保安员考试情况统计 详细信息  只需要公司的deptid
    return request({
        url: '/api/examScore/score-page',
        // url: 'http://192.168.0.109:81/information/selectExtype',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}
src/styles/element-ui.scss
@@ -294,3 +294,8 @@
.avue-empty__desc {
    color: #fff !important;
}
.certificateTJ .avue-form__menu--center {
    // 统计图持证表格按钮过长
    width: 320px !important;
}
src/views/securityAnalysis/certificate.vue
New file
@@ -0,0 +1,103 @@
<template>
  <div class="certificateTJ">
    <avue-crud
      :option="option1"
      :data="data1"
      :page.sync="page1"
      :table-loading="loading1"
      @on-load="getPractitionersPageInfo(page1)"
      @search-change="searchChange"
      @search-reset="searchReset"
    >
    </avue-crud>
  </div>
</template>
<script>
export default {
  props: ["czdata"],
  data() {
    return {
      securityid1: "",
      ExperienceVisible: false,
      loading1: true,
      page1: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      query1: {},
      data1: [],
      option1: {
        addBtn: false,
        searchShowBtn: false,
        columnBtn: false,
        refreshBtn: false,
        // card: true,
        menu: false,
        height: 450,
        widtd: "auto",
        // calcHeight: 54,
        border: true, //liu
        stripe: true,
        // tip: false,
        index: true,
        // dialogClickModal: false,
        // headerAlign: "center",
        align: "center",
        column: [
          {
            label: "姓名",
            prop: "czname",
            disabled: true,
            search: true,
          },
          {
            label: "是否持证",
            prop: "tpye",
            disabled: true,
          },
          {
            label: "发证时间",
            prop: "czptime",
            disabled: true,
          },
        ],
      },
    };
  },
  methods: {
    getPractitionersPageInfo(page) {
      this.loading1 = false;
      //   this.data1 = this.czdata;
      this.page1.total = this.czdata.length;
      this.data1 = this.czdata.slice(
        (+page.currentPage - 1) * +page.pageSize,
        +page.currentPage * +page.pageSize
      );
    },
    searchChange(params, done) {
      if (params.czname == undefined) {
        this.data1 = this.czdata;
        done();
        return;
      }
      var text = new RegExp(params.czname, "g"),
        d = [];
      for (let k in this.czdata) {
        if (text.test(this.czdata[k].czname)) {
          d.push(this.czdata[k]);
        }
      }
      this.data1 = d;
      done();
    },
    searchReset(done) {
      this.data1 = this.czdata;
    },
  },
};
</script>
<style scoped>
</style>
src/views/securityAnalysis/examination.vue
New file
@@ -0,0 +1,123 @@
<template>
  <div class="certificateTJ">
    <avue-crud
      :option="option1"
      :data="data1"
      :page.sync="page1"
      :table-loading="loading1"
      @on-load="getPractitionersPageInfo(page1)"
      @search-change="searchChange"
      @search-reset="searchReset"
      @refresh-change="refreshChange"
    >
    </avue-crud>
  </div>
</template>
<script>
import {
  getinformationstatisticsXX, //保安员考试情况详情统计
} from "@/api/securityAnalysis/securityAnalysis";
export default {
  props: ["card"],
  data() {
    return {
      securityid1: "",
      ExperienceVisible: false,
      loading1: true,
      page1: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      query1: {},
      data1: [],
      option1: {
        addBtn: false,
        searchShowBtn: false,
        columnBtn: false,
        // refreshBtn: false,
        // card: true,
        menu: false,
        height: 450,
        widtd: "auto",
        // calcHeight: 54,
        border: true, //liu
        stripe: true,
        // tip: false,
        index: true,
        // dialogClickModal: false,
        // headerAlign: "center",
        align: "center",
        column: [
          {
            label: "姓名",
            prop: "securityName",
            disabled: true,
            search: true,
          },
          {
            label: "考试场次",
            prop: "examName",
            disabled: true,
          },
          {
            label: "考试时间",
            prop: "examTime",
            disabled: true,
          },
          {
            label: "考试分数",
            prop: "allGrade",
            disabled: true,
          },
        ],
      },
    };
  },
  methods: {
    getPractitionersPageInfo(page, params = {}) {
      // this.data1 = this.czdata;
      console.log(page);
      params = {
        ...params,
        ...this.card,
      };
      getinformationstatisticsXX(page.currentPage, page.pageSize, params).then(
        (res) => {
          // console.log(res.data.data.records);
          const data = res.data.data;
          this.data1 = data.records;
          this.page1.total = data.total;
          this.loading1 = false;
        }
      );
    },
    refreshChange() {
      this.getPractitionersPageInfo(this.page1);
    },
    searchChange(params, done) {
      if (params.czname == undefined) {
        this.data1 = this.czdata;
        done();
        return;
      }
      var text = new RegExp(params.czname, "g"),
        d = [];
      for (let k in this.czdata) {
        if (text.test(this.czdata[k].czname)) {
          d.push(this.czdata[k]);
        }
      }
      this.data1 = d;
      done();
    },
    searchReset(done) {
      this.data1 = this.czdata;
    },
  },
};
</script>
<style scoped>
</style>
src/views/securityAnalysis/index.vue
@@ -2,7 +2,19 @@
  <div class="securityAnalysis">
    <!-- securityAnalysis -->
    <div class="securityAnalysisleft">
      <div class="examine" ref="ech1">
      <div class="examines">
        <div class="examine" ref="ech1"></div>
        <div class="examine1">
          <!-- <div>审查时间:</div>
          <div>审查时间:</div>
          <div>问题保安员人数:</div>
          <div>问题保安员人数:</div>
          <div>问题保安员比例:</div>
          <div>问题保安员比例:</div> -->
          <div v-for="(item, index) in examine1" :key="index">
            {{ item.title }}<br />{{ item.value }}
          </div>
        </div>
        <!-- 保安员审查情况统计
        <div>饼图</div> -->
      </div>
@@ -10,6 +22,7 @@
        <!-- 保安员持证情况统计
        <div>饼图</div> -->
      </div>
      <!-- <div class="czbut"></div> -->
    </div>
    <div class="securityAnalysiscenter">
      <div class="examination" ref="ech3">
@@ -31,6 +44,21 @@
        <div>饼图</div> -->
      </div>
    </div>
    <div>
      <el-dialog
        width="1111px"
        :title="titles"
        append-to-body
        :visible.sync="dialogVisible"
        top="10vh"
      >
        <certificate :czdata="czdata" v-if="sees == 1"></certificate>
        <examination
          :card="{ deptid: deptid, jurisdiction: jurisdiction }"
          v-if="sees == 2"
        ></examination>
      </el-dialog>
    </div>
  </div>
</template>
@@ -45,7 +73,13 @@
} from "@/api/securityAnalysis/securityAnalysis";
import { mapState } from "vuex";
import { getRoleDetail } from "@/api/system/role";
import certificate from "./certificate.vue";
import examination from "./examination.vue";
export default {
  components: {
    certificate,
    examination,
  },
  data() {
    return {
      EC1: "", //保安员审查情况统计 // 饼图
@@ -56,6 +90,14 @@
      EC6: "", //社保缴纳情况统计 // 饼图
      deptid: "",
      jurisdiction: "",
      examine1: [],
      dialogVisible: false,
      titles: "",
      czdata: [],
      sees: "",
    };
  },
  computed: {
@@ -121,6 +163,21 @@
      // console.log(d, ok, no);
      return d;
    },
    getTime() {
      var data = new Date();
      var time = data.toLocaleString().slice(0, 9);
      return time;
    },
    GetPercent(num, total) {
      num = parseFloat(num);
      total = parseFloat(total);
      if (isNaN(num) || isNaN(total)) {
        return "-";
      }
      return total <= 0
        ? "0%"
        : Math.round((num / total) * 10000) / 100.0 + "%";
    },
    getEC1() {
      var that = this;
      getinformationselectExtype(this.deptid, this.jurisdiction)
@@ -135,6 +192,21 @@
        });
    },
    setEC1(d) {
      // console.log(d, 1);
      this.examine1 = [
        {
          title: "审查时间:",
          value: this.getTime(),
        },
        {
          title: "问题保安员人数:",
          value: d[1].value + "人",
        },
        {
          title: "问题保安员比例:",
          value: this.GetPercent(+d[1].value, +d[0].value + +d[1].value),
        },
      ];
      var option, data;
      // if (d) {
      data = d;
@@ -164,6 +236,12 @@
          x: "center",
          y: "90%",
        },
        // grid: {
        //   // left: "3%",
        //   right: "5%",
        //   // bottom: "3%",
        //   // containLabel: true,
        // },
        series: [
          {
            // name: "访问来源",
@@ -209,16 +287,60 @@
      getinformationselectHold(this.deptid, this.jurisdiction)
        .then((res) => {
          var a = res.data.data;
          console.log(a, "持证");
          var b = that.changedata(a, "cz", "wcz", "持证", "未持证");
          that.setEC2(b);
          var datas = [];
          for (var k in a) {
            let b = "";
            let c = [];
            if (a[k].cz >= 1) {
              b = {
                czname: a[k].czname.split(","),
                czptime: a[k].czptime.split(","),
              };
              // datas.push(a[k]);
              // console.log(b, 123);
              if (b.czname.length > 1) {
                for (var n in b.czname) {
                  c.push({
                    czname: b.czname[n],
                    czptime: b.czptime[n] == 0 ? "" : b.czptime[n],
                    tpye: "持证",
                  });
                }
              } else {
                c = [
                  {
                    czname: b.czname[0],
                    czptime: b.czptime[0] == 0 ? "" : b.czptime[0],
                    tpye: "持证",
                  },
                ];
              }
              // console.log(c, 132456);
              datas.push(...c);
            }
            if (a[k].wcz >= 1) {
              b = {
                wczname: a[k].wczname.split(","),
                wczptime: a[k].wczptime.split(","),
              };
              console.log(b, 123);
            }
          }
          // that.czdata = [...datas, ...datas];
          that.czdata = datas;
        })
        .catch((res) => {
          var b = that.changedata([], "cz", "wcz", "持证", "未持证");
          that.setEC1(b);
          that.setEC2(b);
        });
    },
    setEC2(data) {
      var option;
      var that = this;
      // console.log(data, "持证");
      option = {
        title: {
          text: "保安员持证情况统计",
@@ -234,6 +356,24 @@
          // left: "left", x: "center",
          x: "center",
          y: "83%",
        },
        toolbox: {
          show: true,
          itemSize: 25,
          top: 20,
          right: 20,
          feature: {
            myTool1: {
              show: true,
              title: "持证情况查询",
              icon: "path://M137 66l37 63h-74zM921 921l-63 37v-74zM287 381h66c17.1 0 31 13.9 31 31v354c0 17.1-13.9 31-31 31h-66c-17.1 0-31-13.9-31-31V412c0-17.1 13.9-31 31-31zM491 193h66c17.1 0 31 13.9 31 31v542c0 17.1-13.9 31-31 31h-66c-17.1 0-31-13.9-31-31V224c0-17.1 13.9-31 31-31zM695 469h66c17.1 0 31 13.9 31 31v266c0 17.1-13.9 31-31 31h-66c-17.1 0-31-13.9-31-31V500c0-17.1 13.9-31 31-31z",
              onclick: function () {
                that.dialogVisible = true;
                that.sees = 1;
                that.titles = "保安员持证情况统计";
              },
            },
          },
        },
        series: [
          {
@@ -271,7 +411,7 @@
      var that = this;
      getinformationstatistics(this.deptid, this.jurisdiction).then((res) => {
        var a = res.data.data;
        console.log(a, 22222222222222222222);
        // console.log(a, 22222222222222222222);
        // var a = res.data.data,
        //   s = [],
        //   l = [];
@@ -288,7 +428,8 @@
    setEC3(s, l) {
      var xd = [],
        sd = [],
        ld = [];
        ld = [],
        that = this;
      for (var i = 0; i < 100; i++) {
        xd.push(i + "分");
      }
@@ -317,6 +458,24 @@
          // },
          formatter:
            "<span>实操成绩</span>({b0}) :  {c0}<span>人</span><br /><span>理论成绩</span>({b1}) :  {c1}<span>人</span>",
        },
        toolbox: {
          show: true,
          itemSize: 25,
          top: 20,
          right: 20,
          feature: {
            myTool1: {
              show: true,
              title: "考试情况查询",
              icon: "path://M137 66l37 63h-74zM921 921l-63 37v-74zM287 381h66c17.1 0 31 13.9 31 31v354c0 17.1-13.9 31-31 31h-66c-17.1 0-31-13.9-31-31V412c0-17.1 13.9-31 31-31zM491 193h66c17.1 0 31 13.9 31 31v542c0 17.1-13.9 31-31 31h-66c-17.1 0-31-13.9-31-31V224c0-17.1 13.9-31 31-31zM695 469h66c17.1 0 31 13.9 31 31v266c0 17.1-13.9 31-31 31h-66c-17.1 0-31-13.9-31-31V500c0-17.1 13.9-31 31-31z",
              onclick: function () {
                that.dialogVisible = true;
                that.sees = 2;
                that.titles = "保安员考试情况统计";
              },
            },
          },
        },
        legend: {
          data: ["实操成绩", "理论成绩"],
@@ -421,7 +580,7 @@
            }
          }
        }
        console.log(d, "派遣服务单位");
        // console.log(d, "派遣服务单位");
        // console.log(a, 123456);
        // for (var k in a) {
@@ -488,7 +647,7 @@
        })
        .catch((res) => {
          var b = that.changedata([], "pnum", "wpnum", "已派遣", "未派遣");
          that.setEC1(b);
          that.setEC5(b);
        });
    },
    setEC5(d) {
@@ -556,7 +715,7 @@
            "已缴纳社保",
            "未缴纳社保"
          );
          that.setEC1(b);
          that.setEC6(b);
        });
    },
    setEC6(d) {
@@ -678,7 +837,6 @@
  .securityAnalysiscenter {
    width: 40% !important;
  }
  .examine,
  .certificate,
  .examination,
  .dispatchUnit,
@@ -690,6 +848,23 @@
    box-sizing: border-box;
    background-color: #fff;
  }
  .examines {
    width: 100%;
    height: 49%;
    display: flex;
    align-items: center;
    background-color: #fff;
  }
  .examine {
    width: 100%;
    height: 100%;
  }
  .examine1 {
    width: 200px;
    div {
      margin-bottom: 10px;
    }
  }
  // .securityAnalysisleft {
  //   width: $widths;
  // }