forked from integrated_whb/integrated_whb_vue
init
parent
fee5d6f786
commit
6184e2c723
|
@ -214,6 +214,9 @@ import {
|
||||||
import { getUserListAll } from "@/request/data_dictionary.js";
|
import { getUserListAll } from "@/request/data_dictionary.js";
|
||||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "LayoutHiddenAdd",
|
||||||
|
});
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
form: {
|
form: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -286,7 +289,7 @@ const fnVideoPreview = (event) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const fnGetHiddenDangerDatabaseList = async () => {
|
const fnGetHiddenDangerDatabaseList = async () => {
|
||||||
if (props.hiddenType !== "unqualified" || props.hiddenType !== "otherHidden")
|
if (props.hiddenType !== "unqualified" && props.hiddenType !== "otherHidden")
|
||||||
return;
|
return;
|
||||||
if (!form.value.HIDDENPART) return;
|
if (!form.value.HIDDENPART) return;
|
||||||
const resData = await getHiddenDangerDatabaseList({
|
const resData = await getHiddenDangerDatabaseList({
|
|
@ -239,6 +239,9 @@ import { VideoPlay } from "@element-plus/icons-vue";
|
||||||
import LayoutVideo from "@/components/video/index.vue";
|
import LayoutVideo from "@/components/video/index.vue";
|
||||||
import { getHiddenDangerView } from "@/request/hazard_investigation.js";
|
import { getHiddenDangerView } from "@/request/hazard_investigation.js";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "LayoutHiddenView",
|
||||||
|
});
|
||||||
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
|
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
hiddenId: {
|
hiddenId: {
|
|
@ -0,0 +1,387 @@
|
||||||
|
<template>
|
||||||
|
<el-form ref="formRef" :rules="rules" :model="form" label-width="240px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24" v-if="!infoIsEmpty">
|
||||||
|
<el-form-item label="管控部门" prop="DEPTNAME">
|
||||||
|
<el-input :model-value="info.DEPTNAME" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="infoIsEmpty">
|
||||||
|
<el-form-item label="管控部门" prop="DEPARTMENT_ID">
|
||||||
|
<layout-department
|
||||||
|
v-model="form.DEPARTMENT_ID"
|
||||||
|
@update:model-value="fnDepartmentChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="管控责任人" prop="USER_ID">
|
||||||
|
<el-input v-model="form.USER_ID" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<template v-if="!infoIsEmpty">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="风险点(单元)" prop="RISKUNITNAME">
|
||||||
|
<el-input :model-value="info.RISKUNITNAME" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="辨识部位" prop="PARTSNAME">
|
||||||
|
<el-input :model-value="info.PARTSNAME" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<template v-if="infoIsEmpty">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="风险点(单元)" prop="RISK_UNIT_ID">
|
||||||
|
<el-select v-model="form.RISK_UNIT_ID" @change="fnRiskUnitChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in unitList"
|
||||||
|
:key="item.RISKUNIT_ID"
|
||||||
|
:label="item.DEPT_NAME + '-' + item.RISKUNITNAME"
|
||||||
|
:value="item.RISKUNIT_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="辨识部位" prop="IDENTIFICATION_ID">
|
||||||
|
<el-select v-model="form.IDENTIFICATION_ID">
|
||||||
|
<el-option
|
||||||
|
v-for="item in partsList"
|
||||||
|
:key="item.IDENTIFICATIONPARTS_ID"
|
||||||
|
:label="item.PARTSNAME"
|
||||||
|
:value="item.IDENTIFICATIONPARTS_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="存在风险" prop="RISK_DESCR">
|
||||||
|
<el-input
|
||||||
|
v-model="form.RISK_DESCR"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{
|
||||||
|
minRows: 3,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="事故发生的可能性" prop="LIKELIHOOD">
|
||||||
|
<el-select v-model="form.LIKELIHOOD">
|
||||||
|
<el-option :value="10" label="完全可以预料" />
|
||||||
|
<el-option :value="6" label="相当可能" />
|
||||||
|
<el-option :value="3" label="可能,但不经常" />
|
||||||
|
<el-option :value="1" label="可能性小,完全意外" />
|
||||||
|
<el-option :value="0.5" label="很不可能,可以设想" />
|
||||||
|
<el-option :value="0.2" label="极不可能" />
|
||||||
|
<el-option :value="0.1" label="实际不可能" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="分值">
|
||||||
|
{{ form.LIKELIHOOD }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="人员暴露于危险环境中的频繁程度" prop="EXPOSURE">
|
||||||
|
<el-select v-model="form.EXPOSURE">
|
||||||
|
<el-option :value="10" label="连续暴露" />
|
||||||
|
<el-option :value="6" label="每天工作时间内暴露" />
|
||||||
|
<el-option :value="3" label="每周一次或偶然暴露" />
|
||||||
|
<el-option :value="2" label="每月一次暴露,完全意外" />
|
||||||
|
<el-option :value="1" label="每年几次暴露" />
|
||||||
|
<el-option :value="0.5" label="非常罕见暴露" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="分值">
|
||||||
|
{{ form.EXPOSURE }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="一旦发生事故可能造成的后果" prop="CONSEQUENCE">
|
||||||
|
<el-select v-model="form.CONSEQUENCE">
|
||||||
|
<el-option :value="100" label="10人以上死亡" />
|
||||||
|
<el-option :value="40" label="3~9人死亡" />
|
||||||
|
<el-option :value="15" label="1~2人死亡" />
|
||||||
|
<el-option :value="7" label="严重" />
|
||||||
|
<el-option :value="3" label="重大,伤残" />
|
||||||
|
<el-option :value="1" label="引人注意" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="分值">
|
||||||
|
{{ form.CONSEQUENCE }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="风险分级" prop="LEVEL_NAME">
|
||||||
|
{{ form.LEVEL_NAME }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="总分值" prop="DANGER">
|
||||||
|
{{ form.DANGER }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="管控措施" prop="MEASURES">
|
||||||
|
<el-input
|
||||||
|
v-model="form.MEASURES"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{
|
||||||
|
minRows: 3,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="事故类型" prop="ACCIDENTS">
|
||||||
|
<el-select v-model="form.ACCIDENTS" multiple>
|
||||||
|
<el-option
|
||||||
|
v-for="item in accidentTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="应急处置措施" prop="EME_MEASURES">
|
||||||
|
<el-input
|
||||||
|
v-model="form.EME_MEASURES"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{
|
||||||
|
minRows: 3,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<template v-if="control">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="管控措施分类1" prop="MANAGEMENT_CONTROL_ONE">
|
||||||
|
<el-select
|
||||||
|
v-model="form.MANAGEMENT_CONTROL_ONE"
|
||||||
|
@change="form.MANAGEMENT_CONTROL_TWO = ''"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in controlList1"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="管控措施分类2" prop="MANAGEMENT_CONTROL_TWO">
|
||||||
|
<el-select v-model="form.MANAGEMENT_CONTROL_TWO">
|
||||||
|
<el-option
|
||||||
|
v-for="item in controlList2"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="管控措施分类3" prop="MANAGEMENT_CONTROL_THREE">
|
||||||
|
<el-input
|
||||||
|
v-model="form.MANAGEMENT_CONTROL_THREE"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{
|
||||||
|
minRows: 3,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, watch, watchEffect } from "vue";
|
||||||
|
import { useVModel } from "@vueuse/core";
|
||||||
|
import {
|
||||||
|
layoutFnGetAccidentType,
|
||||||
|
layoutFnGetControlMeasures1,
|
||||||
|
layoutFnGetControlMeasures2,
|
||||||
|
} from "@/assets/js/data_dictionary.js";
|
||||||
|
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||||
|
import LayoutDepartment from "@/components/department/index.vue";
|
||||||
|
import { isEmpty } from "lodash-es";
|
||||||
|
import {
|
||||||
|
getIdentifyingPartsListAll,
|
||||||
|
getRiskPointListAllById,
|
||||||
|
} from "@/request/risk_control.js";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "LayoutRiskAdd",
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
form: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
control: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:form"]);
|
||||||
|
const form = useVModel(props, "form", emits);
|
||||||
|
const rules = {
|
||||||
|
USER_ID: [{ required: true, message: "管控责任人不能为空", trigger: "blur" }],
|
||||||
|
RISK_DESCR: [
|
||||||
|
{ required: true, message: "存在风险不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
LIKELIHOOD: [
|
||||||
|
{ required: true, message: "事故发生的可能性不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
EXPOSURE: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "人员暴露于危险环境中的频繁程度不能为空",
|
||||||
|
trigger: "change",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
CONSEQUENCE: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "一旦发生事故可能造成的后果不能为空",
|
||||||
|
trigger: "change",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
LEVEL_NAME: [
|
||||||
|
{ required: true, message: "风险分级不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
MEASURES: [{ required: true, message: "管控措施不能为空", trigger: "blur" }],
|
||||||
|
EME_MEASURES: [
|
||||||
|
{ required: true, message: "应急处置措施不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
ACCIDENTS: [
|
||||||
|
{ required: true, message: "事故类型不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
DEPARTMENT_ID: [
|
||||||
|
{ required: true, message: "部门不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
RISK_UNIT_ID: [
|
||||||
|
{ required: true, message: "风险点(单元)不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
IDENTIFICATION_ID: [
|
||||||
|
{ required: true, message: "辨识部位不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
const formRef = ref(null);
|
||||||
|
const infoIsEmpty = ref(isEmpty(props.info));
|
||||||
|
const unitList = ref([]);
|
||||||
|
const partsList = ref([]);
|
||||||
|
const controlList2 = ref([]);
|
||||||
|
const fnGetLevelName = (LIKELIHOOD, EXPOSURE, CONSEQUENCE) => {
|
||||||
|
const DANGER = (LIKELIHOOD * EXPOSURE * CONSEQUENCE).toFixed(2);
|
||||||
|
if (DANGER > 320) {
|
||||||
|
form.value.LEVELID = "levelA";
|
||||||
|
form.value.LEVEL_NAME = "重大风险/A级";
|
||||||
|
} else if (DANGER > 160) {
|
||||||
|
form.value.LEVELID = "levelB";
|
||||||
|
form.value.LEVEL_NAME = "较大风险/B级";
|
||||||
|
} else if (DANGER > 70) {
|
||||||
|
form.value.LEVELID = "levelC";
|
||||||
|
form.value.LEVEL_NAME = "一般风险/C级";
|
||||||
|
} else {
|
||||||
|
form.value.LEVELID = "levelD";
|
||||||
|
form.value.LEVEL_NAME = "低风险/D级";
|
||||||
|
}
|
||||||
|
form.value.DANGER = DANGER;
|
||||||
|
};
|
||||||
|
watch(
|
||||||
|
[
|
||||||
|
() => props.form.LIKELIHOOD,
|
||||||
|
() => props.form.EXPOSURE,
|
||||||
|
() => props.form.CONSEQUENCE,
|
||||||
|
],
|
||||||
|
([LIKELIHOOD, EXPOSURE, CONSEQUENCE]) => {
|
||||||
|
if (!LIKELIHOOD || !EXPOSURE || !CONSEQUENCE) return;
|
||||||
|
fnGetLevelName(LIKELIHOOD, EXPOSURE, CONSEQUENCE);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const fnGetUnitList = async () => {
|
||||||
|
const resData = await getRiskPointListAllById({
|
||||||
|
DEPARTMENT_ID: form.value.DEPARTMENT_ID,
|
||||||
|
});
|
||||||
|
unitList.value = resData.unitList;
|
||||||
|
};
|
||||||
|
const fnGetPartsList = async () => {
|
||||||
|
const resData = await getIdentifyingPartsListAll({
|
||||||
|
RISK_UNIT_ID: form.value.RISK_UNIT_ID,
|
||||||
|
});
|
||||||
|
partsList.value = resData.partsList;
|
||||||
|
};
|
||||||
|
const fnControlList1Change = () => {
|
||||||
|
controlList2.value = [];
|
||||||
|
const id = form.value.MANAGEMENT_CONTROL_ONE;
|
||||||
|
let BZ = "";
|
||||||
|
for (let i = 0; i < controlList1.value.length; i++) {
|
||||||
|
if (controlList1.value[i].id === id) {
|
||||||
|
BZ = controlList1.value[i].BZ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < controlList2All.value.length; i++) {
|
||||||
|
if (controlList2All.value[i].TBFIELD === BZ) {
|
||||||
|
controlList2.value.push(controlList2All.value[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const fnDepartmentChange = () => {
|
||||||
|
form.value.RISK_UNIT_ID = "";
|
||||||
|
form.value.IDENTIFICATION_ID = "";
|
||||||
|
unitList.value = [];
|
||||||
|
partsList.value = [];
|
||||||
|
};
|
||||||
|
const fnRiskUnitChange = () => {
|
||||||
|
form.value.IDENTIFICATION_ID = "";
|
||||||
|
partsList.value = [];
|
||||||
|
};
|
||||||
|
watchEffect(() => {
|
||||||
|
if (form.value.DEPARTMENT_ID) fnGetUnitList();
|
||||||
|
if (form.value.RISK_UNIT_ID) fnGetPartsList();
|
||||||
|
if (form.value.MANAGEMENT_CONTROL_ONE) fnControlList1Change();
|
||||||
|
});
|
||||||
|
const fnReset = () => {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
};
|
||||||
|
const fnFormValidate = async () => {
|
||||||
|
await useFormValidate(formRef);
|
||||||
|
};
|
||||||
|
const fnAccidentsName = () => {
|
||||||
|
return accidentTypeList.value
|
||||||
|
.filter((item) => form.value.ACCIDENTS.includes(item.BIANMA))
|
||||||
|
.map((item) => item.NAME)
|
||||||
|
.join(",");
|
||||||
|
};
|
||||||
|
defineExpose({
|
||||||
|
reset: fnReset,
|
||||||
|
formValidate: fnFormValidate,
|
||||||
|
accidentsName: fnAccidentsName,
|
||||||
|
});
|
||||||
|
const accidentTypeList = await layoutFnGetAccidentType();
|
||||||
|
const controlList1 = props.control && (await layoutFnGetControlMeasures1());
|
||||||
|
const controlList2All = props.control && (await layoutFnGetControlMeasures2());
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
|
@ -114,7 +114,7 @@ const fnGetInfo = async () => {
|
||||||
data.avatar = FILE_URL + resData.userPhoto;
|
data.avatar = FILE_URL + resData.userPhoto;
|
||||||
} catch {
|
} catch {
|
||||||
data.avatar = new URL(
|
data.avatar = new URL(
|
||||||
"../../../assets/images/public/tx.png",
|
"../../assets/images/public/tx.png",
|
||||||
import.meta.url
|
import.meta.url
|
||||||
).href;
|
).href;
|
||||||
}
|
}
|
|
@ -32,9 +32,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import LayoutBreadcrumb from "@/components/layout/breadcrumb/index";
|
import LayoutBreadcrumb from "./breadcrumb/index";
|
||||||
import LayoutHeader from "@/components/layout/header/index";
|
import LayoutHeader from "./header/index";
|
||||||
import LayoutMenu from "@/components/layout/menu/index";
|
import LayoutMenu from "./menu/index";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { useMenuStore } from "@/pinia/menu";
|
import { useMenuStore } from "@/pinia/menu";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
|
@ -1,5 +1,5 @@
|
||||||
import { createRouter, createWebHashHistory } from "vue-router";
|
import { createRouter, createWebHashHistory } from "vue-router";
|
||||||
import layout from "../components/layout/index.vue";
|
import layout from "../layout/index.vue";
|
||||||
// import children from "../components/children/index.vue";
|
// import children from "../components/children/index.vue";
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<div id="printContent">
|
<div id="printContent">
|
||||||
<hidden-view :hidden-id="HIDDEN_ID" />
|
<layout-hidden-view :hidden-id="HIDDEN_ID" />
|
||||||
</div>
|
</div>
|
||||||
<div class="tc mt-10" v-if="print">
|
<div class="tc mt-10" v-if="print">
|
||||||
<el-button type="primary" v-print="'#printContent'">打印</el-button>
|
<el-button type="primary" v-print="'#printContent'">打印</el-button>
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import HiddenView from "./components/hidden_view.vue";
|
import LayoutHiddenView from "@/components/hidden_view/index.vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<hidden-view :hiddenId="HIDDEN_ID" />
|
<layout-hidden-view :hiddenId="HIDDEN_ID" />
|
||||||
</layout-card>
|
</layout-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import HiddenView from "../checklist_inspection_status/components/hidden_view.vue";
|
import LayoutHiddenView from "@/components/hidden_view/index.vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
|
@ -217,7 +217,6 @@
|
||||||
type="add"
|
type="add"
|
||||||
v-model:visible="data.addOrEditDialog.visible"
|
v-model:visible="data.addOrEditDialog.visible"
|
||||||
v-model:form="data.addOrEditDialog.form"
|
v-model:form="data.addOrEditDialog.form"
|
||||||
:control="false"
|
|
||||||
@get-data="fnAddRiskSubmit"
|
@get-data="fnAddRiskSubmit"
|
||||||
/>
|
/>
|
||||||
<select-risk
|
<select-risk
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
:on-close="fnClose"
|
:on-close="fnClose"
|
||||||
width="1200"
|
width="1200"
|
||||||
>
|
>
|
||||||
<hidden-add
|
<layout-hidden-add
|
||||||
:hidden-type="hiddenType"
|
:hidden-type="hiddenType"
|
||||||
:info="info"
|
:info="info"
|
||||||
v-model:form="form"
|
v-model:form="form"
|
||||||
|
@ -28,7 +28,7 @@ import {
|
||||||
setHiddenDangerListAdd,
|
setHiddenDangerListAdd,
|
||||||
} from "@/request/hazard_investigation.js";
|
} from "@/request/hazard_investigation.js";
|
||||||
import { setUploadImg } from "@/request/api.js";
|
import { setUploadImg } from "@/request/api.js";
|
||||||
import HiddenAdd from "./hidden_add.vue";
|
import LayoutHiddenAdd from "@/components/hidden_add/index.vue";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<HiddenView :hidden-id="HIDDEN_ID" />
|
<layout-hidden-view :hidden-id="HIDDEN_ID" />
|
||||||
<el-divider content-position="left">隐患验收</el-divider>
|
<el-divider content-position="left">隐患验收</el-divider>
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import HiddenView from "@/views/hazard_investigation/checklist_inspection_status/components/hidden_view.vue";
|
import LayoutHiddenView from "@/components/hidden_view/index.vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { reactive, ref } from "vue";
|
import { reactive, ref } from "vue";
|
||||||
import { debounce } from "throttle-debounce";
|
import { debounce } from "throttle-debounce";
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<hidden-add hidden-type="ledger" v-model:form="form" ref="hiddenAddRef" />
|
<layout-hidden-add
|
||||||
|
hidden-type="ledger"
|
||||||
|
v-model:form="form"
|
||||||
|
ref="hiddenAddRef"
|
||||||
|
/>
|
||||||
<div class="tc mt-10">
|
<div class="tc mt-10">
|
||||||
<el-button type="primary" @click="fnSubmit">确定</el-button>
|
<el-button type="primary" @click="fnSubmit">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,7 +12,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import HiddenAdd from "@/views/hazard_investigation/inventory_troubleshooting/components/hidden_add.vue";
|
import LayoutHiddenAdd from "@/components/hidden_add/index.vue";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { debounce } from "throttle-debounce";
|
import { debounce } from "throttle-debounce";
|
||||||
import { setHiddenDangerAdd } from "@/request/hazard_investigation.js";
|
import { setHiddenDangerAdd } from "@/request/hazard_investigation.js";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<div id="printContent">
|
<div id="printContent">
|
||||||
<hidden-view :hidden-id="HIDDEN_ID" />
|
<layout-hidden-view :hidden-id="HIDDEN_ID" />
|
||||||
</div>
|
</div>
|
||||||
<div class="tc mt-10">
|
<div class="tc mt-10">
|
||||||
<el-button type="primary" @click="fnConfirm" v-if="type === 'confirm'">
|
<el-button type="primary" @click="fnConfirm" v-if="type === 'confirm'">
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import HiddenView from "@/views/hazard_investigation/checklist_inspection_status/components/hidden_view.vue";
|
import LayoutHiddenView from "@/components/hidden_view/index.vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { debounce } from "throttle-debounce";
|
import { debounce } from "throttle-debounce";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<HiddenView :hidden-id="HIDDEN_ID" @throw-data="data.info = $event" />
|
<layout-hidden-view
|
||||||
|
:hidden-id="HIDDEN_ID"
|
||||||
|
@throw-data="data.info = $event"
|
||||||
|
/>
|
||||||
<el-divider content-position="left">隐患整改</el-divider>
|
<el-divider content-position="left">隐患整改</el-divider>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -293,7 +296,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import HiddenView from "@/views/hazard_investigation/checklist_inspection_status/components/hidden_view.vue";
|
import LayoutHiddenView from "@/components/hidden_view/index.vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { reactive, ref, watch } from "vue";
|
import { reactive, ref, watch } from "vue";
|
||||||
import LayoutDepartment from "@/components/department/index.vue";
|
import LayoutDepartment from "@/components/department/index.vue";
|
||||||
|
|
|
@ -1,288 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-dialog v-model="visible" :title="title" :before-close="fnClose">
|
|
||||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="240px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控部门" prop="DEPTNAME">
|
|
||||||
<el-input :model-value="info.DEPTNAME" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控责任人" prop="USER_ID">
|
|
||||||
<el-input v-model="form.USER_ID" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="风险点(单元)" prop="RISKUNITNAME">
|
|
||||||
<el-input :model-value="info.RISKUNITNAME" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="辨识部位" prop="PARTSNAME">
|
|
||||||
<el-input :model-value="info.PARTSNAME" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="存在风险" prop="RISK_DESCR">
|
|
||||||
<el-input
|
|
||||||
v-model="form.RISK_DESCR"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{
|
|
||||||
minRows: 3,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="事故发生的可能性" prop="LIKELIHOOD">
|
|
||||||
<el-select v-model="form.LIKELIHOOD">
|
|
||||||
<el-option :value="10" label="完全可以预料" />
|
|
||||||
<el-option :value="6" label="相当可能" />
|
|
||||||
<el-option :value="3" label="可能,但不经常" />
|
|
||||||
<el-option :value="1" label="可能性小,完全意外" />
|
|
||||||
<el-option :value="0.5" label="很不可能,可以设想" />
|
|
||||||
<el-option :value="0.2" label="极不可能" />
|
|
||||||
<el-option :value="0.1" label="实际不可能" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="分值">
|
|
||||||
{{ form.LIKELIHOOD }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="人员暴露于危险环境中的频繁程度" prop="EXPOSURE">
|
|
||||||
<el-select v-model="form.EXPOSURE">
|
|
||||||
<el-option :value="10" label="连续暴露" />
|
|
||||||
<el-option :value="6" label="每天工作时间内暴露" />
|
|
||||||
<el-option :value="3" label="每周一次或偶然暴露" />
|
|
||||||
<el-option :value="2" label="每月一次暴露,完全意外" />
|
|
||||||
<el-option :value="1" label="每年几次暴露" />
|
|
||||||
<el-option :value="0.5" label="非常罕见暴露" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="分值">
|
|
||||||
{{ form.EXPOSURE }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="一旦发生事故可能造成的后果" prop="CONSEQUENCE">
|
|
||||||
<el-select v-model="form.CONSEQUENCE">
|
|
||||||
<el-option :value="100" label="10人以上死亡" />
|
|
||||||
<el-option :value="40" label="3~9人死亡" />
|
|
||||||
<el-option :value="15" label="1~2人死亡" />
|
|
||||||
<el-option :value="7" label="严重" />
|
|
||||||
<el-option :value="3" label="重大,伤残" />
|
|
||||||
<el-option :value="1" label="引人注意" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="分值">
|
|
||||||
{{ form.CONSEQUENCE }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="风险分级" prop="LEVEL_NAME">
|
|
||||||
{{ form.LEVEL_NAME }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="总分值" prop="DANGER">
|
|
||||||
{{ form.DANGER }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控措施" prop="MEASURES">
|
|
||||||
<el-input
|
|
||||||
v-model="form.MEASURES"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{
|
|
||||||
minRows: 3,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="事故类型" prop="ACCIDENTS">
|
|
||||||
<el-select v-model="form.ACCIDENTS" multiple>
|
|
||||||
<el-option
|
|
||||||
v-for="item in accidentTypeList"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="应急处置措施" prop="EME_MEASURES">
|
|
||||||
<el-input
|
|
||||||
v-model="form.EME_MEASURES"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{
|
|
||||||
minRows: 3,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="fnClose">取消</el-button>
|
|
||||||
<el-button type="primary" @click="fnSubmit"> 确定 </el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, watch } from "vue";
|
|
||||||
import { useVModels } from "@vueuse/core";
|
|
||||||
import { debounce } from "throttle-debounce";
|
|
||||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
import { layoutFnGetAccidentType } from "@/assets/js/data_dictionary.js";
|
|
||||||
import {
|
|
||||||
setIdentifyingPartsRiskAdd,
|
|
||||||
setIdentifyingPartsRiskEdit,
|
|
||||||
} from "@/request/risk_control.js";
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
visible: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
type: Object,
|
|
||||||
required: true,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
info: {
|
|
||||||
type: Object,
|
|
||||||
required: true,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
id: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
time: {
|
|
||||||
type: Number,
|
|
||||||
required: true,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
|
||||||
const { visible, form } = useVModels(props, emits);
|
|
||||||
const rules = {
|
|
||||||
USER_ID: [{ required: true, message: "管控责任人不能为空", trigger: "blur" }],
|
|
||||||
RISK_DESCR: [
|
|
||||||
{ required: true, message: "存在风险不能为空", trigger: "blur" },
|
|
||||||
],
|
|
||||||
LIKELIHOOD: [
|
|
||||||
{ required: true, message: "事故发生的可能性不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
EXPOSURE: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "人员暴露于危险环境中的频繁程度不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
CONSEQUENCE: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "一旦发生事故可能造成的后果不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
LEVEL_NAME: [
|
|
||||||
{ required: true, message: "风险分级不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
MEASURES: [{ required: true, message: "管控措施不能为空", trigger: "blur" }],
|
|
||||||
EME_MEASURES: [
|
|
||||||
{ required: true, message: "应急处置措施不能为空", trigger: "blur" },
|
|
||||||
],
|
|
||||||
ACCIDENTS: [
|
|
||||||
{ required: true, message: "事故类型不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
const formRef = ref(null);
|
|
||||||
const accidentTypeList = await layoutFnGetAccidentType();
|
|
||||||
const fnGetLevelName = (LIKELIHOOD, EXPOSURE, CONSEQUENCE) => {
|
|
||||||
const DANGER = (LIKELIHOOD * EXPOSURE * CONSEQUENCE).toFixed(2);
|
|
||||||
if (DANGER > 320) {
|
|
||||||
form.value.LEVELID = "levelA";
|
|
||||||
form.value.LEVEL_NAME = "重大风险/A级";
|
|
||||||
} else if (DANGER > 160) {
|
|
||||||
form.value.LEVELID = "levelB";
|
|
||||||
form.value.LEVEL_NAME = "较大风险/B级";
|
|
||||||
} else if (DANGER > 70) {
|
|
||||||
form.value.LEVELID = "levelC";
|
|
||||||
form.value.LEVEL_NAME = "一般风险/C级";
|
|
||||||
} else {
|
|
||||||
form.value.LEVELID = "levelD";
|
|
||||||
form.value.LEVEL_NAME = "低风险/D级";
|
|
||||||
}
|
|
||||||
form.value.DANGER = DANGER;
|
|
||||||
};
|
|
||||||
watch(
|
|
||||||
[
|
|
||||||
() => props.form.LIKELIHOOD,
|
|
||||||
() => props.form.EXPOSURE,
|
|
||||||
() => props.form.CONSEQUENCE,
|
|
||||||
],
|
|
||||||
([LIKELIHOOD, EXPOSURE, CONSEQUENCE]) => {
|
|
||||||
if (!LIKELIHOOD || !EXPOSURE || !CONSEQUENCE) return;
|
|
||||||
fnGetLevelName(LIKELIHOOD, EXPOSURE, CONSEQUENCE);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
const fnClose = () => {
|
|
||||||
formRef.value.resetFields();
|
|
||||||
visible.value = false;
|
|
||||||
};
|
|
||||||
const fnSubmit = debounce(
|
|
||||||
1000,
|
|
||||||
async () => {
|
|
||||||
await useFormValidate(formRef);
|
|
||||||
const ACCIDENTS_NAME = accidentTypeList.value
|
|
||||||
.filter((item) => form.value.ACCIDENTS.includes(item.BIANMA))
|
|
||||||
.map((item) => item.NAME)
|
|
||||||
.join(",");
|
|
||||||
const params = {
|
|
||||||
...form.value,
|
|
||||||
RISK_UNIT_ID: props.info.RISK_UNIT_ID,
|
|
||||||
DEPARTMENT_ID: props.info.DEPARTMENT_ID,
|
|
||||||
IDENTIFICATION_ID: props.id,
|
|
||||||
CHECK_CONTENT: form.value.MEASURES,
|
|
||||||
ACCIDENTS: form.value.ACCIDENTS.join(","),
|
|
||||||
ACCIDENTS_NAME,
|
|
||||||
SETUPTIME: props.time,
|
|
||||||
TYPE: props.type,
|
|
||||||
};
|
|
||||||
if (!props.type) await setIdentifyingPartsRiskAdd(params);
|
|
||||||
else await setIdentifyingPartsRiskEdit(params);
|
|
||||||
ElMessage.success("操作成功");
|
|
||||||
fnClose();
|
|
||||||
emits("get-data");
|
|
||||||
},
|
|
||||||
{ atBegin: true }
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="visible" :title="title" :before-close="fnClose">
|
||||||
|
<layout-risk-add v-model:form="form" :info="info" ref="riskAddRef" />
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="fnClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="fnSubmit"> 确定 </el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { useVModels } from "@vueuse/core";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import {
|
||||||
|
setIdentifyingPartsRiskAdd,
|
||||||
|
setIdentifyingPartsRiskEdit,
|
||||||
|
} from "@/request/risk_control.js";
|
||||||
|
import LayoutRiskAdd from "@/components/risk_add/index.vue";
|
||||||
|
import { ref } from "vue";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
time: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
||||||
|
const { visible, form } = useVModels(props, emits);
|
||||||
|
const riskAddRef = ref(null);
|
||||||
|
const fnClose = () => {
|
||||||
|
riskAddRef.value.reset();
|
||||||
|
visible.value = false;
|
||||||
|
};
|
||||||
|
const fnSubmit = debounce(
|
||||||
|
1000,
|
||||||
|
async () => {
|
||||||
|
await riskAddRef.value.formValidate();
|
||||||
|
const params = {
|
||||||
|
...form.value,
|
||||||
|
RISK_UNIT_ID: props.info.RISK_UNIT_ID,
|
||||||
|
DEPARTMENT_ID: props.info.DEPARTMENT_ID,
|
||||||
|
IDENTIFICATION_ID: props.id,
|
||||||
|
CHECK_CONTENT: form.value.MEASURES,
|
||||||
|
ACCIDENTS: form.value.ACCIDENTS.join(","),
|
||||||
|
ACCIDENTS_NAME: riskAddRef.value.accidentsName(),
|
||||||
|
SETUPTIME: props.time,
|
||||||
|
TYPE: props.type,
|
||||||
|
};
|
||||||
|
if (!props.type) await setIdentifyingPartsRiskAdd(params);
|
||||||
|
else await setIdentifyingPartsRiskEdit(params);
|
||||||
|
ElMessage.success("操作成功");
|
||||||
|
fnClose();
|
||||||
|
emits("get-data");
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
|
@ -89,7 +89,7 @@
|
||||||
<div class="tc mt-10">
|
<div class="tc mt-10">
|
||||||
<el-button type="primary" @click="fnSubmit">保存</el-button>
|
<el-button type="primary" @click="fnSubmit">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
<add-risk
|
<risk-add
|
||||||
v-model:visible="data.addDialog.visible"
|
v-model:visible="data.addDialog.visible"
|
||||||
v-model:form="data.addDialog.form"
|
v-model:form="data.addDialog.form"
|
||||||
:type="data.addDialog.type"
|
:type="data.addDialog.type"
|
||||||
|
@ -112,7 +112,7 @@ import {
|
||||||
getIdentifyingPartsRiskView3,
|
getIdentifyingPartsRiskView3,
|
||||||
} from "@/request/risk_control.js";
|
} from "@/request/risk_control.js";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import AddRisk from "./components/add_risk.vue";
|
import RiskAdd from "./components/risk_add.vue";
|
||||||
import { debounce } from "throttle-debounce";
|
import { debounce } from "throttle-debounce";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
|
|
|
@ -4,194 +4,7 @@
|
||||||
:title="title ? title : type === 'add' ? '新增' : '修改'"
|
:title="title ? title : type === 'add' ? '新增' : '修改'"
|
||||||
:before-close="fnClose"
|
:before-close="fnClose"
|
||||||
>
|
>
|
||||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="240px">
|
<layout-risk-add v-model:form="form" :control="control" ref="riskAddRef" />
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控部门" prop="DEPARTMENT_ID">
|
|
||||||
<layout-department
|
|
||||||
v-model="form.DEPARTMENT_ID"
|
|
||||||
@update:model-value="fnDepartmentChange"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控责任人" prop="USER_ID">
|
|
||||||
<el-input v-model="form.USER_ID" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="风险点(单元)" prop="RISK_UNIT_ID">
|
|
||||||
<el-select v-model="form.RISK_UNIT_ID" @change="fnRiskUnitChange">
|
|
||||||
<el-option
|
|
||||||
v-for="item in unitList"
|
|
||||||
:key="item.RISKUNIT_ID"
|
|
||||||
:label="item.DEPT_NAME + '-' + item.RISKUNITNAME"
|
|
||||||
:value="item.RISKUNIT_ID"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="辨识部位" prop="IDENTIFICATION_ID">
|
|
||||||
<el-select v-model="form.IDENTIFICATION_ID">
|
|
||||||
<el-option
|
|
||||||
v-for="item in partsList"
|
|
||||||
:key="item.IDENTIFICATIONPARTS_ID"
|
|
||||||
:label="item.PARTSNAME"
|
|
||||||
:value="item.IDENTIFICATIONPARTS_ID"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="存在风险" prop="RISK_DESCR">
|
|
||||||
<el-input
|
|
||||||
v-model="form.RISK_DESCR"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{
|
|
||||||
minRows: 3,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="事故发生的可能性" prop="LIKELIHOOD">
|
|
||||||
<el-select v-model="form.LIKELIHOOD">
|
|
||||||
<el-option :value="10" label="完全可以预料" />
|
|
||||||
<el-option :value="6" label="相当可能" />
|
|
||||||
<el-option :value="3" label="可能,但不经常" />
|
|
||||||
<el-option :value="1" label="可能性小,完全意外" />
|
|
||||||
<el-option :value="0.5" label="很不可能,可以设想" />
|
|
||||||
<el-option :value="0.2" label="极不可能" />
|
|
||||||
<el-option :value="0.1" label="实际不可能" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="分值">
|
|
||||||
{{ form.LIKELIHOOD }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="人员暴露于危险环境中的频繁程度" prop="EXPOSURE">
|
|
||||||
<el-select v-model="form.EXPOSURE">
|
|
||||||
<el-option :value="10" label="连续暴露" />
|
|
||||||
<el-option :value="6" label="每天工作时间内暴露" />
|
|
||||||
<el-option :value="3" label="每周一次或偶然暴露" />
|
|
||||||
<el-option :value="2" label="每月一次暴露,完全意外" />
|
|
||||||
<el-option :value="1" label="每年几次暴露" />
|
|
||||||
<el-option :value="0.5" label="非常罕见暴露" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="分值">
|
|
||||||
{{ form.EXPOSURE }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="一旦发生事故可能造成的后果" prop="CONSEQUENCE">
|
|
||||||
<el-select v-model="form.CONSEQUENCE">
|
|
||||||
<el-option :value="100" label="10人以上死亡" />
|
|
||||||
<el-option :value="40" label="3~9人死亡" />
|
|
||||||
<el-option :value="15" label="1~2人死亡" />
|
|
||||||
<el-option :value="7" label="严重" />
|
|
||||||
<el-option :value="3" label="重大,伤残" />
|
|
||||||
<el-option :value="1" label="引人注意" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="分值">
|
|
||||||
{{ form.CONSEQUENCE }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="风险分级" prop="LEVEL_NAME">
|
|
||||||
{{ form.LEVEL_NAME }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="总分值" prop="DANGER">
|
|
||||||
{{ form.DANGER }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控措施" prop="MEASURES">
|
|
||||||
<el-input
|
|
||||||
v-model="form.MEASURES"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{
|
|
||||||
minRows: 3,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="事故类型" prop="ACCIDENTS">
|
|
||||||
<el-select v-model="form.ACCIDENTS" multiple>
|
|
||||||
<el-option
|
|
||||||
v-for="item in accidentTypeList"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="应急处置措施" prop="EME_MEASURES">
|
|
||||||
<el-input
|
|
||||||
v-model="form.EME_MEASURES"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{
|
|
||||||
minRows: 3,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<template v-if="control">
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控措施分类1" prop="MANAGEMENT_CONTROL_ONE">
|
|
||||||
<el-select
|
|
||||||
v-model="form.MANAGEMENT_CONTROL_ONE"
|
|
||||||
@change="form.MANAGEMENT_CONTROL_TWO = ''"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in controlList1"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控措施分类2" prop="MANAGEMENT_CONTROL_TWO">
|
|
||||||
<el-select v-model="form.MANAGEMENT_CONTROL_TWO">
|
|
||||||
<el-option
|
|
||||||
v-for="item in controlList2"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="管控措施分类3" prop="MANAGEMENT_CONTROL_THREE">
|
|
||||||
<el-input
|
|
||||||
v-model="form.MANAGEMENT_CONTROL_THREE"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{
|
|
||||||
minRows: 3,
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="fnClose">取消</el-button>
|
<el-button @click="fnClose">取消</el-button>
|
||||||
<el-button type="primary" @click="fnSubmit"> 确定 </el-button>
|
<el-button type="primary" @click="fnSubmit"> 确定 </el-button>
|
||||||
|
@ -200,23 +13,15 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, watchEffect } from "vue";
|
import { ref } from "vue";
|
||||||
import { useVModels } from "@vueuse/core";
|
import { useVModels } from "@vueuse/core";
|
||||||
import { debounce } from "throttle-debounce";
|
import { debounce } from "throttle-debounce";
|
||||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import {
|
import {
|
||||||
layoutFnGetAccidentType,
|
|
||||||
layoutFnGetControlMeasures1,
|
|
||||||
layoutFnGetControlMeasures2,
|
|
||||||
} from "@/assets/js/data_dictionary.js";
|
|
||||||
import {
|
|
||||||
getIdentifyingPartsListAll,
|
|
||||||
getRiskPointListAllById,
|
|
||||||
setRiskControlLedgerAdd,
|
setRiskControlLedgerAdd,
|
||||||
setRiskControlLedgerEdit,
|
setRiskControlLedgerEdit,
|
||||||
} from "@/request/risk_control.js";
|
} from "@/request/risk_control.js";
|
||||||
import LayoutDepartment from "@/components/department/index.vue";
|
import LayoutRiskAdd from "@/components/risk_add/index.vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
|
@ -236,7 +41,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
control: {
|
control: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: false,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -245,141 +50,20 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
||||||
const { visible, form } = useVModels(props, emits);
|
const { visible, form } = useVModels(props, emits);
|
||||||
const rules = {
|
const riskAddRef = ref(null);
|
||||||
DEPARTMENT_ID: [
|
|
||||||
{ required: true, message: "部门不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
USER_ID: [{ required: true, message: "管控责任人不能为空", trigger: "blur" }],
|
|
||||||
RISK_UNIT_ID: [
|
|
||||||
{ required: true, message: "风险点(单元)不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
IDENTIFICATION_ID: [
|
|
||||||
{ required: true, message: "辨识部位不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
RISK_DESCR: [
|
|
||||||
{ required: true, message: "存在风险不能为空", trigger: "blur" },
|
|
||||||
],
|
|
||||||
LIKELIHOOD: [
|
|
||||||
{ required: true, message: "事故发生的可能性不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
EXPOSURE: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "人员暴露于危险环境中的频繁程度不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
CONSEQUENCE: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "一旦发生事故可能造成的后果不能为空",
|
|
||||||
trigger: "change",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
LEVELID: [{ required: true, message: "风险分级不能为空", trigger: "blur" }],
|
|
||||||
MEASURES: [{ required: true, message: "管控措施不能为空", trigger: "blur" }],
|
|
||||||
EME_MEASURES: [
|
|
||||||
{ required: true, message: "应急处置措施不能为空", trigger: "blur" },
|
|
||||||
],
|
|
||||||
ACCIDENTS: [
|
|
||||||
{ required: true, message: "事故类型不能为空", trigger: "change" },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
const formRef = ref(null);
|
|
||||||
const unitList = ref([]);
|
|
||||||
const partsList = ref([]);
|
|
||||||
const controlList2 = ref([]);
|
|
||||||
const controlList1 = await layoutFnGetControlMeasures1();
|
|
||||||
const controlList2All = await layoutFnGetControlMeasures2();
|
|
||||||
const fnGetUnitList = async () => {
|
|
||||||
const resData = await getRiskPointListAllById({
|
|
||||||
DEPARTMENT_ID: form.value.DEPARTMENT_ID,
|
|
||||||
});
|
|
||||||
unitList.value = resData.unitList;
|
|
||||||
};
|
|
||||||
const fnGetPartsList = async () => {
|
|
||||||
const resData = await getIdentifyingPartsListAll({
|
|
||||||
RISK_UNIT_ID: form.value.RISK_UNIT_ID,
|
|
||||||
});
|
|
||||||
partsList.value = resData.partsList;
|
|
||||||
};
|
|
||||||
const fnDepartmentChange = () => {
|
|
||||||
form.value.RISK_UNIT_ID = "";
|
|
||||||
form.value.IDENTIFICATION_ID = "";
|
|
||||||
unitList.value = [];
|
|
||||||
partsList.value = [];
|
|
||||||
};
|
|
||||||
const fnRiskUnitChange = () => {
|
|
||||||
form.value.IDENTIFICATION_ID = "";
|
|
||||||
partsList.value = [];
|
|
||||||
};
|
|
||||||
const accidentTypeList = await layoutFnGetAccidentType();
|
|
||||||
const fnGetLevelName = (LIKELIHOOD, EXPOSURE, CONSEQUENCE) => {
|
|
||||||
const DANGER = (LIKELIHOOD * EXPOSURE * CONSEQUENCE).toFixed(2);
|
|
||||||
if (DANGER > 320) {
|
|
||||||
form.value.LEVELID = "levelA";
|
|
||||||
form.value.LEVEL_NAME = "重大风险/A级";
|
|
||||||
} else if (DANGER > 160) {
|
|
||||||
form.value.LEVELID = "levelB";
|
|
||||||
form.value.LEVEL_NAME = "较大风险/B级";
|
|
||||||
} else if (DANGER > 70) {
|
|
||||||
form.value.LEVELID = "levelC";
|
|
||||||
form.value.LEVEL_NAME = "一般风险/C级";
|
|
||||||
} else {
|
|
||||||
form.value.LEVELID = "levelD";
|
|
||||||
form.value.LEVEL_NAME = "低风险/D级";
|
|
||||||
}
|
|
||||||
form.value.DANGER = DANGER;
|
|
||||||
};
|
|
||||||
watch(
|
|
||||||
[
|
|
||||||
() => props.form.LIKELIHOOD,
|
|
||||||
() => props.form.EXPOSURE,
|
|
||||||
() => props.form.CONSEQUENCE,
|
|
||||||
],
|
|
||||||
([LIKELIHOOD, EXPOSURE, CONSEQUENCE]) => {
|
|
||||||
if (!LIKELIHOOD || !EXPOSURE || !CONSEQUENCE) return;
|
|
||||||
fnGetLevelName(LIKELIHOOD, EXPOSURE, CONSEQUENCE);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
watchEffect(() => {
|
|
||||||
if (form.value.DEPARTMENT_ID) fnGetUnitList();
|
|
||||||
if (form.value.RISK_UNIT_ID) fnGetPartsList();
|
|
||||||
if (form.value.MANAGEMENT_CONTROL_ONE) fnControlList1Change();
|
|
||||||
});
|
|
||||||
const fnControlList1Change = () => {
|
|
||||||
controlList2.value = [];
|
|
||||||
const id = form.value.MANAGEMENT_CONTROL_ONE;
|
|
||||||
let BZ = "";
|
|
||||||
for (let i = 0; i < controlList1.value.length; i++) {
|
|
||||||
if (controlList1.value[i].id === id) {
|
|
||||||
BZ = controlList1.value[i].BZ;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i = 0; i < controlList2All.value.length; i++) {
|
|
||||||
if (controlList2All.value[i].TBFIELD === BZ) {
|
|
||||||
controlList2.value.push(controlList2All.value[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const fnClose = () => {
|
const fnClose = () => {
|
||||||
formRef.value.resetFields();
|
riskAddRef.value.reset();
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
};
|
};
|
||||||
const fnSubmit = debounce(
|
const fnSubmit = debounce(
|
||||||
1000,
|
1000,
|
||||||
async () => {
|
async () => {
|
||||||
await useFormValidate(formRef);
|
await riskAddRef.value.formValidate();
|
||||||
const ACCIDENTS_NAME = accidentTypeList.value
|
|
||||||
.filter((item) => form.value.ACCIDENTS.includes(item.BIANMA))
|
|
||||||
.map((item) => item.NAME)
|
|
||||||
.join(",");
|
|
||||||
const params = {
|
const params = {
|
||||||
...form.value,
|
...form.value,
|
||||||
CHECK_CONTENT: form.value.MEASURES,
|
CHECK_CONTENT: form.value.MEASURES,
|
||||||
ACCIDENTS: form.value.ACCIDENTS.join(","),
|
ACCIDENTS: form.value.ACCIDENTS.join(","),
|
||||||
ACCIDENTS_NAME,
|
ACCIDENTS_NAME: riskAddRef.value.accidentsName(),
|
||||||
};
|
};
|
||||||
let resData = {};
|
let resData = {};
|
||||||
if (props.type === "add") resData = await setRiskControlLedgerAdd(params);
|
if (props.type === "add") resData = await setRiskControlLedgerAdd(params);
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
<add
|
<add
|
||||||
v-model:visible="data.addOrEditDialog.visible"
|
v-model:visible="data.addOrEditDialog.visible"
|
||||||
v-model:form="data.addOrEditDialog.form"
|
v-model:form="data.addOrEditDialog.form"
|
||||||
|
control
|
||||||
:type="data.addOrEditDialog.type"
|
:type="data.addOrEditDialog.type"
|
||||||
@get-data="fnResetPaginationTransfer"
|
@get-data="fnResetPaginationTransfer"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue