Commit 796faca2 authored by 王李辉's avatar 王李辉
Browse files

风险矩阵

parent 37ca0095
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -474,11 +474,21 @@ const routes = [{
    },
    component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd'),
  },
  {
    path: '/matrix-grad',
    name: 'matrix-grad',
    meta: {
      title: '矩阵式定级',
      index: 1
    },
    component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd/matrixGrad'),
  },
  
  {
    path: '/risk-return',
    name: 'risk-return',
    meta: {
      title: '风险上报',
      title: '风险上报退回列表',
      index: 1
    },
    component: () => import( /* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskReturn'),
+25 −24
Original line number Diff line number Diff line
@@ -295,7 +295,6 @@ export default {
    this.getList();

    this.$bus.$on("sourceAyy", res => {
      console.log(res.join(","));
      this.source1 = res.join(",");
    });
  },
@@ -464,30 +463,8 @@ export default {
      dangerReturnEcho(`/hdreport/edit/${this.taskId}`)
        .then(res => {
          this.$toast.clear();
          let msg = res.data.hdReport;
           // 对数据进行赋值
          this.returnCause = res.data.reason;
          this.projectId = msg.proId;
          // 对所属工程数组筛选出 相同id 的工程名
          let name = this.columnsProjectName.filter(item => {
            return item.id == msg.proId;
          });
          this.projectName = name[0].projectName;
          this.range = msg.hdRange;
          this.type = msg.hdType;
          this.dangerName = msg.hdProjectName;
          this.dangerNum = msg.hdProjectId;
          this.dangerLevel = msg.hdLev;

          this.findTime = msg.hdDiscoveryTime;
          this.source = msg.dangerId;
          this.source1 = msg.dangerSource;
          this.location = msg.hdPosition;
          this.describe = msg.hdDescribe;
          this.hdPicture1 = msg.hdPicture1;
          this.hdVideo1 = msg.hdVideo1;
          this.expireTime = msg.hdExpirationTime;
          this.recPeople = msg.rectificationUser;
        })
        .catch(() => {
          this.$toast.clear();
@@ -497,6 +474,10 @@ export default {

    // 所属工程名称
    onConProjectName(value) {
      if(!value){
        this.showProjectName = false;
        return
      }
      this.projectId = value.id;
      this.projectName = value.projectName;
      this.showProjectName = false;
@@ -507,6 +488,10 @@ export default {
    },
    // 适用范围
    onConRange(value) {
      if(!value){
        this.showRange = false;
        return
      }
      this.range = value.hdRange;
      this.showRange = false;
      this.type = "";
@@ -520,6 +505,10 @@ export default {
    },
    // 隐患类型
    onConType(value) {
      if(!value){
        this.showType = false;
        return
      }
      this.type = value.hdType;
      this.showType = false;
      this.dangerName = "";
@@ -535,6 +524,10 @@ export default {
    },
    // 隐患项目名称
    onConDangerName(value) {
      if(!value){
        this.showDangerName = false;
        return
      }
      this.dangerName = value.hdName;
      this.showDangerName = false;
      // 请求隐患项目编号和隐患级别
@@ -552,6 +545,10 @@ export default {
    },
    // 风险源
    onConSource(value) {
      if(!value){
        this.showSource = false;
        return
      }
      this.source = value.factor;
      this.showSource = false;
      // 请求风险源第二个字段
@@ -586,6 +583,10 @@ export default {
    },
    // 隐患整改人
    onConRecPeople(value) {
      if(!value){
        this.showRecPeople = false;
        return
      }
      this.recPeople = value.userName;
      this.showRecPeople = false;
    },
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    </van-checkbox-group>

    <div class="footer-con">
      <div style="color: #1989fa;">已选择: {{result.length}}</div>
      <div style="color: #1989fa;">已选择: {{result.length}}</div>
      <div>
        <van-button type="info" @click="confirm">确定</van-button>
      </div>
+8 −0
Original line number Diff line number Diff line
@@ -267,11 +267,19 @@ export default {
    },

    onConRect(value) {
      if(!value){
        this.showPickerRect = false;
        return
      }
      this.valueRect = value.userName;
      this.rectId = value.userId;
      this.showPickerRect = false;
    },
    onConReview(value) {
      if(!value){
        this.showPickerReview = false;
        return
      }
      this.valueReview = value.userName;
      this.reviewId = value.userId;
      this.showPickerReview = false;
+61 −66
Original line number Diff line number Diff line
@@ -289,7 +289,15 @@

<script>
import LHeader from "@/components/header.vue";
import { getFormList,postHdSource, postHdType, postHdPeople, postReAdd, postriskConiCause,postRiskShowMeasures } from "@/service/risk";
import {
  getFormList,
  postHdSource,
  postHdType,
  postHdPeople,
  postReAdd,
  postriskConiCause,
  postRiskShowMeasures
} from "@/service/risk";
export default {
  components: {
    LHeader
@@ -314,7 +322,7 @@ export default {
      columnsTrouble: [],
      setRank: "", //风险定级
      showSetRank: false,
      columnsSetRank: [{ text: '矩阵式定级', disabled: true }, "其他定级方式"],
      columnsSetRank: ["矩阵式定级", "其他定级方式"],
      riskRank: "", // 风险等级
      showRiskRank: false,
      columnsRiskRank: ["一般风险", "较小风险", "较大风险", "重大风险"],
@@ -371,30 +379,33 @@ export default {
      formdata.append("emergencyMeasure", this.urgent);

      // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
      values.setRankModeFile.forEach(item => { // 定级方式
      values.setRankModeFile.forEach(item => {
        // 定级方式
        formdata.append("risk1[]", item.file);
      });
      values.technologyFile.forEach(item => {  // 技术措施
      values.technologyFile.forEach(item => {
        // 技术措施
        formdata.append("risk2[]", item.file);
      });
      values.administrationFile.forEach(item => {  // 管理措施
      values.administrationFile.forEach(item => {
        // 管理措施
        formdata.append("risk3[]", item.file);
      });
      values.urgentFile.forEach(item => {  // 应急措施
      values.urgentFile.forEach(item => {
        // 应急措施
        formdata.append("risk4[]", item.file);
      });


      this.$toast.loading({
        message: "提交中...",
        forbidClick: true,
        loadingType: "spinner",
        duration: 0
      });
      let url = "/riskMain/add"
      let url = "/riskMain/add";
      if (this.taskId) {
        formdata.append("id", this.id);
        url = `/riskMain/editSave/${this.taskId}`
        url = `/riskMain/editSave/${this.taskId}`;
      }

      postReAdd(url, formdata)
@@ -444,39 +455,7 @@ export default {
      postriskConiCause(`/riskMain/edit/${this.taskId}`)
        .then(res => {
          this.$toast.clear();
          let msg = res.data.riskMain;
          // 对数据进行赋值
          this.id = msg.id
          this.returnCause = res.data.reason;
          this.factor = msg.riskFactor;
          this.source = msg.riskSource;
          this.trouble = msg.accidentType;
          this.setRank = msg.riskLevel;
          this.riskRank = msg.riskLevel;
          this.setRankMode = msg.gradingMethod;
          this.location = msg.riskPosition;
          this.control = msg.controlLevel;
          this.technology = msg.technicalMeasures;
          this.administration = msg.managementMeasures;
          this.urgent = msg.emergencyMeasure;

          // this.projectId = msg.proId;
          // 对主责部门和主责人员筛选出 相同id 的工程名
          this.mainDutyDeptId = msg.responsibilityDept;
          this.mainDutyDept = res.data.ResponsibilityMember.organizationName;
          this.mainDutyPeopLeId = msg.responsibilityMember;
          // 请求主责人员
          let formdata1 = new FormData();
          formdata1.append("organizationId", this.mainDutyDeptId);
          postHdPeople(`/riskMain/getUserList`, formdata1).then(res => {
            this.columnsMainDutyPeopLe = res.data;

            let deptMingzi = this.columnsMainDutyPeopLe.filter(item => {
              return item.userId == msg.responsibilityMember;
            });
            this.mainDutyPeopLe = deptMingzi[0].userName;
          });
         
        })
        .catch(() => {
          this.$toast.clear();
@@ -485,12 +464,20 @@ export default {

    // 所属工程名称
    onConProjectName(value) {
      if (!value) {
        this.showProjectName = false;
        return;
      }
      this.projectId = value.id;
      this.projectName = value.projectName;
      this.showProjectName = false;
    },
    // 风险因素
    onConFactor(value) {
      if (!value) {
        this.showFactor = false;
        return;
      }
      this.factor = value.factorType;
      this.showFactor = false;
      this.source = "";
@@ -502,6 +489,10 @@ export default {
    },
    // 风险源
    onConSource(value) {
      if (!value) {
        this.showSource = false;
        return;
      }
      this.source = value.sourceName;
      this.showSource = false;
      this.trouble = "";
@@ -514,27 +505,37 @@ export default {
    },
    // 事故类型
    onConTrouble(value) {
      if (!value) {
        this.showTrouble = false;
        return;
      }
      this.trouble = value.accidentType;
      this.showTrouble = false;
      // 请求三个措施
      postRiskShowMeasures(`/riskMain/showmeasures/${this.factor}/${this.source}/${this.trouble}`).then(res =>{
        console.log(res.data)
        this.technology = res.data[0].measuresProject
        this.administration = res.data[0].measuresAdministration
        this.urgent = res.data[0].measuresEmergency
      })
      postRiskShowMeasures(
        `/riskMain/showmeasures/${this.factor}/${this.source}/${this.trouble}`
      ).then(res => {
        console.log(res.data);
        this.technology = res.data[0].measuresProject;
        this.administration = res.data[0].measuresAdministration;
        this.urgent = res.data[0].measuresEmergency;
      });
    },
    // 风险定级
    onConSetRank(value) {
      this.setRank = value;
      this.riskRank = ""
      this.riskRank = "";
      this.showSetRank = false;
      if (this.setRank == "矩阵式定级") {
        this.$router.push({
          name: "matrix-grad"
        });
      }
    },
    // 自己定义风险等级点击方法
    myRiskRank() {
      console.log(this.setRank);
      if (this.setRank == "") {
         this.$toast("其他定级方式");
        this.$toast("请先选择风险定级");
      } else if (this.setRank == "其他定级方式") {
        this.showRiskRank = true;
      }
@@ -542,15 +543,9 @@ export default {
    // 风险等级
    onConRiskRank(value) {
      this.riskRank = value;
      // if (value == "重大风险" || value == "较大风险") {
      //   this.control = "企业级";
      // } else {
      //   this.control = "项目级";
      // }
      this.showRiskRank = false;
    },


    // 管控层级
    onConControl(value) {
      this.control = value;
Loading