From 4f53bd7e81853d361c9b5bd96589b58bdadd7d84 Mon Sep 17 00:00:00 2001 From: z Date: Mon, 15 Jan 2024 18:00:19 +0800 Subject: [PATCH] init --- src/assets/js/asyncRouter.js | 10 + src/assets/js/data_dictionary.js | 7 + src/components/risk_add/index.vue | 13 +- src/request/continuous_improvement.js | 13 ++ .../enterprise_report/index.vue | 7 + .../hazard_analysis/components/analysis.vue | 76 +++++++ .../hazard_analysis/index.vue | 51 ++++- .../risk_analysis/components/analysis.vue | 146 ++++++++++++++ .../risk_analysis/index.vue | 189 ++++++++++++++++++ .../inventory_management/add.vue | 4 +- .../rectification/rectification.vue | 2 +- 11 files changed, 512 insertions(+), 6 deletions(-) create mode 100644 src/request/continuous_improvement.js create mode 100644 src/views/continuous_improvement/enterprise_report/index.vue create mode 100644 src/views/continuous_improvement/hazard_analysis/components/analysis.vue create mode 100644 src/views/continuous_improvement/risk_analysis/components/analysis.vue create mode 100644 src/views/continuous_improvement/risk_analysis/index.vue diff --git a/src/assets/js/asyncRouter.js b/src/assets/js/asyncRouter.js index a39cdce..4550006 100644 --- a/src/assets/js/asyncRouter.js +++ b/src/assets/js/asyncRouter.js @@ -568,6 +568,16 @@ export default [ }, ], }, + { + path: "/continuous_improvement/risk_analysis", + meta: { title: "风险分析", isSubMenu: false }, + component: "continuous_improvement/risk_analysis/index", + }, + { + path: "/continuous_improvement/enterprise_report", + meta: { title: "企业报告", isSubMenu: false }, + component: "continuous_improvement/enterprise_report/index", + }, ], }, { diff --git a/src/assets/js/data_dictionary.js b/src/assets/js/data_dictionary.js index b72b135..ac1b35b 100644 --- a/src/assets/js/data_dictionary.js +++ b/src/assets/js/data_dictionary.js @@ -83,6 +83,13 @@ export const layoutFnGetRiskLevel = async () => { }); return ref(resData.list); }; +// 风险成因 +export const layoutFnGetRiskCauses = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "1bacbc4c1f6544718519c0d470dfeb62", + }); + return ref(resData.list); +}; // 部门级别 export const layoutFnGetDepartmentLevel = async () => { const resData = await getLevels({ diff --git a/src/components/risk_add/index.vue b/src/components/risk_add/index.vue index d3dba8c..f748067 100644 --- a/src/components/risk_add/index.vue +++ b/src/components/risk_add/index.vue @@ -1,5 +1,5 @@ + @@ -241,10 +242,14 @@ const props = defineProps({ type: Boolean, default: false, }, + rules: { + type: Object, + default: () => ({}), + }, }); const emits = defineEmits(["update:form"]); const form = useVModel(props, "form", emits); -const rules = { +const defineRules = { USER_ID: [{ required: true, message: "管控责任人不能为空", trigger: "blur" }], RISK_DESCR: [ { required: true, message: "存在风险不能为空", trigger: "blur" }, @@ -285,6 +290,7 @@ const rules = { IDENTIFICATION_ID: [ { required: true, message: "辨识部位不能为空", trigger: "change" }, ], + ...props.rules, }; const formRef = ref(null); const infoIsEmpty = ref(isEmpty(props.info)); @@ -317,6 +323,9 @@ watch( ([LIKELIHOOD, EXPOSURE, CONSEQUENCE]) => { if (!LIKELIHOOD || !EXPOSURE || !CONSEQUENCE) return; fnGetLevelName(LIKELIHOOD, EXPOSURE, CONSEQUENCE); + }, + { + immediate: true, } ); const fnGetUnitList = async () => { diff --git a/src/request/continuous_improvement.js b/src/request/continuous_improvement.js new file mode 100644 index 0000000..d2f509b --- /dev/null +++ b/src/request/continuous_improvement.js @@ -0,0 +1,13 @@ +import { post } from "@/request/axios.js"; + +export const setHazardAnalysisSubmit = (params) => + post("/riskpointanalysis/add", params); // 隐患分析提交 +export const getRiskAnalysisList = (params) => + post("/riskpointanalysis/list", params); // 风险分析列表 +export const setRiskAnalysisRepulse = (params) => + post("/riskpointanalysis/delete", params); // 风险分析打回 +export const setRiskAnalysisAdopt = (params) => + post("/riskpointanalysis/apply", params); // 风险分析通过 +// 企业报告 start + +// 企业报告 end diff --git a/src/views/continuous_improvement/enterprise_report/index.vue b/src/views/continuous_improvement/enterprise_report/index.vue new file mode 100644 index 0000000..43a96e1 --- /dev/null +++ b/src/views/continuous_improvement/enterprise_report/index.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/src/views/continuous_improvement/hazard_analysis/components/analysis.vue b/src/views/continuous_improvement/hazard_analysis/components/analysis.vue new file mode 100644 index 0000000..3afcaa7 --- /dev/null +++ b/src/views/continuous_improvement/hazard_analysis/components/analysis.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/views/continuous_improvement/hazard_analysis/index.vue b/src/views/continuous_improvement/hazard_analysis/index.vue index 4d8ea3e..b15039a 100644 --- a/src/views/continuous_improvement/hazard_analysis/index.vue +++ b/src/views/continuous_improvement/hazard_analysis/index.vue @@ -124,11 +124,18 @@ > 查看 - 分析 + + 分析 + + @@ -139,6 +146,9 @@ import useListData from "@/assets/js/useListData.js"; import LayoutDepartment from "@/components/department/index.vue"; import { getHiddenDangerList } from "@/request/hidden_danger_government.js"; import { layoutFnGetHazardLevel } from "@/assets/js/data_dictionary.js"; +import { nextTick, reactive } from "vue"; +import Analysis from "./components/analysis.vue"; +import { getRiskControlLedgerView } from "@/request/risk_control.js"; const stateList = [ { NAME: "未整改", ID: "1" }, @@ -152,6 +162,27 @@ const { list, pagination, searchForm, fnGetData, fnResetPagination } = useListData(getHiddenDangerList, { otherParams: { STATE: 4, DISPOSESTATE: "-1", ANALYSIS: 1 }, }); +const data = reactive({ + analysisDialog: { + visible: false, + form: { + DEPARTMENT_ID: "", + USER_ID: "", + RISK_UNIT_ID: "", + IDENTIFICATION_ID: "", + RISK_DESCR: "", + LIKELIHOOD: "", + EXPOSURE: "", + CONSEQUENCE: "", + LEVEL_NAME: "", + DANGER: "", + MEASURES: "", + ACCIDENTS: [], + EME_MEASURES: "", + IS_NEW: 1, + }, + }, +}); const fnGetDataTransfer = () => { fnGetData({ STARTTIME: searchForm.value.dates?.[0], @@ -167,6 +198,24 @@ const fnResetPaginationTransfer = () => { }); }; const hazardLevelList = await layoutFnGetHazardLevel(); +const fnAnalysis = async ({ + HIDDEN_ID, + RISKPOINT_ID, + HIDDENDESCR, + RECTIFYDESCR, +}) => { + data.analysisDialog.visible = true; + await nextTick(); + if (RISKPOINT_ID) { + const resData = await getRiskControlLedgerView({ RISKPOINT_ID }); + resData.pd.IS_NEW = 0; + data.analysisDialog.form = resData.pd; + data.analysisDialog.form.ACCIDENTS = resData.pd.ACCIDENTS.split(","); + data.analysisDialog.form.RISK_DESCR += HIDDENDESCR; + data.analysisDialog.form.MEASURES += RECTIFYDESCR; + } + data.analysisDialog.form.HIDDEN_ID = HIDDEN_ID; +}; diff --git a/src/views/continuous_improvement/risk_analysis/components/analysis.vue b/src/views/continuous_improvement/risk_analysis/components/analysis.vue new file mode 100644 index 0000000..b4e9050 --- /dev/null +++ b/src/views/continuous_improvement/risk_analysis/components/analysis.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/src/views/continuous_improvement/risk_analysis/index.vue b/src/views/continuous_improvement/risk_analysis/index.vue new file mode 100644 index 0000000..6bb2d23 --- /dev/null +++ b/src/views/continuous_improvement/risk_analysis/index.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/src/views/hazard_investigation/inventory_management/add.vue b/src/views/hazard_investigation/inventory_management/add.vue index 0ab7db4..95bcd9e 100644 --- a/src/views/hazard_investigation/inventory_management/add.vue +++ b/src/views/hazard_investigation/inventory_management/add.vue @@ -343,7 +343,7 @@ const fnGetData = async () => { data.form = resData.pd; data.form.dates = [resData.pd.START_DATE, resData.pd.END_DATE]; data.list = resData.varList; - data.listAll = resData.varList; + data.listAll = [...resData.varList]; }; fnGetData(); const fnGetInspectionItems = async () => { @@ -389,7 +389,7 @@ const fnGetDataFilter = () => { item.USERNAME?.indexOf(keyword) > -1 ); } else { - data.list = data.listAll; + data.list = [...data.listAll]; } fnTableSelection(); }; diff --git a/src/views/hidden_danger_government/rectification/rectification.vue b/src/views/hidden_danger_government/rectification/rectification.vue index a5b539d..c613075 100644 --- a/src/views/hidden_danger_government/rectification/rectification.vue +++ b/src/views/hidden_danger_government/rectification/rectification.vue @@ -476,7 +476,7 @@ watch( } ); const fnChoice = (item) => { - data.RECTIFYDESCR = item.RECTIFYDESCR; + data.form.RECTIFYDESCR = item.RECTIFYDESCR; }; const fnSubmit = debounce( 1000,