licp
2024-12-20 12b0999362e5fdf3b607de13192947efb042daad
cnas8.5搬迁
已修改1个文件
已添加3个文件
727 ■■■■■ 文件已修改
src/assets/api/controller.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a8-measures_deal_risks_opportunities/hazard_identification_risk_assessment.vue 350 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/a8-measures_deal_risks_opportunities/list_risk_analysis_control_plans.vue 318 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/a8-measures_deal_risks_opportunities.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -60,6 +60,7 @@
    processTotaldeal,
    processEvaluate,
    qualityMonitor,
    measuresAddressRisksOpportunities,
  }
}
@@ -787,3 +788,21 @@
  importQualityMonitor:'/qualityMonitor/importQualityMonitor', // å¯¼å…¥ç›‘控计划
  exportQualityMonitorDetail:'/qualityMonitor/exportQualityMonitorDetail', // å¯¼å‡ºç›‘控计划
}
// 8.5 åº”对风险和机遇的措施
const measuresAddressRisksOpportunities = {
  getPageList: '/manageControlPlanList/getPageList', // é‡å¤§é£Žé™©å› ç´ åˆ†æžåŠæŽ§åˆ¶è®¡åˆ’清单 åˆ†é¡µ
  approvalOfControlPlanChecklist: "/manageControlPlanList/approvalOfControlPlanChecklist", // é‡å¤§é£Žé™©å› ç´ åˆ†æžåŠæŽ§åˆ¶è®¡åˆ’清单 æ‰¹å‡†
  riskAnalysisApprovalOfControlPlanChecklist: "/manageControlPlanList/riskAnalysisApprovalOfControlPlanChecklist", // é‡å¤§é£Žé™©å› ç´ åˆ†æžåŠæŽ§åˆ¶è®¡åˆ’清单 å®¡æ ¸
  importControlPlanList: "/manageControlPlanList/importControlPlanList", // é‡å¤§é£Žé™©å› ç´ åˆ†æžåŠæŽ§åˆ¶è®¡åˆ’清单 å¯¼å…¥
  analysisOfMajorRiskFactorsAdded: "/manageControlPlanList/analysisOfMajorRiskFactorsAdded", // é‡å¤§é£Žé™©å› ç´ åˆ†æžåŠæŽ§åˆ¶è®¡åˆ’清单 æ–°å¢ž
  deleteSignificantRiskFactorAnalysis: "/manageControlPlanList/deleteSignificantRiskFactorAnalysis", // é‡å¤§é£Žé™©å› ç´ åˆ†æžåŠæŽ§åˆ¶è®¡åˆ’清单 åˆ é™¤
  getPageResults: "/manageRiskAssessmentResults/getPageResults", // å±é™©å› ç´ è¾¨è¯†ä¸Žé£Žé™©è¯„价结果一览 åˆ†é¡µ
  hazardIdentificationAndRiskApproval: "/manageRiskAssessmentResults/hazardIdentificationAndRiskApproval", // å±é™©å› ç´ è¾¨è¯†ä¸Žé£Žé™©è¯„价结果一览 æ‰¹å‡†
  dangerousRiskApproval: "/manageRiskAssessmentResults/dangerousRiskApproval", // å±é™©å› ç´ è¾¨è¯†ä¸Žé£Žé™©è¯„价结果一览 å®¡æ‰¹
  riskAssessmentImport: "manageRiskAssessmentResults/riskAssessmentImport", // å±é™©å› ç´ è¾¨è¯†ä¸Žé£Žé™©è¯„价结果一览 å¯¼å…¥
  addNewRiskFactors: "/manageRiskAssessmentResults/addNewRiskFactors", // å±é™©å› ç´ è¾¨è¯†ä¸Žé£Žé™©è¯„价结果一览 æ–°å¢ž
  removeRiskFactors: "/manageRiskAssessmentResults/removeRiskFactors", // å±é™©å› ç´ è¾¨è¯†ä¸Žé£Žé™©è¯„价结果一览 åˆ é™¤
  exportHazardFactorIdentification: "/manageRiskAssessmentResults/exportHazardFactorIdentification", // å±é™©å› ç´ è¾¨è¯†ä¸Žé£Žé™©è¯„价结果一览 å¯¼å‡º
  exportSignificantRiskFactors: "/manageControlPlanList/exportSignificantRiskFactors", // é‡å¤§é£Žé™©å› ç´ åˆ†æžåŠæŽ§åˆ¶è®¡åˆ’清单 å¯¼å‡º
}
src/components/do/a8-measures_deal_risks_opportunities/hazard_identification_risk_assessment.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,350 @@
<template>
  <div style="padding: 10px">
    <div class="header">
      <div>危险因素辨识与风险评价结果一览</div>
      <div style="min-width: 200px">
        <el-button type="primary" size="small" @click="addFun">新 å¢ž</el-button>
        <el-button type="primary" size="small" @click="approvalFun">审 æ‰¹</el-button>
        <el-button type="primary" size="small" @click="approveFun">批 å‡†</el-button>
        <el-upload
          style="display: inline-block; padding: 0 6px"
          :headers="headers"
          :action="action"
          :on-error="onError"
          :show-file-list="false"
          :on-success="onSuccess">
          <el-button size="small" type="primary">导 å…¥</el-button>
        </el-upload>
        <el-button size="small" @click="openDownloadDia">导出</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%"
      height="calc(100vh - 18em)">
      <el-table-column type="index" label="序号" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="venue" label="地点/活动" min-width="180"></el-table-column>
      <el-table-column prop="hazard" label="危险因素" width="testDate" min-width="180"></el-table-column>
      <el-table-column prop="accidents" label="可能导致的事故" min-width="180"></el-table-column>
      <el-table-column prop="injury" label="对人可能造成的危害" min-width="180"></el-table-column>
      <el-table-column label="风险评价" align="center" min-width="180">
        <template>
          <el-table-column prop="riskL" label="L" min-width="80"></el-table-column>
          <el-table-column prop="riskE" label="E" min-width="80"></el-table-column>
          <el-table-column prop="riskC" label="C" min-width="80"></el-table-column>
          <el-table-column prop="riskD" label="D" min-width="80"></el-table-column>
        </template>
      </el-table-column>
      <el-table-column prop="level" label="风险等级" min-width="180"></el-table-column>
      <el-table-column prop="measures" label="控制措施" min-width="180"></el-table-column>
      <el-table-column prop="editorName" label="编制人姓名" min-width="180"></el-table-column>
      <el-table-column prop="editorDate" label="编制日期" min-width="180"></el-table-column>
      <el-table-column prop="approvalName" label="审批人姓名" min-width="180"></el-table-column>
      <el-table-column prop="approvalDate" label="审批日期" min-width="180"></el-table-column>
      <el-table-column prop="approvalStatus" label="审批状态" min-width="180">
        <template #default="{ row }">
          {{ row.approvalStatus === 1 ? '通过' : row.approvalStatus === 2 ? '不通过' : '' }}
        </template>
      </el-table-column>
      <el-table-column prop="approveName" label="批准人姓名" min-width="180"></el-table-column>
      <el-table-column prop="approveStatus" label="批准状态" min-width="180">
        <template #default="{ row }">
          {{ row.approveStatus === 1 ? '通过' : row.approveStatus === 2 ? '不通过' : '' }}
        </template>
      </el-table-column>
      <el-table-column prop="approveDate" label="批准日期" min-width="180"></el-table-column>
      <el-table-column
        fixed="right"
        label="操作"
        width="100">
        <template v-slot="scope">
          <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
          <el-button type="text" size="small" @click="editClick(scope.row)">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
                   :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange">
    </el-pagination>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="50%">
      <el-form ref="form" :model="form" label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="地点/活动">
              <el-input v-model="form.venue" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="危险因素">
              <el-input v-model="form.hazard" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="可能导致的事故">
              <el-input v-model="form.accidents" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="对人可能造成的危害" label-width="140px">
              <el-input v-model="form.injury" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="风险评价/L">
              <el-input v-model="form.riskL" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="风险评价/E">
              <el-input v-model="form.riskE" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="风险评价/C">
              <el-input v-model="form.riskC" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="风险评价/D">
              <el-input v-model="form.riskD" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="风险等级">
              <el-input v-model="form.level" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="控制措施">
              <el-input v-model="form.measures" size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="addApi" :loading="loading">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
      form: {},
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
      loading: false
    }
  },
  computed: {
    headers() {
      return {
        'token': sessionStorage.getItem('token')
      }
    },
    action() {
      return this.javaApi + this.$api.measuresAddressRisksOpportunities.riskAssessmentImport
    }
  },
  methods: {
    handleSizeChange(val) {
      this.search.size = val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.search.current = val;
      this.initData();
    },
    // åˆ†é¡µè¡¨æ ¼åˆå§‹åŒ–
    initData() {
      this.tableData = []
      this.$axios.get(this.$api.measuresAddressRisksOpportunities.getPageResults + '?size=' + this.search.size + '&current=' + this.search.current).then(res => {
        if (res.code === 201) return;
        this.tableData = res.data.records;
        this.search.total = res.data.total;
      });
    },
    // å®¡æ‰¹
    approvalFun() {
      let user = JSON.parse(localStorage.getItem('user'))
      this.$confirm('是否审批通过?', '提示', {
        confirmButtonText: '通过',
        cancelButtonText: '不通过',
        type: 'warning',
        closeOnClickModal: false, // ç¦æ­¢ç‚¹å‡»é®ç½©å±‚关闭
        distinguishCancelAndClose: true,
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
            this.approvalApi(user.userId, 1)
            done();
          } else if (action === 'cancel') {
            this.approvalApi(user.userId, 2)
            done();
          } else if (action === 'close') {
            // ç‚¹å‡»â€œÃ—”按钮,不允许关闭
            done();
          }
        }
      })
    },
    // å®¡æ‰¹æŽ¥å£
    approvalApi(userId, status) {
      this.$axios.get(this.$api.measuresAddressRisksOpportunities.dangerousRiskApproval + '?approval=' + userId + '&status=' + status).then(res => {
        if (res.code === 201) return;
        this.initData()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      });
    },
    // æ‰¹å‡†
    approveFun() {
      let user = JSON.parse(localStorage.getItem('user'))
      this.$confirm('是否批准通过?', '提示', {
        confirmButtonText: '通过',
        cancelButtonText: '不通过',
        type: 'warning',
        closeOnClickModal: false, // ç¦æ­¢ç‚¹å‡»é®ç½©å±‚关闭
        distinguishCancelAndClose: true,
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
            this.approveApi(user.userId, 1)
            done();
          } else if (action === 'cancel') {
            this.approveApi(user.userId, 2)
            done();
          } else if (action === 'close') {
            // ç‚¹å‡»â€œÃ—”按钮,不允许关闭
            done();
          }
        }
      })
    },
    // æ‰¹å‡†æŽ¥å£
    approveApi(userId, status) {
      this.$axios.get(this.$api.measuresAddressRisksOpportunities.hazardIdentificationAndRiskApproval + '?approve=' + userId + '&status=' + status).then(res => {
        if (res.code === 201) return;
        this.initData()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      });
    },
    // æ–‡ä»¶ä¸Šä¼ å¤±è´¥
    onError() {
      this.$message({
        type: 'error',
        message: '操作失败!'
      });
    },
    // æ–‡ä»¶ä¸Šä¼ æˆåŠŸ
    onSuccess(response) {
      if (response.code == 201) {
        this.$message({
          type: 'error',
          message: response.message,
        });
        return
      }
      this.initData()
      this.$message({
        type: 'success',
        message: '操作成功!'
      });
    },
    addFun() {
      this.dialogVisible = true
    },
    // åˆ é™¤
    deleteClick(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.get(this.$api.measuresAddressRisksOpportunities.removeRiskFactors + "?id=" + row.id).then(res => {
          if (res.code === 201) return;
          this.initData()
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    addApi() {
      this.loading = true
      this.$axios.post(this.$api.measuresAddressRisksOpportunities.addNewRiskFactors, this.form, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        if (res.code === 201) return;
        this.dialogVisible = false
        this.loading = false
        this.initData()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }).catch(err => {
        this.loading = false
      });
    },
    // ç¼–辑
    editClick(row) {
      this.form = {...row}
      this.dialogVisible = true
    },
    // å¯¼å‡º
    openDownloadDia () {
      this.$axios.get( this.$api.measuresAddressRisksOpportunities.exportHazardFactorIdentification,{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '危险因素辨识与风险评价结果一览' + '.docx';
        link.click();
      })
    },
  },
  mounted() {
    this.initData()
  },
}
</script>
<style scoped>
.header {
  height: 3em;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
src/components/do/a8-measures_deal_risks_opportunities/list_risk_analysis_control_plans.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,318 @@
<template>
  <div style="padding: 10px">
    <div class="header">
      <div>重大风险因素分析及控制计划清单</div>
      <div style="min-width: 200px">
        <el-button type="primary" size="small" @click="addFun">新 å¢ž</el-button>
        <el-button type="primary" size="small" @click="approvalFun">审 æ‰¹</el-button>
        <el-button type="primary" size="small" @click="approveFun">批 å‡†</el-button>
        <el-upload
          style="display: inline-block; padding: 0 6px"
          :action="action"
          :headers="headers"
          :on-error="onError"
          :show-file-list="false"
          :on-success="onSuccess">
          <el-button size="small" type="primary">导 å…¥</el-button>
        </el-upload>
        <el-button size="small" @click="openDownloadDia">导出</el-button>
      </div>
    </div>
    <el-table
      :data="tableData"
      style="width: 100%"
      height="calc(100vh - 18em)">
      <el-table-column type="index" label="序号" width="120">
        <template v-slot="scope">
          <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="jobActivity" label="作业活动" min-width="180"></el-table-column>
      <el-table-column prop="category" label="风险因素类别" width="testDate" min-width="180"></el-table-column>
      <el-table-column prop="description" label="风险因素描述" min-width="180"></el-table-column>
      <el-table-column prop="result" label="可导致的事故" min-width="180"></el-table-column>
      <el-table-column prop="intolerable" label="是否不可承受风险" min-width="180"></el-table-column>
      <el-table-column prop="plan" label="控制计划" min-width="180"></el-table-column>
      <el-table-column prop="editorName" label="编制人姓名" min-width="180"></el-table-column>
      <el-table-column prop="editorDate" label="编制日期" min-width="180"></el-table-column>
      <el-table-column prop="approvalName" label="审批姓名" min-width="180"></el-table-column>
      <el-table-column prop="approvalDate" label="审批日期" min-width="180"></el-table-column>
      <el-table-column prop="approvalStatus" label="审批状态" min-width="180">
        <template #default="{ row }">
          {{ row.approvalStatus ===  1 ? '通过' : row.approvalStatus ===  2 ? '不通过' : '' }}
        </template>
      </el-table-column>
      <el-table-column prop="approveName" label="批准姓名" min-width="180"></el-table-column>
      <el-table-column prop="approveStatus" label="批准状态" min-width="180">
        <template #default="{ row }">
          {{ row.approveStatus ===  1 ? '通过' : row.approveStatus ===  2 ? '不通过' : '' }}
        </template>
      </el-table-column>
      <el-table-column prop="approveDate" label="批准人日期" min-width="180"></el-table-column>
      <el-table-column
        fixed="right"
        label="操作"
        width="100">
        <template v-slot="scope">
          <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
          <el-button type="text" size="small" @click="editClick(scope.row)">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
                   :total="search.total" layout="->,total, sizes, prev, pager, next, jumper"
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange">
    </el-pagination>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="50%">
      <el-form ref="form" :model="form" label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="作业活动">
              <el-input v-model="form.jobActivity" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="风险因素类别">
              <el-input v-model="form.category" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="风险因素描述">
              <el-input v-model="form.description" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="可导致的事故">
              <el-input v-model="form.result" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="是否不可承受风险" label-width="130px">
              <el-input v-model="form.intolerable" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="控制计划">
              <el-input v-model="form.plan" size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="addApi" :loading="loading">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
      form: {},
      loading: false,
      search: {
        size: 20,
        current: 1,
        total: 0
      },
      tableData: [],
    }
  },
  computed: {
    headers() {
      return {
        'token': sessionStorage.getItem('token')
      }
    },
    action() {
      return this.javaApi + this.$api.measuresAddressRisksOpportunities.importControlPlanList
    }
  },
  methods: {
    handleSizeChange(val) {
      this.search.size = val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.search.current = val;
      this.initData();
    },
    initData() {
      this.$axios.get(this.$api.measuresAddressRisksOpportunities.getPageList + '?size=' + this.search.size + '&current=' + this.search.current).then(res => {
        if (res.code === 201) return;
        this.tableData = res.data.records;
        this.search.total = res.data.total;
      });
    },
    // å®¡æ‰¹
    approvalFun() {
      let user = JSON.parse(localStorage.getItem('user'))
      this.$confirm('是否审批通过?', '提示', {
        confirmButtonText: '通过',
        cancelButtonText: '不通过',
        type: 'warning',
        closeOnClickModal: false, // ç¦æ­¢ç‚¹å‡»é®ç½©å±‚关闭
        distinguishCancelAndClose: true,
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
            this.approvalApi(user.userId, 1)
            done();
          } else if (action === 'cancel') {
            this.approvalApi(user.userId, 2)
            done();
          } else if (action === 'close') {
            // ç‚¹å‡»â€œÃ—”按钮,不允许关闭
            done();
          }
        }
      })
    },
    // å®¡æ‰¹æŽ¥å£
    approvalApi(userId, status) {
      this.$axios.get(this.$api.measuresAddressRisksOpportunities.riskAnalysisApprovalOfControlPlanChecklist + '?approval=' + userId + '&status=' + status).then(res => {
        if (res.code === 201) return;
        this.initData()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      });
    },
    // æ‰¹å‡†
    approveFun() {
      let user = JSON.parse(localStorage.getItem('user'))
      this.$confirm('是否批准通过?', '提示', {
        confirmButtonText: '通过',
        cancelButtonText: '不通过',
        type: 'warning',
        closeOnClickModal: false, // ç¦æ­¢ç‚¹å‡»é®ç½©å±‚关闭
        distinguishCancelAndClose: true,
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
            this.approveApi(user.userId, 1)
            done();
          } else if (action === 'cancel') {
            this.approveApi(user.userId, 2)
            done();
          } else if (action === 'close') {
            // ç‚¹å‡»â€œÃ—”按钮,不允许关闭
            done();
          }
        }
      })
    },
    // æ‰¹å‡†æŽ¥å£
    approveApi(userId, status) {
      this.$axios.get(this.$api.measuresAddressRisksOpportunities.approvalOfControlPlanChecklist + '?approve=' + userId + '&status=' + status).then(res => {
        if (res.code === 201) return;
        this.initData()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      });
    },
    onError() {
      this.$message({
        type: 'error',
        message: '操作失败!'
      });
    },
    onSuccess(response) {
      if (response.code == 201) {
        this.$message({
          type: 'error',
          message: response.message,
        });
        return
      }
      this.initData()
      this.$message({
        type: 'success',
        message: '操作成功!'
      });
    },
    addFun() {
      this.dialogVisible = true
    },
    // åˆ é™¤
    deleteClick(row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$axios.get(this.$api.measuresAddressRisksOpportunities.deleteSignificantRiskFactorAnalysis + "?id=" +  row.id).then(res => {
          if (res.code === 201) return;
          this.initData()
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    addApi() {
      this.loading = true
      this.$axios.post(this.$api.measuresAddressRisksOpportunities.analysisOfMajorRiskFactorsAdded, this.form, {
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(res => {
        if (res.code === 201) return;
        this.dialogVisible = false
        this.loading = false
        this.initData()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }).catch(err => {
        this.loading = false
      });
    },
    // ç¼–辑
    editClick(row) {
      this.form = {...row}
      this.dialogVisible = true
    },
    // å¯¼å‡º
    openDownloadDia () {
      this.$axios.get( this.$api.measuresAddressRisksOpportunities.exportSignificantRiskFactors,{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/msword' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = '重大风险因素分析及控制计划清单' + '.docx';
        link.click();
      })
    },
  },
  mounted() {
    this.initData()
  },
}
</script>
<style scoped>
.header {
  height: 3em;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
</style>
src/components/view/a8-measures_deal_risks_opportunities.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
<template>
  <div class="main">
    <el-tabs v-model="activeName" type="border-card" :lazy="true">
      <el-tab-pane label="危险因素辨识与风险评价结果一览" name="危险因素辨识与风险评价结果一览">
        <HazardIdentificationRiskAssessment v-if="activeName === '危险因素辨识与风险评价结果一览'"/>
      </el-tab-pane>
      <el-tab-pane label="重大风险因素分析及控制计划清单" name="重大风险因素分析及控制计划清单">
        <listRiskAnalysisControlPlans v-if="activeName === '重大风险因素分析及控制计划清单'"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import HazardIdentificationRiskAssessment
  from "../do/a8-measures_deal_risks_opportunities/hazard_identification_risk_assessment.vue";
import listRiskAnalysisControlPlans
  from "../do/a8-measures_deal_risks_opportunities/list_risk_analysis_control_plans.vue";
export default {
  components: {HazardIdentificationRiskAssessment, listRiskAnalysisControlPlans},
  data() {
    return {
      activeName: '危险因素辨识与风险评价结果一览',
    }
  }
}
</script>
<style scoped>
.main {
  padding: 15px 0;
  width: 100%;
  border-radius: 15px;
}
/deep/ .el-tabs--border-card>.el-tabs__content {
  height: calc(100vh - 9em);
  padding: 0;
}
</style>